Bug 128284 - gdb(1) segfaults
Summary: gdb(1) segfaults
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: gnu (show other bugs)
Version: 7.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-22 01:50 UTC by Dmitry Marakasov
Modified: 2014-08-27 21:08 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Marakasov freebsd_committer 2008-10-22 01:50:00 UTC
gdb segfaults when I try to debug sepecific programs. Befor I've used gdb66 from ports, but now I can't as it doesn't seem to work properly with threads, so I think these segfaults should be investigated and fixed. For now I'm debugging ports/games/spring - it's complex game application utilizing threads and bunch of other stuff. The game starts under gdb without problems, but gdb segfaults when the game begin loading phase.

Full log here: http://people.freebsd.org/~amdmi3/gdb.log

--- gdb.log begins here ---
Starting program: /usr/bin/gdb prefix/bin/spring

Program received signal SIGSEGV, Segmentation fault.
0x283a43d4 in _malloc_prefork () from /lib/libc.so.7
#0  0x283a43d4 in _malloc_prefork () from /lib/libc.so.7
#1  0x283a58d3 in realloc () from /lib/libc.so.7
#2  0x080d617b in mrealloc (md=0x0, ptr=0x32eb3000, size=26040) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/utils.c:1000
#3  0x080d6270 in xmrealloc (md=0x0, ptr=0x32eb3000, size=26040) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/utils.c:1078
#4  0x080d6351 in xrealloc (ptr=0x32eb3000, size=26040) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/utils.c:1134
#5  0x0810583f in target_resize_to_sections (target=0x829ddc0, num_added=22) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/target.c:1402
#6  0x080c5e8f in update_solib_list (from_tty=0, target=0x829ddc0) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/solib.c:515
#7  0x080c5f2f in solib_add (pattern=0x0, from_tty=0, target=0x829ddc0, readsyms=1) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/solib.c:559
#8  0x0816b2e9 in handle_inferior_event (ecs=0xbfbfe2e8) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/infrun.c:2402
#9  0x081694a8 in wait_for_inferior () at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/infrun.c:1047
#10 0x08169299 in proceed (addr=18446744073709551615, siggnal=TARGET_SIGNAL_0, step=0) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/infrun.c:852
#11 0x080e88f5 in child_create_inferior (exec_file=0x285076a0 "/usr/home/amdmi3/projects/freebsd/ports/games/spring/prefix/bin/spring", allargs=0x2855a11c "", env=0x2855b200)
    at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/inftarg.c:368
#12 0x081a5045 in fbsd_thread_create_inferior (exec_file=0x285076a0 "/usr/home/amdmi3/projects/freebsd/ports/games/spring/prefix/bin/spring", allargs=0x2855a11c "", env=0x2855b200)
    at /usr/src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c:1018
#13 0x0810579a in find_default_create_inferior (exec_file=0x285076a0 "/usr/home/amdmi3/projects/freebsd/ports/games/spring/prefix/bin/spring", allargs=0x2855a11c "", env=0x2855b200)
    at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/target.c:1356
#14 0x08074e08 in run_command (args=0x0, from_tty=1) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/infcmd.c:475
#15 0x080c30f7 in do_cfunc (c=0x28584fd0, args=0x0, from_tty=1) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/cli/cli-decode.c:57
#16 0x080c5602 in cmd_func (cmd=0x28584fd0, args=0x0, from_tty=1) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/cli/cli-decode.c:1541
#17 0x080e65c4 in execute_command (p=0x28502083 "", from_tty=1) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/top.c:743
#18 0x08092ba2 in command_handler (command=0x28502080 "") at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/event-top.c:500
#19 0x08093407 in command_line_handler (rl=0x28501098 "run") at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/event-top.c:793
#20 0x282d47e3 in rl_callback_read_char () from /lib/libreadline.so.7
#21 0x080922a3 in rl_callback_read_char_wrapper (client_data=0x0) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/event-top.c:166
#22 0x08092a3e in stdin_event_handler (error=0, client_data=0x0) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/event-top.c:416
#23 0x08094328 in handle_file_event (event_file_desc=0) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/event-loop.c:721
#24 0x08093b58 in process_event () at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/event-loop.c:334
#25 0x08093ba1 in gdb_do_one_event (data=0x0) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/event-loop.c:371
#26 0x080e619d in do_catch_errors (uiout=0x285516e0, data=0xbfbfe6f8) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/top.c:523
#27 0x080e5f67 in catcher (func=0x80e6181 <do_catch_errors>, func_uiout=0x285516e0, func_args=0xbfbfe6f8, func_val=0xbfbfe704, func_caught=0xbfbfe700, errstring=0x82640d1 "", gdberrmsg=0x0, mask=6)
    at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/top.c:430
#28 0x080e61f2 in catch_errors (func=0x8093b6d <gdb_do_one_event>, func_args=0x0, errstring=0x82640d1 "", mask=6) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/top.c:535
#29 0x081a9e63 in tui_command_loop (data=0x0) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/tui/tui-interp.c:150
#30 0x08074385 in current_interp_command_loop () at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/interps.c:277
#31 0x08073033 in captured_command_loop (data=0x0) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/main.c:97
#32 0x080e619d in do_catch_errors (uiout=0x285516e0, data=0xbfbfe808) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/top.c:523
#33 0x080e5f67 in catcher (func=0x80e6181 <do_catch_errors>, func_uiout=0x285516e0, func_args=0xbfbfe808, func_val=0xbfbfe814, func_caught=0xbfbfe810, errstring=0x81fd9bc "", gdberrmsg=0x0, mask=6)
    at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/top.c:430
#34 0x080e61f2 in catch_errors (func=0x8073028 <captured_command_loop>, func_args=0x0, errstring=0x81fd9bc "", mask=6) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/top.c:535
#35 0x08073e20 in captured_main (data=0xbfbfeab0) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/main.c:805
#36 0x080e619d in do_catch_errors (uiout=0x827df40, data=0xbfbfea68) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/top.c:523
#37 0x080e5f67 in catcher (func=0x80e6181 <do_catch_errors>, func_uiout=0x827df40, func_args=0xbfbfea68, func_val=0xbfbfea74, func_caught=0xbfbfea70, errstring=0x81fd9bc "", gdberrmsg=0x0, mask=6)
    at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/top.c:430
#38 0x080e61f2 in catch_errors (func=0x8073069 <captured_main>, func_args=0xbfbfeab0, errstring=0x81fd9bc "", mask=6) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/top.c:535
#39 0x08073e8c in gdb_main (args=0xbfbfeab0) at /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/main.c:814
#40 0x0807301b in main (argc=2, argv=0xbfbfeb0c) at /usr/src/gnu/usr.bin/gdb/gdb/../../../../contrib/gdb/gdb/gdb.c:35
--- gdb.log ends here ---

How-To-Repeat: Debug ports/games/spring, most likely much other stuff