2019-08-25 00:37 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004665Spring engineAIpublic2018-02-10 15:16
ReporterDeinFreund 
Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
Product Version98.0.1+git 
Target VersionFixed in Version 
Summary0004665: Spring crashing after load of NullOOJavaAI
DescriptionUnable to start a game of ZK or BA against any SkirmishAI written in Java.
Someone else should try to reproduce this bug first.
Steps To ReproduceUsing Spring 98.0.1-374 on Win7 64bit
Start a game of Zero-K 1.3.2.1 or BA 8.08 against a NullOOJavaAI using springlobby 0.210 or latest zkl.
The game will crash either when "Loading SkirmishAI" or after the countdown has finished.
Additional Informationinfolog(BA): http://hastebin.com/ilaciroqep.xml
infolog(ZK): http://hastebin.com/demazujowa.xml
TagsNo tags attached.
Checked infolog.txt for lua Errors
Attached Files

-Relationships
+Relationships

-Notes

~0014003

abma (administrator)

on linux i get the same error:

http://paste.springfiles.com/view/raw/7f71b042

seems i have a bit more verbose logging enabled, it crashes when iterating over buildOption's of "armcom1"

~0014004

abma (administrator)

last known code of line:

https://github.com/spring/spring/blob/develop/AI/Skirmish/NullOOJavaAI/src/main/java/nulloojavaai/NullOOJavaAI.java#L209


so very likely java interface is broken in getBuildOptions() or unitDef.getName()

~0014005

abma (administrator)

or, its just bad memory corruption :-|

~0014006

DeinFreund (reporter)

Doesn't seem to be that causing the crash.
When using another AI(resignAI) which doesn't call either of these methods spring still crashes.

infolog: http://hastebin.com/usotexutoj.xml
ai src: http://hastebin.com/vagoyatake.avrasm
ai build has been attached.

I dont think the crash is caused by a method call issued by the AI itself as it didn't work with any Java-SkirmishAI yet.

~0014007

DeinFreund (reporter)

The crash can be avoided by making the AI fail at init(returnvalue != 0).
Thus it really seems to happen at UnitFinished.

~0014032

abma (administrator)

> The crash can be avoided by making the AI fail at init(returnvalue != 0).

the ai won't be used at all when doing this...

~0014033

abma (administrator)

Last edited: 2015-02-11 22:50

View 2 revisions

@DeinFreund:

does it work with older versions of spring?

i.e. 98.0?

~0014039

DeinFreund (reporter)

Yes, 98.0 stable is working.

~0014040

abma (administrator)

then it would be interesting in which version it broke... (=bisect)

~0014328

DeinFreund (reporter)

As building Spring isn't much fun on Windows, I used the builds provided by the buildbot. The issue lies in (98.0.1-178-g18487b4,98.0.1-218-g340f70e].

Looking at the affected commits, I assume the issue to be caused by:
https://github.com/spring/spring/commit/e27379e8f2cf312b097b4879303bef6517c92be6

Someone should confirm/disprove this.

~0014331

lamer (reporter)

Last edited: 2015-04-11 00:24

View 3 revisions

Tested 98.0.1-99-g619b376 and 98.0.1-451-g0804ae1 on linux: NullOOJavaAI works (keeps "listing resources ..."). AI/Interfaces/Java in place.
Next version i have is >=98.0.1-507-gcebb37a and there is no AI/Interfaces/Java.

How and when Java interface generated, during spring build (e.g. "make spring")?

Also AI's interface version 0.1 is a fiction, it was changed without updating version number several times (currently i don't see an easy way to support ai interface versioning except droping everything except last one). Thus one also have to use proper JavaOO-AIWrapper.jar

Can't confirm bug as NullOOJavaAI in 98.0.1-451-g0804ae1 works on linux. But from around 98.0.1-507-gcebb37a Java's interface/ais build is missing (or its just for linux? didn't look at windows bundle).

Edit: also ^resignAI works out-of-the-box when placed in ~/.spring/engine/98.0.1-451-g0804ae1/AI/Skirmish/resignAI

~0014332

abma (administrator)

Last edited: 2015-04-11 02:12

View 5 revisions

> How and when Java interface generated, during spring build (e.g. "make spring")?

its generated automaticly when java is detected. sadly java detection is slightly broken, so when bigger changes are done to the buildsystem it sometimes gets deactivated :-|

(reenabled it by deleting the line "JAVA_FOUND:INTERNAL=FALSE" from CMakeCache.txt)

created a bug report about this: 0004739 (its a quiet old bug... imo exists >2 years & very likely related to crosscompiling / env vars)

~0014333

abma (administrator)

> Also AI's interface version 0.1 is a fiction,

yes, it wasn't updated because it was very common to use the spring installer and install into the same directory as an old installation (this would be VERY confusing if multiple java ais could be selected)

~0014334

DeinFreund (reporter)

Couldn't easily find a Java interface build newer than 98.0 for Windows. Using this interface and Spring 98.0.1-451 the AI crashes when calling:

OOAICallback.getMap().isPossibleToBuildAt(UnitDef building, AIFLoat3 pos, int facing)

NullOOJavaAI and resignAI don't use this method.

A newer build of the Java interface might be needed, because the suspected commit is another change to the interface:
https://github.com/spring/spring/commit/1c54d1b66d85fc7825f5e4fb59ea6fc13c51200d

I attached a Java AI that should cause Spring to crash at frame 0.

~0014335

lamer (reporter)

Last edited: 2015-04-11 11:50

View 2 revisions

Tested testAI with 98.0.1-451-g0804ae1 (won't crash):
...
[f=0000000] [LoadFinalize] finalized PFS (84ms, checksum 66a9b41e)
[f=0000000] Loading Skirmish AIs
[f=0000000] <SkirmishAI: testAI 0.42 (team 1)>: TestAI initializing..
[f=0000000] <SkirmishAI: testAI 0.42 (team 1)>: TestAI initialized.
[f=0000000] Mex Placement Initialised with 78 spots.
[f=0000000] Loaded DecalsDrawer: Legacy
[f=0000000] GameID: c2ea2855408aba7266be0a1c3fa073bf
[f=0000000] Connection attempt from UnnamedPlayer
[f=0000000] -> Version: 98.0.1-451-g0804ae1 develop
[f=0000000] Epicmenu: Switching to Total Annihilation camera mode
[f=0000000] -> Connection established (given id 0)
[f=0000000] Skirmish AI "Enemy" (ID:0, Short-Name:"testAI", Version:"0.42") took over control of team 1
[f=0000000] Player UnnamedPlayer finished loading and is now ingame
[f=0000000] Chili: tried to add multiple times "scrollpanel6" to "Player List"!
[f=0000004] <UnnamedPlayer> Allies: I choose: Battle Trainer!
[f=0000136] <SkirmishAI: testAI 0.42 (team 1)>: armca
[f=0000136] <SkirmishAI: testAI 0.42 (team 1)>: fighter
[f=0000136] <SkirmishAI: testAI 0.42 (team 1)>: corvamp
[f=0000136] <SkirmishAI: testAI 0.42 (team 1)>: corshad
[f=0000136] <SkirmishAI: testAI 0.42 (team 1)>: corhurc2
[f=0000136] <SkirmishAI: testAI 0.42 (team 1)>: armstiletto_laser
[f=0000136] <SkirmishAI: testAI 0.42 (team 1)>: armcybr
[f=0000136] <SkirmishAI: testAI 0.42 (team 1)>: corawac
...

Looked at window's 98.0.1-451-g0804ae1 bundle and it's missing Java interface. I suppose the real bug is 0004739 (as abma pointed earlier).

~0014336

lamer (reporter)

Last edited: 2015-04-11 16:05

View 2 revisions

On archlinux i was able to generate Java interface by setting proper JAVA_HOME path:
$cmake . -DJAVA_HOME=/usr/lib/jvm/java-8-openjdk
Without export of JAVA_HOME it couldn't find JNI includes (whatever that is but JAVA_FOUND:INTERNAL was TRUE).
Doubt it's related to buildbot issue, but anyway the only option i know to generate proper interface for 98.0.1-524-ged46987 (latest for now) is to compile spring manually on windows.

~0014337

abma (administrator)

current development builds contain java interface again...

~0014341

DeinFreund (reporter)

Using the new build(524) has solved the issue for now.

0004739 really seems to be the underlying issue.

~0014342

abma (administrator)

when running current development version on linux i get this error:

Exception in thread "main" java.lang.NullPointerException
    at com.springrts.ai.oo.clb.WrappMap.isPossibleToBuildAt(WrappMap.java:647)
    at zkai.zkai.unitFinished(zkai.java:49)
    at com.springrts.ai.oo.OOAI.unitFinished(OOAI.java:116)
[f=0000000] Warning: AI for team 1 (ID: 0) failed handling event with topic 6, error: -5

spring doesn't crash...

~0014344

DeinFreund (reporter)

I don't think there should be any difference between linux and windows, still I'm not getting any exceptions:

[f=0000000] Loading Skirmish AIs
[f=0000000] <SkirmishAI: testAI 0.42 (team 1)>: TestAI initializing..
[f=0000000] <SkirmishAI: testAI 0.42 (team 1)>: TestAI initialized.
[f=0000000] Mex Placement Initialised with 26 spots.
[f=0000000] Loaded DecalsDrawer: Legacy
[f=0000000] GameID: fa7f2a55034a6f3e96812b1040c2d64e
[f=0000000] Connection attempt from Player
[f=0000000] -> Version: 98.0.1-524-ged46987 develop
[f=0000000] -> Connection established (given id 0)
[f=0000000] Skirmish AI "Bot1" (ID:0, Short-Name:"CAI", Version:"<not-versioned>") took over control of team 0
[f=0000000] Skirmish AI "Bot2" (ID:1, Short-Name:"testAI", Version:"0.42") took over control of team 1
[f=0000000] Spectator Player finished loading and is now ingame
[f=0000105] <SkirmishAI: testAI 0.42 (team 1)>: armca
[f=0000105] <SkirmishAI: testAI 0.42 (team 1)>: fighter

~0018799

Kloot (developer)

presumably resolved since 98+.

0004739 can be tackled by someone who still cares about the Java interface.
+Notes

-Issue History
Date Modified Username Field Change
2015-02-07 15:59 DeinFreund New Issue
2015-02-08 01:20 abma Note Added: 0014003
2015-02-08 01:21 abma Note Added: 0014004
2015-02-08 02:14 abma Note Added: 0014005
2015-02-08 02:57 DeinFreund File Added: resignAI.zip
2015-02-08 02:57 DeinFreund Note Added: 0014006
2015-02-08 03:03 DeinFreund Note Added: 0014007
2015-02-11 22:50 abma Note Added: 0014032
2015-02-11 22:50 abma Note Added: 0014033
2015-02-11 22:50 abma Note Edited: 0014033 View Revisions
2015-02-12 13:33 DeinFreund Note Added: 0014039
2015-02-12 14:45 abma Note Added: 0014040
2015-04-10 18:36 DeinFreund Note Added: 0014328
2015-04-10 19:06 abma Project AI => Spring engine
2015-04-10 19:06 abma Product Version => 98.0.1+git
2015-04-11 00:02 lamer Note Added: 0014331
2015-04-11 00:10 lamer Note Edited: 0014331 View Revisions
2015-04-11 00:24 lamer Note Edited: 0014331 View Revisions
2015-04-11 01:27 abma Note Added: 0014332
2015-04-11 01:52 abma Note Edited: 0014332 View Revisions
2015-04-11 01:52 abma Note Edited: 0014332 View Revisions
2015-04-11 01:55 abma Note Added: 0014333
2015-04-11 02:12 abma Note Edited: 0014332 View Revisions
2015-04-11 02:12 abma Note Edited: 0014332 View Revisions
2015-04-11 02:44 DeinFreund Note Added: 0014334
2015-04-11 02:45 DeinFreund File Added: testAI.zip
2015-04-11 11:50 lamer Note Added: 0014335
2015-04-11 11:50 lamer Note Edited: 0014335 View Revisions
2015-04-11 16:01 lamer Note Added: 0014336
2015-04-11 16:05 lamer Note Edited: 0014336 View Revisions
2015-04-11 23:49 abma Note Added: 0014337
2015-04-12 14:57 DeinFreund Note Added: 0014341
2015-04-12 15:55 abma Note Added: 0014342
2015-04-12 16:31 DeinFreund Note Added: 0014344
2018-02-10 15:16 Kloot Status new => resolved
2018-02-10 15:16 Kloot Resolution open => fixed
2018-02-10 15:16 Kloot Note Added: 0018799
+Issue History