New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
common/obj_bencher.cc: fix verification crashing when there's no objects #5853
Conversation
@branch-predictor could you add a minimal test case that shows the problem & demonstrate the bug fix ? Otherwise looks great :) |
Actually all it takes is to do
on one node, then on another node:
for seq lock failure, and
for the segfault with memcmp. The caveat here is that I managed to hit both cases on one particular host in 4-node cluster, with remaining two other nodes not showing up this bug. On node on which I did |
The Lock is a race and I can't think of a way to reproduce it reliably. |
The memcmp crash should be easy to repeat somewhere in src/test/test_rados_tool.sh ? |
Actually, probably yes. Doing bench then truncating all objects down to 0 bytes should do it. I'll check it and update test if it'll work. |
@branch-predictor it would also work with bench write one object and truncate it. In the spirit of keepinng it minimal. |
@dachary There's already some other test involving |
b038529
to
e6d8097
Compare
e6d8097
to
56d0b3a
Compare
When specified pool is empty or doesn't contain valid bench objects, rados can crash because it attempts to memcmp through NULL pointer. Added check for valid object size (which also fixes the case when objects are there, but they're truncated), and made object_size being size_t instead of int. In seq_read_bench, there's a missing lock.Lock() which causes rados to trigger assert when object reading fails. Moved lock.Lock() before completion_ret() call. Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
…rash Truncate all objects after format test, then check whether rados bench rand/seq still works, or just crashes. Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
56d0b3a
to
612480b
Compare
common/obj_bencher.cc: fix verification crashing when there's no objects Reviewed-by: Loic Dachary <ldachary@redhat.com>
When specified pool is empty or doesn't contain valid bench objects, rados
can crash because it attempts to memcmp through NULL pointer. Added check
for valid object size (which also fixes the case when objects are there, but
they're truncated), and made object_size being size_t instead of int.
Also, fix lock issue under similar conditions in seq_read_bench().
Signed-off-by: Piotr Dałek piotr.dalek@ts.fujitsu.com