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

How to Use segfault-handler? Is It Still Usable with Node 20.x #4517

Open
Umesh-daiict opened this issue Dec 16, 2024 · 1 comment
Open

How to Use segfault-handler? Is It Still Usable with Node 20.x #4517

Umesh-daiict opened this issue Dec 16, 2024 · 1 comment
Labels

Comments

@Umesh-daiict
Copy link

Node.js Version

20.15.0

NPM Version

10.7.0

Operating System

linux-gnu

Subsystem

Other

Description

Facing an issue when trying to use the package segfault-handler with Node.js 20.15.0. When working on a Linux VM, I encountered segmentation faults during build and bundle processes. To debug these issues, I attempted to use segfault-handler to get stack traces but encountered the following error:

[email protected]/node_modules/bindings/bindings.js:135

A similar issue occurs when using the package node-segfault-handler.

Minimal Reproduction

There are no specific reproduction steps available. The segmentation fault started occurring after migrating from Node.js 18 to Node.js 20.

Output

Here is the error log (with some information redacted for privacy):

at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (/path/to/segfault.js:1:23)
at Module._compile (node:internal/modules/cjs/loader:1358:14) {
  tries: [
    '/path/to/node-segfault-handler/build/NodeSegfaultHandler.node',
    '/path/to/node-segfault-handler/build/Debug/NodeSegfaultHandler.node',
    '/path/to/node-segfault-handler/build/Release/NodeSegfaultHandler.node',
    '/path/to/node-segfault-handler/out/Debug/NodeSegfaultHandler.node',
    '/path/to/node-segfault-handler/Debug/NodeSegfaultHandler.node',
    '/path/to/node-segfault-handler/out/Release/NodeSegfaultHandler.node',
    '/path/to/node-segfault-handler/Release/NodeSegfaultHandler.node',
    '/path/to/node-segfault-handler/build/default/NodeSegfaultHandler.node',
    '/path/to/node-segfault-handler/compiled/20.15.0/linux/x64/NodeSegfaultHandler.node',
    '/path/to/node-segfault-handler/addon-build/release/install-root/NodeSegfaultHandler.node',
    '/path/to/node-segfault-handler/addon-build/debug/install-root/NodeSegfaultHandler.node',
    '/path/to/node-segfault-handler/addon-build/default/install-root/NodeSegfaultHandler.node',
    '/path/to/node-segfault-handler/lib/binding/node-v115-linux-x64/NodeSegfaultHandler.node'
  ]
}

### Before You Submit

- [X] I have looked for issues that already exist before submitting this
- [X] My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask
@preveen-stack
Copy link
Contributor

preveen-stack commented Dec 18, 2024

I tried the example.js part of segfault-handler with nodejs 22.7 on macos

$ node -v
v22.7.0

$ node example.js 
NodeSegfaultHandlerNative: about to dereference NULL (will cause a SIGSEGV)
PID 25607 received SIGSEGV for address: 0x1
0   segfault-handler.node               0x000000010b67b460 _ZL16segfault_handleriP9__siginfoPv + 288
1   libsystem_platform.dylib            0x00007ff80f489e9d _sigtramp + 29
2   ???                                 0x0000044400000000 0x0 + 4690104287232
3   segfault-handler.node               0x000000010b6791f6 _Z22segfault_stack_frame_2v + 22
4   segfault-handler.node               0x000000010b6791da _Z13CauseSegfaultRKN3Nan20FunctionCallbackInfoIN2v85ValueEEE + 26
5   segfault-handler.node               0x000000010b67aedd _ZN3Nan3impL23FunctionCallbackWrapperERKN2v820FunctionCallbackInfoINS1_5ValueEEE + 2653
6   node                                0x0000000106ecd9a2 Builtins_CallApiCallbackGeneric + 162
Segmentation fault: 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants