Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Device::USB and core dumped

by Arien0611 (Novice)
on Oct 16, 2012 at 15:19 UTC ( #999352=perlquestion: print w/replies, xml ) Need Help??
Arien0611 has asked for the wisdom of the Perl Monks concerning the following question:

hi guys. after some trouble, i ve managed to install through cpan the Device::USB module. However, i ve come up with a problem that google couldnt help me with. My code is this:
#!/usr/bin/perl use warnings; use diagnostics; use Device::USB; $usb = Device::USB->new(); print "1\n";
and the outcome is this:
Segmentation fault (core dumped)
my perl -d:Trace give me this:
>> (eval 7)[/usr/local/share/perl5/]:4: $INIT++; >> (eval 7)[/usr/local/share/perl5/]:5: &init; >> /usr/local/share/perl5/ local ($/, $") = ("\n", ' + '); local ($\, $,); >> /usr/local/share/perl5/ local ($/, $") = ("\n", ' + '); local ($\, $,); >> /usr/local/share/perl5/ while (my $o = shift(@DAT +A_OBJS)) { >> $usb = Device::USB->new(); >> /root/perl5/lib/perl5/i386-linux-thread-multi/Device/ + my $class = shift; >> /root/perl5/lib/perl5/i386-linux-thread-multi/Device/ + $init_ref->(); >> /root/perl5/lib/perl5/i386-linux-thread-multi/Device/ + libusb_init();
i honestly don't know what's wrong, i can't figure it out, i don't have the slightest clue. libusb1.0 and devel are installed and when the program misses the line:
$usb = Device::USB->new();
gives "1" as an outcome. Any help would be appreciated. Or some guide that could give me some guidance...

Replies are listed 'Best First'.
Re: Device::USB and core dumped
by daxim (Chaplain) on Oct 16, 2012 at 15:32 UTC
      and how do we read usb devices in perl?
Re: Device::USB and core dumped
by McA (Priest) on Oct 16, 2012 at 15:34 UTC


    my alarm bells ring when I here that you installed Device::USB with troubles knowing (after reading the man page) that this is a wrapper around a C library.

    I would assume that there is something wrong with library version (32bit/64bit) and library references.

    Check if there are more than one libusb on your system.

    Second: Let the shell write core files and dig into it with gdb. If you're lucky you get a hint.

    Update: Look at That seems to be your problem.

    Best regards

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://999352]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2018-08-15 22:23 GMT
Find Nodes?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:

    Results (165 votes). Check out past polls.