Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: gdb segfaults (derefs NULL) for non-BFD input Version-Release number of selected component (if applicable): gdb-7.1-9.fc13.x86_64 How reproducible: every time Steps to Reproduce: 1. : > k; gdb k 2. 3. Actual results: segfault Expected results: diagnostic about invalid file Additional info: $ : > k; /usr/bin/gdb --args /usr/bin/gdb k Reading symbols from /usr/bin/gdb...Reading symbols from /usr/lib/debug/usr/bin/gdb.debug...done. done. (gdb) r Starting program: /usr/bin/gdb k [Thread debugging using libthread_db enabled] Detaching after fork from child process 9551. GNU gdb (GDB) Fedora (7.1-9.fc13) Copyright (C) 2010 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 "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Program received signal SIGSEGV, Segmentation fault. bfd_check_format_matches (abfd=0x0, format=bfd_core, matching=0x0) at ../../bfd/format.c:131 131 if (!bfd_read_p (abfd) (gdb) p abfd $1 = (bfd *) 0x0 (gdb) bt #0 bfd_check_format_matches (abfd=0x0, format=bfd_core, matching=0x0) at ../../bfd/format.c:131 #1 0x000000000044a9ba in exec_file_attach (filename=0x7fffffffdd6e "k", from_tty=<value optimized out>) at ../../gdb/exec.c:268 #2 0x0000000000448517 in exec_or_core_file_attach ( filename=<value optimized out>, from_tty=<value optimized out>) at ../../gdb/main.c:257 #3 0x0000000000540417 in catch_command_errors (command=<value optimized out>, arg=<value optimized out>, from_tty=<value optimized out>, mask=<value optimized out>) at ../../gdb/exceptions.c:525 #4 0x0000000000449177 in captured_main (data=<value optimized out>) at ../../gdb/main.c:888 #5 0x00000000005404ab in catch_errors (func=<value optimized out>, func_args=<value optimized out>, errstring=<value optimized out>, mask=<value optimized out>) at ../../gdb/exceptions.c:510 #6 0x00000000004483b4 in gdb_main (args=0x3) at ../../gdb/main.c:1009 #7 0x0000000000448389 in main (argc=<value optimized out>, argv=<value optimized out>) at ../../gdb/gdb.c:47 Note that this is already fixed "upstream". Using it, I get what I would have expected: $ gdb k "/t/k": not in executable format: File truncated
*** This bug has been marked as a duplicate of bug 581215 ***