Created attachment 118459 [details] 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.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/482.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.