Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old August 9, 2013, 21:27   #1
molybdenum
Apprentice
 
Join Date: May 2013
Posts: 84
molybdenum is on a distinguished road
[3.5-dev] Reproducing chaos/polymorph crash

You can reproduce easily by summoning a chaos breather and a bunch (20+) of monsters. As long as the monster pack stays dense, a crash should occur. You can also just zapping a wand of polymorph at things until it happens.

The issue is actually in project_m(), which includes a notice at the top about polymorph crashes. In the first above case, this is what seems to be happening:
- chaos breather triggers random polymorph on another monster
- place_new_monster_one() (by way of place_new_monster()) can't place the monster in the location it wants to, so it returns false
- m_ptr is null, since cave_monster_at() doesn't return a monster
- mon_clear_timed() (only in the who > 0 branch) crashes because m_ptr is null

In the second case, the first three steps are the same. The crash just occurs when the check for dam > m_ptr->hp is made in the else branch of who > 0.
molybdenum is offline   Reply With Quote
Old August 9, 2013, 21:35   #2
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,946
Derakon is on a distinguished road
Why can't place_new_monster_one() place a monster? Because the target monster is still in place?

Sorry, I shouldn't be asking questions when you've already provided a lot of helpful information. Thanks for the debugging!
Derakon is offline   Reply With Quote
Old August 9, 2013, 22:13   #3
molybdenum
Apprentice
 
Join Date: May 2013
Posts: 84
molybdenum is on a distinguished road
Quote:
Originally Posted by Derakon View Post
Why can't place_new_monster_one() place a monster? Because the target monster is still in place?
Specifically, in my cases, it was because cave_isopen() returned false. I was doing this in fairly open rooms or in town, but I suppose there could have been something on the ground that I didn't pay attention to. Also, plenty of monsters were polymorphed successfully, so it's not happening all the time. I also think that I've had polymorph crash when IDing a wand in a corridor against a single monster.
molybdenum is offline   Reply With Quote
Old August 27, 2013, 15:00   #4
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,672
PowerWyrm is on a distinguished road
Quote:
Originally Posted by molybdenum View Post
You can reproduce easily by summoning a chaos breather and a bunch (20+) of monsters. As long as the monster pack stays dense, a crash should occur. You can also just zapping a wand of polymorph at things until it happens.

The issue is actually in project_m(), which includes a notice at the top about polymorph crashes. In the first above case, this is what seems to be happening:
- chaos breather triggers random polymorph on another monster
- place_new_monster_one() (by way of place_new_monster()) can't place the monster in the location it wants to, so it returns false
- m_ptr is null, since cave_monster_at() doesn't return a monster
- mon_clear_timed() (only in the who > 0 branch) crashes because m_ptr is null

In the second case, the first three steps are the same. The crash just occurs when the check for dam > m_ptr->hp is made in the else branch of who > 0.
The error comes from place_new_monster_one() where a check is made against cave_isempty() while it should be cave_isopen(). There is no reason not to place a monster on top of an object.
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old August 27, 2013, 15:46   #5
molybdenum
Apprentice
 
Join Date: May 2013
Posts: 84
molybdenum is on a distinguished road
Quote:
Originally Posted by PowerWyrm View Post
The error comes from place_new_monster_one() where a check is made against cave_isempty() while it should be cave_isopen(). There is no reason not to place a monster on top of an object.
Yeah, I actually did more testing this weekend and changed that. It's waiting in a pull request.
molybdenum is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[3.5-dev] Crash when leaving game PowerWyrm Vanilla 0 May 28, 2013 17:40
3.5-dev crash on chaos breath Raajaton Vanilla 13 May 28, 2013 05:40
[3.5-dev] Possible crash on cavern levels PowerWyrm Vanilla 5 May 7, 2013 16:55
V 3.5-dev crash eMeM Development 4 May 2, 2013 17:21
Polymorph in Ironman UglySquirrell Vanilla 4 August 2, 2011 22:34


All times are GMT +1. The time now is 09:44.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.