ScalarR not stopping
Hi, I observe the following in the output of the rumble client
Fighting battle 44 ... aaa.r.ScalarR 0.005h.053,jk.mega.DrussGT 3.1.7 Robot aaa.r.ScalarR 0.005h.053 (1) is not stopping. Forcing a stop. Robot aaa.r.ScalarR 0.005h.053 (1) is not stopping. Forcing a stop. Unable to stop thread: aaa.r.ScalarR 0.005h.053 (1) Unable to stop thread: aaa.r.ScalarR 0.005h.053 (1)
and the client seems to be running this battle with 100% CPU for at least several minutes (about 5). Then roborumble continued.
I am not sure where to search for the problem but there is something strange going on. I am running everything with
openjdk version "11.0.16" 2022-07-19 OpenJDK Runtime Environment (build 11.0.16+8-post-Debian-1deb11u1) OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Debian-1deb11u1, mixed mode, sharing)
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
What is HotSpot?
Could it be Kotlin related? My roborumble (official one) clients report this error at the startup time
java.lang.IllegalAccessError: class kotlin.collections.CollectionsKt cannot access its superclass kotlin.collections.CollectionsKt___CollectionsKt (kotlin.collections.CollectionsKt is in unnamed module of loader net.sf.robocode.host.security.RobotClassLoader @586bc8ed; kotlin.collections.CollectionsKt___CollectionsKt is in unnamed module of loader java.net.URLClassLoader @3d494fbf)
I don't think it has something to do with Kotlin, but I generally delete Kotlin jars to suppress this error.
I had a check at the round finalization logic of robocode, it seems that after user specified run() exits, control flow will be handled to `HostingRobotProxy.run`, which calls `BasicRobotProxy.waitForBattleEndImpl`. The logic here had some potential bugs, e.g. when receiving `InterruptedException`, it merely wakes up the thread instead of letting the thread exit gracefully. Not sure what triggered a bug here on some platform though...