NullOOJavaAI crashes on exit

NullOOJavaAI crashes on exit

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

Moderators: hoijui, Moderators

Post Reply
cain
AI Developer
Posts: 124
Joined: 09 Aug 2005, 10:04

NullOOJavaAI crashes on exit

Post by cain »

NullOOJavaAI crash on exit on my windows box, probably related to the 64bit jvm.

java exact version is 6.0.230.5; spectating two RAI matches doesn't give any problem; spectating a RAI vs NullOOJavaAI game grashes on exit.

infolog doesn't give any hints. can't try with a 32bit jvm right now.

anyone got it running on a 64bit windows env?
Attachments
script-ai.txt
(1.22 KiB) Downloaded 105 times
infolog.txt
(23.55 KiB) Downloaded 115 times
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: NullOOJavaAI crashes on exit

Post by AF »

32bit spring + 64bit JVM, you can run a 32bit and a 64bit alongside eachother, but unless you can rebuild spring in 64bit your going to have to use 32bit
cain
AI Developer
Posts: 124
Joined: 09 Aug 2005, 10:04

Re: NullOOJavaAI crashes on exit

Post by cain »

the weird thing is that it runs just fine, until the game ends :mrgreen:
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: NullOOJavaAI crashes on exit

Post by hoijui »

on crash reports, you always include infolog.txt, even if it misses a stack-trace. you ask someone that (you hope) might know more about what is going wrong, and they might see hints in the logs that are none in your eyes. I would also not have to ask for stuff like which OS, GFX card or spring version you were using.
cain
AI Developer
Posts: 124
Joined: 09 Aug 2005, 10:04

Re: NullOOJavaAI crashes on exit

Post by cain »

hoijui wrote:on crash reports, you always include infolog.txt, even if it misses a stack-trace. you ask someone that (you hope) might know more about what is going wrong, and they might see hints in the logs that are none in your eyes. I would also not have to ask for stuff like which OS, GFX card or spring version you were using.
no, you wouldn't need to ask, because everything is included in the infolog that's already attached to the first post to begin with.

seriously, I don't get it, is this genuine hate toward me, toward bug reports or just generic aimless hatred?

I understand the need of a copypasta post as a standard reply to reports, still..
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: NullOOJavaAI crashes on exit

Post by hoijui »

.. i missed it, sorry
cain
AI Developer
Posts: 124
Joined: 09 Aug 2005, 10:04

Re: NullOOJavaAI crashes on exit

Post by cain »

...in that case, sorry for the harsh reply

friends? :mrgreen:
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: NullOOJavaAI crashes on exit

Post by hoijui »

sure :D
really can't imagine how i missed it. this is like the first time i missed something.. EVER! ;-)
(except every possible off-by-one error, and some others)

it was not a copy paste answer btw. was made just for you! :D

next two paragraphs are here mostly as reference to self, about stuff that is known but unfixed since some time

it could be that it crashes cause the JVM is not properly shut down.
The reason for this is, that the Java AI Interface plugin, when shut down, does not know whether it is shut down cause the last Java AI died, or whether the simulation/game has ended, so can not kill the JVM. It is possible to instantiate and kill AIs during runtime of a game. The JVM though, can only be started once per process. once it is shut down, you are not able to start it again, ever, for that process.
So in short, we would need to alter something in the way interface plugins are handled, basically there are two solutions:
  • do not shut down AI Interface plugins, once started, until the game ends
  • add one or two new functions to the AI Interface API, which are called (at first instantiation &) at game end
There is an other issue reported by one user so far, that JVM instantiation fails on 32bit windows if process memory is too fragmented at the time the AI Interface plugin is loaded. The JVM needs to pre-allocate a lot of unfragmented space.
Here the cleanest solution we came up with so far, would be to pre-allocate enough memory early in initialization of the game, and release it right before the plugin gets initialized. the size of the memory to reserve could be specified by an entry in AIInfo.lua.

maybe the interfaces log file contains some info.
cain
AI Developer
Posts: 124
Joined: 09 Aug 2005, 10:04

Re: NullOOJavaAI crashes on exit

Post by cain »

I've tried to debug the exit but I'm twice retarded:

A) first retarded award because I got a source snapshot instead of fetching the master from git, so it took an awful lot of time to get to a point where the java wrapper was not compiled and not compiling, thanks to award B

B) I insisted in using netbeans for c++, which is slow as hell, because it has to index everything every time config changes, and then, because it want me to use unix makefiles. it also has a nice popup telling me that mingw makefiles are not what I want and that mingw make is not posix compliant so I cannot use that. A lot of messing later and thanks to cmake-gui I convinced it to use the damned mingw environment but only for the main project, the other makefiles are executed with standard make which is not happy about them


I've got a visual studio 2010 and git, I'll give it another shot in the next days.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: NullOOJavaAI crashes on exit

Post by hoijui »

yeah... i can imagine you would have problems with many IDEs. i have them too (with C++).
i would recommend you to use the IDE only as a sort of better source file editor, and do the compiling in the command line.
MSVC should work to of course, but there is only one person maintaining that (zerver) and so it might often be broken for a few commits.
cain
AI Developer
Posts: 124
Joined: 09 Aug 2005, 10:04

Re: NullOOJavaAI crashes on exit

Post by cain »

I was looking at an ide mostly for debugging, I can't stand gdb.

As long as the project definition is almost working I can fix it up myself, hopefully :)
msm8bball
Posts: 52
Joined: 09 Oct 2009, 08:08

Re: NullOOJavaAI crashes on exit

Post by msm8bball »

I had problems myself with Win 7 64 bit. What I ended up doing was installing 32 bit JVM.

You appear to have a different error than me, but perhaps this might be useful:
http://springrts.com/phpbb/viewtopic.php?f=15&t=25964
Post Reply

Return to “AI”