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: Thread exit error : gdb7.2 in FreeBSD (built from ports)


Sure, 
I am running on FreeBSD, and they pull vanilla source and apply their
patches to it. In addition, I had written a patch on my own which is
removing an error check in get_current_frame on thread exit and running into
an issue later on. I'm disregarding the fatal errors in the previous post
and focusing on the "invalid thread" issue. With just the FreeBSD patches
applied on gdb7.2, I boot up my application and see the following:

=thread-created,id="60",group-id="i1"
~"[New Thread 803855740 (LWP 100223)]\n"
*running,thread-id="all"
=thread-created,id="61",group-id="i1"
~"[New Thread 82b055500 (LWP 100235)]\n"
*running,thread-id="all"
~"[Thread 82b055c00 (LWP 100221 FooTask) exited]\n"
=thread-exited,id="58",group-id="i1"
&"/tmp/.gdbinit:4: Error in sourced command file:\n"
&"Invalid selected thread.\n"
(gdb)
c
&"c\n"
~"Continuing.\n"
&"Cannot execute this command without a live selected thread.\n"
^error,msg="Cannot execute this command without a live selected thread."
(gdb)
c

Point being, I don't want to break into the debugger on an thread exit such
as this. This behavior is different than in 6.1.1 for FreeBSD.
See here:
http://lists.freebsd.org/pipermail/freebsd-ports-bugs/2011-May/211521.html

This is the bug.
Thanks!


Pedro Alves-10 wrote:
> 
> On Wednesday 14 September 2011 15:26:33, Jusctsch wrote:
>> 
>> Hello all,
>> I have been running into a particularly interesting issue.
>> When a thread exits in the application gdb is running, that exit doesn't
>> seem to propagate in some of the fields in gdb. In many cases, this will
>> end
>> up crashing gdb (failing a thread_info=NULL gdbassert).
>> 
>> [Thread 803855580 (LWP 100241 Foo) exited]
>> error: Invalid selected thread.
>> thread.c:583: internal-error: set_running: Asser                  tion
>> `tp->state_ != THREAD_EXITED' failed.
>> A problem internal to GDB has been detected,
>> further debugging may prove unreliable.
>> Quit this debugging session? (y or n) [answered                   Y;
>> input
>> not from terminal]
>> thread.c:583: internal-error: set_running: Asser                  tion
>> `tp->state_ != THREAD_EXITED' failed.
>> A problem internal to GDB has been detected,
>> further debugging may prove unreliable.
>> Create a core file of GDB? (y or n) [answered Y;                   input
>> not
>> from terminal]
>> 
>> Is this a symptom of FreeBSD and some libraries? 
> 
> It's a gdb bug.
> 
> We'd need more context to understand the problem.
> 
> You can debug gdb with gdb, and put a breakpoint on
> `error' to catch that "error:", for example.  Where's
> that coming from?  Sounds like your port has local
> changes compared to the pristine FSF version?
> 
>> Or is this a gross gdb issue?
> 
> -- 
> Pedro Alves
> 
> 

-- 
View this message in context: http://old.nabble.com/Thread-exit-error-%3A-gdb7.2-in-FreeBSD-%28built-from-ports%29-tp32463912p32465344.html
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.


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