RFR [XS] - 8139026 hotspot.script cannot handle command-line arguments with spaces (original) (raw)

Ioi Lam ioi.lam at oracle.com
Mon Oct 26 05:34:48 UTC 2015


Please review a very small fix:

http://cr.openjdk.java.net/~iklam/8139026-hotspot-script-arg-quoating/

Bug: hotspot/make/hotspot.script cannot handle command-line arguments with spaces

https://bugs.openjdk.java.net/browse/JDK-8139026

Summary of fix:

The old script was adding <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">@</mi><mi>t</mi><mi>o</mi><mi>a</mi><mi>s</mi><mi>t</mi><mi>r</mi><mi>i</mi><mi>n</mi><mi>g</mi><mi>l</mi><mi>i</mi><mi>k</mi><mi>e</mi><mi>X</mi><mo>=</mo><mi mathvariant="normal">&quot;</mi><mi>A</mi><mi>B</mi></mrow><annotation encoding="application/x-tex">@ to a string like X=&quot;A B </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord">@</span><span class="mord mathnormal">t</span><span class="mord mathnormal">o</span><span class="mord mathnormal">a</span><span class="mord mathnormal">s</span><span class="mord mathnormal">t</span><span class="mord mathnormal" style="margin-right:0.02778em;">r</span><span class="mord mathnormal">in</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal" style="margin-right:0.01968em;">l</span><span class="mord mathnormal" style="margin-right:0.03148em;">ik</span><span class="mord mathnormal">e</span><span class="mord mathnormal" style="margin-right:0.07847em;">X</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord">&quot;</span><span class="mord mathnormal">A</span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span>@ C". Doing 

that would lose the quotation on the arguments. This would cause JTREG to fail when running with Jigsaw modules (see bug report for details).

The fix is to pass "$@" directly as arguments to all programs 

launched by hotspot.script

Note that the fix does not address the problem with DBX, but at 

least it's no worse than before.

Tests:

 I have used the modified version for the past 2 weeks with GDB and 

JTREG and found no issues.

 Also, casual testing shows the quotation is retained:

 $ hotspot 'a a'
 Error: Could not find or load main class a a
 $ hotspot "a' a"
 Error: Could not find or load main class a' a
 $ hotspot "a\"' a"
 Error: Could not find or load main class a"' a

Thanks



More information about the hotspot-dev mailing list