You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a memory safety issue when making batch database calls.
Details:
Within a single process, the same leveldb::DB object may be safely shared by multiple concurrent threads. (...) However other objects (like Iterator and WriteBatch) may require external synchronization. If two threads share such an object, they must protect access to it using their own locking protocol. (...)
The bindings (./src/bindings.cc) methods batch_init, batch_put, batch_del, batch_write and batch_clear all share access to the WriteBatch object. The batch_write method will share the object with another thread in BatchWriteWorker. It's possible that batch_put, batch_del and batch_clear can unsafely modify the WriteBatch object that is shared with the other thread.
Reproduce:
Call batch_put, batch_del or batch_clearafter a call to batch_write and before the batch_write worker thread is complete.
Some of the possible errors:
Segmentation fault
Abort trap 6
Corruption: unknown WriteBatch tag
Corruption: bad WriteBatch Put
Corruption: WriteBatch has wrong count
The text was updated successfully, but these errors were encountered:
It can also be reproduced by calling db_closeafterbatch_write and before the worker thread is complete. This can be seen, as with the other cases, in the pull request at #7.
There is a memory safety issue when making batch database calls.
Details:
https://github.com/google/leveldb/blob/master/doc/index.md#concurrency
The bindings (
./src/bindings.cc
) methodsbatch_init
,batch_put
,batch_del
,batch_write
andbatch_clear
all share access to theWriteBatch
object. Thebatch_write
method will share the object with another thread inBatchWriteWorker
. It's possible thatbatch_put
,batch_del
andbatch_clear
can unsafely modify theWriteBatch
object that is shared with the other thread.Reproduce:
Call
batch_put
,batch_del
orbatch_clear
after a call tobatch_write
and before thebatch_write
worker thread is complete.Some of the possible errors:
The text was updated successfully, but these errors were encountered: