Bug in rwlock implementation

Rickard Green <>
Wed Nov 17 13:57:01 CET 2010


I've found a bug in the rwlock implementation that can cause a lock to 
end up in an inconsistent state. The bug is very seldom triggered, but 
can be. It is most likely to be triggered when using the 
read_concurrency option on an ets table that is frequently accessed from 
multiple processes doing lots of writes and reads. That is, a situation 
where you typically don't want to use the read_concurrency option in the 
first place.

There is a fix for this bug currently under testing. The fix will appear 
in R14B01, but there might be changes to it since it is still under 
testing. You can help us out testing it, by using it.

The fix can be fetched using: git fetch 
git://github.com/rickard-green/otp.git rickard/rwlock-euc2010/OTP-8925

Alternatively you can download the complete source including the fix by 
clicking at the download button at: 
https://github.com/rickard-green/otp/tree/rickard/rwlock-euc2010/OTP-8925

Note that you need to run "./otp_build autoconf" in the top directory 
before building.

If you are worried that the bug might be triggered on your system, and 
you don't want to use a fix that isn't in its final state, it is also 
possible to enable pthread rwlocks as a workaround until R14B01. You do 
this by configuring the build as follows:
  ./configure force_pthread_rwlocks=yes <other configure options>

Regards,
Rickard Green, Erlang/OTP, Ericsson AB.



More information about the erlang-questions mailing list