Skip to content

Conversation

@matinzd
Copy link
Contributor

@matinzdmatinzd commented Feb 8, 2021

Original commit from v8 repo:

[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} 

Fixes#37061
Ref: https://bugs.chromium.org/p/v8/issues/detail?id=11389#c18

For test:

./node crash.js{"exports":[],"reexports":[]}

[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} Related issue nodejs#37061
@nodejs-github-botnodejs-github-bot added the v8 engine Issues and PRs related to the V8 dependency. label Feb 8, 2021
@nodejs-github-bot

This comment has been minimized.

@aduh95
Copy link
Contributor

Thanks for sending this. Pinging @nodejs/v8 for reviews.

@nodejs-github-bot
Copy link
Collaborator

@AshCripps
Copy link
Member

Take this with a pinch of salt as the job isnt fully ready yet but running this PR on our DTKs - https://ci.nodejs.org/job/node-test-commit-osx-arm/nodes=osx11/32/console

@AshCripps
Copy link
Member

Take this with a pinch of salt as the job isnt fully ready yet but running this PR on our DTKs - https://ci.nodejs.org/job/node-test-commit-osx-arm/nodes=osx11/32/console

The failure is tracked here - #36656

@matinzd
Copy link
ContributorAuthor

matinzd commented Feb 8, 2021

Take this with a pinch of salt as the job isnt fully ready yet but running this PR on our DTKs - https://ci.nodejs.org/job/node-test-commit-osx-arm/nodes=osx11/32/console

The failure is tracked here - #36656

The referenced issue still exists.

✗ ./node --prof [1] 55990 segmentation fault ./node --prof 

@matinzdmatinzd changed the title deps: V8: Workaround for MacOS 11.2 code page decommit failuresdeps: V8: workaround for MacOS 11.2 code page decommit failures, fixes prof segmentation faultFeb 8, 2021
@matinzdmatinzd changed the title deps: V8: workaround for MacOS 11.2 code page decommit failures, fixes prof segmentation faultdeps: V8: workaround for darwin arm64 code page decommit failures, fixes prof segmentation faultFeb 8, 2021
@AshCripps
Copy link
Member

@matinzd can you remove 24d561a that hasn't landed in V8 yet so blocks this PR from landing. Also can you refer to the Maintaining V8 guide and bump the v8_embedder_string in common.gypi please.

@matinzdmatinzd changed the title deps: V8: workaround for darwin arm64 code page decommit failures, fixes prof segmentation faultdeps: V8: workaround for darwin arm64 code page decommit failuresFeb 9, 2021
@matinzd
Copy link
ContributorAuthor

@matinzd can you remove 24d561a that hasn't landed in V8 yet so blocks this PR from landing. Also can you refer to the Maintaining V8 guide and bump the v8_embedder_string in common.gypi please.

Done

@targos
Copy link
Member

Thanks for the PR! I'll land it as soon as someone else approves it.

targos pushed a commit that referenced this pull request Feb 11, 2021
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@0c8b6e4Fixes: #37061 PR-URL: #37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
@targos
Copy link
Member

Landed in 6ea9af9

@targostargos closed this Feb 11, 2021
targos pushed a commit to targos/node that referenced this pull request Feb 11, 2021
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@0c8b6e4Fixes: nodejs#37061 PR-URL: nodejs#37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
targos pushed a commit to targos/node that referenced this pull request Feb 11, 2021
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@0c8b6e4Fixes: nodejs#37061 PR-URL: nodejs#37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
targos pushed a commit to targos/node that referenced this pull request Feb 12, 2021
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@0c8b6e4Fixes: nodejs#37061 PR-URL: nodejs#37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
targos pushed a commit to targos/node that referenced this pull request Feb 12, 2021
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@0c8b6e4Fixes: nodejs#37061 PR-URL: nodejs#37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
@matinzdmatinzd deleted the patch-1 branch February 12, 2021 22:08
danielleadams pushed a commit that referenced this pull request Feb 16, 2021
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@0c8b6e4Fixes: #37061 PR-URL: #37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
This was referenced Feb 16, 2021
targos pushed a commit to targos/node that referenced this pull request Feb 23, 2021
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@0c8b6e4Fixes: nodejs#37061 PR-URL: nodejs#37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
targos pushed a commit to targos/node that referenced this pull request Feb 24, 2021
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@0c8b6e4Fixes: nodejs#37061 PR-URL: nodejs#37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
targos pushed a commit that referenced this pull request Feb 24, 2021
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@0c8b6e4Fixes: #37061 PR-URL: #37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
a60814billy pushed a commit to a60814billy/node that referenced this pull request Apr 2, 2021
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@0c8b6e4Fixes: nodejs#37061 PR-URL: nodejs#37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
a60814billy pushed a commit to a60814billy/node that referenced this pull request Apr 2, 2021
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@0c8b6e4Fixes: nodejs#37061 PR-URL: nodejs#37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
targos pushed a commit that referenced this pull request Apr 11, 2021
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@0c8b6e4Fixes: #37061 PR-URL: #37276 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ash Cripps <[email protected]>
@danielleadamsdanielleadams mentioned this pull request May 3, 2021
@targostargos removed their assignment Oct 31, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v8 engineIssues and PRs related to the V8 dependency.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS 11.2: Fatal error Check failed: allocator->SetPermissions

5 participants

@matinzd@nodejs-github-bot@aduh95@AshCripps@targos