-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
I've run into an issue on macOS where calling HidApi::new from different threads leads to an abort of the process, with an exception for an illegal instruction.
Looking at the stacktrace, it seems to be cause by a CFAssertMismatchedTypeID assertion somewhere in Core Foundation.
Are there any special precautions that have to be taken when using hidapi from multiple threads? I couldn't find anything in the documentation.
Stacktrace
* thread #5, name = 'try 1', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
* frame #0: 0x00007ff80cf83f3e CoreFoundation`_CFAssertMismatchedTypeID + 110
frame #1: 0x00007ff80ce254bd CoreFoundation`CFRunLoopAddSource + 973
frame #2: 0x00007ff80f76e305 IOKit`IOHIDDeviceScheduleWithRunLoop + 74
frame #3: 0x00007ff80f772651 IOKit`__IOHIDManagerDeviceApplier + 527
frame #4: 0x00007ff80f735537 IOKit`__IOHIDManagerDeviceAdded + 766
frame #5: 0x00007ff80f73513b IOKit`__IOHIDManagerSetDeviceMatching + 347
frame #6: 0x0000000100010724 hidapi-repro`hid_enumerate(vendor_id=0, product_id=0) at hid.c:654:2
frame #7: 0x000000010000ce03 hidapi-repro`hidapi::hidapi::HidApiBackend::get_hid_device_info_vector::hdb756fded0153d2d at hidapi.rs:25:36
frame #8: 0x000000010000dbde hidapi-repro`hidapi::HidApi::new::h471133b553ec121f at lib.rs:171:27
frame #9: 0x0000000100006141 hidapi-repro`hidapi_repro::enumerate::h2a623970c0b3f1ae at main.rs:16:13
Repo with code to reproduce: https://github.com/tiwalun/hidapi-repro
White-Rabbit-Scientific
Metadata
Metadata
Assignees
Labels
No labels