My bot have lag on internet game.

My bot have lag on internet game.

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

What reason for this bug?

Poll ended at 20 Sep 2014, 14:28

Mistmatch AI interface version
1
20%
Bad BOT logic
1
20%
Spring engine have bug
3
60%
It is a Java bug
0
No votes
 
Total votes: 5

playerO1
Posts: 57
Joined: 25 Jun 2014, 15:22

My bot have lag on internet game.

Post by playerO1 »

Hello. I have trouble: on single player my bot work. Can work ower that 1 hour. On online (internet) game my bot crash afther 7- 15 minute. Spring engine: 96, AI Interface: ~97. Using MOD: TA (ower 800 unitDefs).
When this bug happens: spring "frozen", spring mouse cursor don't moving (native cursor moving) and spring start eat memory 1 Gb per 20 second, up to 4-5 Gb, next from 1 minute Spring close and show out of memory message.
My bot some time may using ower that 2 second per 1 game frime. I see on Java AI Interface exist config files for JVM settings, they have rule for limited 1 bot memory up to 64 Mb defauld, that means the memory leak can not contain on bot logic.

Some ideas for how fix this bug and what reason for this bug maybe?
How test Java AI where Spring is runing? I mean how debug bot's by NetBeans SDK, use watch variables and break points when game run? How using profiler for check BOT CPU and memoru usage?

P.S.: I found how repeat this crash in single player.
1. if start play on EvoRTS and build unit "ORB" and afther 1-2 second crash.
My bot log:

Code: Select all

...
commandFinished 
unitCreated: eorb
release: reason=0
2. If start Zero-K, then crash at start.
My bot log:

Code: Select all

unitCreated: armcom1
Now AI have new Tech Up to -1 tech level! (onAddUnit)
Unit from uncknown owner base add to base.
unitFinished 
release: reason=0
Spring infolog fragment on linux 64, Spring 96, AI Interface ~97, my bot and Zero-K mod:

Code: Select all

[f=0000000] Connection attempt from ME
[f=0000000]  -> Version: 96.0
[f=0000000] Epicmenu: Switching to Total Annihilation camera mode
[f=0000000]  -> Connection established (given id 0)
[f=0000000] Mexspot Fetcher received
[f=0000000] Player ME finished loading and is now ingame
[f=0000000] Mex Placement Initialised with 58 spots.
[f=0000000] <ME> Allies: I choose: Battle Commander!
[f=0000000] GameID: 0fa4f853888541ab11c8550e1cdf4421
[f=0000000] <SkirmishAI: FieldBOT dev (team 0)>: Now AI have new Tech Up to -1 tech level! (onAddUnit)
[f=0000000] Error: Failed to allocate memory
[f=0000000] Error: Stacktrace for Spring 96.0:
[f=0000000] Error:   <0> ??:?
[f=0000000] Error:   <1> /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_Znwm+0x3b) [0x7fb002f66f4b]
[f=0000000] Error:   <2> /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSs4_Rep9_S_createEmmRKSaIcE+0x59) [0x7fb002fc23b9]
[f=0000000] Error:   <3> /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSs9_M_mutateEmmm+0x56) [0x7fb002fc2546]
[f=0000000] Error:   <4> /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSs15_M_replace_safeEmmPKcm+0x1e) [0x7fb002fc2aee]
[f=0000000] Error:   <5> /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSs7replaceEmmPKcm+0x5f) [0x7fb002fc3c0f]
[f=0000000] Error:   <6> ??:?
[f=0000000] Error:   <7> ??:?
...
[f=0000000] Error:   <30> ??:?
[f=0000000] Error:   <31> ??:?
[f=0000000] Error:   <32> /usr/games/spring() [0x482ecc]
[f=0000000] Error:   <33> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fb002641ec5]
[f=0000000] Error:   <34> ??:?
p.p.s. On Spring engine 97.0.1-206-g8576ee8 develop have this bug too.
Last edited by playerO1 on 24 Aug 2014, 11:04, edited 1 time in total.
playerO1
Posts: 57
Joined: 25 Jun 2014, 15:22

Re: My bot have lag on internet game.

Post by playerO1 »

I found bug. I found how fix this bug!
The reason for this bug is new Java AI Interface! I remove "AIInterface.jar" from project, remove "Java" folder, copy from Spring engine 94.1 "Java" folder into "AI/Interfaces", and old "AIInterface.jar" into my BOT project, start Spring 96 (i think Spring 97 will be work too) with mod's when they crat and ALL OK! :shock:
Now I can't run more that 1 bot in one game again, but I can play! It is new Interface BAD BUG! :x
Last edited by playerO1 on 24 Aug 2014, 17:38, edited 1 time in total.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: My bot have lag on internet game.

Post by Anarchid »

I've been running multiple Java AI's, including multiples of the same kind, over the network, without much added lag.

The problem is likely in your AI, or is exposed by something your AI does.

You should gather more info.
playerO1
Posts: 57
Joined: 25 Jun 2014, 15:22

Re: My bot have lag on internet game.

Post by playerO1 »

P.S. Yes, it is my Interface broken. I check NullOOJavaAI, they has no work too with Zero-K. What I need do for it fork for me too?

-- before P.S. this post --
I check again on Spring engine: 96, AI Interface: ~97, game start as single player: ME team 1, FieldBOT team 1, NullAI team 2.
On "Zero-K - v1.2.8.8" my bot have call and return success result of next function:
====
1. unitCreated: armcom1
2. unitFinished
3. release: reason=0
====
(not call update(frame))

-----
My unitCreated call:
unit.getDef().getName()
unit.isBeingBuilt()
unit.getDef()
def.isCommander()
def.getTechLevel()
if (unit.isBeingBuilt()) if (builder.getDef().isAssistable() ... // OMG who is builder for first unit?!
unit.getTeam()
ud.isBuilder(), ud.isCommander(), ud.isAbleToRepair(), ud.isBuilder(), ud.isAbleToAttack(), ud.isCommander(), ud.isStealth().
unit.getPos(), unit.isBeingBuilt(),
ut.isAbleToMove(), ut.isAbleToAttack()

-----

On "Evolution RTS - v7.78" (I not undestand how this big log fragment can help):
=====
...
update frame=392
bot: build target:ORB
bot: Start build ORB (eorb) at (5952.0, 278.45825, 5584.0)
update frame=393
unitCreated: eorb
update frame=394
...
update frame=645
commandFinished
unitIdle
update frame=646
...
update frame=648
bot: build target:Metal Extractor
bot: Start build Metal Extractor (emetalextractor) at (5816.0, 1802.9175, 5256.0)
unitCreated: emetalextractor
update frame=649
...
update frame=664
release: reason=0
=====
playerO1
Posts: 57
Joined: 25 Jun 2014, 15:22

Re: My bot have lag on internet game.

Post by playerO1 »

Ok, it is interface bug on My PC. How I can safe using Spring 97 (or 96) with Java bot on Linux 64? Do not tell me that Windows better, I want play on Linux.
How I can get more detail infolog.txt?
[f=0000000] Error: Failed to allocate memory
[f=0000000] Error: Stacktrace for Spring 97.0.1-206-g8576ee8 develop:
[f=0000000] Error: <0> ??:?
[f=0000000] Error: <1> ??:?
WIthout ??:?get addres and function name.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: My bot have lag on internet game.

Post by Anarchid »

1) remove the interface from .spring
2) use latest engine
playerO1
Posts: 57
Joined: 25 Jun 2014, 15:22

Re: My bot have lag on internet game.

Post by playerO1 »

I delete next folder:
~/.spring/AI/Interfaces/Java
~/.config/spring/AI/Interfaces/Java (contain only log file)
and using ~/.spring/engine/spring_{develop}97.0.1-206-g8576ee8_minimal-portable-linux64-static
Run again Zero-K with NullOOJavaAI. Spring crash at start again.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: My bot have lag on internet game.

Post by abma »

97.0.1-338-g0e31515 is latest!
playerO1
Posts: 57
Joined: 25 Jun 2014, 15:22

Re: My bot have lag on internet game.

Post by playerO1 »

Do 97.0.1-338-g0e31515 for Linux 64 have Java AI interface? I found only 32 bit build have Java interface. Do I can mix 32 Java Interface with Spring 64 bit on Linux 64? My spring lobby 0.197 don't work with Spring 32 bit unitsync.co.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: My bot have lag on internet game.

Post by abma »

no, no. sorry, the buildslave forgot the path to java, fixed it. give 97.0.1-344-g06ed166 a try!
playerO1
Posts: 57
Joined: 25 Jun 2014, 15:22

Re: My bot have lag on internet game.

Post by playerO1 »

Thanks, abma. I try test NullOOJava AI with this spring and Zero-K mod, then have this crash again :( How I can using "{develop}97.0.1-344-g06ed166_spring_dbg.7z" for see not only "??:?" on stack in infolog.txt?
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: My bot have lag on internet game.

Post by Anarchid »

First, you need to also get the http://springrts.com/dl/buildbot/defaul ... %20symbols, and place them alongside the spring binary.

Then either the crash handler will pick them up itself, or you'll need to use gdb.
playerO1
Posts: 57
Joined: 25 Jun 2014, 15:22

Re: My bot have lag on internet game.

Post by playerO1 »

I found that button "Take 123 abandoned unit" did not already fixed at this version Java interface :( (if run 2 or more Java bot in my team, test mod: TA).
Thanks, Anarchid, now I can place infolog.txt fragment here.

Code: Select all

[f=0000000] GameID: 8516ff533197e5279b452b90cdebebc5
[f=0000000] Connection attempt from ME
[f=0000000]  -> Version: 97.0.1-344-g06ed166 develop
[f=0000000] Epicmenu: Switching to Total Annihilation camera mode
[f=0000000]  -> Connection established (given id 0)
[f=0000000] Skirmish AI "Bot1" (ID:0, Short-Name:"NullOOJavaAI", Version:"0.1") took over control of team 0
[f=0000000] Skirmish AI "Bot2" (ID:1, Short-Name:"NullJavaAI", Version:"0.1") took over control of team 1
[f=0000000] Skirmish AI "Bot3" (ID:2, Short-Name:"NullJavaAI", Version:"0.1") took over control of team 2
[f=0000000] Player ME finished loading and is now ingame
[f=0000000] <ME> Allies: I choose: Support Trainer!
[f=0000000] <SkirmishAI: NullOOJavaAI 0.1 (team 0)>: unitCreated: class com.springrts.ai.oo.clb.WrappUnitunitId=4734, )
[f=0000000] <SkirmishAI: NullOOJavaAI 0.1 (team 0)>: unitCreated def: armcom1
[f=0000000] <SkirmishAI: NullOOJavaAI 0.1 (team 0)>: 	buildOption x: cormex	Metal Extractor	class com.springrts.ai.oo.clb.WrappUnitDefunitDefId=254, )	-1754967273
[f=0000000] <SkirmishAI: NullOOJavaAI 0.1 (team 0)>: 	buildOption x: armsolar	Solar Collector	class com.springrts.ai.oo.clb.WrappUnitDefunitDefId=56, )	560000023
... I cut this repeating fragments ...
[f=0000000] <SkirmishAI: NullOOJavaAI 0.1 (team 0)>: 	buildOption x: mahlazer	Starlight	class com.springrts.ai.oo.clb.WrappUnitDefunitDefId=330, )	-994967273
[f=0000000] <SkirmishAI: NullOOJavaAI 0.1 (team 0)>: 	buildOption x: raveparty	Disco Rave Party	class com.springrts.ai.oo.clb.WrappUnitDefunitDefId=354, )	-754967273
[f=0000000] <SkirmishAI: NullOOJavaAI 0.1 (team 0)>: 	buildOption x: zenith	Zenith	class com.springrts.ai.oo.clb.WrappUnitDefunitDefId=394, )	-354967273
[f=0000000] <SkirmishAI: NullOOJavaAI 0.1 (team 0)>: 	buildOption x: armcsa	Athena	class com.springrts.ai.oo.clb.WrappUnitDefunitDefId=34, )	340000023
[f=0000000] Error: Failed to allocate memory
[f=0000000] Error: Stacktrace for Spring 97.0.1-344-g06ed166 develop:
[f=0000000] Error:   <0> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/System/FastMath.h:217
[f=0000000] Error:   <1> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/lib/assimp/code/../include/assimp/vector3.inl:124
[f=0000000] Error:   <2> /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/include/g++-v4/bits/stl_tree.h:678
[f=0000000] Error:   <3> /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/include/g++-v4/bits/stl_tree.h:1097
[f=0000000] Error:   <4> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/lib/assimp/code/ColladaParser.cpp:2612
[f=0000000] Error:   <5> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/lib/assimp/code/ColladaParser.cpp:941
[f=0000000] Error:   <6> jcdctmgr.o:?
[f=0000000] Error:   <7> jcdctmgr.o:?
[f=0000000] Error:   <8> jchuff.o:?
[f=0000000] Error:   <9> jcdctmgr.o:?
[f=0000000] Error:   <10> jchuff.o:?
[f=0000000] Error:   <11> jchuff.o:?
[f=0000000] Error:   <12> jcdctmgr.o:?
[f=0000000] Error:   <13> jchuff.o:?
[f=0000000] Error:   <14> /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/include/g++-v4/bits/basic_string.h:536
[f=0000000] Error:   <15> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/Rendering/GlobalRendering.cpp:213
[f=0000000] Error:   <16> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/Game/UI/CursorIcons.h:121
[f=0000000] Error:   <17> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/Rendering/GlobalRendering.cpp:230
[f=0000000] Error:   <18> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/Rendering/GlobalRendering.cpp:170
[f=0000000] Error:   <19> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/Rendering/GlobalRendering.cpp:291
[f=0000000] Error:   <20> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/Rendering/GL/VertexArray.cpp:366
[f=0000000] Error:   <21> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/Lua/LuaHandle.cpp:278
[f=0000000] Error:   <22> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/Lua/LuaHandle.cpp:358
[f=0000000] Error:   <23> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/Lua/LuaHandle.cpp:520
[f=0000000] Error:   <24> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/System/EventHandler.cpp:765 (discriminator 7)
[f=0000000] Error:   <25> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/Game/Game.cpp:1505
[f=0000000] Error:   <26> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/Net/NetCommands.cpp:285
[f=0000000] Error:   <27> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/Game/Game.cpp:994
[f=0000000] Error:   <28> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/System/SpringApp.cpp:859
[f=0000000] Error:   <29> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/System/SpringApp.cpp:889
[f=0000000] Error:   <30> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/System/Main.cpp:48
[f=0000000] Error:   <31> /home/buildbot/slave/linux-static-x64/build/build/default/../../rts/System/Main.cpp:108
[f=0000000] Error:   <32> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fd581c41ec5]
[f=0000000] Error:   <33> ??:?
[f=0000000] Error: [ErrorMessageBox][1] msg="Failed to allocate memory" IsMainThread()=1 fromMain=0
[f=0000000] Error: [ErrorMessageBox][2]
[f=0000000] [SpringApp::ShutDown][1]
[f=0000000] Warning: [CpuId] ht/smt/cmt detection for AMD is not implemented! Using processor number reported by OS.
[f=0000000] [ThreadPool::SetThreadCount][1] #wanted=0 #current=3 #max=4
[f=0000000] Warning: [CpuId] ht/smt/cmt detection for AMD is not implemented! Using processor number reported by OS.
[f=0000000] [ThreadPool::SetThreadCount][2] #threads=0
[f=0000000] [SpringApp::ShutDown][2]
[f=0000000] [~CGame][1]
[f=0000000] [~CGame][2]
[f=0000000] [~CGame][3]
[f=0000000] Start gadgetHandler:Shutdown
[f=0000000] Shutdown - ranks api
[f=0000000] Shutdown - ShareControl
[f=0000000] Shutdown - UnitMorph
[f=0000000] Shutdown - DoLine
I hope it can help to game developer.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: My bot have lag on internet game.

Post by Anarchid »

To my bare naked eyeballs this looks like code not perfectly related to AI, are you sure you can run Spring with this mod without bots?

In particular, the parts about Assimp should have no claim in an AI-related crash.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: My bot have lag on internet game.

Post by abma »

its more likely the stacktrace is invalid. please try to use gdb...

also, is your code in some repository so i/others can reproduce your crash?

FYI: the pull request which fixes getCustomParams isn't merged yet: https://github.com/spring/spring/pull/125 so you'll still get a crash when calling this function and there is sth. different than a string. (i hope thats correct, didn't spent time investigating this) if you are calling this function you have to use the code from the pull request and it maybe works then.
playerO1
Posts: 57
Joined: 25 Jun 2014, 15:22

Re: My bot have lag on internet game.

Post by playerO1 »

I try play vs 3 NullAI(C++) and no crash.
"also, is your code in some repository so i/others can reproduce your crash?" I think no. The reason for crash is not specific code of my bot, crash with nullOOJavaAI I see.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: My bot have lag on internet game.

Post by abma »

please provide a full infolog.txt. i still have no clue what you are doing.

also provide the source code of the AI which makes spring crash, else i can't help as NullJavaAI / HughAI doesn't crash for me in current develop.
playerO1
Posts: 57
Joined: 25 Jun 2014, 15:22

Re: My bot have lag on internet game.

Post by playerO1 »

Hm, I found that my JavaOO-AIWrapper.jar need up to date too. I have update only AIInterface.jar only and think that all good. Afther update library and recompiling I found that my bot no work, but engine no crash. But I don't know whay NullJavaAI can crash game. I check my all folder again and try delete all files from last engine.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: My bot have lag on internet game.

Post by abma »

please provide a full infolog.txt.
playerO1
Posts: 57
Joined: 25 Jun 2014, 15:22

Re: My bot have lag on internet game.

Post by playerO1 »

In mod:Balanced Annihilation V8.00, bot:NullJavaAI 0.1 is work. Where change mod on Zero-K I have this crash.
Attachments
infolog.txt
infolog.txt from crash spring 97
(102.64 KiB) Downloaded 26 times
Post Reply

Return to “AI”