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

Showing incorrect result while passing specific argument in the Java launcher tools

    Details

    • Subcomponent:
    • Introduced In Build:
      b06
    • Introduced In Version:
    • Resolved In Build:
      b126
    • CPU:
      x86_64
    • OS:
      windows
    • Verification:
      Verified

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.8.0_60"
        Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
        Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 10.0.10240]

        A DESCRIPTION OF THE PROBLEM :
        This is an error in the "java" launcher tool -- I couldn't find a category for that.
        Command line arguments, quoted and containing the 2 adjacent characters "\\*", adds extra "\\" characters to the argument. Really odd. Examples:
            Argument Character in arg received by process (raw, no escapes)
            "a\*\b" a\*\\b
            "a\*\*\b" a\*\\*\\\b
            "a\*\*\*\b" a\*\\*\\\*\\\\b
        This has been demonstrated on Windows 10 and Vista, using Java 8-60. I haven't test with older releases. I don't think it's a windows shell problem, as I get expected results using Python, Ruby, Go,
        and a batch script. I suspect the "java" tool is doing something to the args.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Run my little included program with arguments from my description.
        E.g.
           java Arg0 "a\*\b"

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        a\*\b"
        ACTUAL -
        a\*\\b

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        Arg0.java

        class Arg0 {
            public static void main(String[] args) {
                System.out.println(args[0]);
            }
        }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        None yet

          Issue Links

            Activity

            Hide
            aroy Abhijit Roy added a comment - - edited
            Test Result:
            ##########
            OS : Windows 7-64 bit
            ##################
            JDK
            *****
            6u111 b08- Pass
            6u45 b06 - Pass
            7u0 b147- Pass
            7u01 b08 - Pass
            7u05 b06 - Pass
            7u07 b10 - Pass
            7u09 b05 - Pass
            7u10 b18 - Fail
            7u13 b20 - Fail
            7u80 b15 - Fail
            8u0 b132- Fail
            8u65 b17 - Fail
            9ea b64 - Fail

            7u10,7u13,7u80,8,8u65,9ea
            ************************************
            c:\Abhijit\tools>javac Arg0.java
            c:\Abhijit\tools>java Arg0 "a\*\b"
            a\*\\b
            c:\Abhijit\tools>
            Show
            aroy Abhijit Roy added a comment - - edited Test Result: ########## OS : Windows 7-64 bit ################## JDK ***** 6u111 b08- Pass 6u45 b06 - Pass 7u0 b147- Pass 7u01 b08 - Pass 7u05 b06 - Pass 7u07 b10 - Pass 7u09 b05 - Pass 7u10 b18 - Fail 7u13 b20 - Fail 7u80 b15 - Fail 8u0 b132- Fail 8u65 b17 - Fail 9ea b64 - Fail 7u10,7u13,7u80,8,8u65,9ea ************************************ c:\Abhijit\tools>javac Arg0.java c:\Abhijit\tools>java Arg0 "a\*\b" a\*\\b c:\Abhijit\tools>
            Hide
            ksrini Kumar Srinivasan added a comment -
            This issue is specific to *Windows*.
            Show
            ksrini Kumar Srinivasan added a comment - This issue is specific to *Windows*.
            Show
            ksrini Kumar Srinivasan added a comment - the parser http://hg.openjdk.java.net/jdk9/dev/jdk/file/7f644a5d554a/src/java.base/windows/native/libjli/cmdtoargs.c is adding extra back-slashes.
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/3e215a8dba54
            User: robm
            Date: 2016-06-28 22:13:52 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/3e215a8dba54 User: robm Date: 2016-06-28 22:13:52 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/3e215a8dba54
            User: lana
            Date: 2016-07-06 20:17:35 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/3e215a8dba54 User: lana Date: 2016-07-06 20:17:35 +0000

              People

              • Assignee:
                robm Robert Mckenna
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: