JDK-8215398 : -Xlog option usage => Invalid decorator '\temp\app_cds.log'.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9,11,12,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86_64
  • Submitted: 2018-12-13
  • Updated: 2022-04-26
  • Resolved: 2019-01-02
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 11 JDK 12 JDK 13
11.0.2Fixed 12.0.2Fixed 13 b03Fixed
Related Reports
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
Microsoft Windows 10 Pro (version 1803, OS version 17134.471)
OpenJDK 11.0.1 (2018-10-16), JRE 18.9 (build 11.0.1+13)


A DESCRIPTION OF THE PROBLEM :
Option -Xlog does not support Windows absolute paths, namely:
1) OK : -Xlog:class+load:file=app_cds.log
2) KO : -Xlog:class+load:file=c:\temp\app_cds.log
3) OK: -Xlog:class+load:file=\temp\app_cds.log  (<== drive C: is assumed here !)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
C:\temp> javac HelloWorld.java
C:\temp> jar cf app.jar -C . HelloWorld.class
C:\temp> java -XX:DumpLoadedClassList=C:\temp\classlist.txt -classpath app.jar HelloWorld
C:\temp> java -XX:SharedClassListFile=C:\temp\classlist.txt -XX:SharedArchiveFile=c:\temp\app_cds.jsa -Xshare:dump -classpath app.jar
C:\temp> 

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
C:\temp> java.exe -Xshare:on -Xlog:class+load:file=app_cds.log -XX:SharedArchiveFile=c:\temp\app_cds.jsa -classpath app.jar HelloWorld
Hello world!
ACTUAL -
C:\temp> java -Xshare:on -Xlog:class+load:file=c:\temp\app_cds.log -XX:SharedArchiveFile=c:\temp\app_cds.jsa -classpath app.jar HelloWorld
[0.003s][error][logging] Invalid decorator '\temp\app_cds.log'.
Invalid -Xlog option '-Xlog:class+load:file=c:\temp\app_cds.log', see error log for details.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

---------- BEGIN SOURCE ----------
// File C:\temp\HelloWorld.java
public class HelloWorld {
    public static void main(String... args) {
        System.out.println("Hello world!");
    }
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
*** simply omit the drive letter "C:" ***
C:\temp>  java -Xshare:on -Xlog:class+load:file=\temp\app_cds.log -XX:SharedArchiveFile=c:\temp\app_cds.jsa -classpath app.jar HelloWorld
Hello world!

FREQUENCY : always



Comments
Fix Request Backporting this patch improves -Xlog experience. Patch applies cleanly to 11u and 12u. Passes the regression test on Linux and Windows in both 11u and 12u. Regression test fails without the patch on Windows. Passes hotspot:tier1 on 11u and 12u. Also verified the broken -Xlog:class+load:file="c:\temp\app_cds.log" not working on current Windows builds, and working with patched build.
28-02-2019

URL: http://hg.openjdk.java.net/jdk/jdk/rev/883a1a80a6dc User: hseigel Date: 2019-01-02 15:36:18 +0000
02-01-2019

I'm very surprised it has taken a couple of years for this issue to be seen. I don't think we can use a different delimiter on different platforms - that would be a real problem for tests. Is "file=foo:something" even valid syntax for logging? What could the "something" be? If it's not valid then we can isolate the path before the next expected syntactic element. If it is valid then things are more difficult - we may have to special case the sequence <single-char>:\
16-12-2018

The logging support thinks that the ':' in "C:\..." delimits the next decorator. Perhaps use ';' as the delimiter on windows ?
14-12-2018

Issue exists in JDK 9.0.4, 11.0.1+13, 12-ea+23. C:\temp>java.exe -XX:+UnlockDiagnosticVMOptions -Xshare:on -Xlog:class+load:file=\temp\app_cds.log -XX:SharedArchiveFile=c:\temp\app_cds.jsa -classpath app.jar HelloWorld Hello, World C:\temp>java.exe -XX:+UnlockDiagnosticVMOptions -Xshare:on -Xlog:class+load:file=c:\temp\app_cds.log -XX:SharedArchiveFile=c:\temp\app_cds.jsa -classpath app.jar HelloWorld [0.003s][error][logging] Invalid decorator '\temp\app_cds.log'. Invalid -Xlog option '-Xlog:class+load:file=c:\temp\app_cds.log' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. 1) -Xlog:class+load:file=app_cds.log ==> Pass 2) -Xlog:class+load:file=c:\temp\app_cds.log ==> Fail 3) -Xlog:class+load:file=\temp\app_cds.log (<== drive C: is assumed here !) ==> Pass
14-12-2018