Re: Hanging program and call stack.
- From: "Oleg Starodumov" <com-dot-debuginfo-at-oleg>
- Date: Tue, 23 May 2006 13:31:24 +0300
In addition to others...
Is the call-stack reliable when breaking a process? The reason for
asking is that we experience problems with a C++ program that hangs for
some unknown reason. We start the process from Java and the program
very quickly becomes irresponsive. When we attach the program via the
debugger from the 7.1 IDE and break the program, we are told that the
program is soft broken, but the back trace does not seem correct - it
is at a return statement in an innocent looking function (no - there
are no destructors that should be run).
Reliability of the call stack can depend on the approach used by the debugger
to break into the process in case of deadlock. There are some approaches
where the debugger attempts to change the current instruction pointer,
and in some circumstances it probably can lead to incorrect call stack
(though I don't know whether VS2003 debugger uses such techniques).
Because of this, IMO it is better to use a debugger that supports non-invasive
mode of operation (that is, simply suspends all threads in the target) -
WinDbg/CDB or ADPlus in hang mode, as Livven suggested.
Absence of symbols for some modules can also affect the quality of
call stacks (again, WinDbg family offers better control over symbol loading
than VS2003).
After attaching the debugger, collect at least two dumps, one after another,
then use WinDbg to analyze call stacks (and compare them between the dumps,
to see if the process is really stuck, or if some threads are still running).
!runaway and !locks commands should usually be useful, you can
find some samples here:
http://www.debuginfo.com/articles/easywindbg.html#debugdeadlocks
Tracing also can be very effective when tracking down deadlocks.
Regards,
Oleg
[VC++ MVP http://www.debuginfo.com/]
.
- References:
- Hanging program and call stack.
- From: peter . koch . larsen
- Hanging program and call stack.
- Prev by Date: Re: Hanging program and call stack.
- Next by Date: Re: Hanging program and call stack.(solved)
- Previous by thread: Re: Hanging program and call stack.
- Next by thread: Re: Hanging program and call stack.(solved)
- Index(es):
Relevant Pages
|