Bug 206955

Summary: Can't create more than 256 connections to X display
Product: Red Hat Enterprise Linux 4 Reporter: Bastien Nocera <bnocera>
Component: xorg-x11Assignee: Adam Jackson <ajax>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: 4.0CC: desktop-bugs, dmair, tao, xgl-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-10-11 20:06:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 234251, 325581    
Attachments:
Description Flags
test.c none

Description Bastien Nocera 2006-09-18 14:15:03 UTC
xorg-x11-libs-6.8.2-1.EL.13.25

After opening loads of xterms, or other X clients, we'd get the error:
Xlib: connection to ":0.0" refused by server
Xlib: Maximum number of clients reached
xterm Xt error: Can't open display: sunultra20b:0.0

One way to reproduce is to run:
for i in `seq 1 255`; do xlogo & done
and see the ~240th instances and subsequent ones fail to connect to the display

bug 176328 for RHEL3 isn't related, as it was about XOpenDisplay failing when
the first fd would be >= 256.

It isn't related to upstream:
https://bugs.freedesktop.org/show_bug.cgi?id=2920
as the electricsheep screensaver isn't being used.

Comment 1 Bastien Nocera 2006-09-18 14:15:07 UTC
Created attachment 136545 [details]
test.c

Comment 7 Adam Jackson 2007-05-03 22:01:05 UTC
XIDs are the global namespace for objects in the X protocol.  Clients are
assigned a range when they connect, and subsequent allocations happen from that
pool.

The XID itself is allocated as follows:

3 bits reserved (for no good reason)
N bits of client ID
M bits of resource ID

where N is defined by the MAXCLIENTS define in the server source.  Which means
right now, we have 8 bits for client ID and 21 for resource ID.  This patch
would move one bit to the client ID space, which has the side effect of reducing
the number of resources per client from 2millionish to 1millionish.  This is
probably not a problem.  However we may want to add an option somewhere to allow
the user to switch this at server startup.

Comment 8 RHEL Program Management 2007-05-09 09:36:10 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 9 Adam Jackson 2007-08-02 00:15:32 UTC
Built as xorg-x11 6.8.2-1.EL.25.  MODIFIED.

Comment 11 Cameron Meadors 2007-10-09 20:44:46 UTC
Not fixed.  Used the shell loop:

for a in `seq 1 256`; do xlogo & done

hit the limit at 253.  I have some clients already opened.  Starting a new one
explicitly says the limit was hit.



Comment 14 Jonathan Blandford 2007-10-11 20:06:59 UTC

*** This bug has been marked as a duplicate of 230217 ***