NetHack / NetHack

Official NetHack Git Repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assert hit: trapped without a trap (fmon). After DRUM_OF_EARTHQUAKE (with hallusination) #debugfuzzer

mkuoppal opened this issue · comments

During debugfuzzer dungeon collapsed. Monsters were fleeing for DRUM_OF_EARTHQUAKE.

Assert hit: trapped without a trap (fmon)

Last lines from ttyrec: (I can submit more from ttyrec if needed)

e winter wolf cub turns to flee.^[[K^[[6;9H\357\333re'q^D^@n^@^@^@^[[1;37HThe womble turns to flee.^[[K^M^M
Oops...^M
^M
^[[7mHit space to continue: ^[[27m^[[H^[[2J^[[H^[[?1049l^[[23;0;0t^M
\357\333re[q^D^@"^@^@^@SuddenLy, the dungeon collapses.^M
\357\333reuq^D^@^_^@^@^@trapped without a trap (fmon)^M
\357\333re\357q^D^@1^@^@^@ Generating more information you may report:^M
^M
\357\333re\200\221^D^@h^B^@^@[00] /home/miku/nh/install/games/lib/nethackdir/nethack(+0x261c2e) [0x560400056c2e]^M
[01] /home/miku/nh/install/games/lib/nethackdir/nethack(+0x4f3b05) [0x5604002e8b05]^M
[02] /home/miku/nh/install/games/lib/nethackdir/nethack(+0x4f39dc) [0x5604002e89dc]^M
[03] /home/miku/nh/install/games/lib/nethackdir/nethack(panic+0x6e3) [0x5604002eb597]^M
[04] /home/miku/nh/install/games/lib/nethackdir/nethack(impossible+0x2d9) [0x56040056e444]^M
[05] /home/miku/nh/install/games/lib/nethackdir/nethack(+0x640d49) [0x560400435d49]^M
[06] /home/miku/nh/install/games/lib/nethackdir/nethack(mon_sanity_check+0x5f) [0x560400436a9c]^M
\357\333re\315\221^D^@r^B^@^@[07] /home/miku/nh/install/games/lib/nethackdir/nethack(sanity_check+0x62) [0x5604001b262b]^M
[08] /home/miku/nh/install/games/lib/nethackdir/nethack(moveloop_core+0x145) [0x56040011f36c]^M
[09] /home/miku/nh/install/games/lib/nethackdir/nethack(moveloop+0x2c) [0x5604001219ea]^M
[10] /home/miku/nh/install/games/lib/nethackdir/nethack(main+0xab0) [0x5604007dc065]^M
[11] /lib/x86_64-linux-gnu/libc.so.6(+0x280d0) [0x7f6b50c280d0]^M
[12] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x89) [0x7f6b50c28189]^M
[13] /home/miku/nh/install/games/lib/nethackdir/nethack(_start+0x25) [0x560400011665]^M

Glancing at the code this may be because liquid_flow (music.c:341) can delete the trap, but do_earthquake doesn't seem to take that into account and unconditionally sets mtmp->mtrapped to 1 afterwards if the monster would fall into a pit (music.c:326). Most monsters would probably drown, and many of those that wouldn't are flyers/clingers so do_earthquake would ignore them, but it looks to me like those that can swim would end up with mtrapped set without being in a trap.

[Somewhat related, there's a comment "redundant?" on the post-liquid_flow 'mtmp = m_at(x, y)' on music.c:344 -- I don't think this is redundant since liquid_flow can drown (or move, maybe, if lifesaving?) the monster.]