Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old July 2, 2011, 13:07   #31
CunningGabe
Swordsman
 
Join Date: Feb 2008
Location: Boston, MA
Posts: 250
CunningGabe is on a distinguished road
Quote:
Originally Posted by Max Stats View Post
I am also curious that I didn't see the "Compacting objects..." message before this bug. In fact, I don't recall ever seeing this message in recent times. That being said, this theory makes a lot of sense, given that make_object seems pretty robust about not creating objects will null kind, and the bug normally takes a long time to manifest. I guess the best way to go is to drastically lower the threshold for compacting objects and create lots of monsters that steal/pick up objects.
There are two kinds of compacting. One is where the game actually destroys some objects in order to make room -- that's when you see the "Compacting objects" message. The other is when the game just scans through the item list, and moves items around so that there are no more holes in the list. It's this latter kind of compacting that I've observed right before the bug.
CunningGabe is offline   Reply With Quote
Old July 2, 2011, 13:10   #32
Max Stats
Swordsman
 
Join Date: Jun 2010
Posts: 324
Max Stats is on a distinguished road
OK, now it makes even more sense than before.
Max Stats is offline   Reply With Quote
Old July 2, 2011, 16:19   #33
d_m
Angband Devteam member
 
d_m's Avatar
 
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 39
Posts: 1,516
d_m is on a distinguished road
Quote:
Originally Posted by CunningGabe View Post
I'm getting close. The problem seems to be with compacting objects and monster inventories. I don't have time to track it down completely right now, but it seems that after compact_objects(0) is called, then some monsters are left with references to dead objects. Maybe there's a fencepost error somewhere, so that everything in monster inventory except for one object is updated correctly?
Gabe, thanks! I think you are definitely on the right track.

I just managed to trigger this error (with a playtesting character) in GDB. So now I have a core dump and a debugger attached.

In my case, the problem is a mimic whose mimicked item has disappared (probably through compacting). Gabe, did you modify the compacting code to make sure mimicked items are not deleted? Normally if an item can be squelched the game assumes that it is free to delete them, but in the case of an item which is attached to a mimic, we shouldn't allow this to happen.

I will check this myself, but just wanted to ask in case you knew offhand.
__________________
linux->xterm->screen->pmacs
d_m is offline   Reply With Quote
Old July 2, 2011, 16:56   #34
CunningGabe
Swordsman
 
Join Date: Feb 2008
Location: Boston, MA
Posts: 250
CunningGabe is on a distinguished road
Quote:
Originally Posted by d_m View Post
Gabe, thanks! I think you are definitely on the right track.

I just managed to trigger this error (with a playtesting character) in GDB. So now I have a core dump and a debugger attached.

In my case, the problem is a mimic whose mimicked item has disappared (probably through compacting). Gabe, did you modify the compacting code to make sure mimicked items are not deleted? Normally if an item can be squelched the game assumes that it is free to delete them, but in the case of an item which is attached to a mimic, we shouldn't allow this to happen.

I will check this myself, but just wanted to ask in case you knew offhand.
I did modify the compacting code for mimics, but I'll double-check.

I've been trying to debug by summoning lots of cutpurses and watching the item compacting behavior. It seems that sometimes, randomly, a monster thinks its holding nothing, even very soon after it picks something up. I'm still trying to track down why, however.
CunningGabe is offline   Reply With Quote
Old July 3, 2011, 00:34   #35
myshkin
Angband Devteam member
 
Join Date: Apr 2007
Posts: 334
myshkin is on a distinguished road
Quote:
Originally Posted by d_m View Post
In my case, the problem is a mimic whose mimicked item has disappared (probably through compacting). Gabe, did you modify the compacting code to make sure mimicked items are not deleted? Normally if an item can be squelched the game assumes that it is free to delete them, but in the case of an item which is attached to a mimic, we shouldn't allow this to happen.
compact_objects_aux() did not correctly update the mimicked_o_idx member for mimic m_ptrs. I have fixed this and pushed the change to staging, but am not certain that all paths to the o_ptr->kind crash are closed.
myshkin is offline   Reply With Quote
Old July 3, 2011, 01:36   #36
CunningGabe
Swordsman
 
Join Date: Feb 2008
Location: Boston, MA
Posts: 250
CunningGabe is on a distinguished road
Quote:
Originally Posted by myshkin View Post
compact_objects_aux() did not correctly update the mimicked_o_idx member for mimic m_ptrs. I have fixed this and pushed the change to staging, but am not certain that all paths to the o_ptr->kind crash are closed.
Thanks for fixing that. I can confirm, however, that I can still get the crash by killing a bunch of cutpurses. I just started a new character, used debug commands to outfit myself and jumped to DL50. I then 'z'apped all the enemies away and just started summoning and killing cutpurses.

Edit: As an added sanity check, I reverted to before the mimic stuff was committed, and was able to get a crash in the same way. Which is sad, because the bug is still at large, but relieving, because it's not entirely my fault

Last edited by CunningGabe; July 3, 2011 at 01:53.
CunningGabe is offline   Reply With Quote
Old July 3, 2011, 21:58   #37
CunningGabe
Swordsman
 
Join Date: Feb 2008
Location: Boston, MA
Posts: 250
CunningGabe is on a distinguished road
I think what is happening somehow is that an object thinks it is held by a monster other than the one it is held by. (That is, o_ptr->held_m_idx is incorrect.) Then, when the object is moved in the object list, the monster that is actually holding it doesn't get the update, and so the index it has ends up referring to a possibly empty object.

I checked the monster compacting to make sure that it updates o_ptr->held_m_idx appropriately, and it seems that it does. Still trying to look for the problem...

Edit: Found it! Monsters know their own monster index, but the monster compacting code wasn't updating that index. I'll put up a fix now.

Last edited by CunningGabe; July 3, 2011 at 22:10.
CunningGabe is offline   Reply With Quote
Old July 3, 2011, 23:00   #38
myshkin
Angband Devteam member
 
Join Date: Apr 2007
Posts: 334
myshkin is on a distinguished road
Quote:
Originally Posted by CunningGabe View Post
Edit: Found it! Monsters know their own monster index, but the monster compacting code wasn't updating that index. I'll put up a fix now.
Excellent! I've merged your fix to staging.
myshkin 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
Crash bug Napsterbater Vanilla 6 February 26, 2011 10:56
r1953 crash bug Zikke Vanilla 14 March 11, 2010 04:32
Crash Bug? Rizwan Vanilla 4 February 25, 2010 13:58
Death mold description bug? Rizwan Vanilla 3 June 22, 2009 08:30
[FA] Crash Bug Zikke Variants 8 February 19, 2009 05:20


All times are GMT +1. The time now is 18:29.


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