timeoutd crashes after session 'break'

Bug #165254 reported by soutys
36
This bug affects 3 people
Affects Status Importance Assigned to Milestone
timeoutd (Ubuntu)
Fix Released
Undecided
Unassigned
Declined for Jaunty by Chuck Short
Declined for Karmic by Iulian Udrea

Bug Description

Binary package hint: timeoutd

The timeout daemon seems to kill itself after partially-succesful session timeout action...

- firstly, it does not display x-window popups (any!) - messages are echoed under console screen (virtual terminal next to that used/reserved by gdm);

- after all (after the 'last' beep, when timeout limit is reached) it crashes user's session - does not logging out but just restarts (?) gdm - command 'last -10' says that user is still logged;

- timeoutd still tries to logout user XYZ (10 or more times with beep; from '/var/log/syslogd'):

(...) timeoutd[12168]: User XYZ exceeded maximum daily limit (on for 486 minutes, max=180).
(...) timeoutd[12168]: chk_ssh(): PID 11929 does not exist. Something went wrong. Ignoring.

After that it finishes his work ('ps -A|grep timeoutd' says nothing).
Now, the user XYZ is able to log in without any time restrictions...

Timeoutd process can be 'saved': another user should log in before last beep occurs.

+=+=+=+=+
Ubuntu - v7.10 (Gutsy - dist-upgraded from Feisty) with all updates
timeoutd - v1.5-10
gdm - v2.20.1-0ubuntu1

Related branches

Revision history for this message
Risto Mononen (risto-mononen-deactivatedaccount) wrote :

I have similar symptoms on the same SW versions. Yesterday there was additionally a memory protection error, but today timeoutd disappeared without SIGSEGV. See the last row in the attachment.

  risto

Revision history for this message
Risto Mononen (risto-mononen-deactivatedaccount) wrote :

Still one thing about SW versions: synaptic / timeoutd / properties / dependencies says
  "Conflicts: suidmanager"

Hope this helps in fixing it.

  risto

Revision history for this message
Laurent (syrius-no-log) wrote :

confirmed !
Same issues here with hardy...

Revision history for this message
Monchao (monchao) wrote :

In my tests I pass something similar:

in a version of Ubuntu 6.06.1 had installed the Timeoutd package and It works perfectly, closing the session after user to display messages. But at upgrading the Ubuntu 7.10 this operation change, I closed the user session but I showed messages. The last test I've done is to update my version Ubuntu 8.04 but the operation continued as with the Ubuntu 7.10, I closed the user's session but I do not sample messages

Revision history for this message
Shawn Willden (shawn-ubuntu-willden) wrote :

I think I've fixed this. It appears the the field of the utmp structure that holds the X display changed between feisty and gutsy, so timeoutd has basically been completely broken for managing timeouts on local X sessions for gutsy and hardy.

The code was assuming that the ut_line field held the X display (":0" or similar), but it that value is actually now in the ut_host field. This meant that its method for determining if a user was logged into a local X session was broken, causing it to direct warning and logout messages to the wrong place (the TTY) and to use the wrong method for killing X, which somehow caused it to believe the user was still logged in even after the session had ended.

This same sort of error made X idle detection completely non-functional (so I think my fixes should also correct bug #212848).

Revision history for this message
Risto Mononen (risto-mononen-deactivatedaccount) wrote : Re: [Bug 165254] Re: timeoutd crashes after session 'break'

Thanks Shawn! I used timeoutd with the kids' user accounts, and will be
testing the fix soon.

  rm

2008/10/5 Shawn Willden <email address hidden>

> I think I've fixed this. It appears the the field of the utmp structure
> that holds the X display changed between feisty and gutsy, so timeoutd
> has basically been completely broken for managing timeouts on local X
> sessions for gutsy and hardy.
>
> The code was assuming that the ut_line field held the X display (":0" or
> similar), but it that value is actually now in the ut_host field. This
> meant that its method for determining if a user was logged into a local
> X session was broken, causing it to direct warning and logout messages
> to the wrong place (the TTY) and to use the wrong method for killing X,
> which somehow caused it to believe the user was still logged in even
> after the session had ended.
>
> This same sort of error made X idle detection completely non-functional
> (so I think my fixes should also correct bug #212848).
>
> ** Attachment added: "fix_local_x.patch"
> http://launchpadlibrarian.net/18225966/fix_local_x.patch
>
> --
> timeoutd crashes after session 'break'
> https://bugs.launchpad.net/bugs/165254
> You received this bug notification because you are subscribed to
> timeoutd in ubuntu.
>

Greg A (etulfetulf)
Changed in timeoutd:
status: New → Confirmed
Revision history for this message
Shawn Willden (shawn-ubuntu-willden) wrote :

I'm willing to take responsibility for fixing this, since I've fixed it. What do I need to do to get the fix in? I'm getting tired of patching it all over again for each release.

Changed in timeoutd (Ubuntu):
assignee: nobody → Shawn Willden (shawn-ubuntu-willden)
Revision history for this message
Risto Mononen (risto-mononen-deactivatedaccount) wrote :

Hi Shawn,
it would be great to get your fix into the official release. I have not
contributed to Ubuntu myself, but I guess your fix and responsibility change
would be in the next release *KarmicKoala*? Or maybe updates to earlier 8.x
and 9.y releases would work as well.

BR,
  Risto

https://wiki.ubuntu.com/KarmicKoala

2009/5/1 Shawn Willden <email address hidden>

> I'm willing to take responsibility for fixing this, since I've fixed it.
> What do I need to do to get the fix in? I'm getting tired of patching
> it all over again for each release.
>
> ** Changed in: timeoutd (Ubuntu)
> Assignee: (unassigned) => Shawn Willden (shawn-ubuntu-willden)
>
> --
> timeoutd crashes after session 'break'
> https://bugs.launchpad.net/bugs/165254
> You received this bug notification because you are subscribed to
> timeoutd in ubuntu.
>

Revision history for this message
Shawn Willden (shawn-ubuntu-willden) wrote :

I have nominated it for 9.10, but I had also nominated it for 9.04 and nothing happened. I'm not sure what else needs to be done.

Revision history for this message
Risto Mononen (risto-mononen-deactivatedaccount) wrote :

Nothing happening is strange, at least I would assume that someone replies
when you have nominated it! I need to ask around and/or search the forums
for advice.

2009/5/3 Shawn Willden <email address hidden>

> I have nominated it for 9.10, but I had also nominated it for 9.04 and
> nothing happened. I'm not sure what else needs to be done.
>
> --
> timeoutd crashes after session 'break'
> https://bugs.launchpad.net/bugs/165254
> You received this bug notification because you are subscribed to
> timeoutd in ubuntu.
>

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Shawn,

Did you create a package to test you patch? If so, could you attach a debdiff for your fix?

I'm also wondering about some of the details of your patch. Won't using 'host' instead of 'tty' in some places cause messages or actions to be sent to all tty's of a user? I'm afraid that if it was the case, sessions could be killed that don't deserve to be.

Revision history for this message
Shawn Willden (shawn-ubuntu-willden) wrote :

I've attached a debdiff. The only difference between it and the last patch is the changelog diff. Also, there's a git repository at:

http://github.com/divegeek/timeoutd/tree

As for the possibility that the change could cause additional problems, it's possible. I don't deeply understand the issues involved here. What I do know is that without the patch, timeoutd is basically completely unusable for X logins. For that use, it's been working perfectly for me for most of a year. I use it to limit my kids' computer time, and I'd hear about it if it limited them excessively (I hear about it anyway!).

I don't selectively limit the kids based on tty, but I just did a test where I set my time limit for pts/0 very low (2 minutes) and left my limit for other ttys unlimited. Then I both ssh'd in and logged into X. It properly warned and then terminated the ssh session, but the X session was unaffected. Then I did it the other way around (limiting tty7) and again it behaved exactly as it should, logging me out of X while leaving the ssh session. So it appears to work -- but that is the only time I've attempted selective timeouts based on tty, so I can't claim to have tested it exhaustively.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Subscribing ubuntu-universe-sponsors as per https://wiki.ubuntu.com/SponsorshipProcess.

Revision history for this message
Iain Lane (laney) wrote :

Hi,

I'm reviewing this patch for inclusion into Karmic. Has it been sent upstream? If not, can you please do so? I'd like to see some upstream discussion before sponsoring as they know the code best and would be well placed to judge its suitability.

Thanks for your work!

Regards,
Iain

Revision history for this message
Shawn Willden (shawn-ubuntu-willden) wrote :

AFAICT there is no upstream.

Revision history for this message
Michael Terry (mterry) wrote :

Yeah, the copyright file says: "It was downloaded from ion.apana.org.au. Unfortunately, this address is outdated. It is not developed upstream anymore." The Debian QA page says "This package has been orphaned." And it's clearly not maintained in Ubuntu well. :) So, we're on our own here.

Revision history for this message
Chuck Short (zulcss) wrote :

Hi,

The debian changelog has to be fixed up as well before it can be uploaded as well.

Thanks
chuck

Revision history for this message
Fabrice Coutadeur (fabricesp) wrote :

Uploaded. Thanks for your work on this bug!

I've just adjusted the changelog entry, to match Ubuntu, and updated the maintainer in debian/control.

thanks,
Fabrice

Changed in timeoutd (Ubuntu):
assignee: Shawn Willden (shawn-ubuntu-willden) → nobody
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package timeoutd - 1.5-10.1ubuntu1

---------------
timeoutd (1.5-10.1ubuntu1) lucid; urgency=low

  [ Shawn Willden ]
  * Fixed local X session handling (LP: #165254, #212848)

  [ Fabrice Coutadeur ]
  * timeouts.5: added a comment to make clear that LOGINSTATUS should go first
    (thanks Durval Menezes) (LP: #121960)
 -- Shawn Willden <email address hidden> Sun, 04 Jan 2009 23:17:57 -0700

Changed in timeoutd (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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