EVALUATION
I believe the crash stack pointed out in the comments section comes from Linux platform. The root cause of the crash is the Thread object getting from Thread::current() call is NULL since the fast path for retrieving the Thread object from the internal array (caching the known Thread objects) fails.
To be a little bit more in detail, there is a array used internally for caching the Thread objects created. The array index for these Thread object is carefully choosen. There might be crash before inserting the Thread object into that array and as a result, it might cause The fast path of retrieving the Thread object to return NULL.
As a good practice, in the possible VM exit path, we should program defensively to consider that possibility. So the fix would be as simple as falling back to slow path when Thread returned from Thread::current is NULL.
|