Software Development Kit (SDK) and API Discussions

Memory leak in the NMSDK c library

Haihong

Hi, I recently use the ASAN feature with gcc on our custom binary using NMSDK 9.7, and it detected such memory leak:

 

Indirect leak of 128 byte(s) in 2 object(s) allocated from:

    #0 0x7f963768fb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)

    #1 0x7f962e858da5  (/lib/x86_64-linux-gnu/libc.so.6+0x103da5)

    #2 0x7f962e85a0a6 in getaddrinfo (/lib/x86_64-linux-gnu/libc.so.6+0x1050a6)

    #3 0x7f963764825a  (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x9725a)

    #4 0x7f962f42c5c5 in na_server_invoke_elem_http /libnetapp/na.c:3575

    #5 0x7f962f42b6c9 in na_server_invoke_elem /libnetapp/na.c:3014

    #6 0x5593aea874e8 in NetAppApiClient::InvokeAPI(int, ScopedNaElem*, ScopedNaElem*) (/tmp/netapp_api_client_main+0x49e4e8)

 

This is consistently being reported when the API above is called. Looks like the memory allocated in getaddrinfo() is not freed (check https://man7.org/linux/man-pages/man3/getaddrinfo.3.html, there needs freeaddrinfo() afterwards). 

 

Is this a known issue? The fix seems to be straightforward if this is confirmed a legitimate memory leak.

 

By the way, is the netapp SDK source code public (and people can make contribution to)?

1 REPLY 1

wdiane

Please reach out to dl-sdk-answers@netapp.com

Announcements
Register for Insight 2021 Digital

INSIGHT 2021 Digital: Meet the Specialists 2

On October 20-22, gear up for a fully digital, totally immersive virtual experience with a downright legendary lineup of world-renowned specialists. Tune in for visionary conversations, solution deep dives, technical sessions and more.

NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public