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/10498] New: segfault on "run <program>" when built with gcc 4.3.4


Hi,

I just recompiled gdb-6.8 from scratch and keep on getting segfaults when I run 
the program to be debugged.
It worked fine when built with gcc 4.3.3, but today I updated to 4.3.4, compiled 
the "archer-jankratochvil-fedora-merge" branch, which segfaulted, then switched 
to the release version and found that it also segfaults.

I had to modify the gdb-6.8 source to make it compile:
- change some "NULL" in buildsym.c and xml-tdesc.c to "(void*) NULL" to make gcc 
shut up about missing sentinels,
- also #include <linux/limits.h> in hostio.c so PATH_MAX is found.
but that is all (analogous for the archer-* branch)

Using my distribution's gdb-6.4.90-debian to debug gdb-6.8 shows following 
backtrace:

$> /usr/bin/gdb
GNU gdb 6.4.90-debian
Copyright (C) 2006 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 "i486-linux-gnu".
(gdb) file /localdata/bin/gdb
Reading symbols from /localdata/bin/gdb...done.
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) run
Starting program: /localdata/bin/gdb
Failed to read a valid object file image from memory.
[Thread debugging using libthread_db enabled]
[New Thread -1211771200 (LWP 18889)]
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
(gdb) run

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1211771200 (LWP 18889)]
0xb7cdc43b in strlen () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0  0xb7cdc43b in strlen () from /lib/tls/i686/cmov/libc.so.6
#1  0xb7cb0164 in vfprintf () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7ccdc6c in vasprintf () from /lib/tls/i686/cmov/libc.so.6
#3  0x08089356 in xstrvprintf (format=0x82ff3a7 "%s", ap=0xbf8ea8ac "\002") at 
utils.c:1027
#4  0x0808a821 in vfprintf_maybe_filtered (stream=0x2, format=0xb7cad3e5 
"\213u\020\213M\020\213>\203~\004\211\215l~~~\205~\017\204`&",
    args=0x2 <Address 0x2 out of bounds>, filter=1) at utils.c:2103
#5  0x0818ba58 in cli_field_string (uiout=0x837ebe8, fldno=1, width=0, 
align=ui_noalign, fldname=0x0, string=0x82a38ca "Starting program")
    at cli-out.c:363
#6  0x0818add7 in ui_out_field_string (uiout=0x837ebe8, fldname=0x0, 
string=0x82a38ca "Starting program") at ui-out.c:937
#7  0x081221fd in run_command_1 (args=0x0, from_tty=1, tbreak_at_main=0) at 
infcmd.c:541
#8  0x08087611 in execute_command (p=0x834b12b "", from_tty=1) at top.c:449
#9  0x0813338f in command_handler (command=0x834b128 "") at event-top.c:518
#10 0x08134272 in command_line_handler (rl=0x837c0b8 "~\b8\bP\0378\b") at event-
top.c:804
#11 0x081e4a15 in rl_callback_read_char () at callback.c:205
#12 0x0813367b in rl_callback_read_char_wrapper (client_data=0x0) at event-
top.c:177
#13 0x08132f97 in handle_file_event (event_file_desc=0) at event-loop.c:728
#14 0x081323da in process_event () at event-loop.c:341
#15 0x08132c78 in gdb_do_one_event (data=0x0) at event-loop.c:378
#16 0x0812f873 in catch_errors (func=0x8132ab0 <gdb_do_one_event>, 
func_args=0x0, errstring=0x8280480 "", mask=6) at exceptions.c:513
#17 0x080d313a in tui_command_loop (data=0x0) at .././gdb/tui/tui-interp.c:153
#18 0x0812fe94 in current_interp_command_loop () at interps.c:276
#19 0x0808039b in captured_command_loop (data=0x0) at .././gdb/main.c:99
#20 0x0812f873 in catch_errors (func=0x8080390 <captured_command_loop>, 
func_args=0x0, errstring=0x8280480 "", mask=6) at exceptions.c:513
#21 0x0807fe3c in captured_main (data=0xbf8ead44) at .././gdb/main.c:882
#22 0x0812f873 in catch_errors (func=0x807f190 <captured_main>, 
func_args=0xbf8ead44, errstring=0x8280480 "", mask=6) at exceptions.c:513
#23 0x0807f181 in gdb_main (args=0xbf8ead44) at .././gdb/main.c:891
#24 0x0807f145 in main (argc=Cannot access memory at address 0x2
) at gdb.c:33
(gdb)

-- 
           Summary: segfault on "run <program>" when built with gcc 4.3.4
           Product: gdb
           Version: 6.8
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: dennis dot wassel at googlemail dot com
                CC: gdb-prs at sourceware dot org
  GCC host triplet: i686-pc-linux-gnu


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

------- 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]