Page MenuHomePhabricator

Long numeric lines kill the parser
Closed, ResolvedPublic

Description

Author: nat

Description:
Cannot obtain a diff page

To exhibit it:
Go to Wikipedia EN
Try to obtain the diff between:

  1. (cur) (last) 2006-03-18T08:06:09 67.49.215.239
  2. (cur) (last) 2006-03-18T08:03:39 Rory096

Problem: it simply hangs the serving process (till timeout)

Note: the article ('page') contains a huge line. It seems to me that it somewhat
breaks the parser


Version: 1.9.x
Severity: normal
URL: http://en.wikipedia.org/w/index.php?title=Golden_ratio&diff=44320111&oldid=44319915

Details

Reference
bz8689

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:33 PM
bzimport set Reference to bz8689.
bzimport added a subscriber: Unknown Object (MLST).

nat wrote:

(Note: the article is 'Golden ratio')

Trying to access to the URL associated to this bug seems not possible ('Read
Timeout' error) with Iceweasel (Firefox) 2.0.0.1 (Debian x86 package:
2.0.0.1+dfsg-2) and lynx (2.8.5-2sarge2.), either loged under a WP account or as
anon.

I get a 500 error, because on of the revisions in question does not appear to be available.

http://en.wikipedia.org/w/index.php?title=Golden_ratio&oldid=44320111

Perhaps this is due to bug 20757 ?

I get a 500 error, because on of the revisions in question does not appear to
be available.

http://en.wikipedia.org/w/index.php?title=Golden_ratio&oldid=44320111

Perhaps this is due to bug 20757 ?

No. The revision text is available
http://en.wikipedia.org/w/index.php?title=Golden_ratio&oldid=44320111&action=edit

As Nat points out, that seems parser related.

You can view the diff with http://en.wikipedia.org/w/index.php?title=Golden_ratio&diff=44320111&oldid=44319915&diffonly=1

That line produces:
PHP Fatal error: Balloc() allocation exceeds list boundary in includes/parser/Parser.php on line 737

where the relevant lines are:

		foreach ( $lines as $outLine ) {
			$line = trim( $outLine );

			if ( $line == '' ) { # empty line, go to next line
				$out .= $outLine."\n";
				continue;
			}

The error seems to be comparing a numeric string of 2000016 characters ($line) with the empty string with the == equal. It is fixed by doing a strict comparison (===). Then the error moves at a different point.