Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Sep 2010 19:41:01 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r213013 - head/gnu/usr.bin/gdb/kgdb
Message-ID:  <201009221941.o8MJf1LD040687@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Wed Sep 22 19:41:01 2010
New Revision: 213013
URL: http://svn.freebsd.org/changeset/base/213013

Log:
  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:
  head/gnu/usr.bin/gdb/kgdb/main.c

Modified: head/gnu/usr.bin/gdb/kgdb/main.c
==============================================================================
--- head/gnu/usr.bin/gdb/kgdb/main.c	Wed Sep 22 19:26:41 2010	(r213012)
+++ head/gnu/usr.bin/gdb/kgdb/main.c	Wed Sep 22 19:41:01 2010	(r213013)
@@ -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?201009221941.o8MJf1LD040687>