Page MenuHomePhabricator

Fatal error: Balloc() allocation exceeds list boundary in extensions/Lingo/LingoParser.php on line 164
Closed, ResolvedPublic

Description

Fatal error: Balloc() allocation exceeds list boundary in /srv/vagrant/mediawiki/extensions/Lingo/LingoParser.php on line 164

Call Stack:

  0.0005     253272   1. {main}() /srv/vagrant/mediawiki/tests/phpunit/phpunit.php:0
 19.2451   51397744   2. MediaWikiPHPUnitCommand::main() /srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160
 19.2451   51410232   3. PHPUnit_TextUI_Command->run() /srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
206.2882  275748416   4. PHPUnit_TextUI_TestRunner->doRun() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:176
206.4292  276064048   5. PHPUnit_Framework_TestSuite->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php:350
207.1311  276066296   6. PHPUnit_Framework_TestSuite->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:709
694.4479  361450592   7. PHPUnit_Framework_TestSuite->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:709
694.4480  361452472   8. PHPUnit_Framework_TestSuite->runTest() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:749
694.4480  361452952   9. MediaWikiTestCase->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:779
694.4481  361453264  10. PHPUnit_Framework_TestCase->run() /srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
694.4481  361453752  11. PHPUnit_Framework_TestResult->run() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:783
694.4483  361456112  12. PHPUnit_Framework_TestCase->runBare() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php:648
694.4573  361332272  13. PHPUnit_Framework_TestCase->runTest() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:838
694.4573  361333056  14. ReflectionMethod->invokeArgs() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:988
694.4573  361333216  15. ExtraParserTest->testLongNumericLinesDontKillTheParser() /srv/vagrant/mediawiki/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:988
694.4711  363367720  16. Parser->parse() /srv/vagrant/mediawiki/tests/phpunit/includes/ExtraParserTest.php:44
695.5422  367051048  17. wfRunHooks() /srv/vagrant/mediawiki/includes/parser/Parser.php:406
695.5422  367051096  18. Hooks::run() /srv/vagrant/mediawiki/includes/GlobalFunctions.php:4031
695.5422  367052160  19. call_user_func_array() /srv/vagrant/mediawiki/includes/Hooks.php:207
695.5422  367052760  20. LingoHooks::parse() /srv/vagrant/mediawiki/includes/Hooks.php:207
695.5431  367052760  21. LingoParser::parse() /srv/vagrant/mediawiki/extensions/Lingo/LingoHooks.php:49
695.5431  367052760  22. LingoParser->realParse() /srv/vagrant/mediawiki/extensions/Lingo/LingoParser.php:54

Version: master
Severity: normal

Details

Reference
bz68710
Related Changes in Gerrit:

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:42 AM
bzimport set Reference to bz68710.
bzimport added a subscriber: Unknown Object (MLST).

I need more info, please.
What versions of php, webserver, MW, Lingo.
Also processor and os, please.

$ php5 --version
PHP 5.5.9-1ubuntu4.3 (cli) (built: Jul 7 2014 16:36:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

$ uname -a
Linux nemobis 3.13.0-29-generic #53-Ubuntu SMP Wed Jun 4 21:00:20 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

MediaWiki-Vagrant defaults, MW master, Lingo master.

Curious. I don't see how that line could possibly trigger an error:
https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FLingo/1af144074f5e12bbee10f0e72aabff0ccd69b36c/LingoParser.php#L164

Googling for the error message does not yield much. Seems that there are some versions of PHP floating around that are buggy (hence the question for os and processor), but nothing specific, really.

I'll try debugging it, but I am not sure I can do anything.

Foxtrott set Security to None.
Foxtrott unsubscribed.

Here's one possibility:

php > var_dump( '1.' . str_repeat( '1', 1000000 ) == '' );
PHP Fatal error:  Balloc() allocation exceeds list boundary in php shell code on line 1

In the MediaWiki parser, this was worked around a while back (see T10689) by replacing == with ===.

Foxtrott triaged this task as Medium priority.Nov 28 2014, 11:40 AM

Change 176462 had a related patch set uploaded (by Foxtrott):
Fix "Balloc() allocation exceeds list boundary"

https://gerrit.wikimedia.org/r/176462

Patch-For-Review

Change 176462 merged by Foxtrott:
Fix "Balloc() allocation exceeds list boundary"

https://gerrit.wikimedia.org/r/176462

Thanks for the hint. So that error is probably a result of PHP trying to convert a string into a numeric value in order to compare it.