<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Hello, I am new to dpdk ... i would like to trace memory usage and detect memory leaks, valgrind as well as address sanitizer (gcc) report some memory loss at application end. For the life of me, i cannot figure it out ...
i just write a simple program that has the rte_eal_init + rte_eal_cleanup and i get the following error (also tried helloworld from examples, with same results):</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM"><br>
</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">==3399==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7f6ca3efb480 at pc 0x7f6ca7162b61 bp 0x7f6ca3efb450 sp 0x7f6ca3efac00</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">WRITE of size 24 at 0x7f6ca3efb480 thread T-1</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">#0 0x7f6ca7162b60 in __interceptor_sigaltstack.part.0 (/lib64/libasan.so.8+0x61b60)</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">#1 0x7f6ca71d9337 in __sanitizer::UnsetAlternateSignalStack() (/lib64/libasan.so.8+0xd8337)</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">#2 0x7f6ca71c90f4 in __asan::AsanThread::Destroy() (/lib64/libasan.so.8+0xc80f4)</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">#3 0x7f6ca679b000 in __GI___nptl_deallocate_tsd (/lib64/libc.so.6+0x8a000)</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">#4 0x7f6ca679dc9d in start_thread (/lib64/libc.so.6+0x8cc9d)</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">#5 0x7f6ca68235df in __GI___clone3 (/lib64/libc.so.6+0x1125df)</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM elementToProof"><br>
</p>
<div class="_1qeIAgB0cPwnLhDF9XSiJM elementToProof" style="margin-top: 0px; margin-bottom: 0px;">
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Address 0x7f6ca3efb480 is a wild pointer inside of access range of size 0x000000000018.</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.8+0x61b60) in __interceptor_sigaltstack.part.0</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Shadow bytes around the buggy address:</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">0x0fee147d7640: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">0x0fee147d7650: 00 00 00 00 00 00 00 00 00 06 f2 f2 f2 f2 00 00</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">0x0fee147d7660: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">0x0fee147d7670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">0x0fee147d7680: 00 00 00 00 00 00 00 00 00 00 00 04 f3 f3 f3 f3</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">=>0x0fee147d7690:[f3]f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">0x0fee147d76a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">0x0fee147d76b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">0x0fee147d76c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">0x0fee147d76d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">0x0fee147d76e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Shadow byte legend (one shadow byte represents 8 application bytes):</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Addressable: 00</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Partially addressable: 01 02 03 04 05 06 07</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Heap left redzone: fa</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Freed heap region: fd</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Stack left redzone: f1</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Stack mid redzone: f2</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Stack right redzone: f3</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Stack after return: f5</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Stack use after scope: f8</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Global redzone: f9</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Global init order: f6</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Poisoned by user: f7</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Container overflow: fc</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Array cookie: ac</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Intra object redzone: bb</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">ASan internal: fe</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Left alloca redzone: ca</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Right alloca redzone: cb</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">==3399==ABORTING</p>
</div>
<div class="_1qeIAgB0cPwnLhDF9XSiJM elementToProof" style="margin-top: 0px; margin-bottom: 0px;">
<br>
</div>
<div class="_1qeIAgB0cPwnLhDF9XSiJM elementToProof" style="margin-top: 0px; margin-bottom: 0px;">
<p class="_1qeIAgB0cPwnLhDF9XSiJM">I am not sure what I m doing wrong but it is very frustrating. On top of that, I try other scenarios and see if I can just "ignore" that and still detect other memory leaks but it does not work. I get memory from rte_malloc
and don't free it and I still get the above report only, I do not get any report from the memory I leaked intentionally ... no difference what so ever .... I tried the same with the helloworld example and I get the same results ....</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM"><br>
</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Please, if anyone can shed some light and point me in any direction ... I have already searched google for 2 days with nothing new ... surely, I m doing something wrong but I believe I have read everything I can find on google
related to tracing memory in dpdk and there is very little information about it and mostly dismiss valgrind and favor the address sanitizer ...</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM"><br>
</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">specs:</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">Fedora 36 server edition (KVM vm)</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1)</p>
<p class="_1qeIAgB0cPwnLhDF9XSiJM">dpdk 22.03 (compiled with: -Dbuildtype=debug -Dprefix=/path/to/lib/dpdk-22.03/debug/ -Dtests=false -Denable_kmods=true -Denable_trace_fp=true -Db_sanitize=address)</p>
<br>
</div>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
thank you very much!<br>
</div>
</body>
</html>