buffer::ptr self assignment bug + patch#44
Conversation
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>
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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