-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Electron: Fatal error in V8: v8_ArrayBuffer_NewBackingStore #514
Comments
https://www.electronjs.org/blog/v8-memory-cage Electron 21 and later will have the V8 Memory Cage enabled, with implications for some native modules. To track ongoing discussion about native module usage in Electron 21+, see electron/electron#35801. |
I think it would be fairly trivial change to "solve" this problem, at a performance cost though: Remove this if-block: https://github.com/zeromq/zeromq.js/blob/master/src/incoming_msg.cc#L29 where an external buffer is used for performance optimisation reasons. Change were this avoid-buffer-copy performance was done initially: rolftimmermans/zeromq-ng@01773f2#diff-72251d28770bda8994e43d8152076673c8dc28e1d363f787d33c1dc0216ec98b Should be still thought of if we can make this change optional somehow, for Election versions > 21 ? |
@Bartel-C8 Let's try this. Interested in making a pull request? |
Yes sure. But I would like to have a working (test/benchmark) build to validate my changes/performance. As it is now, it seems the test build (on master) is failing? The same on my macOS setup... I can run
So running mocha fails somehow... |
Yeah, the test suit fails. Related to #466. I could not find the issue in the code. |
Thanks for the build fixes! Can run a benchmark now properly! Did a clean benchmark:
And one where I commented out the if-block like suggested above,
Results of small msgsize (<128) should be the same in both cases, as already the I think I found a way (electron/electron#29893 (comment)) to have an Electron (version) compile switch which detects the environment, being plain Node.JS or Electron (from v21 on ...). |
Does this code when |
Must be. It is in the incoming_msg code, which is generic for all protocols. This has a limitation as well:
But I don't think (many) implementations are affected by this? |
For Electron v21+, now, with beta 14, I need a manual step to rebuild native modules: Running
Somehow my Although I see
It still gives the crash. First running Will try to upstep electron-builder though... (Now using: "electron-builder": "^23.0.3") |
Ok, upstepping
This triggers a complete rebuild (from source) for zeromq. |
The bug
As soon as data is received the app crashes with the following error:
Reproducing
Added following code in main.js
Expected behavior
Data should be received and logged in to console
Tested on
The text was updated successfully, but these errors were encountered: