-
Notifications
You must be signed in to change notification settings - Fork 118
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
Upgrade to node 0.10.x segfaults #16
Comments
If you've done |
I was getting a "Bus error: 10" (which from SO-searching seems to be related to segmentation errors) message running the most recent stable 0.10 release and saw this issue, so I've tried downgrading to 8.5 and 8.9 and got more explicit segfaults. In case it's helpful, these were my logs from doing a rebuild: 0.8.5:
0.8.9:
0.10.5:
|
This looks like something different to the above segfault issue. Could you please create a separate issue so it can be tracked better? On 20/06/2013, at 2:25 PM, Ashley Scott notifications@github.com wrote:
|
yep - done, yes I should have figured that. ta Ash On Fri, Jun 21, 2013 at 4:42 PM, Justin Latimer notifications@github.comwrote:
computing, electronics, music, film |
same problem here :( |
I don't get a segfault if I npm install (it just fails silently) but when cloning and trying to run the tests it does. Here is the stack
|
I also get a segmentation fault when i try to run test/input-test.js. I would really love to the module! I'm using node v0.10.13 |
On Ubuntu 12.04 I'm getting segfaults with node v0.10.12 but not with v0.10.8. |
I'm getting a segfault with node v0.10.21 at this line: I'll poke around and see if I can figure anything out... |
So on OS X 10.9 and Node 0.10.22 my stack trace looked like:
The relevant section of the source: static v8::Handle<v8::Value> New(const v8::Arguments& args)
{
v8::HandleScope scope;
NodeMidiInput* input = new NodeMidiInput();
input->message_async.data = input;
uv_async_init(uv_default_loop(), &input->message_async, NodeMidiInput::EmitMessage);
uv_unref((uv_handle_t*)uv_default_loop());
input->Wrap(args.This());
return args.This();
} I couldn't quite figure out what:
Which is to say it started working. Maybe the maintainers can weigh in why that was there? |
It seems like that line carried over when the code was upgraded from libev: b481aea#diff-33494fc3bfb02f47665c320bb90d43e6L254 The libev code originated here: adb62e3#diff-33494fc3bfb02f47665c320bb90d43e6R196 I can't find a corresponding I'm going to open up a PR to remove this line. |
Also, properly close the async watcher when closing the port. Fixes justinlatimer#16
Any of the folks that ran into this interested in testing my PR? |
I was going to post a comment the other day saying "Thank you!", I hadn't tried your patch until you asked though :) It works! No more segfault, and I'm able to read midi. We ended up writing directly to the /dev/ file descriptors for node knockout 🎹 https://www.youtube.com/watch?v=aAxqTc427V0 I hope the author responds ❤️ |
Oh awesome! Going to go check out that project, it seems interesting. On Thu, Dec 19, 2013 at 12:39 PM, Christopher Toledo <
|
Hi. I applied the fix referenced above, but I'm still getting a segfault. Here is the stack printed using segfault_handler: PID 4776 received SIGSEGV for address: 0x11 /home/matt/Programming/NodeProjects/MIDI/midiserver/node_modules/segfault-handler/build/Release/segfault_handler.node(+0xf1e)[0x7f06de4ccf1e] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7f06dea9ecb0] node(uv_unref+0x1d)[0x95db7d] /home/matt/Programming/NodeProjects/MIDI/midiserver/node_modules/midi/build/Release/midi.node(_ZN13NodeMidiInput3NewERKN2v89ArgumentsE+0x2a4)[0x7f06de2c72c4] node[0x5c490d] Can anyone point me in the right direction regarding how to find this bug? I am currently learning how to use objdump and readelf to explore this. |
Ah, I'd only tested it on OS X. I'll see if I can replicate the but on my server. |
@granmoe, I'm having problems getting the alsa kernel modules installing on my linode server... I'll have to try getting local installation up and running. |
@granmoe, Have any other information about the environment you're building and running node-midi with? (node version, linux distro, etc) You might be referencing a different version of node-midi than the rebuilt one. I did something like I am on arch linux, x86_64, node v0.10.24 |
This occurred on a Ubuntu 12.04 LTS with node version 0.10.24. Here is the output of npmlist: application-name@0.0.1 /home/matt/Programming/NodeProjects/MIDI/midiserver |
@granmoe what's the JS code you're running look like? You can try building a debug version of module (you might need to install the node-gyp module):
Then you can run it using gdb:
It'll load the program and you'll end up with a
Then you can type
So here you see what happens with ALSA on Linux where the Now you can ask for a backtrace to see exactly how (from a C++ perspective) we got to this crash:
Go ahead and give this a try and we'll be able to see if you're run into a new issue or a known one. |
Thank you for your responses, @drewish =) I am running this project: https://github.com/PauloSeb/midiServer (the midiServer.js file), and it blows up at the midi.input() call. Here is the output from the steps you gave above: matt@matt-Inspiron-N5040:~/Programming/NodeProjects/MIDI/midiserver/node_modules/midi$ gdb --args /usr/bin/node test/virtual-loopback-test-automated.js Program received signal SIGSEGV, Segmentation fault. |
@granmoe yeah it looks like you're running the un-patched code. Try replacing node-midi.cpp with this patched copy from my repo. |
Thanks, @drewish. That fixed the problem! |
This is fixed in midi v0.7.1 - just pushed to npm! |
@granmoe awesome! @justinlatimer exciting! thanks for getting that out there. |
Hi,
I've just upgraded to node 0.10. from the last stable 0.8 release. Node midi now, sadly, segfaults when required.
I've done the obvious (to my mind), and rebuilt/reinstalled it; but to no avail. I tried giving it a go with this (https://github.com/ddopson/node-segfault-handler) but haven't had any luck getting any output yet. I'll be having another go as soon as I have time.
I'm no node expert, so If there is something I should have done ready for release 0.10 I'd be happy to do it if I knew what it was.
Cheers
Si
The text was updated successfully, but these errors were encountered: