Bug 118596 - [ATK] Leak: Leak in WebKitAccessibleTextGetText
Summary: [ATK] Leak: Leak in WebKitAccessibleTextGetText
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 116317
  Show dependency treegraph
 
Reported: 2013-07-12 04:56 PDT by Brian Holt
Modified: 2013-07-15 06:24 PDT (History)
10 users (show)

See Also:


Attachments
Patch (1.61 KB, patch)
2013-07-12 06:38 PDT, Brian Holt
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Holt 2013-07-12 04:56:36 PDT
Many leaks found in tesktak using valgrind (this is one example):

==32735== 65 bytes in 1 blocks are definitely lost in loss record 8,278 of 12,167
==32735==    at 0x4C2B3F8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==32735==    by 0xA40AD10: g_malloc (gmem.c:159)
==32735==    by 0xA42173B: g_strdup (gstrfuncs.c:364)
==32735==    by 0x6713A39: _ZL27webkitAccessibleTextGetTextP8_AtkTextii (WebKitAccessibleInterfaceText.cpp:594)
==32735==    by 0x6711EA5: _ZL21getGailTextUtilForAtkP8_AtkText (WebKitAccessibleInterfaceText.cpp:171)
==32735==    by 0x6713CF6: _ZL36webkitAccessibleTextGetTextForOffsetP8_AtkTexti15AtkTextBoundary23GetTextRelativePositionPiS3_ (WebKitAccessibleInterfaceText.cpp:659)
==32735==    by 0x6713DA3: _ZL35webkitAccessibleTextGetTextAtOffsetP8_AtkTexti15AtkTextBoundaryPiS2_ (WebKitAccessibleInterfaceText.cpp:673)
==32735==    by 0x9F5FBD9: atk_text_get_text_at_offset (atktext.c:458)
==32735==    by 0x402985: testGetTextFunction (testatk.c:102)
==32735==    by 0x402E43: runGetTextTests (testatk.c:166)
==32735==    by 0x408F03: testWebkitAtkGetTextAtOffset (testatk.c:776)
==32735==    by 0xA427B1C: g_test_run_suite_internal (gtestutils.c:1714)
==32735==    by 0xA427C95: g_test_run_suite_internal (gtestutils.c:1778)
==32735==    by 0xA427C95: g_test_run_suite_internal (gtestutils.c:1778)
==32735==    by 0xA427FF2: g_test_run_suite (gtestutils.c:1823)
==32735==    by 0x4145AB: main (testatk.c:2115)
==32735== 
{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   fun:malloc
   fun:g_malloc
   fun:g_strdup
   fun:_ZL27webkitAccessibleTextGetTextP8_AtkTextii
   fun:_ZL21getGailTextUtilForAtkP8_AtkText
   fun:_ZL36webkitAccessibleTextGetTextForOffsetP8_AtkTexti15AtkTextBoundary23GetTextRelativePositionPiS3_
   fun:_ZL35webkitAccessibleTextGetTextAtOffsetP8_AtkTexti15AtkTextBoundaryPiS2_
   fun:atk_text_get_text_at_offset
   fun:testGetTextFunction
   fun:runGetTextTests
   fun:testWebkitAtkGetTextAtOffset
   fun:g_test_run_suite_internal
   fun:g_test_run_suite_internal
   fun:g_test_run_suite_internal
   fun:g_test_run_suite
   fun:main
}
Comment 1 Radar WebKit Bug Importer 2013-07-12 04:57:01 PDT
<rdar://problem/14426403>
Comment 2 Brian Holt 2013-07-12 06:38:28 PDT
Created attachment 206537 [details]
Patch
Comment 3 Mario Sanchez Prada 2013-07-15 02:06:18 PDT
Comment on attachment 206537 [details]
Patch

gail_util_text_setup() accepts a const gchar* and webkitAccessibleTextGetText() returns newly allocated memory, so this is a absolutely right.

Thanks for the patch!
Comment 4 Carlos Garcia Campos 2013-07-15 05:52:23 PDT
Comment on attachment 206537 [details]
Patch

Correct, it seems there's a similar leak in textExtents.
Comment 5 Brian Holt 2013-07-15 06:07:02 PDT
(In reply to comment #4)
> (From update of attachment 206537 [details])
> Correct, it seems there's a similar leak in textExtents.

It looks like that was fixed in https://bugs.webkit.org/show_bug.cgi?id=118248. Not sure why I missed the leak in addressed in this bug when I was working on that one!
Comment 6 WebKit Commit Bot 2013-07-15 06:24:06 PDT
Comment on attachment 206537 [details]
Patch

Clearing flags on attachment: 206537

Committed r152631: <http://trac.webkit.org/changeset/152631>
Comment 7 WebKit Commit Bot 2013-07-15 06:24:09 PDT
All reviewed patches have been landed.  Closing bug.