CINXE.COM

DPA lib Memory Leak Bug - Enterprise Networking - NVIDIA Developer Forums

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>DPA lib Memory Leak Bug - Enterprise Networking - NVIDIA Developer Forums</title> <meta name="description" content="Guys, I seem to encounter a memory leak problem when using DOCA DPA lib. Here is my code: class DpaKernel { DpaKernel() { ... doca_dpa_create(dev-&amp;gt;get_dev(), app, &amp;amp;dpa_ctx, flags); } ~DpaKernel(){ if (&amp;hellip;"> <meta name="generator" content="Discourse 3.4.0.beta4-dev - https://github.com/discourse/discourse version c8ccf79545125d4c74edef9e463e07518b245bf5"> <link rel="icon" type="image/png" href="https://global.discourse-cdn.com/nvidia/optimized/2X/0/0372ccc95874f71d7fbff64bbbff6f8c69dd850b_2_32x32.png"> <link rel="apple-touch-icon" type="image/png" href="https://global.discourse-cdn.com/nvidia/optimized/2X/8/819b2855e1f1f3249e77dc713405cf77d1eda57c_2_180x180.png"> <meta name="theme-color" media="all" content="#000000"> <meta name="color-scheme" content="light"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, viewport-fit=cover"> <link rel="canonical" href="https://forums.developer.nvidia.com/t/dpa-lib-memory-leak-bug/267531" /> <link rel="search" type="application/opensearchdescription+xml" href="https://forums.developer.nvidia.com/opensearch.xml" title="NVIDIA Developer Forums Search"> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/color_definitions_nvidia_4_13_e5694ed12a98e47dd8a976e0c11cfe41032f0acb.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" class="light-scheme"/> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/desktop_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="desktop" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/automation_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="automation" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/checklist_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="checklist" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-ai_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-ai" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-akismet_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-akismet" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-antivirus_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-antivirus" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-assign_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-assign" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-cakeday_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-cakeday" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-calendar_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-calendar" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-chat-integration_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-chat-integration" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-data-explorer_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-data-explorer" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-details_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-details" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-docs_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-docs" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-jira_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-jira" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-lazy-videos_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-lazy-videos" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-local-dates_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-local-dates" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-policy_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-policy" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-presence_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-presence" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-solved_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-solved" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-templates_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-templates" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-topic-voting_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-topic-voting" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-translator_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-translator" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-user-notes_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-user-notes" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-yearly-review_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-yearly-review" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/footnote_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="footnote" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/hosted-site_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="hosted-site" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/poll_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="poll" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/spoiler-alert_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="spoiler-alert" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-ai_desktop_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-ai_desktop" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-calendar_desktop_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-calendar_desktop" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/discourse-topic-voting_desktop_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="discourse-topic-voting_desktop" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/poll_desktop_2f06ac897896b5ae5df8c0c6694dbeac0a69bba0.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="poll_desktop" /> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/desktop_theme_11_3a071416a8e6746ad0ca0678def4073dfc6cbc3d.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="desktop_theme" data-theme-id="11" data-theme-name="custom header links"/> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/desktop_theme_18_345a0c56112ac3864b0643c4a4305864721a5300.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="desktop_theme" data-theme-id="18" data-theme-name="topic thumbnails"/> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/desktop_theme_19_374e0750d0f7dfd8ca30d808bcac5c748effe5d1.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="desktop_theme" data-theme-id="19" data-theme-name="versatile banner"/> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/desktop_theme_13_e720ca8887de27d855c27622a972ba7d23bd1cb3.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="desktop_theme" data-theme-id="13" data-theme-name="discourse-nvidia-theme"/> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/desktop_theme_17_609616bbde10ae24c851371a4cde58f356cca94a.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="desktop_theme" data-theme-id="17" data-theme-name="fix bulk actions button focus"/> <link href="https://sea2.discourse-cdn.com/nvidia/stylesheets/desktop_theme_20_2b20bd975e474f87392f82a9d9f3c6e1c3568993.css?__ws=forums.developer.nvidia.com" media="all" rel="stylesheet" data-target="desktop_theme" data-theme-id="20" data-theme-name="versatile banner adjustments"/> <script src="//assets.adobedtm.com/5d4962a43b79/76a76b0bb8ea/launch-7d434965ec64.min.js" async="" nonce="CjqXk4LxJF5qCYLhLD0h7QXXA"></script> <meta name="google-site-verification" content="If3jxgzZoS1XODkXDOo83AD2VzBqttpfA2TfyU7YQlk"> <script defer="" src="https://sea2.discourse-cdn.com/nvidia/theme-javascripts/dbd2b5fc7317c86b8d3bb000f99224d82134a5d8.js?__ws=forums.developer.nvidia.com" data-theme-id="13" nonce="CjqXk4LxJF5qCYLhLD0h7QXXA"></script> <script defer="" src="https://sea2.discourse-cdn.com/nvidia/theme-javascripts/4c591360894154cd79bc884669f276607c1af8bb.js?__ws=forums.developer.nvidia.com" data-theme-id="13" nonce="CjqXk4LxJF5qCYLhLD0h7QXXA"></script> <!-- OneTrust Cookies Consent Notice start for nvidia.com --> <script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" data-document-language="true" type="text/javascript" charset="UTF-8" data-domain-script="3e2b62ff-7ae7-4ac5-87c8-d5949ecafff5" nonce="CjqXk4LxJF5qCYLhLD0h7QXXA"></script> <!-- OneTrust Cookies Consent Notice end for nvidia.com --> <script type="text/javascript" src="https://images.nvidia.com/aem-dam/Solutions/ot-js/ot-custom.js" nonce="CjqXk4LxJF5qCYLhLD0h7QXXA"></script><script defer="" src="https://sea2.discourse-cdn.com/nvidia/theme-javascripts/098438cd37b784b1cdbf6a91223ae055e9a0d312.js?__ws=forums.developer.nvidia.com" data-theme-id="22" nonce="CjqXk4LxJF5qCYLhLD0h7QXXA"></script> <link rel="alternate nofollow" type="application/rss+xml" title="RSS feed of &#39;DPA lib Memory Leak Bug&#39;" href="https://forums.developer.nvidia.com/t/dpa-lib-memory-leak-bug/267531.rss" /> <meta property="og:site_name" content="NVIDIA Developer Forums" /> <meta property="og:type" content="website" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:image" content="https://global.discourse-cdn.com/nvidia/original/3X/e/4/e41d27491ee72562cf68c340597ca95f587879bd.png" /> <meta property="og:image" content="https://global.discourse-cdn.com/nvidia/original/3X/e/4/e41d27491ee72562cf68c340597ca95f587879bd.png" /> <meta property="og:url" content="https://forums.developer.nvidia.com/t/dpa-lib-memory-leak-bug/267531" /> <meta name="twitter:url" content="https://forums.developer.nvidia.com/t/dpa-lib-memory-leak-bug/267531" /> <meta property="og:title" content="DPA lib Memory Leak Bug" /> <meta name="twitter:title" content="DPA lib Memory Leak Bug" /> <meta property="og:description" content="Guys, I seem to encounter a memory leak problem when using DOCA DPA lib. Here is my code: class DpaKernel { DpaKernel() { ... doca_dpa_create(dev-&gt;get_dev(), app, &amp;dpa_ctx, flags); } ~DpaKernel(){ if (dpa_ctx != nullptr) { result= doca_dpa_destroy(dpa_ctx); } } } And when I call the dealloc function of my class, the program fail to release flexio heap, the command line shows these error: heap_destroy 317 - Failed to destroy heap, not all device ..." /> <meta name="twitter:description" content="Guys, I seem to encounter a memory leak problem when using DOCA DPA lib. Here is my code: class DpaKernel { DpaKernel() { ... doca_dpa_create(dev-&gt;get_dev(), app, &amp;dpa_ctx, flags); } ~DpaKernel(){ if (dpa_ctx != nullptr) { result= doca_dpa_destroy(dpa_ctx); } } } And when I call the dealloc function of my class, the program fail to release flexio heap, the command line shows these error: heap_destroy 317 - Failed to destroy heap, not all device ..." /> <meta property="og:article:section" content="Infrastructure &amp; Networking" /> <meta property="og:article:section:color" content="76B900" /> <meta property="og:article:section" content="DOCA" /> <meta property="og:article:section:color" content="76B900" /> <meta property="og:article:section" content="Enterprise Networking" /> <meta property="og:article:section:color" content="76B900" /> <meta property="article:published_time" content="2023-09-25T15:46:41+00:00" /> <meta property="og:ignore_canonical" content="true" /> <script type="application/ld+json">{"@context":"http://schema.org","@type":"QAPage","name":"DPA lib Memory Leak Bug","mainEntity":{"@type":"Question","name":"DPA lib Memory Leak Bug","text":"Guys, I seem to encounter a memory leak problem when using DOCA DPA lib.\n\nHere is my code:\n\nclass DpaKernel {\n\nDpaKernel() {\n\n...\n\ndoca_dpa_create(dev-&gt;get_dev(), app, &amp;dpa_ctx, flags);\n\n}\n\n~DpaKernel(){\n\nif (dpa_ctx != nullptr)\n\n{\n\nresult= doca_dpa_destroy(dpa_ctx);\n\n&hellip;","upvoteCount":0,"answerCount":1,"datePublished":"2023-09-25T15:46:41.196Z","author":{"@type":"Person","name":"RongxinCheng","url":"https://forums.developer.nvidia.com/u/RongxinCheng"},"acceptedAnswer":{"@type":"Answer","text":"I think I found the solution, it seems dpa kernel must first release all its events before it actually call doca_dpa_destroy. After I rewrite the order of deallocation as such, the bug is fixed.","upvoteCount":0,"datePublished":"2023-09-26T01:40:14.031Z","url":"https://forums.developer.nvidia.com/t/dpa-lib-memory-leak-bug/267531/2","author":{"@type":"Person","name":"RongxinCheng","url":"https://forums.developer.nvidia.com/u/RongxinCheng"}}}}</script> </head> <body class="crawler browser-update"> <header> <a href="/"> NVIDIA Developer Forums </a> </header> <div id="main-outlet" class="wrap" role="main"> <div id="topic-title"> <h1> <a href="/t/dpa-lib-memory-leak-bug/267531">DPA lib Memory Leak Bug</a> </h1> <div class="topic-category" itemscope itemtype="http://schema.org/BreadcrumbList"> <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a href="/c/infrastructure/doca/networking/374" class="badge-wrapper bullet" itemprop="item"> <span class='badge-category-bg' style='background-color: #76B900'></span> <span class='badge-category clear-badge'> <span class='category-name' itemprop='name'>Infrastructure &amp; Networking</span> </span> </a> <meta itemprop="position" content="1" /> </span> <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a href="/c/infrastructure/doca/networking/374" class="badge-wrapper bullet" itemprop="item"> <span class='badge-category-bg' style='background-color: #76B900'></span> <span class='badge-category clear-badge'> <span class='category-name' itemprop='name'>DOCA</span> </span> </a> <meta itemprop="position" content="2" /> </span> <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a href="/c/infrastructure/doca/networking/374" class="badge-wrapper bullet" itemprop="item"> <span class='badge-category-bg' style='background-color: #76B900'></span> <span class='badge-category clear-badge'> <span class='category-name' itemprop='name'>Enterprise Networking</span> </span> </a> <meta itemprop="position" content="3" /> </span> </div> </div> <div itemscope itemtype='http://schema.org/DiscussionForumPosting'> <meta itemprop='headline' content='DPA lib Memory Leak Bug'> <link itemprop='url' href='https://forums.developer.nvidia.com/t/dpa-lib-memory-leak-bug/267531'> <meta itemprop='datePublished' content='2023-09-25T15:46:41Z'> <meta itemprop='articleSection' content='Enterprise Networking'> <meta itemprop='keywords' content=''> <div itemprop='publisher' itemscope itemtype="http://schema.org/Organization"> <meta itemprop='name' content='NVIDIA'> <div itemprop='logo' itemscope itemtype="http://schema.org/ImageObject"> <meta itemprop='url' content='https://global.discourse-cdn.com/nvidia/original/3X/a/1/a1ef6e0c1fbd3fad5bf82538b78dfaa9c5fa1a61.png'> </div> </div> <div id='post_1' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" rel='nofollow' href='https://forums.developer.nvidia.com/u/RongxinCheng'><span itemprop='name'>RongxinCheng</span></a> </span> <link itemprop="mainEntityOfPage" href="https://forums.developer.nvidia.com/t/dpa-lib-memory-leak-bug/267531"> <span class="crawler-post-infos"> <time datetime='2023-09-25T15:46:41Z' class='post-time'> September 25, 2023, 3:46pm </time> <meta itemprop='dateModified' content='2023-09-25T15:51:17Z'> <span itemprop='position'>1</span> </span> </div> <div class='post' itemprop='text'> <p>Guys, I seem to encounter a memory leak problem when using DOCA DPA lib.</p> <p>Here is my code:</p> <pre><code class="lang-cpp">class DpaKernel { DpaKernel() { ... doca_dpa_create(dev-&gt;get_dev(), app, &amp;dpa_ctx, flags); } ~DpaKernel(){ if (dpa_ctx != nullptr) { result= doca_dpa_destroy(dpa_ctx); } } } </code></pre> <p>And when I call the dealloc function of my class, the program fail to release flexio heap, the command line shows these error:</p> <pre><code class="lang-bash">heap_destroy 317 - Failed to destroy heap, not all device heap memory was freed flexio_process_destroy 907 - Failed to release prm heap memory flexio_process_destroy 914 - Failed to destroy process PRM object (err = 22) </code></pre> <p>And LeakSanitizer detects the following memory leak stack info:</p> <pre><code class="lang-bash">==1513557==ERROR: LeakSanitizer: detected memory leaks Direct leak of 48 byte(s) in 1 object(s) allocated from: #0 0x7fb37227ea57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154 #1 0x7fb3720eab02 (/lib/x86_64-linux-gnu/libmlx5.so.1+0x68b02) #2 0x7fb3721b39fe in flexio_create_prm_process ../libflexio/src/flexio_prm.c:252 #3 0x7fb3721ac1c3 in process_create ../libflexio/src/flexio.c:689 #4 0x7fb3721ac1c3 in flexio_process_create ../libflexio/src/flexio.c:845 #5 0x7fb37218377e (/opt/mellanox/doca/lib/x86_64-linux-gnu/libdoca_dpa.so.2+0x877e) #6 0x7fb37218621d in doca_dpa_create (/opt/mellanox/doca/lib/x86_64-linux-gnu/libdoca_dpa.so.2+0xb21d) #7 0x40fdab in dpu::DpaKernel::DpaKernel(std::shared_ptr&lt;dpu::DpaDevice&gt;&amp;, doca_dpa_app*, unsigned int) /home/chengrx/dpa_bench/src/dpa/dpa_kernel.cc:12 #8 0x421ed2 in test::DpaKernel_Launch_Test::TestBody() /home/chengrx/dpa_bench/test/dpa/test_dpa_kernel.cc:12 #9 0x4c5397 in void testing::internal::HandleSehExceptionsInMethodIfSupported&lt;testing::Test, void&gt;(testing::Test*, void (testing::Test::*)(), char const*) /home/chengrx/dpa_bench/deps/googletest/googletest/src/gtest.cc:2612 #10 0x4b2e17 in void testing::internal::HandleExceptionsInMethodIfSupported&lt;testing::Test, void&gt;(testing::Test*, void (testing::Test::*)(), char const*) /home/chengrx/dpa_bench/deps/googletest/googletest/src/gtest.cc:2648 #11 0x459c25 in testing::Test::Run() /home/chengrx/dpa_bench/deps/googletest/googletest/src/gtest.cc:2687 Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7fb37227ea57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154 #1 0x7fb3721a9c96 in heap_block_create ../libflexio/src/flexio_heap.c:55 #2 0x7fb3721a9c96 in heap_malloc ../libflexio/src/flexio_heap.c:249 #3 0x7fb3721b5dcf in flexio_buf_dev_alloc ../libflexio/src/flexio_mem.c:134 #4 0x7fb3721b5dcf in flexio_buf_dev_alloc ../libflexio/src/flexio_mem.c:116 #5 0x7fb3721b1e42 in internal_msg_stream_create ../libflexio/src/flexio_msg_stream.c:486 #6 0x7fb3721b2c1d in flexio_msg_stream_create ../libflexio/src/flexio_msg_stream.c:797 #7 0x7fb3721837e3 (/opt/mellanox/doca/lib/x86_64-linux-gnu/libdoca_dpa.so.2+0x87e3) #8 0x7fb37218621d in doca_dpa_create (/opt/mellanox/doca/lib/x86_64-linux-gnu/libdoca_dpa.so.2+0xb21d) #9 0x40fdab in dpu::DpaKernel::DpaKernel(std::shared_ptr&lt;dpu::DpaDevice&gt;&amp;, doca_dpa_app*, unsigned int) /home/chengrx/dpa_bench/src/dpa/dpa_kernel.cc:12 #10 0x421ed2 in test::DpaKernel_Launch_Test::TestBody() /home/chengrx/dpa_bench/test/dpa/test_dpa_kernel.cc:12 #11 0x4c5397 in void testing::internal::HandleSehExceptionsInMethodIfSupported&lt;testing::Test, void&gt;(testing::Test*, void (testing::Test::*)(), char const*) /home/chengrx/dpa_bench/deps/googletest/googletest/src/gtest.cc:2612 #12 0x4b2e17 in void testing::internal::HandleExceptionsInMethodIfSupported&lt;testing::Test, void&gt;(testing::Test*, void (testing::Test::*)(), char const*) /home/chengrx/dpa_bench/deps/googletest/googletest/src/gtest.cc:2648 Direct leak of 32 byte(s) in 1 object(s) allocated from: #0 0x7fb37227ea57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154 #1 0x7fb3721a99d1 in heap_malloc_from_pool ../libflexio/src/flexio_heap.c:185 #2 0x7fb3721a9e0b in heap_malloc ../libflexio/src/flexio_heap.c:264 #3 0x7fb3721b5dcf in flexio_buf_dev_alloc ../libflexio/src/flexio_mem.c:134 #4 0x7fb3721b5dcf in flexio_buf_dev_alloc ../libflexio/src/flexio_mem.c:116 #5 0x7fb3721b1e42 in internal_msg_stream_create ../libflexio/src/flexio_msg_stream.c:486 #6 0x7fb3721b2c1d in flexio_msg_stream_create ../libflexio/src/flexio_msg_stream.c:797 #7 0x7fb3721837e3 (/opt/mellanox/doca/lib/x86_64-linux-gnu/libdoca_dpa.so.2+0x87e3) #8 0x7fb37218621d in doca_dpa_create (/opt/mellanox/doca/lib/x86_64-linux-gnu/libdoca_dpa.so.2+0xb21d) #9 0x40fdab in dpu::DpaKernel::DpaKernel(std::shared_ptr&lt;dpu::DpaDevice&gt;&amp;, doca_dpa_app*, unsigned int) /home/chengrx/dpa_bench/src/dpa/dpa_kernel.cc:12 #10 0x421ed2 in test::DpaKernel_Launch_Test::TestBody() /home/chengrx/dpa_bench/test/dpa/test_dpa_kernel.cc:12 #11 0x4c5397 in void testing::internal::HandleSehExceptionsInMethodIfSupported&lt;testing::Test, void&gt;(testing::Test*, void (testing::Test::*)(), char const*) /home/chengrx/dpa_bench/deps/googletest/googletest/src/gtest.cc:2612 Indirect leak of 48 byte(s) in 1 object(s) allocated from: #0 0x7fb37227ea57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154 #1 0x7fb3720eab02 (/lib/x86_64-linux-gnu/libmlx5.so.1+0x68b02) #2 0x7fb3721b3748 in flexio_create_prm_heap_mem ../libflexio/src/flexio_prm.c:179 #3 0x7fb3721a9d5f in heap_block_create ../libflexio/src/flexio_heap.c:67 #4 0x7fb3721a9d5f in heap_malloc ../libflexio/src/flexio_heap.c:249 #5 0x7fb3721b5dcf in flexio_buf_dev_alloc ../libflexio/src/flexio_mem.c:134 #6 0x7fb3721b5dcf in flexio_buf_dev_alloc ../libflexio/src/flexio_mem.c:116 #7 0x7fb3721b1e42 in internal_msg_stream_create ../libflexio/src/flexio_msg_stream.c:486 #8 0x7fb3721b2c1d in flexio_msg_stream_create ../libflexio/src/flexio_msg_stream.c:797 #9 0x7fb3721837e3 (/opt/mellanox/doca/lib/x86_64-linux-gnu/libdoca_dpa.so.2+0x87e3) #10 0x7fb37218621d in doca_dpa_create (/opt/mellanox/doca/lib/x86_64-linux-gnu/libdoca_dpa.so.2+0xb21d) #11 0x40fdab in dpu::DpaKernel::DpaKernel(std::shared_ptr&lt;dpu::DpaDevice&gt;&amp;, doca_dpa_app*, unsigned int) /home/chengrx/dpa_bench/src/dpa/dpa_kernel.cc:12 #12 0x421ed2 in test::DpaKernel_Launch_Test::TestBody() /home/chengrx/dpa_bench/test/dpa/test_dpa_kernel.cc:12 </code></pre> <p>It seems that, the bug is related to how <code>doca_dpa_create</code> and <code>doca_dpa_destroy</code> are implemented, and I have no way to see the codes. May I ask how to fix the memory leak bugs?</p> <p>Thanks.</p> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="0" /> <span class='post-likes'></span> </div> </div> <div id='post_2' itemprop='comment' itemscope itemtype='http://schema.org/Comment' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" rel='nofollow' href='https://forums.developer.nvidia.com/u/RongxinCheng'><span itemprop='name'>RongxinCheng</span></a> </span> <span class="crawler-post-infos"> <time itemprop='datePublished' datetime='2023-09-26T01:40:14Z' class='post-time'> September 26, 2023, 1:40am </time> <meta itemprop='dateModified' content='2023-09-26T01:40:14Z'> <span itemprop='position'>2</span> </span> </div> <div class='post' itemprop='text'> <p>I think I found the solution, it seems dpa kernel must first release all its events before it actually call <code>doca_dpa_destroy</code>. After I rewrite the order of deallocation as such, the bug is fixed.</p> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="0" /> <span class='post-likes'></span> </div> </div> <div id='post_3' itemprop='comment' itemscope itemtype='http://schema.org/Comment' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" rel='nofollow' href='https://forums.developer.nvidia.com/u/TomNVIDIA'><span itemprop='name'>TomNVIDIA</span></a> </span> <span class="crawler-post-infos"> <time itemprop='datePublished' datetime='2023-09-26T15:05:53Z' class='post-time'> September 26, 2023, 3:05pm </time> <meta itemprop='dateModified' content='2023-09-26T15:05:53Z'> <span itemprop='position'>3</span> </span> </div> <div class='post' itemprop='text'> <p>Thanks for sharing the solution!</p> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="0" /> <span class='post-likes'></span> </div> </div> <div id='post_4' itemprop='comment' itemscope itemtype='http://schema.org/Comment' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" rel='nofollow' href='https://forums.developer.nvidia.com/u/system'><span itemprop='name'>system</span></a> Closed </span> <span class="crawler-post-infos"> <time itemprop='datePublished' datetime='2023-10-10T15:05:58Z' class='post-time'> October 10, 2023, 3:05pm </time> <meta itemprop='dateModified' content='2023-10-10T15:05:58Z'> <span itemprop='position'>4</span> </span> </div> <div class='post' itemprop='text'> <p>This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.</p> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="0" /> <span class='post-likes'></span> </div> </div> </div> <div id="related-topics" class="more-topics__list " role="complementary" aria-labelledby="related-topics-title"> <h3 id="related-topics-title" class="more-topics__list-title"> Related topics </h3> <div class="topic-list-container" itemscope itemtype='http://schema.org/ItemList'> <meta itemprop='itemListOrder' content='http://schema.org/ItemListOrderDescending'> <table class='topic-list'> <thead> <tr> <th>Topic</th> <th></th> <th class="replies">Replies</th> <th class="views">Views</th> <th>Activity</th> </tr> </thead> <tbody> <tr class="topic-list-item" id="topic-list-item-297790"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='1'> <span class="link-top-line"> <a itemprop='url' href='https://forums.developer.nvidia.com/t/doca-example-app-runtime-error-errno-unknown-errno14/297790' class='title raw-link raw-topic-link'>DOCA Example App Runtime Error: errno=UNKNOWN-errno14</a> </span> <div class="link-bottom-line"> <a href='/c/infrastructure/doca/getting-started-resources/373' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #76B900'></span> <span class='badge-category clear-badge'> <span class='category-name'>Getting Started &amp; Resources</span> </span> </a> <div class="discourse-tags"> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>8</span> </td> <td class="views"> <span class='views' title='views'>318</span> </td> <td> February 5, 2025 </td> </tr> <tr class="topic-list-item" id="topic-list-item-284412"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='2'> <span class="link-top-line"> <a itemprop='url' href='https://forums.developer.nvidia.com/t/doca-gpu-packet-processing-failed-to-start-mmap-doca-driver-call-failure/284412' class='title raw-link raw-topic-link'>DOCA: GPU Packet Processing - Failed to start mmap DOCA Driver call failure</a> </span> <div class="link-bottom-line"> <a href='/c/infrastructure/doca/getting-started-resources/373' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #76B900'></span> <span class='badge-category clear-badge'> <span class='category-name'>Getting Started &amp; Resources</span> </span> </a> <div class="discourse-tags"> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>2</span> </td> <td class="views"> <span class='views' title='views'>705</span> </td> <td> June 18, 2024 </td> </tr> <tr class="topic-list-item" id="topic-list-item-232542"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='3'> <span class="link-top-line"> <a itemprop='url' href='https://forums.developer.nvidia.com/t/memory-leak-problem-when-using-nvds-obj-enc-process/232542' class='title raw-link raw-topic-link'>Memory leak problem when using nvds_obj_enc_process</a> </span> <div class="link-bottom-line"> <a href='/c/accelerated-computing/intelligent-video-analytics/deepstream-sdk/15' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #76B900'></span> <span class='badge-category clear-badge'> <span class='category-name'>DeepStream SDK</span> </span> </a> <div class="discourse-tags"> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>8</span> </td> <td class="views"> <span class='views' title='views'>1248</span> </td> <td> November 16, 2022 </td> </tr> <tr class="topic-list-item" id="topic-list-item-183047"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='4'> <span class="link-top-line"> <a itemprop='url' href='https://forums.developer.nvidia.com/t/doca-examples/183047' class='title raw-link raw-topic-link'>Doca examples</a> </span> <div class="link-bottom-line"> <a href='/c/infrastructure/doca/getting-started-resources/373' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #76B900'></span> <span class='badge-category clear-badge'> <span class='category-name'>Getting Started &amp; Resources</span> </span> </a> <div class="discourse-tags"> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>16</span> </td> <td class="views"> <span class='views' title='views'>3045</span> </td> <td> October 12, 2021 </td> </tr> <tr class="topic-list-item" id="topic-list-item-254023"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='5'> <span class="link-top-line"> <a itemprop='url' href='https://forums.developer.nvidia.com/t/cupti-profiling-api-memory-leak/254023' class='title raw-link raw-topic-link'>CUPTI profiling API memory leak</a> </span> <div class="link-bottom-line"> <a href='/c/developer-tools/cuda-profiler-tools-interface-cupti/109' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #76B900'></span> <span class='badge-category clear-badge'> <span class='category-name'>CUPTI – CUDA Profiler Tools Interface</span> </span> </a> <div class="discourse-tags"> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>8</span> </td> <td class="views"> <span class='views' title='views'>1678</span> </td> <td> November 20, 2023 </td> </tr> <tr class="topic-list-item" id="topic-list-item-18340"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='6'> <span class="link-top-line"> <a itemprop='url' href='https://forums.developer.nvidia.com/t/fao-nvidia-engineers-memory-leak-in-cudamemcpyasync-only-occurs-on-host-to-device-memory-transfer/18340' class='title raw-link raw-topic-link'>FAO: Nvidia Engineers:- Memory Leak in cudaMemcpyAsync Only occurs on Host To Device memory transfer</a> </span> <div class="link-bottom-line"> <a href='/c/accelerated-computing/cuda/cuda-programming-and-performance/7' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #76B900'></span> <span class='badge-category clear-badge'> <span class='category-name'>CUDA Programming and Performance</span> </span> </a> <div class="discourse-tags"> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>4</span> </td> <td class="views"> <span class='views' title='views'>5870</span> </td> <td> August 18, 2010 </td> </tr> <tr class="topic-list-item" id="topic-list-item-292922"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='7'> <span class="link-top-line"> <a itemprop='url' href='https://forums.developer.nvidia.com/t/segmentation-fault-in-doca-pe-progress/292922' class='title raw-link raw-topic-link'>Segmentation Fault in doca_pe_progress</a> </span> <div class="link-bottom-line"> <a href='/c/infrastructure/doca/infrastructure-management/377' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #76B900'></span> <span class='badge-category clear-badge'> <span class='category-name'>Infrastructure Management</span> </span> </a> <div class="discourse-tags"> <a href='https://forums.developer.nvidia.com/tag/bluefield-smartnic' class='discourse-tag'>bluefield-smartnic</a> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>0</span> </td> <td class="views"> <span class='views' title='views'>257</span> </td> <td> May 15, 2024 </td> </tr> <tr class="topic-list-item" id="topic-list-item-248227"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='8'> <span class="link-top-line"> <a itemprop='url' href='https://forums.developer.nvidia.com/t/memory-leak-when-testing-deepstream-sample-app/248227' class='title raw-link raw-topic-link'>Memory leak when testing deepstream sample app</a> </span> <div class="link-bottom-line"> <a href='/c/accelerated-computing/intelligent-video-analytics/deepstream-sdk/15' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #76B900'></span> <span class='badge-category clear-badge'> <span class='category-name'>DeepStream SDK</span> </span> </a> <div class="discourse-tags"> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>42</span> </td> <td class="views"> <span class='views' title='views'>1499</span> </td> <td> April 20, 2023 </td> </tr> <tr class="topic-list-item" id="topic-list-item-222697"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='9'> <span class="link-top-line"> <a itemprop='url' href='https://forums.developer.nvidia.com/t/asan-reports-memory-leak-in-libnvidia-glcore-so-515-57/222697' class='title raw-link raw-topic-link'>ASAN reports memory leak in libnvidia-glcore.so.515.57</a> </span> <div class="link-bottom-line"> <a href='/c/gpu-graphics/linux/148' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #76B900'></span> <span class='badge-category clear-badge'> <span class='category-name'>Linux</span> </span> </a> <div class="discourse-tags"> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>10</span> </td> <td class="views"> <span class='views' title='views'>4027</span> </td> <td> December 25, 2023 </td> </tr> <tr class="topic-list-item" id="topic-list-item-304012"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='10'> <span class="link-top-line"> <a itemprop='url' href='https://forums.developer.nvidia.com/t/global-memory-leak-after-register-spill/304012' class='title raw-link raw-topic-link'>Global memory &quot;leak&quot; after register spill?</a> </span> <div class="link-bottom-line"> <a href='/c/accelerated-computing/cuda/cuda-programming-and-performance/7' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #76B900'></span> <span class='badge-category clear-badge'> <span class='category-name'>CUDA Programming and Performance</span> </span> </a> <div class="discourse-tags"> <a href='https://forums.developer.nvidia.com/tag/cuda' class='discourse-tag'>cuda</a> ,&nbsp; <a href='https://forums.developer.nvidia.com/tag/kernel' class='discourse-tag'>kernel</a> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>16</span> </td> <td class="views"> <span class='views' title='views'>68</span> </td> <td> September 3, 2024 </td> </tr> </tbody> </table> </div> </div> </div> <footer class="container wrap"> <nav class='crawler-nav'> <ul> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/' itemprop="url">Home </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/categories' itemprop="url">Categories </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/guidelines' itemprop="url">Guidelines </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='https://www.nvidia.com/en-us/about-nvidia/legal-info/' itemprop="url">Terms of Service </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='https://www.nvidia.com/en-us/about-nvidia/privacy-policy/' itemprop="url">Privacy Policy </a> </span> </li> </ul> </nav> <p class='powered-by-link'>Powered by <a href="https://www.discourse.org">Discourse</a>, best viewed with JavaScript enabled</p> </footer> <script defer="" src="https://sea2.discourse-cdn.com/nvidia/theme-javascripts/d8ea190aad487b8feae316757854a563d15c4c27.js?__ws=forums.developer.nvidia.com" data-theme-id="13" nonce="CjqXk4LxJF5qCYLhLD0h7QXXA"></script> <footer> <div class="footer-links"> <div class="container"> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> <div class="padding-md-footer"> <div class="logo-footer"></div> </div> </div> <div class="col-xs-12 col-sm-12 col-md-9 col-lg-9 padding-section-footer"></div> </div> <div class="col-xs-12 col-sm-12 col-md-9 col-lg-9"></div> </div> </div> </div> <div class="footer-boilerplate"> <div class="container"> <div class="boilerplate"> <div class="col-xs-12 col-sm-12 col-lg-9 padding-sm-bottom"> Copyright © 2024 NVIDIA Corporation <ul class="legal_links"> <li class="first leaf"> <a href="https://www.nvidia.com/en-us/about-nvidia/legal-info/" title="">Legal Information</a> </li> <li class="leaf"> <a href="https://developer.nvidia.com/legal/terms" title="">Terms of Use</a> </li> <li class="leaf"> <a href="https://www.nvidia.com/en-us/about-nvidia/privacy-policy/" title="">Privacy Policy</a> </li> <li class="leaf"> <a href="https://developer.nvidia.com/contact" title="">Contact</a> </li> <li class="last leaf"> <a href="https://www.nvidia.com/en-us/about-nvidia/cookie-policy/" title="NVIDIA websites use cookies to deliver and improve the website experience. See our cookie policy for further details on how we use cookies and how to change your cookie settings.">Cookie Policy</a> </li> </ul> </div> </div> </div> </div> </footer> <div class="buorg"><div>Unfortunately, <a href="https://www.discourse.org/faq/#browser">your browser is unsupported</a>. Please <a href="https://browsehappy.com">switch to a supported browser</a> to view rich content, log in and reply.</div></div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10