Baunsgaard opened a new pull request, #2502:
URL: https://github.com/apache/systemds/pull/2502

   AOffset initialized a cached empty slice in its static initializer by 
instantiating its own OffsetEmpty subclass. Since OffsetEmpty (and the other 
offset subclasses) depend on AOffset being initialized first, this formed a 
superclass/subclass class-initialization cycle. When two threads first touched 
the offset classes concurrently (e.g. parallel test execution), each could hold 
one class's init monitor while waiting for the other, deadlocking on the JVM 
class-initialization monitors. Such a deadlock is invisible to the JVM deadlock 
detector and cannot be interrupted, so the affected JVM hangs indefinitely. It 
only manifests under concurrent first-touch, which is why it never reproduced 
in single-threaded local runs.
   
   Defer the empty slice to a lazy holder accessed via emptySlice(), so 
AOffset's static initializer no longer references any subclass. By the time the 
holder is touched, AOffset is already initialized, so no cycle exists.
   
   Add a regression test that forces concurrent first-initialization of the 
offset classes through a dedicated class loader across repeated rounds and 
fails if it does not complete promptly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to