Page MenuHomePhabricator

HHVM segfault when not passing parameter by reference when required
Closed, DeclinedPublic


HHVM was segfaulting on every page view on enbetawiki for most of the day. However, api.php worked fine and all requests to esbetawiki worked as well. Giuseppe and I tracked it down to . We merged and that made the segfaults go away.

The bug seems to be triggered by not passing a reference into a parameter that's supposed to take a reference when using call_user_func_array:

function f ( $x, &$y, &$z ) {
    // Do something with $y (we don't know what exactly yet)

$a = 'foo';
$b = array( /* stuff here */ );
$c = null;
call_user_func_array( 'f', array( $a, $b, &$c ) ); // Note: should have been array( $a, &$b, &$c )

HHVM stack trace: P154

[16:08]	_joe_	RoanKattouw: Hooks::run(BitmapHandlerCheckImageArea, Array) called at [/srv/mediawiki/php-master/includes/media/TransformationalImageHandler.php:600 this is thwat I get as a php stacktrace

Event Timeline

Catrope raised the priority of this task from to Needs Triage.
Catrope updated the task description. (Show Details)
Catrope added a project: HHVM.
Catrope changed Security from none to None.
Catrope added a subscriber: Catrope.

This happened while calling the BitmapHandlerCheckImageArea hook. It's called by includes/media/TransformationalImageHandler.php:600 in MW core, and it's listened to by onBitmapHandlerCheckImageArea in VipsScaler_body.php in the VipsScaler extension.

Krinkle added a project: MediaWiki-General.
Krinkle added a subscriber: Krinkle.

Declining per T192166.