OpenSolaris

Printable Version Enter a New Search
Bug ID 6533650
Synopsis client privates memory leak in Xorg 7.2
State 10-Fix Delivered:Verified (Fix available in build)
Category:Subcategory xserver:xorg-server
Keywords testcase
Responsible Engineer Alan Coopersmith
Reported Against
Duplicate Of
Introduced In
Commit to Fix snv_61
Fixed In snv_61
Release Fixed solaris_nevada(snv_61) , solaris_10u4(s10u4_06) (Bug ID:2147523)
Related Bugs
Submit Date 12-March-2007
Last Update Date 16-March-2007
Description
This X.Org upstream patch should be incorporated into the Solaris builds of Xorg 7.2:


Date: Thu, 15 Feb 2007 17:09:00 +0000 (+0200)
Subject: os: fix client privates leak
X-Git-Url: http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=commitdiff;h=811675733e97416c990e6dc9c19271b43d96248d

os: fix client privates leak
Minor leak here.  Oops.
---

--- a/os/connection.c
+++ b/os/connection.c
@@ -1066,6 +1066,8 @@ CloseDownConnection(ClientPtr client)
     XdmcpCloseDisplay(oc->fd);
 #endif
     CloseDownFileDescriptor(oc);
+    FreeOsBuffers(oc);
+    xfree(client->osPrivate);
     client->osPrivate = (pointer)NULL;
     if (auditTrailLevel > 1)
 	AuditF("client %d disconnected\n", client->index);
*** Test Case ***
Requires machine configured to run Xorg
Stop dtlogin/gdm/X on console.
Run the following script (also saved as an attachment to this bug report).
Before this fix it should report several memory leaks from EstablishNewConnections,
with this fix in place it should report 0 memory leaks from EstablishNewConnections.

#!/bin/ksh

cd /tmp

PATH=/usr/X11/bin:/usr/openwin/bin:$PATH ; export PATH

LD_PRELOAD=libumem.so UMEM_DEBUG=default \
  xinit /usr/openwin/bin/xlogo -- /usr/X11/bin/Xorg :0 >> Xorg.out.$$ 2>&1 &

DISPLAY=:0 ; export DISPLAY

sleep 5

i=0
while [ $i -lt 10 ] ; do
    xdpyinfo >> /dev/null
    i=$(($i+1))
done

Xpid=$(pgrep Xorg)
gcore -o Xorg.core $Xpid
kill $Xpid

mdb_output=mdb.out.$$

mdb Xorg.core.$Xpid > $mdb_output 2>&1 <<EOF
::findleaks -d
EOF


connleaks=$( grep -c EstablishNewConnections $mdb_output )
echo "$connleaks leaks from EstablishNewConnections"

rm Xorg.core.$Xpid Xorg.out.$$ mdb.out.$$
Work Around
N/A
Comments
N/A