jetperch / pyjoulescope

Joulescope driver and utilities
https://www.joulescope.com
Apache License 2.0
37 stars 11 forks source link

macOS crash with 0.5.0 #5

Closed mliberty1 closed 4 years ago

mliberty1 commented 4 years ago

When running the UI application, observed a crash when physically unplugging the Joulescope:

Thread 8 Crashed:
0   libusb-1.0.dylib                0x00000001155a1f99 darwin_handle_transfer_completion + 436
1   libusb-1.0.dylib                0x000000011559f3d9 handle_events + 1012
2   libusb-1.0.dylib                0x000000011559ed7b libusb_handle_events_timeout_completed + 262
3   libusb-1.0.dylib                0x000000011559b8d5 libusb_exit + 334
4   _ctypes.cpython-37m-darwin.so   0x0000000108fc536f ffi_call_unix64 + 79
5   _ctypes.cpython-37m-darwin.so   0x0000000108fc5b35 ffi_call + 713
6   _ctypes.cpython-37m-darwin.so   0x0000000108fc13ea _ctypes_callproc + 647
7   _ctypes.cpython-37m-darwin.so   0x0000000108fbbe1b PyCFuncPtr_call + 500
8   Python                          0x0000000108ad3918 _PyObject_FastCallKeywords + 358
9   Python                          0x0000000108b68ef0 call_function + 746

Only occurred once in about 80 unplug/plug cycles which is greatly improved over 0.4.6.

mliberty1 commented 4 years ago

I found a setup that significantly increased this failure rate to around 50%. Setup:

mliberty1 commented 4 years ago

Fixed in d65b7ef. Testing with the "bad" setup no longer causes segmentation faults. Also added faulthandler to the UI logging to assist with future segmentation fault troubleshooting.