calref / cboe

Classic Blades of Exile
http://spiderwebforums.ipbhost.com/index.php?/forum/12-blades-of-exile/
Other
173 stars 42 forks source link

Dialog: Error!!! std::bad_alloc in Village Ruins #209

Open clort81 opened 4 years ago

clort81 commented 4 years ago

dialog-villageruins

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Thread 1 "Blades of Exile" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x0000007fb779ae68 in __GI_abort () at abort.c:79
#2  0x0000007fb7a51278 in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#3  0x0000007fb7a4efac in ?? () from /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#4  0x0000007fb7a4f000 in std::terminate() () from /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#5  0x0000007fb7a4f330 in __cxa_rethrow () from /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#6  0x000000555562e634 in main (argc=1, argv=0x7fffffeda8) at build/obj/game/boe.main.cpp:128
CelticMinstrel commented 4 years ago

Is this reproduceable? If it can be reliably reproduced, it might be nice to get a stack trace of the actual original throw point (rather than the rethrow in main). The way to do that (if it is indeed reliably reproduceable) would be to comment out the exception handler in main.

clort81 commented 4 years ago

Got another one talking to the guy in the foundry. badalloc2

clort81 commented 4 years ago

Disabled the exception handler in main and got a backtrace:

[New Thread 0x7fb50dd090 (LWP 19200)]
[New Thread 0x7fb46b5090 (LWP 19201)]
[New Thread 0x7faffff090 (LWP 19202)]
[Thread 0x7faffff090 (LWP 19202) exited]
_NET_WM_STATE_ABOVE has atom of 325
_NET_WM_STATE has atom of 324
[Detaching after vfork from child process 19204]
Warning: Missing opcode definition for special node type with ID 56
Warning: Missing opcode definition for special node type with ID 57
Warning: Missing opcode definition for special node type with ID 59
Warning: Missing opcode definition for special node type with ID 60

Thread 1 "Blades of Exile" received signal SIGSEGV, Segmentation fault.
__memcpy_generic () at ../sysdeps/aarch64/multiarch/../memcpy.S:99
99  ../sysdeps/aarch64/multiarch/../memcpy.S: No such file or directory.
(gdb) bt
#0  __memcpy_generic () at ../sysdeps/aarch64/multiarch/../memcpy.S:99
#1  0x0000007fb7ae0820 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
   from /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#2  0x0000007fb7ae0b64 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
   from /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#3  0x0000005555687fac in get_strs (
    str1="There's nothing left here now, except for a grim warning of what the Vale will look like if the curse is left unchecked.", str2="", cur_type=1, which_str1=26, which_str2=27) at build/obj/game/boe.specials.cpp:4626
#4  0x000000555567ae1c in oneshot_spec (which_mode=eSpecCtx::OUT_MOVE, cur_node=..., cur_spec_type=1, 
    next_spec=0x7fffffa89e, next_spec_type=0x7fffffa89c, a=0x7fffffaa36, b=0x7fffffaa34, redraw=0x7fffffaa32)
    at build/obj/game/boe.specials.cpp:2551
#5  0x0000005555677f14 in run_special (which_mode=eSpecCtx::OUT_MOVE, which_type=1, start_spec=21, spec_loc=..., 
    a=0x7fffffaa36, b=0x7fffffaa34, redraw=0x7fffffaa32) at build/obj/game/boe.specials.cpp:2040
#6  0x000000555566b0e4 in check_special_terrain (where_check=..., mode=eSpecCtx::OUT_MOVE, which_pc=..., 
    forced=0x7fffffb1f7) at build/obj/game/boe.specials.cpp:170
#7  0x0000005555591f10 in outd_move_party (destination=..., forced=false) at build/obj/game/boe.actions.cpp:2812
#8  0x0000005555583aec in handle_move (destination=..., did_something=@0x7fffffbb28: false, 
    need_redraw=@0x7fffffbb29: false, need_reprint=@0x7fffffbb27: false) at build/obj/game/boe.actions.cpp:482
#9  0x00000055555878a0 in handle_action (event=...) at build/obj/game/boe.actions.cpp:1144
#10 0x000000555558a3cc in handle_keystroke (event=...) at build/obj/game/boe.actions.cpp:1682
#11 0x0000005555630bd4 in Handle_One_Event () at build/obj/game/boe.main.cpp:236
#12 0x00000055556301e8 in main (argc=1, argv=0x7fffffeda8) at build/obj/game/boe.main.cpp:122
(gdb) 

In another attempt, i get the following text Village_ruins And i note that the str1 and str2 in the crashed version above do not match the dialogue text shown here.

When i set a breakpoint at line 4623 (case 1: in get_strs) of boe.specials.cpp, i see empty str1 and str2

Thread 1 "Blades of Exile" hit Breakpoint 1, get_strs (str1="", str2="", cur_type=1, which_str1=24, which_str2=25)
    at build/obj/game/boe.specials.cpp:4623
4623                if(which_str1 >= 0)
(gdb) print str1
$3 = ""
(gdb) print str2
$4 = ""
(gdb) bt
#0  get_strs (str1="", str2="", cur_type=1, which_str1=24, which_str2=25) at build/obj/game/boe.specials.cpp:4623
#1  0x000000555567ae1c in oneshot_spec (which_mode=eSpecCtx::OUT_MOVE, cur_node=..., cur_spec_type=1, 
    next_spec=0x7fffffa89e, next_spec_type=0x7fffffa89c, a=0x7fffffaa36, b=0x7fffffaa34, redraw=0x7fffffaa32)
    at build/obj/game/boe.specials.cpp:2551
#2  0x0000005555677f14 in run_special (which_mode=eSpecCtx::OUT_MOVE, which_type=1, start_spec=21, spec_loc=..., 
    a=0x7fffffaa36, b=0x7fffffaa34, redraw=0x7fffffaa32) at build/obj/game/boe.specials.cpp:2040
#3  0x000000555566b0e4 in check_special_terrain (where_check=..., mode=eSpecCtx::OUT_MOVE, which_pc=..., 
    forced=0x7fffffb1f7) at build/obj/game/boe.specials.cpp:170
#4  0x0000005555591f10 in outd_move_party (destination=..., forced=false) at build/obj/game/boe.actions.cpp:2812
#5  0x0000005555583aec in handle_move (destination=..., did_something=@0x7fffffbb28: false, 
    need_redraw=@0x7fffffbb29: false, need_reprint=@0x7fffffbb27: false) at build/obj/game/boe.actions.cpp:482
#6  0x00000055555878a0 in handle_action (event=...) at build/obj/game/boe.actions.cpp:1144
#7  0x000000555558a3cc in handle_keystroke (event=...) at build/obj/game/boe.actions.cpp:1682
#8  0x0000005555630bd4 in Handle_One_Event () at build/obj/game/boe.main.cpp:236
#9  0x00000055556301e8 in main (argc=1, argv=0x7fffffeda8) at build/obj/game/boe.main.cpp:122
(gdb) 

Continuing from there, I get the "std::bad_alloc"

(gdb) cont
Continuing.

Thread 1 "Blades of Exile" hit Breakpoint 1, get_strs (str1="", str2="", cur_type=1, which_str1=26, which_str2=27)
    at build/obj/game/boe.specials.cpp:4623
4623                if(which_str1 >= 0)
(gdb) cont
Continuing.
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Thread 1 "Blades of Exile" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x0000007fb779ae68 in __GI_abort () at abort.c:79
#2  0x0000007fb7a51278 in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#3  0x0000007fb7a4efac in ?? () from /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#4  0x0000007fb7a4f000 in std::terminate() () from /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#5  0x0000007fb7a4f330 in __cxa_rethrow () from /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#6  0x00000055556302ec in main (argc=1, argv=0x7fffffeda8) at build/obj/game/boe.main.cpp:128

This might also be of interest?

(gdb) call (void)puts(univ.out->spec_strs[which_str1])
This town can't have been ruins for long. You doubt it's been abandoned for more than five years or so. The giant lizards did fast work, however - they moved through, ate some things, tore everything else up, and left.
(gdb) call (void)puts(univ.out->spec_strs[which_str2])
Bandits picked apart the rest.

EDIT: Attached savefile just above Village Ruins. bad_alloc_save.zip

x-qq commented 4 years ago

I have loaded your savegame and moved the party south into the special node, but I did not get a crash.

Cannot reproduce.