[Xcb] XPutImage to a pixmap is leaking memory

Guillaume Foliard guifo at wanadoo.fr
Thu Jun 3 07:29:08 PDT 2010


Hello,

On Wednesday 02 June 2010 07:16:02 Jamey Sharp wrote:
> On Tue, Jun 1, 2010 at 12:56 PM, Guillaume Foliard <guifo at wanadoo.fr> wrote:
> > Here is the Valgrind trace with debug symbols :
> > 
> > ==6811== 15,984 bytes in 999 blocks are indirectly lost in loss record 21
> > of 25
> > ==6811==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)
> > ==6811==    by 0x3B3860A6B1: _xcb_in_read (xcb_in.c:225)
> > ==6811==    by 0x3B386088EC: _xcb_conn_wait (xcb_conn.c:325)
> > ==6811==    by 0x3B38608D86: _xcb_out_send (xcb_out.c:338)
> > ==6811==    by 0x3B38609034: xcb_writev (xcb_out.c:286)
> > ==6811==    by 0x3B38A4D419: _XSend (xcb_io.c:339)
> > ==6811==    by 0x3B38A3985C: PutSubImage (PutImage.c:804)
> > ==6811==    by 0x3B38A38B50: PutSubImage (PutImage.c:919)
> > ==6811==    by 0x3B38A39A3D: XPutImage (PutImage.c:1029)
> > ==6811==    by 0x400B9D: main (put_image.c:76)
> 
> Right, you received a response from the server which you haven't
> consumed. This doesn't look like a bug in either Xlib or XCB. Did you
> try checking for events like I suggested?

You are right, after each XCopyArea an event NoExposure is waiting. Calling 
XNextEvent to consume it makes what I believed to be a "memory leak" 
disappear.
I read a bit about XCopyArea and generated events and I think we can conclude 
there is no bug, nor in XCB neither in Xlib.

Thank you for your efficient help !

Guillaume




More information about the Xcb mailing list