Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8281275

Upgrading from 8 to 11 no longer accepts '/' as filepath separator in gc paths

XMLWordPrintable

    • b10
    • x86_64
    • windows

        A DESCRIPTION OF THE PROBLEM :
        I'm running the following java command in a Windows Server 2016 operating system using the latest Java 11 version:

        java -Xlog:gc*:file="C:\users\test_gc.log" -version

        This completes successfully.

        However, I would like to be able to do:

        java -Xlog:gc*:file="C:/users/test_gc.log" -version

        This fails due to the forward slashes in a Windows system. This would be normal in a cmd terminal; however, I'm testing the commands above in PowerShell which accepts both backslashes and forward slashes in paths.

        In java 8, forward slashes were acceptable and both of the above commands worked (albeit with \\ for the backslash case). Furthermore, in Java 8 the quotes weren't required due to its xloggc syntax that didn't have a colon. Specifically in this bug report, I would like the bugged incompatibility with '/' to be addressed.

        The loss of a universal forward slash in paths wreaks havoc with running software in Windows that has multiple embedded 3rd-party java components, as each embedded component parses the backslashes differently. Right now I have a combination of single backslashes, double backslashes, and even 4 backslashes as path separators for different java components (jboss, spark, hive). These are common java software products, and it is impossible to address all of their source codes to handle the \ in the same manner.

        For java 11 gc paths to be usable on Windows, it must be able to accept '/' inputs as filepath separators. Thank you.


        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Install latest Java 8 Hotspot version on Windows 64.

        Open PowerShell.

        Enter (substitute User with your username):

        java -Xloggc:C:/Users/User/Documents/gc8.log -version

        Repeat with the latest Java 11 Hotspot version:

        java -Xlog:gc*:file="C:/Users/User/Documents/gc11.log" -version

        It will fail.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        I expected this output:

        openjdk version "11.0.14" 2022-01-18
        OpenJDK Runtime Environment Temurin-11.0.14+9 (build 11.0.14+9)
        OpenJDK 64-Bit Server VM Temurin-11.0.14+9 (build 11.0.14+9, mixed mode)
        ACTUAL -
        Error output:

        Invalid -Xlog option '-Xlog:gc*:file=C:/Users/User/Documents/gc11.log', see error log for details.
        Error: Could not create the Java Virtual Machine.
        Error: A fatal exception has occurred. Program will exit.

        CUSTOMER SUBMITTED WORKAROUND :
        Backslashes work:

        java -Xlog:gc*:file="C:\Users\User\Documents\gc11.log" -version


        FREQUENCY : always


              dholmes David Holmes
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: