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

Roger Riggs rriggs at openjdk.org
Wed Nov 12 23:47:02 UTC 2025


On Fri, 31 Oct 2025 14:00:38 GMT, Justin King <jcking at openjdk.org> wrote:

> 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.

src/java.base/share/native/libjimage/imageFile.cpp line 335:

> 333:     _index_data = (u1*)osSupport::map_memory(_fd, _name, 0, (size_t)map_size());
> 334:     if (_index_data == nullptr) {
> 335:       return false;

Indentation in this file is 4 spaces.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28087#discussion_r2520210679


More information about the core-libs-dev mailing list