syntax highlight

Monday, 23 March 2009

Valgrind - OCI: Suppressions file FTW!

Update: There's a new Valgrind suppressions file @ this link.

Working [1] on a C++ project with Oracle I found that Valgrind reported lots of warnings related to OCI, for which, regardless of being false positives [2] or not, there's little I can do about (other than migrating to MySQL, that is). As the error report kept growing I found that Valgrind will refuse to keep track of new errors after a million or so:

More than 1000000 errors detected. I'm not reporting any more. Final error counts may be inaccurate. Go fix your program!

The solution in this case is a suppresions file for Valgrind. After spending a good deal of time unsuccsesfuly trying to get one I had to do it myself and upload it for the next one to run into this problem:

Link to the file: Valgrind / OCI suppressions.

4 comments:

  1. Great work, just what I'm looking for - but where is the file? (the link seems broken)

    ReplyDelete
  2. Should have been a temporary glitch, anyway this is the file:

    {
    OCI suppression
    Memcheck:Cond
    fun:slpmloclfv
    fun:slpmloc
    fun:lpmloadpkg
    fun:lfvLoadPkg
    }

    {
    OCI suppression
    Memcheck:Value4
    fun:ztced_einit
    fun:ztcedgks
    fun:ztcedi
    fun:ztcebi
    fun:ztcei
    }

    {
    OCI suppression
    Memcheck:Value4
    fun:ztcedecb
    fun:ztcedencbk
    fun:ztceb_encblk
    }

    {
    OCI suppression
    Memcheck:Cond
    fun:CMP_Compare
    fun:CMP_ModularReduce
    fun:Alg_ComputeModQ_GHash
    fun:A_X931RandomGenerateBytes
    fun:ztcr2rnd
    }

    {
    OCI suppression
    Memcheck:Cond
    fun:CMP_BitLengthOfCMPInt
    }

    {
    OCI suppression
    Memcheck:Cond
    fun:CMP_CMPIntToOctetString
    }

    {
    OCI suppression
    Memcheck:Cond
    fun:CMP_OctetStringToCMPInt
    }

    {
    OCI suppression
    Memcheck:Cond
    fun:CMP_SubtractInPlace
    fun:CMP_ModularReduce
    }

    {
    OCI suppression
    Memcheck:Cond
    fun:ztvo5ke
    fun:kpu8lgn
    fun:kpuauthxa
    }

    {
    OCI suppression
    Memcheck:Value4
    fun:ztceaencbk
    fun:ztceb_encblk
    fun:ztcebn
    fun:ztcen
    }

    {
    OCI suppression
    Memcheck:Value4
    fun:ztceaencbk
    fun:ztceb_encblk
    fun:ztceb_padding
    }

    {
    OCI suppression
    Memcheck:Cond
    fun:kzsrepw
    fun:kpu8lgn
    fun:kpuauthxa
    }

    {
    OCI suppression
    Memcheck:Value4
    fun:ztceai
    fun:ztcebi
    fun:ztcei
    }

    {
    OCI suppression
    Memcheck:Value4
    fun:ztucbtx
    fun:ztvo5pe
    fun:kzsrepw
    }

    {
    OCI suppression
    Memcheck:Value4
    fun:ztceadecbk
    fun:ztceb_decblk
    }

    {
    OCI suppression
    Memcheck:Cond
    fun:ztceb_unpadding
    fun:ztcebf
    fun:ztcef
    }

    {
    OCI suppression
    Memcheck:Cond
    fun:nassky
    fun:nszssk
    fun:nszssk2
    }

    {
    OCI suppression
    Memcheck:Cond
    fun:_intel_fast_memcmp
    obj:*
    }

    {
    OCI suppression
    Memcheck:Overlap
    fun:_intel_fast_memcpy
    fun:kpufprow
    fun:kpufch0
    fun:kpufch
    }

    ReplyDelete
  3. Thanks! Since I use x86_64 I had to switch all the 'Value4' to 'Value8', and I also had to add a few extra suppressions (below), but after that it worked just perfectly. Nice to be able to get 0 errors for all our oracle tests ...

    {
    OCI suppression - Mattias
    Memcheck:Cond
    fun:ztcedec
    fun:ztvo5ed
    fun:ztvo5ver
    fun:kpu8lgn
    }

    {
    OCI suppression - Mattias
    Memcheck:Cond
    fun:ztcebf
    fun:ztcef
    fun:ztcedec
    fun:ztvo5ed
    }

    {
    OCI auppression - Mattias
    Memcheck:Value8
    fun:ztceadecbk
    fun:ztcebn
    fun:ztcen
    fun:ztcedec
    }

    {
    OCI suppression - Mattias
    Memcheck:Value8
    fun:ztceaencbk
    fun:ztcebn
    fun:ztcen
    fun:ztvo5pe
    }

    {
    OCI suppression - Mattias
    Memcheck:Value8
    fun:ztceaencbk
    fun:ztcebn
    fun:ztcen
    fun:ztceenc
    }

    {
    OCI suppression - Mattias
    Memcheck:Value8
    fun:ztcedecb
    fun:ztcedencbk
    fun:ztcebn
    fun:ztcen
    }

    {
    OCI suppression - Mattias
    Memcheck:Cond
    fun:CMP_ShiftRightByBits
    fun:CMP_ModularReduce
    fun:Alg_ComputeModQ_GHash
    fun:A_X931RandomGenerateBytes
    }

    {
    OCI suppression - Mattias
    Memcheck:Param
    write(buf)
    fun:__write_nocancel
    fun:snttwrite
    fun:nttwr
    fun:nsntwrn
    fun:nspsend
    }

    {
    OCI suppression - Mattias
    Memcheck:Overlap
    fun:_vgrZU_NONE__intel_fast_memcpy
    fun:kpufprow
    fun:kpufch0
    fun:kpufch
    fun:OCIStmtFetch2
    }

    ReplyDelete
  4. [...] my OCI suppressions file? Well, since then I have updated it. Now it includes some more suppressions, for libnetsnmp, [...]

    ReplyDelete