Menu

#40 Memory leak check on cwb utils and cqp

TODO-3.5
open
None
5
2021-04-08
2010-09-03
No

We need to run CQP and the CWB tools through Valgrind on Linux, in order to see whether we have big memory leaks, buffer overflows or looming segmentation faults.

Discussion

  • Andrew Hardie

    Andrew Hardie - 2011-07-31
    • milestone: --> TODO-3.5
     
  • Andrew Hardie

    Andrew Hardie - 2021-04-08

    Steps to accomplish this:

    • add a COMPILE_WITH_DEB UG variable in the CWB makefile, which when defined causes GCC to run with the -0g options (no optimisation, include debug info)
    • modify the test engine in CWB-Perl to ad a "valgrinding" option, which when true will run all commands within valgrind

    Going from
    COMMAND
    to
    valgrind --leak-check=yes COMMAND

     
  • Andrew Hardie

    Andrew Hardie - 2021-04-08

    In the Perl modules: this should be doable by adding a single switch when "make" runs. This should insert a variable $ValgrindCmd into Config.pm (empty string by default, with the flag, "valgrind --leak-check=yes "

    This can be triggered when running Makefile.PL:

    perl Makefile.PL --with-valgrind
    

    Then, modify CWB/lib/CWB.pm where the application "full pathnames" are set. Lines 177 ff

    For each one, add CWB::Config::$ValgrindCmd before $BinDir.

    We also want C compilation done by the Perl installer to use the GCC flags. I think this involves WriteMakefile().

     OPTIMIZE => ($with_valgrind ? "-Og" : "-O"),
    

    In CWB itself: very simple check on WITH_VALGRIND.

     

Log in to post a comment.