[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#256468: marked as done (xterm: utmp handling is broken for high pts)



Your message dated Wed, 25 Aug 2004 19:52:27 +0200
with message-id <20040825175227.GA14269@lst.de>
and subject line #256468 xterm: utmp handling is broken for high pts
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 27 Jun 2004 09:47:03 +0000
>From jim@jim.sh Sun Jun 27 02:47:03 2004
Return-path: <jim@jim.sh>
Received: from dsl092-074-132.bos1.dsl.speakeasy.net (neurosis.jim.sh) [66.92.74.132] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1BeWFb-000141-00; Sun, 27 Jun 2004 02:47:03 -0700
Received: from neurosis.jim.sh (localhost [127.0.0.1])
	by neurosis.jim.sh (8.12.11/8.12.11/Debian-3) with ESMTP id i5R9l1kL023262
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sun, 27 Jun 2004 05:47:01 -0400
Received: (from jim@localhost)
	by neurosis.jim.sh (8.12.11/8.12.11/Debian-3) id i5R9l1jP023261;
	Sun, 27 Jun 2004 05:47:01 -0400
Message-Id: <200406270947.i5R9l1jP023261@neurosis.jim.sh>
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Jim Paris <jim@jtan.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: xterm: utmp handling is broken for high pts
X-Mailer: reportbug 2.60
Date: Sun, 27 Jun 2004 05:47:01 -0400
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 

Package: xterm
Version: 4.3.0.dfsg.1-5
Severity: normal

Later Linux 2.6 kernels do not recycle pseudo TTYs, so ptys like 
/dev/pts/1234 are not uncommon.

xterm does not seem to handle this well at all.  In particular, it
relies on the 4-digit ut_id field in utmp, which would look like
"p123" in the above example.  If I open up three xterms on ptys which
all have a ut_id of "p123", they overwrite each other in utmp,
so that only one shows up.  

In wtmp, they all show as opening, but on close, they all act as if
they closed the last record, not their own.

I would assume this is due to code like this (in Exit() in main.c):

            utmp.ut_type = DEAD_PROCESS;

            /* position to entry in utmp file */
            /* Test return value: beware of entries left behind: PSz 9 Mar 00 */
            if (!(utret = getutid(&utmp))) {
                (void) setutent();
                utmp.ut_type = USER_PROCESS;
                if (!(utret = getutid(&utmp))) {
                    (void) setutent();
                }
            }

... which uses getutid() to find the proper entry in utmp, without
matching the full and proper ut_line to make sure that it was the
correct entry.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.6
Locale: LANG=C, LC_CTYPE=en_US.UTF-8

Versions of packages xterm depends on:
ii  libc6                     2.3.2.ds1-12   GNU C Library: Shared libraries an
ii  libexpat1                 1.95.6-8       XML parsing C library - runtime li
ii  libfontconfig1            2.2.2-2        generic font configuration library
ii  libfreetype6              2.1.7-2        FreeType 2 font engine, shared lib
ii  libice6                   4.3.0.dfsg.1-1 Inter-Client Exchange library
ii  libncurses5               5.4-3          Shared libraries for terminal hand
ii  libsm6                    4.3.0.dfsg.1-1 X Window System Session Management
ii  libxaw7                   4.3.0.dfsg.1-1 X Athena widget set library
ii  libxext6                  4.3.0.dfsg.1-1 X Window System miscellaneous exte
ii  libxft2                   2.1.2-6        FreeType-based font drawing librar
ii  libxmu6                   4.3.0.dfsg.1-1 X Window System miscellaneous util
ii  libxpm4                   4.3.0.dfsg.1-1 X pixmap library
ii  libxrender1               0.8.3-7        X Rendering Extension client libra
ii  libxt6                    4.3.0.dfsg.1-1 X Toolkit Intrinsics
ii  xlibs                     4.3.0.dfsg.1-1 X Window System client libraries m
ii  xlibs-data                4.3.0.dfsg.1-1 X Window System client data

-- no debconf information

---------------------------------------
Received: (at 256468-done) by bugs.debian.org; 25 Aug 2004 17:52:29 +0000
>From hch@lst.de Wed Aug 25 10:52:29 2004
Return-path: <hch@lst.de>
Received: from verein.lst.de (mail.lst.de) [213.95.11.210] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1C01wj-0004Ld-00; Wed, 25 Aug 2004 10:52:29 -0700
Received: from verein.lst.de (localhost [127.0.0.1])
	by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i7PHqR95014290
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO)
	for <256468-done@bugs.debian.org>; Wed, 25 Aug 2004 19:52:27 +0200
Received: (from hch@localhost)
	by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id i7PHqRNo014288
	for 256468-done@bugs.debian.org; Wed, 25 Aug 2004 19:52:27 +0200
Date: Wed, 25 Aug 2004 19:52:27 +0200
From: Christoph Hellwig <hch@lst.de>
To: 256468-done@bugs.debian.org
Subject: #256468 xterm: utmp handling is broken for high pts
Message-ID: <20040825175227.GA14269@lst.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.28i
X-Spam-Score: -4.901 () BAYES_00
X-Scanned-By: MIMEDefang 2.39
Delivered-To: 256468-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 
	version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 

the kernel changed to a first-fit allocation again.  Note that this
only hides the bugs in buggy applications like xterm but isn't a real
fix.



Reply to: