• Show log

    Commit

  • Hash : 877054f3
    Author : Patrick Steinhardt
    Date : 2020-02-10T12:35:13

    cmake: consolidate Valgrind option
    
    OpenSSL doesn't initialize bytes on purpose in order to generate
    additional entropy. Valgrind isn't too happy about that though, causing
    it to generate warninings about various issues regarding use of
    uninitialized bytes.
    
    We traditionally had some infrastructure to silence these errors in our
    OpenSSL stream implementation, where we invoke the Valgrind macro
    `VALGRIND_MAKE_MEMDEFINED` in various callbacks that we provide to
    OpenSSL. Naturally, we only include these instructions if a preprocessor
    define "VALGRIND" is set, and that in turn is only set if passing
    "-DVALGRIND" to CMake. We do that in our usual Azure pipelines, but we
    in fact forgot to do this in our nightly build. As a result, we get a
    slew of warnings for these nightly builds, but not for our normal
    builds.
    
    To fix this, we could just add "-DVALGRIND" to our nightly builds. But
    starting with commit d827b11b6 (tests: execute leak checker via CTest
    directly, 2019-06-28), we do have a secondary variable that directs
    whether we want to use memory sanitizers for our builds. As such, every
    user wishing to use Valgrind for our tests needs to pass both options
    "VALGRIND" and "USE_LEAK_CHECKER", which is cumbersome and error prone,
    as can be seen by our own builds.
    
    Instead, let's consolidate this into a single option, removing the old
    "-DVALGRIND" one. Instead, let's just add the preprocessor directive if
    USE_LEAK_CHECKER equals "valgrind" and remove "-DVALGRIND" from our own
    pipelines.