Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Perl-cross IO::Select problems

by ragawu (Initiate)
on Mar 05, 2014 at 21:24 UTC ( #1077156=perlquestion: print w/ replies, xml ) Need Help??
ragawu has asked for the wisdom of the Perl Monks concerning the following question:

Hi I've cross compiled Perl for my MIPS based router using Perl-cross.

Basic tests work, however the IO module is failing for some tests, notably io_sel.t, io_sock.t.

Using the debugger on the target platform, I can see that one of the problems occurs (freezing) during a call to IO::Select::can_write(). Execution stops at line 122, the call to select(..). I'm still able to ctrl-c back to the Perl debugger

My understanding of Perl's internals is limited, so am looking for advice on how to diagnose what the issue is. I've successfully built and tested a c program which uses select so it's not as if the functionality is missing.

Would running perl through GDB be a good idea?

I've installed Perl in a non-standard location, but I have PERL5LIB set correctly and don't believe the issue is with paths, or missing modules - surely I would receive a warning/error msg if that was the case.

Looking at the config/build log doesn't offer any clues either. Have asked on stackoverflow but no one has bitten.. hopefully a monk here can advise

thank you

Comment on Perl-cross IO::Select problems
Select or Download Code
Re: Perl-cross IO::Select problems
by andal (Friar) on Mar 10, 2014 at 07:44 UTC

    Can you use strace to see which system calls are executed and with which arguments?

      I'm sorry for the slow reply, I stopped checking perlmonks for a reply after 5 days.

      Here is the strace for the dist/IO/t/io_sock.t test: http://pastebin.ca/2670056

      Looking through it, I'm not sure whether to be alarmed by all the illegal seeks or inappropriate ioctls. I can see the arguments for the system calls as bellow. This is a snippet of the full log above.

      4162 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 4 4162 ioctl(4, TIOCNXCL, 0x7f8dd7b0) = -1 EINVAL (Invalid argument) 4162 _llseek(4, 0, 0x7f8dd7d0, SEEK_CUR) = -1 ESPIPE (Illegal seek) 4162 ioctl(4, TIOCNXCL, 0x7f8dd7b0) = -1 EINVAL (Invalid argument) 4162 _llseek(4, 0, 0x7f8dd7d0, SEEK_CUR) = -1 ESPIPE (Illegal seek) 4162 fcntl64(4, F_SETFD, FD_CLOEXEC) = 0 4162 connect(4, {sa_family=AF_INET, sin_port=htons(50346), sin_addr=i +net_addr("127.0.0.1")}, 16) = 0 4161 <... stat64 resumed> 0x7f8dd740) = -1 ENOENT (No such file or d +irectory) 4162 write(4, "ok 3\n", 5 <unfinished ...> 4161 stat64("/media/9b24938d-ae9c-4776-98a2-ba1863c3efc3/usr/lib/perl +5/site_perl/5.18.2/IO/Select.pm", <unfinished ...> 4162 <... write resumed> ) = 5 4161 <... stat64 resumed> 0x7f8dd660) = -1 ENOENT (No such file or d +irectory) 4162 brk(0x801000 <unfinished ...> 4161 stat64("/media/9b24938d-ae9c-4776-98a2-ba1863c3efc3/usr/lib/perl +5/5.18.2/mips-linux/IO/Select.pmc", <unfinished ...> 4162 <... brk resumed> ) = 0x801000 4161 <... stat64 resumed> 0x7f8dd740) = -1 ENOENT (No such file or d +irectory) 4162 read(4, <unfinished ...> 4161 stat64("/media/9b24938d-ae9c-4776-98a2-ba1863c3efc3/usr/lib/perl +5/5.18.2/mips-linux/IO/Select.pm", {st_mode=S_IFREG|0444, st_size=824 +7, ...}) = 0 4161 open("/media/9b24938d-ae9c-4776-98a2-ba1863c3efc3/usr/lib/perl5/ +5.18.2/mips-linux/IO/Select.pm", O_RDONLY|O_LARGEFILE) = 4 4161 ioctl(4, TIOCNXCL, 0x7f8dd508) = -1 ENOTTY (Inappropriate ioc +tl for device) 4161 _llseek(4, 0, [0], SEEK_CUR) = 0 4161 brk(0x801000) = 0x801000 4161 read(4, "# IO::Select.pm\n#\n# Copyright (c"..., 8192) = 8192 4161 brk(0x803000) = 0x803000 4161 brk(0x804000) = 0x804000 4161 brk(0x805000) = 0x805000 4161 brk(0x806000) = 0x806000 4161 brk(0x807000) = 0x807000 4161 brk(0x808000) = 0x808000 4161 brk(0x80a000) = 0x80a000 4161 brk(0x80b000) = 0x80b000 4161 brk(0x80c000) = 0x80c000 4161 brk(0x80d000) = 0x80d000 4161 brk(0x80e000) = 0x80e000 4161 brk(0x80f000) = 0x80f000 4161 brk(0x810000) = 0x810000 4161 brk(0x811000) = 0x811000 4161 brk(0x812000) = 0x812000 4161 brk(0x814000) = 0x814000 4161 brk(0x815000) = 0x815000 4161 _llseek(4, 4259, [4259], SEEK_SET) = 0 4161 _llseek(4, 0, [4259], SEEK_CUR) = 0 4161 close(4) = 0 4161 getuid() = 0 4161 geteuid() = 0 4161 getgid() = 0 4161 getegid() = 0 4161 _newselect(8, [], NULL, NULL, {15, 0}) = 0 (Timeout) 4161 write(2, "accept failed: Connection timed "..., 89) = 89

      The arguments look ok to me, at least they're not corrupted somehow.

        I've also compiled perl using buildroot (which also uses perl-cross) and have compared the config.log files. One thing which leaps out is the buildroot perl doesn't enable Duselargefiles. I've modified my configure call to also disable large file support, but no improvement.

        The only other differences was a couple of floating point system calls being unavailable with my toolchain, which I'm ASSuming are unrelated to this.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2014-12-27 07:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls