The latest 2 attempts to build sagemath for Fedora both hung. In both cases, I could see a jmol process that was not using any CPU. GDB showed the hung process had what appeared to be a single user thread, named "Thread-1", which was waiting on a condition variable. I looked at the various condition variables in the jmol code, and may have found the issue. In src/org/jmol/script/ScriptParallelProcessor.java
, an Object named lock
is created on line 57. That object is used in the block at line 83 to wait for scripts to exit, and is passed to the scripts on line 139. However, if there is an error, then the script calls parallelProcessor.clearShapeManager
(on line 67 of ScriptProcessRunnable.java
) instead of processLock.notifyAll
. Currently, clearShapeManager
takes the lock on, and notifies, this
instead of lock
, resulting in a signal that nothing is waiting for, and fewer signals than expected in the main loop.
If that is indeed the cause of the hang, then the sagemath build is generating an error, which didn't used to happen. But one problem at a time!
While looking at this code, I also noticed that line 64 of ScriptParallelProcess.java
looks suspicious. Shouldn't that be:
boolean inParallel = vwr.isParallel() || vwr.setParallel(true);
?
SageMath is using parallel processing? Seems odd. This is Java not
JavaScript I hope. JavaScript can't use parallel processing.
Yes, Java in this case. Another datapoint: I patched the jmol code as indicated above (i.e., changing
clearShapeManager
to lock and notifylock
) and did a test build, and this time the build finished. But I don't see anything in the build log about a jmol error, so I'm not sure I completely understand what is going on.