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 21+ breaks sodium_malloc
#185
Comments
Electron 20.x.y has reached end-of-support ... ☑️ Last working version |
@mafintosh / @emilbayes I manage the scuttlebutt maintenance fund and would love to contribute funds to this issue being resolved. Are either of you interested (or can you recommend someone who you'd trust to merge/publish a fix?). I'm interested in version 3 being patched for the moment, but the same fix will be applicable to 4. I imagine this is relevant to Keet too? |
Dont think its fixable as electron disabled the api. We just dont use the secure mem atm. If I am wrong and it is fixable, then happy to apply. |
@mafintosh I can see these paths forward, have marked this bits which I think you might be able to answer with (:question:). If any seem of interest to explore, would be up for resourcing that (even if it's a dead end). If (1) is safe and fine, I can take that path instead 1. replace
|
|
(1) answers my question adequately I think - if Hypercore team is happy with Appreciate your time, thanks @mafintosh |
Here's the solution I'm using. This is at the start of the // WARNING - monkey patch
const na = require('sodium-native')
na.sodium_malloc = function sodium_malloc_monkey_patched (n) {
return Buffer.alloc(n)
} 🙈 |
Ah, and you also need na.sodium_free = function sodium_free_monkey_patched () {} |
Trying to upgrade to electron@26 , I started seeing an error which I tracked back to
sodium-native/blob/v3.4.1/binding.c#L95
Some research surfaces this issue electron/electron#35801
TL;DR - the new memory cage in v8 deprecated
napi_create_external_buffer
👍The electron issue has people discussing different approaches to navigating this breaking change. I don't know enough of this domain (yet) to be able to take this further.
The text was updated successfully, but these errors were encountered: