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

Fix crashing on Electron > 21 #921

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

minggangw
Copy link
Member

@minggangw minggangw commented Jun 6, 2023

Since Electron 21, the V8 sandboxed pointers was enabled, which disables creating a new BackingStore and taking over an external memory block. Instead, we must copy the data into a newly-allocated memory that is inside V8 memory cage.

See more details: https://www.electronjs.org/blog/v8-memory-cage

This patch fixed the crashing when running on Electron > 21.

Testing

  1. Electron v25.0.1 with Iron

    • Automated test: electron --expose-gc ./scripts/run_test.js
    • Manually tested: electron example/subscription-message-example.js & node example/publisher-message-example.js
  2. Nodejs v18.16.0 with Iron

    • Automated test: npm test

Fix #864

Since Electron 21, the V8 sandboxed pointers was enabled, which disables
creating a new BackingStore and take over an external memory block.
Instead, we must copy the data into a newly-allocated memory that is
inside V8 memory cage.

See more details: https://www.electronjs.org/blog/v8-memory-cage

This patch fixed the crashing when running on Electron > 21.

Fix RobotWebTools#864
@minggangw minggangw added the bug label Jun 6, 2023
@minggangw minggangw merged commit 048a120 into RobotWebTools:develop Jun 6, 2023
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undefined symbol error using Electron >= 12 when receiving/deserializing arrays
1 participant