develooper Front page | perl.perl5.porters | Postings from October 2017

[perl #132334] In Perl 5.26 and above, the /o modifier has sideeffects on split

Thread Next
From:
James E Keenan via RT
Date:
October 29, 2017 13:52
Subject:
[perl #132334] In Perl 5.26 and above, the /o modifier has sideeffects on split
Message ID:
rt-4.0.24-26230-1509285145-851.132334-15-0@perl.org
On Sun, 29 Oct 2017 00:36:22 GMT, tonyc wrote:
> On Sat, Oct 28, 2017 at 06:35:12AM -0700, James E Keenan via RT wrote:
> > On Sat, 28 Oct 2017 08:10:56 GMT, tonyc wrote:
> > > On Sat, 21 Oct 2017 09:54:22 -0700, Harald.Joerg@arcor.de wrote:
> > > > "James E Keenan via RT" <perlbug-followup@perl.org> writes:
> > > >
> > > > > [...]
> > > > > Agreed. Building a threaded perl at tag v5.24.0 and running
> > > > > that test
> > > > > file, I get all tests PASSing.  My unthreaded perl-5.24.1 had a
> > > > > FAIL
> > > > > on the 4th test.
> > > > >
> > > > > So, is the original poster's test setup "correct" -- in the
> > > > > sense that
> > > > > having all 4 tests pass is the expected behavior?
> > > > >
> > > > > Harald.Joerg: Do you know which of your perl builds were
> > > > > threaded and
> > > > > which were not?
> > > >
> > > > Sure! I have to apologize: *with a non-threaded 5.24.3, the
> > > > fourth test
> > > > fails as well*.  I had run the 5.24 tests with Debian's system
> > > > perl,
> > > > which is threaded.  So, this isn't about the perl version, but
> > > > about
> > > > threaded/unthreaded builds.  Sorry for the confusion.  I did some
> > > > more
> > > > perlbrew installs and tests:
> > > >
> > > > The test succeeds with:
> > > >
> > > > (v5.26.1) built for x86_64-linux-thread-multi
> > > > (v5.24.1) built for x86_64-linux-gnu-thread-multi
> > > > (v5.20.2) built for x86_64-linux-gnu-thread-multi
> > > >
> > > > The test fails with:
> > > >     (v5.27.1) built for x86_64-linux
> > > >     (v5.26.1) built for x86_64-linux
> > > >     (v5.24.3) built for x86_64-linux
> > > >
> > > > The "gnu-thread" Perls are what's distributed with Debian 8/9,
> > > > all the
> > > > others are perlbrewed. Thanks for the clarification!
> > >
> > > This might have been fixed by
> > > 3cb4cde3dd4d2af2f5065053905708bffa5168f9
> > >
> > > Tony
> >
> > I believe it has been fixed.  Here are the results of running test
> > file at commit eecd4d1156438b131ac47c72b020788f66b6d178 on non-
> > threaded, then threaded builds on Linux.
> >
> > #####
> > [perl] 519 $ ./perl -Ilib -V | grep thread
> >     useithreads=undef
> >     libs=-lpthread -lnsl -ldb -ldl -lm -lcrypt -lutil -lc
> >     perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
> >  [perl] 520 $ ./perl -Ilib ~/learn/perl/p5p/132334-split.t
> > 1..4
> > ok 1 - Going to split 'ab' with ''
> > ok 2 - Resulting in ('a','b')
> > ok 3 - Going to split 'a;b' with ';'
> > ok 4 - Resulting in ('a','b')
> >
> >
> > #####
> > [perl] 523 $ ./perl -Ilib -V | grep thread
> >     archname=x86_64-linux-thread-multi
> >     config_args='-des -Dusedevel -Duseithreads'
> >     useithreads=define
> >     libs=-lpthread -lnsl -ldb -ldl -lm -lcrypt -lutil -lc
> >     perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
> >     /usr/local/lib/perl5/site_perl/5.27.6/x86_64-linux-thread-multi
> >     /usr/local/lib/perl5/5.27.6/x86_64-linux-thread-multi
> >  [perl] 524 $ ./perl -Ilib ~/learn/perl/p5p/132334-split.t
> > 1..4
> > ok 1 - Going to split 'ab' with ''
> > ok 2 - Resulting in ('a','b')
> > ok 3 - Going to split 'a;b' with ';'
> > ok 4 - Resulting in ('a','b')
> > #####
> >
> > Questions:
> >
> > 1. Are the tests added as part of
> > 3cb4cde3dd4d2af2f5065053905708bffa5168f9 sufficient to demonstrate
> > that the problem has been solved?  Or should we add a variant of the
> > test file above to the test suite?
> 
> A test specific this case might be useful.
> 

Test adapted from original poster's code added in commit 6e8135a4380966ca56b30d95854b54dc8d9c08d4.


> > 2. Should this be backported to 5.24 and 5.26?
> 
> No, it changes behaviour for non-threaded builds (when it doesn't
> crash.)
> 
> Tony

Marking ticket Resolved.  Thank you very much.
-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=132334

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About