JDK-8338656 : NPE at org.sunflow.core.Geometry.intersect on aarch64
  • Type: Bug
  • Component: hotspot
  • Sub-Component: test
  • Affected Version: 17,22,23,24,25
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2024-08-20
  • Updated: 2025-05-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26Unresolved
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
Running SPECJvm2008 sunflow on aarch64 fails intermittently (with low frequency) with the following NPE:

java.lang.NullPointerException: Cannot invoke "org.sunflow.core.AccelerationStructure.intersect(org.sunflow.core.Ray, org.sunflow.core.IntersectionState)" because "this.accel" is null
at org.sunflow.core.Geometry.intersect(Unknown Source)
at org.sunflow.core.Instance.intersect(Unknown Source)
at org.sunflow.core.InstanceList.intersectPrimitive(Unknown Source)
at org.sunflow.core.accel.BoundingIntervalHierarchy.intersect(Unknown Source)
at org.sunflow.core.Scene.trace(Unknown Source)
at org.sunflow.core.LightServer$1.run(Unknown Source)
at java.base/java.lang.Thread.run(Thread.java:1575)

ORIGINAL REPORT:

Running Kitchensink (8H) on JDK 24+10 (linux-aarch64) fails intermittently with the following NPE when compressed OOPs are disabled:

java.lang.NullPointerException: Cannot invoke "org.sunflow.core.AccelerationStructure.intersect(org.sunflow.core.Ray, org.sunflow.core.IntersectionState)" because "this.accel" is null
at org.sunflow.core.Geometry.intersect(Unknown Source)
at org.sunflow.core.Instance.intersect(Unknown Source)
at org.sunflow.core.InstanceList.intersectPrimitive(Unknown Source)
at org.sunflow.core.accel.BoundingIntervalHierarchy.intersect(Unknown Source)
at org.sunflow.core.Scene.trace(Unknown Source)
at org.sunflow.core.LightServer$1.run(Unknown Source)
at java.base/java.lang.Thread.run(Thread.java:1575)
Comments
> Good news: I could reproduce this after 65 runs with SPECJvm2008 sunflow and JDK 24-ea+10-1076 on Linux AArch64 I tried 1000 runs using the same JDK build, benchmark invocation, and platform but could not trigger the issue, unfortunately. No luck either using rr's chaos mode (to try to cause a data race with higher likelihood).
13-05-2025

The NPE has been observed independently and reported multiple times [1][2][3] as being caused by a race condition in the sunflow code. Note in particular that the failure reported in DaCapo's version of sunflow [1] (already accepted and fixed) is triggered from code compiled using GraalVM Native Image. IMO, this is enough evidence that the failure is not due to a C1/C2 bug. The fact that the failure has only been observed relatively recently (since 2023) even though we have used SPECjvm2008 sunflow for testing for a much longer time (as pointed out by [~stefank] [4]) may be explained by the fact that it is only observable on aarch64 architectures (tested more thoroughly in the latest years), or perhaps some VM change around 2023 made the failure more likely to trigger. [1] https://github.com/dacapobench/dacapobench/issues/258 [2] https://github.com/fpsunflower/sunflow/issues/4 [3] https://bugs.openjdk.org/browse/JDK-8323028?focusedId=14638532&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14638532 [4] https://bugs.openjdk.org/browse/JDK-8323028?focusedId=14645483&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14645483
09-05-2025

Updating the title and description to generalize all seen failures so far. The failure has been seen regardless of GC and OOP compression mode, the only commonality is use of aarch64 (often linux-aarch64 release but the failure has also been observed on linux-aarch64-debug and macosx-aarch64). Here is a summary of all the failures seen so far (VM version and VM configuration): jdk-25+21: -XX:+UseParallelGC -XX:+UseNUMA jdk-25+19 (personal build): -XX:+UseZGC jdk-25+19: -XX:+UseZGC jdk-25+17: (no VM args) jdk-25+14: (no VM args) jdk-25+12: (no VM args) jdk-24+27 (personal build): -XX:+UseParallelGC -XX:+UseNUMA jdk-24+27 (personal build): (no VM args) jdk-24+10 (personal build): -XX:-UseCompressedOops jdk-22+27 (personal build): -Xcomp -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:+TieredCompilation -XX:+UseZGC -XX:+ZGenerational jdk-17u (personal build): -XX:+UseParallelGC
09-05-2025

Thanks Leonid, so it's not related JDK-8347718.
22-04-2025

[~thartmann] still failing with this issue.
21-04-2025

Potentially related to JDK-8347718, we should try to verify once the fix is in.
15-01-2025

Given JDK-8345078, it looks like JDK-8335977 did *not* fix the issue. Re-opening.
08-01-2025

I'm closing this as duplicate of JDK-8335977 because I could not reproduce the issue with -XX:-ReduceAllocationMerges. Once the fix for JDK-8335977 is available, we need to verify that it fixes the issue.
16-09-2024

Turns out that I was lucky. Unfortunately, I did not manage to reproduce this anymore with SPECJvm2008 sunflow, even after thousands of iterations. JDK-8339526 might be related.
11-09-2024

I could not reproduce this with JDK 22 b7 after 1000 runs.
26-08-2024

[~cslucas] FYI, this is likely another regression from JDK-8287061 (it's reproducible with the fix for JDK-8331194). I'm currently trying to narrow it down.
22-08-2024

Good news: I could reproduce this after 65 runs with SPECJvm2008 sunflow and JDK 24-ea+10-1076 on Linux AArch64: java --enable-preview -XX:-UseCompressedOops -XX:MaxRAMPercentage=50 -XX:MaxMetaspaceSize=512m -jar SPECjvm2008.jar -ict -ikv -wt 0 -bt 2 -fit 240 -crf false -ctf false -chf false sunflow Iteration 1 (240s) begins: Wed Aug 21 16:31:49 GMT 2024 Exception in thread "Thread-760" java.lang.NullPointerException: Cannot invoke "org.sunflow.core.AccelerationStructure.intersect(org.sunflow.core.Ray, org.sunflow.core.IntersectionState)" because "this.accel" is null at org.sunflow.core.Geometry.intersect(Unknown Source) at org.sunflow.core.Instance.intersect(Unknown Source) at org.sunflow.core.InstanceList.intersectPrimitive(Unknown Source) at org.sunflow.core.accel.BoundingIntervalHierarchy.intersect(Unknown Source) at org.sunflow.core.Scene.trace(Unknown Source) at org.sunflow.core.LightServer$1.run(Unknown Source) at java.base/java.lang.Thread.run(Thread.java:1575)
21-08-2024

Pre-ILW = Unexpected NPE, extremely intermittent with SpecJvm sunflow benchmark running in parallel with other (stress) tests, no known workaround but potentially -XX:-ReduceAllocationMerges or disable compilation of affected method = HLM = P3
21-08-2024