Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Consolekit cannot open session....
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
krotuss
Apprentice
Apprentice


Joined: 01 Aug 2008
Posts: 156

PostPosted: Thu Mar 13, 2014 2:13 pm    Post subject: Reply with quote

On my box this problem was caused due to inability to "wait" for "/usr/lib/ConsoleKit/ck-collect-session-info", because SA_NOCLDWAIT flag was set in sigaction struct. This is caused by "unref_unix_signal_handler_unlocked" keeping it undefined:

Code:

static void
unref_unix_signal_handler_unlocked (int signum)
{
  unix_signal_refcount[signum]--;
  if (unix_signal_refcount[signum] == 0)
    {
      struct sigaction action;
      action.sa_handler = SIG_DFL;
      sigemptyset (&action.sa_mask);
      sigaction (signum, &action, NULL);
    }
}


patching it like this:
Code:

static void
unref_unix_signal_handler_unlocked (int signum)
{
  unix_signal_refcount[signum]--;
  if (unix_signal_refcount[signum] == 0)
    {
      struct sigaction action;
      action.sa_handler = SIG_DFL;
      sigemptyset (&action.sa_mask);
      action.sa_flags = SA_RESTART | SA_NOCLDSTOP;
      sigaction (signum, &action, NULL);
    }
}


fixed problem for me (or at least apparently, haven't done excessive testing yet). So this is maybe glib bug.
Back to top
View user's profile Send private message
gerard27
Advocate
Advocate


Joined: 04 Jan 2004
Posts: 2377
Location: Netherlands

PostPosted: Thu Mar 13, 2014 2:31 pm    Post subject: Reply with quote

Since I didn't have this problem I'm wondering what version of udev ypu're using.
I have masked anything >udev-208.
Once again I'm running ~amd64.
Gerard.
_________________
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Back to top
View user's profile Send private message
Spacebug
n00b
n00b


Joined: 04 Jan 2009
Posts: 18
Location: Germany

PostPosted: Thu Mar 13, 2014 3:50 pm    Post subject: Reply with quote

@krotuss: Brilliant!! Your solution solved the problem on my machine as well. Thanks!

It would be great if you could file the bug (I guess it is a glib bug) so it could fixed/patched permanently.
Back to top
View user's profile Send private message
krotuss
Apprentice
Apprentice


Joined: 01 Aug 2008
Posts: 156

PostPosted: Thu Mar 13, 2014 4:16 pm    Post subject: Reply with quote

@Spacebug: Glad to hear that. Its already reported here. I had posted .patch file there.
Back to top
View user's profile Send private message
Spacebug
n00b
n00b


Joined: 04 Jan 2009
Posts: 18
Location: Germany

PostPosted: Thu Mar 13, 2014 6:11 pm    Post subject: Reply with quote

@krotuss: Thanks for making a patch file.

To apply krotuss's patch, simply create the file

Code:
 /etc/portage/patches/dev-libs/glib/ckbug.patch


with contents:

Code:
 
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -4978,6 +4978,7 @@
       struct sigaction action;
       action.sa_handler = SIG_DFL;
       sigemptyset (&action.sa_mask);
+      action.sa_flags = SA_RESTART | SA_NOCLDSTOP;
       sigaction (signum, &action, NULL);
     }
 }


Then "emerge -a1 glib" and the problem should be solved (it did the trick for me at least).

However, in the thread https://bugs.gentoo.org/show_bug.cgi?id=501330 a Gentoo Developer claims that this is not a safe way to solve the problem. Krotuss, what is your take on this?
Back to top
View user's profile Send private message
erikdenv
n00b
n00b


Joined: 24 May 2004
Posts: 31
Location: The Netherlands

PostPosted: Thu Mar 13, 2014 8:59 pm    Post subject: Reply with quote

This works for me, thanks krotuss for the patch.
Back to top
View user's profile Send private message
thumper
Guru
Guru


Joined: 06 Dec 2002
Posts: 528
Location: Venice FL

PostPosted: Thu Mar 13, 2014 9:35 pm    Post subject: Reply with quote

Just thought I'd mention this.

In glib 2.39.91 (and or) master at https://github.com/GNOME/glib/blob/master/glib/gmain.c

Shows the following:

Code:
static void
unref_unix_signal_handler_unlocked (int signum)
{
  unix_signal_refcount[signum]--;
  if (unix_signal_refcount[signum] == 0)
    {
      struct sigaction action;
      memset (&action, 0, sizeof (action));
      action.sa_handler = SIG_DFL;
      sigemptyset (&action.sa_mask);
      sigaction (signum, &action, NULL);
    }
}


As you can see that function has seen a recent change, although I've had no time to test and see if it makes any difference.

Edit: here is the commit for the above noted change:
https://mail.gnome.org/archives/commits-list/2013-November/msg02586.html


George


Last edited by thumper on Fri Mar 14, 2014 12:14 am; edited 1 time in total
Back to top
View user's profile Send private message
krotuss
Apprentice
Apprentice


Joined: 01 Aug 2008
Posts: 156

PostPosted: Thu Mar 13, 2014 10:18 pm    Post subject: Reply with quote

Spacebug wrote:

However, in the thread https://bugs.gentoo.org/show_bug.cgi?id=501330 a Gentoo Developer claims that this is not a safe way to solve the problem. Krotuss, what is your take on this?


That patch was intended as a quick fix and proof that sigaction flags are to blame rather than for "production" use. Its up to glib and consolekit developers to come with proper solution.
Back to top
View user's profile Send private message
thumper
Guru
Guru


Joined: 06 Dec 2002
Posts: 528
Location: Venice FL

PostPosted: Fri Mar 14, 2014 12:36 am    Post subject: Reply with quote

Just tested this;

The apparent official patch to that function listed here https://mail.gnome.org/archives/commits-list/2013-November/msg02586.html
has made the problem go away for me.

George
Back to top
View user's profile Send private message
Spacebug
n00b
n00b


Joined: 04 Jan 2009
Posts: 18
Location: Germany

PostPosted: Fri Mar 14, 2014 1:01 am    Post subject: Reply with quote

The official patch works for me as well.

Thanks thumper for finding it. And thanks again to krotuss for locating the bug in the first place. Great work!
Back to top
View user's profile Send private message
xtz
Apprentice
Apprentice


Joined: 29 Oct 2007
Posts: 181
Location: Singapore

PostPosted: Fri Mar 14, 2014 1:51 am    Post subject: Reply with quote

Works for me too.
Back to top
View user's profile Send private message
tetromino
Retired Dev
Retired Dev


Joined: 02 Dec 2003
Posts: 215

PostPosted: Fri Mar 14, 2014 4:54 am    Post subject: Reply with quote

This should be fixed by dev-libs/glib-2.38.2-r1 - see https://bugs.gentoo.org/show_bug.cgi?id=501330
Back to top
View user's profile Send private message
massimo
Veteran
Veteran


Joined: 22 Jun 2003
Posts: 1226

PostPosted: Sat Mar 15, 2014 7:29 am    Post subject: Reply with quote

Fixed, thanks a lot.
_________________
Hello 911? How are you?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum