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
Crash while doing setPrivateKey on ECDH #16477
Comments
@NicholasBertazzon have you tried it on 4.0.4 (was released recently) or v5.0.0-beta.2? |
Here's the stack trace:
|
This line in BignumPointer priv(BN_bin2bn(
reinterpret_cast<unsigned char*>(Buffer::Data(args[0].As<Object>())),
Buffer::Length(args[0].As<Object>()),
nullptr)); |
Any traction on this? We're experiencing an app crash as well trying to upgrade to Electron 4.0. Particularly affecting - MatthieuLemoine/push-receiver#23 |
There's a pull request, that should address it, but so far there was no progress beyond that: #16822 |
Thanks for the info @jayarjo. Glad to see there's a PR out 🎉 |
I don't believe #16822 is related to this crash. |
Yeah #16822 doesn't seem to be related. @nornagon could you look into this? Why would this break in an Electron environment? What seems suspicious in |
We patch some of node/v8's Buffer code for compatibility (e.g.), and that function in node seems to make some assumptions about the memory layout of buffers. cc @codebytere whom i think knows more about the Buffer patches. |
@jamesb3ll not sure if this is applicable here, but you posted a workaround on another repo's thread. Adding here for context. cc @codebytere
|
Sadly this workaround doesn't seem to work for me @v5.0.0-beta.3... Crashes with an malloc error. Any other ideas? This bug is currently keeping me back quite a bit @chevonc @codebytere. The last working release I could find on npm was v4.0.0-nightly.20180821 |
This comment has been minimized.
This comment has been minimized.
I did a little more digging and it looks like the culprit is actually this in node_crypto.cc:
The BoringSSL implementation of that function expects the key to be non-null. |
@chevonc should go out in the next releases of 4.x and 5.x-beta. |
Thank you so much @nornagon 😃 I wish I'd knew how to fix it myself, I learnt a little bit about electron uses patches. Thanks! |
node_modules/.bin/electron --version
: v4.0.1node_modules/.bin/electron --version
on last known working Electron version (if applicable): v3.1.1Expected Behavior
Shouldn't crash :)
Actual behavior
Electron crashes (half of it, I mean the process is still going on at almost 100% CPU, in background)
To Reproduce
Additional Information
It works with electron 3.1.1, but not 4.0.1
Maybe an update of Node could fix the issue
The text was updated successfully, but these errors were encountered: