[cairo-commit] 8 commits - src/cairo-svg-surface.c test/cairo-test.c test/.valgrind-suppressions

Carl Worth cworth at kemper.freedesktop.org
Fri Jun 30 17:04:08 PDT 2006


 src/cairo-svg-surface.c     |    1 
 test/.valgrind-suppressions |  368 ++++++++++++++++++++++++++++++++++++++++++++
 test/cairo-test.c           |   11 -
 3 files changed, 375 insertions(+), 5 deletions(-)

New commits:
diff-tree 19c4700101bfce7d73a50017021b4ec198ddd783 (from 84b06eed4e53eb34b0ec378216fa246286998acd)
Author: Carl Worth <cworth at cworth.org>
Date:   Sat Jul 1 01:05:30 2006 +0200

    Even _more_ valgrind suppresions for Xrm (XrmGetFileDatabase this time)

diff --git a/test/.valgrind-suppressions b/test/.valgrind-suppressions
index ffd4a6b..f9f8a86 100644
--- a/test/.valgrind-suppressions
+++ b/test/.valgrind-suppressions
@@ -89,7 +89,7 @@
    fun:__libc_start_main
 }
 {
-   XGetDefault is fairly obnoxious about leaving reachable memory around
+   XrmGetStringDatabase is fairly obnoxious about leaving reachable memory around
    Memcheck:Leak
    fun:malloc
    fun:_XlcAddCT
@@ -102,19 +102,17 @@
    fun:_XrmInitParseInfo
    fun:NewDatabase
    fun:XrmGetStringDatabase
-   fun:XGetDefault
 }
 {
-   XGetDefault is fairly obnoxious about leaving reachable memory around
+   XrmGetStringDatabase is fairly obnoxious about leaving reachable memory around
    Memcheck:Leak
    fun:malloc
    fun:PutEntry
    fun:GetDatabase
    fun:XrmGetStringDatabase
-   fun:XGetDefault
 }
 {
-   XGetDefault is fairly obnoxious about leaving reachable memory around
+   XrmGetStringDatabase is fairly obnoxious about leaving reachable memory around
    Memcheck:Leak
    fun:malloc
    fun:initialize
@@ -124,10 +122,9 @@
    fun:_XrmInitParseInfo
    fun:NewDatabase
    fun:XrmGetStringDatabase
-   fun:XGetDefault
 }
 {
-   XGetDefault is fairly obnoxious about leaving reachable memory around
+   XrmGetStringDatabase is fairly obnoxious about leaving reachable memory around
    Memcheck:Leak
    fun:malloc
    fun:add_codeset
@@ -138,29 +135,26 @@
    fun:_XrmInitParseInfo
    fun:NewDatabase
    fun:XrmGetStringDatabase
-   fun:XGetDefault
 }
 {
-   XGetDefault is fairly obnoxious about leaving reachable memory around
+   XrmInitialize is fairly obnoxious about leaving reachable memory around
    Memcheck:Leak
    fun:malloc
    fun:_XrmInternalStringToQuark
    fun:XrmPermStringToQuark
    fun:XrmInitialize
-   fun:XGetDefault
 }
 {
-   XGetDefault is fairly obnoxious about leaving reachable memory around
+   XrmInitialize is fairly obnoxious about leaving reachable memory around
    Memcheck:Leak
    fun:malloc
    fun:permalloc
    fun:_XrmInternalStringToQuark
    fun:XrmPermStringToQuark
    fun:XrmInitialize
-   fun:XGetDefault
 }
 {
-   XGetDefault is fairly obnoxious about leaving reachable memory around
+   XrmGetStringDatabase is fairly obnoxious about leaving reachable memory around
    Memcheck:Leak
    fun:malloc
    fun:_XlcSetConverter
@@ -169,7 +163,6 @@
    fun:_XrmInitParseInfo
    fun:NewDatabase
    fun:XrmGetStringDatabase
-   fun:XGetDefault
 }
 {
    XrmGetStringDatabase is fairly obnoxious about leaving reachable memory around
@@ -284,3 +277,172 @@
    obj:/lib/ld-2.3.6.so
    obj:/lib/ld-2.3.6.so
 }
+{
+   XrmGetFileDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XlcAddCT
+   fun:_XlcInitCTInfo
+   fun:initialize
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcUtf8Loader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetFileDatabase
+}
+{
+   XrmGetFileDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:PutEntry
+   fun:GetDatabase
+   fun:XrmGetFileDatabase
+}
+{
+   XrmGetFileDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcDefaultLoader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetFileDatabase
+}
+{
+   XrmGetFileDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:add_codeset
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcDefaultLoader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetFileDatabase
+}
+{
+   XrmGetFileDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XlcAddCharSet
+   fun:_XlcAddCT
+   fun:_XlcInitCTInfo
+   fun:initialize
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcUtf8Loader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetFileDatabase
+}
+{
+   XrmGetFileDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:realloc
+   fun:add_codeset
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcDefaultLoader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetFileDatabase
+}
+{
+   XrmGetFileDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XlcCreateDefaultCharSet
+   fun:_XlcAddCT
+   fun:_XlcInitCTInfo
+   fun:initialize
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcUtf8Loader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetFileDatabase
+}
+{
+   XrmGetFileDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XlcCreateDefaultCharSet
+   fun:_XlcAddCT
+   fun:_XlcInitCTInfo
+   fun:initialize
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcUtf8Loader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetFileDatabase
+}
+{
+   XrmGetFileDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XlcAddCT
+   fun:_XlcInitCTInfo
+   fun:initialize
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcUtf8Loader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetFileDatabase
+}
+{
+   XrmGetFileDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XlcCreateLocaleDataBase
+   fun:initialize
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcUtf8Loader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetFileDatabase
+}
+{
+   XrmGetFileDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XlcCreateDefaultCharSet
+   fun:_XlcAddCT
+   fun:_XlcInitCTInfo
+   fun:initialize
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcUtf8Loader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetFileDatabase
+}
+{
+   XrmGetFileDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XlcSetConverter
+   fun:_XlcInitCTInfo
+   fun:initialize
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcUtf8Loader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetFileDatabase
+}
diff-tree 84b06eed4e53eb34b0ec378216fa246286998acd (from 35ec5747ca5eb8a63ec334d61eb13357b4aa3802)
Author: Carl Worth <cworth at cworth.org>
Date:   Sat Jul 1 00:47:59 2006 +0200

    SVG: Fix leak in _cairo_svg_surface_mask

diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c
index 6383a32..b391506 100644
--- a/src/cairo-svg-surface.c
+++ b/src/cairo-svg-surface.c
@@ -1421,6 +1421,7 @@ _cairo_svg_surface_mask (void		    *abst
 				 "  </g>\n"
 				 "</mask>\n");
     _cairo_memory_stream_copy (mask_stream, document->xml_node_defs);
+    _cairo_output_stream_destroy (mask_stream);
 
     snprintf (buffer, sizeof buffer, "mask=\"url(#mask%d);\"",
 	      document->mask_id);
diff-tree 35ec5747ca5eb8a63ec334d61eb13357b4aa3802 (from 80cb0d5ba1e3622b4b71639cf03e7dc277cbb457)
Author: Carl Worth <cworth at cworth.org>
Date:   Sat Jul 1 00:38:06 2006 +0200

    Add yet another XrmGetStringDatabase valgrind suppression.

diff --git a/test/.valgrind-suppressions b/test/.valgrind-suppressions
index 3ffcd81..ffd4a6b 100644
--- a/test/.valgrind-suppressions
+++ b/test/.valgrind-suppressions
@@ -231,6 +231,21 @@
    fun:XrmGetStringDatabase
 }
 {
+   XrmGetStringDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XlcSetConverter
+   fun:_XlcInitCTInfo
+   fun:initialize
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcUtf8Loader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetStringDatabase
+}
+{
    pthread initialization seems to leave some memory possibly lost
    Memcheck:Leak
    fun:calloc
diff-tree 80cb0d5ba1e3622b4b71639cf03e7dc277cbb457 (from 14e7883fae58e51c2deab5b97c9a405c5dbb3aeb)
Author: Carl Worth <cworth at cworth.org>
Date:   Sat Jul 1 00:37:44 2006 +0200

    Fix some leaks in the test suite itself.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index 7103a00..651b9f0 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -1214,6 +1214,8 @@ static void
 cleanup_ps (void *closure)
 {
     ps_target_closure_t *ptc = closure;
+    if (ptc->target)
+	cairo_surface_destroy (ptc->target);
     free (ptc->filename);
     free (ptc);
 }
@@ -1331,6 +1333,8 @@ static void
 cleanup_pdf (void *closure)
 {
     pdf_target_closure_t *ptc = closure;
+    if (ptc->target)
+	cairo_surface_destroy (ptc->target);
     free (ptc->filename);
     free (ptc);
 }
@@ -1442,6 +1446,8 @@ static void
 cleanup_svg (void *closure)
 {
     svg_target_closure_t *ptc = closure;
+    if (ptc->target)
+	cairo_surface_destroy (ptc->target);
     free (ptc->filename);
     free (ptc);
 }
diff-tree 14e7883fae58e51c2deab5b97c9a405c5dbb3aeb (from 8919b6b3243db5db59a73f804854364a00a8586d)
Author: Carl Worth <cworth at cworth.org>
Date:   Sat Jul 1 00:00:43 2006 +0200

    Fix a memory leak by removing accidentally duplicated code.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index b9fcf45..7103a00 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -1473,11 +1473,6 @@ cairo_test_for_target (cairo_test_t *tes
     else
 	offset_str = strdup("");
 
-    if (dev_offset)
-	xasprintf (&offset_str, "-%d", dev_offset);
-    else
-	offset_str = strdup("");
-
     xasprintf (&png_name, "%s-%s-%s%s%s", test->name,
 	       target->name, format, offset_str, CAIRO_TEST_PNG_SUFFIX);
 
diff-tree 8919b6b3243db5db59a73f804854364a00a8586d (from 98cc1651cf19699a0c90e8e2e7f2c2da2ae83760)
Author: Carl Worth <cworth at cworth.org>
Date:   Fri Jun 30 23:24:23 2006 +0200

    Add valgrind suppressions for pthread initialization still reachable/possibly lost memory

diff --git a/test/.valgrind-suppressions b/test/.valgrind-suppressions
index e284591..3ffcd81 100644
--- a/test/.valgrind-suppressions
+++ b/test/.valgrind-suppressions
@@ -230,3 +230,42 @@
    fun:NewDatabase
    fun:XrmGetStringDatabase
 }
+{
+   pthread initialization seems to leave some memory possibly lost
+   Memcheck:Leak
+   fun:calloc
+   obj:/lib/ld-2.3.6.so
+   obj:/lib/ld-2.3.6.so
+   fun:_dl_allocate_tls
+   fun:__pthread_initialize_minimal
+   obj:/usr/lib/debug/libpthread-0.10.so
+   obj:/usr/lib/debug/libpthread-0.10.so
+   obj:/lib/ld-2.3.6.so
+   obj:/lib/ld-2.3.6.so
+   obj:/lib/ld-2.3.6.so
+}
+{
+   pthread initialization seems to leave some memory still reachable
+   Memcheck:Leak
+   fun:calloc
+   fun:_dl_tls_setup
+   fun:__pthread_initialize_minimal
+   obj:/usr/lib/debug/libpthread-0.10.so
+   obj:/usr/lib/debug/libpthread-0.10.so
+   obj:/lib/ld-2.3.6.so
+   obj:/lib/ld-2.3.6.so
+   obj:/lib/ld-2.3.6.so
+}
+{
+   pthread initialization seems to leave some memory possibly lost
+   Memcheck:Leak
+   fun:memalign
+   obj:/lib/ld-2.3.6.so
+   fun:_dl_allocate_tls
+   fun:__pthread_initialize_minimal
+   obj:/usr/lib/debug/libpthread-0.10.so
+   obj:/usr/lib/debug/libpthread-0.10.so
+   obj:/lib/ld-2.3.6.so
+   obj:/lib/ld-2.3.6.so
+   obj:/lib/ld-2.3.6.so
+}
diff-tree 98cc1651cf19699a0c90e8e2e7f2c2da2ae83760 (from f6b10a6aabb121e1a4ca092ca175aad39b3c828d)
Author: Carl Worth <cworth at cworth.org>
Date:   Fri Jun 30 23:21:06 2006 +0200

    Add valgrind suppressions for still-reachable memory from XGetDefault and XrmGetStringDatabase

diff --git a/test/.valgrind-suppressions b/test/.valgrind-suppressions
index 51e12f4..e284591 100644
--- a/test/.valgrind-suppressions
+++ b/test/.valgrind-suppressions
@@ -88,3 +88,145 @@
    fun:exit
    fun:__libc_start_main
 }
+{
+   XGetDefault is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XlcAddCT
+   fun:_XlcInitCTInfo
+   fun:initialize
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcUtf8Loader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetStringDatabase
+   fun:XGetDefault
+}
+{
+   XGetDefault is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:PutEntry
+   fun:GetDatabase
+   fun:XrmGetStringDatabase
+   fun:XGetDefault
+}
+{
+   XGetDefault is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcDefaultLoader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetStringDatabase
+   fun:XGetDefault
+}
+{
+   XGetDefault is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:add_codeset
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcDefaultLoader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetStringDatabase
+   fun:XGetDefault
+}
+{
+   XGetDefault is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XrmInternalStringToQuark
+   fun:XrmPermStringToQuark
+   fun:XrmInitialize
+   fun:XGetDefault
+}
+{
+   XGetDefault is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:permalloc
+   fun:_XrmInternalStringToQuark
+   fun:XrmPermStringToQuark
+   fun:XrmInitialize
+   fun:XGetDefault
+}
+{
+   XGetDefault is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XlcSetConverter
+   fun:_XlcDefaultLoader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetStringDatabase
+   fun:XGetDefault
+}
+{
+   XrmGetStringDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XlcCreateDefaultCharSet
+   fun:_XlcAddCT
+   fun:_XlcInitCTInfo
+   fun:initialize
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcUtf8Loader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetStringDatabase
+}
+{
+   XrmGetStringDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:realloc
+   fun:add_codeset
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcDefaultLoader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetStringDatabase
+}
+{
+   XrmGetStringDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XlcAddCharSet
+   fun:_XlcAddCT
+   fun:_XlcInitCTInfo
+   fun:initialize
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcUtf8Loader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetStringDatabase
+}
+{
+   XrmGetStringDatabase is fairly obnoxious about leaving reachable memory around
+   Memcheck:Leak
+   fun:malloc
+   fun:_XlcCreateLocaleDataBase
+   fun:initialize
+   fun:initialize
+   fun:_XlcCreateLC
+   fun:_XlcUtf8Loader
+   fun:_XOpenLC
+   fun:_XrmInitParseInfo
+   fun:NewDatabase
+   fun:XrmGetStringDatabase
+}
diff-tree f6b10a6aabb121e1a4ca092ca175aad39b3c828d (from c6c943f3cfefa535e6c2da6adcac15507a8f0952)
Author: Carl Worth <cworth at cworth.org>
Date:   Fri Jun 30 23:06:56 2006 +0200

    Add another suppression due to mysterious occurences in libc

diff --git a/test/.valgrind-suppressions b/test/.valgrind-suppressions
index 0f90a7e..51e12f4 100644
--- a/test/.valgrind-suppressions
+++ b/test/.valgrind-suppressions
@@ -78,3 +78,13 @@
    fun:cairo_show_text
    fun:draw
 }
+{
+   XXX: I have no idea what might be causing this
+   Memcheck:Free
+   fun:free
+   fun:free_mem
+   fun:__libc_freeres
+   fun:_vgw_freeres
+   fun:exit
+   fun:__libc_start_main
+}


More information about the cairo-commit mailing list