OpenZWave / node-openzwave-shared

OpenZWave addon for Node.js (all versions) including management and security functions
Other
199 stars 113 forks source link

Crash from constructor #214

Closed rektide closed 5 years ago

rektide commented 6 years ago

Hello. I was using this project fine about a year ago, with the latest of this lib and open-zwave, on whatever the latest Node 8 was. I just came back to this project, & got a crash trying to

var ozw = new (require("openzwave-shared"))()

The segfault looks like:

FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.
 1: node::Abort() [node]
 2: 0x121a2cc [node]
 3: v8::Utils::ReportApiFailure(char const*, char const*) [node]
 4: OZW::OZW::New(Nan::FunctionCallbackInfo<v8::Value> const&) [/usr/local/src/node-openzwave-shared/build/Release/openzwave_shared.node]
 5: 0x7fca7d240ee6 [/usr/local/src/node-openzwave-shared/build/Release/openzwave_shared.node]
 6: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [node]
 7: 0xb9095f [node]
 8: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [node]
 9: 0x63e6230463d

I have updated to the latest openzwave-shared addon and open-zwave library. I have high confidence the open-zwave library is properly installed (via a sudo make install). This is now Node 8.9.4.

Is there anything I should do to get better debugging information in these stack traces? If I'm not compounding the work required to help out, it'd be great to know how to get debugging information such as line numbers in stack traces, if that's a thing.

Thank you so so much. This library is amazingly helpful. My humble apologies for raising this issue.

rektide commented 6 years ago

Hey. I modified the package.json to make the install script be debug (node-gyp rebuild --debug), but the segfault stack-trace still looks the same.

Big leap, but this inuitively feel like it may be a Nan bug, but I'll poke around in the openzwave-shared code a little & see if anything jumps out at me. Any help at getting better debugging would be sweet.

jacksun101 commented 6 years ago

It seems to be fixed by adding parameters like this.

var zwave = new ZWave({ ConsoleOutput: false, Logging: false });

rektide commented 6 years ago

Confirmed that adding the parameter fixed it.

I'll try to pick up a little bit more about Node Addons to see if I can get this documented usage working.

ekarak commented 6 years ago

bug confirmed - The code assumes a non-empty options object.Will fix that now...

ekarak commented 6 years ago

https://github.com/OpenZWave/node-openzwave-shared/tree/bugfix/issue%23214-crash-on-empty-options committed, will merge once dear Mr. Travis gives us the green light

AddoSolutions commented 6 years ago

Having this same issue. jacksun101's fix worked for me.

ekarak commented 5 years ago

Erm... forgot to merge this. Also seems that Travis was singing the blues so all build tests failed. Will look this up now

charles-toller commented 5 years ago

This issue is still occurring as of v1.4.8. Any progress on this?

iksheth commented 5 years ago

Erm... forgot to merge this. Also seems that Travis was singing the blues so all build tests failed. Will look this up now

Is it Merged now ? it is sill occurring on 1.4.8 !

ekarak commented 5 years ago

this is merged and released with 1.5.0