-
Notifications
You must be signed in to change notification settings - Fork 1.7k
'native-image' compilation process crashes very rarely #3245
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
Comments
The crash is happening in a stack that contains
|
I'll update with full reproducer instructions and include the code shortly. |
I've edited the steps to reproduce and included a gist with minimal code. It sounds like an issue with Hotspot transformation of event classes for JFR. This is pretty niche; I'm not sure now if this bug report is appropriate for upstream at this exact moment since the JFR work is still in progress @ https://github.com/native-image-jfr/graal |
Since the crash is in the JDK module system code
it could also be just a generic JDK bug, where the HotSpot code needs to be made more defensive. So maybe file a OpenJDK bug for this? |
It looks to me like this happens when Modules::add_reads_module(from_module, to_module) calls from_module->add_read(to_module) which in turn calls this->set_read_walk_required(to_module->loader_data()). This last call effectively executes to_module->loader_data()->is_builtin_class_loader_data(). Since by that point we know to_module cannot be null the SEGV indicates that to_module->loader_data() is NULL. Now normally when a module is created (by ModuleEntryTable::locked_create_entry) there is a prior assert that the field _class_loader_data is non-NULL. So, it's unlikely that in this case a NUL Lvalue has slipped through. The only case where that method is not used to create a module entry is when the java.base module is created. It's _class_loader_data may be temporarily null, up until ClassLoaderData::init_null_class_loader_data() gets called. It looks rather too late for that to be happening here but ... Running with module debug logging enabled might clarify things -- that requires a debug build of the JVM. |
Sorry I haven't been tracking this very well. I ended up opening a bug against OpenJDK to track this as an investigation from https://bugs.openjdk.java.net/browse/JDK-8265071 But now I realize it got closed with a reference back to this issue, hahah...... I'll see if I can allocate cycles of my own to debug this. |
Closing this older ticket with no updates in 4 years. I don't see any similar crash in our CI. If this is still relevant, please reopen, I suspect it has long been fixed. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the issue
When using
native-image
to compile a binary, the JVM process crashes very rarely:Steps to reproduce the issue
EventCommit.java
from: https://gist.github.com/jiekang/c2dd7851de31b88e7c6feb9453224303javac EventCommit.java
mx build
mx native-image -ea -esa --no-fallback -H:+AllowVMInspection EventCommit
Maybe more likely with:
`mx native-image -ea -esa --no-fallback -H:+AllowVMInspection "-J-XX:FlightRecorderOptions=retransform=false" EventCommit
And seen with both:
#3155 :
mx native-image -ea -esa --no-fallback -H:+AllowVMInspection EventCommit
#3070
mx native-image -ea -esa --no-fallback -H:+FlightRecorder EventCommit
Describe GraalVM and your environment:
More details
Edit:
2021-03-03: Updated steps to reproduce issue with code
The text was updated successfully, but these errors were encountered: