fix: make fd_tell and path_filestat_get WASI stubs abort instead of silently returning success#20904
Open
johnathan79717 wants to merge 1 commit intomerge-train/barretenbergfrom
Open
fix: make fd_tell and path_filestat_get WASI stubs abort instead of silently returning success#20904johnathan79717 wants to merge 1 commit intomerge-train/barretenbergfrom
johnathan79717 wants to merge 1 commit intomerge-train/barretenbergfrom
Conversation
fd_tell was returning success without writing to the output offset pointer, leaving callers with stale data. Write 0 to the pointer instead. path_filestat_get was silently returning success without writing the filestat struct. Since barretenberg never intentionally calls stat(), abort like the other unimplemented filesystem stubs. Closes AztecProtocol/barretenberg#1648
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.
Summary
Two WASI stubs in
wasi_stubs.cppwere silently returning success (0) without doing the right thing. This is the same class of issue as theenviron_sizes_getfix in #20902.fd_tell: was returning success without writing to the output pointer. Since barretenberg never callsftell(), it now aborts like the other unimplemented stubs.path_filestat_get: was silently returning success without writing thefilestatoutput struct. Since barretenberg has no filesystem support, it now aborts like the other unimplemented filesystem stubs (path_filestat_set_times,path_link, etc.).Closes AztecProtocol/barretenberg#1648