Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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

Replies are listed 'Best First'.
Re: Perl-cross IO::Select problems
by andal (Hermit) 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:

      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("")}, 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/", <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/", {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/", 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, "#\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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1077156]
Approved by GotToBTru
Front-paged by Corion
[marto]: CCTV footage of the joke gone wrong is used in educational materials now IIRC
[ambrus]: oiskuu: definitely not silly. have you ever tried to remove cat hair or dog hair from clothes? for many clothes, it's pretty hard, and running the washing machine with a cat inside would get the hair on everything.
[oiskuu]: YM, I'm interested in your questions... maybe start a a thread at polls.
[oiskuu]: marto, it ended badly? I doubt the power is easy to plug at those installations?
[marto]: oiskuu sadly yes
[Your Mother]: My cat used to climb into the freezer when I opened it. Once I closed it and left him for 5 minutes hoping to disuade the habit. When I opened it expecting a cat eager to never return he just stared at me. Had to pull him out.
[Your Mother]: oiskuu, I think we should just be friends.
[marto]: the 'cool' place to hang out
[Your Mother]: ♫ Caffeine, caffeine, caffeine, caffeine. There will be answer, caffeine. ♫ ♬
[oiskuu]: Ahh, old cats with rheuma. I think (s)he was saying, "dude, NOT cold enough."

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (12)
As of 2017-12-18 15:02 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (488 votes). Check out past polls.