Bug 92131

Summary: DisableDevice() leaks SyncCounter resources
Product: xorg Reporter: spikycaterpillar_opensourcesupport_leave_spamblocker_in_to_maintain_deliverability
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED MOVED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: 7.7 (2012.06)   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Patch to free SyncCounters. none

Description spikycaterpillar_opensourcesupport_leave_spamblocker_in_to_maintain_deliverability 2015-09-26 23:15:10 UTC
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.
Comment 1 GitLab Migration User 2018-12-13 22:33:02 UTC
-- 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.