DisableDevice() leaks SyncCounter resources
Submitted by spi..@..oo.net
Assigned to Xorg Project Team
Description
Created attachment 118459 Patch to free SyncCounters.
DisableDevice() leaks SyncCounter resources when you ctrl-alt-F# out of X, ultimately leading to resource exhaustion. I've verified the leak on Debian xorg-server packages 1.16.4-1 and 1.17.2-1.1.
To reproduce the leak: Start an X server. Start xrestop, and take a look
at the line for res-base 0000000. It looks something like:
res-base Wins GCs Fnts Pxms Misc Pxm mem Other Total PID Identifier
0000000 1 0 2 0 48 0B 3K 3K ? <unknown>
Use control-alt-function-key to switch to another VT, then switch back to X. The Misc column, on my computer, goes up by seven on each switch out of X.
I've attached a patch that seemss to fix the problem (tested against Debian xorg-server 1.16.4-1 and 1.17.2-1.1 source packages, seems to be working so far) It should be noted that I don't know how FreeResource() is supposed to be called, it just looks right and hasn't crashed yet.
I'm assuming this will affect all architectures and any OS that triggers DisableDevice(); the affected machine is a Debian Linux machine with an amd64 processor.
Attachment 118459, "Patch to free SyncCounters.":
free-synccounters.diff
Version: 7.7 (2012.06)