Skip Menu |
 

This queue is for tickets about the Text-Tabs+Wrap CPAN distribution.

Report information
The Basics
Id: 124024
Status: open
Priority: 0/
Queue: Text-Tabs+Wrap

People
Owner: Nobody in particular
Requestors: andy [...] andybev.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: "This shouldn't happen" does happen with very long lines
Date: Sat, 6 Jan 2018 07:19:46 +0000
To: bug-Text-Tabs+Wrap [...] rt.cpan.org
From: Andrew Beverley <andy [...] andybev.com>
Download (untitled) / with headers
text/plain 383b
If using Text::Wrap with $huge = 'overflow' and very long lines without spaces, then the Perl regular expression capture limit of 32766 causes Text::Wrap to exit with "This shouldn't happen". The problem is that the conditional statement that should catch it does not, because the capture is greater than 32766. The attached patch fixes it for me, but I would welcome any feedback.

Message body is not shown because sender requested not to inline it.

Download (untitled) / with headers
text/plain 1.5k
Hi Andrew, On Sat Jan 06 02:20:36 2018, abeverley wrote: Show quoted text
> If using Text::Wrap with $huge = 'overflow' and very long lines without > spaces, then the Perl regular expression capture limit of 32766 causes > Text::Wrap to exit with "This shouldn't happen". The problem is that > the conditional statement that should catch it does not, because the > capture is greater than 32766.
something more complicated is going on here. To wit: $ time perl -e 'print length $1 if ("x" x 100_000_000) =~ /(.*)/' 100000000 real 0m0.288s user 0m0.141s sys 0m0.134s $ time perl -e 'print length $1 if ("x" x 100_000_000) =~ /(\X*)/' 32767 real 0m0.187s user 0m0.070s sys 0m0.110s $ time perl -e 'print length $1 if ("x" x 100_000_000) =~ /((?>\X*)*)/' 100000000 real 0m15.473s user 0m11.520s sys 0m3.449s Show quoted text
> The attached patch fixes it for me, but I would welcome any feedback.
That is the obvious spot fix for the problem, yes. And it clearly has better O(n) behaviour than my alternative workaround above. I intend to reconsider both the implementation of the Unicode support itself and the ensuing old/modern variant split of the codebase, though. So I’d prefer not to diverge the variants much more from each other, and the resulting unified codebase might very well not even exhibit the problem in the first place. That makes me reluctant to simply ship your fix. OTOH I don’t know how quickly I’ll be done with this and I might just ship the hotfix anyway as a holdover in the meantime. How urgent is this issue on your end?
Subject: Re: [rt.cpan.org #124024] "This shouldn't happen" does happen with very long lines
Date: Mon, 26 Feb 2018 18:43:08 +0000
To: bug-Text-Tabs+Wrap [...] rt.cpan.org
From: Andrew Beverley <andy [...] andybev.com>
Download (untitled) / with headers
text/plain 344b
On Sun, 25 Feb 2018 08:45:30 -0500 "Aristotle Pagaltzis via RT" wrote: Show quoted text
> How urgent is this issue on your end?
Thanks for the reply. It's not hugely urgent - I can workaround it for the time being. I just need to know that I'm not going to run into it in a couple of years when I deploy a new server and I've forgotten about the bug ;-) Andy


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.