Page MenuHomePhabricator

PHP Warning: preg_match(): Null byte in regex
Open, Needs TriagePublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   PHP Warning: preg_match(): Null byte in regex
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.7/includes/MagicWord.php(270)
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.37.0-wmf.7/includes/MagicWord.php(270): preg_match(string, string)
#2 /srv/mediawiki/php-1.37.0-wmf.7/extensions/ParserFunctions/includes/ParserFunctions.php(228): MagicWord->matchStartToEnd(string)
#3 /srv/mediawiki/php-1.37.0-wmf.7/includes/parser/Parser.php(3400): MediaWiki\Extensions\ParserFunctions\ParserFunctions::switch(Parser, PPFrame_Hash, array)
#4 /srv/mediawiki/php-1.37.0-wmf.7/includes/parser/Parser.php(3085): Parser->callParserFunction(PPFrame_Hash, string, array)
#5 /srv/mediawiki/php-1.37.0-wmf.7/includes/parser/PPFrame_Hash.php(263): Parser->braceSubstitution(array, PPFrame_Hash)
#6 /srv/mediawiki/php-1.37.0-wmf.7/includes/parser/Parser.php(2923): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#7 /srv/mediawiki/php-1.37.0-wmf.7/includes/parser/Parser.php(925): Parser->replaceVariables(string, PPFrame_Hash)
#8 /srv/mediawiki/php-1.37.0-wmf.7/includes/parser/Parser.php(4836): Parser->preprocess(string, Title, ParserOptions)
#9 /srv/mediawiki/php-1.37.0-wmf.7/includes/cache/MessageCache.php(1258): Parser->transformMsg(string, ParserOptions, Title)
#10 /srv/mediawiki/php-1.37.0-wmf.7/includes/language/Message.php(1360): MessageCache->transform(string, boolean, Language, Title)
#11 /srv/mediawiki/php-1.37.0-wmf.7/includes/language/Message.php(927): Message->transformText(string)
#12 /srv/mediawiki/php-1.37.0-wmf.7/includes/language/Message.php(987): Message->format(string)
#13 /srv/mediawiki/php-1.37.0-wmf.7/includes/OutputPage.php(946): Message->text()
#14 /srv/mediawiki/php-1.37.0-wmf.7/includes/OutputPage.php(995): OutputPage->setHTMLTitle(Message)
#15 /srv/mediawiki/php-1.37.0-wmf.7/includes/OutputPage.php(2683): OutputPage->setPageTitle(string)
#16 /srv/mediawiki/php-1.37.0-wmf.7/includes/exception/MWExceptionRenderer.php(138): OutputPage->prepareErrorPage(string)
#17 /srv/mediawiki/php-1.37.0-wmf.7/includes/exception/MWExceptionRenderer.php(66): MWExceptionRenderer::reportHTML(Wikimedia\RequestTimeout\RequestTimeoutException)
#18 /srv/mediawiki/php-1.37.0-wmf.7/includes/exception/MWExceptionHandler.php(106): MWExceptionRenderer::output(Wikimedia\RequestTimeout\RequestTimeoutException, integer)
#19 /srv/mediawiki/php-1.37.0-wmf.7/includes/exception/MWExceptionHandler.php(185): MWExceptionHandler::report(Wikimedia\RequestTimeout\RequestTimeoutException)
#20 /srv/mediawiki/php-1.37.0-wmf.7/includes/MediaWiki.php(570): MWExceptionHandler::handleException(Wikimedia\RequestTimeout\RequestTimeoutException, string)
#21 /srv/mediawiki/php-1.37.0-wmf.7/index.php(53): MediaWiki->run()
#22 /srv/mediawiki/php-1.37.0-wmf.7/index.php(46): wfIndexMain()
#23 /srv/mediawiki/w/index.php(3): require(string)
#24 {main}
Impact
Notes

Details

Request URL
https://als.wikipedia.org/wiki/Weiler_(Oberelsass)

Event Timeline

I tracked it down to Language::getMagic(), where $mw->mSynonyms is filled with a magicWords entry from the LocalisationCache. On my machine, the only element in this array is the string #REDIRECT. There is (was?) obviously a null byte somewhere in a Message…php file where these magic word aliases are coming from. But which one? I wasn't able to make CodeSearch find anything.

When there was a timeout before it could be T293568.
If not, also possible another corruption tracked with T245183

MSantos subscribed.