-
-
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
SerialPort.list() crashes Node when used with brother device #2259
Comments
Hi @rb-serin Would you be able to confirm the specific version(s) of electron and serial port that you are using? Also, could you confirm if you are facing the issue of the device not being assigned a COM port per the prior issue you referenced? If the COM port isn't being assigned by windows you might want to manually configure the COM port within device manager (there are some instructions here: https://www.virtual-serial-port.org/articles/com-port-on-windows-10/#assign ). Although even if that does resolve your issue it sounds like the error handling/ fault tolerance could be improved. |
This might be related to #2155 as both seem to relate to unexpected behaviour; in both cases I think we need more info to be able to investigate and debug |
I can reliably reproduce this issue. The key part is to query for ports while windows is installing usb to serial drivers. It can be reproduced simply by removing the usb to serial drivers of the device from device manager and then unplugging the device and plugging it in again, the crash will happen when serialport.list() is called while the drivers are being reinstalled. Versions, Operating System and Hardware
Code to reproduce
|
I wonder if this is due to changes being made to the data stored in the windows registry as we are executing the list(). Since much of the data returned by the list operation comes from the registry if it's content changes mid process it could causes this breakage. I can't see any unhandled exceptions based on a quick scan of the code, but that does feel like the most likely issue. I had previously thought about avoiding direct registry access, and using the windows APIs more fully to provide us a little more abstraction, in the hope that the APIs would provide better fault tollerance and handling of weird edge cases. I'll try to take a look at this again when I get some time. If anyone wants to take a look at the code in question and perform some debugging, the EIO_List and associated methods it calls can be found @ https://github.com/serialport/node-serialport/blob/master/packages/bindings/src/serialport_win.cpp#L782 |
thanks @pseudorandomseed that's great news! I mean that you have access to a device that exhibits this issues... I'm really sorry that this is causing crashes for you (and your customers). Would you be able to try adding print statements to the EIO_List method per @reconbot suggestion: #2155 (comment) This would allow us to see at which step of the process the crash is occurring? (let me know if you would like any help or support to make the changes, or to setup your windows machine to be able to build the code) |
That's about right |
Can someone test |
It hasn't been verified that the similar issue with the u-blox devices described above has the same cause, but I have tested that one with serialport@10.0.0 and the issue still persists. |
Are you also experiencing the u-blox device issue with the latest v9 release too? If so I wonder if we have a different defect we need to address for that device |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week no further activity occurs. Feel free continue the discussion or ask for a |
SerialPort.list() crashes Node ( used on electron) when a Brother printer is attached
(Please answer all 3)
What are you trying to do?
Listing all devices attached to the machine
What happens?
Node crashes leaving a blank page on electron renderer process
What should have happened?
Getting a list of devices or an exception
Code to Reproduce the Issue
Versions, Operating System and Hardware
This is the same problem as #1518
See also https://www.gitmemory.com/issue/serialport/node-serialport/2155/771687008
The text was updated successfully, but these errors were encountered: