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

Client crashes after connecting to emulator for a second time. #121

Open
ColinT opened this issue Mar 7, 2020 · 1 comment
Open

Client crashes after connecting to emulator for a second time. #121

ColinT opened this issue Mar 7, 2020 · 1 comment

Comments

@ColinT
Copy link
Contributor

ColinT commented Mar 7, 2020

Net64 client will crash to desktop a while after connecting to an emulator for a second time.

Steps to reproduce:

  • Open Net64 client.
  • Connect to PJ64 MM.
  • Connect to PJ64 MM again. (Problem occurs whether or not the same process is used).
  • Client will crash to desktop.

This also occurs if the mock emulator is used as the second connection.

The crash appears to be caused by a binary file, likely winprocess.
The error message is:

npm ERR! code ELIFECYCLE
npm ERR! errno 3221226356
npm ERR! [email protected] start: `yarn build:dev && cd ./build && electron .`
npm ERR! Exit status 3221226356

This is a heap corruption error (0xC0000374).

I tried to use a debug build of winprocess using

npm explore winprocess -- npx node-gyp --debug configure rebuild

to investigate but was unable to run Net64 using it. Looks like it is webpacked it into the Electron app somehow instead of going through a regular nodejs dependency resolver.

If this is indeed an upstream issue with winprocess, consider switching to memoryjs. I have been using it in another project without issue.

@Tarnadas
Copy link
Owner

Hey,
Thanks for investigating this crash! I'm aware of it, but since I'm not very proficient with C++ and since winprocess is really outdated, I had no intention to fix it.

The dev build won't pick up your debug build of winprocess unless you move it to a specific position at ./build/winprocess.node. This is caused by my Webpack config at https://github.com/Tarnadas/net64plus/blob/master/webpack.dev.js#L120
I had to make some weird Webpack setups so that nexe will catch up the native Node dependencies for the bundled executable, which is published on Github.

I will eventually replace the Electron backend with Tauri, which would mean I will no longer have to rely on winprocess and any other native Node dependency. This would be a huge rewrite, so eventually it would be still worth investigating the current crash. I wasn't aware of memoryjs. Maybe it would be easy enough to replace it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants