refactor: detect large files in Io functions#9828
Merged
Conversation
e219720 to
81d9c1e
Compare
Collaborator
Author
|
I tried to write some tests when the channel is not seekable; in that case |
`Io.read_all` and related functions read the contents of a file in a string, which has a size limit (`Sys.max_string_length`) and can be an issue in 32-bit systems. This makes an explicit check and raises a `Code_error` in these situations. Signed-off-by: Etienne Millon <me@emillon.org>
bdb798e to
3dc4479
Compare
rgrinberg
approved these changes
Jan 26, 2024
emillon
added a commit
to emillon/dune
that referenced
this pull request
Feb 5, 2024
`Io.read_all` and related functions read the contents of a file in a string, which has a size limit (`Sys.max_string_length`) and can be an issue in 32-bit systems. This makes an explicit check and raises a `Code_error` in these situations. Signed-off-by: Etienne Millon <me@emillon.org>
emillon
added a commit
that referenced
this pull request
Feb 5, 2024
* test: add repro for #9538 (subst on 32-bit) (#9539) Signed-off-by: Etienne Millon <me@emillon.org> * refactor: detect large files in Io functions (#9828) `Io.read_all` and related functions read the contents of a file in a string, which has a size limit (`Sys.max_string_length`) and can be an issue in 32-bit systems. This makes an explicit check and raises a `Code_error` in these situations. Signed-off-by: Etienne Millon <me@emillon.org> * fix(subst): ignore large files (#9811) Fixes #9538 This logs a warning for large files (>16MB on 32-bit systems). Signed-off-by: Etienne Millon <me@emillon.org> --------- Signed-off-by: Etienne Millon <me@emillon.org>
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.
Io.read_alland related functions read the contents of a file in a string, which has a size limit (Sys.max_string_length) and can be an issue in 32-bit systems. This makes an explicit check and raises aCode_errorin these situations.