8225543: Jcmd fails to attach to the Java process on Linux using the main class name if whitespace options were used to launch the process
David Holmes
david.holmes at oracle.com
Thu Jun 13 05:21:53 UTC 2019
Hi Daniil,
These changes seem quite reasonable. In hindsight splitting the
command-line based on spaces was bound to hit problems with arguments
containing spaces. :(
Thanks for fixing.
David
On 13/06/2019 3:50 am, Daniil Titov wrote:
> Hi David and Serguei,
>
> Could you please have a look at this change? This fix is related with the changes [3] that you reviewed back in February.
>
> Mach5 sun/tools/jcmd, serviceability/dcmd/framework, jdk_svc, hotspot_serviceability, tier1, tier2 and tier3 tests passed.
>
> Thanks a lot!
> --Daniil
>
> On 6/10/19, 4:56 PM, "serviceability-dev on behalf of Daniil Titov" <serviceability-dev-bounces at openjdk.java.net on behalf of daniil.x.titov at oracle.com> wrote:
>
> Please review the change that fixes jcmd process name matching on Linux platform.
>
> After changes [3] , on Linux platform the proc filesystem is used to find a Java process, however, sun.tools.ProcessHelper class,
> introduced in that change, didn't take into account the presence of module whitespace options ( e.g. --patch-module) or the
> fact that some values of Java options could contain whitespaces.
>
> The latter problem is fixed by keeping '\0' as a separator for command line arguments read from /proc/{pid}/cmdline rather than
> replacing it with a whitespace. The former problem is fixed by making sun.tools.ProcessHelper aware of these module whitespace
> options (--add-opens, --add-exports,--add-reads, --add-modules, --patch-module,--limit-modules, or --upgrade-module-path) as well
> as of the case when a source-file mode is used or when --module options is used in "--<name>=<value>" format.
>
> Testing: sun/tools/jcmd and serviceability/dcmd/framework tests succeeded in Mach5. jdk_svc, tier1, tier2, and tier3 tests are in progress.
>
>
> [1] Webrev: http://cr.openjdk.java.net/~dtitov/8225543/webrev.01/
> [2] Bug: https://bugs.openjdk.java.net/browse/JDK-8225543
> [3] https://bugs.openjdk.java.net/browse/JDK-8205654
>
> Thanks!
> --Daniil
>
>
>
>
>
>
More information about the serviceability-dev
mailing list