JDK-8250911 : [windows] os::pd_map_memory error detection broken
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8,9,10,11,12,13,14,15,16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2020-08-01
  • Updated: 2021-03-15
  • Resolved: 2020-08-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 13 JDK 16
11.0.11-oracleFixed 13.0.7Fixed 16 b09Fixed
Related Reports
Relates :  
Description
os::pd_map_memory() uses CreateFile to open the file-to-be-mapped, but uses NULL instead of INVALID_HANDLE_VALUE to check if opening the file failed or not.

Which is wrong, NULL is actually a valid value. 

INVALID_HANDLE_VALUE is -1.

Seems to be a very old bug; it is in all releases AFAICS.


Comments
Fix request (13u) Requesting backport to 13u for parity with 11u. The patch applies cleanly. Tested with tier1.
15-03-2021

Fix Request: Important to fix because: handle - instead of ignoring - mapping errors on Windows, e.g. if CDS cannot map its archive files. Confusing secondary errors happen otherwise. Nature of fix: Compare with INVALID_HANDLE_VALUE instead of NULL Low risk because: Very simple patch. Errors would happen later with broken mappings anyway. Applies cleanly: yes Testing done: nightlies, manual
02-12-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/c13af6e1d11f User: stuefe Date: 2020-08-02 07:55:58 +0000
02-08-2020