# This is the valgrind.supp used by `bazel test --config memcheck`.

{
    MOSEK invalid memory access #1
    Memcheck:Addr4
    ...
    fun:checkout_from_flexlm
}

{
    MOSEK invalid memory access #2
    Memcheck:Addr16
    ...
    fun:checkout_from_flexlm
}


{
    MOSEK invalid memory access #3
    Memcheck:Leak
    match-leak-kinds: possible
    ...
    fun:moseklicense_checkout
}

{
   MOSEK use of uninitialized CPU condition code #1
   Memcheck:Cond
   fun:internal_ascii_loop
   fun:__gconv_transform_internal_ascii
   fun:wcsrtombs
   obj:*/libmosek64.so.*
}

{
   MOSEK use of uninitialized CPU condition code #2
   Memcheck:Cond
   fun:__wcsnlen_avx2
   fun:wcsrtombs
   obj:*/libmosek64.so.*
}

{
   MOSEK use of uninitialized CPU condition code #3
   Memcheck:Cond
   obj:*/libmosek64.so.*
}

{
   MOSEK memory leak #1
   Memcheck:Leak
   match-leak-kinds: possible
   fun:malloc
   obj:*/libmosek64.so.*
}

{
   MOSEK memory leak #2
   Memcheck:Leak
   match-leak-kinds: possible
   fun:calloc
   fun:allocate_dtv
   ...
   obj:*/libmosek64.so.10.0
}

# Started happening when Gurobi got updated to 7.0.2. PR 6332.
{
    <gurobi-1>
    Memcheck:Leak
    match-leak-kinds: possible
    fun:malloc
    fun:mkl_serv_thread_free_buffers
    fun:PRIVATE*
}

# Started happening when Gurobi got updated to 10.0.2. PR 19766.
{
    <gurobi-2>
    Memcheck:Leak
    match-leak-kinds: possible
    fun:malloc
    ...
    fun:mkl_blas_dtrsm
    ...
    fun:PRIVATE*
}

# Started happening when using libOSMesa for offscreen rendering, PR 7851.
{
    <libosmesa-1>
    Memcheck:Leak
    match-leak-kinds: possible
    fun:malloc
    obj:/usr/lib/x86_64-linux-gnu/libOSMesa.so.8.0.0
    ...
    fun:call_init.part.0
    fun:call_init
    fun:_dl_init
    obj:/lib/x86_64-linux-gnu/ld-2.23.so
}

{
   bash: definite leak in set_default_locale
   Memcheck:Leak
   match-leak-kinds: definite
   fun:malloc
   fun:xmalloc
   fun:set_default_locale
   fun:main
}

{
   bash: definite leak in reader_loop
   Memcheck:Leak
   match-leak-kinds: definite
   fun:malloc
   fun:xmalloc
   ...
   fun:reader_loop
   fun:main
}

# TODO(sam.creasey) Write a printer function (or another workaround) for
# drake::multibody::test::ModelLoadFunction so that gtest won't trigger
# memcheck. Related to https://github.com/google/googletest/issues/1610.
{
   googletest: conditional jump or move depends on uninitialised value in PrintValue
   Memcheck:Cond
   ...
   fun:vfprintf
   fun:vsnprintf
   fun:snprintf
   fun:*PrintByteSegmentInObjectTo*
   fun:PrintBytesInObjectToImpl
   fun:*PrintBytesInObjectTo*
   fun:PrintValue
}

{
   googletest: use of uninitialized value of size 8 in PrintValue
   Memcheck:Value8
   ...
   fun:vfprintf
   fun:vsnprintf
   fun:snprintf
   fun:*PrintByteSegmentInObjectTo*
   fun:PrintBytesInObjectToImpl
   fun:*PrintBytesInObjectTo*
   fun:PrintValue
}

{
   nvidia-glcore: conditional jump or move depends on uninitialized value
   Memcheck:Cond
   ...
   obj:/usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.*
}

{
   python: invalid read of size 4 in PyObject_Free
   Memcheck:Addr4
   ...
   fun:PyObject_Free
}

{
   python: invalid read of size 4 in PyObject_Free
   Memcheck:Value4
   ...
   fun:PyObject_Free
}

{
   python: use of uninitialized value of size 8 in PyObject_Free
   Memcheck:Addr8
   ...
   fun:PyObject_Free
}

{
   python: use of uninitialized value of size 8 in PyObject_Free
   Memcheck:Value8
   ...
   fun:PyObject_Free
}

{
   python: conditional jump or move depends on uninitialized value in PyObject_Free
   Memcheck:Cond
   ...
   fun:PyObject_Free
}

{
   python: invalid read of size 4 in PyObject_Realloc
   Memcheck:Addr4
   ...
   fun:PyObject_Realloc
}

{
   python: invalid read of size 4 in PyObject_Realloc
   Memcheck:Value4
   ...
   fun:PyObject_Realloc
}

{
   python: use of uninitialized value of size 8 in PyObject_Realloc
   Memcheck:Addr8
   ...
   fun:PyObject_Realloc
}

{
   python: use of uninitialized value of size 8 in PyObject_Realloc
   Memcheck:Value8
   ...
   fun:PyObject_Realloc
}

{
   python: conditional jump or move depends on uninitialized value in PyObject_Realloc
   Memcheck:Cond
   ...
   fun:PyObject_Realloc
}

{
   swrast: conditional jump or move depends on uninitialized value in clone
   Memcheck:Cond
   ...
   obj:/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
   fun:start_thread
   fun:clone
}

{
   swrast: use of uninitialized value of size 8 in clone
   Memcheck:Value8
   ...
   obj:/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
   fun:start_thread
   fun:clone
}

{
   libclp: invalid read of size 4 in startup via SimplexPrimal
   Memcheck:Addr4
   fun:_ZN10ClpSimplex7startupEii
   fun:_ZN16ClpSimplexPrimal6primalEii
   fun:_ZN10ClpSimplex6primalEii
   fun:_ZN10ClpSimplex15reducedGradientEi
   fun:_ZN10ClpSimplex6primalEii
}

{
   libclp: invalid read of size 4 in startup via SimplexNonlinear
   Memcheck:Addr4
   fun:_ZN10ClpSimplex7startupEii
   fun:_ZN19ClpSimplexNonlinear6primalEv
   fun:_ZN10ClpSimplex6primalEii
}
