elunna / NerfHack

The official rewrite of Hack'EM rebased on NetHack 3.7
3 stars 0 forks source link

extract_nobj: object lost (destroyed potion of monster detection with no monsters) #62

Closed elunna closed 2 hours ago

elunna commented 3 hours ago
Suddenly, the dungeon collapses.
extract_nobj: object lost
  Generating more information you may report:

(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737339574208) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737339574208) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737339574208, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff7283476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff72697f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00005555559c5fb7 in NH_abort (why=0x7fffffffcc90 "extract_nobj: object lost") at end.c:1965
#6  0x00005555559bb179 in panic (str=0x555556127440 "extract_nobj: object lost") at end.c:470
#7  0x0000555555b37c3a in extract_nobj (obj=0x60b0003bea60, head_ptr=0x5555564ebea8 <gi+8>) at mkobj.c:2733
#8  0x0000555555a65030 in freeinv (obj=0x60b0003bea60) at invent.c:1367
#9  0x0000555555a64744 in useupall (obj=0x60b0003bea60) at invent.c:1279
#10 0x0000555555a64857 in useup (obj=0x60b0003bea60) at invent.c:1295
#11 0x0000555555f9a730 in maybe_destroy_item (carrier=0x5555564ed808 <gy+8>, obj=0x60b0003bea60, dmgtyp=2) at zap.c:6939
#12 0x0000555555f9b4c3 in destroy_items (mon=0x5555564ed808 <gy+8>, dmgtyp=2, dmg_in=12) at zap.c:7096
#13 0x00005555559dc7cb in explode (x=43, y=16, type=-11, dam=12, olet=21 '\025', expltype=5) at explode.c:652
#14 0x0000555555e95d16 in b_trapped (item=0x55555610bc80 "door", bodypart=3) at trap.c:7363
#15 0x0000555555a9b195 in doopen_indir (x=44, y=16) at lock.c:977
#16 0x0000555555a1daf0 in test_move (ux=43, uy=16, dx=1, dy=0, mode=0) at hack.c:1030
#17 0x0000555555a2f855 in domove_core () at hack.c:2791
#18 0x0000555555a2da90 in domove () at hack.c:2572
#19 0x000055555586b832 in rhack (key=108) at cmd.c:3476
#20 0x00005555557c555a in moveloop_core () at allmain.c:554
#21 0x00005555557c5a58 in moveloop (resuming=0 '\000') at allmain.c:585
#22 0x0000555555f9e912 in main (argc=4, argv=0x7fffffffdf18) at ../sys/unix/unixmain.c:323

Program received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737339574208) at ./nptl/pthread_kill.c:44
44  ./nptl/pthread_kill.c: No such file or directory.

(gdb) p gt.toplines
$1 = "You are caught in the explosion!  Your potion of monster detection boils and explodes!  You feel threatened.", '\000' <repeats 191 times>

This is a problem I handled before in HackEM after porting extra vapor effects from potions. A potion of monster detection is destroyed somehow, no monsters are on the level so it triggers the potion being used up after detection, but the potion was already destroyed by the original effect.

elunna commented 2 hours ago

Fixed in b01187e1c and c4a458f94 (both ported from HackEM)