Skip to content

fix: avoid startup crash when V8 sandbox is disabled#49210

Merged
jkleinsc merged 2 commits into
electron:mainfrom
david-metrica:fix/v8-sandbox-disabled-build
Jan 23, 2026
Merged

fix: avoid startup crash when V8 sandbox is disabled#49210
jkleinsc merged 2 commits into
electron:mainfrom
david-metrica:fix/v8-sandbox-disabled-build

Conversation

@david-metrica
Copy link
Copy Markdown
Contributor

@david-metrica david-metrica commented Dec 14, 2025

Description of Change

Fixes #49199

This fixes startup crash in custom builds where V8 sandbox is disabled.

32-bit builds do not enable the V8 sandbox, so checking ARCH_CPU_32_BIT alongside !V8_ENABLE_SANDBOX is redundant.

For more information refer to:
#49199 (Issue where this was solved)
#48699 (Same problem but the issue was unresolved)

Checklist

Release Notes

notes: Fixed startup crash when V8 sandbox is disabled.

@david-metrica david-metrica requested a review from a team as a code owner December 14, 2025 09:11
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Dec 14, 2025
@nikwen nikwen added target/40-x-y PR should also be added to the "40-x-y" branch. semver/minor backwards-compatible functionality labels Dec 14, 2025
@nikwen nikwen added semver/patch backwards-compatible bug fixes and removed semver/minor backwards-compatible functionality api-review/requested 🗳 labels Dec 14, 2025
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Dec 15, 2025
@deepak1556
Copy link
Copy Markdown
Member

deepak1556 commented Dec 15, 2025

Please follow the steps here to edit and re-export the existing patch https://github.com/electron/electron/blob/main/docs/development/patches.md#editing-an-existing-patch

@david-metrica
Copy link
Copy Markdown
Contributor Author

Please follow the steps here to edit and re-export the existing patch https://github.com/electron/electron/blob/main/docs/development/patches.md#editing-an-existing-patch

Hello @deepak1556 ,

Sorry if this is a basic question, but I’m not entirely sure how this process works.

The instructions say:

Editing an existing patch
$ cd src/v8
$ vim some/code/file.cc

I assume this means I need to run gclient sync and then modify the same files that the existing patch touches. However, I’m unsure on how the tooling knows which specific patch I’m editing.

The instructions also mention:
“Find the commit SHA of the patch you want to edit.”

Which commit SHA is this referring to?

  • The commit I originally created?
  • The latest revision of the patch?
  • Or the original commit where the patch was first introduced?

I apologise if this is obvious, I’m a bit lost on the workflow here.

Also, I’m currently in transit (flying from Asia to Europe), so I won’t be able to update this pull request until Friday.

Thanks in advance for your help.

@nikwen
Copy link
Copy Markdown
Member

nikwen commented Dec 17, 2025

Using build-tools:

  1. cd src/electron
  2. git checkout fix/v8-sandbox-disabled-build
  3. e sync
  4. e patches chromium
  5. git commit -m "chore: update patch"

@david-metrica
Copy link
Copy Markdown
Contributor Author

Everything should be fine now. Please let me know if I missed something.

@ckerr
Copy link
Copy Markdown
Member

ckerr commented Jan 5, 2026

32-bit builds do not enable the V8 sandbox, so checking ARCH_CPU_32_BIT alongside !V8_ENABLE_SANDBOX is redundant.

This is probably obvious, but just to make it explicit for anyone reading this: the V8 Sandbox requires a 64-bit system so it should be safe to replace ARCH_CPU_32_BIT with V8_ENABLE_SANDBOX as this PR does

Copy link
Copy Markdown
Member

@ckerr ckerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Copy Markdown
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!

@dsanders11
Copy link
Copy Markdown
Member

@david-metrica, could you update this PR to have signed commits? This repo enforces commit signatures, so the lack of them in this PR blocks merging here.

@david-metrica david-metrica force-pushed the fix/v8-sandbox-disabled-build branch from 5cad60a to b5c7ee2 Compare January 7, 2026 19:15
@david-metrica
Copy link
Copy Markdown
Contributor Author

@dsanders11 Sorry! I didn't notice that! It should be fine now. Let me know if I am missing anything else.

@codebytere
Copy link
Copy Markdown
Member

@david-metrica could you rebase this? then we can get it merged :)

@david-metrica david-metrica force-pushed the fix/v8-sandbox-disabled-build branch from 9d04895 to daa5f8a Compare January 13, 2026 14:21
@david-metrica
Copy link
Copy Markdown
Contributor Author

@codebytere Please check. It should be fine now.

@github-actions github-actions Bot added the target/41-x-y PR should also be added to the "41-x-y" branch. label Jan 19, 2026
@jkleinsc
Copy link
Copy Markdown
Member

@david-metrica can you rebase one more time? There was an issue on main that has now been resolved.

@david-metrica david-metrica force-pushed the fix/v8-sandbox-disabled-build branch from daa5f8a to a40bea2 Compare January 21, 2026 20:08
@david-metrica
Copy link
Copy Markdown
Contributor Author

@david-metrica can you rebase one more time? There was an issue on main that has now been resolved.

@jkleinsc @codebytere Done!

@jkleinsc jkleinsc merged commit 8a11d5a into electron:main Jan 23, 2026
103 of 104 checks passed
@release-clerk
Copy link
Copy Markdown

release-clerk Bot commented Jan 23, 2026

Release Notes Persisted

Fixed startup crash when V8 sandbox is disabled.

@trop
Copy link
Copy Markdown
Contributor

trop Bot commented Jan 23, 2026

I have automatically backported this PR to "41-x-y", please check out #49504

@trop
Copy link
Copy Markdown
Contributor

trop Bot commented Jan 23, 2026

I have automatically backported this PR to "40-x-y", please check out #49505

@trop trop Bot added in-flight/40-x-y merged/41-x-y PR was merged to the "41-x-y" branch. and removed target/41-x-y PR should also be added to the "41-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. in-flight/41-x-y labels Jan 23, 2026
@trop trop Bot removed the in-flight/40-x-y label Feb 19, 2026
@ckerr
Copy link
Copy Markdown
Member

ckerr commented Feb 19, 2026

/trop run backport-to 40-x-y

@trop
Copy link
Copy Markdown
Contributor

trop Bot commented Feb 19, 2026

The backport process for this PR has been manually initiated - sending your PR to 40-x-y!

@trop
Copy link
Copy Markdown
Contributor

trop Bot commented Feb 19, 2026

I have automatically backported this PR to "40-x-y", please check out #49884

@trop trop Bot added in-flight/40-x-y merged/40-x-y PR was merged to the "40-x-y" branch. and removed in-flight/40-x-y labels Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash on startup with Electron 40.x built with v8_enable_sandbox=false (Illegal Access in IndirectBaseHandle::IsEmpty)

8 participants