ceph-rust icon indicating copy to clipboard operation
ceph-rust copied to clipboard

segfaults

Open Ten0 opened this issue 1 year ago • 0 comments

To reproduce:

  • Create a Rados by connecting
  • Create an IoCtx with rados.get_rados_ioctx(pool_name)
  • Drop the Rados
  • Use the IoCtx -> segfaults

=> API is unsound.

rados.get_rados_ioctx(pool_name) should either have a lifetime bound on the Rados it takes as parameter (which is bothersome for some use-cases) or take self: &Arc<Rados> and store an Arc<Rados> inside (which considering how heavy ioctx is anyway wouldn't have a significant cost, so is probably the better option).

Ten0 avatar Dec 16 '23 22:12 Ten0