From: Paul Pluzhnikov <ppluzhnikov@google.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>,
Eli Zaretskii <eliz@gnu.org>,
brobecker@adacore.com, teawater@gmail.com,
tromey@redhat.com, bauerman@br.ibm.com,
gdb-patches@sourceware.org
Subject: Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1
Date: Fri, 01 May 2009 17:02:00 -0000 [thread overview]
Message-ID: <8ac60eac0905011002r73ced485j5643f9de3a7b0d01@mail.gmail.com> (raw)
In-Reply-To: <20090501164905.GA32287@caradoc.them.org>
On Fri, May 1, 2009 at 9:49 AM, Daniel Jacobowitz <drow@false.org> wrote:
> Have you tried this?
Yes. It's slightly better than what I said: GDB knows about the original
(main) thread, and the thread that crashed, but knows no other threads.
Here is a sample session.
$ cat thread-crash.c
#include <pthread.h>
void *fn(void *p)
{
if (p) {
char *cp = 0;
cp[1] = 'a'; /* crash! */
}
sleep(60);
return 0;
}
#define N 5
int main()
{
pthread_t tid[N];
int i;
for (i = 0; i < N; ++i)
pthread_create(tid+i, 0, fn, i == N-1 ? &i : 0);
for (i = 0; i < N; ++i)
pthread_join(tid[i], 0);
return 0;
}
First with a patched gdb:
$ /home/ppluzhnikov/Archive/sourceware.org/gdb/build/gdb/gdb
./thread-crash-64-v10
GNU gdb (GDB) 6.8.50.20090430-cvs
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
(gdb) r
[Thread debugging using libthread_db enabled]
[New Thread 0x40800950 (LWP 32344)]
[New Thread 0x41001950 (LWP 32345)]
[New Thread 0x41802950 (LWP 32346)]
[New Thread 0x42003950 (LWP 32347)]
[New Thread 0x42804950 (LWP 32348)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x42804950 (LWP 32348)]
0x00000000004005ab in fn (p=0x7fffffffda0c) at thread-crash.c:7
7 cp[1] = 'a'; /* crash! */
(gdb) inf thread
* 6 Thread 0x42804950 (LWP 32348) 0x00000000004005ab in fn
(p=0x7fffffffda0c) at thread-crash.c:7
5 Thread 0x42003950 (LWP 32347) 0x00007ffff78ffb81 in nanosleep ()
from /lib/libc.so.6
4 Thread 0x41802950 (LWP 32346) 0x00007ffff78ffb81 in nanosleep ()
from /lib/libc.so.6
3 Thread 0x41001950 (LWP 32345) 0x00007ffff78ffb81 in nanosleep ()
from /lib/libc.so.6
2 Thread 0x40800950 (LWP 32344) 0x00007ffff78ffb81 in nanosleep ()
from /lib/libc.so.6
1 Thread 0x7ffff7fda6e0 (LWP 32341) 0x00007ffff7bd127f in
__lll_unlock_wake_private () from /lib/libpthread.so.0
(gdb) q
And now with current CVS Head:
$ /home/ppluzhnikov/Archive/sourceware.org/gdb/build2/gdb/gdb
./thread-crash-64-v10
GNU gdb (GDB) 6.8.50.20090501-cvs
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
(gdb) r
warning: Cannot initialize thread debugging library: versions of
libpthread and libthread_db do not match
warning: Cannot initialize thread debugging library: versions of
libpthread and libthread_db do not match
[New LWP 32375]
Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 32375]
0x00000000004005ab in fn (p=0x7fffffffda0c) at thread-crash.c:7
7 cp[1] = 'a'; /* crash! */
(gdb) inf thread
* 2 LWP 32375 0x00000000004005ab in fn (p=0x7fffffffda0c) at thread-crash.c:7
1 LWP 32368 0x00007ffff7939b01 in clone () from /lib/libc.so.6
--
Paul Pluzhnikov
next prev parent reply other threads:[~2009-05-01 17:02 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-06 20:39 Paul Pluzhnikov
2009-04-08 21:23 ` Thiago Jung Bauermann
2009-04-10 19:06 ` Paul Pluzhnikov
2009-04-16 17:56 ` Tom Tromey
2009-04-16 18:22 ` Eli Zaretskii
2009-04-17 19:13 ` Paul Pluzhnikov
2009-04-18 17:01 ` Eli Zaretskii
2009-04-19 14:59 ` Thiago Jung Bauermann
2009-04-19 18:03 ` Paul Pluzhnikov
2009-04-20 13:18 ` Daniel Jacobowitz
2009-04-20 16:47 ` Paul Pluzhnikov
2009-04-20 17:02 ` Daniel Jacobowitz
2009-04-20 17:20 ` Paul Pluzhnikov
2009-04-20 18:04 ` Daniel Jacobowitz
2009-04-20 19:09 ` Paul Pluzhnikov
2009-04-22 17:25 ` Daniel Jacobowitz
2009-04-23 1:10 ` Paul Pluzhnikov
2009-04-23 1:34 ` Tom Tromey
2009-04-23 6:28 ` Hui Zhu
2009-04-23 6:21 ` Hui Zhu
2009-04-23 7:01 ` Paul Pluzhnikov
2009-04-23 8:06 ` Hui Zhu
2009-04-23 11:32 ` Hui Zhu
2009-04-29 20:30 ` Paul Pluzhnikov
2009-04-30 5:38 ` Hui Zhu
2009-04-30 18:56 ` Joel Brobecker
2009-04-30 19:11 ` Paul Pluzhnikov
2009-04-30 22:12 ` Doug Evans
2009-04-30 23:18 ` Paul Pluzhnikov
2009-05-01 0:20 ` Paul Pluzhnikov
2009-05-11 13:13 ` Pedro Alves
2009-05-11 18:09 ` Paul Pluzhnikov
2009-05-11 21:09 ` Pedro Alves
2009-05-12 7:16 ` Hui Zhu
2009-05-12 16:42 ` Paul Pluzhnikov
2009-05-13 2:56 ` Hui Zhu
2009-05-13 3:29 ` Paul Pluzhnikov
2009-05-13 4:39 ` Hui Zhu
2009-05-15 14:37 ` Daniel Jacobowitz
2009-05-15 16:56 ` Paul Pluzhnikov
2009-05-01 7:21 ` Eli Zaretskii
2009-05-01 15:49 ` Paul Pluzhnikov
2009-05-01 16:49 ` Daniel Jacobowitz
2009-05-01 17:02 ` Paul Pluzhnikov [this message]
2009-05-01 17:11 ` Daniel Jacobowitz
2009-05-01 17:17 ` Pedro Alves
2009-05-01 18:53 ` Doug Evans
2009-05-04 0:07 ` Hui Zhu
2009-05-04 3:31 ` Paul Pluzhnikov
2009-05-05 2:54 ` Hui Zhu
2009-05-05 3:38 ` Joel Brobecker
2009-05-05 11:42 ` Hui Zhu
2009-05-11 11:34 ` Pedro Alves
2009-05-11 12:24 ` Joel Brobecker
2009-04-20 17:37 ` Paul Pluzhnikov
2009-04-20 18:46 ` Eli Zaretskii
2015-08-25 18:01 ` Jan Kratochvil
2015-08-25 18:14 ` Paul Pluzhnikov
2015-08-25 18:22 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8ac60eac0905011002r73ced485j5643f9de3a7b0d01@mail.gmail.com \
--to=ppluzhnikov@google.com \
--cc=bauerman@br.ibm.com \
--cc=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=teawater@gmail.com \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox