Open piotrchmiel opened 1 week ago
@piotrchmiel The memory that leaks corresponds to a FI_SHUTDOWN
event added to the Event Queue after the endpoint shuts down. I'm not familiar with RDM but I guess there is a bug where err_entry.err_data
is not freed after the EQ event is consumed by RDM.
Describe the bug A memory leak is detected by the Address Sanitizer when performing operations on an endpoint that has been shut down using fi_shutdown. The issue occurs specifically when using the TCP provider in RDM mode, and no event queue (ep->util_ep.eq) is bound to the domain.
To Reproduce Steps to reproduce the behavior:
Expected behavior The memory allocated in xnet_ep_disable (specifically err_entry.err_data = mem_dup(err_data, err_data_size);) should be properly released, avoiding memory leaks.
Output The Address Sanitizer reports the following memory leak:
Environment: OS: Ubuntu 22.04 Provider: TCP Mode: RDM Libfabric 1.22.0
Additional context The memory leak originates from the function xnet_ep_disable at the line:
err_entry.err_data = mem_dup(err_data, err_data_size);
The issue only occurs when no event queue is bound to the domain (ep->util_ep.eq is empty) and operations are performed on the endpoint after it has been shut down using fi_shutdown.