gdb/2125: fork and pthread's cause

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

gdb/2125: fork and pthread's cause

Jeroen Massar

>Number:         2125
>Category:       gdb
>Synopsis:       fork and pthread's cause
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 17 15:18:01 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Jeroen Massar <[hidden email]>
>Release:        gdb-6.4 + 6.5.50.20060517-cvs
>Organization:
>Environment:
Debian unstable (2.6.16, glibc 2.3.6), but most likely anything as it has been there for quite some time according to google, but no bug report that I could find.
>Description:
http://sourceware.org/ml/gdb/2005-09/msg00247.html

Create a thread, and do a fork, gdb crashes half-crashes out from under you on. See the above url for a nice test example.

Current 6.5.50 (2006-05-17) segfaults
>How-To-Repeat:
jma@firenze:~$ gdb gdb
GNU gdb 6.5.50.20060517-cvs-debian
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 "i486-linux-gnu"...(no debugging symbols found)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".

(gdb) r ./bliep
Starting program: /usr/bin/gdb ./bliep
(no debugging symbols found)
GNU gdb 6.5.50.20060517-cvs-debian
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 "i486-linux-gnu"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".

(gdb) r
Starting program: /home/jma/bliep
[Thread debugging using libthread_db enabled]
[New Thread -1478564160 (LWP 16992)]
pid=16992
[New Thread -1478566992 (LWP 16995)]
start_routine
[Thread -1478566992 (LWP 16995) exited]
join: Success
fork pid = 16996

waiting child pid = 16996
Program received signal SIGSEGV, Segmentation fault.
0x080918d3 in _initialize_proc_service ()
(gdb) fork pid = 0
pid = 0

(gdb)
(gdb) bt
#0  0x080918d3 in _initialize_proc_service ()
#1  0x0809363a in check_for_thread_db ()
#2  0x0810b06b in normal_stop ()
#3  0x0807fc6d in discard_cleanups ()
#4  0x081168a4 in throw_exception ()
#5  0x08116ef0 in print_any_exception ()
#6  0x08116f0c in throw_verror ()
#7  0x0807f923 in error ()
#8  0x0807fa1b in perror_with_name ()
#9  0x080912d8 in ps_get_thread_area ()
#10 0x0809665b in lin_lwp_attach_lwp ()
#11 0x080928e9 in check_for_thread_db ()
#12 0x0810bf0f in resume ()
#13 0x0810c0b3 in resume ()
#14 0x0810ca27 in handle_inferior_event ()
#15 0x0810e6ed in wait_for_inferior ()
#16 0x0810e86c in proceed ()
#17 0x08106f67 in kill_if_already_running ()
#18 0x0807db91 in execute_command ()
#19 0x0811af2c in async_disable_stdin ()
#20 0x0811b42c in async_disable_stdin ()
#21 0xa7f0f4ba in rl_callback_read_char () at /home/packages/bash/readline5-5.1/callback.c:204
#22 0x0811a87b in delete_timer ()
#23 0x0811a07a in delete_file_handler ()
#24 0x08119b14 in standard_macro_lookup ()
#25 0x0811a43a in gdb_do_one_event ()
#26 0x081171e3 in catch_errors ()
#27 0x080c2a84 in _initialize_tui_hooks ()
#28 0x0811a2b0 in delete_async_signal_handler ()
#29 0x081174cf in current_interp_command_loop ()
#30 0x0807837b in main ()
(gdb)
>Fix:
Now that is the magic question ;)
>Release-Note:
>Audit-Trail:
>Unformatted: