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

nw 0.14.2 crashes when calling native module #4772

Closed
RohitSharma27 opened this issue Apr 26, 2016 · 7 comments
Closed

nw 0.14.2 crashes when calling native module #4772

RohitSharma27 opened this issue Apr 26, 2016 · 7 comments
Assignees
Milestone

Comments

@RohitSharma27
Copy link

nw 0.14.2
node v5.9.0
Mac OS X El Capitan
Hi Guys,
I have written a simple native addon which is running asynchronously using libuv's worker thread. When I am running the module using node then it is working all fine. But, when I am trying to run it on "nw 0.14.2", nw crashes and I see the following message on the Console.

com.apple.xpc.launchd[1]: (io.nwjs.nw.201632[608]) Service exited with abnormal code: 11

What could be the possible reason? Please help.

@RohitSharma27
Copy link
Author

You may try to reproduce the issue by running https://github.com/paulhauner/example-async-node-addon in nw 0.14.2 but remove the "sleep(3)" call.
So, basically it looks like if I don't hold the UV thread for some time then the app crashes.
Even "sleep(1)" is enough. But, without the sleep call, app crashes.
I am really on a tight deadline with my addon. I need a direction to look in to. It will be appreciated.
Thanks.

@rogerwang
Copy link
Member

Will fix it soon.

@rogerwang rogerwang added this to the 0.14.x milestone Apr 26, 2016
@rogerwang rogerwang self-assigned this Apr 26, 2016
@rogerwang
Copy link
Member

I just tried the example -- it works for me.

btw, my Node is 5.11.0 but it may not be related.

@RohitSharma27
Copy link
Author

This is what you should do to see the issue.

  1. Comment out the sleep() call in the above mentioned addon's cc file.
  2. Inject a file using "inject_js_start" and in that file require the above mentioned module and you will see that when you start the app. It crashes.
    Thanks.

@RohitSharma27
Copy link
Author

RohitSharma27 commented Apr 27, 2016

@rogerwang
You can download the sample app from https://www.dropbox.com/s/l1jqtcbr4ggy8ut/sampleApp.zip?dl=0
I have commented the "sleep()" call. You'll need to perform node-gyp configure and node-gyp build.
The app will crash and even if I write "sleep(1)" then it works fine. This is the SDK build that I am using.
Hope it will help you identify the issue.
Thanks.

@rogerwang
Copy link
Member

I commented the sleep() call, but I didn't do the "inject_js_start". Will check it again.

@rogerwang
Copy link
Member

This is fixed in git and will be available in the next nightly build.

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