Page MenuHomePhabricator

Investigate why sign-up fatal resulted in a blank page and fix
Closed, ResolvedPublic

Description

Follows-up T173394: Fatal error from AntiSpoof when logging in

The MediaWiki exception from that task resulted in a blank page. An HTTP response that has a body, but an empty one. The response had no HTML content in its response. I forgot whether the content-type was text/plain or text/html, presumably text/html per PHP's default.

Event Timeline

What seems to be happening is this:

  1. The mismatched typehint raises an E_RECOVERABLE_ERROR error in HHVM.
  2. MWExceptionHandler::handleError() sees that E_RECOVERABLE_ERROR is not in self::$fatalErrorTypes, so it does its normal logging then returns false to let the default error handler process it.
  3. The default error handler treats E_RECOVERABLE_ERROR as E_ERROR, and so terminates execution.
  4. MWExceptionHandler::handleFatalError() gets called as the shutdown handler. error_get_last() returns the E_RECOVERABLE_ERROR. Since that's not in self::$fatalErrorTypes, MWExceptionHandler::handleFatalError() ignores it.

This seems to result in MediaWiki not outputting any error information to the browser. The solution may be to add E_RECOVERABLE_ERROR to MWExceptionHandler::$fatalErrorTypes, since we're not actually recovering from it. Then MWExceptionHandler::handleFatalError() will report error information to the browser.

• CCicalese_WMF renamed this task from Investigate why sign-up fatal resulted in a blank page to Investigate why sign-up fatal resulted in a blank page and fix.Jan 9 2018, 2:20 AM
• CCicalese_WMF moved this task from Inbox to Backlog on the MediaWiki-Platform-Team-Archived board.
tstarling renamed this task from Investigate why sign-up fatal resulted in a blank page and fix to Investigate why sign-up fatal resulted in a blank page and fix.Jan 9 2018, 2:21 AM

It's probably an HHVM bug. I was on HHVM 3.22 but it was showing the generic 500 error (ErrorDocument500), with a mangled Content-Encoding header, regardless of $fatalErrorTypes. So I upgraded to HHVM 3.27, and now a type hint error is caught by the exception handler (not the error handler) and displayed normally. I see WMF is still on 3.18.

daniel claimed this task.
daniel subscribed.

Assuming this is no longer relevant, since we are moving away from HHVM, and no longer support it for future versions of MediaWiki.