Segfault in CompiledMethod::is_unloading()

Andrew Haley aph at redhat.com
Fri Nov 16 14:06:41 UTC 2018


On 11/15/18 8:16 PM, Vladimir Kozlov wrote:
> 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?

We do.

> What is call stack?

#0  JVM_handle_linux_signal (sig=11, info=0xffff488cd0b0, ucVoid=0xffff488cd130, abort_if_unrecognized=1)
    at /home/aph/jdk-jdk/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp:509
#1  0x0000ffffb6f898a4 in signalHandler (sig=11, info=0xffff488cd0b0, uc=0xffff488cd130)
    at /home/aph/jdk-jdk/src/hotspot/os/linux/os_linux.cpp:4422
#2  <signal handler called>
#3  0x0000ffffb685b5d4 in CompiledMethod::is_unloading (this=0xffff1c6e8830)
    at /home/aph/jdk-jdk/src/hotspot/share/code/compiledMethod.cpp:604
#4  0x0000ffffb685b958 in clean_if_nmethod_is_unloaded<CompiledIC> (ic=0xffffb051a7f0,
    addr=0xffff909111a8 <M1795_292_java.util.List.add(Ljava/lang/Object;)Z_plt.jmp> "0\215\005\220\020\"\034\221\020\002", <incomplete sequence \371>, from=0xffff1c6e8830, clean_all=false) at /home/aph/jdk-jdk/src/hotspot/share/code/compiledMethod.cpp:508
#5  0x0000ffffb685b49c in clean_if_nmethod_is_unloaded (ic=0xffffb051a7f0, from=0xffff1c6e8830, clean_all=false)
    at /home/aph/jdk-jdk/src/hotspot/share/code/compiledMethod.cpp:517
#6  0x0000ffffb685b754 in CompiledMethod::cleanup_inline_caches_impl (this=0xffff1c6e8830, unloading_occurred=false, clean_all=false)
    at /home/aph/jdk-jdk/src/hotspot/share/code/compiledMethod.cpp:638
#7  0x0000ffffb659782c in CompiledMethod::cleanup_inline_caches (this=0xffff1c6e8830, clean_all=false)
    at /home/aph/jdk-jdk/src/hotspot/share/code/compiledMethod.hpp:351
#8  0x0000ffffb71118bc in NMethodSweeper::process_compiled_method (cm=0xffff1c6e8830)
    at /home/aph/jdk-jdk/src/hotspot/share/runtime/sweeper.cpp:780
#9  0x0000ffffb7110b60 in NMethodSweeper::sweep_code_cache () at /home/aph/jdk-jdk/src/hotspot/share/runtime/sweeper.cpp:545
#10 0x0000ffffb7110640 in NMethodSweeper::possibly_sweep () at /home/aph/jdk-jdk/src/hotspot/share/runtime/sweeper.cpp:458
#11 0x0000ffffb7110134 in NMethodSweeper::sweeper_loop () at /home/aph/jdk-jdk/src/hotspot/share/runtime/sweeper.cpp:349
#12 0x0000ffffb716351c in sweeper_thread_entry (thread=0xffffb0519800, __the_thread__=0xffffb0519800)
    at /home/aph/jdk-jdk/src/hotspot/share/runtime/thread.cpp:3332
#13 0x0000ffffb715e370 in JavaThread::thread_main_inner (this=0xffffb0519800) at /home/aph/jdk-jdk/src/hotspot/share/runtime/thread.cpp:1813
#14 0x0000ffffb715e1c8 in JavaThread::run (this=0xffffb0519800) at /home/aph/jdk-jdk/src/hotspot/share/runtime/thread.cpp:1793
#15 0x0000ffffb715a4e4 in Thread::call_run (this=0xffffb0519800) at /home/aph/jdk-jdk/src/hotspot/share/runtime/thread.cpp:378
#16 0x0000ffffb6f8054c in thread_native_entry (thread=0xffffb0519800) at /home/aph/jdk-jdk/src/hotspot/os/linux/os_linux.cpp:701
#17 0x0000ffffb7ee7bb0 in start_thread () from /lib64/libpthread.so.0

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the hotspot-gc-dev mailing list