RFR: JDK-8227021: VM fails if any sun.boot.library.path paths are longer than JVM_MAXPATHLEN

Adam Farley8 adam.farley at uk.ibm.com
Mon Jul 1 12:27:11 UTC 2019


Hi All,

The title say it all. 

If you pass in a value for sun.boot.library.path consisting 
of one or more paths that are too long, then the vm will 
fail to start because it can't load one of the libraries it 
needs (the zip library), despite the fact that the VM 
automatically prepends the default library path to the 
sun.boot.library.path property, using the correct separator 
to divide it from the user-specified path.

So we've got the right path, in the right place, at the 
right time, we just can't *use* it.

I've fixed this by changing the relevant os.cpp code to
ignore paths that are too long, and to attempt to locate 
the needed library on the other paths (if any are valid).

I've also added functionality to handle the edge case of
paths that are neeeeeeearly too long, only for a 
sub-path (or file name) to push us over the limit *after*
the split_path function is done assessing the path length.

I've also changed the code we're overriding, on the assumption
that someone's still using it somewhere.

Bug: https://bugs.openjdk.java.net/browse/JDK-8227021
Webrev: http://cr.openjdk.java.net/~afarley/8227021/webrev/ 

Thoughts and impressions welcome.

Best Regards

Adam Farley 
IBM Runtimes

Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU



More information about the hotspot-dev mailing list