This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [testsuite patch]#2 Fix PR threads/19422 regression + Guile regression [Re: [PATCH+doc] Fix PR threads/19422 - show which thread caused stop]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 22 Jan 2016 21:05:42 +0100
- Subject: Re: [testsuite patch]#2 Fix PR threads/19422 regression + Guile regression [Re: [PATCH+doc] Fix PR threads/19422 - show which thread caused stop]
- Authentication-results: sourceware.org; auth=none
- References: <1451950202-18024-1-git-send-email-palves at redhat dot com> <5697ABE8 dot 7060705 at redhat dot com> <20160122173020 dot GA5946 at host1 dot jankratochvil dot net> <20160122173100 dot GA5990 at host1 dot jankratochvil dot net> <56A276EB dot 1070208 at redhat dot com>
On Fri, 22 Jan 2016 19:37:31 +0100, Pedro Alves wrote:
> On 01/22/2016 05:31 PM, Jan Kratochvil wrote:
> > OK to check-in the fix for both of these problems?
>
> I think I'm confused -- the first hunk shows that it's
> thread 1 that receives the signal; then why do we need
> the "thread 1" command?
I have looked more at it now and there is a race. The following outputs are
from unpatched FSF GDB HEAD:
racy case #1:
(xgdb) PASS: gdb.gdb/selftest.exp: Set xgdb_prompt
^M
Thread 1 "xgdb" received signal SIGINT, Interrupt.^M
0x00007ffff583bfdd in poll () from /lib64/libc.so.6^M
(gdb) FAIL: gdb.gdb/selftest.exp: send ^C to child process
signal SIGINT^M
Continuing with signal SIGINT.^M
^C^M
Thread 1 "xgdb" received signal SIGINT, Interrupt.^M
0x00007ffff5779da0 in sigprocmask () from /lib64/libc.so.6^M
(gdb) PASS: gdb.gdb/selftest.exp: send SIGINT signal to child process
backtrace^M
#0 0x00007ffff5779da0 in sigprocmask () from /lib64/libc.so.6^M
#1 0x0000000000704e79 in _rl_handle_signal (sig=2) at signals.c:228^M
#2 <signal handler called>^M
#3 0x00007ffff583bfdd in poll () from /lib64/libc.so.6^M
#4 0x00000000005ebf53 in gdb_wait_for_event (block=block@entry=1) at event-loop.c:746^M
#5 0x00000000005ec589 in gdb_do_one_event () at event-loop.c:323^M
#6 0x00000000005ec6be in start_event_loop () at event-loop.c:347^M
#7 0x00000000005e6513 in captured_command_loop (data=data@entry=0x0) at main.c:318^M
#8 0x00000000005e348d in catch_errors (func=func@entry=0x5e6500 <captured_command_loop>, func_args=func_args@entry=0x0, errstring=errstring@entry=0x7e0e6c "", mask=mask@entry=RETURN_MASK_ALL) at exceptions.c:240^M
#9 0x00000000005e7006 in captured_main (data=data@entry=0x7fffffffd5f0) at main.c:1157^M
#10 0x00000000005e348d in catch_errors (func=func@entry=0x5e6970 <captured_main>, func_args=func_args@entry=0x7fffffffd5f0, errstring=errstring@entry=0x7e0e6c "", mask=mask@entry=RETURN_MASK_ALL) at exceptions.c:240^M
#11 0x00000000005e78cb in gdb_main (args=args@entry=0x7fffffffd5f0) at main.c:1165^M
#12 0x000000000046c0a5 in main (argc=<optimized out>, argv=<optimized out>) at gdb.c:32^M
(gdb) PASS: gdb.gdb/selftest.exp: backtrace through signal handler
racy case #2:
(xgdb) PASS: gdb.gdb/selftest.exp: Set xgdb_prompt
^M
Thread 1 "xgdb" received signal SIGINT, Interrupt.^M
0x00007ffff583bfdd in poll () from /lib64/libc.so.6^M
(gdb) FAIL: gdb.gdb/selftest.exp: send ^C to child process
signal SIGINT^M
Continuing with signal SIGINT.^M
^C^M
Thread 2 "xgdb" received signal SIGINT, Interrupt.^M
[Switching to Thread 0x7ffff3b7f700 (LWP 13227)]^M
0x00007ffff6b88b10 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0^M
(gdb) PASS: gdb.gdb/selftest.exp: send SIGINT signal to child process
backtrace^M
#0 0x00007ffff6b88b10 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0^M
#1 0x00007ffff6db32b7 in GC_wait_marker () from /lib64/libgc.so.1^M
#2 0x00007ffff6da92ba in GC_help_marker () from /lib64/libgc.so.1^M
#3 0x00007ffff6db15ef in GC_mark_thread () from /lib64/libgc.so.1^M
#4 0x00007ffff6b8360a in start_thread () from /lib64/libpthread.so.0^M
#5 0x00007ffff5847a4d in clone () from /lib64/libc.so.6^M
(gdb) FAIL: gdb.gdb/selftest.exp: backtrace through signal handler
Jan