Last modified: 2014-07-18 00:22:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T68930, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66930 - Under HHVM: Fatal error: Argument 1 passed to AbstractContent::getParserOutput() must be an instance of Title, null given
Under HHVM: Fatal error: Argument 1 passed to AbstractContent::getParserOutpu...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Spam Blacklist (Other open bugs)
master
All All
: High normal (vote)
: ---
Assigned To: Max Semenik
: hhvm
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-22 02:00 UTC by Ori Livneh
Modified: 2014-07-18 00:22 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Ori Livneh 2014-06-22 02:00:18 UTC
Caller appears to be SpamBlacklistHooks::filterMergedContent()

To reproduce, run the extension's unit tests under HHVM.

Error and trace info:


Fatal error: Argument 1 passed to AbstractContent::getParserOutput() must be an instance of Title, null given in /srv/mediawiki/includes/content/AbstractContent.php on line 490
    #0 at [/srv/mediawiki/includes/content/AbstractContent.php:490]\n    #1 AbstractContent->getParserOutput(), called at [/srv/mediawiki/extensions/SpamBlacklist/SpamBlacklistHooks.php:28]\n    #2 SpamBlacklistHooks::filterMergedContent(), called at [/srv/mediawiki/includes/Hooks.php:206]\n    #3 Hooks::run(), called at [/srv/mediawiki/includes/GlobalFunctions.php:4056]\n    #4 wfRunHooks(), called at [/srv/mediawiki/includes/EditPage.php:1506]\n    #5 EditPage->runPostMergeFilters(), called at [/srv/mediawiki/includes/EditPage.php:1755]\n    #6 EditPage->internalAttemptSave(), called at [/srv/mediawiki/tests/phpunit/includes/EditPageTest.php:153]\n    #7 EditPageTest->assertEdit(), called at [/srv/mediawiki/tests/phpunit/includes/EditPageTest.php:192]\n    #8 EditPageTest->testCreatePage(), called at [:0]\n    #9 ReflectionMethod->invokeArgs(), called at [/srv/mediawiki/vendor/phpunit/phpunit/src/Framework/TestCase.php:951]\n    #10 PHPUnit_Framework_TestCase->runTest(), called at [/srv/mediawiki/vendor/phpunit/phpunit/src/Framework/TestCase.php:817]\n    #11 PHPUnit_Framework_TestCase->runBare(), called at [/srv/mediawiki/vendor/phpunit/phpunit/src/Framework/TestResult.php:686]\n    #12 PHPUnit_Framework_TestResult->run(), called at [/srv/mediawiki/vendor/phpunit/phpunit/src/Framework/TestCase.php:753]\n    #13 PHPUnit_Framework_TestCase->run(), called at [/srv/mediawiki/tests/phpunit/MediaWikiTestCase.php:133]\n    #14 MediaWikiTestCase->run(), called at [/srv/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php:675]\n    #15 PHPUnit_Framework_TestSuite->run(), called at [/srv/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php:675]\n    #16 PHPUnit_Framework_TestSuite->run(), called at [/srv/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php:675]\n    #17 PHPUnit_Framework_TestSuite->run(), called at [/srv/mediawiki/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:426]\n    #18 PHPUnit_TextUI_TestRunner->doRun(), called at [/srv/mediawiki/vendor/phpunit/phpunit/src/TextUI/Command.php:179]\n    #19 PHPUnit_TextUI_Command->run(), called at [/srv/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42]\n    #20 MediaWikiPHPUnitCommand::main(), called at [/srv/mediawiki/tests/phpunit/phpunit.php:160]
Comment 1 Chad H. 2014-06-23 13:43:08 UTC
I see two bugs here. One, we should figure out why we're passing null here and see if that's a bug. It might not be.

HHVM I think is being a little overzealous here though. Isn't null an acceptable value for a typed parameter?
Comment 2 Ori Livneh 2014-06-23 18:07:35 UTC
(In reply to Chad H. from comment #1)
> HHVM I think is being a little overzealous here though. Isn't null an
> acceptable value for a typed parameter?

It could very well be an HHVM bug. If you can produce a minimal case that generates a different result on HHVM and Zend PHP it'd be very helpful.
Comment 3 Max Semenik 2014-06-23 18:15:37 UTC
(In reply to Chad H. from comment #1)
> HHVM I think is being a little overzealous here though. Isn't null an
> acceptable value for a typed parameter?

$ php eval.php
> function f(stdClass $x) { echo get_class($x); }

> f(new stdClass);
stdClass
> f(null)
PHP Catchable fatal error:  Argument 1 passed to f() must be an instance of stdClass, null given, called in /vagrant/mediawiki/maintenance/eval.php(81) : eval()'d code on line 1 and defined in /vagrant/mediawiki/maintenance/eval.php(81) : eval()'d code on line 1


$ hhvm -a
hphpd> function f(stdClass $x) { echo get_class($x); }
hphpd> f(new stdClass);
stdClass
hphpd> f(null);
Notice: Attempted to interpret unknown debugger command as PHP!

Hit fatal : Argument 1 passed to f() must be an instance of stdClass, null given
    #0 at [:1]
    #1 f(), called at [:1]
    #2 include(), called at [:1]
Comment 4 Gerrit Notification Bot 2014-06-23 18:37:27 UTC
Change 141483 had a related patch set uploaded by Ori.livneh:
Use preg_match rather than fnmatch for 'like' operator

https://gerrit.wikimedia.org/r/141483
Comment 5 Gerrit Notification Bot 2014-06-23 18:55:45 UTC
Change 141483 merged by jenkins-bot:
Use preg_match rather than fnmatch for 'like' operator

https://gerrit.wikimedia.org/r/141483
Comment 6 Ori Livneh 2014-06-23 18:58:20 UTC
Sorry, the patch is unrelated to this bug; I meant to reference bug 66935 instead.
Comment 7 Gerrit Notification Bot 2014-07-17 22:33:05 UTC
Change 147334 had a related patch set uploaded by MaxSem:
Editing unit tests: set title in context

https://gerrit.wikimedia.org/r/147334
Comment 8 Gerrit Notification Bot 2014-07-18 00:03:33 UTC
Change 147334 merged by jenkins-bot:
Editing unit tests: set title in context

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links