Composite: Uninitialized borderClipX/borderClipY

Peter Åstrand astrand at cendio.se
Tue Feb 17 11:49:51 PST 2009


Valgrind warned me about two other uninitialized variables, which are not 
padding. Valgrind output at the end. I'm a bit unsure of what these should 
be initialized to, is zero fine? That would be:

--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -138,6 +138,7 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update)
         cw->clients = 0;
         cw->oldx = COMP_ORIGIN_INVALID;
         cw->oldy = COMP_ORIGIN_INVALID;
+       cw->borderClipX = cw->borderClipY = 0;
         cw->damageRegistered = FALSE;
         cw->damaged = FALSE;
         dixSetPrivate(&pWin->devPrivates, CompWindowPrivateKey, cw);

Here's the Valgrind output (using 1.5.3 xserver):

==9865== Conditional jump or move depends on uninitialised value(s)
==9865==    at 0x82954A0: pixman_region_translate (pixman-region.c:1905)
==9865==    by 0x8233CEA: miTranslateRegion (miregion.c:1586)
==9865==    by 0x81861D1: compSetRedirectBorderClip (compwindow.c:657)
==9865==    by 0x8234BF9: miComputeClips (mivaltree.c:261)
==9865==    by 0x8235941: miValidateTree (mivaltree.c:762)
==9865==    by 0x821E09A: MapWindow (window.c:2818)
==9865==    by 0x81F3A83: ProcMapWindow (dispatch.c:696)
==9865==    by 0x81F9F7E: Dispatch (dispatch.c:454)
==9865==    by 0x820F9C5: main (main.c:441)
==9865==  Uninitialised value was created by a heap allocation
==9865==    at 0x4004A74: malloc (vg_replace_malloc.c:207)
==9865==    by 0x824A3A8: Xalloc (utils.c:1339)
==9865==    by 0x81868D6: compRedirectWindow (compalloc.c:111)
==9865==    by 0x818602A: compCreateWindow (compwindow.c:615)
==9865==    by 0x821F850: CreateWindow (window.c:753)
==9865==    by 0x81F34F5: ProcCreateWindow (dispatch.c:522)
==9865==    by 0x81F9F7E: Dispatch (dispatch.c:454)
==9865==    by 0x820F9C5: main (main.c:441)


Regards, 
---
Peter Åstrand		ThinLinc Chief Developer
Cendio AB		http://www.cendio.com
Wallenbergs gata 4
583 30 Linköping	Phone: +46-13-21 46 00


More information about the xorg-devel mailing list