Bug 161401 - gdb fails when a break point is placed inside a library.
Summary: gdb fails when a break point is placed inside a library.
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: 4
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jan Kratochvil
QA Contact:
URL: gdb SIGSEGV at dwarf2_read_section
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-06-22 21:38 UTC by Gilboa Davara
Modified: 2008-02-26 05:14 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-02-26 05:14:38 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Test case makefile (723 bytes, text/plain)
2005-06-22 21:39 UTC, Gilboa Davara
no flags Details
Library test file. (102 bytes, text/plain)
2005-06-22 21:39 UTC, Gilboa Davara
no flags Details
Main test file (main()) (166 bytes, text/plain)
2005-06-22 21:40 UTC, Gilboa Davara
no flags Details
One reproducer tarball built on FC4-GOLD.x86_64. (12.48 KB, application/octet-stream)
2007-01-11 17:36 UTC, Jan Kratochvil
no flags Details

Description Gilboa Davara 2005-06-22 21:38:01 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4

Description of problem:
GDB dies when trying to debug the attached test-case.
Might relate to bug 146810:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=146810


Version-Release number of selected component (if applicable):
gdb-6.3.0.0-1.21.x86_64.rpm

How reproducible:
Always

Steps to Reproduce:
1. Save the attached files (test.c lib_test.c Makefile)
2. $ make
3. $ gdb ./test
4. b TestFunc
5. "Function "TestFunc" not defined.
    Make breakpoint pending on future shared library load? (y or [n]) "
    Answer y
6. r


Actual Results:  1. Program executes and displays the strings "Count=0" till "Count=99"
2. GDB doesn't stop at TestFunc.
3. GDB dies.
4. See generated core dump. (Below)


Expected Results:  1. Stop at TestFunc 100 times.
2. Exit normally

Additional info:

$ gdb /usr/bin/gdb
GNU gdb Red Hat Linux (6.3.0.0-1.21rh)
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 "x86_64-redhat-linux-gnu"...(no debugging symbols found)
Using host libthread_db library "/lib64/libthread_db.so.1".

(gdb) core-file core.1751
Core was generated by `gdb ./test'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib64/libncurses.so.5...done.
Loaded symbols for /usr/lib64/libncurses.so.5
Reading symbols from /lib64/libm.so.6...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libdl.so.2...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libc.so.6...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib64/libthread_db.so.1...done.
Loaded symbols for /lib64/libthread_db.so.1
#0  0x00000000004f6562 in dwarf2_read_section ()
(gdb) bt
#0  0x00000000004f6562 in dwarf2_read_section ()
#1  0x00000000004fa562 in dwarf2_build_psymtabs ()
#2  0x00000000004fa69d in dwarf2_build_psymtabs ()
#3  0x00000000004b2a0a in psymtab_to_symtab ()
#4  0x00000000004aef5e in basic_lookup_transparent_type ()
#5  0x00000000004af233 in lookup_symbol ()
#6  0x0000000000512b7f in find_imps ()
#7  0x00000000004b92a0 in _initialize_symmisc ()
#8  0x00000000004ba4d9 in decode_line_1 ()
#9  0x000000000049174e in bpstat_print ()
#10 0x00000000004918b4 in bpstat_print ()
#11 0x000000000044678c in throw_exception ()
#12 0x000000000044684f in catch_exceptions_with_msg ()
#13 0x0000000000491bfe in resolve_sal_pc_list ()
#14 0x00000000004921cb in resolve_sal_pc_list ()
#15 0x0000000000494075 in re_enable_breakpoints_in_shlibs ()
#16 0x00000000004c18af in handle_inferior_event ()
#17 0x00000000004c32d9 in wait_for_inferior ()
#18 0x00000000004c3458 in proceed ()
#19 0x00000000004bcbcb in kill_if_already_running ()
#20 0x0000000000446c5a in execute_command ()
#21 0x00000000004cd554 in async_disable_stdin ()
#22 0x00000000004cda0c in async_disable_stdin ()
#23 0x00000000005a690a in rl_callback_read_char ()
#24 0x00000000004cce99 in delete_timer ()
#25 0x00000000004cc18a in standard_macro_lookup ()
#26 0x00000000004cca40 in gdb_do_one_event ()
#27 0x000000000044678c in throw_exception ()
#28 0x00000000004468f7 in catch_errors ()
#29 0x0000000000480b44 in _initialize_tui_hooks ()
#30 0x000000000043da09 in main ()
(gdb)  q

Comment 1 Gilboa Davara 2005-06-22 21:39:09 UTC
Created attachment 115835 [details]
Test case makefile

Comment 2 Gilboa Davara 2005-06-22 21:39:41 UTC
Created attachment 115836 [details]
Library test file.

Comment 3 Gilboa Davara 2005-06-22 21:40:19 UTC
Created attachment 115837 [details]
Main test file (main())

Comment 4 Gilboa Davara 2005-06-22 21:47:00 UTC
Test case working just fine on FC3/i386.

Oh... Forgot to add (in Steps to Reproduce:)
2. export LD_LIBRARY_PATH=.


Comment 5 Gilboa Davara 2005-08-25 01:19:36 UTC
Checked again with latest kernel/gcc.
Same crash.

gcc-4.0.1-4.fc4
kernel-smp-2.6.12-1.1398_FC4

Comment 7 Paul Jakma 2005-09-25 05:25:21 UTC
I get this too, the below is using the 'aspathtest' programme from the 'quagga'
package (upstream version, not currently in FC I think):

#0  0x00000000004f6562 in process_die (die=Variable "die" is not available.
)
    at ../../gdb-6.3/gdb/dwarf2read.c:8861
8861      if (IS_ABSOLUTE_PATH (fe->name))
(gdb) bt
#0  0x00000000004f6562 in process_die (die=Variable "die" is not available.
)
    at ../../gdb-6.3/gdb/dwarf2read.c:8861
#1  0x00000000004fa562 in psymtab_to_symtab_1 (pst=Variable "pst" is not available.
)
    at ../../gdb-6.3/gdb/dwarf2read.c:2598
#2  0x00000000004fa69d in dwarf2_psymtab_to_symtab (pst=0x883810)
    at ../../gdb-6.3/gdb/dwarf2read.c:2334
#3  0x00000000004b2a0a in psymtab_to_symtab (pst=0x883810)
    at ../../gdb-6.3/gdb/symfile.c:278
#4  0x00000000004aef5e in lookup_symbol_aux_psymtabs (block_index=0, 
    name=0x7fffffcb9750 "aspath_cmp_left", linkage_name=0x0, 
    domain=VAR_DOMAIN, symtab=0x0) at ../../gdb-6.3/gdb/symtab.c:1276
#5  0x00000000004af233 in lookup_symbol (
    name=0x7fffffcb9750 "aspath_cmp_left", block=0x7fffffcb9750, 
    domain=VAR_DOMAIN, is_a_field_of_this=0x0, symtab=0x0)
    at ../../gdb-6.3/gdb/symtab.c:1118
#6  0x0000000000512b7f in find_imps (symtab=0x0, block=0x0, 
    method=0x7bf006 "aspath_cmp_left", syms=0x0, nsym=0x7fffffcb986c, 
    ndebug=0x7fffffcb9868) at ../../gdb-6.3/gdb/objc-lang.c:1436
#7  0x00000000004b92a0 in decode_objc (argptr=0x7fffffcb9cb8, funfirstline=1, 
    file_symtab=0x0, canonical=0x7fffffcb9d60, saved_arg=Variable "saved_arg" is
not available.
)
    at ../../gdb-6.3/gdb/linespec.c:1322
#8  0x00000000004ba4d9 in decode_line_1 (argptr=0x7fffffcb9cb8, 
    funfirstline=1, default_symtab=0x0, default_line=0, 
---Type <return> to continue, or q <return> to quit--- 
    canonical=0x7fffffcb9d60, not_found_ptr=0x7fffffcb9d7c)
    at ../../gdb-6.3/gdb/linespec.c:947
#9  0x000000000049174e in parse_breakpoint_sals (address=0x7fffffcb9cb8, 
    sals=0x7fffffcb9d40, addr_string=0x7fffffcb9d60, 
    not_found_ptr=0x7fffffcb9d7c) at ../../gdb-6.3/gdb/breakpoint.c:5208
#10 0x00000000004918b4 in do_captured_parse_breakpoint (ui=Variable "ui" is not
available.
)
    at ../../gdb-6.3/gdb/breakpoint.c:5300
#11 0x000000000044678c in catcher (
    func=0x491899 <do_captured_parse_breakpoint>, func_uiout=0x810250, 
    func_args=0x7fffffcb9d20, func_val=0x7fffffcb9c34, 
    func_caught=0x7fffffcb9c30, errstring=Variable "errstring" is not available.
) at ../../gdb-6.3/gdb/top.c:431
#12 0x000000000044684f in catch_exceptions_with_msg (uiout=Variable "uiout" is
not available.
)
    at ../../gdb-6.3/gdb/top.c:506
#13 0x0000000000491bfe in break_command_1 (arg=0x7bf006 "aspath_cmp_left", 
    flag=0, from_tty=1, pending_bp=0x0) at ../../gdb-6.3/gdb/breakpoint.c:5346
#14 0x0000000000446c5a in execute_command (p=0x7bf014 "t", from_tty=1)
    at ../../gdb-6.3/gdb/top.c:733
#15 0x00000000004cd554 in command_handler (
    command=0x7bf000 "break aspath_cmp_left")
    at ../../gdb-6.3/gdb/event-top.c:500
#16 0x00000000004cda0c in command_line_handler (
    rl=0x8305c0 "break aspath_cmp_left") at ../../gdb-6.3/gdb/event-top.c:793
#17 0x00000000005a690a in rl_callback_read_char ()
---Type <return> to continue, or q <return> to quit---
    at ../../gdb-6.3/readline/callback.c:123
#18 0x00000000004cce99 in rl_callback_read_char_wrapper (client_data=Variable
"client_data" is not available.
)
    at ../../gdb-6.3/gdb/event-top.c:166
#19 0x00000000004cc18a in process_event ()
    at ../../gdb-6.3/gdb/event-loop.c:334
#20 0x00000000004cca40 in gdb_do_one_event (data=Variable "data" is not available.
)
    at ../../gdb-6.3/gdb/event-loop.c:371
#21 0x000000000044678c in catcher (func=0x4468aa <do_catch_errors>, 
    func_uiout=0x810250, func_args=0x7fffffcba040, func_val=0x7fffffcba05c, 
    func_caught=0x7fffffcba058, errstring=Variable "errstring" is not available.
) at ../../gdb-6.3/gdb/top.c:431
#22 0x00000000004468f7 in catch_errors (func=Variable "func" is not available.
) at ../../gdb-6.3/gdb/top.c:536
#23 0x0000000000480b44 in tui_command_loop (data=Variable "data" is not available.
)
    at ../../gdb-6.3/gdb/tui/tui-interp.c:150
#24 0x000000000043da09 in captured_command_loop (data=Variable "data" is not
available.
)
    at ../../gdb-6.3/gdb/main.c:91
#25 0x000000000044678c in catcher (func=0x4468aa <do_catch_errors>, 
    func_uiout=0x810250, func_args=0x7fffffcba200, func_val=0x7fffffcba21c, 
    func_caught=0x7fffffcba218, errstring=Variable "errstring" is not available.
) at ../../gdb-6.3/gdb/top.c:431
#26 0x00000000004468f7 in catch_errors (func=Variable "func" is not available.
) at ../../gdb-6.3/gdb/top.c:536
#27 0x000000000043e105 in captured_main (data=Variable "data" is not available.
) at ../../gdb-6.3/gdb/main.c:801
#28 0x000000000044678c in catcher (func=0x4468aa <do_catch_errors>, 
    func_uiout=0x7977e0, func_args=0x7fffffcba580, func_val=0x7fffffcba59c, 
    func_caught=0x7fffffcba598, errstring=Variable "errstring" is not available.
) at ../../gdb-6.3/gdb/top.c:431
---Type <return> to continue, or q <return> to quit---
#29 0x00000000004468f7 in catch_errors (func=Variable "func" is not available.
) at ../../gdb-6.3/gdb/top.c:536
#30 0x000000000043da59 in gdb_main (args=Variable "args" is not available.
) at ../../gdb-6.3/gdb/main.c:810
#31 0x000000000043d9ee in main (argc=Variable "argc" is not available.
) at ../../gdb-6.3/gdb/gdb.c:35


Comment 8 Gilboa Davara 2005-09-25 12:37:24 UTC
Bug still not assigned :/

Comment 9 Gilboa Davara 2005-11-05 13:27:21 UTC
Updated to latest version (gdb-6.3.0.0-1.84) still doesn't work.

Here's a recent gdb-debuginfo crash dump.

$ gdb gdb
gdb) r ./test
[snip]
gdb) b TestFunc

gdb) btFunction "TestFunc" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (TestFunc) pending.
(gdb) r
Starting program: /home/gilboa/Logs/gdb/test
Detaching after fork from child process 7905.
Detaching after fork from child process 7906.
[Thread debugging using libthread_db enabled]
[New Thread 46912497358656 (LWP 7905)]

Program received signal SIGSEGV, Segmentation fault.
0x00000000004f6852 in process_die (die=Variable "die" is not available.) at
../../gdb-6.3/gdb/dwarf2read.c:8863
8863      if (IS_ABSOLUTE_PATH (fe->name))
(gdb) bt
#0  0x00000000004f6852 in process_die (die=Variable "die" is not available.) at
../../gdb-6.3/gdb/dwarf2read.c:8863
#1  0x00000000004fa85e in psymtab_to_symtab_1 (pst=Variable "pst" is not
available.) at ../../gdb-6.3/gdb/dwarf2read.c:2600
#2  0x00000000004fa99b in dwarf2_psymtab_to_symtab (pst=0xa9c420) at
../../gdb-6.3/gdb/dwarf2read.c:2336
#3  0x00000000004b2cba in psymtab_to_symtab (pst=0xa9c420) at
../../gdb-6.3/gdb/symfile.c:279
#4  0x00000000004af1fe in lookup_symbol_aux_psymtabs (block_index=0,
name=0x7ffffffd63c0 "TestFunc", linkage_name=0x0, domain=VAR_DOMAIN,
symtab=0x0)at ../../gdb-6.3/gdb/symtab.c:1276
#5  0x00000000004af4d3 in lookup_symbol (name=0x7ffffffd63c0 "TestFunc",
block=0x7ffffffd63c0, domain=VAR_DOMAIN, is_a_field_of_this=0x0, symtab=0x0) at
../../gdb-6.3/gdb/symtab.c:1118
#6  0x0000000000512e6f in find_imps (symtab=0x0, block=0x0, method=0x94adf0
"TestFunc", syms=0x0, nsym=0x7ffffffd64dc, ndebug=0x7ffffffd64d8) at
../../gdb-6.3/gdb/objc-lang.c:1436
#7  0x00000000004b9550 in decode_objc (argptr=0x7ffffffd6928, funfirstline=1,
file_symtab=0x0, canonical=0x7ffffffd69d0, saved_arg=Variable "saved_arg" is not
available.) at ../../gdb-6.3/gdb/linespec.c:1322
#8  0x00000000004ba7a9 in decode_line_1 (argptr=0x7ffffffd6928, funfirstline=1,
default_symtab=0x0, default_line=0, canonical=0x7ffffffd69d0,
not_found_ptr=0x7ffffffd69ec) at ../../gdb-6.3/gdb/linespec.c:947
#9  0x00000000004919fe in parse_breakpoint_sals (address=0x7ffffffd6928,
sals=0x7ffffffd69b0, addr_string=0x7ffffffd69d0, not_found_ptr=0x7ffffffd69ec)
at ../../gdb-6.3/gdb/breakpoint.c:5208
#10 0x0000000000491b64 in do_captured_parse_breakpoint (ui=Variable "ui" is not
available.) at ../../gdb-6.3/gdb/breakpoint.c:5300
#11 0x00000000004468cc in catcher (func=0x491b49 <do_captured_parse_breakpoint>,
func_uiout=0x908d60, func_args=0x7ffffffd6990, func_val=0x7ffffffd68a4,
func_caught=0x7ffffffd68a0, errstring=Variable "errstring" is not available.) at
../../gdb-6.3/gdb/top.c:431
#12 0x000000000044698f in catch_exceptions_with_msg (uiout=Variable "uiout" is
not available.) at ../../gdb-6.3/gdb/top.c:506
#13 0x0000000000491eae in break_command_1 (arg=0x94adf0 "TestFunc", flag=0,
from_tty=1, pending_bp=0x8cefb0) at ../../gdb-6.3/gdb/breakpoint.c:5346
#14 0x000000000049247b in resolve_pending_breakpoint (b=0x8cefb0) at
../../gdb-6.3/gdb/breakpoint.c:4446
#15 0x0000000000494325 in re_enable_breakpoints_in_shlibs () at
../../gdb-6.3/gdb/breakpoint.c:4571
#16 0x00000000004c1b8f in handle_inferior_event (ecs=0x7ffffffd6d90) at
../../gdb-6.3/gdb/infrun.c:2233
#17 0x00000000004c35b9 in wait_for_inferior () at ../../gdb-6.3/gdb/infrun.c:990
#18 0x00000000004c3745 in proceed (addr=Variable "addr" is not available.) at
../../gdb-6.3/gdb/infrun.c:811
#19 0x00000000004bce9b in run_command (args=0x0, from_tty=1) at
../../gdb-6.3/gdb/infcmd.c:482
#20 0x0000000000446d9a in execute_command (p=0x8b7ff1 "", from_tty=1) at
../../gdb-6.3/gdb/top.c:733
#21 0x00000000004cd844 in command_handler (command=0x8b7ff0 "") at
../../gdb-6.3/gdb/event-top.c:500
#22 0x00000000004cdcfc in command_line_handler (rl=0x8cf0d0 "r") at
../../gdb-6.3/gdb/event-top.c:793
#23 0x00000000005a743a in rl_callback_read_char () at
../../gdb-6.3/readline/callback.c:123
#24 0x00000000004cd189 in rl_callback_read_char_wrapper (client_data=Variable
"client_data" is not available.) at ../../gdb-6.3/gdb/event-top.c:166
#25 0x00000000004cc46a in process_event () at ../../gdb-6.3/gdb/event-loop.c:334
#26 0x00000000004ccd2c in gdb_do_one_event (data=Variable "data" is not
available.) at ../../gdb-6.3/gdb/event-loop.c:371
#27 0x00000000004468cc in catcher (func=0x4469ea <do_catch_errors>,
func_uiout=0x908d60, func_args=0x7ffffffd71f0, func_val=0x7ffffffd720c,
func_caught=0x7ffffffd7208, errstring=Variable "errstring" is not available.) at
../../gdb-6.3/gdb/top.c:431
#28 0x0000000000446a37 in catch_errors (func=Variable "func" is not available.)
at ../../gdb-6.3/gdb/top.c:536
#29 0x0000000000480e04 in tui_command_loop (data=Variable "data" is not
available.) at ../../gdb-6.3/gdb/tui/tui-interp.c:150
#30 0x000000000043db49 in captured_command_loop (data=Variable "data" is not
available.) at ../../gdb-6.3/gdb/main.c:91
#31 0x00000000004468cc in catcher (func=0x4469ea <do_catch_errors>,
func_uiout=0x908d60, func_args=0x7ffffffd73b0, func_val=0x7ffffffd73cc,
func_caught=0x7ffffffd73c8, errstring=Variable "errstring" is not available.) at
../../gdb-6.3/gdb/top.c:431
#32 0x0000000000446a37 in catch_errors (func=Variable "func" is not available.)
at ../../gdb-6.3/gdb/top.c:536
#33 0x000000000043e242 in captured_main (data=Variable "data" is not available.)
at ../../gdb-6.3/gdb/main.c:802
#34 0x00000000004468cc in catcher (func=0x4469ea <do_catch_errors>,
func_uiout=0x7984a0, func_args=0x7ffffffd7730, func_val=0x7ffffffd774c,
func_caught=0x7ffffffd7748, errstring=Variable "errstring" is not available.) at
../../gdb-6.3/gdb/top.c:431
#35 0x0000000000446a37 in catch_errors (func=Variable "func" is not available.)
at ../../gdb-6.3/gdb/top.c:536
#36 0x000000000043db99 in gdb_main (args=Variable "args" is not available.) at
../../gdb-6.3/gdb/main.c:811
#37 0x000000000043db2e in main (argc=Variable "argc" is not available.) at
../../gdb-6.3/gdb/gdb.c:35

Comment 10 Gilboa Davara 2006-01-28 15:34:07 UTC
Just for the heck of it, I added "-m32" to the makefile, building it as 32bit
binary/library and it worked just fine.
Seems to be 64bit only problem.

Comment 11 Gilboa Davara 2006-01-28 15:37:36 UTC
Reported up-stream: Problem 1997.


Comment 12 Gilboa Davara 2007-01-11 12:29:36 UTC
FYI, fixed in FC6.

- Gilboa

Comment 13 Jan Kratochvil 2007-01-11 17:36:34 UTC
Created attachment 145370 [details]
One reproducer tarball built on FC4-GOLD.x86_64.

Thanks for the report and sorry the resolving lacked so far.

FC4 built FC4 debugged: gdb crash
FC4 built FC6 debugged: works
FC6 built FC6 debugged: works

Still to evaluate the specific reason, it may just be unreproducibility.

Comment 15 Christian Iseli 2007-01-22 10:06:36 UTC
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Thanks.

Comment 16 petrosyan 2008-02-26 05:14:38 UTC
Fedora Core 4 is no longer maintained.

Setting status to "INSUFFICIENT_DATA". If you can reproduce this bug in the
current Fedora release, please reopen this bug and assign it to the
corresponding Fedora version.


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