New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed test dist/IO/t/cachepropagate-unix on OS X with Perl 5.22 (regression from 5.20) #15310
Comments
From mojca@macports.orgSince Perl 5.22 (I only tested 5.22.1 and 5.22.2) I'm experiencing a dist/IO/t/cachepropagate-unix ................................. This happens on Mac OS X (I tested on 10.7, but is most likely present I opened a ticket at See also ticket #128093. Mojca |
From @jkeenanOn Sat May 07 07:40:21 2016, mojca@macports.org wrote:
Please attach to this story the results of 'perl -V' performed in the build where you experienced this problem. Thank you very much. -- |
The RT System itself - Status changed from 'new' to 'open' |
From mojca.miklavec.lists@gmail.comDne Ned 08 Maj 2016 08:13:11 je jkeenan napisal:
$ perl5.22 -V Characteristics of this binary (from libperl): $ perl5.24 -V Characteristics of this binary (from libperl): |
From @tonycozOn Sat May 07 07:40:21 2016, mojca@macports.org wrote:
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 (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: you might try changing that to: # now test datagram sockets: and see if you get a useful diagnostic. To test just the single test file: ./Configure ... your flags here ... Tony |
From mojca.miklavec.lists@gmail.comFirst some unrelated stuff. I tried running with harness in the same (or at least similar way). cd work/dir/t/ But I either get Can't locate TAP/Harness.pm in @INC (you may need to install the TAP::Harness module) (@INC contains: ../lib) at harness line 13. Or if I uncomment setting @INC in harness, I get Could not execute (../../t/perl -I../.. -MTestInit=U2T t/cachepropagate-unix.t): open3: exec of ../../t/perl -I../.. -MTestInit=U2T t/cachepropagate-unix.t failed: No such file or directory at /opt/local/lib/perl5/vendor_perl/5.24/TAP/Parser/Iterator/Process.pm line 165. In the first attempt (just running "perl" or "prove") I don't get any additional debug information after making that change, but I'll try to dig further. The problem is that the datagram socket gets created. I tried to change the following line to ok(defined( and that one prints "Illegal seek". ok 5 - spawned a child # Failed test 'domain match' # Failed test 'type match' |
From mojca.miklavec.lists@gmail.comDne Pon 16 Maj 2016 18:34:51 je tonyc napisal:
Now I'm super confused: $ sudo port -v build perl5.24 Weird enough the tests succeed if I run them "isolated" from MacPorts. I started wondering if sandboxing has anything to do with the failure. I need to consult other experienced MacPorters. (Then again I wonder why this wasn't a problem back in 5.20.) |
From mojca.miklavec.lists@gmail.comI really need some explanation and further help here. These are two commands that are being run one after another in the same folder. "perl5.24" is the executable that was built with exactly the same flags and in exactly the same way, but it is already installed on the system. Running the test suite automatically fails; running "./perl harness ..." from the "t" subfolder succeeds (even though it results in "Illegal seek" when I print "$!"); running the installed perl5.24 or prove-5.24 fails with "Illegal seek". $ perl-5.24.0/t> ./perl harness -v ../dist/IO/t/cachepropagate-unix.t $ perl-5.24.0/t> prove-5.24 -v ../dist/IO/t/cachepropagate-unix.t # Failed test 'domain match' # Failed test 'type match' # Failed test 'domain match' # Failed test 'type match' Test Summary Report ../dist/IO/t/cachepropagate-unix.t (Wstat: 1024 Tests: 15 Failed: 4) |
From mojca.miklavec.lists@gmail.comSee also a slightly different problem (I can reproduce it on 10.7): https://trac.macports.org/ticket/51327#comment:6 |
From @tonycozOn Tue May 17 04:35:52 2016, mojca.miklavec.lists@gmail.com wrote:
Your theory about the temp path could be it, that path is 99 characters long. The definition of sockaddr_un is: struct sockaddr_un { (from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/un.h) So it seems likely you're over 103 characters, since there's also a temp directory name and "/testsock" included in the final socket path. Socket::pack_sockaddr_un() appears to fit what it can into sun_path and discard the rest of the path, which seems like a bug to me. Changing pack_sockaddr_un() so it can fail would require changes to anything that calls it to handle the error. Tony |
From @tonycozOn Tue Jun 14 23:21:58 2016, tonyc wrote:
Opened https://rt.cpan.org/Ticket/Display.html?id=116819 Tony |
From @tonycozOn Tue Jun 14 23:21:58 2016, tonyc wrote:
Here's a different approach, which I hope is future proof. Tony |
From @tonycoz0001-perl-128095-check-pack_sockaddr_un-s-return-value.patchFrom 4b09738d6af9f9ed8890fd7af0868339e4a3fda9 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Mon, 15 Aug 2016 10:39:22 +1000
Subject: (perl #128095) check pack_sockaddr_un()'s return value
pack_sockaddr_un() silently truncates the supplied path if it won't
fit into the sun_path member of sockaddr_un.
This may change in the future, but for now check the path in the
sockaddr matches the desired path, and skip if it doesn't.
---
dist/IO/t/cachepropagate-unix.t | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/dist/IO/t/cachepropagate-unix.t b/dist/IO/t/cachepropagate-unix.t
index e3e438e..20c70dd 100644
--- a/dist/IO/t/cachepropagate-unix.t
+++ b/dist/IO/t/cachepropagate-unix.t
@@ -14,10 +14,21 @@ use Test::More;
plan skip_all => "UNIX domain sockets not implemented on $^O"
if ($^O =~ m/^(?:qnx|nto|vos|MSWin32|VMS)$/);
-plan tests => 15;
-
my $socketpath = catfile(tempdir( CLEANUP => 1 ), 'testsock');
+# check the socketpath fits in sun_path.
+#
+# pack_sockaddr_un() just truncates the path, this may change, but how
+# it will handle such a condition is undetermined (and we might need
+# to work with older versions of Socket outside of a perl build)
+# https://rt.cpan.org/Ticket/Display.html?id=116819
+
+my $name = eval { pack_sockaddr_un($socketpath) };
+defined $name && (unpack_sockaddr_un($name))[0] eq $socketpath
+ or plan skip_all => "socketpath too long for sockaddr_un";
+
+plan tests => 15;
+
# start testing stream sockets:
my $listener = IO::Socket::UNIX->new(Type => SOCK_STREAM,
Listen => 1,
--
2.1.4
|
From mojca@macports.orgOn 15 August 2016 at 02:41, Tony Cook via RT wrote:
Thank you. I cannot judge about the contents of the patch, but I can Mojca |
From @tonycozOn Wed Aug 17 18:31:57 2016, mojca@macports.org wrote:
Thanks, applied to blead as 5b549d1. Tony |
@tonycoz - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.26.0, this and 210 other issues have been Perl 5.26.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
From mojca@macports.orgWhat about backporting the patch to 5.24? |
Migrated from rt.perl.org#128095 (status was 'resolved')
Searchable as RT128095$
The text was updated successfully, but these errors were encountered: