Fix some issues with rwlock corruption that caused deadlock like symptoms.
authorRussell Bryant <russell@russellbryant.com>
Fri, 27 Mar 2009 02:20:23 +0000 (02:20 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 27 Mar 2009 02:20:23 +0000 (02:20 +0000)
commit5e80b9d09ae920213a17c23c7006d07b6fcf58e7
treebbed7a4fdcd872c6f80865042f39eba529ffd7fe
parentb043f8ab1bfdab732e4852af4fd84e0f78ccf7bd
Fix some issues with rwlock corruption that caused deadlock like symptoms.

When dvossel and I were doing some load testing last week, we noticed that we
could make Asterisk trunk lock up instantly when we started generating a bunch
of calls.  The backtraces of locked threads were bizarre, and many were stuck
on an _unlock_ of an rwlock.

The changes are:

1) Fix a number of places where a backtrace would be loaded into an invalid
   index of the backtrace array.  It's an off by one error, which ends up
   writing over the rwlock itself.

2) Ensure that in the array of held locks, we NULL out an index once it is
   not being used so that it's not confusing when analyzing its contents.

3) Remove a bunch of logging referring to an rwlock operating being done
   with "deep reentrancy".  It is normal for _many_ threads to hold a
   read lock on an rwlock.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184531 65c4cc65-6c06-0410-ace0-fbb531ad65f3
include/asterisk/lock.h