JDK-8253572 : [windows] CDS archive may fail to open with long file names
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8,11,12,13,14,15,16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2020-09-24
  • Updated: 2021-06-08
  • Resolved: 2020-09-26
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 16
11.0.12Fixed 16 b18Fixed
Related Reports
Relates :  
Description
On Windows, os::pd_map_memory() uses CreateFile, not CreateFileW, to get a handle to the mapped file. This causes misleading "file not found" errors if the file name is longer than Windows allows [1][2].

AFAICS os::pd_map_memory is only used by CDS.

[1] https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
[2] https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
Comments
Fix Request: I'd like to fix this in 11u since the bug affects 11u. Important to fix since this causes the VM to be unable to open CDS archives with path names longer than 260 chars. To make matters worse, the error report is not very clear either. Nature of the fix: use CreateFileW instead of CreateFile Low risk (the fix is small and the technique is used in a number of other places almost verbatim) Applies cleanly: yes Fix tested in our nightlies.
19-04-2021

Changeset: b66fa8f4 Author: Thomas Stuefe <stuefe@openjdk.org> Date: 2020-09-26 04:12:54 +0000 URL: https://git.openjdk.java.net/jdk/commit/b66fa8f4
26-09-2020