-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
macOS 11.2: Fatal error Check failed: allocator->SetPermissions
#37061
Comments
Some additional information:
See microsoft/vscode#113410 (comment) for more details. |
@andreialecu : did you find a workaround ? Thanks ! |
Unfortunately no. I had to revert to nodejs 14, using Rosetta. Hopefully only temporarily.
|
yes i did the same but sad to have to use back Rosetta... Thanks. |
Same crash happens on latest MacOS 11.2 RC2 (20D62). Update: |
Thanks for filing this and investigating the cause, @andreialecu . I am running into this when trying to run the Netlify CLI. |
I also have this problem on apple silicon node v 15.7.0. System info
Error:
|
Big Sur 11.2 RC3 doesn't change anything. Still get the same error... |
@aduh95 apologies for tagging you on this, but given your mac arm64 commits, perhaps you would know who to forward this to since it is a very serious problem. 11.2 will be out any day now and this will hit a lot of people. |
I just reported this directly to Apple. Will see what happens... |
I also reported it to Apple several days ago but that's usually a black hole. I'm inclined to believe that |
Unfortunately I don't have M1 macs at my disposal anymore. If the problem is the V8 version, could you try compile
|
Thanks for the tip @aduh95, I built it but it doesn't seem to be enough:
|
@andreialecu What does |
Seems to be exactly the same. I'm not sure if I tested this properly, or if Chromium 86 had a different issue, but I mentioned here what I did: microsoft/vscode#113410 (comment) |
The |
To others in this thread:
|
Just Apple Silicon. No problem on Intel. Happens in some projects. |
@aduh95 Some additional info. Removing the node/deps/v8/src/wasm/wasm-code-manager.cc Lines 1630 to 1631 in 770d9e2
Resolves the problem, as expected. I'm able to run Why it fails though, is a mistery. I went through a bit of a rabbit hole reading source to see where it leads to and found this part: node/deps/v8/src/base/platform/platform-posix.cc Lines 417 to 421 in b9dfda9
I assume I found this https://bugs.exim.org/show_bug.cgi?id=2618 mentioning |
Possibly related: Probably related: v8/v8@4e077ff That's the most recent commit that references JIT and aarm64, and was included in V8 8.8. Would changing this instruction: node/deps/v8/src/wasm/wasm-code-manager.cc Lines 1630 to 1631 in 770d9e2
to CHECK(allocator->SetPermissions(reinterpret_cast<void*>(region.begin()),
region.size(), PageAllocator::kNoAccessWillJitLater)); solve the issue? |
@aduh95 nope:
|
So I just tried some random WASM packages from npm using their example scripts and they seem to run properly on So WASM does work to some extent, until that I can reproduce it 100% using This may also indicate that Chrome and recent |
Check failed: allocator->SetPermissions
Check failed: allocator->SetPermissions
Here's an easy way to get the patch applied: Ensure you have # install nvm if you don't have it:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash I made a gist of the patch for easy download: cd ~
curl https://gist.githubusercontent.com/andreialecu/54b17d7872d047a61e85dcf0261a6105/raw/da5b55457533397e178a021ccfbf9cb827da9d8b/node-arm64.diff > node-patch.diff
nvm install 15.8 (if you already have node installed via nvm, you may need to uninstall it first - Now, wait for a bit for Once it starts compiling, open a second terminal and run the following. You should have plenty of time before it starts compiling the relevant files. cd ~/.nvm/.cache/src/node-v15.8.0/files
patch -p1 < ~/node-patch.diff After it's done you can use |
I built node from source using homebrew |
@Carlosted I haven't used homebrew for a few months (I switched to MacPorts), but you should add |
I can confirm that using the command |
Not for me.😂 |
This comment has been minimized.
This comment has been minimized.
@adietrichs : That's an unrelated issue. Please file a bug at crbug.com/v8/new and include as much detail as you can (ideally: repro instructions). |
Original commit message: [mac][wasm] Work around MacOS 11.2 code page decommit failures MacOS 11.2 refuses to set "no access" permissions on memory that we previously used for JIT-compiled code. It is still unclear whether this is WAI on the part of the kernel. In the meantime, as a workaround, we use madvise(..., MADV_FREE_REUSABLE) instead of mprotect(..., NONE) when discarding code pages. This is inspired by what Chromium's gin platform does. Fixed: v8:11389 Change-Id: I866586932573b4253002436ae5eee4e0411c45fc Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2679688 Commit-Queue: Jakob Kummerow <[email protected]> Commit-Queue: Michael Lippautz <[email protected]> Auto-Submit: Jakob Kummerow <[email protected]> Reviewed-by: Michael Lippautz <[email protected]> Cr-Commit-Position: refs/heads/master@{#72559} Refs: v8/v8@0c8b6e4 Fixes: #37061 PR-URL: #37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
The fix should land in Node.js v15.9.0 (expected release date: today). Please stop commenting the issue is still happening with Node.js v15.8.0, we know, the fix is coming. In the mean time, please wait for v15.9.0 to be released, or build from source, or use the x86_64 version with Rosetta. |
Just upgraded to v15.9.0 and it resolved the Safari localhost connection issue |
Homebrew Pull Request: Homebrew/homebrew-core#71400 |
I've uninstalled node --HEAD via brew and installed it again (node@15), and I can confirm that it is working as expected. Thanks, everyone! |
Original commit message: [mac][wasm] Work around MacOS 11.2 code page decommit failures MacOS 11.2 refuses to set "no access" permissions on memory that we previously used for JIT-compiled code. It is still unclear whether this is WAI on the part of the kernel. In the meantime, as a workaround, we use madvise(..., MADV_FREE_REUSABLE) instead of mprotect(..., NONE) when discarding code pages. This is inspired by what Chromium's gin platform does. Fixed: v8:11389 Change-Id: I866586932573b4253002436ae5eee4e0411c45fc Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2679688 Commit-Queue: Jakob Kummerow <[email protected]> Commit-Queue: Michael Lippautz <[email protected]> Auto-Submit: Jakob Kummerow <[email protected]> Reviewed-by: Michael Lippautz <[email protected]> Cr-Commit-Position: refs/heads/master@{#72559} Refs: v8/v8@0c8b6e4 Fixes: nodejs#37061 PR-URL: nodejs#37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
Original commit message: [mac][wasm] Work around MacOS 11.2 code page decommit failures MacOS 11.2 refuses to set "no access" permissions on memory that we previously used for JIT-compiled code. It is still unclear whether this is WAI on the part of the kernel. In the meantime, as a workaround, we use madvise(..., MADV_FREE_REUSABLE) instead of mprotect(..., NONE) when discarding code pages. This is inspired by what Chromium's gin platform does. Fixed: v8:11389 Change-Id: I866586932573b4253002436ae5eee4e0411c45fc Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2679688 Commit-Queue: Jakob Kummerow <[email protected]> Commit-Queue: Michael Lippautz <[email protected]> Auto-Submit: Jakob Kummerow <[email protected]> Reviewed-by: Michael Lippautz <[email protected]> Cr-Commit-Position: refs/heads/master@{#72559} Refs: v8/v8@0c8b6e4 Fixes: nodejs#37061 PR-URL: nodejs#37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
Original commit message: [mac][wasm] Work around MacOS 11.2 code page decommit failures MacOS 11.2 refuses to set "no access" permissions on memory that we previously used for JIT-compiled code. It is still unclear whether this is WAI on the part of the kernel. In the meantime, as a workaround, we use madvise(..., MADV_FREE_REUSABLE) instead of mprotect(..., NONE) when discarding code pages. This is inspired by what Chromium's gin platform does. Fixed: v8:11389 Change-Id: I866586932573b4253002436ae5eee4e0411c45fc Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2679688 Commit-Queue: Jakob Kummerow <[email protected]> Commit-Queue: Michael Lippautz <[email protected]> Auto-Submit: Jakob Kummerow <[email protected]> Reviewed-by: Michael Lippautz <[email protected]> Cr-Commit-Position: refs/heads/master@{#72559} Refs: v8/v8@0c8b6e4 Fixes: #37061 PR-URL: #37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
Original commit message: [mac][wasm] Work around MacOS 11.2 code page decommit failures MacOS 11.2 refuses to set "no access" permissions on memory that we previously used for JIT-compiled code. It is still unclear whether this is WAI on the part of the kernel. In the meantime, as a workaround, we use madvise(..., MADV_FREE_REUSABLE) instead of mprotect(..., NONE) when discarding code pages. This is inspired by what Chromium's gin platform does. Fixed: v8:11389 Change-Id: I866586932573b4253002436ae5eee4e0411c45fc Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2679688 Commit-Queue: Jakob Kummerow <[email protected]> Commit-Queue: Michael Lippautz <[email protected]> Auto-Submit: Jakob Kummerow <[email protected]> Reviewed-by: Michael Lippautz <[email protected]> Cr-Commit-Position: refs/heads/master@{#72559} Refs: v8/v8@0c8b6e4 Fixes: nodejs#37061 PR-URL: nodejs#37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
Original commit message: [mac][wasm] Work around MacOS 11.2 code page decommit failures MacOS 11.2 refuses to set "no access" permissions on memory that we previously used for JIT-compiled code. It is still unclear whether this is WAI on the part of the kernel. In the meantime, as a workaround, we use madvise(..., MADV_FREE_REUSABLE) instead of mprotect(..., NONE) when discarding code pages. This is inspired by what Chromium's gin platform does. Fixed: v8:11389 Change-Id: I866586932573b4253002436ae5eee4e0411c45fc Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2679688 Commit-Queue: Jakob Kummerow <[email protected]> Commit-Queue: Michael Lippautz <[email protected]> Auto-Submit: Jakob Kummerow <[email protected]> Reviewed-by: Michael Lippautz <[email protected]> Cr-Commit-Position: refs/heads/master@{#72559} Refs: v8/v8@0c8b6e4 Fixes: nodejs#37061 PR-URL: nodejs#37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
Original commit message: [mac][wasm] Work around MacOS 11.2 code page decommit failures MacOS 11.2 refuses to set "no access" permissions on memory that we previously used for JIT-compiled code. It is still unclear whether this is WAI on the part of the kernel. In the meantime, as a workaround, we use madvise(..., MADV_FREE_REUSABLE) instead of mprotect(..., NONE) when discarding code pages. This is inspired by what Chromium's gin platform does. Fixed: v8:11389 Change-Id: I866586932573b4253002436ae5eee4e0411c45fc Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2679688 Commit-Queue: Jakob Kummerow <[email protected]> Commit-Queue: Michael Lippautz <[email protected]> Auto-Submit: Jakob Kummerow <[email protected]> Reviewed-by: Michael Lippautz <[email protected]> Cr-Commit-Position: refs/heads/master@{#72559} Backport-PR-URL: #38051 Co-authored-by: BoHong Li <[email protected]> Refs: v8/v8@0c8b6e4 Fixes: #37061 PR-URL: #37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
I was also facing the similar issue with nodejs 15.3.0 on mac M1 chip
I tried installing node 17.2.0 and it is working fine. Successful logs:
|
@matinzd or @targos if you don't mind, could you help to provide the gist.githubusercontent.com/targos/8ca8f7a0c76847f29f5658a93c30af1c/raw/adf420ca34e1e0a74c5a70ece059c3d0d2c5c043/crash.js, currently it is 404, attached to #37276? Wanted to learn about this :). Thanks! |
What steps will reproduce the bug?
Use latest macOS Beta 11.2 (released 24 Jan 2021) and node 15.6.0
How often does it reproduce? Is there a required condition?
All the time.
What is the expected behavior?
No crash.
What do you see instead?
Additional information
This started happening after the macOS beta update I think. I was on beta before, but everything was working fine until after the update.
I'm on an ARM64 M1 chip (mac mini 16gb ram)
node/deps/v8/src/wasm/wasm-code-manager.cc
Lines 1630 to 1631 in 770d9e2
The text was updated successfully, but these errors were encountered: