MadLittleMods / node-usb-detection

List USB devices in system and detect changes on them.
MIT License
371 stars 114 forks source link

Segmentation fault when removing and adding the usb too fast #158

Open DHVPP opened 2 years ago

DHVPP commented 2 years ago

Hello,

I've encountered a problem with this package where If i remove and add the USB device too fast (as fast as I can), my Electron app just crashes and I get back the Segmentation fault (core dumped) error in logs. This error specifically happens when the package takes more than 1 sec to detect changes on USB ports (this happens kinda often) and in the meantime i pull out and plug in the USB again.

Info about the implementation: I call usbDetect.startMonitoring() as soon as the app is ready to launch, and I call usbDetect.stopMonitoring() before the app closes. I'm also only listening to add and remove events.

Linux Ubuntu 20.04 Node version 16.13.1 Electron version 16.0.0

I've seen #138 and #156 issues, but this might be a different problem.

Thanks for reading, hope to hear from you about this, Regards

DHVPP commented 2 years ago

@MadLittleMods Hey, sorry to be bothering you directly. Can I at least get a feedback if this sounds to you like a valid case or it might be a problem with my project specificaly?

MadLittleMods commented 2 years ago

@DHVPP Sounds plausible which is why the labels were added 👍

oleszczyk commented 1 year ago

Same issue here :( Any chance it will be fixed soon?