This continues from T248891: Error: Trying to access array offset on value of type null (includes/deferred/DeferredUpdates.php:237) on PHP 7.4
From T248891:11:05:14 Dumping file(s) mw-error.log 11:05:14 + set +e 11:05:14 + cd /srv/jenkins/workspace/workspace/quibble-vendor-mysql-php74-docker/log 11:05:14 + grep --color . mw-error.log 11:05:14 2020-03-30 18:03:32 cf60bdc56f7f wikidb: [665416b8da28a05f62ce7a94] /index.php?title=BeforeEach-name-0.9997845813782571-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n&action=submit ErrorException from line 237 of /workspace/src/includes/deferred/DeferredUpdates.php: PHP Notice: Trying to access array offset on value of type null 11:05:14 #0 /workspace/src/includes/deferred/DeferredUpdates.php(237): MWExceptionHandler::handleError() 11:05:14 #1 /workspace/src/includes/deferred/DeferredUpdates.php(150): DeferredUpdates::handleUpdateQueue() 11:05:14 #2 /workspace/src/includes/MediaWiki.php(1059): DeferredUpdates::doUpdates() 11:05:14 #3 /workspace/src/includes/MediaWiki.php(839): MediaWiki->restInPeace() 11:05:14 #4 /workspace/src/includes/MediaWiki.php(859): MediaWiki->{closure}() 11:05:14 #5 /workspace/src/includes/MediaWiki.php(574): MediaWiki->doPostOutputShutdown() 11:05:14 #6 /workspace/src/index.php(47): MediaWiki->run() 11:05:14 #7 {main} 11:05:14 2020-03-30 18:03:33 cf60bdc56f7f wikidb: [10a3e56aa570ec5ebfceeb8f] /index.php?title=BeforeEach-name-0.02593870942175247-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n&action=submit ErrorException from line 237 of /workspace/src/includes/deferred/DeferredUpdates.php: PHP Notice: Trying to access array offset on value of type null 11:05:14 #0 /workspace/src/includes/deferred/DeferredUpdates.php(237): MWExceptionHandler::handleError() 11:05:14 #1 /workspace/src/includes/deferred/DeferredUpdates.php(150): DeferredUpdates::handleUpdateQueue() 11:05:14 #2 /workspace/src/includes/MediaWiki.php(1059): DeferredUpdates::doUpdates() 11:05:14 #3 /workspace/src/includes/MediaWiki.php(839): MediaWiki->restInPeace() 11:05:14 #4 /workspace/src/includes/MediaWiki.php(859): MediaWiki->{closure}() 11:05:14 #5 /workspace/src/includes/MediaWiki.php(574): MediaWiki->doPostOutputShutdown() 11:05:14 #6 /workspace/src/index.php(47): MediaWiki->run() 11:05:14 #7 {main} 11:05:14 2020-03-30 18:03:35 cf60bdc56f7f wikidb: [9c3c49439dec9d888816c59f] /index.php?title=BeforeEach-name-0.35932370040107586-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n&action=submit ErrorException from line 237 of /workspace/src/includes/deferred/DeferredUpdates.php: PHP Notice: Trying to access array offset on value of type null 11:05:14 #0 /workspace/src/includes/deferred/DeferredUpdates.php(237): MWExceptionHandler::handleError() 11:05:14 #1 /workspace/src/includes/deferred/DeferredUpdates.php(150): DeferredUpdates::handleUpdateQueue() 11:05:14 #2 /workspace/src/includes/MediaWiki.php(1059): DeferredUpdates::doUpdates() 11:05:14 #3 /workspace/src/includes/MediaWiki.php(839): MediaWiki->restInPeace() 11:05:14 #4 /workspace/src/includes/MediaWiki.php(859): MediaWiki->{closure}() 11:05:14 #5 /workspace/src/includes/MediaWiki.php(574): MediaWiki->doPostOutputShutdown() 11:05:14 #6 /workspace/src/index.php(47): MediaWiki->run() 11:05:14 #7 {main} 11:05:14 2020-03-30 18:03:38 cf60bdc56f7f wikidb: [b70a7998f6fae9c2094580ec] /index.php?title=BeforeEach-name-0.5304086324145123-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n&action=delete ErrorException from line 237 of /workspace/src/includes/deferred/DeferredUpdates.php: PHP Notice: Trying to access array offset on value of type null 11:05:14 #0 /workspace/src/includes/deferred/DeferredUpdates.php(237): MWExceptionHandler::handleError() 11:05:14 #1 /workspace/src/includes/deferred/DeferredUpdates.php(150): DeferredUpdates::handleUpdateQueue() 11:05:14 #2 /workspace/src/includes/MediaWiki.php(1059): DeferredUpdates::doUpdates() 11:05:14 #3 /workspace/src/includes/MediaWiki.php(839): MediaWiki->restInPeace() 11:05:14 #4 /workspace/src/includes/MediaWiki.php(859): MediaWiki->{closure}() 11:05:14 #5 /workspace/src/includes/MediaWiki.php(574): MediaWiki->doPostOutputShutdown() 11:05:14 #6 /workspace/src/index.php(47): MediaWiki->run() 11:05:14 #7 {main} 11:05:14 2020-03-30 18:03:40 cf60bdc56f7f wikidb: [ea2e27cf7de5144f23bf5d19] /index.php?title=Special:Undelete&action=submit ErrorException from line 237 of /workspace/src/includes/deferred/DeferredUpdates.php: PHP Notice: Trying to access array offset on value of type null 11:05:14 #0 /workspace/src/includes/deferred/DeferredUpdates.php(237): MWExceptionHandler::handleError() 11:05:14 #1 /workspace/src/includes/deferred/DeferredUpdates.php(150): DeferredUpdates::handleUpdateQueue() 11:05:14 #2 /workspace/src/includes/MediaWiki.php(1059): DeferredUpdates::doUpdates() 11:05:14 #3 /workspace/src/includes/MediaWiki.php(839): MediaWiki->restInPeace() 11:05:14 #4 /workspace/src/includes/MediaWiki.php(859): MediaWiki->{closure}() 11:05:14 #5 /workspace/src/includes/MediaWiki.php(574): MediaWiki->doPostOutputShutdown() 11:05:14 #6 /workspace/src/index.php(47): MediaWiki->run() 11:05:14 #7 {main} 11:05:14 2020-03-30 18:03:41 cf60bdc56f7f wikidb: [acc714eb27b0a78edfdd46b1] /index.php?title=BeforeEach-name-0.7802289035705332-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n&action=submit ErrorException from line 237 of /workspace/src/includes/deferred/DeferredUpdates.php: PHP Notice: Trying to access array offset on value of type null 11:05:14 #0 /workspace/src/includes/deferred/DeferredUpdates.php(237): MWExceptionHandler::handleError() 11:05:14 #1 /workspace/src/includes/deferred/DeferredUpdates.php(150): DeferredUpdates::handleUpdateQueue() 11:05:14 #2 /workspace/src/includes/MediaWiki.php(1059): DeferredUpdates::doUpdates() 11:05:14 #3 /workspace/src/includes/MediaWiki.php(839): MediaWiki->restInPeace() 11:05:14 #4 /workspace/src/includes/MediaWiki.php(859): MediaWiki->{closure}() 11:05:14 #5 /workspace/src/includes/MediaWiki.php(574): MediaWiki->doPostOutputShutdown() 11:05:14 #6 /workspace/src/index.php(47): MediaWiki->run() 11:05:14 #7 {main} 11:05:14 2020-03-30 18:04:00 cf60bdc56f7f wikidb: [b1b5ac8c63cdcdff7dde5348] /index.php/Special:CreateAccount ErrorException from line 237 of /workspace/src/includes/deferred/DeferredUpdates.php: PHP Notice: Trying to access array offset on value of type null 11:05:14 #0 /workspace/src/includes/deferred/DeferredUpdates.php(237): MWExceptionHandler::handleError() 11:05:14 #1 /workspace/src/includes/deferred/DeferredUpdates.php(150): DeferredUpdates::handleUpdateQueue() 11:05:14 #2 /workspace/src/includes/MediaWiki.php(1059): DeferredUpdates::doUpdates() 11:05:14 #3 /workspace/src/includes/MediaWiki.php(839): MediaWiki->restInPeace() 11:05:14 #4 /workspace/src/includes/MediaWiki.php(859): MediaWiki->{closure}() 11:05:14 #5 /workspace/src/includes/MediaWiki.php(574): MediaWiki->doPostOutputShutdown() 11:05:14 #6 /workspace/src/index.php(47): MediaWiki->run() 11:05:14 #7 {main}
In T248891#6011925, @Krinkle wrote:self::$executeContext = [ 'stage' => $stage, 'subqueue' => [] ]; try { $e = self::run( $du, $lbf, $logger, $stats, $httpMethod ); // … while ( self::$executeContext['subqueue'] ) { # <! Error: array offset on null // … unset( self::$executeContext['subqueue'][$firstKey] ); // … } } finally { // … self::$executeContext = null; }Interesting. It would seem that an exception (presumably from run()) is aborting the while-loop and reaching the finally block (that part makes sense) but then somehow getting back into the while-loop?
For this task:
- Figure out why self::$executeContext can sometimes be null during execution.
- Make it no longer possible or account for it.