RFR: CODETOOLS-7902936 Stray VM warnings in forked PrintPropertiesMain lead to hard to debug XML parse exception [v2]

Aleksey Shipilev shade at openjdk.java.net
Tue May 25 16:53:09 UTC 2021

On Sat, 22 May 2021 01:54:46 GMT, Jason Zaugg <jzaugg at openjdk.org> wrote:

> What advice could we give? The use can't currently add JVM options to the `PrintPropertiesMain` forked JVM.

Argh. I thought we can ask user to provide `-Xlog` shun manually.

> * use a temporary file to transfer the XML. The parent process could create the file and pass its name as an argument to `PrintPropertiesMain`.

Yes, temp file would be cleanest option here. Call `FileUtils.tempFile("properties")` in host VM, pass the name of that file as the first argument to `PrintPropertiesMain`, let it write there, read the file back. This whole `stdout` mess is why JMH eventually moved to `BinaryLinkServer/Client` -- relying on standard streams to be pristine is wishful thinking :( But using the binary link here would be overkill.


PR: https://git.openjdk.java.net/jmh/pull/41

More information about the jmh-dev mailing list