View Issue Details

IDProjectCategoryView StatusLast Update
0004262Spring engineLuapublic2014-01-14 02:29
Reporterzwzsg Assigned TojK  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version96.0 
Summary0004262: Spring.Restart with startscript content as second argument
Descriptionkp_spring_direct_launch.lua line 465 is:

Spring.Restart("",trimmed)

where trimmed is a fairly large string containing the content of the startscript that I wish to restart Spring with.

It used to work in Spring 95. In Spring 96, the infolog reads:

[f=0000000] Spring Direct Launch 2: Ok, calling Spring.Restart("","[GAME]{..}") now!
[f=0000000] [Sound] [~CSound][1] soundThread=027629E8
[f=0000000] [Sound] [~CSound][2]
[f=0000000] [Sound] [~CSound][3]
[f=0000000] Error: [Spring.Restart] error Invalid argument
[f=0000000] Spring Direct Launch 2: Just called Spring.Restart("","[GAME]{..}")
[f=0000000] Spring Direct Launch 2: Wait, we shouldn't be here, should have restarted or crashed or quitted by now.

And then, Spring.exe crashes for reasons that may or may not be related (to me it looks likes something about CSound having being half reintialised by Spring.Restart and then causing a crash next frame, but ianad. Anyway, it'll become irrelevant once Spring.Restart works again.)

https://github.com/spring/spring/blob/master/rts/Game/Game.cpp#L1115
spring.exe 0x0042ABAB rts/Game/Game.cpp:1115
spring.exe 0x0042AEFA rts/Game/Game.cpp:1173
spring.exe 0x008900A3 rts/System/SpringApp.cpp:968
spring.exe 0x008968A4 rts/System/SpringApp.cpp:1034
spring.exe 0x00872956 rts/System/Main.cpp:65
spring.exe 0x0087376C rts/System/Main.cpp:125
spring.exe 0x0087398D rts/System/Main.cpp:134
spring.exe 0x00401402 crtexe.c:0
kernel32.dll 0x7C817077 ??:0

So, what exactly is invalid in my Spring.Restart arguments?
Steps To Reproduce- Get a WinXP machine
- Download Spring 96 portable for windows, unzip
- Download Kernel Panic 4.6, unzip in same folder
- Run Spring.exe directly, run Kernel Panic game to get Kernel Panic menu
- Once in KP ingame menu, click mission, Challenge 1 - Bug Squashing
- Wait a few seconds for crash to occur
- Read infolog.txt
Additional InformationSpring.Restart fails the same with http://springrts.com/dl/buildbot/default/develop/96.0.1-141-g059f13c/win32/
TagsNo tags attached.
Attached Files
infolog.txt (Attachment missing)
Checked infolog.txt for Errors

Relationships

has duplicate 0004329 resolvedabma Spring.Restart crashes spring.exe, no new instance is started 

Activities

zwzsg

2014-01-11 02:22

reporter   ~0012670

I modified my widget to:
- Write the string trimmed into the file Kernel_Panic_script.txt
- Use Spring.Restart("Kernel_Panic_script.txt","")
And it failed the same:
- Error: [Spring.Restart] error Invalid argument

zwzsg

2014-01-11 17:27

reporter   ~0012674

knorke's Spring Tank uses:
    local file=VFS.LoadFile(startscriptfilename)
    Spring.Restart("-s", file)
And fails the same:
[f=0000644] Error: [Spring.Restart] error Invalid argument
[f=0000645] Error: Spring 96.0 has crashed.

cleanrock

2014-01-11 17:30

reporter   ~0012675

I believe jk have tried to fix this:
https://github.com/spring/spring/commit/059f13c
Have you tried latest develop ?

zwzsg

2014-01-11 18:36

reporter   ~0012676

See "Additional Information"

cleanrock

2014-01-11 19:41

reporter   ~0012679

looks like kloot also tried to fix this now, dunno why they dont want to ref this bug report
https://github.com/spring/spring/commit/f501cb4

Kloot

2014-01-11 20:57

developer   ~0012680

when testing f501cb4, *also* check your space-in-path case (4161) because the behavior between Windows and Linux seems to be different

zwzsg

2014-01-12 16:47

reporter   ~0012684

I tested http://springrts.com/dl/buildbot/default/develop/96.0.1-144-ge0802a4/win32/
Spring.Restart works correctly with this build.

Then I added some space in my folder name. This time Spring crashed during restart.

abma

2014-01-13 09:13

administrator   ~0012686

Last edited: 2014-01-13 09:15

did someone take into account that length of command line args on windows are limited?

http://stackoverflow.com/questions/3205027/maximum-length-of-command-line-string

is the parameter written to a script.txt or is it called directly?

zwzsg

2014-01-14 00:32

reporter   ~0012691

Yeah, I hit this limit years ago, it was 32k. But this is not the problem now.

- With the build f501cb4, and no space in path, I can pass a 1558 char long string as parameter and Spring restarts fine.

- With 96 and no space in path, it crashes even if I write the script to a txt (so with a short command line).

- With space in path and f501cb4, it crashes.

Issue History

Date Modified Username Field Change
2014-01-11 02:04 zwzsg New Issue
2014-01-11 02:04 zwzsg File Added: infolog.txt
2014-01-11 02:22 zwzsg Note Added: 0012670
2014-01-11 17:27 zwzsg Note Added: 0012674
2014-01-11 17:30 cleanrock Note Added: 0012675
2014-01-11 17:30 cleanrock Assigned To => jK
2014-01-11 17:30 cleanrock Status new => feedback
2014-01-11 18:36 zwzsg Note Added: 0012676
2014-01-11 18:36 zwzsg Status feedback => assigned
2014-01-11 19:41 cleanrock Note Added: 0012679
2014-01-11 19:41 cleanrock Assigned To jK =>
2014-01-11 19:41 cleanrock Status assigned => new
2014-01-11 20:57 Kloot Note Added: 0012680
2014-01-12 16:47 zwzsg Note Added: 0012684
2014-01-13 09:13 abma Note Added: 0012686
2014-01-13 09:15 abma Note Edited: 0012686
2014-01-13 09:15 abma Note Edited: 0012686
2014-01-14 00:32 zwzsg Note Added: 0012691
2014-01-14 02:29 jK Changeset attached => spring develop 65a9d0b7
2014-01-14 02:29 jK Assigned To => jK
2014-01-14 02:29 jK Status new => resolved
2014-01-14 02:29 jK Resolution open => fixed
2014-10-07 19:14 abma Relationship added has duplicate 0004329