Skip to content

buffer::ptr self assignment bug + patch#44

Merged
liewegas merged 1 commit intomasterfrom
unknown repository
Feb 11, 2013
Merged

buffer::ptr self assignment bug + patch#44
liewegas merged 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Feb 10, 2013

After

buffer::ptr a(1);
a = a;

a call to a.get_raw() will return a null pointer and there will be
no pointer referencing the original buffer::raw object although its
reference count is 1.

buffer::ptr& buffer::ptr::operator= (const ptr& p) is modified to use
a local buffer::raw pointer to fix the memory leak. a = a
is a noop instead of loosing the original raw buffer.

A set of unit tests is added src/test/bufferlist.cc to demonstrate
that the proposed change works as expected. It is checked with
valgrind that reports no memory leak. The same test can be run against
the original code to show that it leaks.

http://tracker.ceph.com/issues/4070 refs #4070

Signed-off-by: Loic Dachary loic@dachary.org

After

buffer::ptr a(1);
a = a;

a call to a.get_raw() will return a null pointer and there will be
no pointer referencing the original buffer::raw object although its
reference count is 1.

buffer::ptr& buffer::ptr::operator= (const ptr& p) is modified to use
a local buffer::raw pointer to fix the memory leak. a = a
is a noop instead of loosing the original raw buffer.

A set of unit tests is added src/test/bufferlist.cc to demonstrate
that the proposed change works as expected. It is checked with
valgrind that reports no memory leak. The same test can be run against
the original code to show that it leaks.

http://tracker.ceph.com/issues/4070 refs #4070

Signed-off-by: Loic Dachary <loic@dachary.org>
liewegas added a commit that referenced this pull request Feb 11, 2013
buffer::ptr self assignment bug + patch

Reviewed-by: Sage Weil <sage@inktank.com>
@liewegas liewegas merged commit 778c45c into ceph:master Feb 11, 2013
@ghost ghost deleted the wip-4070 branch February 11, 2013 14:53
XinzeChi pushed a commit to XinzeChi/ceph that referenced this pull request Jan 29, 2016
common: improve shared_cache and simple_cache efficiency
ddiss pushed a commit to ddiss/ceph that referenced this pull request Oct 25, 2016
rgw: remove -EEXIST error msg for ZoneCreate

Reviewed-by: Karol Mroz <kmroz@suse.com>
tchaikov pushed a commit to tchaikov/ceph that referenced this pull request May 28, 2017
mon: handle MStatfs using PGStatService
adamemerson added a commit to adamemerson/ceph that referenced this pull request Nov 4, 2017
d1ff03b Merge pull request ceph#44 from adamemerson/wip-system-includes
4cc4b94 build: Mark dependency includes as SYSTEM in dmclock
05096c1 Merge pull request ceph#43 from TaewoongKim/anticipation_conf
f356c45 Add missing anticipation_timeout argument for PullPriorityQueue constructor
9896448 Merge pull request ceph#42 from tchaikov/wip-cmake
979899e add travis CI on gnu/linux
8a3dabd cmake: the built archives are located in ${binary_dir}
ee15ced cmake: check for include in /usr/include also

git-subtree-dir: src/dmclock
git-subtree-split: d1ff03b
ricardoasmarques pushed a commit to ricardoasmarques/ceph that referenced this pull request Jan 31, 2018
mgr/dashboard_v2: Add support for session expire at browser close.
galsalomon66 added a commit that referenced this pull request Jan 14, 2021
…thods,interfaces (#44)

Signed-off-by: gal salomon <gal.salomon@gmail.com>
votdev referenced this pull request in votdev/ceph Oct 5, 2022
rgw/sfs: Store objects by bucket id.
tobias-urdin pushed a commit to tobias-urdin/ceph that referenced this pull request Aug 2, 2023
Add fails_on_mod_proxy_fcgi to functional.test_s3.test_100_continue

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
athanatos pushed a commit to athanatos/ceph that referenced this pull request Feb 14, 2025
build: Mark dependency includes as SYSTEM in dmclock

Reviewed-by: J. Eric Ivancich <ivancich@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant