JDK-8234808 : jdb quoted option parsing broken
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 8,11,13.0.1,14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-11-26
  • Updated: 2021-02-02
  • Resolved: 2020-09-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b17Fixed
Related Reports
Relates :  
Relates :  
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.
Comments
Fix confirmed. Thanks. Are there any plans to back-port the fix to the LTS versions?
22-09-2020

Changeset: d1f9b8a8 Author: Alex Menkov <amenkov@openjdk.org> Date: 2020-09-22 00:05:14 +0000 URL: https://git.openjdk.java.net/jdk/commit/d1f9b8a8
22-09-2020

After verification, i confirm the regression is caused by JDK-7154809, logic used for strip off enclosing quote chars doesn't take care of spaces in between. Unassigning myself...
07-01-2020

I checked all the issues got fixed in 8 b36 and could not find any, looked again JDK-7154809, it got fixed in 7u6 b12 where the current issue fails. where as 7u6 b11 it passes. For 8u backport it is still confusing, why it shows as fixed in b50 instead of b36? I will revert the patch and reverify, but ATM regression is due to JDK-7154809 it is strong suspect.
06-01-2020