A run-time lock diagnostic system called
<citerefentry><refentrytitle>witness
</refentrytitle><manvolnum>4
</manvolnum></citerefentry>, enabled in FreeBSD-CURRENT and disabled by default for stable branches and releases, detects the potential for deadlocks due to locking errors, including errors caused by obtaining multiple resource locks with a different order from different parts of the kernel. The
<citerefentry><refentrytitle>witness
</refentrytitle><manvolnum>4
</manvolnum></citerefentry> framework tries to detect this problem as it happens, and reports it by printing a message to the system console about a
<errorname>lock order reversal
</errorname> (often referred to also as
<acronym>LOR
</acronym>).