From owner-freebsd-current@FreeBSD.ORG Tue Oct 11 12:20:51 2011 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AC111065674 for ; Tue, 11 Oct 2011 12:20:51 +0000 (UTC) (envelope-from poyopoyo@puripuri.plala.or.jp) Received: from msa03b.plala.or.jp (msa03.plala.or.jp [IPv6:2400:7800:0:5010::3]) by mx1.freebsd.org (Postfix) with ESMTP id BA1E38FC0C for ; Tue, 11 Oct 2011 12:20:50 +0000 (UTC) Received: from i220-220-100-225.s02.a026.ap.plala.or.jp ([220.220.100.225]) by msa03b.plala.or.jp with ESMTP id <20111011122049.MXRW5763.msa03b.plala.or.jp@i220-220-100-225.s02.a026.ap.plala.or.jp> for ; Tue, 11 Oct 2011 21:20:49 +0900 Date: Tue, 11 Oct 2011 21:20:48 +0900 Message-ID: <86sjmzra73.wl%poyopoyo@puripuri.plala.or.jp> From: poyopoyo@puripuri.plala.or.jp To: freebsd-current@FreeBSD.org User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/23.3 (amd64-portbld-freebsd9.0) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-VirusScan: Outbound; msa03b; Tue, 11 Oct 2011 21:20:49 +0900 X-Mailman-Approved-At: Tue, 11 Oct 2011 16:37:59 +0000 Cc: Subject: MPSAFE tty and lastcomm output X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2011 12:20:51 -0000 Hi, Does anyone see this on -CURRENT (and stable/9)? It doesn't look so smart output to me. I was aware of this issue first back in Aug 2009. == $ tty; lastcomm tty|head -1 /dev/pts/12 tty - user pts/12 0.002 secs Tue Oct 11 20:41 == OK, As this was run on pts/12, nothing is wrong. == $ script /dev/null tty; lastcomm tty|head -1; lastcomm tty|head -1 Script started, output file is /dev/null /dev/pts/13 Script done, output file is /dev/null tty - user pts/13 0.001 secs Tue Oct 11 20:46 tty - user #C:0x8b 0.001 secs Tue Oct 11 20:46 == Please look at the second entry of lastcomm. These two entries should describe the identical tty(1) process, and a tty field in the second entry does not look good. It looks stored accounting information is correct, but lastcomm failed to represent device name gently after it has been destroyed. Funnier case: == $ jot 1000|while read n; do script /dev/null tty < /dev/tty & done > /dev/null 2>&1 ; wait; lastcomm tty|head == And you'll see variety of output. Some devices are still alive and others has been destroyed. Without head(1) you'll see a swarm of them, of course. (After this one-liner, my tty always goes mad and have to reset(1) to be back sane. This is another issue though.) -- kuro