-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Failed to load .wasm on macOS running on Apple silicon #23243
Labels
Comments
Another suggestion is to set Also need to try to update v8 :) nodejs/node-v8#226 (comment) |
dio
added a commit
to dio/envoy
that referenced
this issue
Sep 27, 2022
This applies https://chromium-review.googlesource.com/c/v8/v8/+/3700352 as a fix for MemoryAllocator::PartialFreeMemory() which shouldn't try to change permissions of RWX pages. This mainly affects macOS > 11.2 due to mprotect behavior changes (envoyproxy#23243) on Apple silicon. Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
This was referenced Sep 27, 2022
cc @PiotrSikora |
wbpcode
added
investigate
Potential bug that needs verification
area/wasm
and removed
triage
Issue requires triage
labels
Sep 28, 2022
wbpcode
pushed a commit
that referenced
this issue
Sep 29, 2022
* macOS: Allow to load .wasm on Apple silicon This applies https://chromium-review.googlesource.com/c/v8/v8/+/3700352 as a fix for MemoryAllocator::PartialFreeMemory() which shouldn't try to change permissions of RWX pages. This mainly affects macOS > 11.2 due to mprotect behavior changes (#23243) on Apple silicon.
dio
added a commit
to dio/envoy
that referenced
this issue
Sep 29, 2022
…xy#23257) * macOS: Allow to load .wasm on Apple silicon This applies https://chromium-review.googlesource.com/c/v8/v8/+/3700352 as a fix for MemoryAllocator::PartialFreeMemory() which shouldn't try to change permissions of RWX pages. This mainly affects macOS > 11.2 due to mprotect behavior changes (envoyproxy#23243) on Apple silicon.
dio
added a commit
to dio/envoy
that referenced
this issue
Sep 29, 2022
This applies https://chromium-review.googlesource.com/c/v8/v8/+/3700352 as a fix for MemoryAllocator::PartialFreeMemory() which shouldn't try to change permissions of RWX pages. This mainly affects macOS > 11.2 due to mprotect behavior changes (envoyproxy#23243) on Apple silicon. This is cherry-picked from: envoyproxy@63f27a6 Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
wbpcode
pushed a commit
that referenced
this issue
Sep 30, 2022
backport: macOS: Enable wasm and allow to load .wasm on Apple silicon This applies https://chromium-review.googlesource.com/c/v8/v8/+/3700352 as a fix for MemoryAllocator::PartialFreeMemory() which shouldn't try to change permissions of RWX pages. This mainly affects macOS > 11.2 due to mprotect behavior changes (#23243) on Apple silicon. This is cherry-picked from: 63f27a6 Signed-off-by: Dhi Aurrahman <dio@rockybars.com> Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
oschaaf
pushed a commit
to maistra/envoy
that referenced
this issue
Oct 26, 2022
* macOS: Allow to load .wasm on Apple silicon This applies https://chromium-review.googlesource.com/c/v8/v8/+/3700352 as a fix for MemoryAllocator::PartialFreeMemory() which shouldn't try to change permissions of RWX pages. This mainly affects macOS > 11.2 due to mprotect behavior changes (envoyproxy/envoy#23243) on Apple silicon.
phlax
pushed a commit
to phlax/envoy
that referenced
this issue
Nov 23, 2022
backport: macOS: Enable wasm and allow to load .wasm on Apple silicon This applies https://chromium-review.googlesource.com/c/v8/v8/+/3700352 as a fix for MemoryAllocator::PartialFreeMemory() which shouldn't try to change permissions of RWX pages. This mainly affects macOS > 11.2 due to mprotect behavior changes (envoyproxy#23243) on Apple silicon. This is cherry-picked from: envoyproxy@63f27a6 Signed-off-by: Dhi Aurrahman <dio@rockybars.com> Signed-off-by: Dhi Aurrahman <dio@rockybars.com> Signed-off-by: Ryan Northey <ryan@synca.io>
phlax
pushed a commit
to phlax/envoy
that referenced
this issue
Nov 24, 2022
backport: macOS: Enable wasm and allow to load .wasm on Apple silicon This applies https://chromium-review.googlesource.com/c/v8/v8/+/3700352 as a fix for MemoryAllocator::PartialFreeMemory() which shouldn't try to change permissions of RWX pages. This mainly affects macOS > 11.2 due to mprotect behavior changes (envoyproxy#23243) on Apple silicon. This is cherry-picked from: envoyproxy@63f27a6 Signed-off-by: Dhi Aurrahman <dio@rockybars.com> Signed-off-by: Dhi Aurrahman <dio@rockybars.com> Signed-off-by: Ryan Northey <ryan@synca.io>
phlax
pushed a commit
that referenced
this issue
Nov 26, 2022
backport: macOS: Enable wasm and allow to load .wasm on Apple silicon This applies https://chromium-review.googlesource.com/c/v8/v8/+/3700352 as a fix for MemoryAllocator::PartialFreeMemory() which shouldn't try to change permissions of RWX pages. This mainly affects macOS > 11.2 due to mprotect behavior changes (#23243) on Apple silicon. This is cherry-picked from: 63f27a6 Signed-off-by: Dhi Aurrahman <dio@rockybars.com> Signed-off-by: Dhi Aurrahman <dio@rockybars.com> Signed-off-by: Ryan Northey <ryan@synca.io>
phlax
added a commit
that referenced
this issue
Nov 30, 2022
…24089) * deps: bump `com_github_wasmtime` -> 1.0.0 (#23232) Signed-off-by: river phillips <riverphillips1@gmail.com> Signed-off-by: Ryan Northey <ryan@synca.io> * wasm: update WAVM to nightly/2022-05-14. (#22491) Signed-off-by: Piotr Sikora <piotrsikora@google.com> Signed-off-by: Ryan Northey <ryan@synca.io> * wasm: update Proxy-Wasm C++ Host to latest. (#22575) Signed-off-by: Piotr Sikora <piotrsikora@google.com> Signed-off-by: Ryan Northey <ryan@synca.io> * deps: Bump `com_github_wasmtime` -> 1.0.2 (#24086) Fix: - CVE-2022-39392 - CVE-2022-39393 - CVE-2022-39394 Signed-off-by: Ryan Northey <ryan@synca.io> * bazel: update rules_rust This gets us on rust 1.60 Signed-off-by: Keith Smiley <keithbsmiley@gmail.com> Signed-off-by: Ryan Northey <ryan@synca.io> * deps: Bump `rules_rust` -> 0.8.1 (#22253) Fix #22073 Signed-off-by: Ryan Northey <ryan@synca.io> * wasm: fix V8 build on older versions of Linux. (#22228) wasm: fix build on older versions of Linux. Signed-off-by: Piotr Sikora <piotrsikora@google.com> Signed-off-by: Ryan Northey <ryan@synca.io> * backport: macOS: Allow to load .wasm on Apple silicon (#23299) backport: macOS: Enable wasm and allow to load .wasm on Apple silicon This applies https://chromium-review.googlesource.com/c/v8/v8/+/3700352 as a fix for MemoryAllocator::PartialFreeMemory() which shouldn't try to change permissions of RWX pages. This mainly affects macOS > 11.2 due to mprotect behavior changes (#23243) on Apple silicon. This is cherry-picked from: 63f27a6 Signed-off-by: Dhi Aurrahman <dio@rockybars.com> Signed-off-by: Dhi Aurrahman <dio@rockybars.com> Signed-off-by: Ryan Northey <ryan@synca.io> * deps: Bump `v8` to 10.7.193.13 and `proxy_wasm_cpp_host` to b0a0594 (#23434) Signed-off-by: Dhi Aurrahman <dio@rockybars.com> * ci: Disable wasm coverage tests (#24169) and adjust-coverage-total Signed-off-by: Ryan Northey <ryan@synca.io> Signed-off-by: phlax <phlax@users.noreply.github.com> * deps: Bump `com_github_wasmtime` -> 2.0.2 (+related) (#24150) deps: Bump `com_github_wasmtime` -> 2.0.2 - `proxy_wasm_cpp_host` - `proxy_wasm_rust_sdk` Signed-off-by: Ryan Northey <ryan@synca.io> Signed-off-by: river phillips <riverphillips1@gmail.com> Signed-off-by: Ryan Northey <ryan@synca.io> Signed-off-by: Piotr Sikora <piotrsikora@google.com> Signed-off-by: Dhi Aurrahman <dio@rockybars.com> Signed-off-by: phlax <phlax@users.noreply.github.com> Co-authored-by: River <6375745+RiverPhillips@users.noreply.github.com> Co-authored-by: Piotr Sikora <piotrsikora@google.com> Co-authored-by: Keith Smiley <keithbsmiley@gmail.com> Co-authored-by: Dhi Aurrahman <dio@rockybars.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background:
Currently, since the following PR is merged,
macOS binaries v1.23.x (e.g. fetched via Homebrew), and main by default doesn't support Wasm.
Relevant:
Since @keith's CL on v8 upstream is merged. Also, that CL is actually included in the current (also release/1.23) linked v8: 10.4.132.18:
envoy/bazel/repository_locations.bzl
Line 1053 in 6389f16
Therefore, now we can successfully build
envoy
on macOS on Apple silicon (tested on M1) 🎉. However, when we run it to load a.wasm
file (fromexamples/wasm-cc
), we caught on: https://chromium.googlesource.com/v8/v8.git/+/refs/tags/10.4.132.18/src/base/platform/platform-posix.cc#478, we expect ENOMEM (12) but got EACCES (13, Permission denied). (full log: https://gist.githubusercontent.com/dio/7ef745c09327aa6da0be3b32ef28016a/raw/d220e891afe52208d346ed0dae0d72220275fe73/v8-log.txt).That check was introduced by: https://chromium-review.googlesource.com/c/v8/v8/+/3610445. Seems like, when on macOS, it (
if (ret != 0) CHECK_EQ(ENOMEM, errno);
) should be executed after the "workaround" for macOS on Apple silicon is executed (to usemadvise
, caused by themprotect
"bug" on Apple silicon since macOS 11.2: https://bugs.chromium.org/p/v8/issues/detail?id=11389#c14. As additional info: this workaround was introduced by https://chromium-review.googlesource.com/c/v8/v8/+/2679688).The proposed additional entry to
bazel/v8.patch
:I tested to build and run the produced binary on macOS running on M1 (it successfully loads the
.wasm
file):If this patch does make sense, I'd like to raise PRs both for
release/1.23
andmain
branches, since both of them are linked to the same v8 version: 10.4.132.18.Thanks!
The text was updated successfully, but these errors were encountered: