Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

USBInterfaceOpen bug [still present]?



hi-

I have an automated script that runs a test application over and over again. It starts the app, opens the USB device, issues a few commands, closes the USB device and then terminates the app then sleeps for a few seconds. Then it repeats that over an over again. Around 10,000 to 15,000 iterations it hangs on this stack trunk:

IOUSBInterfaceClass::USBInterfaceOpen(bool)
io_connect_method_scalarI_scalarO
mach_msg
mach_msg_trap
mach_msg_trap

I did a search in the archives and found the post below.

Any suggestions?

How do I avoid "a deadlock contending for that gate."

thanks!-

-lance




From: Florent Pillet <email@hidden>
Date: Fri, 14 May 2004 22:49:14 +0200
That's what I had been saying since a couple messages... That it is a bug in IOUSBFamily, that is has been around for quite some Mac OS X releases, and that it happens with a variety of USB devices. The problem is always the same: a hang in USBInterfaceOpen when called from userland code. I noticed it first while using Palm devices and Palm's HotSync synchronization software, which itself is a userland application. Later, with my own code, I started getting hangs too and others are reporting the same problem, always with userland code.


Unfortunately this doesn't happen all the time, but I'll try to keep USB Prober logging stuff at level 7. I'm running a dual G4 with a bunch of USB devices connected, so that may not render debugging easy, but since the USB hangs the end of the trace should be the deadlock point...

On 14 mai 04, at 20:30, Barry Twycross wrote:


I didn't realise this wasn't one of our functions. I didn't look closely enough at the trace to see "darwin.c" rather than IOUSB... something as the file.



The problem is really with this line: #3 0x000acce4 in IOUSBInterfaceClass::USBInterfaceOpen(bool) ()

The interface open is hanging. That's in our open source IOUSBInterfaceUserClient.cpp, it gets to IOUSBInterfaceUserClient::open(bool seize). That just does an open on the underlaying interface. (IOUSBInterface.cpp).

There are lots of log messages in that function so running a logging family and seeing what pops up should get you some pointers. That function runs something on a command gate. So my guess is a deadlock contending for that gate.

It doesn't look like this is a descriptor problem like I was speculating about yesterday.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.