Synopsis : Gdb failed to stop by Control-C linux on FC5 (2.6.18-1) for multithreaded child process
Environment : linux 2.6.17-1.2139 (Fedora core 5). gdb 6.3 and gdb 6.6 Description : gdb does not stop on Control "C" when debugging some processes (apache httpd child process) When I try to debug child apache httpd process then ctrl-c doesn't stop the gdb which makes it very hard to debug. If I debug parent httpd process, gdb works as expected. [/disk/apache/apache2] $ /usr/sfw/bin/gdb ./bin/httpd 30619 GNU gdb 6.6 Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"... "This is gdb initialization file "Using host libthread_db library "/lib/libthread_db.so.1". Attaching to program: /disk/apache/apache2/bin/httpd, process 30619 LLA: waitpid 30619, faking SIGSTOP LLW: Using pending wait status Stopped (signal) (stopped) for process 30619. LLW: Candidate event Stopped (signal) (stopped) in process 30619. LLTA: PTRACE_PEEKUSER process 30619, 0, 0 (OK) Reading symbols from /lib/libm.so.6...done. Loaded symbols for /lib/libm.so.6 Reading symbols from /disk/apache/apache2/lib/libaprutil-1.so.0...done. Loaded symbols for /disk/apache/apache2/lib/libaprutil-1.so.0 Reading symbols from /usr/lib/libsqlite3.so.0...done. Loaded symbols for /usr/lib/libsqlite3.so.0 Reading symbols from /lib/libexpat.so.0...done. Loaded symbols for /lib/libexpat.so.0 Reading symbols from /disk/apache/apache2/lib/libapr-1.so.0...done. Loaded symbols for /disk/apache/apache2/lib/libapr-1.so.0 Reading symbols from /lib/libuuid.so.1...done. Loaded symbols for /lib/libuuid.so.1 Reading symbols from /lib/librt.so.1...done. Loaded symbols for /lib/librt.so.1 Reading symbols from /lib/libcrypt.so.1...done. Loaded symbols for /lib/libcrypt.so.1 Reading symbols from /lib/libpthread.so.0...done. [Thread debugging using libthread_db enabled] [New Thread -1208449360 (LWP 30619)] [New Thread -1274238048 (LWP 30626)] LLAL: PTRACE_ATTACH LWP 30626, 0, 0 (OK) LLAL: waitpid LWP 30626 received Stopped (signal) (stopped) [New Thread -1263748192 (LWP 30625)] LLAL: PTRACE_ATTACH LWP 30625, 0, 0 (OK) LLAL: waitpid LWP 30625 received Stopped (signal) (stopped) [New Thread -1253258336 (LWP 30624)] LLAL: PTRACE_ATTACH LWP 30624, 0, 0 (OK) LLAL: waitpid LWP 30624 received Stopped (signal) (stopped) [New Thread -1242768480 (LWP 30623)] LLAL: PTRACE_ATTACH LWP 30623, 0, 0 (OK) LLAL: waitpid LWP 30623 received Stopped (signal) (stopped) [New Thread -1232278624 (LWP 30622)] LLAL: PTRACE_ATTACH LWP 30622, 0, 0 (OK) LLAL: waitpid LWP 30622 received Stopped (signal) (stopped) [New Thread -1221788768 (LWP 30621)] LLAL: PTRACE_ATTACH LWP 30621, 0, 0 (OK) LLAL: waitpid LWP 30621 received Stopped (signal) (stopped) Loaded symbols for /lib/libpthread.so.0 Reading symbols from /lib/libdl.so.2...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /lib/libc.so.6...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /lib/libnss_files.so.2...done. Loaded symbols for /lib/libnss_files.so.2 Reading symbols from /disk/apache/apache2/modules/mod_perl.so...done. Loaded symbols for /disk/apache/apache2/modules/mod_perl.so Reading symbols from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so...done. Loaded symbols for /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so Reading symbols from /lib/libresolv.so.2...done. Loaded symbols for /lib/libresolv.so.2 Reading symbols from /lib/libnsl.so.1...done. Loaded symbols for /lib/libnsl.so.1 Reading symbols from /lib/libutil.so.1...done. Loaded symbols for /lib/libutil.so.1 Reading symbols from /lib/libgcc_s.so.1...done. Loaded symbols for /lib/libgcc_s.so.1 Reading symbols from /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/ServerUtil/ServerUtil.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/ServerUtil/ServerUtil.so Reading symbols from /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/Response/Response.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/Response/Response.so Reading symbols from /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/RequestRec/RequestRec.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/RequestRec/RequestRec.so Reading symbols from /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/RequestUtil/RequestUtil.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/RequestUtil/RequestUtil.so Reading symbols from /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/RequestIO/RequestIO.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/RequestIO/RequestIO.so Reading symbols from /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/Log/Log.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/Log/Log.so Reading symbols from /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/Access/Access.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/Access/Access.so Reading symbols from /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/APR/Table/Table.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/APR/Table/Table.so Reading symbols from /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/APR/Status/Status.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/APR/Status/Status.so Reading symbols from /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/ModPerl/Util/Util.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/ModPerl/Util/Util.so Reading symbols from /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/ModPerl/Global/Global.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/ModPerl/Global/Global.so Reading symbols from /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/Const/Const.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/Const/Const.so 0x004dd410 in __kernel_vsyscall () (gdb) b http_filters.c:186 Breakpoint 1 at 0x809a4f5: file http_filters.c, line 186. (gdb) c Continuing. LLR: Preparing to resume process -1, 0, inferior_ptid LWP 30619 RC: PTRACE_CONT LWP 30621, 0, 0 (resume sibling) RC: PTRACE_CONT LWP 30622, 0, 0 (resume sibling) RC: PTRACE_CONT LWP 30623, 0, 0 (resume sibling) RC: PTRACE_CONT LWP 30624, 0, 0 (resume sibling) RC: PTRACE_CONT LWP 30625, 0, 0 (resume sibling) RC: PTRACE_CONT LWP 30626, 0, 0 (resume sibling) LLR: PTRACE_CONT process 30619, 0 (resume event thread) my_waitpid begin pid = -1 options=-2147483647 my_waitpid end lwpid = 0 status = 0, lastsignal = 0 my_waitpid begin pid = -1 options=1 my_waitpid end lwpid = 0 status = 0, lastsignal = 0 my_waitpid begin pid = -1 options=-2147483647 my_waitpid end lwpid = 0 status = 0, lastsignal = 0 my_waitpid begin pid = -1 options=1 my_waitpid end lwpid = 0 status = 0, lastsignal = 0 my_waitpid begin pid = -1 options=-2147483647 my_waitpid end lwpid = 0 status = 0, lastsignal = 2 my_waitpid begin pid = -1 options=1 my_waitpid end lwpid = 0 status = 0, lastsignal = 0 Pressing Ctrl -c doesn't stop I noticed that waitpid returns but it doesn't return the pid when pressing ctrl-c. gdb receives the signal but fails to react because waitpid return 0. The above printf shows the result. To reproduce it run the httpd process and attach the child httpd process. Note : I tried to file the bug from http://sourceware.org/cgi-bin/gnatsweb.pl?cmd=create&database=gdb&return_url=http%3A%2F%2Fsourceware.org%2Fcgi-bin%2Fgnatsweb.pl but it failed so I am posting to this alias. _______________________________________________ bug-gdb mailing list bug-gdb@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gdb