Bug 110315 - GDM miscounts current sessions
Summary: GDM miscounts current sessions
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gdm
Version: rawhide
Hardware: i686
OS: Linux
high
high
Target Milestone: ---
Assignee: Havoc Pennington
QA Contact:
URL:
Whiteboard:
Depends On: 114986
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-11-18 11:53 UTC by Phil Anderson
Modified: 2007-11-30 22:10 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-02-02 19:49:20 UTC
Type: ---
Embargoed:


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

Description Phil Anderson 2003-11-18 11:53:32 UTC
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 10:10:48 UTC
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 22:11:19 UTC
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 05:16:06 UTC
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-02 01:29:31 UTC
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-02 03:03:27 UTC
Created attachment 97406 [details]
gdm-2.4.4.5-7.spec.diff

* Sun Feb 01 2004 Warren Togami <wtogami> 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 19:49:20 UTC
You should see this in rawhide soon.

Comment 7 Warren Togami 2004-02-04 05:43:34 UTC
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-10 04:40:42 UTC
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.