- 
    Type:
Bug
 - 
    Resolution: Fixed
 - 
    Priority:
  P4                     
     - 
    Affects Version/s: 17.0.3-oracle
 - 
    Component/s: hotspot
 
| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build | 
|---|---|---|---|---|---|---|
| JDK-8290222 | 17.0.5-oracle | Dukebot | P4 | Resolved | Fixed | b02 | 
| JDK-8290805 | 17.0.5 | Goetz Lindenmaier | P4 | Resolved | Fixed | b01 | 
                    We've observed a deadlock in leakprofiler::emit_events when the JVM is shut down with Runtime.getRuntime().halt(). 
Suggestion for resolution:
During investigation, [~egahlin] has commented that JfrEmergencyDump::on_vm_shutdown didn't seem to be designed for being run from Java. Nevertheless, it can be reached from a Java call to Runtime.getRuntime().halt() [1]. To resolve, add a boolean parameter to Jfr::on_vm_shutdown do differentiate the "called from java" case, and in that case to not call JfrEmergencyDump::on_vm_shutdown.
[1] code path:
Runtime.getRuntime().halt()
JVM_Halt
before_exit
Jfr::on_vm_shutdown
JfrEmergencyDump::on_vm_shutdown
post_events
LeakProfiler::emit_events
Suggestion for resolution:
During investigation, [~egahlin] has commented that JfrEmergencyDump::on_vm_shutdown didn't seem to be designed for being run from Java. Nevertheless, it can be reached from a Java call to Runtime.getRuntime().halt() [1]. To resolve, add a boolean parameter to Jfr::on_vm_shutdown do differentiate the "called from java" case, and in that case to not call JfrEmergencyDump::on_vm_shutdown.
[1] code path:
Runtime.getRuntime().halt()
JVM_Halt
before_exit
Jfr::on_vm_shutdown
JfrEmergencyDump::on_vm_shutdown
post_events
LeakProfiler::emit_events
- backported by
 - 
                    
JDK-8290222 Deadlock in leakprofiler::emit_events during shutdown
-         
     - Resolved
 
 -         
 - 
                    
JDK-8290805 Deadlock in leakprofiler::emit_events during shutdown
-         
     - Resolved
 
 -         
 
- duplicates
 - 
                    
JDK-8282361 JFR hang in LeakProfiler::emit_events during shutdown
-         
     - Closed
 
 -         
 
- links to
 - 
                    
        
        Commit
        openjdk/jdk17u-dev/fbaf069d
    
 - 
                    
        
        Commit
        openjdk/jdk/e8568b89
    
 - 
                    
        
        Review
        openjdk/jdk17u-dev/568
    
 - 
                    
        
        Review
        openjdk/jdk/9465
    
 
             (2 links to)