-
Notifications
You must be signed in to change notification settings - Fork 41
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
"A dynamic link library (DLL) initialization routine failed" when run in Windows under Electron or PKG #49
Comments
I can't seem to reproduce this with pkg. What bcrypto version are you using? Is there any chance of creating an isolated test case which reproduces the issue? |
@chjj since this is for Bob, I think I can answer with reasonable confidence. Here's our package-lock.json for Bob 4.0:
This commit, from May 26th, is somewhere between 5.1 (may 19th) and 5.2 (jun 13th). |
@chjj @mslipper I am able to get Bob to build and run in dev mode on Windows by reverting this commit: f8f5cb7 or in other words, using cmake instead of node-gyp as you're already planning on doing I think. I'm not sure but reading up on this issue I think the problem is because electron doesn't contain nodejs, it runs a fork, and so there are these extra tools like What I did just now is clone master branch of Bob, restore the Bob seems to running fine on Windows now in dev mode, and synced the HNS blockchain in about 45 minutes. |
@pinheadmz very interesting that it works with cmake. node-gyp adds a ton of unnecessary flags to each build (most of which are intended for building node.js itself, not addons). I would guess something here is borking the build on windows. Maybe this justifies switching to cmake for everything, though it is an extra dependency for users depending on how you look at it. |
Oh to be clear - hsd and bcrypto build fine on windows as-is master branches and latest releases. But there is something wrong with building for Electron on windows. |
Hi there,
When I run software under Electron or PKG that runs bcrypto with native bindings on Windows, I get a "DLL Initialization Routine Failed" error. The error looks like this:
I've already verified that the Node ABI version in use is correct. After attaching WinDBG to the PKG-generated process, I see the following error:
(Note: The exception is not handled, since WinDBG goes into a loop after stepping over the exception.)
The error is the same when I debug Bob in the same way. Error code
c0000005
isn't a missing DLL error, it implies a runtime bug withinbcrypto
itself that is triggering a memory access violation. Any chance you could take a look and see what is going on? Being able to bundle HSD via PKG would dramatically simplify Bob development, and allow people to make standalone HSD binaries in the future.The issue is not present when HSD is run from my system Nodejs interpreter. The error disappears when I set
process.env.NODE_BACKEND
tojs
.The text was updated successfully, but these errors were encountered: