scliffe has asked for the wisdom of the Perl Monks concerning the following question:
I'm having a problem with Device::USB, specifically I'm getting the following warning:
Argument "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0..." isn't numeric in subroutine entry at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Device/USB/Device.pm line 585, <DATA> line 1.
This is then followed by a Segmentation fault.
This code from Device::USB that is causing this is:
sub get_descriptor { my $self = shift; my $type = shift; my $index = shift; $self->_assert_open(); my $buf = "\0" x MAX_BUFFER_SIZE; my $retlen = Device::USB::libusb_get_descriptor( $self->{handle}, $type, $index, $buf, MAX_BUFFER_SIZE ); return if $retlen < 0; return substr( $buf, 0, $retlen ); }
The argument $buf ends up as (nil) in Device::USB::libusb_get_descriptor (which is an Inline::C function) so there appears to be some problem with the argument passing.
Is this a bug in the Device::USB package?
Thanks in advance for any advice.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem trying to use Device::USB
by almut (Canon) on Mar 15, 2010 at 07:21 UTC | |
by scliffe (Novice) on Mar 15, 2010 at 22:41 UTC | |
|
Re: Problem trying to use Device::USB
by BrowserUk (Patriarch) on Mar 15, 2010 at 06:33 UTC | |
|
Re: Problem trying to use Device::USB
by gwadej (Chaplain) on Jul 22, 2010 at 03:52 UTC |