AmyBSOD/dnhslex

Discoveries can crash the game

AmyBSOD opened this issue · 0 comments

(gdb) backtrace
#0 0x00000008010a66d7 in ftello () from /lib/libc.so.7
#1 0x00000000006824ca in obj_typename (otyp=17458830) at src/objnam.c:354
#2 0x00000000006818f2 in dodiscovered () at src/o_init.c:1236
#3 0x0000000000463147 in doextcmd () at src/cmd.c:323
Chris-plus-alphanumericgibberish#4 0x0000000000468c57 in rhack (cmd=0xb42810 "#") at src/cmd.c:5124
Chris-plus-alphanumericgibberish#5 0x000000000040507d in moveloop ()
Chris-plus-alphanumericgibberish#6 0x00000000007fd637 in main (argc=,
argv=) at sys/unix/unixmain.c:296

This happens when starting a new game as a chiropteran samurai and going to the discoveries screen. All attempts to reproduce this in regular dnethack have failed, probably because samurai can't be chiropterans there and none of the playable combos have the bug. Anyway, this sure looks like either an oversight with the xchar-to-int conversion, or the game trying to access a freed or otherwise invalid pointer, but the 17458830 must be put in the player's discoveries array at game start since the bug happens directly after starting a new game, so the discoveries are obviously just being initialized wrongly at game start. What is causing this?