-
Notifications
You must be signed in to change notification settings - Fork 284
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
NAPI segmentation fault on Arm #3698
Comments
@nodejs/node-api |
@niyan-ly could you get and print out the return code that you see for the a) and b) calls? |
napi_value list, binding, new_list;
size_t len = 4;
napi_get_cb_info(env, info, &len, &list, &binding, NULL); // code-a This code is broken regardless of architecture – napi_value list[4];
napi_value binding, new_list;
size_t len = 4;
napi_get_cb_info(env, info, &len, &list, &binding, NULL); // code-a (To be fair, this is implied in the docs, but not spelled out very explicitly.) |
Refs: nodejs/help#3698 Signed-off-by: Michael Dawson <mdawson@devrus.com>
Create PR to try to clarify - nodejs/node#41635 |
@addaleax thank you, I should have read the doc more carefully before open this issue. Anyway, thank you for your detailed explanation. |
Refs: nodejs/help#3698 Signed-off-by: Michael Dawson <mdawson@devrus.com>
Refs: nodejs/help#3698 Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41635 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Refs: nodejs/help#3698 Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: nodejs#41635 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Refs: nodejs/help#3698 Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41635 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Refs: nodejs/help#3698 Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41635 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Refs: nodejs/help#3698 Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41635 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Refs: nodejs/help#3698 Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41635 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Version
v16.13.2
Platform
Darwin YongLins-MacBook-Pro.local 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 arm64
Subsystem
macOS Monterey 12.1
What steps will reproduce the bug?
Background
I ran this test on the m1 macbook, got
segmentation fault
error. Then I pulled thelatest
official node docker image, still got same error. It seems more like anarm-build
related issue, node-v14 on m1 still got the same error. But it works well on x64 linux(debian 9).The key point is, if we switch the line
code-a
andcode-b
, which means create js_array before get_cb_info, then everything works well.Step to reproduce
copy these 3 files,
code.c
test.js
binding.gyp
.node-gyp configure
node-gyp rebuild
node test
Result
How often does it reproduce? Is there a required condition?
stable reproducible.
What is the expected behavior?
code should be compile and execute successfully.
What do you see instead?
segmentation fault.
Additional information
No response
The text was updated successfully, but these errors were encountered: