https://bugzilla.wikimedia.org/show_bug.cgi?id=65796

--- Comment #9 from Tim Starling <[email protected]> ---
I'm at the "how can this possibly work at all" stage now, which is usually a
sign of progress. _object_and_properties_init() has:

  Z_OBJVAL_P(arg) = HPHP::ObjectData::newInstance(cls);

at this point, the ObjectData's refcount is 0, which is apparently broken. Then
it does:

  // Zend doesn't have this, but I think we need it or else new objects have a
  // refcount of 0
  Z_ADDREF_P(arg);

The comment is apparently incorrect -- the RefData's refcount is 1 already and
apparently doesn't need to be incremented, and it fails to increment the
ObjectData's refcount.

The two bugs apparently sometimes cancel each other out, since the RefData
stays live indefinitely and keeps the ObjectData alive. I'm still sorting
through the exact chronology, but it seems some sequence of boxing and unboxing
exposes the incorrect reference count in the ObjectData.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to