Bug 95062

Summary: [Gtk] Several tests launch g_object_ref/unref assertion messages
Product: WebKit Reporter: Alejandro Piñeiro <apinheiro>
Component: AccessibilityAssignee: Zan Dobersek <zan>
Status: RESOLVED FIXED    
Severity: Normal CC: jdiggs, mario, mrobinson, pnormand, zan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Alejandro Piñeiro 2012-08-27 02:15:09 PDT
Execute run-webkit-tests with the accessibility tests:

Tools/Scripts/run-webkit-tests  --gtk accessibility  platform/gtk/accessibility

If you take a look to the stderr of some of those tests you will find several assertion messages related to g_object_ref/unref. For example from accessibility/aria-hidden-updates-alldescendants.html:

g_object_ref: assertion `G_IS_OBJECT (object)' failed
g_object_ref: assertion `G_IS_OBJECT (object)' failed
g_object_unref: assertion `G_IS_OBJECT (object)' failed
g_object_ref: assertion `G_IS_OBJECT (object)' failed
g_object_unref: assertion `G_IS_OBJECT (object)' failed
g_object_ref: assertion `G_IS_OBJECT (object)' failed
g_object_unref: assertion `G_IS_OBJECT (object)' failed
g_object_ref: assertion `G_IS_OBJECT (object)' failed
g_object_ref: assertion `G_IS_OBJECT (object)' failed
g_object_unref: assertion `G_IS_OBJECT (object)' failed
g_object_ref: assertion `G_IS_OBJECT (object)' failed
g_object_unref: assertion `G_IS_OBJECT (object)' failed
g_object_ref: assertion `G_IS_OBJECT (object)' failed
g_object_unref: assertion `G_IS_OBJECT (object)' failed
g_object_ref: assertion `G_IS_OBJECT (object)' failed
g_object_ref: assertion `G_IS_OBJECT (object)' failed
g_object_unref: assertion `G_IS_OBJECT (object)' failed
g_object_ref: assertion `G_IS_OBJECT (object)' failed
g_object_unref: assertion `G_IS_OBJECT (object)' failed
g_object_ref: assertion `G_IS_OBJECT (object)' failed
g_object_unref: assertion `G_IS_OBJECT (object)' failed

Note: this started to happen after the changes made on bug 94200. Not sure if that means that this bug should be titled with a REGRESSION label.
Comment 1 Zan Dobersek 2012-08-27 11:40:10 PDT
I've recommended using GRefPtr<AtkObject> as the type definition for the PlatformUIElement. That doesn't really work as it causes compilation errors (conversion of 0 from integer to AccessibilityUIElement becomes impossible and the refactoring to avoid this is IMO not really worth the trouble).

To bypass this the m_element member should be checked that it is non-nul before refing/unrefing.
Comment 2 Zan Dobersek 2012-10-02 09:45:22 PDT
Created attachment 166701 [details]
Patch
Comment 3 Zan Dobersek 2012-10-02 09:46:28 PDT
CC-ing a11y folks and reviewers.
Comment 4 Martin Robinson 2012-10-02 09:48:49 PDT
Comment on attachment 166701 [details]
Patch

Thanks!
Comment 5 Zan Dobersek 2012-10-02 10:00:03 PDT
Comment on attachment 166701 [details]
Patch

Clearing flags on attachment: 166701

Committed r130183: <http://trac.webkit.org/changeset/130183>
Comment 6 Zan Dobersek 2012-10-02 10:00:08 PDT
All reviewed patches have been landed.  Closing bug.