This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 110315 - GDM miscounts current sessions
GDM miscounts current sessions
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gdm (Show other bugs)
rawhide
i686 Linux
high Severity high
: ---
: ---
Assigned To: Havoc Pennington
:
Depends On: 114986
Blocks:
  Show dependency treegraph
 
Reported: 2003-11-18 06:53 EST by Phil Anderson
Modified: 2007-11-30 17:10 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-02-02 14:49:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
gdm-2.4.4.5-xdmcp_sessions.patch (1.66 KB, patch)
2004-02-01 20:29 EST, Warren Togami
no flags Details | Diff
gdm-2.4.4.5-7.spec.diff (3.62 KB, text/plain)
2004-02-01 22:03 EST, Warren Togami
no flags Details

  None (edit)
Description Phil Anderson 2003-11-18 06:53:32 EST
Description of problem:
GDM in fedora core 1 has broken 'Maximum Number of Sessions' in XDCMP.
 Instead of counting concurrent sessions, it counts the sessions which
have happened since the gdm process started.  i.e. it seems to forget
to subtract 1 from the session count when someone logs out.

After 16 log ins and log outs, you get 'XDCMP fatal error: Session
declined Maximum number of open sessions reached'

Version-Release number of selected component (if applicable):
2.4.4.5-1

How reproducible:
Always



Steps to Reproduce:
Log in and out 16 times with XDCMP.
  
Actual results:
17th time will fail.

Expected results:
17th time will work.

Additional info:
Work around is to either restart gdm regularly, or set the limit to 9999.

There are no signs of stray processes from old sessions, so it seems
like the old sessions are logging out correctly.
Comment 1 Warren Togami 2004-01-28 05:10:48 EST
Still broken in rawhide.  This is particularly crippling for K12LTSP
and my LUG's super-linux-advocacy presentation of K12LTSP at a huge
educator's conference on February 3rd.  Help!!!
Comment 2 Phil Anderson 2004-01-28 17:11:19 EST
The work around which I'm using is to set in your /etc/X11/gdm/gdm.conf

MaxSessions=9999

And I restart gdm nightly.
Comment 3 Stephen Walton 2004-01-29 00:16:06 EST
I don't know if this helps, but I had a chance to look at the source
code and compare it with an older version of gdm.  The culprit seems
to be in display.c lines 411 ff:

    if (d->type == TYPE_XDMCP) {
        if (d->dispstat == XDMCP_MANAGED)
                xdmcp_sessions--;
        else if (d->dispstat == XDMCP_PENDING)
                xdmcp_pending--;
                                                                     
          
        d->type = -1;
    }

In the older version the same code read

    if (d->type == TYPE_XDMCP) {
        xdmcp_sessions--;
        if (d->dispstat == XDMCP_PENDING)
               xdmcp_pending--;
                                                                     
                  d->type = -1;
    }

If you look in xdmcp.c, routine gdm_xdmcp_display_alloc increments
xdmcp_pending when it creates a PENDING display, and
gdm_xdmcp_handle_manage decrements xdmcp_pending and increments
xdmcp_sessions when converting a PENDING display to an actual one.  So
the first form of the code above <i>looks</i> correct, but obviously
isn't doing the right thing for some reason.
Comment 4 Warren Togami 2004-02-01 20:29:31 EST
Created attachment 97405 [details]
gdm-2.4.4.5-xdmcp_sessions.patch

It turns out to be a race condition already fixed in gdm-2.5.90.0.  I copied
and tested the relevant code from upstream into this patch.  Tested in FC2
rawhide only.  Please test in FC1.
Comment 5 Warren Togami 2004-02-01 22:03:27 EST
Created attachment 97406 [details]
gdm-2.4.4.5-7.spec.diff

* Sun Feb 01 2004 Warren Togami <wtogami@redhat.com> 1:2.4.4.5-8
- patch30 xdmcp_session counter fix from gdm-2.5.90.0 #110315
- automake14 really needed, not automake
- BR libcroco-devel, libcroco-devel, libattr-devel, gettext
- conditionally BR libselinux-devel
- explicit epoch in all deps
Comment 6 Warren Togami 2004-02-02 14:49:20 EST
You should see this in rawhide soon.
Comment 7 Warren Togami 2004-02-04 00:43:34 EST
https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=97457&action=view
updated xdmcp_sessions patch adds two missing lines from upstream CVS
Comment 8 Stephen Walton 2004-02-09 23:40:42 EST
I know this is closed but wanted to post that the fix works for me. 
Thanks, Warren!

Note You need to log in before you can comment on or make changes to this bug.