GNOME Bugzilla – Bug 694730
memory leak in sqlite backend
Last modified: 2013-09-14 16:55:47 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.
Happens on openismus-work branch, I haven't checked master.
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