This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/10886] Crash of gdb 7.0 as shipped with Unbuntu 9.10, probably due to a double free.


------- Additional Comments From ppluzhnikov at google dot com  2009-11-09 17:43 -------
I can not reproduce this problem on a trivial test case.
Andre, could you perhaps provide more detailed instructions?

Note: if you link with -lmcheck, or set MALLOC_CHECK_=2, the intermittent crash
should become deterministic (if it is due to double free).

I can however make gdb-cvs crash on a trivial related example by executing:

cat t.c
int main() { return 0; }

cat foo.c
int foo() { return 42; }

gcc -g t.c -ldl && gcc -g -fPIC -shared -o foo.so foo.c

gdb64-cvs -nx ./a.out
GNU gdb (GDB) 7.0.50.20091109-cvs
...
Reading symbols from /tmp/gdb-pr10886/a.out...done.
(gdb) b main
Breakpoint 1 at 0x40048c: file t.c, line 1.
(gdb) r
Starting program: /tmp/gdb-pr10886/a.out
Breakpoint 1, main () at t.c:1
1	int main() { return 0; }
(gdb) print dlopen("./foo.so", 2)
$1 = 6295632
(gdb) b foo
Breakpoint 2 at 0x7ffff76794f0: file foo.c, line 1.
(gdb) c
Continuing.

Program exited normally.
(gdb) r
Starting program: /tmp/gdb-pr10886/a.out 
Breakpoint 1, main () at t.c:1
1	int main() { return 0; }
(gdb) info b
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x000000000040048c in main at t.c:1
	breakpoint already hit 1 time
Segmentation fault (core dumped)

The crash is here:
(gdb) bt
#0  lookup_minimal_symbol_by_pc_section_1 (pc=140737344148720, section=0xd21390,
want_trampoline=<value optimized out>)
    at ../../src/gdb/minsyms.c:488
#1  0x00000000004ff3e9 in find_pc_sect_symtab (pc=140737344148720,
section=0xd21390) at ../../src/gdb/symtab.c:2071
#2  0x00000000004fd117 in blockvector_for_pc_sect (pc=140737344148720,
section=0xd21390, pblock=0x7fff5d7d9df0, symtab=0x0)
    at ../../src/gdb/block.c:106
#3  0x00000000004fd140 in block_for_pc_sect (pc=140737344148720,
section=0xd21390) at ../../src/gdb/block.c:182
#4  0x00000000004cd9f9 in find_pc_sect_function (pc=140737344148720,
section=0xd21390) at ../../src/gdb/blockframe.c:139
#5  0x00000000004d428d in print_breakpoint_location (b=0xcdf2d0, loc=0xcb6300,
loc_number=<value optimized out>, 
    last_loc=0x7fff5d7da038, print_address_bits=<value optimized out>,
allflag=0) at ../../src/gdb/breakpoint.c:3836
#6  print_one_breakpoint_location (b=0xcdf2d0, loc=0xcb6300, loc_number=<value
optimized out>, last_loc=0x7fff5d7da038, 
    print_address_bits=<value optimized out>, allflag=0) at
../../src/gdb/breakpoint.c:4053
#7  0x00000000004d4910 in print_one_breakpoint (b=0x7ffff76794f0, last_loc=0x0,
print_address_bits=64, allflag=0)
    at ../../src/gdb/breakpoint.c:4225
#8  0x00000000004d4bf4 in breakpoint_1 (bnum=-1, allflag=0) at
../../src/gdb/breakpoint.c:4403
#9  0x000000000045cb3a in execute_command (p=0xa62a06 "", from_tty=1) at
../../src/gdb/top.c:453
...

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1


http://sourceware.org/bugzilla/show_bug.cgi?id=10886

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]