-
-
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
[linux] open file descriptor leak on serialport.open(), fd is not closed properly on serialport.close() #544
Comments
Update: it seems that this issue is only in the latest version(s), i've tested 3 versions: |
I got the same issue... I'm using node v0.12.4 and serialport: 1.7.4. The kernel version is I have tried your example code with |
I got the issue ... handle is open 2 times in serialport_unix.cpp void EIO_Open(uv_work_t* req) { if(-1 == setup(fd, data)){ int setup(int fd, OpenBaton *data) { |
We fixed a ton of bugs in our latest beta specifically ones addressing this issue. #733 Please try it out |
I'm going to close this as we've confirmed this bug is fixed. Please reopen or make a new issue if you have more issues! Thanks for reporting it and tracking down the issue! |
On linux, when you open() and close() the serial port connection, the file descriptor to the device (e.g. to /dev/ttyUSB0) will not be closed properly.
I've written a simple application that will open and close the connection to the serial port every second.
When you watch the file descriptors with 'lsof -c node' you will see that on every call to open() a new file descriptor is opened that will not be closed on close();
Used node version: 0.10.x
Used serialport module: 1.7.4
Example application to test the issue (it will open an close the serialport every second):
You can watch the open file descriptors with: watch -n1 "lsof -c node | wc -l"
The text was updated successfully, but these errors were encountered: