MantisBT - VCMI |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0001259 | VCMI | Mechanics - Adventure Map | public | 2013-04-24 05:31 | 2013-08-18 21:04 |
|
Reporter | Warmonger | |
Assigned To | Tow | |
Priority | normal | Severity | crash | Reproducibility | sometimes |
Status | closed | Resolution | fixed | |
Platform | | OS | | OS Version | |
Product Version | | |
Target Version | 0.93 | Fixed in Version | | |
|
Summary | 0001259: AI crashes when trying to find visitable offset |
Description | After recent changes which removed other bugs, now I get only one bug during long AI runs. Debugger claims access violation in this function:
int3 CGObjectInstance::getVisitableOffset() const
{
for(int y = 0; y < 6; y++)
for (int x = 0; x < 8; x++)
if((defInfo->visitMap[5-y] >> x) & 1)
return int3(x,y,0);
logGlobal->warnStream() << "Warning: getVisitableOffset called on non-visitable obj!";
return int3(-1,-1,-1);
}
Looks like visitMap size is innapriopriate. It happens on any of random tests maps I used so far, so no new objects (towns, dwellings) should be present. |
Steps To Reproduce | |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | 0001391 | closed | Tow | Failed to create savegame after ~2 months of gameplay. | child of | 0001409 | closed | Tow | Crashes during AI turn (accessing removed objects) |
|
Attached Files | 1259dump.rar (2,107,870) 2013-04-26 11:18 https://bugs.vcmi.eu/file_download.php?file_id=1262&type=bug |
|
Issue History |
Date Modified | Username | Field | Change |
2013-04-24 05:31 | Warmonger | New Issue | |
2013-04-24 05:43 | Warmonger | Description Updated | bug_revision_view_page.php?rev_id=2177#r2177 |
2013-04-24 10:13 | Ivan | Note Added: 0003519 | |
2013-04-24 11:17 | Tow | Note Added: 0003520 | |
2013-04-24 11:24 | Warmonger | Note Added: 0003521 | |
2013-04-24 11:31 | Tow | Note Added: 0003522 | |
2013-04-26 04:22 | Warmonger | Note Added: 0003529 | |
2013-04-26 06:26 | Warmonger | Note Edited: 0003529 | bug_revision_view_page.php?bugnote_id=3529#r2181 |
2013-04-26 11:18 | Warmonger | Note Added: 0003530 | |
2013-04-26 11:18 | Warmonger | File Added: 1259dump.rar | |
2013-04-26 11:18 | Warmonger | Note Edited: 0003530 | bug_revision_view_page.php?bugnote_id=3530#r2183 |
2013-08-01 14:49 | Warmonger | Relationship added | related to 0001391 |
2013-08-15 16:00 | Tow | Note Added: 0003850 | |
2013-08-15 16:00 | Tow | Relationship added | child of 0001409 |
2013-08-18 21:04 | Tow | Note Added: 0003874 | |
2013-08-18 21:04 | Tow | Status | new => closed |
2013-08-18 21:04 | Tow | Assigned To | => Tow |
2013-08-18 21:04 | Tow | Resolution | open => fixed |
Notes |
|
(0003519)
|
Ivan
|
2013-04-24 10:13
|
|
Is there a chance that whole defInfo is missing (e.g. null or broken pointer)? IIRC visitMap is C-style array so it have constant size. |
|
|
(0003520)
|
Tow
|
2013-04-24 11:17
|
|
I'd rather guess it is object pointer (this) that is likely to be null. If you encounter this again, please save the full stacktrace and logs.
I'm also working on serializing AI state in saves, that should make reproducing such bugs much easier. |
|
|
|
Looks like it.
Of all 1 destinations, object oid=16843009 seems nice
Disaster happened.
Reason: 0xc0000005 - EXCEPTION_ACCESS_VIOLATION at 0023:629
Attempt to read from 0x00000038
Thread ID: 4744 [4744]
Crash info will be put in VCMI_client.exe_crashinfo.dmp
This happened also when I turned all the new towns off. Will investigate later. |
|
|
(0003522)
|
Tow
|
2013-04-24 11:31
|
|
Please show me the full log. It is possible, that object 16843009 was already removed.
[side noteā¦ awfully high number, is that reasonable object id at all?] |
|
|
(0003529)
|
Warmonger
|
2013-04-26 04:22
(edited on: 2013-04-26 06:26) |
|
Of course id was completely wrong. Even biggest map has no more than 127k tiles.
I tried to reproduce it with r3358 and new build using MVS2012 with Boost 1.53, but failed. AI continued playing for like 78 months over night ;)
|
|
|
|
Happened again. Object seems to be NULL.
Stack trace:
VCMI_lib.dll!CGObjectInstance::getVisitableOffset() Line 493 C++
VCMI_lib.dll!CGObjectInstance::visitablePos() Line 554 C++
VCAI.dll!VCAI::goVisitObj(const CGObjectInstance * obj, HeroPtr h) Line 1064 C++
> VCAI.dll!VCAI::wander(HeroPtr h) Line 1511 C++
VCAI.dll!VCAI::performTypicalActions() Line 2337 C++
VCAI.dll!VCAI::tryRealize(CGoal g) Line 1963 C++
VCAI.dll!VCAI::striveToGoal(const CGoal & ultimateGoal) Line 2102 C++
VCAI.dll!VCAI::makeTurnInternal() Line 1046 C++
VCAI.dll!VCAI::makeTurn() Line 985 C++
VCAI.dll!boost::`anonymous namespace'::thread_start_function(void *) C++
msvcr110.dll!_callthreadstartex() Line 354 C
msvcr110.dll!_threadstartex(void * ptd) Line 332 C
kernel32.dll!74e333aa() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!76fe9ef2() Unknown
ntdll.dll!76fe9ec5() Unknown
Attaching everything possible.
|
|
|
(0003850)
|
Tow
|
2013-08-15 16:00
|
|
All such issues now go under 0001409 and should be fixed soon. |
|
|
(0003874)
|
Tow
|
2013-08-18 21:04
|
|
Covered by 0001409 and fixed in r3501. |
|