JDK-8241296 : Segfault in JNIHandleBlock::oops_do()
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7,8,11,13,14,15
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • CPU: generic
  • Submitted: 2020-03-19
  • Updated: 2020-06-17
  • Resolved: 2020-03-20
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 11 JDK 13 JDK 14 JDK 15 Other
11.0.7Fixed 13.0.4Fixed 14.0.2Fixed 15 b16Fixed openjdk8u252Fixed
Description
We're seeing intermittent SEGVs in JDKs with some newer GCC versions and combinations of options. It turns out that it's a pretty trivial error which has never been noticed before. 

Thread::oops_do() does this:

void Thread::oops_do(OopClosure* f, CodeBlobClosure* cf) {
  active_handles()->oops_do(f);

However, there is a window while a Thread is being constructed when active_handles() is NULL. GC can occur during this time period, and it's a matter of luck that we haven't seen this crash before.
Comments
Fix request (13u): The original change applies cleanly, tier1 tests pass.
05-06-2020

Fix Request (14u) Dodges the (mis)compilation trouble with some compilers. Patch applies cleanly to 14u, passes tier1 tests. (Please pick this up to 14.0.1?).
23-03-2020

8u patch is here: http://cr.openjdk.java.net/~aph/8241296-8u/
20-03-2020

Patch applies cleanly to 11u.
20-03-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/60a0bfdf44b8 User: aph Date: 2020-03-20 13:13:27 +0000
20-03-2020

RFR: https://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2020-March/028895.html
19-03-2020