View Issue Details

IDProjectCategoryView StatusLast Update
0002157Spring engineLinuxpublic2012-06-03 20:42
ReporterMitmat Assigned Toabma  
PrioritynormalSeveritymajorReproducibilitysometimes
Status resolvedResolutionfixed 
Product Version0.82.5 
Summary0002157: Bug with game restart functionality
DescriptionSteps to reproduce: Linux (Kubuntu 10.04), Spring 0.82.5.1, KP 4.1. Load a mission and restart it several times until the bug appears.

After several restarts (5 on average), display is bugged (see picture and log files in attachment) and/or loading is very slow. I suggest this is due to the "LuaUnsyncedCtrl::Restart(lua_State*)" function that uses the "execlp" function. I'm not sure but I suspect that the new game find old data of the previous game's instance...

I propose you a solution that is functional in my case: just use a "fork()" and call the "execlp" function only in the child's process and let the parent's process ended cleanly. Then the game restarts with a new PID and a clean execution context.

You will find in attachment my modified "rts/Lua/LuaUnsyncedCtrl.cpp" file.

Note: In the parent's process the "LuaUnsyncedCtrl::Restart(lua_State*)" function now returns.
TagsNo tags attached.
Attached Files
infolog.bak.txt (Attachment missing)
infolog.txt (Attachment missing)
LuaUnsyncedCtrl.cpp (Attachment missing)
snapshot1.png (Attachment missing)
Checked infolog.txt for Errors

Relationships

related to 0002246 resolvedabma Make newbies life easier (some ideas for first start) 
related to 0002253 resolvedabma crash in current master, when running spring + then select "Start SpringSettings" or "Start the Lobby" 

Activities

hoijui

2010-10-02 12:54

reporter   ~0005684

i would say, a better solution would be:
instead of calling execvp() right away, we should store the arguments for the restart, set globalQuit = true (as you do), wait till spring is ready stop its process, and at that moment, check if there is a restart request pending, and execute if so. with this, we would probably not have to rely on fork(), which means the solution is platform independent.

in the future, the restart could probably be executed by the launcher executable, by using a temp file to store the restart arguments, if that has any advantages.

comments?

Mitmat

2010-10-05 15:45

reporter   ~0005695

I tested to call execvp() between Shutdown() and return 0 of the SpringApp::Run function but the bug is always the same.

The second solution should be settle the matter...

hoijui

2010-12-27 23:38

reporter   ~0006159

Hmm...
SDL (which also manages OpenGL stuff, if i remember correctly) shuts down after that. it redefines the main function, to be always the first and last thing in control. which means.. yeah.. i guess we can not use the first solution. :/

abma

2012-05-23 10:51

administrator   ~0008701

Last edited: 2012-05-23 10:51

is this still a problem in spring 88? i cannot reproduce it...

abma

2012-06-03 20:42

administrator   ~0008733

seems to be fixed, reopen report if not...

Issue History

Date Modified Username Field Change
2010-10-01 15:33 Mitmat New Issue
2010-10-01 15:33 Mitmat File Added: attachment.tar.gz
2010-10-02 12:54 hoijui Note Added: 0005684
2010-10-05 15:45 Mitmat Note Added: 0005695
2010-12-06 21:01 abma Relationship added related to 0002246
2010-12-07 10:13 abma Relationship added related to 0002253
2010-12-27 01:35 abma File Added: infolog.bak.txt
2010-12-27 01:36 abma File Added: infolog.txt
2010-12-27 01:36 abma File Added: LuaUnsyncedCtrl.cpp
2010-12-27 01:36 abma File Added: snapshot1.png
2010-12-27 01:36 abma File Deleted: attachment.tar.gz
2010-12-27 23:38 hoijui Note Added: 0006159
2012-05-23 10:51 abma Note Added: 0008701
2012-05-23 10:51 abma Status new => feedback
2012-05-23 10:51 abma Note Edited: 0008701
2012-06-03 20:42 abma Note Added: 0008733
2012-06-03 20:42 abma Status feedback => resolved
2012-06-03 20:42 abma Resolution open => fixed
2012-06-03 20:42 abma Assigned To => abma