Changes between Initial Version and Version 1 of WebKitGTK/TrackingMemoryErrors


Ignore:
Timestamp:
May 4, 2013 3:26:33 AM (8 years ago)
Author:
elima@igalia.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WebKitGTK/TrackingMemoryErrors

    v1 v1  
     1== Running Valgrind to check memory errors and leaks in WebKitGtk ==
     2
     3Tracking memory errors and leaks in WebKitGtk is similar to how is done for other GTK/GNOME software, with a few extra considerations.
     4
     5The "Valgrind page at GNOME wiki":https://live.gnome.org/Valgrind contains some tips, and is a useful reading as a starting point.
     6
     7=== WebKit1 ===
     8
     9{{{
     10G_SLICE=always-malloc G_DEBUG=gc-friendly,resident-modules valgrind \
     11    --tool=memcheck --leak-check=full --leak-resolution=high        \
     12    --num-callers=20 --log-file=vgdump --smc-check=all              \
     13    WebKitBuild/Release/Programs/GtkLauncher
     14}}}
     15
     16Notice the @--smc-check-all@ flag, which enables checks for self modifying code. ??(@FIXME: I suppose this is required because WK generates a lot of its own code, but a better confirmation/explanation here would be nice)??.
     17
     18=== WebKit2 ===
     19
     20{{{
     21G_SLICE=always-malloc G_DEBUG=gc-friendly,resident-modules valgrind         \
     22    --tool=memcheck --leak-check=full --leak-resolution=high                \
     23    --num-callers=20 --log-file=vgdump --smc-check=all --trace-children=yes \
     24    WebKitBuild/Release/Programs/MiniBrowser
     25}}}
     26
     27Here, the interesting bit is @--trace-children=yes@, which tells valgrind to also hook into any child process spawned by the original program. For WK2 this is required if you want to check memory in the Web process (which you most likely do), otherwise it will only check it in the UI process.
     28
     29Notice that for both WK1 and WK2, the corresponding launcher programs are used instead of the provided script, in order to avoid checking for errors in the script's runtime, which apart from been undesired, will slow down the process even more.
     30
     31=== Memory leaks found in WebKit ===
     32
     33=== Memory leaks found in external modules ===
     34
     35* **at-spi2-atk**:
     36  * ''FIXED'' "Memory leaks due to not calling dbus_error_free()":https://bugzilla.gnome.org/show_bug.cgi?id=698951
     37
     38* **atk**
     39  * ''FIXED'' "AtkSocket not freeing 'embedded_plug_id' when destroyed":https://bugzilla.gnome.org/show_bug.cgi?id=699256