valgrind findings

This commit is contained in:
John Kerl 2015-12-22 22:26:06 -05:00
parent ab4a2f0f35
commit ffe255b79c
3 changed files with 25 additions and 1 deletions

View file

@ -176,6 +176,7 @@ static void mapper_bar_free(void* pvstate) {
free(pstate->bars[i]);
free(pstate->bars);
ap_free(pstate->pargp);
free(pstate);
}
// ----------------------------------------------------------------

View file

@ -34,13 +34,14 @@ static mapper_t* mapper_check_parse_cli(int* pargi, int argc, char** argv) {
// ----------------------------------------------------------------
static mapper_t* mapper_check_alloc() {
mapper_t* pmapper = mlr_malloc_or_die(sizeof(mapper_t));
mapper_t* pmapper = mlr_malloc_or_die(sizeof(mapper_t));
pmapper->pvstate = NULL;
pmapper->pprocess_func = mapper_check_process;
pmapper->pfree_func = mapper_check_free;
return pmapper;
}
static void mapper_check_free(void* pvstate) {
free(pvstate);
}
// ----------------------------------------------------------------

22
c/tools/clean-valgrind-output Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
# E.g. for filtering the output of reg_test/run --valgrind.
# This just strips out some false positives, e.g. system-level stuff not
# relevant to Miller itself. mgrepv is at
# https://github.com/johnkerl/scripts/blob/master/fundam/mgrepv
sed 's/^==.*== //' "$@" | swipe \
| mgrepv dyld \
| mgrepv copySwiftV1MangledName \
| mgrepv 'LEAK SUMMARY' \
| mgrepv 'HEAP SUMMARY' \
| mgrepv 'UNKNOWN fcntl' \
| grep -v 'ERROR SUMMARY' \
| grep -v 'Memcheck,' \
| grep -v 'Copyright' \
| grep -v 'Using Valgrind' \
| grep -v 'For counts of' \
| mgrepv 'mlr_try_float_from_string' \
| cat
#| mgrepv 'parse_command_line'