Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools/ceph-dencoder: unregister dencoders in dtor
we have leak reports from ASan like ``` Direct leak of 512 byte(s) in 1 object(s) allocated from: #0 0x557c5ca1aa88 in __interceptor_calloc (/home/jenkins-build/build/workspace/ceph-pull-requests/build/bin/ceph-dencoder+0xc0a88) (BuildId: 0431ba72332bcadbbda97c424e0d5e66a10e88d7) #1 0x7f3093a4e7e5 (<unknown module>) Direct leak of 464 byte(s) in 1 object(s) allocated from: #0 0x557c5ca1aa88 in __interceptor_calloc (/home/jenkins-build/build/workspace/ceph-pull-requests/build/bin/ceph-dencoder+0xc0a88) (BuildId: 0431ba72332bcadbbda97c424e0d5e66a10e88d7) #1 0x7f3093a5de3e (<unknown module>) Direct leak of 248 byte(s) in 1 object(s) allocated from: #0 0x557c5ca1aa88 in __interceptor_calloc (/home/jenkins-build/build/workspace/ceph-pull-requests/build/bin/ceph-dencoder+0xc0a88) (BuildId: 0431ba72332bcadbbda97c424e0d5e66a10e88d7) #1 0x7f30939e05a9 (<unknown module>) Direct leak of 48 byte(s) in 1 object(s) allocated from: #0 0x557c5ca5566d in operator new(unsigned long) (/home/jenkins-build/build/workspace/ceph-pull-requests/build/bin/ceph-dencoder+0xfb66d) (BuildId: 0431ba72332bcadbbda97c424e0d5e66a10e88d7) #1 0x7f3094c27087 (<unknown module>) ceph#2 0x7f3094c21d64 (<unknown module>) ceph#3 0x557c5ca680bb in DencoderPlugin::register_dencoders[abi:cxx11]() /home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/ceph-dencoder/denc_plugin.h:44:5 ceph#4 0x557c5ca5f9ea in main /home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/ceph-dencoder/ceph_dencoder.cc:100:38 ceph#5 0x7f309f33ad8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16 Direct leak of 48 byte(s) in 1 object(s) allocated from: #0 0x557c5ca5566d in operator new(unsigned long) (/home/jenkins-build/build/workspace/ceph-pull-requests/build/bin/ceph-dencoder+0xfb66d) (BuildId: 0431ba72332bcadbbda97c424e0d5e66a10e88d7) #1 0x7f308c91f257 (<unknown module>) ceph#2 0x7f308c8fd0df (<unknown module>) ceph#3 0x557c5ca680bb in DencoderPlugin::register_dencoders[abi:cxx11]() /home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/ceph-dencoder/denc_plugin.h:44:5 ceph#4 0x557c5ca5f9ea in main /home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/ceph-dencoder/ceph_dencoder.cc:100:38 ceph#5 0x7f309f33ad8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16 ``` it turns out the dencoders allocated by `register_dencoders()` are never unregistered, so let's do the proper cleanup when done with the dencoders. Signed-off-by: Kefu Chai <[email protected]>
- Loading branch information