Closed abrown closed 1 year ago
Great find Andrew!
After some discussion today, it became clear that at least the assert
issue is of our own doing: at some point we "undefined" NDEBUG
which changes how assert
works in C generally. https://github.com/bytecodealliance/sightglass/pull/244 fixes this.
As reported in #238, the
shootout-ackermann
benchmark output did not match what was expected. While debugging this, several things became apparent:0
as flags toopen
was the problem.wasi-libc
definesO_RDONLY
as0x04000000
, e.g., so it may be that passing0
is problematic for some reason. OnceO_RDONLY
is used, the benchmark works as expected.assert()
is not aborting the program as one might expect. There are a couple of definitions inwasi-libc
(e.g., bottom-half and top-half) that seem to do the right thing but I did not observe an abort when I passed in bad paths toopen()
.Both of these issues seem wasi-libc related and might warrant some investigation there. This benchmark currently is building itself with wasi-sdk v19.0; by reverting this commit, here are the steps to replicate this issue:
In any case, using
O_RDONLY
seems to fix the issue so we can close238 and continue the discussion in the wasi-libc repository.