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
failure when line length approaches 2^30 characters #10212
Comments
From mbmiller+m@gmail.comThis bug is highly replicable. See the attached perlbug -d output, but we The problem is that perl fails when line length approaches 2^30 characters $ perl -pi -e 'BEGIN{undef $/} ; s/\A/ID /' foo.txt ...with this result: $ ls -l foo.txt That is, zero bytes remain from a 1.5 GB file. (I know that I should have $ head -c 1073741818 foo.txt | perl -pe 's/./AB/' > bar.txt That did not fail, so I tried this: $ head -c 1073741819 foo.txt | perl -pe 's/./AB/' > bar.txt But that failed (with the same "Substitution ... chunk 1." message as Of course, 2^30 = 1073741824, which happens to be exactly 5 bytes greater cc: three people who helped me figure this out Mike -- |
From mbmiller+m@gmail.comFlags: This perlbug was built using Perl v5.8.3 - Fri Jul 11 14:54:19 UTC 2008 Site configuration information for perl v5.8.3: Configured by abuild at Fri Jul 11 14:47:00 UTC 2008. Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration: Locally applied patches: @INC for perl v5.8.3: Environment for perl v5.8.3: |
From mbmiller+m@gmail.comHello Perl Debuggers-- One of our supercomputing staff looked into this and the origin of the Mike Date: Fri, 5 Mar 2010 11:05:35 -0600 Hi Mike, I took a look into this and basically perl thinks you have an infinite From pp_hot.c in the perl src: I32 iters = 0; maxiters = 2 * slen + 10; /* We can match twice at each if (iters++ > maxiters) So assuming signed ints, slen can be (2^31 - 10) / 2 which is exactly what To do what you want to do, something like this should be a (faster) work perl -pi -e 'print "ID " if $. == 1' foo.txt Mark On Thu, 4 Mar 2010, perlbug-followup@perl.org wrote:
|
From mbmiller+m@gmail.comHello PerlBug People-- We never received a reply to this message from a month ago. We are Thanks. Mike On Fri, 5 Mar 2010, Mike Miller wrote:
Please note that I am using a new email address: mbmiller+m@gmail.com. |
From @iabynOn Mon, Apr 05, 2010 at 03:05:39PM -0500, Mike Miller wrote:
Sorry that no-one replied. We tend to have a lot of bugs reports and not -- |
The RT System itself - Status changed from 'new' to 'open' |
From @ikegamiOn Tue, Apr 6, 2010 at 7:32 AM, Dave Mitchell <davem@iabyn.com> wrote:
Seems the OP actually talks about an infinite loop when maxiters = 2 * slen + 10; overflows. It's hard to tell because he didn't include any code or any |
From @ikegamiOn Tue, Apr 6, 2010 at 11:48 AM, Mike Miller
My apologies, I was looking at a reply thinking it was the OP. |
From mbmiller+m@gmail.comOn Tue, 6 Apr 2010, Eric Brine wrote:
What sort of code are you missing? My original post is below. It Thanks. Mike Date: Thu, 4 Mar 2010 15:28:47 -0600 (CST) This bug is highly replicable. See the attached perlbug -d output, but we The problem is that perl fails when line length approaches 2^30 characters $ perl -pi -e 'BEGIN{undef $/} ; s/\A/ID /' foo.txt ...with this result: $ ls -l foo.txt That is, zero bytes remain from a 1.5 GB file. (I know that I should have $ head -c 1073741818 foo.txt | perl -pe 's/./AB/' > bar.txt That did not fail, so I tried this: $ head -c 1073741819 foo.txt | perl -pe 's/./AB/' > bar.txt But that failed (with the same "Substitution ... chunk 1." message as Of course, 2^30 = 1073741824, which happens to be exactly 5 bytes greater cc: three people who helped me figure this out Mike -- |
From mbmiller+m@gmail.comFlags: This perlbug was built using Perl v5.8.3 - Fri Jul 11 14:54:19 UTC 2008 Site configuration information for perl v5.8.3: Configured by abuild at Fri Jul 11 14:47:00 UTC 2008. Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration: Locally applied patches: @INC for perl v5.8.3: Environment for perl v5.8.3: |
Migrated from rt.perl.org#73306 (status was 'open')
Searchable as RT73306$
The text was updated successfully, but these errors were encountered: