bytecodealliance / sightglass

A benchmark suite and tool to compare different implementations of the same primitives.
Apache License 2.0
69 stars 33 forks source link

benchmark: failed to rebuild spidermonkey benchmark #231

Open abrown opened 1 year ago

abrown commented 1 year ago

The "rebuild benchmarks" CI workflow found an issue rebuilding the SpiderMonkey benchmark: https://github.com/bytecodealliance/sightglass/actions/runs/4453084060/jobs/7821309649#step:4:5101. This CI workflow only rebuilds a subset of the benchmarks each CI run (for time's sake) to check that they can be rebuilt deterministically, so the failure will only reappear occasionally. cc: @cfallin

cfallin commented 1 year ago

Hmm -- I took a look at this and was able to reproduce locally. I'm not sure where the mach bootstrap error is coming from though. The version of SpiderMonkey we have pinned is fairly outdated so it's possible that the toolchain it's trying to download no longer exists, and an update to latest SpiderMonkey would fix this. (I don't have the bandwidth to do this at the moment, but we can leave this open to track...)

william-stacken commented 1 year ago

I was able to get around this by editing the Spidermonkey Dockerfile to clone the fork https://github.com/fastly/spidermonkey-wasi-embedding instead of https://github.com/tschneidereit/spidermonkey-wasi-embedding. But for some reason the runtime.cpp gets stuck somewhere inside JS_Init() when I attempt to run the benchmark.

EDIT: I found out that the reason the benchmark got stuck was because for some reason __wasm_call_ctors never got invoked in the _start function. When I manually called it in the main function of runtime.cpp the benchmark ran successfully.

EDIT 2: Nevermid me, I had inserted a call to __wasm_call_ctors at a different place in the code, which I think causes wasi sdk version 14 to think that the different place was the entrypoint and not the main function. Using the fork I mentioned works for me at least.