Skip to content

[IO] Add IREE_IO_FILE_MODE_SHARE_READ to internal read-only callers#24007

Open
jtuyls wants to merge 1 commit intoiree-org:mainfrom
jtuyls:fix-file-share-read-windows
Open

[IO] Add IREE_IO_FILE_MODE_SHARE_READ to internal read-only callers#24007
jtuyls wants to merge 1 commit intoiree-org:mainfrom
jtuyls:fix-file-share-read-windows

Conversation

@jtuyls
Copy link
Copy Markdown
Contributor

@jtuyls jtuyls commented Apr 3, 2026

On Windows, opening the same file for reading from multiple places fails with ERROR_SHARING_VIOLATION. Fix internal callers to pass IREE_IO_FILE_MODE_SHARE_READ when opening files for reading.

Fixed callers:

  • file_contents.c: iree_io_file_contents_read, iree_io_file_contents_map
  • parameter_util.c: parameter file loading (preload and mmap modes)

Add a test that opens the same file twice for reading concurrently, validating the fix on all platforms. See test failing on windows without this fix: https://github.com/iree-org/iree/actions/runs/23940576218/job/69825870972

@jtuyls jtuyls requested a review from benvanik as a code owner April 3, 2026 13:28
On Windows, opening the same file for reading from multiple places
fails with ERROR_SHARING_VIOLATION. Fix internal callers to pass
IREE_IO_FILE_MODE_SHARE_READ when opening files for reading.

Fixed callers:
- file_contents.c: iree_io_file_contents_read, iree_io_file_contents_map
- parameter_util.c: parameter file loading (preload and mmap modes)

Add a test that opens the same file twice for reading concurrently,
validating the fix on all platforms.

Signed-off-by: Jorn <jorn.tuyls@gmail.com>
@jtuyls jtuyls force-pushed the fix-file-share-read-windows branch from 3284344 to ae0ff08 Compare April 3, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant