[Xcb] uninitialized byted when a connection is created

Jamey Sharp jamey at minilop.net
Sun May 15 15:10:53 PDT 2005


On Sun, 2005-05-15 at 22:31 +0200, Vincent Torri wrote:
> Hello,

Hi Vincent!

> i've done the simpliest program for xcb :
> 
>   XCBConnection *c;
>   c = XCBConnectBasic ();
> 
> i run it through valgrind. I obtain:

Good! I should do that more often.

> ==31232== 1 errors in context 1 of 1:
> ==31232== Syscall param write(buf) points to uninitialised byte(s)
> ==31232==    at 0x1B9F4923: write (in /lib/tls/libc-2.3.3.so)
> ==31232==    by 0x1B919C25: _xcb_out_write (xcb_out.c:194)
> ==31232==    by 0x1B9195CC: _xcb_conn_wait (xcb_conn.c:224)
> ==31232==    by 0x1B91A0D8: _xcb_out_flush (xcb_out.c:267)
> ==31232==    by 0x1B919041: write_setup (xcb_conn.c:68)
> ==31232==    by 0x1B9192B2: XCBConnect (xcb_conn.c:140)
> ==31232==    by 0x1B91B832: XCBConnectBasic (xcb_util.c:152)
> ==31232==    by 0x804849D: main (in /home/torri/algo/xcb_test/test1)
> ==31232==  Address 0x1BA6E461 is 4257 bytes inside a block of size 8472
> alloc'd
> ==31232==    at 0x1B902F75: calloc (vg_replace_malloc.c:175)
> ==31232==    by 0x1B91922F: XCBConnect (xcb_conn.c:134)
> ==31232==    by 0x1B91B832: XCBConnectBasic (xcb_util.c:152)
> ==31232==    by 0x804849D: main (in /home/torri/algo/xcb_test/test1)
> 
> Is it normal ? If not, does someone see where the problem is ?

It is "normal", in the sense that it's been that way for a pretty long
time. I do think it's odd that you seem to have 4kB of authentication
data though.

XCB has a handful of different valgrind warnings about uninitialized
writes, because it doesn't initialize most padding bytes. Jim Gettys
once pointed me at a claim, unsubstantiated as I recall, that
compression ratios improve by zeroing those bytes. True or not, it would
at least make valgrind happy...

--Jamey



More information about the xcb mailing list