Debugging rw lock

Ryan Stone rysto32 at gmail.com
Thu Feb 13 22:03:07 UTC 2014


On Thu, Feb 13, 2014 at 4:06 PM, Ian Lepore <ian at freebsd.org> wrote:
> Does option DEADLKRES not work with rwlocks?  (I've never used it, just
> seen it in the NOTES).
>
> -- Ian

DEADLKRES will panic the system after a thread has been blocked for a
timeout period (I think that it's something ridiculous like 30
minutes).  However it's of no use when trying to debugging a leaked
read lock, because the thread that lost the lock will have left behind
no clues as to it's identity.

If you have some kind of reproduction scenario, the quickest hack that
might get you an answer would be to change INP_INFO_RLOCK to actually
take a wlock instead.


Rather than instrumenting the code, you could use the dtrace lockstat
provider to log every lock/unlock and post-process the output to find
the culprit.  Make sure that you have r258541 if you want to use
lockstat.

http://svnweb.freebsd.org/changeset/base/258541


More information about the freebsd-hackers mailing list