* Possible deadlock when debugging with gdb
@ 2011-07-19 14:36 Jose Manuel Pulido
0 siblings, 0 replies; only message in thread
From: Jose Manuel Pulido @ 2011-07-19 14:36 UTC (permalink / raw)
To: gdb
Hello all. I'm using gdb 7.2, release version to debug a program
written in c++ and compiled with gcc 4.5.0 in a MinGW environment
under Windows XP SP3 32 bits.
This is how my debugging session goes on: I usually attach gdb to my
program when it's already running (gdb --pid xxxx), then gdb takes a
couple seconds to show the interactive prompt and I enter 'continue'
after (possibly) setting one or more breakpoints.
My program keeps running and if I enter ctrl+c in the gdb console,
sometimes not only gdb stop responding, but so does my program and
Windows explorers renders unable to launch any new window. I can't
even launch a task manager to kill gdb or my program. This, however,
doesn't happen always, but roughly in the 20% of my executions.
If I manage to kill my program's process when this happens, both gdb
and explorer regain their responsivity and gdb shows a lot of console
lines at once, but the first of them is the following one:
'warning: SuspendThread failed. (winerr 5)'
Online documentation on SuspendThread states that a deadlock condition
can occur if the thread being suspended owns a synchronization object.
My program is GUI based and has some worker threads that use mutexes
and system wide critical sections. Yet, I tried disabling every mutex
and critical section in my code, but that didn't work out.
The thing is I can debug other programs without any problem, and I've
used to be able to debug this one as well, but I fail to understand
what might be causing this. Reviewing the changes in my source code
during the last two months, or selectively disabling functionality,
but nothing of that helped.
I thank in advance to anyone that might read this and give a piece of advice.
Regards, Jose.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-07-19 14:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-19 14:36 Possible deadlock when debugging with gdb Jose Manuel Pulido
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).