-
-
Notifications
You must be signed in to change notification settings - Fork 477
EXC_BAD_ACCESS with Node 8.3, works with Node 6.11 #101
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
Comments
Thanks @mcollina for the report. I tried Windows and Ubuntu, but I'm not seeing that crash. I don't have a Mac handy right now to verify with, but I'll try to track one down. |
I did this:
So far, it's stuck on "# Subtest: create an histogram arguments checks\nok 1 - expected to throw" |
This is on "macOS Sierra Version 10.12.2" |
Still stuck ... I'm going to interrupt it. |
Yes, and if you run that with lldb, you will get the error above. |
Aaah, OK. Will do. |
Reproduced. |
Built 8.3.0 with debug symbols and it runs successfully LOL |
That is, inside lldb. |
So it only happens with the official version. |
@jasongin the instability may arise from the fact that the constructor for the |
Yes, I agree test coverage is needed. It just hasn't been a top priority for me so far because |
@gabrielschulhof What you’re saying makes a lot of sense. I think this would be the fix for it: diff --git a/napi-inl.h b/napi-inl.h
index 4573963422d9..bf64376072c6 100644
--- a/napi-inl.h
+++ b/napi-inl.h
@@ -2428,12 +2428,10 @@ inline napi_value ObjectWrap<T>::ConstructorCallbackWrapper(
}
T* instance;
- napi_value wrapper;
- details::WrapCallback([&] {
+ napi_value wrapper = details::WrapCallback([&] {
CallbackInfo callbackInfo(env, info);
instance = new T(callbackInfo);
- wrapper = callbackInfo.This();
- return nullptr;
+ return callbackInfo.This();
});
napi_ref ref; The code should look like that anyway, I think. In its current state, |
Fixes: nodejs/node-addon-api#101 PR-URL: nodejs/node-addon-api#105 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Fixes: nodejs/node-addon-api#101 PR-URL: nodejs/node-addon-api#105 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Fixes: nodejs/node-addon-api#101 PR-URL: nodejs/node-addon-api#105 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Fixes: nodejs/node-addon-api#101 PR-URL: nodejs/node-addon-api#105 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
I've ported https://github.com/mcollina/native-hdr-histogram/tree/napi to node-addon-api. The tests passes with Node 6.11, but they fail with the following error on Node 8.3.0-rc.0:
to reproduce, run
node --napi-modules test.js
after downloading and building the linked branch: https://github.com/mcollina/native-hdr-histogram/tree/napiThe text was updated successfully, but these errors were encountered: