jeffpc / nx01

testing
MIT License
1 stars 0 forks source link

client: free XDR received args & sent responses #58

Closed jeffpc closed 8 years ago

jeffpc commented 8 years ago

The client receives the RPC args, passes them to the handler function, and then fails to free them. Similarly, the client sends the RPC response structs, and then fails to free them. This leads to memory leaks. E.g.,

vclock leak: 2 buffers, 16 bytes each, 32 bytes total
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
         8eef7a8          8eebf80      46c356b0247               64
                          8ecb590                0                0
                 libumem.so.1`umem_cache_alloc_debug+0x1fe
                 libumem.so.1`umem_cache_alloc+0x18f
                 libnomad_common.so`nvclock_alloc+0x1f
                 libnomad_common.so`xdr_nvclock+0x96
                 libnomad_common.so`xdr_nobjhndl+0x35
                 libnomad_common.so`xdr_rpc_create_req+0x21
                 fetch_args.isra.0+0xd
                 process_connection+0xf2
                 connection_acceptor+0x39
                 libnomad_common.so`wrap_taskq_callback+0x20
                 libsuntaskq.so`taskq_thread+0xa0
                 libc_hwcap1.so.1`_thrp_setup+0x88
                 libc_hwcap1.so.1`_lwp_start

and

umem_alloc_16 leak: 2 buffers, 16 bytes each, 32 bytes total
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
         8ed9648          8ed5de0      46c356b11d0               64
                          8ea4590                0                0
                 libumem.so.1`umem_cache_alloc_debug+0x1fe
                 libumem.so.1`umem_cache_alloc+0x18f
                 libumem.so.1`umem_alloc+0x50
                 libumem.so.1`umem_malloc+0x36
                 libumem.so.1`realloc+0x28
                 libnsl.so.1`xdr_string+0xfe
                 libnomad_common.so`xdr_rpc_create_req+0x47
                 fetch_args.isra.0+0xd
                 process_connection+0xf2
                 connection_acceptor+0x39
                 libnomad_common.so`wrap_taskq_callback+0x20
                 libsuntaskq.so`taskq_thread+0xa0
                 libc_hwcap1.so.1`_thrp_setup+0x88
                 libc_hwcap1.so.1`_lwp_start