Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Oct 2018 10:13:26 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 232501] lang/perl5.26: $^X is non-deterministic
Message-ID:  <bug-232501-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D232501

            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@FreeBSD.org
          Reporter: freebsd@oldach.net
             Flags: maintainer-feedback?(mat@FreeBSD.org)
          Assignee: mat@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 na=
mes
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 b=
een
used /last/ to run perl. Once all three had been called, the last one remai=
ns
sticky. Here's a quick test:

# reboot straight into single-user, don't run anything=20
# 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=20
# 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=20
# 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 h=
ard
links with soft links perl -> perl5 -> perl5.26.2?

This is seen on FreeBSD 11.2-STABLE r339287 amd64.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-232501-7788>