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

Fix lack of stack trace on ARM #37

Merged
merged 1 commit into from
Aug 13, 2018
Merged

Conversation

relovution
Copy link
Contributor

On ARM, the default installation of this module would produce no stack trace. Example:

root@beaglebone:~/test/node_modules/segfault-handler# node example.js NodeSegfaultHandlerNative: about to dereference NULL (will cause a SIGSEGV) PID 1907 received SIGSEGV for address: 0x2 root@beaglebone:~/test/node_modules/segfault-handler# uname -a Linux beaglebone 4.1.19-bone-rt-r20 #1 Sun Mar 13 04:30:34 UTC 2016 armv7l GNU/Linux

The fix is to build with -funwind-tables as per http://stackoverflow.com/questions/24700150/on-raspberry-pi-backtrace-returns-0-frames:

root@beaglebone:~/test/node_modules/segfault-handler# node example.js NodeSegfaultHandlerNative: about to dereference NULL (will cause a SIGSEGV) PID 2268 received SIGSEGV for address: 0x2 /root/test/node_modules/segfault-handler/build/Release/segfault-handler.node(+0x12a0)[0xb68ba2a0] /lib/arm-linux-gnueabihf/libc.so.6(+0x26b00)[0xb68f1b00] /root/test/node_modules/segfault-handler/build/Release/segfault-handler.node(_Z22segfault_stack_frame_1v+0x1f)[0xb68ba5c4] /root/test/node_modules/segfault-handler/build/Release/segfault-handler.node(+0x1434)[0xb68ba434]

Works on at least ARM and OS X. See also #24.

@cbratschi
Copy link

I would also add the -rdynamic compiler flag. Otherwise some details are missing. It is more important to use both flags in your own native modules.

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

Successfully merging this pull request may close these issues.

3 participants