Opened 9 years ago

Closed 8 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) 8 years ago.

Download all attachments as: .zip

Change History (11)

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

As an added bonus, here are the problems with 5.24 (which should go into a different ticket):

env MACOSX_DEPLOYMENT_TARGET=10.7 /usr/bin/clang -o libperl.dylib -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -fstack-protector -dynamiclib                             -compatibility_version 				5.24.0 			     -current_version 				5.24.0 			     -install_name /opt/local/lib/perl5/5.24/darwin-thread-multi-2level/CORE/libperl.dylib op.o     perl.o  gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o   DynaLoader.o -lpthread -ldl -lm -lutil -lc 
Undefined symbols for architecture x86_64:
  "_environ", referenced from:
      _perl_construct in perl.o
      _S_init_postdump_symbols in perl.o
      _Perl_my_setenv in util.o
      _Perl_my_clearenv in util.o
      _Perl_init_i18nl10n in locale.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libperl.dylib] Error 1
make: *** Waiting for unfinished jobs....
Version 0, edited 9 years ago by mojca (Mojca Miklavec) (next)

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

Description: modified (diff)

comment:3 Changed 8 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 8 years ago by mojca (Mojca Miklavec)

Port: perl5.24 added

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

Cc: cal@… added

comment:6 Changed 8 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 8 years ago by mojca (Mojca Miklavec)

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

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

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

I committed r151547.

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

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