New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
erasure-code: use new/delete to alloc/free coefficients array #56586
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup
pushed to https://shaman.ceph.com/builds/ceph/wip-pr-56586-kefu/22e9098308a4561faf7db77e1adaa49d25d780fa/, to build test it. but would be ideal if we can run it through teuthology tests. |
before this change, we allocate coefficients table with `malloc()` in `ErasureCodeIsaDefault::prepare()`, but free them using `delete`. this is identified by LeakSanitizer, and it reports ``` ==3135332==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete) on 0x60700002a870 #0 0x5627c6ef721d in operator delete(void*) (/home/jenkins-build/build/workspace/ceph-pull-requests/build/bin/unittest_erasure_code_plugin_isa+0x1ca21d) (BuildId: 7922906370e5183d67f55211a868c0b0e22b4a2c) #1 0x7fbbe38e858f in ErasureCodeIsaTableCache::~ErasureCodeIsaTableCache() /home/jenkins-build/build/workspace/ceph-pull-requests/src/erasure-code/isa/ErasureCodeIsaTableCache.cc:65:13 #2 0x7fbbe390be40 in ErasureCodePluginIsa::~ErasureCodePluginIsa() /home/jenkins-build/build/workspace/ceph-pull-requests/src/erasure-code/isa/ErasureCodePluginIsa.h:24:7 #3 0x7fbbe390be68 in ErasureCodePluginIsa::~ErasureCodePluginIsa() /home/jenkins-build/build/workspace/ceph-pull-requests/src/erasure-code/isa/ErasureCodePluginIsa.h:24:7 #4 0x5627c7063b52 in ceph::ErasureCodePluginRegistry::~ErasureCodePluginRegistry() /home/jenkins-build/build/workspace/ceph-pull-requests/src/erasure-code/ErasureCodePlugin.cc:49:5 #5 0x7fbbeccb6494 in __run_exit_handlers stdlib/./stdlib/exit.c:113:8 #6 0x7fbbeccb660f in exit stdlib/./stdlib/exit.c:143:3 #7 0x7fbbecc9ad96 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:74:3 #8 0x7fbbecc9ae3f in __libc_start_main csu/../csu/libc-start.c:392:3 #9 0x5627c6e38da4 in _start (/home/jenkins-build/build/workspace/ceph-pull-requests/build/bin/unittest_erasure_code_plugin_isa+0x10bda4) (BuildId: 7922906370e5183d67f55211a868c0b0e22b4a2c) ``` so, in this change, we use `new []` and `delete []` to allocate and free them, to be more consistent, and to silence this warning. Signed-off-by: Kefu Chai <tchaikov@gmail.com>
22e9098
to
6a88e09
Compare
changelog
|
being tested at #56537 |
This PR is under test in https://tracker.ceph.com/issues/65560. |
Nothing is related with this changes. Would file another PR.
@Svelar thanks! |
before this change, we allocate coefficients table with
malloc()
inErasureCodeIsaDefault::prepare()
, but free them usingdelete
. this is identified by LeakSanitizer, and it reportsso, in this change, we use
new []
anddelete []
to allocate and free them, to be more consistent, and to silence this warning.Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
x
between the brackets:[x]
. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test dashboard cephadm
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox
jenkins test windows
jenkins test rook e2e