Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Oct 2010 14:59:14 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r213577 - stable/8/gnu/usr.bin/gdb/kgdb
Message-ID:  <201010081459.o98ExEEh097276@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010081459.o98ExEEh097276>