path_filestat_set_times silently does nothing
Summary
path_filestat_set_times (POSIX utimensat) returns Errno::Success and leaves the target file's timestamps unchanged.
The implementation resolves the path to an inode, reads that inode's stat into a binding it then discards, and writes the requested timestamps to the inode of the directory file descriptor that was passed in instead. The target file is never modified. This affects host-mounted volumes and the in-memory filesystem alike, and nothing is propagated to the host in either case.
There is no error, no errno, and no partial effect, so a caller has nothing to detect.
A related defect, #6973: in the sibling syscall fd_filestat_set_times. Same code area.
Component: lib/wasix (WASI/WASIX syscalls)
Affected versions: confirmed on 7.2.1 and 7.4.0
$ wasmer -vV
wasmer 7.4.0
binary: wasmer-cli
commit-hash: 32b50f8b600efa8e2d5f88593c453139bf1ca222
commit-date: 2026-08-31
host: x86_64-unknown-linux-gnu
CPU flags: sse2 sse3 ssse3 sse4.1 sse4.2 popcnt avx bmi bmi2 avx2 avx512dq avx512vl avx512f lzcnt fma
runtimes: Singlepass, Cranelift, LLVM, V8
features: wasix, napi_v10, napi_extension_wasmer_vSteps to reproduce
Reproducer attached: wasmer-utimensat-repro.zip . It needs only wasmer and python3 .
unzip wasmer-utimensat-repro.zip
cd wasmer-utimensat-repro
./run.sh # or: ./run.sh /path/to/wasmerrun.sh creates a test file on a --volume-mounted host directory, calls path_filestat_get → path_filestat_set_times (SET_ATIM|SET_MTIM, st_mtim = 1e18 ns = 1000000000 s) → path_filestat_get, and prints the host-side mtime before and after.
Expected
st_mtim becomes 1000000000 in both the guest and host views.
Actual
host mtime before: 1788401232
path_filestat_get(before) rc = 0
path_filestat_set_times rc = 0
path_filestat_get(after) rc = 0
guest mtim: 1788401232 -> 1788401232 (wanted 1000000000) moved=False
host mtime after: 1788401232 (wanted 1000000000)Success is reported three times and nothing changes.
Additional context
Where the timestamps actually go. The second module in the bundle (wrong_inode.wat, also run by run.sh) makes the same call on the file d/test.txt, then stats the directory fd 3:
path_filestat_set_times rc = 0
DIRECTORY mtim: 0 -> 1000000000 moved=TrueThe directory received the timestamps intended for the file.
Reference comparison. The same module under wasmtime 48.0.1, same host, same file. The preopen layout differs — wasmtime maps the directory to fd 3 directly, so change the path in repro.wat to test.txt and its length to 8, then run wasmtime run --dir ./testdir::/d repro.wat:
host mtime before: 1788399561
path_filestat_set_times rc = 0
guest mtim: 1788399561 -> 1000000000 (wanted 1000000000) moved=True
host mtime after: 1000000000 (wanted 1000000000)Not a host-passthrough issue. The same no-op occurs against a purely in-memory file under /tmp with no --volume at all.
Disclosure on AI Content
I used AI (Claude Opus) to assist with authoring this issue, and the reproducer code is entirely AI generated.
Source: wasmerio/wasmer