Subject: Re: utmpx problem on NetBSD
To: Thomas Klausner <wiz@NetBSD.org>
From: Geoff Wing <gcw@pobox.com>
List: current-users
Date: 06/01/2005 17:37:46
On Tuesday 2005-05-31 01:18 +1000, Thomas Klausner output:
:I think I get the first error when I kill an xterm or rxvt
:with screen inside by exiting the window manager. I'm not
:quite sure when the second one happens; it might be interaction
:with screen too.

I'd say the problem is the interaction with screen.  rxvt isn't waiting
for the child to exit completely before cleaning up so a race occurs.
I'd presume the sequence is:
 1) screen has removed the original utmp entry while running
 2) both rxvt and screen get a signal to exit
 3) rxvt finishes first and tries to clean up the utmp entry which isn't
    there because screen removed it, error spewed out from utmp_update(8)
 4) screen finishes and maybe puts back the utmp entry it removed

I'll think about it and see if I can come up with a neater solution.

Regards, 
Geoff