RFR 8167546: enhance os::file_name_strncmp() on Mac OSX

Gerard Ziemski gerard.ziemski at oracle.com
Wed Oct 3 17:44:13 UTC 2018

Hi all,

Please review this fix, which allows CDS archives to be opened by using case insensitive path name on case insensitive filesystems on Mac OS X.

Background: this issue only affects Mac OS X, with case insensitive filesystem, for those archives which use “ExtraSharedClassListFile” option to embed the name of the main class, when referring to the original class path using name with different letter case (in other words, uncommon).

Example: we create archive using:

 java -cp hello.jar -Xshare:dump -XX:ExtraSharedClassListFile=my.list -XX:SharedArchiveFile=my.jsa

(where “my.list” contains "Hello”), but then later try running it using this command:

 java -cp Hello.jar -Xshare:on -XX:SharedArchiveFile=my.jsa Hello 

(notice 1st command refers to “hello.jar”, but 2nd uses “Hello.jar”)

On Mac with filesystem with case insensitive paths, this currently erroneously fails. I believe that this is technically an issue, but we have not received any real world reports complaining about this. A developer who uses different case path names and assumes that the underlaying system is case insensitive, and therefore such use case should work, is in my opinion asking for trouble, but given the time I spent on this issue so far, I’m inclined to push the fix, so that no one else needs to address it again in the future. Plus, the fix seems reasonably simple.

CDS archives can be referred to by using relative paths, as in this example (i.e. “hello.jar”), but also using absolute paths (i.e. “/Volumes/Work/hello.jar”) and this fix accounts for both.

Side note: interestingly enough, one can not create an archive using a relative path to a jar, and then later refer to that jar by using its absolute path, even when those are in fact the same jar file.

bug: https://bugs.openjdk.java.net/browse/JDK-8167546
webrev: http://cr.openjdk.java.net/~gziemski/8167546_rev1
testing: Mach5 hs-tier1,2,3,4,5,6,7

More information about the hotspot-runtime-dev mailing list