RFR: 8273608: Deadlock when jcmd of OnError attaches to itself

Xin Liu xliu at openjdk.java.net
Mon Sep 20 22:12:09 UTC 2021


This patch allows the custom commands of OnError to attach to HotSpot itself. 
It sets the thread of report_and_die() to Native before os::fork_and_exec(cmd). 
This prevents cmds which require safepoint synchronization from deadlock.
eg. OnError='jcmd %p Thread.print'.

-------------

Commit messages:
 - 8273608: Deadlock when jcmd of OnError attaches to itself

Changes: https://git.openjdk.java.net/jdk/pull/5590/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5590&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8273608
  Stats: 34 lines in 1 file changed: 34 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5590.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5590/head:pull/5590

PR: https://git.openjdk.java.net/jdk/pull/5590


More information about the hotspot-dev mailing list