RFR: 8352533: Report useful IOExceptions when jspawnhelper fails [v4]

Aleksey Shipilev shade at openjdk.org
Wed Apr 30 16:11:14 UTC 2025


> When jspawnhelper fails for whatever reason, but more prominently due to [JDK-8325621](https://bugs.openjdk.org/browse/JDK-8325621), it will report the errors into stdout, but not to the relevant `IOException`. So, if the application is configured to only capture the exception logs (e.g. through `java.util.logging`), we will miss any output from `jspawnhelper`, and user would be left without a clue what have happened. We have seen customers spending weeks trying to figure out what went wrong.
> 
> It would be good to provide useful `IOException` when `jspawnhelper` fails. We already have a precedent with vmError [printing helpful suggestions](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/utilities/vmError.cpp#L422) when VM fails, we can do a similar thing here. 
> 
> I am very open to bike-shedding about the actual message :)
> 
> Additional testing:
>  - [x] Ad-hoc experiments with breaking jspawnhelper
>  - [x] macos-aarch64-server-fastdebug, `java/lang/Process java/lang/ProcessBuilder`

Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:

 - Add bug ID
 - Merge branch 'master' into JDK-8352533-jspawnhelper-ioexceptions
 - Pull message into a field
 - Test cases
 - Merge branch 'master' into JDK-8352533-jspawnhelper-ioexceptions
 - Initial fix
   
   Good spawnhelper failure message
   
   Trying tests
   
   Print helper message on all IOExceptions
   
   Final

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/24149/files
  - new: https://git.openjdk.org/jdk/pull/24149/files/f1b9a9af..74ddf9af

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24149&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24149&range=02-03

  Stats: 317079 lines in 3027 files changed: 99805 ins; 205890 del; 11384 mod
  Patch: https://git.openjdk.org/jdk/pull/24149.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24149/head:pull/24149

PR: https://git.openjdk.org/jdk/pull/24149


More information about the core-libs-dev mailing list