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

jdb quoted option parsing broken

    XMLWordPrintable

Details

    • b12
    • 7u6
    • b17

    Backports

      Description

        This was identified while researching solutions to the following Tomcat bug:
        https://bz.apache.org/bugzilla/show_bug.cgi?id=63815

        While the Tomcat case is a little more complicated, this issue can be reduced to trying to pass a system property where the value contains a space. This works with java but the equivalent jdb fails.

        A test case is available here:
        https://github.com/markt-asf/tomcat-bugs/tree/master/src/java/org/apache/tomcat/bug63815

        You need EchoArgs.java and jdb-test.sh.
        EchoArgs.java is a simple Java program that echos the arguments used to the console.
        jdb-test.sh first calls this program via java and then via jdb

        java "-Dfoo=ba" ...
        and
        jdb "-Dfoo=ba" ...

        work as expected. However, if a space is inserted:
        java "-Dfoo=b a" ...
        works but
        jdb "-Dfoo=b a" ...
        fails. It thinks a is the main class name.

        Attachments

          Issue Links

            Activity

              People

                amenkov Alex Menkov
                markt Mark Thomas
                Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: