New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utimensat() with timespec=NULL sets wrong time #4184
Comments
Could you provide the wasm file here to help reproduce? You can also try running locally with |
I'm able to reproduce this. The RUST_LOG trace shows the flags values having |
|
This turned out to be a bug in wasi-libc. It was passing uninitialized values into WASI functions, which previously worked because it only does so when those values aren't being used, however with the recent LLVM update, LLVM is now optimizing in a way which actively breaks this code. I've now opened WebAssembly/wasi-libc#291 with a fix. |
The fix is now in the wasi-sdk-16 release. |
Thanks! Your patch fixed the utime tests in CPython's test suite. |
WASI libc or wasmtime set wrong atime and mtime when
utimensat
is used withNULL
timespec. The call is suppose to set the atime and mtime of the file to NOW, but it sets both to0
. I can't say if the problem is in wasi-libc__wasilibc_nocwd_utimensat
,utimens_get_timestamps
, or in wasmtimepath_filestat_set_times
implementation.Test Case
Reproducer:
Steps to Reproduce
Compile and run the reproducer with WASI-SDK's clang and wasmtime
Expected Results
utimensat
with timespecNULL
should set the mtime and atime of the file to the current time.Actual Results
wasmtime sets atime and mtime to 0.
Versions and Environment
WASI SDK: 15.0
Wasmtime version or commit: 0.36.0
Operating system: Linux (Ubuntu 20.04 in podman on Fedora 36)
Architecture: x86_64
Extra Info
Anything else you'd like to add?
The text was updated successfully, but these errors were encountered: