Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when moving into moat #10

Closed
gregorp opened this issue Apr 23, 2020 · 2 comments
Closed

Crash when moving into moat #10

gregorp opened this issue Apr 23, 2020 · 2 comments

Comments

@gregorp
Copy link

gregorp commented Apr 23, 2020

I was playing on Hardfought (xNetHack version 5.1). Wanted to dilute some potions, so I jumped in the moat on the Oracle level. Did it 2 or 3 times, and the game crashed. When I opened the game, it told my I had a game in progress, asked I wanted to abandon it. Got in touch with an admin who recovered the save file. I went back to the Oracle level and jumped in the water again, game crashed again, no "game in progress" notification this time.

When I moved into the moat I was a Samurai, Level 10, ~90 HP, wearing GDSM, wielding Snickersnee, and carrying ~8 potions (a couple of which were acid), nothing else in inventory.

Happy to provide additional info or attempt to reproduce if that would help.

@copperwater
Copy link
Owner

Fixed in d820b66. Not sure why you were trying to get acid potions to dilute anyway, but thanks for the extra context, it helped me make sense of an earlier bug report I couldn't figure out.

@gregorp
Copy link
Author

gregorp commented Apr 28, 2020

Forgetting that acid doesn't dilute :(

Thank you, really enjoying my recent switch to xNetHack!

copperwater added a commit that referenced this issue Dec 21, 2020
Partial merge #10 of vanilla. Conflict notes:
1. Adopted vanilla's message for when reading an identify scroll and
   it's the only thing in inventory.
copperwater pushed a commit that referenced this issue May 13, 2023
If you were on a level teleporter, the spoteffects() call after
the hero gets expelled could end up going to a new level and
freeing all the monst chains from the level you were originally
engulfed on.

    #0 0xba0507 in free
    #1 0x87feda in dealloc_monst src/mon.c:2369
    #2 0x880a02 in dmonsfree src/mon.c:2194
    #3 0x9a7aa2 in savelev_core src/save.c:507
    #4 0x9a7a21 in savelev src/save.c:466
    #5 0x71eb9d in goto_level src/do.c:1483
    #6 0x71833f in deferred_goto src/do.c:1903
    #7 0xa2533f in level_tele src/teleport.c:1117
    #8 0xa2567b in level_tele_trap src/teleport.c:1198
    #9 0xa5c007 in trapeffect_level_telep src/trap.c:1861
    #10 0xa5f856 in trapeffect_selector src/trap.c:2497
    #11 0xa47497 in dotrap src/trap.c:2586
    #12 0x7d669b in spoteffects src/hack.c:2859
    #13 0x89d495 in xkilled src/mon.c:3187

The latter parts of xkilled() after the spoteffects() call would
then attempt to dereference the free'd monst pointer.

Save a copy of the monst struct prior to spoteffects() if you were
expelled, then point at the reference copy afterwards.

Resolves #938
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants