RFR: 8332287: When printing arguments in error logs, quote arguments with whitespaces [v2]

Kevin Walls kevinw at openjdk.org
Fri May 17 13:40:04 UTC 2024


On Thu, 16 May 2024 15:07:28 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Trivial fix to a simple issue.
>> 
>> In hs-err files, when printing the arguments of the crashed JVM process, print arguments with whitespaces in them with quotes. Makes it easier to copy-paste them to terminals.
>> 
>> Before:
>> 
>> Command Line: -Dtest.vm.opts=-XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressArrayCopyMacroNode -XX:+StressLCM -XX:+StressGCM -XX:+StressIGVN -XX:+StressCCP -XX:+StressMacroExpansion -XX:+StressMethodHandleLinkerInlining -XX:+StressCompiledExceptionHandlers -XX:CompileCommand=memlimit,*.*,1G~crash -XX:CompileCommand=memstat,*::*,print -Dtest.tool.vm.opts=-J-XX:+UnlockDiagnosticVMOptions -J-XX:-TieredCompilation -J-XX:+StressArrayCopyMacroNode -J-XX:+StressLCM -J-XX:+StressGCM -J-XX:+StressIGVN -J-XX:+StressCCP -J-XX:+StressMacroExpansion -J-XX:+StressMethodHandleLinkerInlining -J-XX:+StressCompiledExceptionHandlers -J-XX:CompileCommand=memlimit,*.*,1G~crash -J-XX:CompileCommand=memstat,*::*,print -XX:+StressCompiledExceptionHandlers -XX:CompileCommand=memlimit,*.*,1G~crash -XX:CompileCommand=memstat,*::*,print -Djava.library.path=/shared/projects/openjdk/jdk-jdk/output-fastdebug/images/test/hotspot/jtreg/native -Xbatch -XX:CompileCommand=option,*::*,bool,Vectorize
 ,true -XX:+PrintOpto -XX:+TraceLoopOpts com.sun.javatest.regtest.agent.MainWrapper /Users/thomas/shared/projects/openjdk/jtreg-runs/jtreg/JTwork/compiler/c2/TestFindNode.d/main.0.jta
>> 
>> 
>> Now (notice the gigantic -Dtest.vm.opts and -Dtest.tool.vm.opts that are actually just one large argument each)
>> 
>> 
>> Command Line: "-Dtest.vm.opts=-XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressArrayCopyMacroNode -XX:+StressLCM -XX:+StressGCM -XX:+StressIGVN -XX:+StressCCP -XX:+StressMacroExpansion -XX:+StressMethodHandleLinkerInlining -XX:+StressCompiledExceptionHandlers -XX:CompileCommand=memlimit,*.*,1G~crash -XX:CompileCommand=memstat,*::*,print" "-Dtest.tool.vm.opts=-J-XX:+UnlockDiagnosticVMOptions -J-XX:-TieredCompilation -J-XX:+StressArrayCopyMacroNode -J-XX:+StressLCM -J-XX:+StressGCM -J-XX:+StressIGVN -J-XX:+StressCCP -J-XX:+StressMacroExpansion -J-XX:+StressMethodHandleLinkerInlining -J-XX:+StressCompiledExceptionHandlers -J-XX:CompileCommand=memlimit,*.*,1G~crash -J-XX:CompileCommand=memstat,*::*,print" -XX:+StressCompiledExceptionHandlers -XX:CompileCommand=memlimit,*.*,1G~crash -XX:CompileCommand=memstat,*::*,print -Djava.library.path=/shared/projects/openjdk/jdk-jdk/output-fastdebug/images/test/hotspot/jtreg/native -Xbatch -XX:Comp...
>
> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
> 
>   cast to unsigned

OK, yes I can expect for the JVM arguments, it doesn't matter if the JVM sees -Dfoo="1 2 3 " or "-Dfoo=1 2 3 "

I just thought that if we report the quotes in a different place to the original, that we should at least acknowledge that difference somewhere in the change/bug report.  I was exactly noticing that this is an interpreted form of the arg.

(But yes it should be harmless, and no I don't want to suggest we should do anything much more clever here right now.)

I think -XX args work this way too, they don't mind the quotes moving.

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

PR Comment: https://git.openjdk.org/jdk/pull/19248#issuecomment-2117627764


More information about the hotspot-runtime-dev mailing list