Segfault in CompiledMethod::is_unloading()

Vladimir Kozlov vladimir.kozlov at oracle.com
Thu Nov 15 20:16:39 UTC 2018


On 11/15/18 9:45 AM, Andrew Haley wrote:
> I'm seeing a segfault at
> 
>    state_is_unloading = IsUnloadingBehaviour::current()->is_unloading(this);
> 
> because
> 
>    IsUnloadingBehaviour::_current == NULL
> 
> I see IsUnloadingBehaviour::set_current called earlier by the VM thread
> with NULL as its argument.

Should happen only in UnloadingScope destructor.
Do we have IsUnloadingBehaviour::current() call outside unloading scope?
What is call stack?

Vladimir

> 
> 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
> is:
> 
>   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
> it.
> 


More information about the hotspot-gc-dev mailing list