I am getting a crash in MinGW-GDB 7.3-2 and I was referred here to report it. Here is a full log, including a backtrace: http://pastebin.com/BWmnFdAr GDB crashes once I run the target program. The same error occurs both with the stock MinGW-GDB and a binary I built myself to output a useful backtrace with CFLAGS containing "-O0 -ggdb -static". Here is the eduke32.debug.exe I used: http://dukeworld.duke4.net/eduke32/synthesis/20110928-2047/eduke32_win32_20110928-2047.zip If it is any use at all, here is the gdb.exe I compiled: http://hendricks266.duke4.net/stuff/gdb-7.3-2_mingw32_-ggdb_-O0_-static.7z
GNU gdb (GDB) 7.3 Copyright (C) 2011 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 "mingw32". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from t:\games\eduke32\gdb.exe...done. (gdb) r Starting program: t:\games\eduke32\gdb.exe --args eduke32.debug.exe [New Thread 9420.0x2300] GNU gdb (GDB) 7.3 Copyright (C) 2011 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 "mingw32". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from t:\games\eduke32\eduke32.debug.exe...done. (gdb) r Starting program: t:\games\eduke32\eduke32.debug.exe [New Thread 9420.0x2328] [New Thread 9420.0xeb4] [New Thread 9440.0x25e0] Program received signal SIGSEGV, Segmentation fault. 0x0053793f in coff_symtab_read (symtab_offset=84512, nsyms=799, objfile=0x489a748) at coffread.c:935 935 if (bfd_section->flags & SEC_CODE) (gdb) bt #0 0x0053793f in coff_symtab_read (symtab_offset=84512, nsyms=799, objfile=0x489a748) at coffread.c:935 #1 0x00536f54 in coff_symfile_read (objfile=0x489a748, symfile_flags=8) at coffread.c:608 #2 0x0040a8a3 in syms_from_objfile (objfile=0x489a748, addrs=0x488d4e0, offsets=0x0, num_offsets=0, add_flags=8) at symfile.c:1020 #3 0x0040aa75 in symbol_file_add_with_addrs_or_offsets (abfd=0x47e54c8, add_flags=8, addrs=0x488d4e0, offsets=0x0, num_offsets=0, flags=2) at symfile.c:1123 #4 0x0040ac3a in symbol_file_add_from_bfd (abfd=0x47e54c8, add_flags=8, addrs=0x488d4e0, flags=2) at symfile.c:1216 #5 0x00486b40 in solib_read_symbols (so=0x489a308, flags=8) at solib.c:650 #6 0x00487053 in solib_add (pattern=0x0, from_tty=0, target=0x8d8c20, readsyms=1) at solib.c:956 #7 0x0042621b in handle_inferior_event (ecs=0x246f90c) at infrun.c:3174 #8 0x0042543c in wait_for_inferior (treat_exec_as_sigtrap=0) at infrun.c:2610 #9 0x004248f1 in proceed (addr=2089816591, siggnal=TARGET_SIGNAL_0, step=0) at infrun.c:2136 #10 0x0041c5d8 in run_command_1 (args=0x0, from_tty=1, tbreak_at_main=0) at infcmd.c:600 #11 0x0041c60e in run_command (args=0x0, from_tty=1) at infcmd.c:610 #12 0x0043d7b7 in do_cfunc (c=0x289e2b8, args=0x0, from_tty=1) at ./cli/cli-decode.c:67 #13 0x0043fddb in cmd_func (cmd=0x289e2b8, args=0x0, from_tty=1) at ./cli/cli-decode.c:1777 #14 0x004028f4 in execute_command (p=0x244591 "", from_tty=1) at top.c:428 #15 0x004364bc in command_handler (command=0x244590 "") at event-top.c:499 #16 0x004369c3 in command_line_handler (rl=0x2d58e50 "r") at event-top.c:704 #17 0x005e1a83 in rl_callback_read_char () at callback.c:205 #18 0x00435c4b in rl_callback_read_char_wrapper (client_data=0x0) at event-top.c:177 #19 0x004363b9 in stdin_event_handler (error=0, client_data=0x0) at event-top.c:434 #20 0x00458e57 in handle_file_event (data=...) at event-loop.c:831 #21 0x00458651 in process_event () at event-loop.c:402 #22 0x00458713 in gdb_do_one_event (data=0x0) at event-loop.c:467 #23 0x00422195 in catch_errors (func=0x45865f <gdb_do_one_event>, func_args=0x0, errstring=0x6f86e0 "", mask=6) at exceptions.c:521 #24 0x00458755 in start_event_loop () at event-loop.c:491 #25 0x00435d74 in cli_command_loop () at event-top.c:210 #26 0x00415a7a in current_interp_command_loop () at interps.c:293 #27 0x0040164a in captured_command_loop (data=0x0) at ./main.c:228 #28 0x00422195 in catch_errors (func=0x40163f <captured_command_loop>, func_args=0x0, errstring=0x6dc080 "", mask=6) at exceptions.c:521 #29 0x004024b5 in captured_main (data=0x246ff40) at ./main.c:936 #30 0x00422195 in catch_errors (func=0x401680 <captured_main>, func_args=0x246ff40, errstring=0x6dc080 "", mask=6) at exceptions.c:521 #31 0x004024eb in gdb_main (args=0x246ff40) at ./main.c:945 #32 0x004013e0 in main (argc=3, argv=0x2441c8) at gdb.c:35 (gdb) quit A debugging session is active. Inferior 1 [process 9420] will be killed. Quit anyway? (y or n)
I was able to work around the bug by adding this snippet at line 935 in coffread.c: if (bfd_section == 0) ms_type = mst_unknown; else This probably is not an ideal solution but I have encountered no problems with it so far.
Sorry, nobody got to downloading the bad .exe when it was still around. If this is still an issue, I think just the .exe would be enough to reproduce the bug.
(In reply to Tom Tromey from comment #3) > Sorry, nobody got to downloading the bad .exe when it > was still around. If this is still an issue, I think just > the .exe would be enough to reproduce the bug. The file was apparently moved, I found it at this new location: http://dukeworld.duke4.net/eduke32/synthesis/old/2011/20110928-2047/eduke32_win32_20110928-2047.zip But I can't reproduce any crash, not even with the compiled gdb he provided. Maybe I would need a full Duke Nukem 3D copy to reproduce the issue.