Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wisp] Fix coroutine miss nmethod marking cause by work stealing. #176

Open
nebula-xm opened this issue Nov 15, 2023 · 0 comments
Open

[Wisp] Fix coroutine miss nmethod marking cause by work stealing. #176

nebula-xm opened this issue Nov 15, 2023 · 0 comments

Comments

@nebula-xm
Copy link

nebula-xm commented Nov 15, 2023

Summary:
NMethodMarkingClosure will do handshake to scan nmethod and mark out of safepoint. If a coroutine is steal from a not scanned thread to a scanned thread. The coroutine will miss current round of nmethod marking then collected by mistake. The above case will lead to a crash.

The crash as follow:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (codeCache.cpp:647), pid=14780, tid=14962
#  guarantee(is_result_safe || is_in_asgct()) failed: unsafe access to zombie method
#
# JRE version: OpenJDK Runtime Environment (kwai-snowman17-0.0.1-SNAPSHOT) (17.0.7+7) (build 17.0.7-internal+7)
# Java VM: OpenJDK 64-Bit Server VM (kwai-snowman17-0.0.1-SNAPSHOT) (17.0.7-internal+7, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x5c6944]  CodeCache::find_blob(void*)+0xf4
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/local/bin/core_capturer.py -t %t -P %P -p %p -i %i -u %u -g %g -s %s -E %E -H %h" (or dumping to /home/web_server/kuaishou-tomcat/bin/tomcat/bin/core.14780)
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

Current thread (0x000055574fec1a00):  JavaThread "Wisp-Root-Worker-17" daemon [_thread_in_vm, id=14962, stack(0x00007f16fe241000,0x00007f16fe2d9000)]

Stack: [0x00007f16fe241000,0x00007f16fe2d9000],  sp=0x00007f16fe2d55d0,  free space=593k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x5c6944]  CodeCache::find_blob(void*)+0xf4
V  [libjvm.so+0x6f0225]  frame::frame(long*, long*, long*, unsigned char*)+0x35
V  [libjvm.so+0x6ef8ae]  frame::sender(RegisterMap*) const+0x19e
V  [libjvm.so+0xd07ef7]  SharedRuntime::resolve_sub_helper(bool, bool, JavaThread*)+0xb7
V  [libjvm.so+0xd082a7]  SharedRuntime::resolve_helper(bool, bool, JavaThread*)+0x37
V  [libjvm.so+0xd0861c]  SharedRuntime::resolve_virtual_call_C(JavaThread*)+0x3c
v  ~RuntimeStub::resolve_virtual_call
J  0x00007f177fed02f0

Test Plan: all wisp tests

Reviewed-by: yulei

nebula-xm added a commit to kuaishou-syslab/dragonwell17 that referenced this issue Nov 15, 2023
Summary:
NMethodMarkingClosure will do handshake to scan nmethod and mark out of safepoint. If a coroutine is steal from a not scanned thread to a scanned thread. The coroutine will miss current round of nmethod marking then collected by mistake. The above case will lead to a crash.

Test Plan: all wisp tests

Reviewed-by: yulei

Issue:
dragonwell-project#176
yuleil pushed a commit that referenced this issue Nov 16, 2023
Summary:
NMethodMarkingClosure will do handshake to scan nmethod and mark out of safepoint. If a coroutine is steal from a not scanned thread to a scanned thread. The coroutine will miss current round of nmethod marking then collected by mistake. The above case will lead to a crash.

Test Plan: all wisp tests

Reviewed-by: yulei

Issue:
#176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant