#
# This is a valgrind suppression file for Onedata helpers.
#
#  Here's an example of running valgrind:
#
#	cd python/dist/src
#	valgrind --tool=memcheck --suppressions=Misc/valgrind.supp \
#		./python -E -tt ./Lib/test/regrtest.py -u bsddb,network
#

# all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif

#
# Supress ld issues
#
{
   Generic ubuntu ld problems
   Memcheck:Addr8
   obj:/lib64/ld-linux-x86-64.so.2
   obj:/lib64/ld-linux-x86-64.so.2
   obj:/lib64/ld-linux-x86-64.so.2
   obj:/lib64/ld-linux-x86-64.so.2
}

#
# Disable all internal Python leaks and errors
#
{
   ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
   Memcheck:Cond
   ...
   obj:/usr/bin/python2.7
   ...
}

{
   PYTHON_LEAKS/Any leak in Python related to running PyTest
   Memcheck:Leak
   ...
   obj:/usr/bin/python2.7
   ...
}

{
   PYTHON_LEAKS/Any leak in Python related to running PyTest
   Memcheck:Value4
   ...
   obj:/usr/bin/python2.7
   ...
}

{
   PYTHON_LEAKS/Any leak in Python related to running PyTest
   Memcheck:Value8
   ...
   obj:/usr/bin/python2.7
   ...
}

{
   PYTHON_LEAKS/Any leak in Python related to running PyTest
   Memcheck:Addr4
   ...
   obj:/usr/bin/python2.7
   ...
}

{
   PYTHON_LEAKS/Any leak in Python related to running PyTest
   Memcheck:Addr8

   ...
   obj:/usr/bin/python2.7
   ...
}

#
# Supress libnspr4 leaks
#
{
   LIBNSPR4/libnspr leaks
   Memcheck:Leak

   ...
   obj:/usr/lib/x86_64-linux-gnu/libnspr4.so
   ...
}

#
# Supress dl_open leaks
#
{
   DLOPEN/_dl_open leaks
   Memcheck:Leak

   ...
   fun:_dl_open
   ...
}

#
# Supress glusterfs xlator_init leaks
#
{
   GLUSTERFS_XLATOR/xlator_init leaks
   Memcheck:Leak

   ...
   fun:xlator_init
   ...
}

#
# Supress libprotobuf potential leaks
#
{
   PROTOBUF/libprotobuf leaks
   Memcheck:Leak

   ...
   obj:/usr/lib/x86_64-linux-gnu/libprotobuf.so.14.0.0
   ...
}

#
# TODO: VFS-XXXX Supress memory allocation error in s3-aws-sdk
#
{
   AWS-SDK/s3 mismatched malloc/free in release stream
   Memcheck:Free
   fun:free
   fun:_ZN3Aws5Utils6Stream14ResponseStream13ReleaseStreamEv
}

#
#
#
{
   GLUSTERFS/connection leak
   Memcheck:Leak
   match-leak-kinds: definite
   ...
   fun:glfs_new@@GFAPI_3.4.0
   fun:_ZZN3one7helpers15GlusterFSHelper7connectEvENKUlvE_clEv
   ...
}

{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   match-leak-kinds: definite
   fun:malloc
   fun:mem_get
   fun:mem_get0
   fun:get_new_dict_full
   fun:glusterfs_graph_insert
   fun:glusterfs_graph_prepare
   fun:glfs_process_volfp
   fun:glfs_mgmt_getspec_cbk
   fun:rpc_clnt_handle_reply
   fun:rpc_clnt_notify
   fun:rpc_transport_notify
   fun:socket_event_poll_in
}

{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   match-leak-kinds: definite
   fun:calloc
   fun:__gf_calloc
   fun:glusterfs_oldvolfile_update
   fun:glfs_mgmt_getspec_cbk
   fun:rpc_clnt_handle_reply
   fun:rpc_clnt_notify
   fun:rpc_transport_notify
   fun:socket_event_poll_in
   fun:socket_event_handler
   fun:event_dispatch_epoll_handler
   fun:event_dispatch_epoll_worker
   fun:start_thread
}

{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   match-leak-kinds: definite
   fun:malloc
   fun:mem_get
   fun:mem_get0
   fun:dict_set_lk
   fun:dict_set
   fun:dict_set_dynstr
   fun:volume_option
   fun:graphyyparse
   fun:glusterfs_graph_construct
   fun:glfs_process_volfp
   fun:glfs_mgmt_getspec_cbk
   fun:rpc_clnt_handle_reply
   fun:rpc_clnt_notify
}

{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   match-leak-kinds: definite
   fun:malloc
   fun:mem_get
   fun:mem_get0
   fun:get_new_dict_full
   fun:new_volume
   fun:graphyyparse
   fun:glusterfs_graph_construct
   fun:glfs_process_volfp
   fun:glfs_mgmt_getspec_cbk
   fun:rpc_clnt_handle_reply
   fun:rpc_clnt_notify
   fun:rpc_transport_notify
   fun:socket_event_poll_in
}

{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   match-leak-kinds: definite
   fun:calloc
   fun:__gf_calloc
   fun:xlator_dynload
   fun:create_master
   fun:glfs_init_common
   fun:glfs_init@@GFAPI_3.4.0
   fun:_ZZN3one7helpers15GlusterFSHelper7connectEvENKUlvE_clEv
   fun:_ZN5folly7futures6detail17CoreCallbackStateINS_4UnitEZN3one7helpers15GlusterFSHelper7connectEvEUlvE_E6invokeIJEEEDaDpOT_
   fun:_ZZN5folly7futures6detail17CoreCallbackStateINS_4UnitEZN3one7helpers15GlusterFSHelper7connectEvEUlvE_E9tryInvokeIJEEEDaDpOT_ENKUlvE_clEv
   fun:_ZN5folly11makeTryWithIZNS_7futures6detail17CoreCallbackStateINS_4UnitEZN3one7helpers15GlusterFSHelper7connectEvEUlvE_E9tryInvokeIJEEEDaDpOT_EUlvE_EENSt9enable_ifIXntsrSt7is_sameINSt9result_ofIFT_vEE4typeEvE5valueENS_3TryISL_EEE4typeEOSI_
   fun:_ZN5folly7futures6detail17CoreCallbackStateINS_4UnitEZN3one7helpers15GlusterFSHelper7connectEvEUlvE_E9tryInvokeIJEEEDaDpOT_
   fun:_ZZN5folly6FutureINS_4UnitEE18thenImplementationIZN3one7helpers15GlusterFSHelper7connectEvEUlvE_NS_7futures6detail14callableResultIS1_S7_EELb0EJEEENSt9enable_ifIXsrNT0_13ReturnsFutureE5valueENSD_6ReturnEE4typeEOT_NS9_9argResultIXT1_ESI_JDpT2_EEEENUlONS_3TryIS1_EEE_clESQ_
   fun:_ZN5folly6detail8function14FunctionTraitsIFvONS_3TryINS_4UnitEEEEE9callSmallIZNS_6FutureIS4_E18thenImplementationIZN3one7helpers15GlusterFSHelper7connectEvEUlvE_NS_7futures6detail14callableResultIS4_SG_EELb0EJEEENSt9enable_ifIXsrNT0_13ReturnsFutureE5valueENSM_6ReturnEE4typeEOT_NSI_9argResultIXT1_ESR_JDpT2_EEEEUlS6_E_EEvRNS1_4DataES6_
}

{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   match-leak-kinds: definite
   fun:calloc
   fun:__gf_calloc
   fun:rpcclnt_cbk_program_register
   fun:glfs_mgmt_init
   fun:glfs_init_common
   fun:glfs_init@@GFAPI_3.4.0
   fun:_ZZN3one7helpers15GlusterFSHelper7connectEvENKUlvE_clEv
   fun:_ZN5folly7futures6detail17CoreCallbackStateINS_4UnitEZN3one7helpers15GlusterFSHelper7connectEvEUlvE_E6invokeIJEEEDaDpOT_
   fun:_ZZN5folly7futures6detail17CoreCallbackStateINS_4UnitEZN3one7helpers15GlusterFSHelper7connectEvEUlvE_E9tryInvokeIJEEEDaDpOT_ENKUlvE_clEv
   fun:_ZN5folly11makeTryWithIZNS_7futures6detail17CoreCallbackStateINS_4UnitEZN3one7helpers15GlusterFSHelper7connectEvEUlvE_E9tryInvokeIJEEEDaDpOT_EUlvE_EENSt9enable_ifIXntsrSt7is_sameINSt9result_ofIFT_vEE4typeEvE5valueENS_3TryISL_EEE4typeEOSI_
   fun:_ZN5folly7futures6detail17CoreCallbackStateINS_4UnitEZN3one7helpers15GlusterFSHelper7connectEvEUlvE_E9tryInvokeIJEEEDaDpOT_
   fun:_ZZN5folly6FutureINS_4UnitEE18thenImplementationIZN3one7helpers15GlusterFSHelper7connectEvEUlvE_NS_7futures6detail14callableResultIS1_S7_EELb0EJEEENSt9enable_ifIXsrNT0_13ReturnsFutureE5valueENSD_6ReturnEE4typeEOT_NS9_9argResultIXT1_ESI_JDpT2_EEEENUlONS_3TryIS1_EEE_clESQ_
}

{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   match-leak-kinds: definite
   fun:malloc
   fun:mem_get
   fun:__saved_frames_put
   fun:__save_frame
   fun:rpc_clnt_submit
   obj:*
   obj:*
   obj:*
   fun:rpc_clnt_notify
   fun:rpc_transport_notify
   fun:socket_connect_finish
   fun:socket_event_handler
}

