ceph / ceph/go-ceph

Violations of pointer passing rules

Open
#584 6 comments 0 reactions 1 assignee Claimed by @ansiwen View on GitHub
bug
Dominant language
Go
Stars
691
Forks
296
Avg merge
2d 16h
Merged PRs (30d)
11

Description

At least at one place we hand over Go pointers to the Ceph API that gonna get stored in a handler registry after the call returns, which violates the pointer passing rules:
https://github.com/ceph/go-ceph/blob/312e4cf6b5cfb02e69768232d0fb0888a7ba51ba/rados/read_op.go#L80-L81
So there is no guarantee that the pointers remain valid.

With the iterator right before:
https://github.com/ceph/go-ceph/blob/312e4cf6b5cfb02e69768232d0fb0888a7ba51ba/rados/read_op.go#L79
we are safe, since - as far as I can tell - it doesn't get stored anywhere.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.