Summary: | [ATK] Leak: leaks in AccessibilityUIElement | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brian Holt <brian.holt> | ||||||||
Component: | Accessibility | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | cdumez, commit-queue, eflews.bot, gyuyoung.kim | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 116317 | ||||||||||
Attachments: |
|
Description
Brian Holt
2013-07-02 05:29:53 PDT
Created attachment 205903 [details]
Patch
Fix for 2 of the 3 leaks
Comment on attachment 205903 [details] Patch Attachment 205903 [details] did not pass efl-ews (efl): Output: http://webkit-queues.appspot.com/results/1019110 The proposed patch addresses the first two leaks. The final leak Memcheck:Leak fun:malloc fun:g_malloc fun:g_strdup fun:_ZL27webkitAccessibleTextGetTextP8_AtkTextii fun:_ZL23webkitAccessibleGetNameP10_AtkObject fun:_ZN22AccessibilityUIElement5titleEv will not be addressed in this bug because it requires a wider change to the Atk object caching mechanism that is used by the implementation of the Atk interface to return const pointers (e.g. const gchar*). A new bug will be raised. Created attachment 205904 [details]
Revised patch
Comment on attachment 205904 [details] Revised patch View in context: https://bugs.webkit.org/attachment.cgi?id=205904&action=review > Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:316 > + GOwnPtr<char> attributeData(attributeString.get()); This does not look right. > Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:424 > + GOwnPtr<gchar> text(atk_text_get_text(ATK_TEXT(m_element), 0, -1)); This part looks OK though. (In reply to comment #5) > (From update of attachment 205904 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=205904&action=review > > > Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:316 > > + GOwnPtr<char> attributeData(attributeString.get()); > > This does not look right. Absolutely correct, don't know how that slipped past. > > > Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:424 > > + GOwnPtr<gchar> text(atk_text_get_text(ATK_TEXT(m_element), 0, -1)); > > This part looks OK though. Comment on attachment 205904 [details] Revised patch View in context: https://bugs.webkit.org/attachment.cgi?id=205904&action=review > Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:315 > + GOwnPtr<char> attributeString(attributeSetToString(atk_object_get_attributes(ATK_OBJECT(m_element)))); There is indeed a leak here though. According to the doc: https://developer.gnome.org/atk/unstable/AtkObject.html#atk-object-get-attributes "This atkattributeset should be freed by a call to atk_attribute_set_free()." (In reply to comment #7) > (From update of attachment 205904 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=205904&action=review > > > Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:315 > > + GOwnPtr<char> attributeString(attributeSetToString(atk_object_get_attributes(ATK_OBJECT(m_element)))); > > There is indeed a leak here though. According to the doc: > https://developer.gnome.org/atk/unstable/AtkObject.html#atk-object-get-attributes > > "This atkattributeset should be freed by a call to atk_attribute_set_free()." Yes, I've just been discussing with Mario how to resolve this. The best fix requires a specialisation of GOwnPtr so I'll propose that in a separate bug (coming shortly). Comment on attachment 205904 [details] Revised patch View in context: https://bugs.webkit.org/attachment.cgi?id=205904&action=review >> Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:315 >> + GOwnPtr<char> attributeString(attributeSetToString(atk_object_get_attributes(ATK_OBJECT(m_element)))); > > There is indeed a leak here though. According to the doc: > https://developer.gnome.org/atk/unstable/AtkObject.html#atk-object-get-attributes > > "This atkattributeset should be freed by a call to atk_attribute_set_free()." And BTW, same issue in Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp. Maybe you can fix the leaks in WKTR as well in the same patch? (In reply to comment #9) > (From update of attachment 205904 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=205904&action=review > > >> Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:315 > >> + GOwnPtr<char> attributeString(attributeSetToString(atk_object_get_attributes(ATK_OBJECT(m_element)))); > > > > There is indeed a leak here though. According to the doc: > > https://developer.gnome.org/atk/unstable/AtkObject.html#atk-object-get-attributes > > > > "This atkattributeset should be freed by a call to atk_attribute_set_free()." > > And BTW, same issue in Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp. Maybe you can fix the leaks in WKTR as well in the same patch? Absolutely :-) (In reply to comment #8) > (In reply to comment #7) > > (From update of attachment 205904 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=205904&action=review > > > > > Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:315 > > > + GOwnPtr<char> attributeString(attributeSetToString(atk_object_get_attributes(ATK_OBJECT(m_element)))); > > > > There is indeed a leak here though. According to the doc: > > https://developer.gnome.org/atk/unstable/AtkObject.html#atk-object-get-attributes > > > > "This atkattributeset should be freed by a call to atk_attribute_set_free()." > > Yes, I've just been discussing with Mario how to resolve this. The best fix requires a specialisation of GOwnPtr so I'll propose that in a separate bug (coming shortly). I agree, probably in a new Source/WebCore/accessibility/atk/GOwnPtrAtk.h ? See for example: Source/WebCore/platform/network/soup/GOwnPtrSoup.* Created attachment 205916 [details]
Patch
Fix for 1 of the 3 leaks
Comment on attachment 205916 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=205916&action=review > Tools/ChangeLog:8 > + Reviewed by Christophe Dumez. The patch did not get r+. So It is a bit early to update this line :) > Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:425 > + GOwnPtr<gchar> axValue(g_strdup_printf("AXValue: %s", textWithReplacedCharacters.get())); Would you fix the same issue in Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp in the same patch please? (In reply to comment #13) > (From update of attachment 205916 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=205916&action=review > > > Tools/ChangeLog:8 > > + Reviewed by Christophe Dumez. > > The patch did not get r+. So It is a bit early to update this line :) Sorry, I didn't realise that we only do that after r+. Because I'm not a committer I thought I could make the change to avoid having to upload another patch after r+ ... > > > Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:425 > > + GOwnPtr<gchar> axValue(g_strdup_printf("AXValue: %s", textWithReplacedCharacters.get())); > > Would you fix the same issue in Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp in the same patch please? It turns out that this has already been fixed in WKTR, but it wasn't applied to the DRT. Comment on attachment 205916 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=205916&action=review >>> Tools/ChangeLog:8 >>> + Reviewed by Christophe Dumez. >> >> The patch did not get r+. So It is a bit early to update this line :) > > Sorry, I didn't realise that we only do that after r+. Because I'm not a committer I thought I could make the change to avoid having to upload another patch after r+ ... You don't have to reupload a patch after r+ unless there are nits to fix. This line gets automatically updated when landing after a r+. >>> Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:425 >>> + GOwnPtr<gchar> axValue(g_strdup_printf("AXValue: %s", textWithReplacedCharacters.get())); >> >> Would you fix the same issue in Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp in the same patch please? > > It turns out that this has already been fixed in WKTR, but it wasn't applied to the DRT. Oh, my bad. I misread my grep output. Comment on attachment 205916 [details] Patch Clearing flags on attachment: 205916 Committed r152298: <http://trac.webkit.org/changeset/152298> All reviewed patches have been landed. Closing bug. |