-
Notifications
You must be signed in to change notification settings - Fork 560
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
substitution loop issue with long strings #14190
Comments
From @cpansproutI’m creating a ticket for this, so it is easier to track. In <CAH+_n-4R1tO7nxEu6ehRkNZfO+0reMdcU7wGK-YMF3SqHchoOw@mail.gmail.com> Edward Peschko wrote:
And in <CAH+_n-4-aiGqxHDOdwd9NB-xbGkGfaEMOjsGyeSSZKUEi6R-mw@mail.gmail.com> he wrote:
That’s exactly what’s happening. The sbu_iters and sbu_maxiters members defined in cop.h are of type I32. (And this bug is *old*. Perl 1 had a fixed limit of 10000. Perl 4 started calculating the maximum number of iterations based on the string length, fixing the bug, but in such a way that when 64-bit systems came along it resurfaced. So since Perl 4 the bug is as old as 64-bit systems.) We could fix this by changing those two struct members to SSize_t. But if that would enlarge the struct subst/struct blk union defined in cop.h, it might be worthwhile considering skipping the check altogether for long strings. After all, if substitution loops, it is because of a bug in perl; and if that bug does occur then it is likely to happen regardless of the length of the string. (Right?) So it will be caught even if the check is skipped for long strings. Now, to work around the bug, you would have to do a while() loop instead of substituting all at once. But that will still fail in 5.18 and earlier, because it was not until 5.20 that the regular expression gained support for strings longer than 2GB. Another thing you could do is split your string into smaller strings and concatenate them afterwards. But only you can tell whether that will work for your code. -- Father Chrysostomos |
From @jkeenanOn Mon Oct 27 21:40:18 2014, sprout wrote:
[snip]
[snip]
Father C, which of these two alternatives do you think we should pursue? (Or, are there others?)
Thank you very much. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @cpansproutOn Fri Nov 14 19:01:36 2014, jkeenan wrote:
That would depend on whether using 64-bit values to records the iterations enlarges the struct. I haven’t checked yet. -- Father Chrysostomos |
From @cpansproutFixed in 3c6ef0a. This turned out to be the same bug as #103260. -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'pending release' |
From @khwilliamsonThanks for submitting this ticket The issue should be resolved with the release today of Perl v5.22. 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#123071 (status was 'resolved')
Searchable as RT123071$
The text was updated successfully, but these errors were encountered: