MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001259VCMIMechanics - Adventure Mappublic2013-04-24 05:312013-08-18 21:04
ReporterWarmonger 
Assigned ToTow 
PrioritynormalSeveritycrashReproducibilitysometimes
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version0.93Fixed in Version 
Summary0001259: AI crashes when trying to find visitable offset
DescriptionAfter 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.
TagsNo tags attached.
Attached Filesrar file icon 1259dump.rar [^] (2,107,870 bytes) 2013-04-26 11:18

- Relationships
related to 0001391closedTow Failed to create savegame after ~2 months of gameplay. 
child of 0001409closedTow Crashes during AI turn (accessing removed objects) 

-  Notes
(0003519)
Ivan (developer)
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 (developer)
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.
(0003521)
Warmonger (administrator)
2013-04-24 11:24

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 (developer)
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 (administrator)
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 ;)

(0003530)
Warmonger (administrator)
2013-04-26 11:18
edited on: 2013-04-26 11:18

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 (developer)
2013-08-15 16:00

All such issues now go under 0001409 and should be fixed soon.
(0003874)
Tow (developer)
2013-08-18 21:04

Covered by 0001409 and fixed in r3501.

- Issue History
Date Modified Username Field Change
2013-04-24 05:31 Warmonger New Issue
2013-04-24 05:43 Warmonger Description Updated View Revisions
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 View Revisions
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 View Revisions
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

Site | Forums | Wiki | Slack | GitHub


Copyright © 2000 - 2024 MantisBT Team
Hosting provided by DigitalOcean