Skip to content

Copy data into V8 memory cage instead#5

Open
gniezen wants to merge 1 commit intoronomon:masterfrom
gniezen:patch-1
Open

Copy data into V8 memory cage instead#5
gniezen wants to merge 1 commit intoronomon:masterfrom
gniezen:patch-1

Conversation

@gniezen
Copy link
Copy Markdown

@gniezen gniezen commented Feb 7, 2023

Since Electron v21 there is a V8 memory cage/sandbox that has been enabled, which prevents native modules from pointing to external memory.

The fix is to copy externally-created buffers into th V8 memory cage before passing them to JavaScript:
https://www.electronjs.org/blog/v8-memory-cage#i-want-to-refactor-a-node-native-module-to-support-electron-21-how-do-i-do-that

Without this fix the Electron render process crashes when getAlignedBuffer() is called. I've tested that this fix works on Windows 11 and MacOS Ventura.

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

Successfully merging this pull request may close these issues.

1 participant