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: [PATCH] Simple fix+testcase invalid ptid struct after exec()


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


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