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

NodeJS process with WebMIDI crashes upon closing Max 8, if Max was started before starting the NodeJS process #391

Open
nnirror opened this issue Nov 2, 2023 · 3 comments
Assignees
Labels
Context: Node.js Problem specific to Node.js Type: dependency Issue that cannot be resolved until a dependency is fixed

Comments

@nnirror
Copy link

nnirror commented Nov 2, 2023

Description

My nodeJS process crashes when I include WebMIDI, under the following circumstance:

I first open Max 8, then start a nodeJS process, and then close Max.

Environment:
Specify the environment where you are witnessing the problem:

  • webmidi 3.1.6 for NodeJS
  • NodeJS v14.20.0
  • JavaScript
  • MacOS Catalina

Details

Here's the contents of a nodeJS process that's crashing on my machine. This test.js file contains only:

const {WebMidi} = require('webmidi');
WebMidi.enable();

Steps to reproduce:

  1. open Max 8.
  2. start the node process: node test.js
  3. close Max 8.

I see the following error in the console, and I see that the nodeJS process thread has terminated.

Segmentation fault: 11

I checked that the same workflow does not cause a crash with Ableton Live 11.

@djipco djipco self-assigned this Nov 2, 2023
@djipco
Copy link
Owner

djipco commented Nov 2, 2023

WEBMIDI.js uses the jzz package under the hood for MIDI communication on Node.js. Could you install the module and try this basic example to see if you get the same problem:

const navigator = require('jzz'); 

navigator.requestMIDIAccess({sysex: true}).then((access)=>{
  console.log(Array.from(access.inputs.values()), Array.from(access.outputs.values())); 
}, (err)=>{console.log(err)});

Thanks!

P.S. It might be related to this: jazz-soft/JZZ#49 (follow-up here: jazz-soft/jazz-midi#5)

@djipco djipco added the Status: info needed Info is needed before moving on label Nov 2, 2023
@nnirror
Copy link
Author

nnirror commented Nov 3, 2023

@djipco Yes, I do get the exact same error in a test npm project that only has jzz 1.7.4 installed. When I open Max, start the Node process, and then close Max, I get Segmentation fault: 11.

@djipco djipco added Type: dependency Issue that cannot be resolved until a dependency is fixed and removed Status: info needed Info is needed before moving on labels Nov 4, 2023
@djipco
Copy link
Owner

djipco commented Nov 4, 2023

Thanks for reporting back. It is quite clear now that the issue is with the jazz-midi module. I have notified the jazz-midi team of the problem. We will have to wait for them for a resolution.

@djipco djipco added the Context: Node.js Problem specific to Node.js label Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Context: Node.js Problem specific to Node.js Type: dependency Issue that cannot be resolved until a dependency is fixed
Projects
None yet
Development

No branches or pull requests

2 participants