FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 05-26-2008, 11:08 PM
Kjartan Maraas
 
Default SESSION_MANAGER env var in rawhide and XSMP spec

Hi

I've been trying to track down some issues with gnome-session in GNOME
2.23.x which is in rawhide now. I first noticed this when trying out a
jhbuild of GNOME 2.23.x, but then noticed that rawhide suffers from the
same symptoms. A bunch of processes are left in [defunct] state after
login and starting new programs complains about not being able to
connect to the session manager.

After some investigation and help from one of the gnome-session
maintainers we noticed that the SESSION_MANAGER env var in rawhide
differs from other distros. What I see in rawhide is this:

[kmaraas@localhost gnome-session]$ echo $SESSION_MANAGER
local/unix:@/tmp/.ICE-unix/2994

and he had:

local/henderson:/tmp/.ICE-unix/14577

The XSMP spec has this to say:

The client finds the network address of the SM in a system-dependent way. On POSIX systems an environment
variable called SESSION_MANAGER will contain a list of network IDs. Each id will contain the
transport name followed by a slash and the (transport-specific) address. A TCP/IP address would look like
this:
tcp/hostnameortnumber
where the hostname is a fully qualified domain name. A Unix Domain address looks like this:
local/hostnameath
A DECnet address would look like this:
decnet/nodename:bjname
If multiple network IDs are specified, they should be separated by commas.

Is the current format in rawhide according to spec?
And does gnome-session just have to be updated to handle this format?

Cheers
Kjartan


--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 05-26-2008, 11:52 PM
"Colin Walters"
 
Default SESSION_MANAGER env var in rawhide and XSMP spec

On Mon, May 26, 2008 at 7:08 PM, Kjartan Maraas <kmaraas@broadpark.no> wrote:

> [kmaraas@localhost gnome-session]$ echo $SESSION_MANAGER
> local/unix:@/tmp/.ICE-unix/2994

I believe this change is described here:
http://www.redhat.com/archives/rhl-devel-list/2007-October/msg00034.html

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 05-27-2008, 02:14 PM
Adam Jackson
 
Default SESSION_MANAGER env var in rawhide and XSMP spec

On Tue, 2008-05-27 at 01:08 +0200, Kjartan Maraas wrote:
> Hi
>
> I've been trying to track down some issues with gnome-session in GNOME
> 2.23.x which is in rawhide now. I first noticed this when trying out a
> jhbuild of GNOME 2.23.x, but then noticed that rawhide suffers from the
> same symptoms. A bunch of processes are left in [defunct] state after
> login and starting new programs complains about not being able to
> connect to the session manager.
>
> After some investigation and help from one of the gnome-session
> maintainers we noticed that the SESSION_MANAGER env var in rawhide
> differs from other distros. What I see in rawhide is this:
>
> [kmaraas@localhost gnome-session]$ echo $SESSION_MANAGER
> local/unix:@/tmp/.ICE-unix/2994
>
> and he had:
>
> local/henderson:/tmp/.ICE-unix/14577

I'm not aware of any code placing semantic meaning on the
SESSION_MANAGER variable. libSM doesn't even look at the right hand
side of the / in the transport spec when the transport is "local", so
the different hostnames shouldn't matter.

That said, that change didn't actually fix the bug I put it in to try to
fix, so I should probably just back it out.

- ajax
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 05-27-2008, 04:56 PM
Kjartan Maraas
 
Default SESSION_MANAGER env var in rawhide and XSMP spec

ti., 27.05.2008 kl. 10.14 -0400, skrev Adam Jackson:
> On Tue, 2008-05-27 at 01:08 +0200, Kjartan Maraas wrote:
> > Hi
> >
> > I've been trying to track down some issues with gnome-session in GNOME
> > 2.23.x which is in rawhide now. I first noticed this when trying out a
> > jhbuild of GNOME 2.23.x, but then noticed that rawhide suffers from the
> > same symptoms. A bunch of processes are left in [defunct] state after
> > login and starting new programs complains about not being able to
> > connect to the session manager.
> >
> > After some investigation and help from one of the gnome-session
> > maintainers we noticed that the SESSION_MANAGER env var in rawhide
> > differs from other distros. What I see in rawhide is this:
> >
> > [kmaraas@localhost gnome-session]$ echo $SESSION_MANAGER
> > local/unix:@/tmp/.ICE-unix/2994
> >
> > and he had:
> >
> > local/henderson:/tmp/.ICE-unix/14577
>
> I'm not aware of any code placing semantic meaning on the
> SESSION_MANAGER variable. libSM doesn't even look at the right hand
> side of the / in the transport spec when the transport is "local", so
> the different hostnames shouldn't matter.
>
No, I don't think it's really the difference in semantics that causes
gnome-session to break after all. The code only seems to look at the
"local/" part of the string anyway. The code is like this:

/**
* gsm_xsmp_init:
*
* Initializes XSMP. Notably, it creates the XSMP listening socket and
* sets the SESSION_MANAGER environment variable to point to it.
**/
void
gsm_xsmp_init (void)
{
char error[256];
mode_t saved_umask;
IceListenObj *listeners;
int num_listeners;
int i, local_listener;

/* Set up sane error handlers */
IceSetErrorHandler (ice_error_handler);
IceSetIOErrorHandler (ice_io_error_handler);
SmsSetErrorHandler (sms_error_handler);

/* Initialize libSM; we pass NULL for hostBasedAuthProc to disable
* host-based authentication.
*/
if (!SmsInitialize (PACKAGE, VERSION, accept_xsmp_connection,
NULL, NULL, sizeof (error), error))
gsm_initialization_error (TRUE, "Could not initialize libSM: %s", error);

#ifdef HAVE_X11_XTRANS_XTRANS_H
/* By default, IceListenForConnections will open one socket for each
* transport type known to X. We don't want connections from remote
* hosts, so for security reasons it would be best if ICE didn't
* even open any non-local sockets. So we use an internal ICElib
* method to disable them here. Unfortunately, there is no way to
* ask X what transport types it knows about, so we're forced to
* guess.
*/
_IceTransNoListen ("tcp");
#endif

/* Create the XSMP socket. Older versions of IceListenForConnections
* have a bug which causes the umask to be set to 0 on certain types
* of failures. Probably not an issue on any modern systems, but
* we'll play it safe.
*/
saved_umask = umask (0);
umask (saved_umask);
if (!IceListenForConnections (&num_listeners, &listeners,
sizeof (error), error))
gsm_initialization_error (TRUE, _("Could not create ICE listening socket: %s"), error);
umask (saved_umask);

/* Find the local socket in the returned socket list. */
local_listener = -1;
for (i = 0; i < num_listeners; i++)
{
char *id = IceGetListenConnectionString (listeners[i]);

if (!strncmp (id, "local/", sizeof ("local/") - 1))
{
local_listener = i;
xsmp_network_id = g_strdup (id);
g_free (id);
break;
}

g_free (id);
}

if (local_listener == -1)
gsm_initialization_error (TRUE, "IceListenForConnections did not return a local listener!");

if (num_listeners == 1)
xsmp_sockets = listeners;
else
{
/* Xtrans was apparently compiled with support for some
* non-local transport besides TCP (which we disabled above). We
* close those additional sockets here. (There's no API for
* closing a subset of the returned connections, so we have to
* cheat...)
*
* If the g_warning below is triggering for you and you want to
* stop it, the fix is to add additional _IceTransNoListen()
* calls above.
*/
IceListenObj local_listener_socket = listeners[local_listener];

listeners[local_listener] = listeners[num_listeners - 1];
#ifdef HAVE_X11_XTRANS_XTRANS_H
g_warning ("IceListenForConnections returned %d non-local listeners: %s",
num_listeners - 1,
IceComposeNetworkIdList (num_listeners - 1, listeners));
#endif
IceFreeListenObjs (num_listeners - 1, listeners);

xsmp_sockets = malloc (sizeof (IceListenObj));
xsmp_sockets[0] = local_listener_socket;
}

/* Update .ICEauthority with new auth entries for our socket */
if (!update_iceauthority (TRUE, xsmp_network_id))
{
/* FIXME: is this really fatal? Hm... */
gsm_initialization_error (TRUE, "Could not update ICEauthority file %s",
IceAuthFileName ());
}

g_setenv ("SESSION_MANAGER", xsmp_network_id, TRUE);
g_debug ("SESSION_MANAGER=%s
", xsmp_network_id);
}

Cheers
Kjartan


--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 05-27-2008, 05:02 PM
"Bill Crawford"
 
Default SESSION_MANAGER env var in rawhide and XSMP spec

2008/5/27 Kjartan Maraas <kmaraas@broadpark.no>:

> #ifdef HAVE_X11_XTRANS_XTRANS_H
> /* By default, IceListenForConnections will open one socket for each
> * transport type known to X. We don't want connections from remote
> * hosts, so for security reasons it would be best if ICE didn't
> * even open any non-local sockets. So we use an internal ICElib
> * method to disable them here. Unfortunately, there is no way to
> * ask X what transport types it knows about, so we're forced to
> * guess.
> */
> _IceTransNoListen ("tcp");
> #endif
[...]
> if (!IceListenForConnections (&num_listeners, &listeners,
> sizeof (error), error))
> gsm_initialization_error (TRUE, _("Could not create ICE listening socket: %s"), error);
> umask (saved_umask);
>
> /* Find the local socket in the returned socket list. */
> local_listener = -1;
> for (i = 0; i < num_listeners; i++)
> {
> char *id = IceGetListenConnectionString (listeners[i]);
>
> if (!strncmp (id, "local/", sizeof ("local/") - 1))
> {
> local_listener = i;

Bet this is picking up the "abstract socket" listener, and not getting
the "real" unix socket one. This might explain a connection problem.

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 05-27-2008, 06:40 PM
Dan Winship
 
Default SESSION_MANAGER env var in rawhide and XSMP spec

Bill Crawford wrote:
>> if (!strncmp (id, "local/", sizeof ("local/") - 1))
>> {
>> local_listener = i;
>
> Bet this is picking up the "abstract socket" listener, and not getting
> the "real" unix socket one. This might explain a connection problem.

Yeah. See also http://bugzilla.gnome.org/show_bug.cgi?id=534641#c2

So is the right fix to assume there might be multiple local sockets, and
listen on all of them?

-- Dan

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 

Thread Tools




All times are GMT. The time now is 09:34 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org