SceneMaker / VisualSceneMaker

Visual SceneMaker is an authoring tool for creating interactive presentations aimed to non-programming experts. It supports the modeling of verbal and non-verbal behavior of Virtual Characters and robots. Therefore, it provides users with a graphical interface and a simple scripting language that allows them to create rich and compelling content.
http://scenemaker.dfki.de
Other
18 stars 11 forks source link

ConcurrentModificationException when executing nodes with no delays #211

Closed fnunnari closed 3 years ago

fnunnari commented 3 years ago

I experienced an exception when two nodes, bouncing on each other with epsilon edges, were executing with no delay:

Exception in thread "Thread-247" java.util.ConcurrentModificationException
    at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1495)
    at java.base/java.util.HashMap$EntryIterator.next(HashMap.java:1528)
    at java.base/java.util.HashMap$EntryIterator.next(HashMap.java:1526)
    at com.google.common.collect.AbstractMapBasedMultimap$Itr.next(AbstractMapBasedMultimap.java:1170)
    at org.ros.node.DefaultNodeMainExecutor.shutdown(DefaultNodeMainExecutor.java:161)
    at org.ros.node.DefaultNodeMainExecutor$1.run(DefaultNodeMainExecutor.java:108)
    at java.base/java.lang.Thread.run(Thread.java:830)

In general, a light-speed bouncing between two nodes is not a desired case, and has to be avoided. In fact this happened by mistake during development and testing.

However, I assume that the node execution should be thread safe also in this conditions. At worse, the system could slow down, but not crash.

SceneMaker commented 3 years ago

Well. I guess this is not a VSM bug. I'm pretty sure the engine is thread safe. Either it is a java bug (we had this before from time to time) or it has something to do with ROS. I

fnunnari commented 3 years ago

ROS is not involved. Actually, the fast loops happened because the ROS machine was off. If it is related to Java, better be careful with the following version:

% java -version
openjdk version "13.0.4" 2020-07-14
OpenJDK Runtime Environment Zulu13.33+25-CA (build 13.0.4+8-MTS)
OpenJDK 64-Bit Server VM Zulu13.33+25-CA (build 13.0.4+8-MTS, mixed mode, sharing)
fnunnari commented 3 years ago

Investigated. It is a bug internal to ROS when executing the shutdown of the services.