Segfault in CompiledMethod::is_unloading()

Andrew Haley aph at
Thu Nov 15 17:45:57 UTC 2018

I'm seeing a segfault at

  state_is_unloading = IsUnloadingBehaviour::current()->is_unloading(this);


  IsUnloadingBehaviour::_current == NULL

I see IsUnloadingBehaviour::set_current called earlier by the VM thread
with NULL as its argument.

Should this segfault be impossible? If so, why?

  _is_unloading_state == 4 at this point.

Surely we should check that sUnloadingBehaviour::_current != NULL
before calling it?

The method being processed by NMethodSweeper::process_compiled_method

 755674 12888     aot[ 1]   jdk.internal.reflect.Label.add(Ljdk/internal/reflect/ClassFileAssembler;SSI)V   AOTCompiledMethod

This is a complex and hard-to-reproduce test case, so if anyone
can give me a clue about what's supposed to happen I'd appreciate

Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

More information about the hotspot-gc-dev mailing list