Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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/Inline.pm:199]:4: $INIT++; >> (eval 7)[/usr/local/share/perl5/Inline.pm:199]:5: &init; >> /usr/local/share/perl5/Inline.pm:209: local ($/, $") = ("\n", ' + '); local ($\, $,); >> /usr/local/share/perl5/Inline.pm:209: local ($/, $") = ("\n", ' + '); local ($\, $,); >> /usr/local/share/perl5/Inline.pm:211: while (my $o = shift(@DAT +A_OBJS)) { >> main.pl:7: $usb = Device::USB->new(); >> /root/perl5/lib/perl5/i386-linux-thread-multi/Device/USB.pm:187: + my $class = shift; >> /root/perl5/lib/perl5/i386-linux-thread-multi/Device/USB.pm:189: + $init_ref->(); >> /root/perl5/lib/perl5/i386-linux-thread-multi/Device/USB.pm:175: + 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...

Comment on Device::USB and core dumped
Select or Download Code
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

    Hi,

    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 https://rt.cpan.org/Public/Bug/Display.html?id=65908. That seems to be your problem.

    Best regards
    McA

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2015-07-04 09:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (59 votes), past polls