Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Nov 2014 11:29:44 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r274747 - stable/10/sys/kern
Message-ID:  <201411201129.sAKBTilP029333@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Nov 20 11:29:43 2014
New Revision: 274747
URL: https://svnweb.freebsd.org/changeset/base/274747

Log:
  MFC r274474:
  Do not try to dereference thread pointer when the value is not a pointer.

Modified:
  stable/10/sys/kern/kern_lock.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_lock.c
==============================================================================
--- stable/10/sys/kern/kern_lock.c	Thu Nov 20 11:26:06 2014	(r274746)
+++ stable/10/sys/kern/kern_lock.c	Thu Nov 20 11:29:43 2014	(r274747)
@@ -1341,9 +1341,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?201411201129.sAKBTilP029333>