This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Simple fix+testcase invalid ptid struct after exec()
- From: Daniel Jacobowitz <drow at false dot org>
- To: Jess Balint <jbalint at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 2 May 2008 10:14:55 -0400
- Subject: Re: [PATCH] Simple fix+testcase invalid ptid struct after exec()
- References: <20080425114059.GD3076@gumby.improvedideas.com>
On Fri, Apr 25, 2008 at 06:40:59AM -0500, Jess Balint wrote:
> Hi, if your program is threaded and calls exec() or a variant, a ptid
> will be created with lwp=0. Commands such as "info threads" will trigger
> an assertion. I've attached a simple fix and testcase for this. When
> running the testsuite, I am receiving 16 unexpected failures both before
> and after this fix, so I don't believe I've broken anything that has a
> proper test. :)
Whoops. Thanks for the patch.
Do you have an FSF copyright assignment through your employer? I
don't see your name listed individually. Unfortunately we can't
accept the testcase without an assignment, since it's large.
> Index: gdb/linux-thread-db.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/linux-thread-db.c,v
> retrieving revision 1.41
> diff -u -r1.41 linux-thread-db.c
> --- gdb/linux-thread-db.c 14 Apr 2008 14:02:23 -0000 1.41
> +++ gdb/linux-thread-db.c 25 Apr 2008 11:40:14 -0000
> @@ -837,7 +837,7 @@
> unpush_target (&thread_db_ops);
> using_thread_db = 0;
>
> - return pid_to_ptid (GET_PID (ptid));
> + return BUILD_LWP (GET_PID (ptid), GET_PID (ptid));
> }
It's probably historical that we do something complicated here but...
looks to me like this is just "return ptid;".
--
Daniel Jacobowitz
CodeSourcery