Comments (3)
Expected behavior
Expected on Linux:
clock resolution 0 sec 1 nsec
Actual on Linux:
clock resolution 0 sec 1000 nsec
No I don't think this is really expected or bug at all. The whole point of WASI is isolation and if you make this happen, then you leak the host information into the Wasm guest, which basically breaks the sandbox. Why do you want to make this flux depending on the underlying OS? Ack this is not written in the WASI spec at all.
from wazero.
just FYI, wazero CLI is fixed to use WithSysWalltime API, and you can see what's expected there regarding resolutin:
// WithSysWalltime uses time.Now for sys.Walltime with a resolution of 1us
// (1000ns).
//
// See WithWalltime
WithSysWalltime() ModuleConfig
from wazero.
Just want to highlight that leaking host information is not unique to clock resolution. Wazero already leaks filesystem host information like most other Wasi runtimes (Wasmtime, WasmEdge, etc.), e.g. filestat::dev
, filestat::ino
. I think it's reasonable to expect a call to clock_res_get
return an accurate clock resolution, especially when the current Wazero clock_time_get
is passed through the Go runtime to call the corresponding OS clock_gettime
.
In any case, even if complete portability is desired for clock_res_get
, I propose setting it to a lowest common denominator, say 55 ms, instead of an arbitrary value.
from wazero.
Related Issues (20)
- Read directory bug ? HOT 1
- Wasm GC HOT 3
- Dynamically load WASM files HOT 1
- ` fd_fdstat_set_flags` truncates file HOT 1
- [WASI] `fd_fdstat_set_flags` with `fdflags::append` resets fd offset HOT 1
- `fd_filestat_set_size` wraps instead of error on large file size
- Feature Request: Rust tokio async interoperability through pollOneOff HOT 20
- Issue with reloading compiled module HOT 3
- flaky test: ExampleCoreFeaturesThreads HOT 2
- flaky test: internal/engine/wazevo.TestE2E on amd64 HOT 2
- flaky test: wasi_snapshot_preview1/wasi_stdlib_unix_test Test_NonblockingFile
- flaky test: TestFileCache_{compiler, wazevo} HOT 12
- Complex Types using WIT Supported HOT 2
- flaky test: TestPoll_Windows/poll_should_wait_for_the_given_duration
- Expose fsConfig.WithSysFSMount for custom writable FS support HOT 4
- How to concurrent call one instance's export function? HOT 2
- dirfs.OpenFile can return EEXIST even if that is not defined FS.OpenFile in the interface documentation HOT 4
- dirfs.OpenFile can return ENAMETOOLONG even if that is not defined FS.OpenFile in the interface documentation HOT 3
- flaky test: Test_pathOpen_Errors/trailing_slash_on_file on Windows HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wazero.