nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.46k stars 279 forks source link

PID 95455 received SIGSEGV for address: 0x0 #2766

Closed JorisPalings closed 1 year ago

JorisPalings commented 4 years ago

What steps will reproduce the bug?

  1. Record raw audio stream for n seconds using naudiodon (PortAudio), where n is a yargs argv.
  2. Convert raw audio stream to .mp3 stream using lame.
  3. Write stream to file using fs.
  4. Send .mp3 file to API for analysis using node-fetch.
  5. Modify API response.
  6. Serve modified API response using express.
  7. Repeat steps 1-6 every n seconds using setInterval().

How often does it reproduce? Is there a required condition?

After a random number of cycles (steps 1-6) the process crashes.

What is the expected behavior?

The process should keep running, recording an .mp3 file every n seconds, and updating and serving the modified analysis of this .mp3 file as a REST endpoint.

What do you see instead?

After a random number of cycles, the process exits and the following is displayed in the console:

PID 95455 received SIGSEGV for address: 0x0
0   segfault-handler.node               0x0000000102df3fe0 _ZL16segfault_handleriP9__siginfoPv + 304
1   libsystem_platform.dylib            0x00007fff6e5685fd _sigtramp + 29
2   node                                0x00000001002be2e3 _ZN2v88internal26SourcePositionTableBuilder21ToSourcePositionTableEPNS0_7IsolateE + 67
[1]    95455 segmentation fault  node index.js --min 20 --record 5 --repeat

Using the segfault-handler package gives the following crash log:

PID 87455 received SIGSEGV for address: 0x0
0   segfault-handler.node               0x0000000102f2efe0 _ZL16segfault_handleriP9__siginfoPv + 304
1   libsystem_platform.dylib            0x00007fff6e5685fd _sigtramp + 29
2   libsystem_c.dylib                   0x00007fff94e89388 __global_locale + 0

Additional information

bnoordhuis commented 4 years ago

Can you check what find . -name \*.node prints from your project's top-level directory?

JorisPalings commented 4 years ago

find . -name \*.node prints the following:

./node_modules/@suldashi/lame/build/Release/bindings.node
./node_modules/naudiodon/build/Release/naudiodon.node
./node_modules/segfault-handler/build/Release/segfault-handler.node
bnoordhuis commented 4 years ago

Thanks. I expect the issue is in one of those add-ons. Turning on core dumps with ulimit -c unlimited and inspecting the stack trace (bt command) afterwards in lldb might give some clues.

I'm moving this to nodejs/help because it's unlikely that it's an issue with Node.js itself but I can move it back if it turns out to be one after all.

janakg commented 4 years ago

any updates on this. Exact error while running a node 12.13.1 on macOS for a different use case.

PID 32068 received SIGSEGV for address: 0x0
0   segfault-handler.node               0x00000001028ddfe0 _ZL16segfault_handleriP9__siginfoPv + 304
1   libsystem_platform.dylib            0x00007fff69ef85fd _sigtramp + 29
2   ???                                 0x0000000000000000 0x0 + 0
3   node                                0x00000001002c1653 _ZN2v88internal13GlobalHandles40InvokeSecondPassPhantomCallbacksFromTaskEv + 419
4   node                                0x00000001000d2bd6 _ZN4node22PerIsolatePlatformData17RunForegroundTaskENSt3__110unique_ptrIN2v84TaskENS1_14default_deleteIS4_EEEE + 176
5   node                                0x00000001000d2123 _ZN4node22PerIsolatePlatformData28FlushForegroundTasksInternalEv + 603
6   node                                0x00000001000d2d4b _ZN4node12NodePlatform10DrainTasksEPN2v87IsolateE + 53
7   node                                0x00000001000b4c61 _ZN4node16NodeMainInstance3RunEv + 751
8   node                                0x000000010005b817 _ZN4node5StartEiPPc + 294
9   libdyld.dylib                       0x00007fff69cfbcc9 start + 1
❯ find . -name \*.node
./sivi-vision-node/node_modules/fsevents/fsevents.node
./node_modules/sivi-vision-node/build/default/SiviVision.node
./node_modules/sharp/build/Release/sharp.node
./node_modules/segfault-handler/build/Release/segfault-handler.node
github-actions[bot] commented 1 year ago

There has been no activity on this issue for 3 years and it may no longer be relevant. It will be closed 1 month after the last non-automated comment.

github-actions[bot] commented 1 year ago

There has been no activity on this issue and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.