-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Uncaught exceptions can cause node to hang #282
Comments
Update: I have narrowed the problem to an issue with the Why node-serialport causes this hang-up... I still don't know. But, it's probably related to Very interesting and strange... |
I also have this problem. I'm running on Rasbian kernel 3.10.24+, node v0.10.12. I like to resume stdin and then listen for the 'SIGINT' event on process. Then I cleanup open ports and other application stuff,and explicitly call process.exit(). If I call serialPort.close() in my SIGINT handler, then try to call process.exit(), it just hangs. I have to ctrl-Z and kill -9 node to recover. This is really annoying, because I would like to call process.exit() in the serial.close() callback function to ensure everything is closed properly, but it just hangs. So at this point, I just don't close the serial port. It seems to be fine; I'm just using the /dev/ttyAMA0 (rx/tx pins) on the rpi to talk to an arduino. Anyone have any more info on this? |
What a fascinating bug, great sleuthing @bminer! Do you have a recommended fix and if so could you submit a pull request? |
@JayBeavers - Unfortunately, I do not have a fix at this time. It's also pretty tough to reproduce the problem. (sigh) If I find any more information, I will post back here. |
@bminer any update or data? |
Sadly, no. I do not have time ATM to debug this issue. However, I can say that libuv is working on separating the thread pools for different tasks (libuv/leps#4). And, they are working on an approach to allow reading from TTY/serial ports (libuv/libuv#19). So, eventually, these wonderful things will make it to Node.js. In the meantime, I have been using node-serialport and other libs to address the issue, and I just deal with the bugs. |
We've had a lot of similar bugs fixed as well as some major rewrites of our c++ code since this bug was filed. I sure hope we caught this bug, but since it was never quite identified, I'm closing this issue. |
Sounds good, thanks. I'm not sure if it's still an issue or not either. I've been pretty happy with the stability improvements made to this lib. |
In certain situations,
process.exit(1)
or an uncaught exception will cause the Node.js process to hang when using node-serialport. The desired behavior is for the Node process to die. Instead, the process remains open and just hangs.I am working on some reproducible code to demonstrate this bug. I am fairly certain that node-serialport is the culprit... it reminds me of issue #150.
This problem occurs on node-serialport 1.2.5. Node 0.10.22. Debian Linux 7.0
The text was updated successfully, but these errors were encountered: