Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

QTHID crashes under OSX lion when Funcube Dongle is Connected to the USB port #7

Closed
st0ne opened this Issue · 7 comments

2 participants

@st0ne

hi,

when the funcube dongle is connected to the usb port. then the qthid will close immediatly. i've tried with qt creator, to see where the problem is.

it says:
EXC_BAD_ACCESS
Could not access Memory

The error will be at line 468 of hidmac.c

i don't know where the problem is, my programing skill is not too good ;-)

here is the code:

/* Attach the new report object to the end of the list. /
if (dev->input_reports == NULL) {
/
The list is empty. Put it at the root. /
dev->input_reports = rpt;
}
else {
/
Find the end of the list and attach. */
struct input_report *cur = dev->input_reports;
while (cur->next != NULL)
cur = cur->next;
cur->next = rpt;
}

@csete
Owner

Hi,
Which version of OS X?

@st0ne

oh sorry, i forgot... it's osx lion GM.

@csete
Owner

Ok, thanks. I will look at it when I get lion.

@st0ne

ok thanks, if you have some ideas now, i can test it ;-)

@csete
Owner

Sorry, I really have no idea whatsoever since I have never worked inside the hidapi files - they come from a different project written by somebody else.

@st0ne
@csete
Owner

Analysis provided by Matt on the FCDevelopment group:

OK, so I've been playing with a small test harness that uses fcd.c and hidmac.c to do try various things.

Once I start making more than a couple of calls to various fcd functions I get segmentation faults.
I have tried compiling as both 32 bit and 64 bit and both have issues.

I began to think that the problem might be something to do with continually opening and closing the FCD,
using fcdOpen and fcdClose, so I modified fed.c so that fcdOpen reuses a previously opened connection and
fcdClose is a no-op.

My test harness now seems to run without issues every time.

I am no expert with IOKit but what I think is happening is that fcd.c opens the HID device in IOKit, quickly does
its thing and then closes the HID device. Sometime after this IOKit is coming along with a callback to hidmac.c
but the device has already been closed and this generates the segfault.

This feels to me like a bug in IOKit but as I say I'm no expert. It might be a bug in hidapi, I don't think it is a bug in
Qthid but it might be possible to mitigate the problem in Qthid by reusing the hid device rather than opening/closing
it for every query to the device.

@csete csete referenced this issue from a commit
Mike K0ZAP Fix hidmac on Lion. Issue #7. 192c512
@csete csete closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.