valgrind cleanup and suppresion
authorimarom <[email protected]>
Sun, 4 Dec 2016 13:14:43 +0000 (15:14 +0200)
committerimarom <[email protected]>
Sun, 4 Dec 2016 13:14:43 +0000 (15:14 +0200)
Signed-off-by: imarom <[email protected]>
scripts/t-rex-64-valgrind
scripts/valgrind.sup [new file with mode: 0644]
src/main_dpdk.cpp

index 5ac2bec..d11491b 100755 (executable)
@@ -31,7 +31,8 @@ export LD_LIBRARY_PATH=$PWD:$PWD/dumy_libs
 fi
             
 export VALGRIND_LIB=/auto/proj-pcube-b/apps/PL-b/tools/valgrind-dpdk/lib/valgrind
-export VALGRIND_BIN="/auto/proj-pcube-b/apps/PL-b/tools/valgrind-dpdk/bin/valgrind --leak-check=full"
+export VALGRIND_BIN="/auto/proj-pcube-b/apps/PL-b/tools/valgrind-dpdk/bin/valgrind --leak-check=full --error-exitcode=1 --suppressions=valgrind.sup"
+export GLIBCXX_FORCE_NEW=1
 
 if [ -t 0 ] && [ -t 1 ]; then
     export is_tty=true
diff --git a/scripts/valgrind.sup b/scripts/valgrind.sup
new file mode 100644 (file)
index 0000000..b6bcc88
--- /dev/null
@@ -0,0 +1,57 @@
+{
+   DL issue
+   Memcheck:Cond
+   fun:index
+   fun:expand_dynamic_string_token
+   fun:fillin_rpath
+   fun:_dl_init_paths
+   fun:dl_main
+   fun:_dl_sysdep_start
+   fun:_dl_start_final
+   fun:_dl_start
+   obj:/lib/x86_64-linux-gnu/ld-2.19.so
+   obj:*
+   obj:*
+   obj:*
+   obj:*
+}
+
+{
+   DPDK threads
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:calloc
+   fun:allocate_dtv
+   fun:_dl_allocate_tls
+   fun:allocate_stack
+   fun:pthread_create@@GLIBC_2.2.5
+   fun:rte_eal_init
+   fun:_Z9main_testiPPc
+   fun:(below main)
+}
+
+{
+   DPDK interrupt thread
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:calloc
+   fun:allocate_dtv
+   fun:_dl_allocate_tls
+   fun:allocate_stack
+   fun:pthread_create@@GLIBC_2.2.5
+   fun:rte_eal_intr_init
+   fun:rte_eal_init
+   fun:_Z9main_testiPPc
+   fun:(below main)
+}
+
+{
+   DPDK epoll ctl
+   Memcheck:Param
+   epoll_ctl(event)
+   fun:epoll_ctl
+   fun:eal_intr_thread_main
+   fun:start_thread
+   fun:clone
+}
+
index add2e70..c9e0c6a 100644 (file)
@@ -3429,12 +3429,14 @@ bool CGlobalTRex::is_all_links_are_up(bool dump){
 void CGlobalTRex::try_stop_all_cores(){
 
     TrexStatelessDpQuit * dp_msg= new TrexStatelessDpQuit();
-    TrexStatelessRxQuit * rx_msg= new TrexStatelessRxQuit();
     send_message_all_dp(dp_msg);
+    delete dp_msg;
+    
     if (get_is_stateless()) {
+        TrexStatelessRxQuit * rx_msg= new TrexStatelessRxQuit();
         send_message_to_rx(rx_msg);
     }
-    delete dp_msg;
+    
     // no need to delete rx_msg. Deleted by receiver
     bool all_core_finished = false;
     int i;
@@ -3796,7 +3798,14 @@ bool CGlobalTRex::Create(){
 
 }
 void CGlobalTRex::Delete(){
+    
     m_zmq_publisher.Delete();
+    m_fl.Delete();
+    
+    if (m_trex_stateless) {
+        delete m_trex_stateless;
+        m_trex_stateless = NULL;
+    }
 }
 
 
@@ -4597,8 +4606,11 @@ void CGlobalTRex::shutdown() {
     for (int i = 0; i < m_max_ports; i++) {
         m_ports[i].stop();
     }
+    
     if (m_mark_for_shutdown != SHUTDOWN_TEST_ENDED) {
         /* we should stop latency and exit to stop agents */
+        Delete();
+        utl_termio_reset();
         exit(-1);
     }
 }
@@ -4762,7 +4774,6 @@ int CGlobalTRex::stop_master(){
 
     dump_stats(stdout,CGlobalStats::dmpSTANDARD);
     dump_post_test_stats(stdout);
-    m_fl.Delete();
 
     return (0);
 }
@@ -5615,7 +5626,7 @@ int main_test(int argc , char * argv[]){
     g_trex.stop_master();
     g_trex.Delete();
     utl_termio_reset();
-
+    
     return (0);
 }