LinuxUSBKeyboard-0.04
Perl v5.10.0 built for arm-linux-gnueabi-thread-multi
Linux debian 2.6.31 #1 PREEMPT Mon Jun 21 15:35:08 CEST 2010 armv5tejl
GNU/Linux
The C sub-process hangs and consumes a lot of system resources if the
USB bus was disconnected or re-connected. The calling process does not
receive any notification of this event which causes the application to hang.
I traced the system calls with example function echo_codes.pl
The program loops somewhere in C function _keycodes.
During normal oeration strace’s output is:
gettimeofday({1315905818, 293562}, NULL) = 0
ioctl(3, USBDEVFS_REAPURBNDELAY, 0xbebca984) = -1 EAGAIN (Resource
temporarily unavailable)
select(4, NULL, [3], NULL, {0, 1000}) = 0 (Timeout)
After re-plugging the USB device , strace’s output is:
gettimeofday({1315905921, 911127}, NULL) = 0
ioctl(3, USBDEVFS_SUBMITURB, 0xbee94940) = -1 ENODEV (No such device)
Problem:
The function does not return the “no device” message to the perl caller.