Bugzilla – Bug 1424
cachedb:testframe is not thread safe
Last modified: 2017-08-31 09:35:36 CEST
as of svn trunk revision 4322, the testframe cachedb backend is not thread safe. both testframe_store() and testframe_lookup() refer to or modify testframe_moddata, which is shared by multiple worker threads, without any mutual exclusion.
perhaps the intent is that this backend is only for testing and debugging purposes and is not expected to be used with multiple threads. but even if so, it's dangerous as a user could enable cachedb (perhaps just out of curiosity) and see various kinds of disruption due to race conditions.
So I suggest either:
- introduce proper locking or other mutex for the access to the backend, or
- explicitly prohibit or auto-disable the use of testframe if more than multiple thread is used
Yes, fixed by adding mutex to testframe. Thanks for the report!
Best regards, Wouter