JDK-8219584 : Try to dump error file by thread which causes safepoint timeout
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-02-22
  • Updated: 2019-08-15
  • Resolved: 2019-03-08
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 12 JDK 13
11.0.4Fixed 12.0.2Fixed 13 b12Fixed
Related Reports
Relates :  
Relates :  
Description
The VM supports diagnostic flags -XX:+SafepointTimeout and -XX:+AbortVMOnSafepointTimeout to detect safepoint synchronization timeouts and to exit with an error message.
However, we usually don't see what the thread was doing which didn't reach the safepoint.
We can get a more helpful hs_err file if we kill that thread and let it dump the hs_err file.

Note: This feature doesn't work on Windows. Some additional information (si_code, "sent by kill") is only displayed on linux.

New hs_err output:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=... (sent by kill), ...
#

The "T H R E A D" section should show a stack trace showing what the thread was actually doing.

The "printing siginfo" step should show more info like si_code (SI_TKILL), pid of the sender, etc if possible.

An Event is added:
Event: ... Thread ... sent signal 4 to Thread ... because blocking a safepoint.

Flags for using the feature this way:
-XX:+UnlockDiagnosticVMOptions
-XX:+SafepointTimeout
-XX:+SafepointALot
-XX:+AbortVMOnSafepointTimeout
-XX:SafepointTimeoutDelay=500
-XX:GuaranteedSafepointInterval=500

Comments
Fix Request I'd like to backport the following 2 changes at once (to 11u and 12u): "8219584: Try to dump error file by thread which causes safepoint timeout" "8220353: [TESTBUG] TestRegisterRestoring uses SafepointALot without UnlockDiagnosticVMOptions" I made manual changes to 8219584 (even though all these changes apply cleanly). They were reviewed: https://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2019-March/033119.html JDK-8220353 is a test fix needed after 8219584. Risk is very low because the feature is inactive by default. These changes enable backport of "8220374: C2: LoopStripMining doesn't strip as expected".
18-03-2019