RFR: 8353439: Shell grouping of -XX:OnError= commands is surprising [v3]
Kevin Walls
kevinw at openjdk.org
Tue Apr 8 13:36:18 UTC 2025
On Tue, 8 Apr 2025 09:42:16 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Kevin Walls has updated the pull request incrementally with one additional commit since the last revision:
>>
>> comment
>
> src/hotspot/share/utilities/vmError.cpp line 156:
>
>> 154:
>> 155: const char * cmdend = cmd;
>> 156: while (*cmdend != '\0' && *cmdend != ';' && *cmdend != '\n') cmdend++;
>
> What happens if I specify, eg in Bash:
>
> -XX:OnError=lengthy command \
> more command options
>
> ?
They should get joined into one line by the shell, so we see them as one OnError arg:
$ java ....args... -XX:OnError="/bin/echo ONE \
> TWO THREE" MyApp
...crash:
# -XX:OnError="/bin/echo ONE TWO THREE"
# Executing /bin/sh -c "/bin/echo ONE TWO THREE" ...
ONE TWO THREE
Aborted (core dumped)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24354#discussion_r2033206360
More information about the hotspot-dev
mailing list