[HipHop] Setting up

Paul Tarjan pt at fb.com
Wed May 15 03:01:47 UTC 2013


Hey wikimedia.

First of all, thanks for making the mailing list :) Did you get hhvm
running in the labs environment yet?

I tracked down the segfault I alluded to in the meeting. If you want to be
unblocked before I ship the patch, you can turn this code:

  $link = DatabaseBase::factory( $type )->getSoftwareLink();

into

  $obj = DatabaseBase::factory( $type );
  $link = $obj->getSoftwareLink();


and you shouldn't segfault.

The details if you are interested. getSoftwareLink() is a static method,
but it is being called on an instance. This works in PHP but we first
decref the object before calling the method. This object has a desctructor
which gets called when the refcount goes to 0. In this case, the
destructor is called right in the middle of setting the stack up for
getSoftwareLink() and clobbers it. Eventually we segfault with a corrupted
stack.

I also cleaned up our github issues, so feel free to submit any if you hit
issues.

Thanks
Paul




More information about the HipHop mailing list