Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old April 17, 2013, 14:59   #1
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,398
PowerWyrm is on a distinguished road
[3.5-dev] New refactored FOV crashes

See this commit: 9d48405fa5669b2419067dd0522512c5d5a77237 (Detect and work around the 'knight's move' LOS hack when doing FOV).

Calls to cave_iswall(c, x + something, y + something) are suspicious for two reasons: first, the function declaration is cave_iswall(struct cave *c, int y, int x), which implies that y should go before x; second, the two parameters surely can go out of bounds when you inspect a grid that is near the border of the level, so maybe add some bound checking somewhere.
__________________
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 April 18, 2013, 09:05   #2
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,398
PowerWyrm is on a distinguished road
It seems that the problem is more severe...

Now I got random crashes when changing levels. I suspect an illegal access to cave->info somewhere. On my local copy of the source, I'm gonna do three things:
- remove the byte_256 hack on cave->info and use byte_wid instead (I don't see anywhere in the source why cave->info has width 256 instead of DUNGEON_WID, it's probably a leftover from old code)
- add access functions to all CAVE_XXX flags and put an assert(in_bounds) in them
- fix asserts I'll get by putting in_bounds checks where the code lacks them
__________________
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 April 18, 2013, 10:33   #3
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,356
AnonymousHero is on a distinguished road
Have you tried running under Valgrind?
AnonymousHero is offline   Reply With Quote
Old April 18, 2013, 13:01   #4
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,398
PowerWyrm is on a distinguished road
I finished refactoring the cave->info access code, and it seems that the only faulty code is the one mentioned in my first post ('knight's move' rule when updating FOV): calls to cave_iswall() are done with out of bounds coordinates when near the border of the level. Adding some bounds checking fixed the crash problems.
__________________
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
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
Game crashes when confused or stuned ZenDragon Vanilla 2 November 14, 2011 20:44
New dev version Magnate Development 38 November 8, 2011 15:17
Bug: Windows executable crashes to desktop Leiferra Development 2 July 26, 2011 01:14
LOS/FOV/projections in NPP/Sangband half Development 1 July 21, 2009 22:49
V dev bugs Pete Mack Vanilla 5 September 22, 2008 00:38


All times are GMT +1. The time now is 05:47.


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