<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Valgrind reports possible memory leaks in na_startup. in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Valgrind-reports-possible-memory-leaks-in-na-startup/m-p/70325#M618</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eduardo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We will look into the issue.&lt;/P&gt;&lt;P&gt;If it is indeed a memory leak, we will see if we can fix it in the upcoming releases of NMSDK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Feb 2014 12:13:11 GMT</pubDate>
    <dc:creator>sens</dc:creator>
    <dc:date>2014-02-07T12:13:11Z</dc:date>
    <item>
      <title>Valgrind reports possible memory leaks in na_startup.</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Valgrind-reports-possible-memory-leaks-in-na-startup/m-p/70320#M617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I'm developing a little application in C using API version 5.1 and I use valgrind to detect memory leaks in my code. I have found a possible leak within the na_startup API call, just with the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;#include &amp;lt;string.h&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;#include &amp;lt;locale.h&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;#include &amp;lt;netapp_api.h&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;int main(void)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; char *StartupErrBuf;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartupErrBuf=(char *)calloc(256,sizeof(char));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; na_startup(StartupErrBuf,strlen(StartupErrBuf));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; free(StartupErrBuf);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; na_shutdown();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;valgrind reports 41 allocs and only 21 frees. I'm not an expert developer but I guess there are some intermediate allocs which are not freed or maybe I'm doing something wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is part of the report from valgrind when it is used to analyze the compiled binary from the above code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653== HEAP SUMMARY:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in use at exit: 268 bytes in 20 blocks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp; total heap usage: 40 allocs, 20 frees, 1,106 bytes allocated&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653== 3 bytes in 1 blocks are still reachable in loss record 1 of 20&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp; at 0x4A0610C: malloc (vg_replace_malloc.c:195)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp; by 0x4FDFCD2: pool_alloc (pool.c:266)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp; by 0x4FEC1F7: str_cat (str.c:798)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp; by 0x4FDEF21: path_initialize_dirs (path.c:203)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp; by 0x4FDEDFF: path_init (path.c:154)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp; by 0x4C17E15: na_startup (na.c:270)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp; by 0x40072C: main (startup.c:12)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653== 7 bytes in 1 blocks are still reachable in loss record 2 of 20&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp; at 0x4A0610C: malloc (vg_replace_malloc.c:195)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp; by 0x4FDFCD2: pool_alloc (pool.c:266)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp; by 0x4FEC1F7: str_cat (str.c:798)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp; by 0x4FDEF42: path_initialize_dirs (path.c:204)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp; by 0x4FDEDFF: path_init (path.c:154)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp; by 0x4C17E15: na_startup (na.c:270)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;==31653==&amp;nbsp;&amp;nbsp;&amp;nbsp; by 0x40072C: main (startup.c:12)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be very appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eduardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 05:43:40 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Valgrind-reports-possible-memory-leaks-in-na-startup/m-p/70320#M617</guid>
      <dc:creator>sistemasgmv</dc:creator>
      <dc:date>2025-06-05T05:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Valgrind reports possible memory leaks in na_startup.</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Valgrind-reports-possible-memory-leaks-in-na-startup/m-p/70325#M618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eduardo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We will look into the issue.&lt;/P&gt;&lt;P&gt;If it is indeed a memory leak, we will see if we can fix it in the upcoming releases of NMSDK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 12:13:11 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Valgrind-reports-possible-memory-leaks-in-na-startup/m-p/70325#M618</guid>
      <dc:creator>sens</dc:creator>
      <dc:date>2014-02-07T12:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Valgrind reports possible memory leaks in na_startup.</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Valgrind-reports-possible-memory-leaks-in-na-startup/m-p/70334#M619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sen, thank you for your answer. I have several valgrind logs regarding this issue and I can send them to you if you need them. I have made several tests with NMSDK 5.1 and 5.2 versions with the same results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eduardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 12:22:29 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Valgrind-reports-possible-memory-leaks-in-na-startup/m-p/70334#M619</guid>
      <dc:creator>sistemasgmv</dc:creator>
      <dc:date>2014-02-07T12:22:29Z</dc:date>
    </item>
  </channel>
</rss>

