Closed ljcui closed 2 months ago
@ljcui Is the code you describe above, the same as from the frame shown in your stack?, i.e.: rocksdb::My_test_Test::TestBody() /root/rocksdb/utilities/transactions/transaction_test.cc:7584
@ljcui Is the code you describe above, the same as from the frame shown in your stack?, i.e.:
rocksdb::My_test_Test::TestBody() /root/rocksdb/utilities/transactions/transaction_test.cc:7584
yes, I add a temporary test case in transaction_test.cc,and the test case content is the code above. Maybe i found the reason, i change the code
from
for (iter->Seek("key"); iter->Valid(); iter->Next()) {
auto k = iter->key();
txn->Delete(k);
}
to
for (iter->Seek("key"); iter->Valid(); iter->Next()) {
auto k = iter->key().ToString();
txn->Delete(k);
}
then AddressSanitizer do not report error.
Expected behavior
AddressSanitizer do not report error
Actual behavior
AddressSanitizer report heap-use-after-free,
Steps to reproduce the behavior
checkout to v9.5.2, compile rocksdb with -DWITH_ASAN=ON and run the following test code :