userconfig crashes while loading group id's

Bug #69200 reported by Leo Milano
4
Affects Status Importance Assigned to Milestone
kde-guidance (Ubuntu)
Fix Released
Undecided
Sebastian Kügler

Bug Description

Binary package hint: kde-guidance

I have a system where I created a custom "users" group, with numeric ID = 100. All my users belong to that group:

root@grisell# grep 100 /etc/group
users:x:100:

# grep 100 /etc/passwd
leo:x:1000:100:Leo Milano:/home/leo:/bin/bash
lmilano:x:1002:100:Leo:/home/lmilano:/bin/bash
(and so on)

I don't know if this is the reason, but userconfig seems to choke while loading group id on start up:

root@grisell# userconfig
kbuildsycoca running...
no user removed
Traceback (most recent call last):
  File "/usr/bin/userconfig", line 1711, in ?
    userconfigapp = UserConfigApp()
  File "/usr/bin/userconfig", line 275, in __init__
    self.__updateGroupList()
  File "/usr/bin/userconfig", line 515, in __updateGroupList
    self.__selectGroup(self.selectedgroupid)
  File "/usr/bin/userconfig", line 521, in __selectGroup
    lvi = self.groupidsToListItems[groupid]
KeyError

I am not sure how I can be of any more help, maybe by posting my complete /etc/group ? Would that be useful ?

This is Kubuntu 6.10, kde-guidance 0.7.0-0ubuntu4

Many thanks !
Leo

Leo Milano (lmilano)
description: updated
Revision history for this message
Sebastian Kügler (sebasje) wrote :

Yes, that would definitely help. Can you post your /etc/passwd and /etc/group here?

Revision history for this message
Leo Milano (lmilano) wrote :
Revision history for this message
Leo Milano (lmilano) wrote :
Revision history for this message
Leo Milano (lmilano) wrote :

Some more info: I wrote a little workaround to debug. With this patch, at least I can load (and use) userconfig. I am wrapping the __selectGroup() function in a try clause, and showing the problematic groups. It turns out that this function is some times called with a NULL object, and some times with a groupid = 0.

Here is the output to the console:

#############################
grisell: bin> userconfig
no user removed
ERROR LOADING GROUP: None
no user removed
ERROR LOADING GROUP: 0
no user removed
ERROR LOADING GROUP: 0
#############################

Cheers !
Leo

Revision history for this message
Sebastian Kügler (sebasje) wrote :

Does the attached patch help your problem? (Also without your debugging patch?)

Changed in kde-guidance:
status: Unconfirmed → Needs Info
Revision history for this message
Sebastian Kügler (sebasje) wrote :

I'm pretty confident the attached patch helps. If not, please reopen this bug.

Changed in kde-guidance:
assignee: nobody → sebas-kde
status: Needs Info → Fix Released
Revision history for this message
Leo Milano (lmilano) wrote : Re: userconfig crashes while loading group id's (FIX - PATCH)

Sebas, unfortunately, your patch doesn't fix the problem. The reason is that the prblematic function is called from many places.

I am attaching a patch that does fix the problem. The key is to make the check for a valid "groupid" inside the function "__selectGroup", not in the in the different calls to the function (this is also a more robust solution)

Sorry for the delay!

Revision history for this message
Leo Milano (lmilano) wrote :

Sorry, I am trying to re-open this bug but the launchpad interface is extremely confusing to me. Could someone please give me a hand re-opening this bug ? It still hasn't been fixed. Please see my previous comment where I attach a patch that does fix the problem.

Thanks !

Revision history for this message
Sebastian Kügler (sebasje) wrote :

This patch apparently is applied (not by me, at least I don't remember doing so). Did you actually check the latest version in subversion? (Fix _released_ might be incorrect, but the patch definitely is in.

Revision history for this message
Leo Milano (lmilano) wrote :

What I was proposing has not been applied. The first
few lines of the function should looke like this:
    #######################################################################
     def __selectGroup(self,groupid):
- if groupid:
- self.selectedgroupid = groupid
- lvi = self.groupidsToListItems[groupid]
- self.grouplist.setSelected(lvi,True)

Everything else in the function should be enclosed in the same "if groupid". That is, the validation for the function belongs to the function, not to the functon callers.

The version I am seeing in websvn is rev=621399. Here is the full path:

http://websvn.kde.org/trunk/playground/base/guidance/userconfig/userconfig.py?rev=621399&view=markup

Am I looking at the wrong place ?

Thanks!
-- Leo

Revision history for this message
Sebastian Kügler (sebasje) wrote : Re: [Bug 69200] Re: userconfig crashes while loading group id's

On Sunday 28 January 2007 16:01:30 Leo Milano wrote:
> What I was proposing has not been applied. The first
> few lines of the function should looke like this:
> #######################################################################
> def __selectGroup(self,groupid):
> - if groupid:
> - self.selectedgroupid = groupid
> - lvi = self.groupidsToListItems[groupid]
> - self.grouplist.setSelected(lvi,True)
>
> Everything else in the function should be enclosed in the same "if
> groupid". That is, the validation for the function belongs to the
> function, not to the functon callers.
>
> The version I am seeing in websvn is rev=621399. Here is the full path:
>
> http://websvn.kde.org/trunk/playground/base/guidance/userconfig/userconfig.
>py?rev=621399&view=markup
>
> Am I looking at the wrong place ?

No, I think your patch was wrong. :>

Your patch removes that check for groupid (which isn't in there in the first
place), so I couldn't apply it (and thought someone else had fixed it in the
meantime).

If you can confirm that your patch has to be applied with -R, I'd be happy to
do it.

Cheers,
--
sebas

 http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
War doesn't determine who's right, only who's left.

Revision history for this message
Leo Milano (lmilano) wrote :

Arrg, I sent it reversed. Let's try again. BTW, it's a blessing this thing is written in python, I can just send a patch without having to get the source, compile, etc.

Let's see how it goes. Cheers!
-- leo

Revision history for this message
Sebastian Kügler (sebasje) wrote :

Committed, thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.