After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 606724 - Xdmcp fail to show greeter at second time
Xdmcp fail to show greeter at second time
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.29.x
Other All
: Normal critical
: ---
Assigned To: GDM maintainers
GDM maintainers
: 610264 (view as bug list)
Depends on: 494817
Blocks:
 
 
Reported: 2010-01-12 10:43 UTC by Halton Huo
Modified: 2010-04-22 21:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove display from XDMCP factory store when the display is finished or fail (2.16 KB, patch)
2010-01-12 10:54 UTC, Halton Huo
committed Details | Review

Description Halton Huo 2010-01-12 10:43:31 UTC
With patch for bug #494817, the XDMCP greeter are shown and capable to login. 

But when I logout and try to connect second time, the greeter fails to show up anymore. Here is the log when I trun on debug.

[...]
Jan  6 17:38:22 judo gdm-binary[21028]: [ID 702911 daemon.warning] DEBUG(+): GdmXdmcpDisplayFactory: Got REQUEST from 129.158.217.118
Jan  6 17:38:22 judo gdm-binary[21028]: [ID 702911 daemon.warning] DEBUG(+): GdmXdmcpDisplayFactory: xdmcp_pending=0, MaxPending=4, xdmcp_sessions=0, MaxSessions=16, ManufacturerID=
Jan  6 17:38:22 judo gdm-binary[21028]: [ID 702911 daemon.warning] DEBUG(+): GdmXdmcpDisplayFactory: Maximum number of open XDMCP sessions from host 129.158.217.118 reached
Jan  6 17:38:22 judo gdm-binary[21028]: [ID 702911 daemon.warning] DEBUG(+): GdmXdmcpDisplayFactory: Sending DECLINE to 129.158.217.118
[...]
Comment 1 Halton Huo 2010-01-12 10:54:44 UTC
Created attachment 151238 [details] [review]
Remove display from XDMCP factory store when the display is finished or fail

After investigation, I found it is because the display is not remove when it is finished. Same with what we did in daemon/gdm-local-display-factory.c, we should remove the display when its  status changed to GDM_DISPLAY_FINISHED and GDM_DISPLAY_FAILED in daemon/gdm-xdmcp-display-factory.c.
Comment 2 Ray Strode [halfline] 2010-01-13 17:18:21 UTC
So one thing I don't understand is...The code already does:

display_dispose_check (factory, hostname, clnt_dspnum);

upon a new connection which looks like it should clean things up.  Do you know why that isn't working?

Also, I notice the other display types have a finish method that calls unmanage, but xdmcp doesn't.  I wonder if that's relevant.

I think I need to understand a little bit better what's going on here, before I'd feel comfortable committing attachment 151238 [details] [review]
Comment 3 Halton Huo 2010-01-14 04:15:44 UTC
(In reply to comment #2)
> So one thing I don't understand is...The code already does:
> 
> display_dispose_check (factory, hostname, clnt_dspnum);
> 
> upon a new connection which looks like it should clean things up.  Do you know
> why that isn't working?
With debugging, display_dispose_check() is invoked when getting REQUEST from remote hosts.

At that time the displays in store are not created as GDM_XDMCP_DISPLAY, so it return FALSE in remove_host(). The following messages should be helpful (some message are added in my local code base). 

Jan 14 12:06:52 judo gdm-binary[18541]: [ID 702911 daemon.warning] DEBUG(+): GdmXdmcpDisplayFactory: Received opcode REQUEST from client 129.158.217.94 : 388
98
Jan 14 12:06:52 judo gdm-binary[18541]: [ID 702911 daemon.warning] DEBUG(+): GdmXdmcpDisplayFactory: Got REQUEST from 129.158.217.94
Jan 14 12:06:52 judo gdm-binary[18541]: [ID 702911 daemon.warning] DEBUG(+): GdmXdmcpDisplayFactory: xdmcp_pending=0, MaxPending=4, xdmcp_sessions=0, MaxSess
ions=16, ManufacturerID=
Jan 14 12:06:52 judo gdm-binary[18541]: [ID 702911 daemon.warning] DEBUG(+): GdmXdmcpDisplayFactory: entered =1
Jan 14 12:06:52 judo gdm-binary[18541]: [ID 702911 daemon.warning] DEBUG(+): GdmXdmcpDisplayFactory: display_dispose_check (129.158.217.94:0)
Jan 14 12:06:52 judo gdm-binary[18541]: [ID 702911 daemon.warning] DEBUG(+): display_dispose_check count=0
Jan 14 12:06:52 judo gdm-binary[18541]: [ID 702911 daemon.warning] DEBUG(+): display_dispose_check is not xdmcp display
Jan 14 12:06:52 judo gdm-binary[18541]: [ID 702911 daemon.warning] DEBUG(+): GdmXdmcpDisplayFactory: Creating xdmcp display for 129.158.217.94:0

I think that is right behavior because this display is not managed during REQUEST phase, am I right? 
> 
> Also, I notice the other display types have a finish method that calls
> unmanage, but xdmcp doesn't.  I wonder if that's relevant.
I have no idea, do you need me do some trying?

> 
> I think I need to understand a little bit better what's going on here, before
> I'd feel comfortable committing attachment 151238 [details] [review]
Comment 4 Halton Huo 2010-01-21 15:29:14 UTC
Ping, does the patch looks good?
Comment 5 José Alburquerque 2010-02-18 19:09:17 UTC
I tested this patch and it does allow for re-logging in after logging out using XDMCP (see bug #610264).  However, multiple logins (at the same time) using XDMCP does not seem possible.  Maybe this bug can address that also?
Comment 6 José Alburquerque 2010-02-18 19:41:00 UTC
*** Bug 610264 has been marked as a duplicate of this bug. ***
Comment 7 Brian Cameron 2010-02-18 20:30:34 UTC
When you say that multiple logins at the same time are not allowed, you need to provide more detail about this.  Note that GDM does have configuration options like xdmcp/DisplaysPerHost which is set to 1 by default, only allowing one login from the same machine at a time.  If you are trying to login to XDMCP multiple times from the same machine, then you need to configure GDM to allow this.  Refer to the manual:

http://library.gnome.org/admin/gdm/2.28/configuration.html.en#xdmcpsection

If this doesn't fix the problem, please edit /etc/gdm/custom.conf so it has these lines:

[debug]
Enable=true

Then, restart GDM.  Now GDM will output debug messages to your syslog (/var/log/messages or /var/adm/messages depending on your system).

Now try to login multiple times so that the failure happens, and after the failure happens, attach the gdm-related debug messages from the bottom of your syslog to the bug report so we can help with analysis.  Usually the debug messages will highlight what is going wrong.
Comment 8 José Alburquerque 2010-02-18 21:38:05 UTC
Okay.  From the information you provided, there is no problem with multiple logins.  Increasing the number of displays per host for XDMCP allows multiple logins with no problems.

If there is no other fix for this bug, I recommend that this patch be applied so that there are no problems when logging out.
Comment 9 José Alburquerque 2010-03-08 21:17:07 UTC
I can now report that this bug is not an issue in release 2.29.6.  Thanks.
Comment 10 Brian Cameron 2010-03-08 21:25:22 UTC
Jose, I'm confused.  The fix for this bug did not go into 2.29.6.  Are you sure that the problem is not happening anymore?  

What version of GDM were you using before when it didn't work?  I don't see any fixes to the XDMCP code between version 2.29.5 and 2.29.6.
Comment 11 José Alburquerque 2010-03-08 22:01:04 UTC
That's odd.  I was experiencing this on this system (ubuntu 10.04) before a recent gdm upgrade.  I wanted to see if the bug was still there after the upgrade out of curiosity and now the bug is gone.

Honestly, it's hard to know what was happening before.  All I can say is that I was experiencing this bug, the patch fixed it, removing the patch broke it, but this most recent upgrade does not exhibit the behavior.  I did not apply the patch for the bug to disappear.

Maybe it was inadvertently fixed while attending another issue. I can definitely confirm that I'm not using a locally compiled version but rather the system package that was provided with the upgrade.

Maybe the original reporter can test also.
Comment 12 Halton Huo 2010-03-11 10:11:49 UTC
(In reply to comment #11)
Jose, if I did not apply this patch on gdm-2.29.92 release on OpenSolaris, this bug is still there.

How did you test on Ubuntu then?

Here is my steps on OpenSolaris:
1) Edit /etc/gdm/custom.conf
   Add Enable=true in section [xdmcp]. Add Enable=true also in [debug] for issue tracking.
2) #svcadm restart gdm
   #svcadm enable xvnc-inetd
3) On client, vncviewer <my_server>,  close it after connected.
4) Do step 3) again
Expected result:
  vncviewer can connect my server more than once.

Actual result:
  vncviewer can not connect my server at second time.
Comment 13 José Alburquerque 2010-03-11 20:56:17 UTC
My custom.conf file is similar to yours (see bug #610264).  The way I tested this patch was to use the apt-build tool on ubuntu so I could download the system package source, apply the patch and then have the tool re-build the package which could then be installed in place of the system package for testing.  This was the easiest way I could find to make sure the patch was good.  When I reverted to the system package, the bug re-appeared.

A few days later, there were one or two other gdm update for this system.  Since I know this bug has been reported, I would see if this bug disappeared, testing the same way you describe in steps 3 and 4 (making sure that gdm had been restarted, of course).  With a recent update, I noticed that multiple login/logout sessions were now possible so I thought the bug had been fixed.  But apparently it is not fixed for you.

Just now, I removed the apt-build package line from my system package repositories (so packages that apt-build made would not be available for installation), reloaded the sources and re-installed gdm (the same version that you just reported you used on OpenSolaris -- 2.29.92), rebooted the system (to be sure that everything new would be used), and tested multiple login/logout sessions witch Vnc successfully.  I just don't know what changed, but the bug has disappeared for me.

Oh well.  If more information is needed from me I'd be happy to provide it.
Comment 14 José Alburquerque 2010-03-24 22:50:12 UTC
Now I'm experiencing the bug again.  I honestly don't know what's going on so please ignore my postings about this bug disappearing until the developers can determine what is really happening with this bug.
Comment 15 Halton Huo 2010-03-25 02:20:36 UTC
Could you apply the patch and try again?
Comment 16 José Alburquerque 2010-03-25 19:07:08 UTC
The patch still applies cleanly and makes the bug disappear when it is exhibitted.
Comment 17 Halton Huo 2010-03-26 01:47:22 UTC
Nice, Ray and Brian, does it make sense to commit the patch?
Comment 18 Michael Young 2010-03-29 14:22:12 UTC
I am seeing a probably related bug in 2.28 on Fedora 12 (see https://bugzilla.redhat.com/show_bug.cgi?id=562143 ), where gdm doesn't clean up properly after an xdmcp session ends resulting in gdm leaking file descriptors and eventually breaking when all the file descriptors are used up. I have proposed a patch https://bugzilla.redhat.com/attachment.cgi?id=399058 which fixes the problem I am seeing and may also fix your problem.
Comment 19 Halton Huo 2010-03-30 07:46:14 UTC
I tried the patch in comment #18 without my patch in comment #1. This bug still appears.
Comment 20 Ray Strode [halfline] 2010-03-31 18:00:56 UTC
Now that 2.30.0 is out the door we should make sure we land this, the patch from comment 18, or some combination there of for the next stable release.
Comment 21 Brian Cameron 2010-04-22 21:16:45 UTC
I committed the patch attached and the patch in comment #18, so marking this bug as fixed.