This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem debugging multi-threaded application


On 2008-01-21 19:35, Daniel Jacobowitz wrote:
> On Mon, Jan 21, 2008 at 07:26:37PM +0100, Arvid Brodin wrote:
>> If I invoke gdb under strace, i.e. 'strace -f -o strace-out.txt gdb
>> <my-program>'
> 
> Don't do that :-)  strace and gdb both use the ptrace interface; if
> you tell strace to follow children with -f, then it will win and
> gdb will not be able to debug the program it started.

That explains a lot. Thanks for the info!


>> I have no idea if this is a bug in gdb, if we do something bad in
>> our program, if it is a bug in nptl, or ...
> 
> It sounds sort of like a problem with job control and terminal groups,
> but I'm not sure I have enough to guess... can you run it and use the
> gdb "attach" command?

Actually, that was one of the first things I tried, and yes, that works fine. Sorry for not mentioning it before. I also found this old message regarding a similar symptom and foregrounding/backgrounding and SIGTTOU, which suggests commenting out the [New Thread ...] message. I tried that but it made no difference. I suspect that particular bug has been long fixed:

http://sourceware.org/ml/gdb/2004-03/msg00251.html

--
Arvid Brodin
Enea LCC


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]