![]() |
#1 |
Prophet
Join Date: Apr 2008
Posts: 2,972
![]() |
[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 https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant! |
![]() |
![]() |
![]() |
#2 |
Prophet
Join Date: Apr 2008
Posts: 2,972
![]() |
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 https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant! |
![]() |
![]() |
![]() |
#3 |
Veteran
Join Date: Jun 2007
Posts: 1,393
![]() |
Have you tried running under Valgrind?
|
![]() |
![]() |
![]() |
#4 |
Prophet
Join Date: Apr 2008
Posts: 2,972
![]() |
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 https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant! |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Game crashes when confused or stuned | ZenDragon | Vanilla | 2 | November 14, 2011 21:44 |
New dev version | Magnate | Development | 38 | November 8, 2011 16: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 |