From owner-freebsd-bugs@FreeBSD.ORG Mon Aug 24 11:40:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13152106568C for ; Mon, 24 Aug 2009 11:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CADD38FC29 for ; Mon, 24 Aug 2009 11:40:01 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7OBe1Xj085875 for ; Mon, 24 Aug 2009 11:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7OBe1oW085874; Mon, 24 Aug 2009 11:40:01 GMT (envelope-from gnats) Resent-Date: Mon, 24 Aug 2009 11:40:01 GMT Resent-Message-Id: <200908241140.n7OBe1oW085874@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mikolaj Golub Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1528B106568B for ; Mon, 24 Aug 2009 11:39:15 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 03DA48FC12 for ; Mon, 24 Aug 2009 11:39:15 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n7OBdE7u036181 for ; Mon, 24 Aug 2009 11:39:14 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n7OBdE4N036180; Mon, 24 Aug 2009 11:39:14 GMT (envelope-from nobody) Message-Id: <200908241139.n7OBdE4N036180@www.freebsd.org> Date: Mon, 24 Aug 2009 11:39:14 GMT From: Mikolaj Golub To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/138131: [patch] pstat -t coredumps when reading from kernel crashdump X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2009 11:40:02 -0000 >Number: 138131 >Category: misc >Synopsis: [patch] pstat -t coredumps when reading from kernel crashdump >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Aug 24 11:40:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Mikolaj Golub >Release: 7.2-STABLE but all versions are affected >Organization: >Environment: FreeBSD zhuzha.ua1 7.2-STABLE FreeBSD 7.2-STABLE #2: Fri Jul 3 08:58:49 EEST 2009 root@zhuzha.ua1:/usr/obj/usr/src/sys/GENERIC i386 >Description: "pstat -t -M " crashes with segmentation fault. #0 0x0804912f in ttymode_kvm () at /usr/src/usr.sbin/pstat/pstat.c:249 249 tp = TAILQ_NEXT(tp, t_list); (gdb) list 244 XT_COPY(ilowat); 245 XT_COPY(ohiwat); 246 XT_COPY(olowat); 247 #undef XT_COPY 248 ttyprt(&xt); 249 tp = TAILQ_NEXT(tp, t_list); 250 } 251 } 252 253 static void (gdb) bt #0 0x0804912f in ttymode_kvm () at /usr/src/usr.sbin/pstat/pstat.c:249 #1 0x08049274 in ttymode () at /usr/src/usr.sbin/pstat/pstat.c:282 #2 0x08048f56 in main (argc=0, argv=0xbfbfeda0) at /usr/src/usr.sbin/pstat/pstat.c:196 >How-To-Repeat: pstat -t -M /dev/mem >Fix: Attached patch fixes the problem. Patch attached with submission follows: --- usr.sbin/pstat/pstat.c.orig 2009-08-24 14:15:10.000000000 +0300 +++ usr.sbin/pstat/pstat.c 2009-08-24 14:16:10.000000000 +0300 @@ -246,7 +246,7 @@ ttymode_kvm(void) XT_COPY(olowat); #undef XT_COPY ttyprt(&xt); - tp = TAILQ_NEXT(tp, t_list); + tp = TAILQ_NEXT(&tty, t_list); } } >Release-Note: >Audit-Trail: >Unformatted: