Project

General

Profile

Actions

Bug #9362

closed

librados, rados_read corrupts memory on timeout

Added by Matthias Kiefer over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Category:
librados
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
Regression:
Severity:
1 - critical
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

If you configure librados with rados_osd_op_timeout, timeouts on rados_read will result in memory corruptions and segmentation faults.

If rados_read returns with a timeout (-110) the output buffer provided to rados_read is accessed after rados_read returned. This either results in the given buffer changing content after the call or, if the buffer is freed immediately, in a memory corruption.

During testing the timeout feature in a multithreading environment we experienced many crashes of the processes using librados and even worse had corrupted objects being written to ceph. These corrupted objects contained content of an object where rados_read resulted in a timeout at exactly the same time where the corrupted object was written to ceph.

Attached you can find a small program to reproduce the problem.

The problem was reproduced with librados 0.67.10 and 0.80.5


Files

radosreadtimeout.cpp (2.58 KB) radosreadtimeout.cpp Matthias Kiefer, 09/05/2014 05:08 AM
core.segfault.gz (474 KB) core.segfault.gz Matthias Kiefer, 09/09/2014 12:41 AM

Related issues 1 (0 open1 closed)

Related to Ceph - Bug #9476: "Segmentation fault (core dumped)" in upgrade:dumpling-giant-x:parallel-giant-distro-basic-multi runDuplicate09/15/2014

Actions
Actions

Also available in: Atom PDF