Skip to content

memleak is detected during glusterd peer handshake #4558

Open
@chen1195585098

Description

@chen1195585098

asan reports:

Direct leak of 4386 byte(s) in 34 object(s) allocated from:
    #0 0x7ff3b72efbb8 in __interceptor_malloc (/lib64/libasan.so.5+0xefbb8)
    #1 0x7ff3b6902420 in __gf_malloc (/lib64/libglusterfs.so.0+0x102420)
    #2 0x7ff3b6876e18 in dict_allocate_and_serialize (/lib64/libglusterfs.so.0+0x76e18)
    #3 0x7ff3aa5ec701 in glusterd_mgmt_handshake glusterd-handshake.c:2212
    #4 0x7ff3aa5ee2cc in __glusterd_peer_dump_version_cbk glusterd-handshake.c:2388
    #5 0x7ff3aa5b58ca in glusterd_big_locked_cbk glusterd-rpc-ops.c:217
    #6 0x7ff3b642ffcb in rpc_clnt_handle_reply rpc-clnt.c:780
    #7 0x7ff3b64307e9 in rpc_clnt_notify rpc-clnt.c:957
    #8 0x7ff3b6425c2c in rpc_transport_notify (/lib64/libgfrpc.so.0+0x25c2c)
    #9 0x7ff3a880d874 in socket_event_poll_in_async socket.c:2531
    #10 0x7ff3a882828e in socket_event_poll_in ../../../../libglusterfs/src/glusterfs/async.h:189
    #11 0x7ff3a882828e in socket_event_handler socket.c:2963
    #12 0x7ff3a882828e in socket_event_handler socket.c:2883
    #13 0x7ff3b69af776 in event_dispatch_epoll_handler event-epoll.c:640
    #14 0x7ff3b69af776 in event_dispatch_epoll_worker event-epoll.c:751
    #15 0x7ff3b48082fe in start_thread pthread_create.c:479
    #16 0x7ff3b3e39dd2 in __GI___clone (/lib64/libc.so.6+0x39dd2)

By the way, size in mem_acct data struct, which indicates total size allocated for data-type, is not updated correctly.
size will increase when GF_MALLOC is called, however, it never get a decreasement in GF_FREE.
Should fix it here, otherwise the wrong size may mislead mempool memleak anlysis.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions