This is the mail archive of the gdb-patches@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: RFC: Fix crash on i386 (%gs-)threaded programs using execve(2)


Hi Daniel,

I am now copyright assignment compliant (as Red Hat employee).

The mail below was never replied; the patch still applies to the latest CVS.
Could you please review it?


Thanks,
Jan


On Thu, 15 Jun 2006 22:35:20 +0200, Jan Kratochvil wrote:
------------------------------------------------------------------------------

Hi Daniel,

[ regarding debugging of exec*(2) called from programs using -lpthread ]

On Wed, 14 Jun 2006 16:25:52 +0200, Daniel Jacobowitz wrote:
...
> Your problem combines two different issues:
> 
> - libthread_db doesn't do anything sensible at the beginning of
> execution, before libpthread is initialized.  I filed a bug in the
> glibc bugzilla about this with a possible patch.

http://sourceware.org/bugzilla/show_bug.cgi?id=2696

Still I do not see much a problem, gdb(1) just runs in non-threaded mode and
with my patch it properly drops back to the non-threaded mode after exec*(2).


> - gdb thinks threading is still active after an exec.
> 
> We already have a way to detect exec events: PTRACE_EVENT_EXEC. 
> Support for it is disabled, because it really doesn't work very well,

Does the rewritten patch look fine?  Why was follow_exec() enabled only for
HP-UX? (and in fact it would have to be enabled there by hand)

...
> Oh, and please don't add more tests to the testsuite which would spin
> forever if detached from GDB; we've already got a few and I'm convinced
> in hindsight that it was a mistake.  You only need it to exec once, so
> you could make it quietly exit the second time.

I did not understood the problem exactly; I dropped my test case as it is
already tested by the existing (originally HP-UX only) "gdb.base/foll-exec".


Thanks,
Jan

Attachment: gdb-cvs20060614-follow_exec.patch
Description: Text document

Attachment: gdb.sum.diff
Description: Text document


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