Bug 426395 - gdb crash when setting breakpoint
gdb crash when setting breakpoint
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: gdb (Show other bugs)
8
All Linux
low Severity low
: ---
: ---
Assigned To: Jan Kratochvil
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-12-20 14:19 EST by Tom Tromey
Modified: 2014-08-11 01:46 EDT (History)
1 user (show)

See Also:
Fixed In Version: 6.6-38.fc8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-12-23 17:51:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tom Tromey 2007-12-20 14:19:47 EST
gdb crashes when I try to set a breakpoint on 'main'
in a certain executable.

mopsy. rpm -q gdb
gdb-6.6-36.fc8


The source files are trivial:

mopsy. cat h.h
#define VALUE 5
mopsy. cat m.c
#include "h.h"
#include <stdio.h>

int main()
{
  printf ("%d\n", VALUE);
}


Compile with PCH and with -g3:

mopsy. gcc -g3 -o h.h.gch h.h
mopsy. gcc -g3 -I. -Winvalid-pch -o m m.c


Now debug 'm' and try "b main".  gdb crashes.

Program received signal SIGSEGV, Segmentation fault.
0x081072d4 in symbol_found (funfirstline=<value optimized out>, 
    canonical=0xbf8e6cc4, copy=0xbf8e69e0 "main", sym=0x9ba39d4, 
    file_symtab=0x0, sym_symtab=0x322e312e) at ../../gdb/linespec.c:2192
2192              if (lookup_block_symbol (b, copy, NULL, VAR_DOMAIN) != NULL)

#0  0x081072d4 in symbol_found (funfirstline=<value optimized out>, 
    canonical=0xbf8e6cc4, copy=0xbf8e69e0 "main", sym=0x9ba39d4, 
    file_symtab=0x0, sym_symtab=0x322e312e) at ../../gdb/linespec.c:2192
#1  0x081073b4 in decode_variable_1 (copy=0xbf8e69e0 "main", funfirstline=1, 
    canonical=0xbf8e6cc4, file_symtab=0x0) at ../../gdb/linespec.c:1998
#2  0x081098f8 in decode_line_1 (argptr=0xbf8e6c68, funfirstline=1, 
    default_symtab=0x0, default_line=0, canonical=0xbf8e6cc4, 
    not_found_ptr=0xbf8e6cc0) at ../../gdb/linespec.c:2062
#3  0x080d2afb in parse_breakpoint_sals (address=0xbf8e6c68, sals=0xbf8e6cb4, 
    addr_string=0xbf8e6cc4, not_found_ptr=0xbf8e6cc0)
    at ../../gdb/breakpoint.c:5260
#4  0x0811c2d2 in catch_exception (uiout=0x9b805d0, 
    func=0x80d2b50 <do_captured_parse_breakpoint>, func_args=0xbf8e6c98, 
    mask=6) at ../../gdb/exceptions.c:469
#5  0x080d85cc in break_command_1 (arg=0x9b4610e "", flag=0, 
    from_tty=163286116, pending_bp=0x0) at ../../gdb/breakpoint.c:5425
#6  0x0807ed63 in execute_command (p=0x9b4610d "n", from_tty=1)
    at ../../gdb/top.c:456
#7  0x0811fb0f in command_handler (command=0x9b46108 "b main")
    at ../../gdb/event-top.c:519
#8  0x08120711 in command_line_handler (rl=0x9b885b8 "")
    at ../../gdb/event-top.c:804
#9  0x005a7822 in rl_callback_read_char () at ../callback.c:205
#10 0x0811fceb in rl_callback_read_char_wrapper (client_data=0x0)
    at ../../gdb/event-top.c:179
#11 0x0811f65e in handle_file_event (event_file_desc=0)
    at ../../gdb/event-loop.c:730
#12 0x0811eb19 in process_event () at ../../gdb/event-loop.c:343
#13 0x0811f2e8 in gdb_do_one_event (data=0x0) at ../../gdb/event-loop.c:380
#14 0x0811c0b3 in catch_errors (func=0x811f1d0 <gdb_do_one_event>, 
    func_args=0x0, errstring=0x8235d09 "", mask=6)
    at ../../gdb/exceptions.c:515
#15 0x080c5474 in tui_command_loop (data=0x0) at ../../gdb/tui/tui-interp.c:151
#16 0x0811c55f in current_interp_command_loop () at ../../gdb/interps.c:278
#17 0x0807807b in captured_command_loop (data=0x0) at ../../gdb/main.c:101
#18 0x0811c0b3 in catch_errors (func=0x8078070 <captured_command_loop>, 
    func_args=0x0, errstring=0x8235d09 "", mask=6)
    at ../../gdb/exceptions.c:515
#19 0x08078828 in captured_main (data=0xbf8e7074) at ../../gdb/main.c:828
#20 0x0811c0b3 in catch_errors (func=0x80780b0 <captured_main>, 
    func_args=0xbf8e7074, errstring=0x8235d09 "", mask=6)
    at ../../gdb/exceptions.c:515
#21 0x08078061 in gdb_main (args=0xbf8e7074) at ../../gdb/main.c:837
#22 0x08078025 in main (argc=3, argv=0x9bb8c2c) at ../../gdb/gdb.c:35
Comment 1 Jan Kratochvil 2007-12-21 17:12:49 EST
Thanks, it is a regression from my faulty fix of Bug 109921.
To be fixed in F-8 gdb-6.6-38.fc8 by a backport from:
  http://sourceware.org/ml/gdb-patches/2007-01/msg00434.html
Rawhide is already using the upstream variant from Daniel Jacobowitz.
F-8 test scratch build available at:
  http://koji.fedoraproject.org/koji/taskinfo?taskID=306014

FYI gcc-4.1.2-33.x86_64 produces there a suboptimal duplicite entry:

Dump of debug contents of section .debug_line:
 The File Name Table:
  Entry Dir     Time    Size    Name
  1     0       0       0       m.c
...
  17    0       0       0       m.c
Comment 3 Fedora Update System 2007-12-23 17:51:45 EST
gdb-6.6-38.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 4 Fedora Update System 2007-12-26 18:52:02 EST
gdb-6.6-38.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

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