Actions
Bug #17310
closedimage.stat() call in librbdpy fails sometimes
Status:
Resolved
Priority:
High
Assignee:
Jason Dillaman
Target version:
-
% Done:
0%
Source:
Community (user)
Tags:
Backport:
jewel,hammer
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
I'm running a simple test script to reproduce this:
import rados import rbd cluster = rados.Rados(conffile='/etc/ceph/ceph.conf') cluster.connect() ioctx = cluster.open_ioctx('images') image = rbd.Image(ioctx, '41a6aadf-c655-49c8-b77d-eedd356f5349') stat = image.stat() print stat['size'] == image.size() print stat['block_name_prefix'] print len(stat['block_name_prefix'])
and I am seeing varying results like
$ python test.py Traceback (most recent call last): File "test.py", line 7, in <module> stat = image.stat() File "rbd.pyx", line 1124, in rbd.Image.stat (/build/ceph-XmVvyr/ceph-10.2.2/src/build/rbd.c:10803) File "rbd.pyx", line 433, in rbd.decode_cstr (/build/ceph-XmVvyr/ceph-10.2.2/src/build/rbd.c:2440) File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xaf in position 24: invalid start byte $ python test.py True rbd_data.3d98fcf378d97c0( 26 $ python test.py True rbd_data.3d98fcf378d97c0| 26
Looking at the code in src/pybind/rbd/rbd.pyx it seems like decode_cstr(info.block_name_prefix)
is being called assuming that block_name_prefix
is a null-terminated string, which it isn't.
Updated by Jason Dillaman over 7 years ago
- Project changed from Ceph to rbd
- Category deleted (
libvirt)
Updated by Jason Dillaman over 7 years ago
- Status changed from New to In Progress
- Assignee set to Jason Dillaman
- Backport set to jewel,hammer
Updated by Jason Dillaman over 7 years ago
- Status changed from In Progress to Fix Under Review
Updated by Mykola Golub over 7 years ago
- Status changed from Fix Under Review to Pending Backport
Updated by Nathan Cutler over 7 years ago
- Copied to Backport #17373: jewel: image.stat() call in librbdpy fails sometimes added
Updated by Nathan Cutler over 7 years ago
- Copied to Backport #17374: hammer: image.stat() call in librbdpy fails sometimes added
Updated by Nathan Cutler over 7 years ago
- Status changed from Pending Backport to Resolved
Actions