[Webkit-unassigned] [Bug 186269] Make it possible to track unbalanced ref()/deref()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 4 22:33:04 PDT 2018


--- Comment #4 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Sam and I looked at what it would take to expose ref/deref to Instruments, and it's not as useful as this. Instruments pairs up ref/deref with some logic that compares stack traces, and does poorly if these are not cleanly nested. I've done this on numerous traces recently, when I proxied ref/deref on Node to a dummy CF object just so that I could leverage Instruments' UI for pairing stacks. It still required lots of manual inspection and error-prone pairing.

Conversely, with this token scheme, I was able to track ref/deref on Document and get a SINGLE unmatched ref() stack for a specific layout test that was abandoning a document.

I agree that tracking tokens outside of RefPtr and Ref might be laborious, but:
a) we can make more helper classes for common patterns
b) you can start with the built-in support, and then hack in token tracking for manual refs/derefs as you need them. I bet most classes would only need a few changes to convert all ref/deref to being tracked. And the token tracking is really easy.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180605/3c990801/attachment.html>

More information about the webkit-unassigned mailing list