RFR: 8371048: ImageFileReader::open fails to check return value of osSupport::map_memory

Justin King jcking at openjdk.org
Fri Oct 31 16:00:02 UTC 2025


Check whether `osSupport::map_memory` actually succeeded in all compliation modes, instead of crashing shortly after in non-debug builds. Ideally we should fall back to just reading the entire file into memory manually or use seek+read, but this is good enough for now to avoid crashing.

-------------

Commit messages:
 - JDK-8371048: ImageFileReader::open fails to check return value of osSupport::map_memory

Changes: https://git.openjdk.org/jdk/pull/28087/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28087&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8371048
  Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28087.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28087/head:pull/28087

PR: https://git.openjdk.org/jdk/pull/28087


More information about the hotspot-dev mailing list