RFR: 8206267: Unsafe publication of StubCodeDesc leads to crashes

Aleksey Shipilev shade at redhat.com
Tue Jul 3 14:57:39 UTC 2018

On 07/03/2018 04:31 PM, aph wrote:
> The StubCodeDesc constructor is unsychronized. However, it runs when
> the C2 compiler thread is initializing. The compiler thread reads the
> StubCodeDesc list while it is in an unstable state, resulting in a
> read from an uninitialized pointer field and it then segfaults,
> causing the VM to abort.
> http://cr.openjdk.java.net/~aph/8206267/
> OK for 11 and 12?

Looks good for 12.
Looks simple enough for 11.

Star formatting is a bit awkward:
   37 StubCodeDesc *volatile StubCodeDesc::_list = NULL;
   42   static StubCodeDesc *volatile _list;         // the list of all descriptors

...should probably be:
   37 StubCodeDesc* volatile StubCodeDesc::_list = NULL;
   42   static StubCodeDesc* volatile _list;         // the list of all descriptors


More information about the hotspot-runtime-dev mailing list