← Back to team overview

maria-developers team mailing list archive

Adding Valgrind suppressions

 

Just a remark about adding Valgrind suppressions for problems in system
libraries that we cannot fix.

I see in mysql-test/valgrind.supp a number of suppressions like this:

    {
       dlclose memory loss from plugin variant 4
       Memcheck:Leak
       fun:malloc
       obj:/lib*/ld-*.so
       obj:/lib*/ld-*.so
       obj:/lib*/ld-*.so
       obj:/lib*/libdl-*.so
       fun:dlclose
       fun:_ZL15free_plugin_memP12st_plugin_dl
       fun:_ZL13plugin_dl_delPK19st_mysql_lex_string
    }

where these "obj:/lib*/ld-*.so" entries are caused by lack of debugging
information, so Valgrind cannot provide proper stack traces.

Please do not add any more suppressions like this. Instead, install debugging
versions of the system libraries (this can be done without any loss of
efficiency, as the debug libraries are only used when explicitly requested,
eg. by `mtr --valgrind`).

On Ubuntu/Debian:

    sudo apt-get install libc6-dbg

On Suse:

    Enable the `debuginfo' repository (if not already enabled)
    Install the package `glibc-debuginfo'

Then the needed suppression will look much nicer:

    {
       dlclose memory loss from plugin variant 2
       Memcheck:Leak
       fun:malloc
       fun:_dl_close_worker
       fun:_dl_close
       fun:_dl_catch_error
       fun:_dlerror_run
       fun:dlclose
       fun:_ZL15free_plugin_memP12st_plugin_dl
       fun:_ZL13plugin_dl_delPK19st_mysql_lex_string
    }

This way, we get fewer suppressions to maintain, and those we do need to
maintain are much easier to read.

 - Kristian.