Opened 4 years ago

Closed 4 years ago

#51327 closed defect (fixed)

perl5.22: failed test dist/IO/t/cachepropagate-unix

Reported by: mojca (Mojca Miklavec) Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: dbevans (David B. Evans), neverpanic (Clemens Lang), raimue (Rainer Müller)
Port: perl5.22 perl5.24

Description (last modified by mojca (Mojca Miklavec))

dist/IO/t/cachepropagate-unix ................................. #   Failed test 'datagram socket created'
#   at t/cachepropagate-unix.t line 75.
Can't call method "protocol" on an undefined value at t/cachepropagate-unix.t line 77.
# Looks like you planned 15 tests but ran 9.
# Looks like you failed 1 test of 9 run.
# Looks like your test exited with 48 just after 9.
FAILED at test 9

Running

prove-5.20 -l cachepropagate-unix.t 

works with Perl 5.20.3 and the tests fails with 5.22.1 as well.

Upstream report: https://rt.perl.org/Ticket/Display.html?id=128095

Attachments (1)

0001-perl-128095-check-pack_sockaddr_un-s-return-value.patch (1.6 KB) - added by mojca (Mojca Miklavec) 4 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 4 years ago by mojca (Mojca Miklavec)

As an added bonus, here are the problems with 5.24: #51330

Last edited 4 years ago by mojca (Mojca Miklavec) (previous) (diff)

comment:2 Changed 4 years ago by mojca (Mojca Miklavec)

Description: modified (diff)

comment:3 Changed 4 years ago by mojca (Mojca Miklavec)

Quoting Tony from the upstream ticket:

This test passes successfully on both 10.10.5 and 10.11.4 with a default build of blead perl (5.24 + unrelated changes).

pallas:t tony$ ./perl harness -v ../dist/IO/t/cachepropagate-unix.t 
../dist/IO/t/cachepropagate-unix.t .. 
1..15
ok 1 - stream socket created
ok 2 - protocol defined
ok 3 - domain defined
ok 4 - type defined
ok 5 - spawned a child
ok 6 - domain match
ok 7 # skip no Socket::SO_PROTOCOL
ok 8 - type match
ok 9 - datagram socket created
ok 10 - protocol defined
ok 11 - domain defined
ok 12 - type defined
ok 13 - domain match
ok 14 # skip no Socket::SO_PROTOCOL
ok 15 - type match
ok
All tests successful.
Files=1, Tests=15,  1 wallclock secs ( 0.01 usr  0.00 sys +  0.08 cusr  0.01 csys =  0.10 CPU)
Result: PASS

(not using MacPorts)

5.22.2 also passes.

I don't have 10.7 to test against.

Since I can't reproduce it here, you might try adding some diagnostic code, the code that's failing is:

    # now test datagram sockets:
    $listener = IO::Socket::UNIX->new(Type => SOCK_DGRAM,
                                      Local => $socketpath);
    ok(defined($listener), 'datagram socket created');

you might try changing that to:

    # now test datagram sockets:
    $listener = IO::Socket::UNIX->new(Type => SOCK_DGRAM,
                                      Local => $socketpath)
      or diag "datagram socket: $!";
    ok(defined($listener), 'datagram socket created');

and see if you get a useful diagnostic.

To test just the single test file:

  ./Configure ... your flags here ...
  make test TEST_ARGS=-v TEST_FILES=../dist/IO/t/cachepropagate-unix.t

Tony

comment:4 Changed 4 years ago by mojca (Mojca Miklavec)

Port: perl5.24 added

comment:5 Changed 4 years ago by mojca (Mojca Miklavec)

Cc: cal@… added

comment:6 Changed 4 years ago by raimue (Rainer Müller)

Cc: raimue@… added

On OS X 10.10, I can reproduce failures with both perl 5.20 and perl 5.24. Although I get "Address already in use" with the suggested diag added to the test code:

ok 8 - type match
# datagram socket: Address already in use
not ok 9 - datagram socket created
#   Failed test 'datagram socket created'

As far as I tested, this issue seems to be our custom $TMPDIR value in the environment, on my system that would be: TMPDIR=/opt/local/var/macports/build/_Users_raimue_src_macports_trunk_dports_lang_perl5/perl5.24/work/.tmp.

My wild guess is that the path is truncated somewhere due to its length, and the socket/bind syscall only sees a substring of the given path that triggers the "Address already in use" because this substring is an existing path. I can make the test also fail reproducibly with the following sequence. Although also the stream socket test #1 may fail sometimes (depending on path length?).

$ sudo port -v build perl5.24
$ cd $(port work perl5.24)/perl-5.24.0
$ sudo -u macports env TMPDIR=/tmp/$(perl -le 'print "A" x 150;') sh -c 'rm -rf $TMPDIR && mkdir $TMPDIR && make test TEST_ARGS=-v TEST_FILES=../dist/IO/t/cachepropagate-unix.t'

Changed 4 years ago by mojca (Mojca Miklavec)

comment:8 Changed 4 years ago by mojca (Mojca Miklavec)

I attached a patch (unmodified) with a potential fix for testing.

comment:9 Changed 4 years ago by mojca (Mojca Miklavec)

I committed r151547.

comment:10 Changed 4 years ago by mojca (Mojca Miklavec)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.