Project

General

Profile

Bug #22042 ยป rados-double-free-reproduce.py

Python script to reproduce issue - Christoph Heer, 11/04/2017 08:34 PM

 
import rados
cluster = rados.Rados(conffile='/etc/ceph/ceph.conf', conf={"keyring": '/etc/ceph/ceph.client.admin.keyring'})
cluster.connect()
ioctx = cluster.open_ioctx('test')

object_name = 'test'

try:
ioctx.remove_object(object_name)
except rados.ObjectNotFound:
pass

print 'write'
for i in xrange(9):
attr = 'attr:%s' % i
value = ''
if 2 < i < 6:
value = 'value:%s' % i

ioctx.set_xattr(object_name, attr, value)
print i, (attr, value)

print 'read'
for i, a in enumerate(ioctx.get_xattrs(object_name)):
print i, a
    (1-1/1)