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