View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0004725 | Spring engine | General | public | 2015-04-02 12:17 | 2015-04-04 22:13 | ||||
Reporter | lamer | ||||||||
Assigned To | jK | ||||||||
Priority | normal | Severity | crash | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Product Version | 98.0.1+git | ||||||||
Target Version | 99.0 | Fixed in Version | |||||||
Summary | 0004725: 98.0.1-507-gcebb37a crash in GameHelper.cpp:661 | ||||||||
Description | Replay crash. Happened in engine from buildbot and was reproduced in manually compiled version. | ||||||||
Steps To Reproduce | $ ./spring Crash_Iceland_v1_98.0.1-507-gcebb37a develop.sdf (run fast on 10x till ~20th minute, frame=0023055) | ||||||||
Additional Information | http://paste.springfiles.com/view/b08dc9e3 frame=0023055 Segmentation fault (SIGSEGV) in spring 98.0.1-507-gcebb37a develop Halted Stacktrace for Spring 98.0.1-507-gcebb37a develop using libunwind: (Signal handler calls suppressed [4]. Inlined calls denoted by < > brackets.) <03> /usr/include/c++/4.9.2/bits/stl_vector.h:795 std::vector<std::list<CUnit*, std::allocator<CUnit*> >, std::allocator<std::list<CUnit*, std:: [...] [03] .../games/spring/spring/rts/Game/GameHelper.cpp:661 CGameHelper::GenerateWeaponTargets(CWeapon const*, CUnit const*, std::multimap<float, CUnit*, [...] [04] .../games/spring/spring/rts/Sim/Weapons/Weapon.cpp:749 CWeapon::AutoTarget() [05] .../games/spring/spring/rts/Sim/Weapons/Weapon.cpp:895 CWeapon::SlowUpdate(bool) [06] .../games/spring/spring/rts/Sim/Units/Unit.cpp:1108 CUnit::SlowUpdateWeapons() [07] .../games/spring/spring/rts/Sim/Units/Unit.cpp:1077 CUnit::SlowUpdate() <08> /usr/include/c++/4.9.2/bits/stl_list.h:159 std::_List_iterator<CUnit*>::operator++() [08] .../games/spring/spring/rts/Sim/Units/UnitHandler.cpp:288 CUnitHandler::Update() [09] .../games/spring/spring/rts/Game/Game.cpp:1577 CGame::SimFrame() [10] .../games/spring/spring/rts/Net/NetCommands.cpp:513 CGame::ClientReadNet() [11] .../games/spring/spring/rts/Game/Game.cpp:1023 CGame::Update() [12] .../games/spring/spring/rts/System/SpringApp.cpp:920 SpringApp::Update() [13] .../games/spring/spring/rts/System/SpringApp.cpp:954 SpringApp::Run() [14] .../games/spring/spring/rts/System/Main.cpp:48 Run(int, char**) [15] .../games/spring/spring/rts/System/Main.cpp:108 main [16] /usr/lib/libc.so.6(__libc_start_main+0xf0) [0x7f468b0d9800] __libc_start_main [17] ./spring(_start+0x29) [0x4aec39] ?? | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | |||||||||
Attached Files |
|
![]() |
|
lamer (reporter) 2015-04-02 12:26 |
Uh oh. Zero-K $VERSION was used (commit d8e189c45a73ae4ab8fac287e68735a5b5feb8ce) So i guess it will be harder to reproduce with attached replay than i thought. |
cleanrock (reporter) 2015-04-02 18:24 Last edited: 2015-04-02 18:24 |
I can reproduce this with the attached demo. The ref quads in GenerateWeaponTargets look fine (all ints are sane) when crash happen but the quadField->GetQuad gets a bad int (assert in GetQuad is triggered). I suspected another thread called something that changed CQuadField::tempQuads but running with WorkerThreadCount = 0 did not help. When i made quads in GenerateWeaponTargets a copy instead of a const ref to tempQuads crash did not happen, my guess is that something in the for loop in GenerateWeaponTargets changes tempQuads (there are a bunch of functions that do tempQuads.clear();). jK, you should look into this. |
cleanrock (reporter) 2015-04-03 09:42 |
I added a bunch of assert(qi >= quads.begin() && qi < quads.end()); it is the AllowWeaponTarget call that invalidates qi. It is a Sharpshooter that is evaluating a Conjurer (cloaked constructor) as target. |
cleanrock (reporter) 2015-04-03 09:48 Last edited: 2015-04-03 09:49 |
I guess we need a copy of the quads if we are doing callins here. |
cleanrock (reporter) 2015-04-04 07:12 |
jk will fix this, from #sy: 2015-04-03 10:44:52: cleanrock: [LCC]jK, about 4725, shall i make quads a copy or do you have a different plan ? 2015-04-03 10:49:20: [LCC]jK: diff plan 2015-04-03 10:52:38: [LCC]jK: return a shared_ptr and check if it is unique when writing to the vector |
jK (developer) 2015-04-04 22:13 |
Fix 4c0c12406dd19a8a4475e889614147a827e34afa committed to develop branch: fix 0004725: use explicit copy vector for the return results as cleanrock advised I did checked how often there are conflicts by calling the functions in multi-level. I used a shared_ptr for that and checked it with `assert(sptr.unique());` to ensure the tempQuads vector is not overwriten while still in use. ... ... ... the assert was triggered every few seconds ... ... ..., repo: spring changeset id: 4789 |
![]() |
|||
Date Modified | Username | Field | Change |
---|---|---|---|
2015-04-02 12:17 | lamer | New Issue | |
2015-04-02 12:17 | lamer | File Added: Crash_Iceland_v1_98.0.1-507-gcebb37a develop.sdf | |
2015-04-02 12:26 | lamer | Note Added: 0014266 | |
2015-04-02 18:24 | cleanrock | Note Added: 0014267 | |
2015-04-02 18:24 | cleanrock | Note Edited: 0014267 | View Revisions |
2015-04-02 18:26 | abma | Target Version | => 99.0 |
2015-04-03 09:42 | cleanrock | Note Added: 0014269 | |
2015-04-03 09:48 | cleanrock | Note Added: 0014270 | |
2015-04-03 09:49 | cleanrock | Note Edited: 0014270 | View Revisions |
2015-04-04 07:12 | cleanrock | Note Added: 0014271 | |
2015-04-04 22:13 | jK | Changeset attached | => spring develop 4c0c1240 |
2015-04-04 22:13 | jK | Note Added: 0014274 | |
2015-04-04 22:13 | jK | Assigned To | => jK |
2015-04-04 22:13 | jK | Status | new => resolved |
2015-04-04 22:13 | jK | Resolution | open => fixed |