Bug 804256

Summary: gdb: until command segfaults in amd64_sigtramp_frame_sniffer
Product: [Fedora] Fedora Reporter: Nicholas Miell <nmiell>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: jan.kratochvil, pmuldoon, sergiodj, tromey
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gdb-7.4.50.20120120-42.fc17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-12 02:20:55 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:

Description Nicholas Miell 2012-03-17 02:14:09 UTC
Description of problem:
Using the until command segfaults gdb.

Version-Release number of selected component (if applicable):
gdb-7.3.50.20110722-10.fc16.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Install Firefox 11 from Koji
    firefox-11.0-1.fc16.x86_64
    xulrunner-11.0-3.fc16.x86_64
    nspr-4.9-1.fc16.x86_64
    nss-3.13.3-1.fc16.x86_64
    et al
2. Run firefox -g -P -no-remote (which will start firefox under gdb, assuming no other debugger is installed)
3. b mozilla::widget::GfxInfo::Getdata (say yes to the pending breakpoint)
4. run
5. until 146
  
Actual results:
Segmentation fault

Expected results:
A functional debugger.

Additional info:
#0  0x00000000075960d0 in ?? ()
#1  0x00000000004755b4 in amd64_sigtramp_frame_sniffer (self=<optimized out>, this_frame=0x898b298, this_cache=<optimized out>)
    at ../../gdb/amd64-tdep.c:2235
#2  0x000000000046a9a1 in frame_unwind_find_by_frame (this_frame=0x898b298, this_cache=0x898b2b0) at ../../gdb/frame-unwind.c:113
#3  0x00000000004679a1 in get_frame_type (frame=0x898b298) at ../../gdb/frame.c:2199
#4  0x0000000000469773 in skip_inlined_frames (frame=0x898b298) at ../../gdb/frame.c:313
#5  0x0000000000469801 in frame_unwind_caller_id (next_frame=<optimized out>) at ../../gdb/frame.c:374
#6  0x0000000000513a2d in until_break_command (arg=0xfa1159 "", from_tty=<optimized out>, anywhere=<optimized out>) at ../../gdb/breakpoint.c:9873
#7  0x0000000000556de9 in until_command (arg=0xfa1156 "146", from_tty=1) at ../../gdb/infcmd.c:1369
#8  0x000000000045edcb in execute_command (p=0xfa1158 "6", from_tty=1) at ../../gdb/top.c:441
#9  0x0000000000573b98 in command_handler (command=0xfa1150 "until 146") at ../../gdb/event-top.c:532
#10 0x000000000057466b in command_line_handler (rl=<optimized out>) at ../../gdb/event-top.c:735
#11 0x0000000000653319 in rl_callback_read_char () at ../../readline/callback.c:220
#12 0x0000000000573c09 in rl_callback_read_char_wrapper (client_data=<optimized out>) at ../../gdb/event-top.c:179
#13 0x0000000000572ab8 in process_event () at ../../gdb/event-loop.c:402
#14 process_event () at ../../gdb/event-loop.c:352
#15 0x0000000000573218 in gdb_do_one_event (data=<optimized out>) at ../../gdb/event-loop.c:467
#16 gdb_do_one_event (data=<optimized out>) at ../../gdb/event-loop.c:417
#17 0x000000000056d7eb in catch_errors (func=0x5730f0 <gdb_do_one_event>, func_args=0x0, errstring=0x70f65c "", mask=<optimized out>)
    at ../../gdb/exceptions.c:506
#18 0x00000000004debd8 in tui_command_loop (data=<optimized out>) at ../../gdb/tui/tui-interp.c:175
#19 0x0000000000454ea9 in captured_command_loop (data=<optimized out>) at ../../gdb/main.c:231
#20 0x000000000056d7eb in catch_errors (func=0x454ea0 <captured_command_loop>, func_args=0x0, errstring=0x70f65c "", mask=<optimized out>)
    at ../../gdb/exceptions.c:506
#21 0x0000000000455b86 in captured_main (data=<optimized out>) at ../../gdb/main.c:1030
#22 0x000000000056d7eb in catch_errors (func=0x455240 <captured_main>, func_args=0x7fffd9864060, errstring=0x70f65c "", mask=<optimized out>)
    at ../../gdb/exceptions.c:506
#23 0x00000000004563b4 in gdb_main (args=<optimized out>) at ../../gdb/main.c:1040
#24 0x0000000000454da9 in main (argc=<optimized out>, argv=<optimized out>) at ../../gdb/gdb.c:49

Comment 1 Nicholas Miell 2012-03-17 02:14:56 UTC
Sorry, mozilla::widget::GfxInfo::Getdata should be mozilla::widget::GfxInfo::GetData

Comment 2 Jan Kratochvil 2012-03-17 07:08:59 UTC
Even FSF GDB HEAD has still stale frame_info pointers:

#1  in freehook (ptr=0xb3c45e0, caller=0x825759) at mcheck.c:211
#2  in xfree (ptr=0xb3c45e0) at ./common/common-utils.c:107
#3  in obstack_free (h=0x1d4ac20, obj=0x0) at obstack.c:367
#4  in reinit_frame_cache () at frame.c:1542 
#5  in switch_to_thread (ptid=...) at thread.c:989
#6  in switch_to_program_space_and_thread (pspace=0x27c38a0) at progspace.c:494 
#7  in skip_prologue_sal (sal=0x24ec190) at symtab.c:2694
#8  in decode_all_digits () at linespec.c:2523
#9  in decode_line_internal () at linespec.c:1132
#10 in decode_line_1 (flags=1default_line=81) at linespec.c:1344
#11 in until_break_command (arg="",from_tty=1,anywhere=0) at breakpoint.c:10532

reinit_frame_cache needs to be removed in these simple cases.

Comment 3 Fedora Update System 2012-04-04 20:07:32 UTC
gdb-7.4.50.20120120-38.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/gdb-7.4.50.20120120-38.fc17

Comment 4 Fedora Update System 2012-04-04 21:48:46 UTC
gdb-7.3.50.20110722-14.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/gdb-7.3.50.20110722-14.fc16

Comment 5 Fedora Update System 2012-04-05 18:25:20 UTC
Package gdb-7.4.50.20120120-38.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gdb-7.4.50.20120120-38.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-5348/gdb-7.4.50.20120120-38.fc17
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2012-04-12 02:20:55 UTC
gdb-7.4.50.20120120-38.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2012-04-19 14:03:59 UTC
gdb-7.3.50.20110722-15.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/gdb-7.3.50.20110722-15.fc16

Comment 8 Fedora Update System 2012-04-24 20:47:58 UTC
gdb-7.4.50.20120120-42.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/gdb-7.4.50.20120120-42.fc17

Comment 9 Fedora Update System 2012-04-24 20:48:14 UTC
gdb-7.3.50.20110722-16.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/gdb-7.3.50.20110722-16.fc16

Comment 10 Fedora Update System 2012-04-24 20:48:35 UTC
gdb-7.3.1-50.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/gdb-7.3.1-50.fc15

Comment 11 Fedora Update System 2012-05-04 23:09:29 UTC
gdb-7.4.50.20120120-42.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2012-08-17 05:55:51 UTC
gdb-7.3.50.20110722-16.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.