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

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

Thread Previous | Thread Next
From:
Tony Cook
Date:
October 29, 2017 00:36
Subject:
Re: [perl #132334] In Perl 5.26 and above, the /o modifier has sideeffects on split
Message ID:
20171029003601.qo3nyjbegudyg5se@mars.tony.develop-help.com
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.

> 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

Thread Previous | 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