2025-07-04 11:21 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0006156Spring engineGeneralpublic2019-03-13 20:46
ReporterGoogle_Frog 
Assigned ToKloot 
PrioritynormalSeveritycrashReproducibilityhave not tried
StatusresolvedResolutionfixed 
Product Version104.0 +git 
Target VersionFixed in Version104.0 +git 
Summary0006156: 104.0.1-1060-g7f3541f maintenance Save crash
DescriptionThese two crashes occured just after someone saved the game.
https://github.com/ZeroK-RTS/CrashReports/issues/20439
https://github.com/ZeroK-RTS/CrashReports/issues/20440

What is the status of saving with the recent changes?
TagsNo tags attached.
Checked infolog.txt for ErrorsYes
Attached Files

-Relationships
+Relationships

-Notes

~0019809

Google_Frog (reporter)

https://github.com/ZeroK-RTS/CrashReports/issues/20523

~0019811

Kloot (developer)

Last edited: 2019-03-11 11:51

View 2 revisions

20439, 20440
  rts/ExternalAI/SkirmishAILibrary.cpp:93
  rts/ExternalAI/SkirmishAIWrapper:278
  rts/ExternalAI/EngineOutHandler.cpp:117
  rts/System/LoadSave/LuaLoadSaveHandler.cpp:109
  rts/System/LoadSave/LuaLoadSaveHandler.cpp:77
  rts/System/LoadSave/LoadSaveHandler.cpp:41
  rts/Game/UnsyncedGameCommands.cpp:134
  rts/Game/IActionExecutor.h:108

same as 0006085, should be reported to the AI's developer.

~0019814

lamer (reporter)

How come the stacktrace doesn't contain AI's trace? That black magic scares me.

~0019815

lamer (reporter)

Player in crash report uses NullAI (Lua AI i guess), Chicken (Lua), and Circuit (native AI).
Crashes are at 9000th and 18000th frame (autosave).
I'll try to reproduce it when i have time, but it's seems like a memory corruption happens before call to native AI's internals.
CircuitAI doesn't do much on EVENT_SAVE: it opens std::ofstream and almost immediately closes it.

Testing Skirmish singleplayer 1xCircuitAI vs Player doesn't crash on manual save.

Sidenote: Can't edit my own notes :(

~0019829

Google_Frog (reporter)

Here are some more.
 - Longer stacktrace: https://github.com/ZeroK-RTS/CrashReports/issues/20529
 - https://github.com/ZeroK-RTS/CrashReports/issues/20554
 - https://github.com/ZeroK-RTS/CrashReports/issues/20567
 - https://github.com/ZeroK-RTS/CrashReports/issues/20569
 - https://github.com/ZeroK-RTS/CrashReports/issues/20583

~0019839

lamer (reporter)

Thread 1 "spring-main" received signal SIGSEGV, Segmentation fault.
0x0000555555b7f94b in CSkirmishAILibrary::HandleEvent (this=0x0, skirmishAIId=0, topic=topic@entry=23, data=data@entry=0x7fffffffd5f8)
    at /home/bob/spring/spring/rts/ExternalAI/SkirmishAILibrary.cpp:93
93 const int ret = aiLib.handleEvent(skirmishAIId, topic, data);
(gdb) bt
#0 0x0000555555b7f94b in CSkirmishAILibrary::HandleEvent (this=0x0, skirmishAIId=0, topic=topic@entry=23, data=data@entry=0x7fffffffd5f8)
    at /home/bob/spring/spring/rts/ExternalAI/SkirmishAILibrary.cpp:93
#1 0x0000555555b827a0 in CSkirmishAIWrapper::HandleEvent (this=0x5555569d2900 <singleton>, topic=23, data=0x7fffffffd5f8)
    at /home/bob/spring/spring/rts/ExternalAI/SkirmishAIWrapper.cpp:450
#2 0x0000555555b83a5e in CSkirmishAIWrapper::Load (this=this@entry=0x5555569d2900 <singleton>, loadStream=loadStream@entry=0x7fffffffd930)
    at /home/bob/spring/spring/rts/ExternalAI/SkirmishAIWrapper.cpp:268
0000003 0x0000555555b5be57 in CEngineOutHandler::Load (this=0x5555569d2900 <singleton>, s=s@entry=0x7fffffffd930, skirmishAIId=0 '\000')
    at /home/bob/spring/spring/rts/ExternalAI/EngineOutHandler.cpp:106
0000004 0x0000555555aae4ce in CLuaLoadSaveHandler::LoadAIData (this=0x5555bb3ebc20) at /home/bob/spring/spring/rts/System/LoadSave/LuaLoadSaveHandler.cpp:218
0000005 0x0000555555aae66f in CLuaLoadSaveHandler::LoadGame (this=0x5555bb3ebc20) at /home/bob/spring/spring/rts/System/LoadSave/LuaLoadSaveHandler.cpp:196
#6 0x00005555556e78b5 in CGame::LoadGame (this=0x555621312ff0, mapFileName="maps/Tundra.smf") at /home/bob/spring/spring/rts/Game/Game.cpp:420
#7 0x0000555555709736 in CLoadScreen::Init (this=0x5555b7719c70) at /home/bob/spring/spring/rts/Game/LoadScreen.cpp:136
#8 0x0000555555709869 in CLoadScreen::CreateDeleteInstance (mapFileName=..., modFileName=..., saveFile=<optimized out>)
    at /home/bob/spring/spring/rts/Game/LoadScreen.cpp:183
#9 0x00005555557128c5 in CPreGame::UpdateClientNet (this=<optimized out>) at /home/bob/spring/spring/rts/Game/PreGame.cpp:389
0000010 0x0000555555713b48 in CPreGame::Update (this=0x5555cf1f4cd0) at /home/bob/spring/spring/rts/Game/PreGame.cpp:186
#11 0x0000555555ac6520 in SpringApp::Update (this=this@entry=0x7fffffffe420) at /home/bob/spring/spring/rts/System/SpringApp.cpp:764
0000012 0x0000555555ac9ba8 in SpringApp::Run (this=this@entry=0x7fffffffe420) at /home/bob/spring/spring/rts/System/SpringApp.cpp:799
0000013 0x0000555555ab30c0 in Run (argc=1, argv=0x7fffffffe5f8) at /home/bob/spring/spring/rts/System/Main.cpp:43
0000014 0x000055555569a96a in main (argc=1, argv=0x7fffffffe5f8) at /home/bob/spring/spring/rts/System/Main.cpp:94
(gdb) p aiLib
Cannot access memory at address 0x0
(gdb) p &aiLib
$1 = (SSkirmishAILibrary *) 0x0
(gdb) p this
$2 = (const CSkirmishAILibrary * const) 0x0

^ Engine did something wrong.

~0019840

Kloot (developer)

@lamer mind sharing an infolog and the script you used to reproduce this? Your example points to a crash during load, but all these traces involved an auto*save* which means the logic is broken both ways.

~0019841

lamer (reporter)

Yes, will do. But stuck with another issue: feeding startscript directly to spring binary - works yet runs at 1 frame per 5 seconds after load; passing startscript from lua Spring.Reload(startscript) - crashes with above error.

startscript:
[GAME]
{
  SaveFile=test3.slsf;
  IsHost=1;
  OnlyLocal=1;
  MyPlayerName=lamer;
}

I'll upload infologs ([1] crash; [2] 1 frame per 5 seconds), startscript and test3.slsf soon.

~0019842

lamer (reporter)

Commented LuaMenu part to enable Spring.Reload(script) here:
https://github.com/ZeroK-RTS/Zero-K/blob/9523f4085e99c7ea2279e1db76781999c3e70372/LuaUI/Widgets/gui_savegame.lua#L251-L253
Because otherwise Load button does absolutely nothing (i don't use chobby - it's just additional layer of complexity for the moment).

Sidenote: tried once with chobby as default LuaMenu: spring has "seconds per frame" issue after load but didn't crash.

Attached infolog_reload_crash.txt, crash_script.txt, test3 savefile.

~0019843

Kloot (developer)

test3.slsf loaded directly from crash_script.txt (on the CLI) doesn't crash for me with 1078-ga9a9a51, neither does feeding the script to Spring.Reload from a widget.

in both cases I can reproduce the ultra-low framerate bug.

~0019845

lamer (reporter)

1078-ga9a9a51 doesn't crash for me either with Spring.Reload from a widget.

~0019847

Kloot (developer)

9c151887 may have squashed this, time and infologs will tell
+Notes

-Issue History
Date Modified Username Field Change
2019-03-11 09:09 Google_Frog New Issue
2019-03-11 10:17 Google_Frog Note Added: 0019809
2019-03-11 11:49 Kloot Note Added: 0019811
2019-03-11 11:51 Kloot Note Edited: 0019811 View Revisions
2019-03-11 12:36 lamer Note Added: 0019814
2019-03-11 13:16 lamer Note Added: 0019815
2019-03-13 04:38 Google_Frog Note Added: 0019829
2019-03-13 15:36 lamer Note Added: 0019839
2019-03-13 15:56 Kloot Note Added: 0019840
2019-03-13 17:23 lamer Note Added: 0019841
2019-03-13 18:35 lamer File Added: infolog_reload_crash.txt
2019-03-13 18:35 lamer File Added: crash_script.txt
2019-03-13 18:35 lamer File Added: test3.lua
2019-03-13 18:36 lamer File Added: test3.slsf
2019-03-13 18:37 lamer Note Added: 0019842
2019-03-13 19:06 Kloot Note Added: 0019843
2019-03-13 20:20 lamer Note Added: 0019845
2019-03-13 20:46 Kloot Assigned To => Kloot
2019-03-13 20:46 Kloot Status new => resolved
2019-03-13 20:46 Kloot Resolution open => fixed
2019-03-13 20:46 Kloot Fixed in Version => 104.0 +git
2019-03-13 20:46 Kloot Note Added: 0019847
+Issue History