Page MenuHomePhabricator

Object of class ParserOptions could not be converted to string
Closed, DuplicatePublic

Description

Seen in fluorine:/a/mw-log/fatal.log:

2015-08-31 11:36:54 mw1250 ruwiki fatal ERROR: [a1e2fd55] /wiki/%D0%90%D0%BA%D1%81%D0%B8%D0%BE%D0%BC%D0%B0%D1%82%D0%B8%D0%BA%D0%B0_%D1%82%D0%B5%D0%BE%D1%80%D0%B8%D0%B8_%D0%BC%D0%BD%D0%BE%D0%B6%D0%B5%D1%81%D1%82%D0%B2   ErrorException from line 5822 of /srv/mediawiki/php-1.26wmf20/includes/parser/Parser.php: PHP Error: Object of class ParserOptions could not be converted to string {"exception":"[Exception ErrorException] (/srv/mediawiki/php-1.26wmf20/includes/parser/Parser.php:5822) PHP Error: Object of class ParserOptions could not be converted to string
[stacktrace]
#0 /srv/mediawiki/php-1.26wmf20/includes/parser/Parser.php(5822): MWExceptionHandler::handleError(integer, string, string, integer)
#1 /srv/mediawiki/php-1.26wmf20/includes/parser/Parser.php(1333): Parser->replaceTransparentTags(string)
#2 /srv/mediawiki/php-1.26wmf20/includes/parser/Parser.php(442): Parser->internalParseHalfParsed(string, boolean, boolean)
#3 /srv/mediawiki/php-1.26wmf20/includes/StubObject.php(105): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#4 /srv/mediawiki/php-1.26wmf20/includes/StubObject.php(129): StubObject->_call(string, array)
#5 /srv/mediawiki/php-1.26wmf20/includes/content/WikitextContent.php(331): StubObject->__call(string, array)
#6 /srv/mediawiki/php-1.26wmf20/includes/content/AbstractContent.php(497): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
#7 /srv/mediawiki/php-1.26wmf20/includes/poolcounter/PoolWorkArticleView.php(140): AbstractContent->getParserOutput(Title, integer, ParserOptions)
#8 /srv/mediawiki/php-1.26wmf20/includes/poolcounter/PoolCounterWork.php(123): PoolWorkArticleView->doWork()
#9 /srv/mediawiki/php-1.26wmf20/includes/page/Article.php(676): PoolCounterWork->execute()
#10 /srv/mediawiki/php-1.26wmf20/includes/actions/ViewAction.php(44): Article->view()
#11 /srv/mediawiki/php-1.26wmf20/includes/MediaWiki.php(456): ViewAction->show()
#12 /srv/mediawiki/php-1.26wmf20/includes/MediaWiki.php(255): MediaWiki->performAction(Article, Title)
#13 /srv/mediawiki/php-1.26wmf20/includes/MediaWiki.php(683): MediaWiki->performRequest()
#14 /srv/mediawiki/php-1.26wmf20/includes/MediaWiki.php(474): MediaWiki->main()
#15 /srv/mediawiki/php-1.26wmf20/index.php(41): MediaWiki->run()
#16 /srv/mediawiki/w/index.php(3): include(string)
#17 {main}

Related Objects

Event Timeline

ori raised the priority of this task from to High.
ori updated the task description. (Show Details)
ori subscribed.

It's difficult to see how that could have happened, given that mTransparentTagHooks is empty on ruwiki, and grepping php-1.26wmf20 core and extensions shows no callers of setTransparentTagHook(). extractTagsAndParams() can match and return HTML comments when given an empty array for $elements, but then where does the ParserOptions come from? And it's not always a ParserOptions:

$ zgrep 'Parser.php:5822' archive/fatal.log-20150831.gz | perl -ne 'while (<>) {if (/Object of class (\w+)/ ) {print "$1\n"; } }' | sort | uniq -c | sort -rn
   49 ParserOptions
   16 ParserOutput
   16 Article
    2 WikiPage
    2 Revision

It seems like the most likely explanation is an HHVM bug, perhaps VM stack corruption or a dangling pointer which is used in a predictable way. The logs show different servers being involved, with a burst of 5-10 errors from each server. Each burst lasts for less than a second: P1956

It seems that the bursts are terminated by a segfault:

Aug 30 09:00:05 mw1254 hhvm: Core dumped: Segmentation fault
Aug 30 15:41:46 mw1181 hhvm: Core dumped: Segmentation fault
Aug 30 16:56:25 mw1042 hhvm: Core dumped: Segmentation fault

Those three log entries correlate with the first three bursts in the fatal log.