Re: Process exits premature
- From: "boris" <noone@xxxxxxxxxxx>
- Date: Sun, 28 Jun 2009 01:55:17 -0700
"hd" <hd@xxxxxxxxxxx> wrote in message news:eSHPys19JHA.5780@xxxxxxxxxxxxxxxxxxxxxxx
(Since I always get very good insights and ideas in this group, I try againHi,
here. Forgive me if this is off topic. Thanks in advance!)
In an app are there two processes A and B. Both in C#, though B uses bunch
of modules of unmanaged code. A is a Windows service and B standalone
console app. A starts B.
The symptom is:
1. After A starts B, B SOMETIMES exits itself earlier.
Let's say B has main thread waiting for another thread which is a windows
callback function. In this callback function, the code is like:
CallbackFunction()
{
...
Statement 1
Log1
Statement 2
Log2
Statement 3
Log3
Statement 4
Log4
Statement 5 (end of the function)
}
The above statements have some disc access (file saving activities).
Logs indicate that sometimes the whole process B gets disappeared without
all the above statements executed, plus the main thread doesn't finished up
to the end either.
2. No exception, no event viewer log, no dump.
3. The end point within CallbackFunction() changes too, could be Log2, or
Log3, or Log4.
4. It only happens when B is started by A. It will not happen when running B
alone.
Any ideas of how to approach the problem?
Usual rules would apply.
You could try attaching debugger to B - I'm not sure how it works with managed code, but in case of un-managed code you could add:
DebugBreak();
- near place where execution starts and recompile. Once B is launched (by A) and DebugBreak() is reached, VS debugger will come up and you'll be able to step through code, inspect variables, etc. If you can reproduce the problem under debugger, everything is fine. If not, you might need to instrument your code: so that it writes strings into your custom logfile (or just use OutputDebugString() to send logging output to debug console, instead of logfile - DebugView.exe can be used to view messages sent to debug console).
Boris
.
- References:
- Process exits premature
- From: hd
- Process exits premature
- Prev by Date: Re: Memory consumption using a *lot* of dlls
- Next by Date: Re: Memory consumption using a *lot* of dlls
- Previous by thread: Re: Process exits premature
- Index(es):
Relevant Pages
|