Content-type: multipart/related; boundary="Boundary_(ID_TCbi8yfJABrQHnyZb44nzw)"; type="text/html" --Boundary_(ID_TCbi8yfJABrQHnyZb44nzw) Content-type: text/html; CHARSET=US-ASCII Content-transfer-encoding: quoted-printable
Can you try 1.0.16-rc6 and see if it still hangs? You can find it @&n= bsp; rc6/libusb-1.0.16-rc6.tar.bz2


On A= pr 13, 2013, at 08:20 AM, Robert Heller <> wrote:=

We are developing cross-platform code to interface wit= h a USB device
using libusb 1.x and are running into a strange problem= . The code works
just fine under Linux (Ubuntu and CentOS 5.9) and und= er MacOSX 'Tiger'
(10.5?), but has a strange failure mode under MacOSX= 10.8 (Mt. Lion).
The program runs fine once, then 'hangs' the second = time it is run.

The 'heart' of the code is this (excerpted from a= C++ class library):

from the class header file:

enum _i= mportantConstants {
/** Data length -- size of data response packet. *= /
DataLength =3D 64,
/** Interrupt Input Endpoint. */
Endpoint= IntIn =3D 0x81,
/** Interrupt Output Endpoint. */
EndpointIntOut =3D= 0x01,
/** Bulk Input Endpoint. */
EndpointBulkIn =3D 0x82,
/*= * Bulk Output Endpoint. */
EndpointBulkOut =3D 0x02,
/** Timeout (= ms) */
Timeout =3D 2000

/** Device handle. */
stru= ct libusb_device_handle *devh;

>From the class implementation = file:

r =3D libusb_interrupt_transfer(devh, EndpointIntIn, data,<= br> DataLength,&transferred,
if (r < 0) return r= ;
else if (transferred < DataLength) return -EIO;
else return 0= ;

The machine where the problem occurs is running Darwin Kernel V= ersion

unknowne0f847181b76:trunk ed$ uname -a
Dar= win 12.3.0 Darwin Kernel Version 12.3.0:
S= un Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64
Using g++ 4.2.1 and Libusb 1.0.8:

checking for ld used by = g++...
= checking if the linker
(/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwi= n11/4.2.1/ld) is GNU ld... no
checking whether the g++ linker
(/us= r/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports
shar= ed libraries... yes
checking for g++ option to produce PIC... -fno-com= mon -DPIC
checking if g++ PIC flag -fno-common -DPIC works... yes
= checking if g++ static flag -static works... no
checking if g++ suppor= ts -c -o file.o... yes
checking if g++ supports -c -o file.o... (cache= d) yes
checking whether the g++ linker
(/usr/llvm-gcc-4.2/libexec/= gcc/i686-apple-darwin11/4.2.1/ld) supports
shared libraries... yes
= checking dynamic linker characteristics... darwin12.3.0 dyld
checking= how to hardcode library paths into programs... immediate
checking for= doxygen... /usr/local/bin/doxygen
checking DOXYGEN version... 8.3.1 checking for pdflatex... /usr/texbin/pdflatex
checking for makeinde= x... /usr/texbin/makeindex
checking for pkg-config... /opt/local/bin/p= kg-config
checking pkg-config is at least version 0.9.0... yes
che= cking for LIBUSB... yes
libusb Version is 1.0.8
checking for ANSI = C header files... (cached) yes

Is this a known issue? Are there a= ny special things we should be
looking for? Is there some partitular s= et up / system config magic that
needs to be done? The machine in ques= tion seems to handle 'standard'
USB things (eg thumb drives, keyboards= , mouse, etc.) without problems,
so it does not seem to be a host hard= ware issue or a general problem
with Mt. Lion's USB subsystem in gener= al.

Robert Heller -- 978-544-6933 / heller@deep=
Deepwoods Software --<= br> () ascii ribbon campaign -- against html e-mail
/\ www.a= -- against proprietary attachments

<= br> ----------------------------------------------------------------------= --------
Precog is a next-generation analytics platform capable of adv= anced
analytics on semi-structured data. The platform includes APIs fo= r building
apps and a phenomenal toolset for data science. Developers = can use
our toolset for easy data analysis & visualization. Get a = free account!
libusb-devel mail= ing list vel
= --Boundary_(ID_TCbi8yfJABrQHnyZb44nzw)--