Bug 87868

Summary: memory leak in _cairo_xlib_surface_put_shm
Product: cairo Reporter: Massimo <sixtysix>
Component: xlib backendAssignee: Chris Wilson <chris>
Status: RESOLVED MOVED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Massimo 2014-12-30 16:29:48 UTC
valgrind reports memory leaks running:

.libs/cairo-test-suite -f dash-curve

>==5== 1,056 bytes in 3 blocks are definitely lost in loss record 1 of 9
>==5==    at 0x4A06BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
>==5==    by 0x4CA9785: source.isra.4 (cairo/src/cairo-xlib-source.c:112)
>==5==    by 0x4CA9890: color_source (cairo/src/cairo-xlib-source.c:502)
>==5==    by 0x4CAAA7E: white_source (cairo/src/cairo-xlib-source.c:528)
>==5==    by 0x4CAAA7E: solid_source (cairo/src/cairo-xlib-source.c:607)
>==5==    by 0x4CAAA7E: _cairo_xlib_source_create_for_pattern (cairo/src/cairo-xlib-source.c:1128)
>==5==    by 0x4C90A6B: clip_and_composite (cairo/src/cairo-traps-compositor.c:1024)
>==5==    by 0x4C91ED6: clip_and_composite_traps (cairo/src/cairo-traps-compositor.c:1845)
>==5==
>==5== 1,056 bytes in 3 blocks are definitely lost in loss record 2 of 9
>==5==    at 0x4A06BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
>==5==    by 0x4CA9785: source.isra.4 (cairo/src/cairo-xlib-source.c:112)
>==5==    by 0x4CA9890: color_source (cairo/src/cairo-xlib-source.c:502)
>==5==    by 0x4CAA36E: opaque_source (cairo/src/cairo-xlib-source.c:555)
>==5==    by 0x4CAA36E: solid_source (cairo/src/cairo-xlib-source.c:609)
>==5==
>==5== 7,072 bytes in 1 blocks are definitely lost in loss record 9 of 9
>==5==    at 0x4A06BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
>==5==    by 0x4CAFEEB: _cairo_xlib_surface_put_shm (cairo/src/cairo-xlib-surface-shm.c:1107)
>==5==    by 0x4CAB858: _cairo_xlib_surface_flush (cairo/src/cairo-xlib-surface.c:1501)
>==5==    by 0x4C7E6CC: _cairo_surface_finish_snapshots (cairo/src/cairo-surface.c:1017)
>==5==    by 0x4C7E6CC: cairo_surface_destroy (cairo/src/cairo-surface.c:961)

In _cairo_xlib_display_destroy (src/cairo-xlib.c) the
cairo_surfaces:

display->white
display->alpha[0:255]
display->solid[0:16]

are not destroyed. And in _cairo_xlib_surface_put_shm and
_cairo_xlib_surface_update_shm (src/cairo-xlib-surface-shm.c)
'rects' is not freed when rects != stack_rects.
Comment 1 GitLab Migration User 2018-08-25 13:50:10 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/220.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.