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
The glob() function is exponential on pathological patterns #15964
Comments
From @avarCreated by @avarRuss Cox has published a paper describing pathological cases in Here's the stand-alone Perl program he used to test: Running that as instructed on blead compiled just now gives; $ ./perl -Ilib /tmp/tglob.pl Perl Info
|
From @shlomifOn Tue, 25 Apr 2017 00:55:40 -0700, avar wrote:
On Mageia Linux v6 x86-64, I am unable to reproduce the problem. With this program: #!/usr/bin/perl use Time::HiRes qw(clock_gettime); $| = 1; I am getting these results: shlomif@telaviv1:~$ /home/shlomif/apps/perl/bleadperl/bin/perl5.26.0 glob.pl This is perl 5, version 26, subversion 0 (v5.26.0 (v5.25.11-29-g4b05bc8)) built for x86_64-linux-thread-multi Copyright 1987-2017, Larry Wall Perl may be copied only under the terms of either the Artistic License or the Complete documentation for Perl, including FAQ lists, should be found on shlomif@telaviv1:~$ /usr/bin/perl works fine as well. |
The RT System itself - Status changed from 'new' to 'open' |
From @pjcjOn Tue, Apr 25, 2017 at 03:58:13AM -0700, Shlomi Fish via RT wrote:
Did you remember to create the test file? -- |
From @iabynOn Tue, Apr 25, 2017 at 03:58:13AM -0700, Shlomi Fish via RT wrote:
I can reproduce it with blead an linux. Did you create the file /tmp/glob/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa as well as the directory /tmp/glob? -- |
From @shlomifOn Tue, 25 Apr 2017 05:01:42 -0700, davem wrote:
Sorry - I missed that part - I thought the program was self-contained. Now I can reproduce that problem with the 'a'x100 file created, and furthermore «shlomif@telaviv1:/tmp/glob$ bash -c 'echo a*a*a*a*a*a*a*a*b'» hangs. |
From @demerphqOn 25 April 2017 at 09:55, Ævar Arnfjörð Bjarmason
For some time now we have used the code in File::Glob for glob(). The code involved in this slowdown is in ext/File-Glob/bsd_glob.c in Yves |
From @demerphqOn 25 April 2017 at 14:48, demerphq <demerphq@gmail.com> wrote:
Turn out I am wrong, and this was a fine trade off. Implementing (that is a branch not blead) -- |
From @jkeenanOn Tue, 25 Apr 2017 07:55:40 GMT, avar wrote:
Similar results in a FreeBSD-10.3 VM: ##### $ perl 131211-glob.pl |
From @demerphqOn 25 April 2017 at 15:20, demerphq <demerphq@gmail.com> wrote:
Timing data with my patch: $ ./perl -Ilib t.pl Timing data without: $ perl t.pl Yves -- |
From @jkeenanOn Tue, 25 Apr 2017 13:26:46 GMT, demerphq wrote:
I got similar improvements with your branch. On Linux: ##### fixup File::Glob degenerate matching $ ./perl -Ilib ~/learn/perl/p5p/131211-glob.pl On the same FreeBSD-10.3 VM mentioned earlier: ##### -- |
From @demerphqOn 25 April 2017 at 15:55, James E Keenan via RT
Thanks. FWIW, i realize my patch is wrong tho. Close but no cigar. I cheers, -- |
From @khwilliamsonOn Tue, 25 Apr 2017 07:22:34 -0700, demerphq wrote:
I wasn't following this closely, but a patch got applied as 0db967b without the ticket being closed, and now os390 is failing # Failed test 'tried all the patterns without bailing out' -- |
From @demerphqOn 11 July 2017 at 04:32, Karl Williamson via RT
That is very weird. Does os390 use this code? Yves -- |
From @khwilliamsonOn 07/11/2017 08:44 AM, demerphq wrote:
It looks like the hints file defines PERL_EXTERNAL_GLOB, so unless I'm |
From @demerphqOn 11 July 2017 at 18:18, Karl Williamson <public@khwilliamson.com> wrote:
I would be happy if you were to apply that. On the other hand, if that Yves -- |
From @khwilliamsonOn 07/11/2017 10:21 AM, demerphq wrote:
But there is a reason for them not using ours. ISTR the expansions have |
From @demerphqOn 11 July 2017 at 18:37, Karl Williamson <public@khwilliamson.com> wrote:
Hmm. Well I guess I cant be responsible for fixing that. ;-) Yves -- |
From @khwilliamsonOn 07/11/2017 10:52 AM, demerphq wrote:
I have now pushed a commit to blead that skips this test if ccflags has Is there a reason this ticket hasn't been closed? |
From @iabynOn Thu, Jul 13, 2017 at 10:45:08PM -0600, Karl Williamson wrote:
There was an issue with ext/File-Glob/t/rt131211.t intermittently failing -- |
@iabyn - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release yesterday of Perl 5.28.0, this and 185 other issues have been Perl 5.28.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' |
Migrated from rt.perl.org#131211 (status was 'resolved')
Searchable as RT131211$
The text was updated successfully, but these errors were encountered: