[IO] Add IREE_IO_FILE_MODE_SHARE_READ to internal read-only callers#24007
Open
jtuyls wants to merge 1 commit intoiree-org:mainfrom
Open
[IO] Add IREE_IO_FILE_MODE_SHARE_READ to internal read-only callers#24007jtuyls wants to merge 1 commit intoiree-org:mainfrom
jtuyls wants to merge 1 commit intoiree-org:mainfrom
Conversation
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>
3284344 to
ae0ff08
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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