From 8446178ed6b7999202d512a7d00bc20f0bcebe61 Mon Sep 17 00:00:00 2001 From: Jonathan Hao Date: Thu, 26 Feb 2026 15:57:18 +0000 Subject: [PATCH] fix: correct fd_tell and path_filestat_get WASI stubs 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 https://github.com/AztecProtocol/barretenberg/issues/1648 --- barretenberg/cpp/src/barretenberg/wasi/wasi_stubs.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/barretenberg/cpp/src/barretenberg/wasi/wasi_stubs.cpp b/barretenberg/cpp/src/barretenberg/wasi/wasi_stubs.cpp index af2520e76c42..d5b6cc5d3928 100644 --- a/barretenberg/cpp/src/barretenberg/wasi/wasi_stubs.cpp +++ b/barretenberg/cpp/src/barretenberg/wasi/wasi_stubs.cpp @@ -165,7 +165,8 @@ int32_t __imported_wasi_snapshot_preview1_fd_renumber(int32_t, int32_t) int32_t __imported_wasi_snapshot_preview1_fd_tell(int32_t, uint64_t*) { - info("fd_tell stubbed."); + info("fd_tell not implemented."); + abort(); return 0; } @@ -200,6 +201,8 @@ int32_t __imported_wasi_snapshot_preview1_fd_prestat_dir_name(int32_t, int32_t, int32_t __imported_wasi_snapshot_preview1_path_filestat_get(int32_t, int32_t, int32_t, int32_t, int32_t) { + info("path_filestat_get not implemented."); + abort(); return 0; }