After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694730 - memory leak in sqlite backend
memory leak in sqlite backend
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Contacts
3.8.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2013-02-26 09:46 UTC by Patrick Ohly
Modified: 2013-09-14 16:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Patrick Ohly 2013-02-26 09:46:57 UTC
valgrind reports a leak when running SyncEvolution tests:

==18552== 25 bytes in 1 blocks are definitely lost in loss record 2,353 of 6,616
==18552==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==18552==    by 0xADC3D40: g_malloc (gmem.c:159)
==18552==    by 0xADDA3BB: g_strdup (gstrfuncs.c:364)
==18552==    by 0x1146400B: get_string_cb (e-book-backend-sqlitedb.c:255)
==18552==    by 0x854F1CE: sqlite3_exec (in /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==18552==    by 0x114665A2: book_backend_sql_exec_real (e-book-backend-sqlitedb.c:301)
==18552==    by 0x1146666F: book_backend_sql_exec (e-book-backend-sqlitedb.c:391)
==18552==    by 0x11469FC6: e_book_backend_sqlitedb_get_revision (e-book-backend-sqlitedb.c:3995)
==18552==    by 0x1F90480E: e_book_backend_file_open (e-book-backend-file.c:656)
==18552==    by 0x1146C229: book_backend_open (e-book-backend-sync.c:397)
==18552==    by 0x11473F26: operation_thread (e-data-book.c:292)
==18552==    by 0xADE2181: g_thread_pool_thread_proxy (gthreadpool.c:309)
==18552==    by 0xADE1964: g_thread_proxy (gthread.c:797)
==18552==    by 0x8E34B4F: start_thread (pthread_create.c:304)
==18552==    by 0xB90F70C: clone (clone.S:112)
==18552== 
{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   fun:malloc
   fun:g_malloc
   fun:g_strdup
   fun:get_string_cb
   fun:sqlite3_exec
   fun:book_backend_sql_exec_real
   fun:book_backend_sql_exec
   fun:e_book_backend_sqlitedb_get_revision
   fun:e_book_backend_file_open
   fun:book_backend_open
   fun:operation_thread
   fun:g_thread_pool_thread_proxy
   fun:g_thread_proxy
   fun:start_thread
   fun:clone
}

To reproduce, run testpim.py TestContacts.testFilterStartup with TEST_DBUS_PREFIX=syncevolution/test/valgrindcheck.sh VALGRIND_ARGS=--show-possibly-lost=no.
Comment 1 Patrick Ohly 2013-02-26 09:48:42 UTC
Happens on openismus-work branch, I haven't checked master.
Comment 2 Tristan Van Berkom 2013-02-26 10:13:26 UTC
This was an obvious fix, pushed the correction to openismus-work

(checked on master, this won't occur on master)

commit 011911a18717586ee5b98a6ca3dcf52a80bbf08b
Author: Tristan Van Berkom <tristanvb@openismus.com>
Date:   Tue Feb 26 19:08:59 2013 +0900

    EBookBackendFile: Dont load the revision if the revision is already loaded
    
    This avoids a small memory leak when multiple clients are connected,
    the patch also adds a comment and a little extra locking around access
    to the ->revision variable in the ->open() method.
    
    Fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=694730