Skip to content
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

LoadBrowserProcessSpecificV8Snapshot fuse yields a crashing package #8797

Open
t3chguy opened this issue Jan 22, 2025 · 5 comments
Open

LoadBrowserProcessSpecificV8Snapshot fuse yields a crashing package #8797

t3chguy opened this issue Jan 22, 2025 · 5 comments

Comments

@t3chguy
Copy link
Contributor

t3chguy commented Jan 22, 2025

[0122/170408.987:FATAL:v8_initializer.cc(687)] Error loading V8 startup snapshot file

Digging deeper, LoadBrowserProcessSpecificV8Snapshot wants a browser_v8_context_snapshot.bin but this does not exist in the build

Image

Copying v8_context_snapshot.bin to browser_v8_context_snapshot.bin seems to resolve the issue

@mmaietta
Copy link
Collaborator

Hi there!
Missing some key details here, can you please list the following?
electron-builder version, electron version, and whether you're using elecron/fuses directly or via electronFuses config property.

electron-builder just unpacks an electron release artifact, so my initial guess here is that the browser_v8_context_snapshot file isn't in the release artifact. electron-builder is not supposed to create it AFAIK as electron-builder is a packager, not a bundler.

@charliez0
Copy link

I meet this problem too, all latest version, changing fuses with @elecron/fuses

@mmaietta
Copy link
Collaborator

Pretty sure you're supposed to compile/build/provide your OWN browser snapshot in order to use that fuse as it's specific to your own installed (or forked) electron version.
https://www.electronjs.org/docs/latest/tutorial/fuses#loadbrowserprocessspecificv8snapshot

Copying v8_context_snapshot.bin to browser_v8_context_snapshot.bin seems to resolve the issue

Doing this does nothing different than having LoadBrowserProcessSpecificV8Snapshot: false as all you're doing under-the-hood is forcing electron to load two identical snapshots, versus its default of loading one snapshot for both main and browser.

Overall, this isn't a bug, it's an end-user misconfiguration. Happy to be proven otherwise, but I'm not finding any resources on how to compile a xxxx_snapshot.bin

@t3chguy
Copy link
Contributor Author

t3chguy commented Jan 23, 2025

Doing this does nothing different than having LoadBrowserProcessSpecificV8Snapshot: false as all you're doing under-the-hood is forcing electron to load two identical snapshots, versus its default of loading one snapshot for both main and browser.

The fuses page says separate snapshots can also improve security

Using separate snapshots for renderer processes and the main process can improve security

Which could be construed as a form of scope isolation but agreed the docs are lacking

@t3chguy
Copy link
Contributor Author

t3chguy commented Jan 23, 2025

I think ultimately this issue is about https://www.electron.build/tutorials/adding-electron-fuses.html#loadbrowserprocessspecificv8snapshot not being clear, it looks like something you can just enable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants