View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001848 | Spring engine | Unit Scripting | public | 2010-02-21 17:15 | 2010-02-22 01:36 |
| Reporter | kmcguire | Assigned To | hoijui | ||
| Priority | normal | Severity | crash | Reproducibility | always |
| Status | resolved | Resolution | no change required | ||
| Product Version | 0.81.1.3 | ||||
| Summary | 0001848: skirmishAiCallback_UnitDef_MoveData_* Access Violation | ||||
| Description | Clb_UnitDef_MoveData_getDepthMod, -- UnitDefId=316 Clb_UnitDef_MoveData_getMoveType, -- UnitDefId=316 Clb_UnitDef_MoveData_isSubMarine, -- UnitDefId=316 Loading an AI DLL (starting the game from the command line using spring.exe) and clicking the test button (at top) will produce a crash from an access violation. Somewhere inside skirmishAiCallback_UnitDef_MoveData_getTerrainClass a instruction tries to access memory that does not exist: IF, you call the function with the arguments __stdcall(int32_t=1, int32_t=316). This also happens with a few other functions and maybe others. This could be a problem on my machine, or a mistake that I am making. | ||||
| Additional Information | /* This should be sufficient to produce the crash. */ extern "C" __declspec(dllexport) int __stdcall init(int teamId, const struct SSkirmishAICallback* callback) { callback->Clb_UnitDef_MoveData_isSubMarine(1, 316); return 0; } extern "C" int __declspec(dllexport) __stdcall handleEvent(int teamId, int topic, const void* data) { return 0; } | ||||
| Tags | No tags attached. | ||||
| Attached Files | |||||
| Checked infolog.txt for Errors | |||||
|
|
EXPORT(int) init(int teamId, const struct SSkirmishAICallback* callback) { bool isMDAvail = callback->Clb_UnitDef_0AVAILABLE0MoveData(teamId, 316); if (isMDAvail) { callback->Clb_UnitDef_MoveData_getDepthMod(teamId, 316); callback->Clb_UnitDef_MoveData_getMoveType(teamId, 316); callback->Clb_UnitDef_MoveData_isSubMarine(teamId, 316); } return 0; } |
|
|
Thank you for the solution. The rest is for you guys to consider if it is a bug or not. I am okay either way. I got it figured out now. |
|
|
:-) a crash through this can only be run into with a bug in an AI Interface or Wrapper (assuming nobody writes a pure C AI). runtime guarding against it would mean overhead (even doh little, of course). i added assert(s) in the functions you mentioned (in pureint branch). |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2010-02-21 17:15 | kmcguire | New Issue | |
| 2010-02-21 17:15 | kmcguire | File Added: infolog.txt | |
| 2010-02-21 20:57 | hoijui | Note Added: 0004675 | |
| 2010-02-21 23:11 | kmcguire | Note Added: 0004676 | |
| 2010-02-22 01:36 | hoijui | Note Added: 0004677 | |
| 2010-02-22 01:36 | hoijui | Status | new => resolved |
| 2010-02-22 01:36 | hoijui | Resolution | open => no change required |
| 2010-02-22 01:36 | hoijui | Assigned To | => hoijui |