Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Nov 2014 17:44:36 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r274474 - head/sys/kern
Message-ID:  <201411131744.sADHiadu081546@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Nov 13 17:44:35 2014
New Revision: 274474
URL: https://svnweb.freebsd.org/changeset/base/274474

Log:
  Do not try to dereference thread pointer when the value is not a pointer.
  
  Reported and tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/kern/kern_lock.c

Modified: head/sys/kern/kern_lock.c
==============================================================================
--- head/sys/kern/kern_lock.c	Thu Nov 13 17:43:37 2014	(r274473)
+++ head/sys/kern/kern_lock.c	Thu Nov 13 17:44:35 2014	(r274474)
@@ -1360,9 +1360,14 @@ lockmgr_printinfo(const struct lock *lk)
 		    (uintmax_t)LK_SHARERS(lk->lk_lock));
 	else {
 		td = lockmgr_xholder(lk);
-		printf("lock type %s: EXCL by thread %p "
-		    "(pid %d, %s, tid %d)\n", lk->lock_object.lo_name, td,
-		    td->td_proc->p_pid, td->td_proc->p_comm, td->td_tid);
+		if (td == (struct thread *)LK_KERNPROC)
+			printf("lock type %s: EXCL by KERNPROC\n",
+			    lk->lock_object.lo_name);
+		else
+			printf("lock type %s: EXCL by thread %p "
+			    "(pid %d, %s, tid %d)\n", lk->lock_object.lo_name,
+			    td, td->td_proc->p_pid, td->td_proc->p_comm,
+			    td->td_tid);
 	}
 
 	x = lk->lk_lock;



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