Likely Deadlock cs_setpwalletRegistered
2013-09-01 09:22:23 POTENTIAL DEADLOCK DETECTED 2013-09-01 09:22:23 Previous lock order was: 2013-09-01 09:22:23 (1) cs_wallet wallet.cpp:774 2013-09-01 09:22:23 mempool.cs main.cpp:1114 2013-09-01 09:22:23 (2) cs_setpwalletRegistered main.cpp:129 2013-09-01 09:22:23 Current lock order is: 2013-09-01 09:22:23 pnode->cs_vRecvMsg net.cpp:1518 2013-09-01 09:22:23 cs_main main.cpp:4062 2013-09-01 09:22:23 (2) cs_setpwalletRegistered main.cpp:161 2013-09-01 09:22:23 (1) cs_wallet wallet.h:310 2013-09-01 09:22:23 LOCKCONTENTION: cs_setpwalletRegistered 2013-09-01 09:22:23 Locker: main.cpp:129
This is likely caused by this commit https://github.com/bitcoin/bitcoin/commit/e5cefb9b
This should at least be investigated before 0.9.0.
@CodeShark Can you take a look please.
A possible deadlock is a thing we should fix ASAP, can any core dev take a look?
I had actually replaced these locks with shared locks that shouldn't have this issue - but apparently they caused pulltester to choke so they were removed. The only place where locking is necessary is when modifying the setpwalletRegistered structure itself (ie inserting or deleting).
Did anyone ever figure out why the boost::shared_lock solution didn't work? I had tested it on my own system and didn't have any problems with it.
@CodeShark Could be because of old compiler/build environment and old Boost version used!?
I believe the solution here is to use boost::signals2 to register the wallet callbacks; signals2 is actually specifically designed to be thread-safe, while being concurrently modifiable.