Skip Menu |

This queue is for tickets about the Device-USB CPAN distribution.

Report information
The Basics
Id: 90439
Status: open
Priority: 0/
Queue: Device-USB

People
Owner: Nobody in particular
Requestors: py.bonnetain [...] ba-consultants.fr
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Device::USB, init, segfault
Date: Sat, 16 Nov 2013 14:04:02 +0100
To: bug-device-usb [...] rt.cpan.org
From: Pierre-Yves Bonnetain <py.bonnetain [...] ba-consultants.fr>
Hello, I recently got a magnetic stripe reader with an USB connection to my computer, so I'm now dabbling with Device::USB and libusb, on a Gentoo distrib. I installed Device::USB 0.36 from Cpan, and I'm using libusb-1.0.9-r2. libusb_init(), from Device::USB initialization routine, segfaults : $ perl -d /usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux/Device/dump_usb.pl Inline::CODE(0x187ccb8)((eval 5)[/usr/lib64/perl5/vendor_perl/5.12.4/Inline.pm:200]:4): 4: $INIT++; DB<1> n Inline::CODE(0x187ccb8)((eval 5)[/usr/lib64/perl5/vendor_perl/5.12.4/Inline.pm:200]:5): 5: &init; DB<1> main::(/usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux/Device/dump_usb.pl:20): 20: our $VERSION=0.02; DB<1> main::(/usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux/Device/dump_usb.pl:49): 49: my $usb = Device::USB->new(); DB<1> s Device::USB::new(/usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux/Device/USB.pm:189): 189: my $class = shift; DB<1> s Device::USB::new(/usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux/Device/USB.pm:191): 191: $init_ref->(); DB<1> s Device::USB::CODE(0x19005b8)(/usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux/Device/USB.pm:177): 177: libusb_init(); DB<1> s Segmentation fault And the kernel logs : perl5.12.4[16153]: segfault at 7fff3a800ff8 ip 00007f0f2e06f03f sp 00007fff3a801000 error 6 in libusb-0.1.so.4.4.4[7f0f2e06d000+5000] This is not only for dump_usb.pl. Any code that uses Device::USB will segfault on Device::USB->new(). It may be possible that this problem comes from my installation (incompatible versions, this kind of stuff). If you have any hint as to how to pinpoint the bug, or how to help you chase it, just tell me. I'm in a hell of a hurry to use this magstripe reader, so I'll lend any help I can. Sincerely, -- Pierre-Yves Bonnetain-Nesterenko B&A Consultants - Sécurité informatique - www.ba-consultants.fr Tel. : +33 (0) 563 277 241 - Fax : +33 (0) 567 737 829
Subject: Re: [rt.cpan.org #90439] Device::USB, init, segfault
Date: Sat, 16 Nov 2013 08:39:22 -0600
To: bug-Device-USB [...] rt.cpan.org
From: "G. Wade Johnson" <gwadej [...] anomaly.org>
On Sat, 16 Nov 2013 08:04:19 -0500 "Pierre-Yves Bonnetain via RT" <bug-Device-USB@rt.cpan.org> wrote: Show quoted text
> Sat Nov 16 08:04:19 2013: Request 90439 was acted upon. > Transaction: Ticket created by py.bonnetain@ba-consultants.fr > Queue: Device-USB > Subject: Device::USB, init, segfault > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: py.bonnetain@ba-consultants.fr > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=90439 > > > > Hello, > > I recently got a magnetic stripe reader with an USB connection to my > computer, so I'm now dabbling with Device::USB and libusb, on a Gentoo > distrib. > > I installed Device::USB 0.36 from Cpan, and I'm using libusb-1.0.9-r2.
Hello, The problem is right here. When we wrote libusb years ago, the standard version was 0.1.4. I haven't been working on USB in several years now, so I've never gotten a chance to rewrite the library for libusb 1.0. It is possible to install a 0.1 version of libusb on Linux. That's what most people have done. The only other approach is for someone to rewrite Device::USB to match version 1.0 of libusb. Hope that helps, G. Wade Show quoted text
> libusb_init(), from Device::USB initialization routine, segfaults : > > $ perl -d > /usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux/Device/dump_usb.pl > Inline::CODE(0x187ccb8)((eval > 5)[/usr/lib64/perl5/vendor_perl/5.12.4/Inline.pm:200]:4): > 4: $INIT++; > DB<1> n > Inline::CODE(0x187ccb8)((eval > 5)[/usr/lib64/perl5/vendor_perl/5.12.4/Inline.pm:200]:5): > 5: &init; > DB<1> > main::(/usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux/Device/dump_usb.pl:20): > 20: our $VERSION=0.02; > DB<1> > main::(/usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux/Device/dump_usb.pl:49): > 49: my $usb = Device::USB->new(); > DB<1> s > Device::USB::new(/usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux/Device/USB.pm:189): > 189: my $class = shift; > DB<1> s > Device::USB::new(/usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux/Device/USB.pm:191): > 191: $init_ref->(); > DB<1> s > Device::USB::CODE(0x19005b8)(/usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux/Device/USB.pm:177): > 177: libusb_init(); > DB<1> s > Segmentation fault > > And the kernel logs : > perl5.12.4[16153]: segfault at 7fff3a800ff8 ip 00007f0f2e06f03f sp > 00007fff3a801000 error 6 in libusb-0.1.so.4.4.4[7f0f2e06d000+5000] > > This is not only for dump_usb.pl. Any code that uses Device::USB will > segfault on Device::USB->new(). > > It may be possible that this problem comes from my installation > (incompatible versions, this kind of stuff). > > If you have any hint as to how to pinpoint the bug, or how to help you > chase it, just tell me. I'm in a hell of a hurry to use this magstripe > reader, so I'll lend any help I can. > > Sincerely,
-- Understanding is a three-edged sword. -- Kosh in "Deathwalker"