Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 162882 - gdb gets SIGSEGV in free when run under ddd
Summary: gdb gets SIGSEGV in free when run under ddd
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: 4
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Alexandre Oliva
QA Contact:
: 151410 165376 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2005-07-11 04:58 UTC by Michael Ubell
Modified: 2007-11-30 22:11 UTC (History)
3 users (show)

Fixed In Version: gdb-
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-09-26 10:18:55 UTC

Attachments (Terms of Use)
Untested patch for FC4 gdb- (deleted)
2006-08-13 14:25 UTC, Jan Kratochvil
no flags Details | Diff

Description Michael Ubell 2005-07-11 04:58:54 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/412 (KHTML, like Gecko) Safari/412

Description of problem:
Running gdb under ddd (either 3.3.10 or 3.3.11) gets segv when displaying code.
In this case I am running tclsh8.4 and dynamicly loading the BerkeleyDB tcl library.
It does not happen with gdb run standalone.  Strangely if you run gdb under
gdb under ddd it happens (must be some environment set by ddd?).

(gdb) file gdb
(no debugging symbols found)
(gdb) run tclsh8.4
(no debugging symbols found)
GNU gdb Red Hat Linux (
Copyright 2004 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 "i386-redhat-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib/".

Function "__db_loadme" not defined.
Function "__db_err" not defined.
(gdb) run
Starting program: /usr/bin/tclsh8.4 
Detaching after fork from child process 5636.
Detaching after fork from child process 5637.
Reading symbols from shared object read from target memory...(no debugging symbols found)...done.
Loaded system supplied DSO at 0xc66000
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
% source ../test/test.tcl
[Thread debugging using libthread_db enabled]
[New Thread -1208309280 (LWP 5636)]
Detaching after fork from child process 5639.
% ^C
Program received signal SIGINT, Interrupt.
[Switching to Thread -1208309280 (LWP 5636)]
0x00c66402 in __kernel_vsyscall ()
(gdb) where
#0  0x00c66402 in __kernel_vsyscall ()
#1  0x0049ed13 in __read_nocancel () from /lib/
#2  0x006aecde in Tcl_LappendObjCmd () from /usr/lib/
#3  0x0067fbcf in Tcl_WriteRaw () from /usr/lib/
#4  0x00681a81 in Tcl_ChannelWideSeekProc () from /usr/lib/
#5  0x00681c8e in Tcl_GetsObj () from /usr/lib/
#6  0x00691444 in Tcl_Main () from /usr/lib/
#7  0x0804863c in main ()
(gdb) list __db_open

Program received signal SIGSEGV, Segmentation fault.
0x00446926 in free () from /lib/
(gdb) where
#0  0x00446926 in free () from /lib/
#1  0x080f4ca1 in find_line_pc_range ()
#2  0x080df3a4 in print_source_lines ()
#3  0x08084da2 in execute_command ()
#4  0x08112c94 in async_disable_stdin ()
#5  0x08113109 in async_disable_stdin ()
#6  0x081ede7d in rl_callback_read_char ()
#7  0x081125bb in delete_timer ()
#8  0x08111e6e in delete_file_handler ()
#9  0x08111952 in standard_macro_lookup ()
#10 0x08112197 in gdb_do_one_event ()
#11 0x08084834 in throw_exception ()
#12 0x080849ed in catch_errors ()
#13 0x080c2799 in _initialize_tui_hooks ()
#14 0x0810f953 in current_interp_command_loop ()
#15 0x0807b4fb in main ()

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Build berkeledb release with tcl support
2. ddd tclsh8.4
3. run
4. source ../test/test.tcl
5. Ctrl-C
6. list __db_open

Actual Results:  (gdb) list __db_open

Program received signal SIGSEGV, Segmentation fault.
0x00446926 in free () from /lib/

Expected Results:  list the routine

Additional info:

Comment 1 Michael Ubell 2005-07-11 21:38:47 UTC
I unpacked the gdb source RPM and compiled so that I could do a little debugging.
The problem does not happen in the verision of gdb built from the source distribution.
(I don't know if I should have applied all the patches that were in the distribution,
but I did not.)

Comment 2 Jan Kratochvil 2006-08-13 14:25:39 UTC
Created attachment 134098 [details]
Untested patch for FC4 gdb-

Although I was unable to directly reproduce the crash I stronly believe the
attached patch would fix it.
This bug was already fixed in FC5 and it is completely bugfixed/rewritten in
CVS so as FC4 went to fedoralegacy suggesting CLOSED-CURRENTRELEASE.

Comment 3 Jan Kratochvil 2006-08-13 16:39:22 UTC
This Bug was fixed by gdb-

Comment 4 Jan Kratochvil 2006-08-14 23:06:51 UTC
*** Bug 151410 has been marked as a duplicate of this bug. ***

Comment 5 Jan Kratochvil 2006-12-30 00:50:00 UTC
*** Bug 165376 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.