in reply to Perl-cross IO::Select problems

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

Replies are listed 'Best First'.
Re^2: Perl-cross IO::Select problems
by ragawu (Initiate) on Mar 21, 2014 at 16:18 UTC
    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.

        Ok I think I'm being too precious about these tests passing, I now see that the reason the Socket.t test fails is that my router doesn't listen on port 7 - hence 'connection refused' in the strace.

        Looking through strace on the actual failing application, I can see the issue is missing modules. LWP not finding Net::HTTP being one of them. I will rebuild my perl installation and monitor strace for missing modules.

        I presumed I'd get some sort of warning on the command line, sorry I'm still an amateur with perl..