ensure clean valgrind run

This commit is contained in:
Dane Springmeyer 2015-04-26 23:26:11 +02:00
parent 930eb184d8
commit d9ea4e9b6e
3 changed files with 90 additions and 24 deletions

View file

@ -79,13 +79,14 @@ pep8:
@pep8 -r --select=W391 -q --filename=*.py `pwd`/tests/ | xargs gsed -i -e :a -e '/^\n*$$/{$$d;N;ba' -e '}' @pep8 -r --select=W391 -q --filename=*.py `pwd`/tests/ | xargs gsed -i -e :a -e '/^\n*$$/{$$d;N;ba' -e '}'
@pep8 -r --select=W391 -q --filename=*.py `pwd`/tests/ | xargs ged -i '/./,/^$$/!d' @pep8 -r --select=W391 -q --filename=*.py `pwd`/tests/ | xargs ged -i '/./,/^$$/!d'
# note: pass --gen-suppressions=yes to create new suppression entries
grind: grind:
@source localize.sh && source mapnik-settings.env && \ @source localize.sh && source mapnik-settings.env && \
for FILE in test/standalone/*-bin; do \ for FILE in test/standalone/*-bin; do \
valgrind --leak-check=full --log-fd=1 $${FILE} | grep definitely; \ valgrind --suppressions=./test/unit/valgrind.supp --leak-check=full --log-fd=1 $${FILE} | grep definitely; \
done done
@source localize.sh && source mapnik-settings.env && \ @source localize.sh && source mapnik-settings.env && \
valgrind --leak-check=full --log-fd=1 ./test/unit/run | grep definitely valgrind --suppressions=./test/unit/valgrind.supp --leak-check=full --log-fd=1 ./test/unit/run | grep definitely;
render: render:
@for FILE in tests/data/good_maps/*xml; do \ @for FILE in tests/data/good_maps/*xml; do \

View file

@ -2,6 +2,12 @@
#include "catch.hpp" #include "catch.hpp"
#include <libxml/parser.h> // for xmlInitParser(), xmlCleanupParser() #include <libxml/parser.h> // for xmlInitParser(), xmlCleanupParser()
#include <cairo.h>
#include <unicode/uclean.h>
#ifdef MAPNIK_USE_PROJ4
#include <proj_api.h>
#endif
int main (int argc, char* const argv[]) int main (int argc, char* const argv[])
{ {
@ -13,5 +19,18 @@ int main (int argc, char* const argv[])
// http://xmlsoft.org/xmlmem.html // http://xmlsoft.org/xmlmem.html
xmlCleanupParser(); xmlCleanupParser();
// http://cairographics.org/manual/cairo-Error-handling.html#cairo-debug-reset-static-data
cairo_debug_reset_static_data();
// http://icu-project.org/apiref/icu4c/uclean_8h.html#a93f27d0ddc7c196a1da864763f2d8920
u_cleanup();
#ifdef MAPNIK_USE_PROJ4
// http://trac.osgeo.org/proj/ticket/149
pj_clear_initcache();
// https://trac.osgeo.org/proj/wiki/ProjAPI#EnvironmentFunctions
pj_deallocate_grids();
#endif
return result; return result;
} }

View file

@ -1,31 +1,77 @@
{ {
dl_error1 catch1
Memcheck:Cond Memcheck:Addr1
fun:index fun:strlen
fun:expand_dynamic_string_token fun:_ZL29____C_A_T_C_H____T_E_S_T____9v
fun:fillin_rpath fun:_ZN5Catch10RunContext20invokeActiveTestCaseEv
fun:_dl_init_paths fun:_ZN5Catch10RunContext14runCurrentTestERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_
fun:dl_main fun:_ZN5Catch10RunContext7runTestERKNS_8TestCaseE
fun:_dl_sysdep_start fun:_ZN5Catch6Runner8runTestsEv
fun:_dl_start fun:_ZN5Catch7Session3runEv
fun:main
} }
{ {
dl_error2 catch2
Memcheck:Cond Memcheck:Cond
fun:index fun:_platform_memchr$VARIANT$Haswell
fun:expand_dynamic_string_token fun:__sfvwrite
fun:_dl_map_object fun:fwrite
fun:map_doit fun:_ZNSt3__111__stdoutbufIcE8overflowEi
fun:_dl_catch_error fun:_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl
fun:do_preload fun:_ZNSt3__116__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_
fun:dl_main fun:_ZNSt3__124__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m
fun:_dl_sysdep_start fun:_ZN5Catch15ConsoleReporter11printTotalsERKNS_6TotalsE
fun:_dl_start fun:_ZN5Catch15ConsoleReporter12testRunEndedERKNS_12TestRunStatsE
fun:_ZN5Catch10RunContextD2Ev
fun:_ZN5Catch6Runner8runTestsEv
fun:_ZN5Catch7Session3runEv
} }
{ {
tmpfile catch3
Memcheck:Cond
fun:_platform_memchr$VARIANT$Haswell
fun:__sfvwrite
fun:fwrite
fun:_ZNSt3__111__stdoutbufIcE8overflowEi
fun:_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl
fun:_ZNSt3__116__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_
fun:_ZNSt3__124__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m
fun:_ZN5Catch12_GLOBAL__N_115PosixColourImpl3useENS_6Colour4CodeE
fun:_ZN5Catch6Colour3useENS0_4CodeE
fun:_ZN5Catch15ConsoleReporter18printTotalsDividerERKNS_6TotalsE
fun:_ZN5Catch15ConsoleReporter12testRunEndedERKNS_12TestRunStatsE
fun:_ZN5Catch10RunContextD2Ev
}
{
catch4
Memcheck:Cond
fun:_platform_memchr$VARIANT$Haswell
fun:__sfvwrite
fun:fwrite
fun:_ZNSt3__111__stdoutbufIcE8overflowEi
fun:_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl
fun:_ZNSt3__116__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_
fun:_ZNSt3__124__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m
fun:_ZN5Catch15ConsoleReporter18printTotalsDividerERKNS_6TotalsE
fun:_ZN5Catch15ConsoleReporter12testRunEndedERKNS_12TestRunStatsE
fun:_ZN5Catch10RunContextD2Ev
fun:_ZN5Catch6Runner8runTestsEv
fun:_ZN5Catch7Session3runEv
}
{
pixman
Memcheck:Leak Memcheck:Leak
match-leak-kinds: definite
fun:malloc fun:malloc
fun:fdopen@@GLIBC_* fun:_pixman_implementation_create
fun:tmpfile@@GLIBC_* fun:_pixman_implementation_create_general
fun:_pixman_choose_implementation
fun:pixman_constructor
fun:_ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE
fun:_ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE
fun:_ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListERNS_15UninitedUpwardsE
fun:_ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListERNS_15UninitedUpwardsE
fun:_ZN11ImageLoader19processInitializersERKNS_11LinkContextEjRNS_21InitializerTimingListERNS_15UninitedUpwardsE
fun:_ZN11ImageLoader15runInitializersERKNS_11LinkContextERNS_21InitializerTimingListE
fun:_ZN4dyld24initializeMainExecutableEv
} }