From e37a8821c7b6a8a3f2ab1e1e5d9d38eaff2a8b83 Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Wed, 21 Oct 2009 16:41:07 -0600 Subject: [PATCH] Use valgrind on OS X (separate the suppressions file per-platform) Change-Id: If933766db5afaa8f271f3b86e5c881d2c2f68170 Reviewed-on: http://gerrit.dechocorp.com/1749 Reviewed-by: Brian Palmer --- mordor.supp => linux.supp | 0 mordor/fiber.cpp | 4 +- mordor/fiber.h | 2 +- mordor/pch.h | 2 +- osx.supp | 192 ++++++++++++++++++++++++++++++++++++++ valgrind.supp | 69 -------------- 6 files changed, 196 insertions(+), 73 deletions(-) rename mordor.supp => linux.supp (100%) create mode 100644 osx.supp delete mode 100644 valgrind.supp diff --git a/mordor.supp b/linux.supp similarity index 100% rename from mordor.supp rename to linux.supp diff --git a/mordor/fiber.cpp b/mordor/fiber.cpp index a1537ea8..774d559a 100644 --- a/mordor/fiber.cpp +++ b/mordor/fiber.cpp @@ -399,7 +399,7 @@ Fiber::allocStack() m_stack = mmap(NULL, m_stacksize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); if (m_stack == MAP_FAILED) MORDOR_THROW_EXCEPTION_FROM_LAST_ERROR_API("mmap"); -#ifdef LINUX +#if defined(LINUX) || defined(OSX) m_valgrindStackId = VALGRIND_STACK_REGISTER(m_stack, (char *)m_stack + m_stacksize); #endif m_sp = (char*)m_stack + m_stacksize; @@ -414,7 +414,7 @@ Fiber::freeStack() #elif defined(WINDOWS) VirtualFree(m_stack, 0, MEM_RELEASE); #elif defined(POSIX) -#ifdef LINUX +#if defined(LINUX) || defined(OSX) VALGRIND_STACK_DEREGISTER(m_valgrindStackId); #endif munmap(m_stack, m_stacksize); diff --git a/mordor/fiber.h b/mordor/fiber.h index b737543d..03e5dfcd 100644 --- a/mordor/fiber.h +++ b/mordor/fiber.h @@ -173,7 +173,7 @@ class Fiber : public boost::enable_shared_from_this #elif defined(SETJMP_FIBERS) jmp_buf m_env; #endif -#ifdef LINUX +#if defined(LINUX) || defined(OSX) int m_valgrindStackId; #endif State m_state, m_yielderNextState; diff --git a/mordor/pch.h b/mordor/pch.h index a9e0991e..5c693ef6 100644 --- a/mordor/pch.h +++ b/mordor/pch.h @@ -108,7 +108,7 @@ #include #include -#ifdef LINUX +#if defined(LINUX) || defined (OSX) #include #endif diff --git a/osx.supp b/osx.supp new file mode 100644 index 00000000..0201a7b8 --- /dev/null +++ b/osx.supp @@ -0,0 +1,192 @@ +{ + + Memcheck:Leak + fun:malloc + fun:_ZN5boost6detail25get_once_per_thread_epochEv + fun:_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_ + fun:_ZN5boost6detail12get_tss_dataEPKv +} +{ + strftime on mac + Memcheck:Cond + fun:strftime_l$UNIX2003 +} +{ + + Memcheck:Leak + fun:malloc + fun:_nc_table_new + fun:token_table_add + fun:notify_register_check + fun:notify_register_tz + fun:tzsetwall_basic + fun:tzset + fun:strftime_l$UNIX2003 +} +{ + + Memcheck:Leak + fun:malloc + fun:_nc_table_insert_n + fun:token_table_add + fun:notify_register_check + fun:notify_register_tz + fun:tzsetwall_basic + fun:tzset + fun:strftime_l$UNIX2003 +} +{ + + Memcheck:Leak + fun:calloc + fun:token_table_add + fun:notify_register_check + fun:notify_register_tz + fun:tzsetwall_basic + fun:tzset + fun:strftime_l$UNIX2003 +} +{ + + Memcheck:Leak + fun:calloc + fun:_nc_table_new + fun:token_table_add + fun:notify_register_check + fun:notify_register_tz + fun:tzsetwall_basic + fun:tzset + fun:strftime_l$UNIX2003 +} +{ + + Memcheck:Leak + fun:malloc + fun:tzsetwall_basic + fun:tzset + fun:strftime_l$UNIX2003 +} +{ + + Memcheck:Leak + fun:malloc + fun:tzload + fun:tzsetwall_basic + fun:tzset + fun:strftime_l$UNIX2003 +} +{ + + Memcheck:Leak + fun:calloc + fun:_Unwind_Find_FDE + fun:_Unwind_GetIPInfo + fun:_Unwind_GetIPInfo + fun:_Unwind_RaiseException + fun:__cxa_throw +} +{ + + Memcheck:Leak + fun:malloc + fun:get_or_create_key_element + fun:_keymgr_get_and_lock_processwide_ptr_2 + fun:_keymgr_get_and_lock_processwide_ptr + fun:_Unwind_Find_FDE + fun:_Unwind_GetIPInfo + fun:_Unwind_GetIPInfo + fun:_Unwind_RaiseException + fun:__cxa_throw +} +{ + + Memcheck:Leak + fun:malloc + fun:__register_frame + fun:_Unwind_Find_FDE + fun:_Unwind_GetIPInfo + fun:_Unwind_GetIPInfo + fun:_Unwind_RaiseException + fun:__cxa_throw +} +{ + + Memcheck:Leak + fun:calloc + fun:_Unwind_Find_FDE + fun:_Unwind_GetIPInfo + fun:_Unwind_RaiseException + fun:__cxa_throw +} +{ + + Memcheck:Leak + fun:malloc + fun:__register_frame + fun:_Unwind_Find_FDE + fun:_Unwind_GetIPInfo + fun:_Unwind_RaiseException + fun:__cxa_throw +} +{ + + Memcheck:Leak + fun:malloc + fun:atexit_register + fun:__cxa_atexit +} +{ + + Memcheck:Leak + fun:malloc + fun:__cxa_get_globals + fun:__cxa_allocate_exception +} +{ + + Memcheck:Leak + fun:malloc + fun:__smakebuf + fun:__swsetup + fun:__sfvwrite + fun:fwrite$UNIX2003 +} +{ + + Memcheck:Leak + fun:_Znwm + fun:_ZN5boost63_GLOBAL__N_libs_thread_src_pthread_thread.cpp_00000000_B329391125make_external_thread_dataEv + fun:_ZN5boost6detail12set_tss_dataEPKvNS_10shared_ptrINS0_20tss_cleanup_functionEEEPvb +} +{ + + Memcheck:Leak + fun:_Znwm + fun:_ZN5boost6detail12shared_countC2IPNS_19thread_specific_ptr*run_custom_cleanup_functionENS0_14do_heap_deleteIS7_EEEET_T0_ + fun:_ZN5boost6detail12shared_countC1IPNS_19thread_specific_ptr*run_custom_cleanup_functionENS0_14do_heap_deleteIS7_EEEET_T0_ + fun:_ZN5boost10shared_ptrINS_6detail20tss_cleanup_functionEEC2INS_19thread_specific_ptr*run_custom_cleanup_functionENS1_14do_heap_deleteIS9_EEEEPT_T0_ + fun:_ZN5boost10shared_ptrINS_6detail20tss_cleanup_functionEEC1INS_19thread_specific_ptr*run_custom_cleanup_functionENS1_14do_heap_deleteIS9_EEEEPT_T0_ + fun:_ZN5boost10shared_ptrINS_6detail20tss_cleanup_functionEE5resetINS_19thread_specific_ptr*run_custom_cleanup_functionENS1_14do_heap_deleteIS9_EEEEvPT_T0_ +} +{ + + Memcheck:Leak + fun:_Znwm + fun:_ZN5boost6detail13heap_new_implINS_19thread_specific_ptr*run_custom_cleanup_functionERPFvPS4_EEEPT_T0_ + fun:_ZN5boost6detail8heap_newINS_19thread_specific_ptr*run_custom_cleanup_functionEPFvPS4_EEEPT_RT0_ +} +{ + + Memcheck:Leak + fun:_Znwm + fun:_ZN5boost6detail12set_tss_dataEPKvNS_10shared_ptrINS0_20tss_cleanup_functionEEEPvb +} +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:new_sem_from_pool + fun:_pthread_cond_wait + fun:pthread_cond_wait$UNIX2003 +} diff --git a/valgrind.supp b/valgrind.supp deleted file mode 100644 index a5885000..00000000 --- a/valgrind.supp +++ /dev/null @@ -1,69 +0,0 @@ -{ - pthread_once - Memcheck:Leak - fun:malloc - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/libc-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/libc-2.7.so - fun:__libc_dlopen_mode - obj:/lib/libc-2.7.so - fun:pthread_once -} -{ - boost::tss init - Memcheck:Leak - fun:malloc - fun:_ZN5boost6detail25get_once_per_thread_epochEv - fun:_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_ - fun:_ZN5boost6detail23get_current_thread_dataEv - fun:_ZN5boost6detail13find_tss_dataEPKv - fun:_ZN5boost6detail12get_tss_dataEPKv -} -{ - boost::tss var - Memcheck:Leak - fun:_Znwm - fun:_ZN5boost6detail13heap_new_implINS_19thread_specific_ptr*run_custom_cleanup_function* - fun:_ZN5boost6detail8heap_newINS_19thread_specific_ptr*run_custom_cleanup_function* - fun:_ZN5boost19thread_specific_ptr* -} -{ - boost::tss set - Memcheck:Leak - fun:_Znwm - obj:/usr/lib/libboost_thread.so.1.40.0 - fun:_ZN5boost6detail12set_tss_dataEPKvNS_10shared_ptrINS0_20tss_cleanup_functionEEEPvb - fun:_ZN5boost19thread_specific_ptr*reset* -} -{ - boost::tss set - Memcheck:Leak - fun:_Znwm - fun:_ZN5boost6detail12set_tss_dataEPKvNS_10shared_ptrINS0_20tss_cleanup_functionEEEPvb - fun:_ZN5boost19thread_specific_ptr*reset* -} -{ - boost::tss destroy - Memcheck:Leak - fun:_Znwm - fun:_ZN5boost6detail12shared_countC1IPNS_19thread_specific_ptr*run_custom_cleanup_function*do_heap_delete*_ - fun:_ZN5boost10shared_ptrINS_6detail20tss_cleanup_functionEEC1INS_19thread_specific_ptr*run_custom_cleanup_function*do_heap_delete* - fun:_ZN5boost10shared_ptrINS_6detail20tss_cleanup_functionEE5resetINS_19thread_specific_ptr*run_custom_cleanup_function*do_heap_delete* - fun:_ZN5boost19thread_specific_ptr* -} -{ - boost::date_time::time_input_facet - Memcheck:Cond - obj:/lib/libc-2.7.so - fun:_ZNKSt11__timepunctIcE6_M_putEPcmPKcPK2tm - fun:_ZNKSt8time_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecPK2tmcc - fun:_ZNKSt8time_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_RSt8ios_basecPK2tmPKcSB_ - fun:_ZN5boost9date_time20gather_month_stringsIcEESt6vectorISbIT_St11char_traitsIS3_ESaIS3_EESaIS7_EERKSt6localeb - fun:_ZN5boost9date_time18format_date_parserINS_9gregorian4dateEcEC1ERKSsRKSt6locale - fun:_ZN5boost9date_time16date_input_facetINS_9gregorian4dateEcSt19istreambuf_iteratorIcSt11char_traitsIcEEEC2ERKSsm - fun:_ZN5boost9date_time16time_input_facetINS_10posix_time5ptimeEcSt19istreambuf_iteratorIcSt11char_traitsIcEEEC1ERKSsm -}