Skip to content
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

Mac: hid_exit() crasher on bad access 0 #92

Open
satzg opened this issue Dec 9, 2012 · 6 comments
Open

Mac: hid_exit() crasher on bad access 0 #92

satzg opened this issue Dec 9, 2012 · 6 comments

Comments

@satzg
Copy link

satzg commented Dec 9, 2012

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
[Switching to process 61712 thread 0x1703]
0x00007fff89770697 in CFSetGetValue ()
(gdb) bt
#0 0x00007fff89770697 in CFSetGetValue ()
#1 0x00007fff8977e5f0 in __CFRunLoopFindMode ()
#2 0x00007fff8978d0f5 in CFRunLoopRemoveSource ()
#3 0x00007fff8d1754f9 in IOHIDDeviceUnscheduleFromRunLoop ()
#4 0x00007fff8d1771bc in __IOHIDManagerDeviceApplier ()
#5 0x00007fff897582d2 in __CFSetApplyFunction_block_invoke_1 ()
#6 0x00007fff89758121 in CFBasicHashApply ()
#7 0x00007fff897580a4 in CFSetApplyFunction ()
#8 0x00007fff8d17739f in IOHIDManagerUnscheduleFromRunLoop ()
#9 0x00007fff8d17740d in IOHIDManagerClose ()
#10 0x000000010002e49b in hid_exit () at hid.c:393

hid_close is called prior to hid_exit. Completely reproducible.

@signal11
Copy link
Owner

Which version? Using latest from git repo? Can you isolate which version this problem started in?

@sharppoin
Copy link

Encountering this same issue with the latest version. Was it solved?

@todbot
Copy link

todbot commented Jul 28, 2021

This is not the repo of the latest version.
This is https://github.com/libusb/hidapi
See #468

@sharppoin
Copy link

I understand that this is not the latest. I am using the latest as you linked above. However, I MAY have stumbled upon a "fix", add a 200ms delay between IOHIDManagerClose and CFRelease in the hid_exit method seems to work for me.

@sharppoin
Copy link

In the hid_exit for mac/hid.c (libusb/hidapi), we call IOHIDManagerClose, but there isn't a corresponding IOHIDManagerOpen anywhere in the code except in main()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants