Sign in to follow this  
Ahmet

Starting exe with Windows Services

Recommended Posts

Ahmet    104
Hi;

I have a window service starts a program which produce report files. There is no problem when files are produced in my computer. But when I mapped a folder from my network to include files my program will produce, my program gives "debug asertion: map set iterator not dereferencable " exception.
I dont encounter same problem when tracing my code to produce to network folders.
Anyone have an idea what would be the cause of this problem?
I think it would be about network privileges but I am not sure. If is this problem comes from privileges how can I overcome this issue?

Regards.

Share this post


Link to post
Share on other sites
rip-off    10979
[quote]
Anyone have an idea what would be the cause of this problem?
[/quote]
It looks like the problem is a bug in your code - specifically you are using a std::map or std::set iterator incorrectly.

[quote]
I think it would be about network privileges but I am not sure.
[/quote]
It does not look to be the case. That said, once you fix this bug you might find privilege problems anyway.

[hr]

What is probably happening is the new mapping is causing a branch of your code to execute you haven't tested. A classic example might be you are testing a small number of files, but when you try it for "real" on a larger number you trigger some undefined behaviour.

I'd recommend copying all the files locally and seeing if you can still reproduce the issue. Also try attaching a debugger to the process, or starting it from a debugger.

Share this post


Link to post
Share on other sites
Ahmet    104
[quote]

I'd recommend copying all the files locally and seeing if you can still reproduce the issue. Also try attaching a debugger to the process, or starting it from a debugger.

[/quote]
I cant see my exe on process explorer of VS2008 because whenever it start I dont have enough time to select it for debug attaching.
I trigger windows service with changing database. Listener Windows service start my exe andsend parameters to it. I a few seconds I see the exception.
How can debug my code when started by window service?

Share this post


Link to post
Share on other sites
Ahmet    104
I found the problem, as you said it is about a case when occur on strange situation. I writed a line to sleep 30 seconds and attached the exe and waited to see results. At the end I see the problem it is about misuse of maps..
Thank you very much [url="http://www.gamedev.net/user/78572-rip-off/"][color="#284b72"]rip-off[/color][/url].
I use this site because I have always find the solution , there is great people ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this