Bug 133909 (IT_42912)

Summary: Segfault in ambiguous_line_spec (C++)
Product: Red Hat Enterprise Linux 3 Reporter: Bastien Nocera <bnocera>
Component: gdbAssignee: Jeff Johnston <jjohnstn>
Status: CLOSED ERRATA QA Contact: Jay Turner <jturner>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: cagney, jjohnstn, srevivo, tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-05-19 12:09:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 132991, 146413    
Attachments:
Description Flags
testcase.cpp none

Description Bastien Nocera 2004-09-28 13:42:30 UTC
Description of problem:
Segfault in ambiguous_line_spec (C++)

Version-Release number of selected component (if applicable):
gdb-6.1post-1.20040607.9

How reproducible:
Every time

Steps to Reproduce:
- compile the attached source (g++ -O0 -g -o testcase testcase.cpp)
- gdb ./testcase
- do 'list Test::Test' or 'break Test::Test', you will get the choice
to select all or cancel.
- first bug (?) the found line are shown as: '?HERE'
- choose 'all' (-> '1')
- on list you get a segfault, on break invalid breakpoints:
"Note: breakpoint -1 (disabled) also set at pc 0x0.
Breakpoint 1 at 0x0"
  
Actual results:
#0  ambiguous_line_spec (sals=0xbfffd078)
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/cli/cli-cmds.c:997
#1  0x080b276d in list_command (arg=0x828f7b5 "Test::Test", from_tty=1)
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/cli/cli-cmds.c:709
#2  0x080ae239 in do_cfunc (c=0x0, args=0x0, from_tty=0)
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/cli/cli-decode.c:57
#3  0x080b012c in cmd_func (cmd=0x82c0e10, args=0x0, from_tty=0)
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/cli/cli-decode.c:1561
#4  0x0807f665 in execute_command (p=0x828f7be "t", from_tty=1)
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/top.c:744
#5  0x0810ab91 in command_handler (command=0x828f7b0 "list Test::Test")
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/event-top.c:500
#6  0x0810afcb in command_line_handler (rl=0x81f9b8e "erver ")
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/event-top.c:793
#7  0x081e0b75 in rl_callback_read_char ()
   at /usr/src/debug/gdb+dejagnu-20040607/readline/callback.c:123
#8  0x0810a4fb in rl_callback_read_char_wrapper (client_data=0x0)
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/event-top.c:166
#9  0x0810aa8a in stdin_event_handler (error=0, client_data=0x0)
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/event-top.c:416
#10 0x08109d7e in handle_file_event (event_file_desc=137252424)
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/event-loop.c:721
#11 0x08109827 in process_event ()
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/event-loop.c:334
#12 0x08109888 in gdb_do_one_event (data=0x0)
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/event-loop.c:371
#13 0x0807f291 in do_catch_errors (uiout=0x82c1f08, data=0x0)
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/top.c:524
#14 0x0807f110 in catcher (func=0x807f280 <do_catch_errors>,
   func_uiout=0x82c1f08, func_args=0xbfffd3c0, func_val=0xbfffd3b8,
   func_caught=0xbfffd3bc, errstring=0x0, gdberrmsg=0x0, mask=6)
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/top.c:431
#15 0x0807f2f2 in catch_errors (func=0, func_args=0x0, errstring=0x0,
mask=0)
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/top.c:536
#16 0x080bc994 in tui_command_loop (data=0x0)
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/tui/tui-interp.c:150
#17 0x081075f9 in current_interp_command_loop ()
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/interps.c:277
#18 0x0807a83b in captured_command_loop (data=0x0)
   at /usr/src/debug/gdb+dejagnu-20040607/gdb/main.c:97

Expected results:
(gdb) list Test::Test
[0] cancel
[1] all
[2] Test at testcase.cpp:27
[3] Test at testcase.cpp:27
> 1
file: "testcase.cpp", line number: 27
file: "testcase.cpp", line number: 27

(This is on FC2)

Additional info:
FC2 with gdb-6.0post-1.20031117.8 seems to work properly.

Comment 1 Bastien Nocera 2004-09-28 13:43:11 UTC
Created attachment 104435 [details]
testcase.cpp

Comment 2 Bastien Nocera 2004-09-28 13:47:57 UTC
Also reproduced with the latest RHEL3 gdb-6.1post-1.20040607.17.

Comment 6 Jeff Johnston 2005-01-20 22:44:04 UTC
A fix has been built into gdb as of gdb-6.3.0.0-0.4

Comment 7 Tim Powers 2005-05-19 12:09:49 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2005-187.html