From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 14:59:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26B67106564A; Fri, 8 Oct 2010 14:59:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 162CC8FC08; Fri, 8 Oct 2010 14:59:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o98ExELb097278; Fri, 8 Oct 2010 14:59:14 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98ExEEh097276; Fri, 8 Oct 2010 14:59:14 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201010081459.o98ExEEh097276@svn.freebsd.org> From: Ed Maste Date: Fri, 8 Oct 2010 14:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213577 - stable/8/gnu/usr.bin/gdb/kgdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 14:59:15 -0000 Author: emaste Date: Fri Oct 8 14:59:14 2010 New Revision: 213577 URL: http://svn.freebsd.org/changeset/base/213577 Log: MFC r213013: Move test for zero bufp or size before rseq and wseq calculation. This avoids spinning in an infinite loop for some (possibly corrupt?) core files at work. Modified: stable/8/gnu/usr.bin/gdb/kgdb/main.c Directory Properties: stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) Modified: stable/8/gnu/usr.bin/gdb/kgdb/main.c ============================================================================== --- stable/8/gnu/usr.bin/gdb/kgdb/main.c Fri Oct 8 14:56:39 2010 (r213576) +++ stable/8/gnu/usr.bin/gdb/kgdb/main.c Fri Oct 8 14:59:14 2010 (r213577) @@ -222,11 +222,13 @@ kgdb_dmesg(void) return; bufp = kgdb_parse("msgbufp->msg_ptr"); size = (int)kgdb_parse("msgbufp->msg_size"); + if (bufp == 0 || size == 0) + return; rseq = (int)kgdb_parse("msgbufp->msg_rseq"); wseq = (int)kgdb_parse("msgbufp->msg_wseq"); rseq = MSGBUF_SEQ_TO_POS(size, rseq); wseq = MSGBUF_SEQ_TO_POS(size, wseq); - if (bufp == 0 || size == 0 || rseq == wseq) + if (rseq == wseq) return; printf("\nUnread portion of the kernel message buffer:\n");