[Bug 232501] lang/perl5.26: $^X is non-deterministic

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Oct 21 10:13:28 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=232501

            Bug ID: 232501
           Summary: lang/perl5.26: $^X is non-deterministic
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: mat at FreeBSD.org
          Reporter: freebsd at oldach.net
             Flags: maintainer-feedback?(mat at FreeBSD.org)
          Assignee: mat at FreeBSD.org

This popped up in bug #232146. perl, perl5 and perl5.26.2 are hard links to the
same image. When asking $^X ("the name by which this perl interpreter was
invoked") it appears that the output depends on which of the three image names
had been used recently. All potential invocations of perl, perl5, or perl5.26.2
appear to show up over time as $^X.

The behavior of $^X actually depends on which of the three hard links had been
used /last/ to run perl. Once all three had been called, the last one remains
sticky. Here's a quick test:

# reboot straight into single-user, don't run anything 
# perl -e 'print $^X, "\n"'
/usr/local/bin/perl
# perl5 -e 'print $^X, "\n"'
/usr/local/bin/perl5
# perl5.26.2 -e 'print $^X, "\n"'
/usr/local/bin/perl5.26.2
# perl -e 'print $^X, "\n"'
/usr/local/bin/perl5.26.2
# perl5 -e 'print $^X, "\n"'
/usr/local/bin/perl5.26.2
# perl5.26.2 -e 'print $^X, "\n"'
/usr/local/bin/perl5.26.2
# perl -e 'print $^X, "\n"'
/usr/local/bin/perl5.26.2
# perl5 -e 'print $^X, "\n"'
/usr/local/bin/perl5.26.2
# perl5.26.2 -e 'print $^X, "\n"'
/usr/local/bin/perl5.26.2

# reboot straight into single-user, don't run anything 
# perl5.26.2 -e 'print $^X, "\n"'
/usr/local/bin/perl5.26.2
# perl5 -e 'print $^X, "\n"'
/usr/local/bin/perl5
# perl -e 'print $^X, "\n"'
/usr/local/bin/perl
# perl5.26.2 -e 'print $^X, "\n"'
/usr/local/bin/perl
# perl5 -e 'print $^X, "\n"'
/usr/local/bin/perl
# perl -e 'print $^X, "\n"'
/usr/local/bin/perl
# perl5.26.2 -e 'print $^X, "\n"'
/usr/local/bin/perl
# perl5 -e 'print $^X, "\n"'
/usr/local/bin/perl
# perl -e 'print $^X, "\n"'
/usr/local/bin/perl

# reboot straight into single-user, don't run anything 
# perl -e 'print $^X, "\n"'
/usr/local/bin/perl
# perl5.26.2 -e 'print $^X, "\n"'
/usr/local/bin/perl5.26.2
# perl5 -e 'print $^X, "\n"'
/usr/local/bin/perl5
# perl -e 'print $^X, "\n"'
/usr/local/bin/perl5
# perl5.26.2 -e 'print $^X, "\n"'
/usr/local/bin/perl5
# perl5 -e 'print $^X, "\n"'
/usr/local/bin/perl5
# perl -e 'print $^X, "\n"'
/usr/local/bin/perl5
# perl5.26.2 -e 'print $^X, "\n"'
/usr/local/bin/perl5
# perl5 -e 'print $^X, "\n"'
/usr/local/bin/perl5

In other words, use of $^X is non-deterministic in FreeBSD.

I suspect the canonical fix would be to replace the perl/perl5/perl5.26.2 hard
links with soft links perl -> perl5 -> perl5.26.2?

This is seen on FreeBSD 11.2-STABLE r339287 amd64.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list