
marvin at rectangular
Sep 10, 2008, 2:17 PM
Post #1 of 1
(2346 views)
Permalink
|
|
r3862 - in trunk: devel/conf perl perl/buildlib/Lucy perl/t
|
|
Author: creamyg Date: 2008-09-10 14:17:39 -0700 (Wed, 10 Sep 2008) New Revision: 3862 Added: trunk/devel/conf/kinoperl.supp trunk/perl/t/valgrind_triggers.pl Removed: trunk/devel/conf/p510_valgrind.supp trunk/devel/conf/p588_valgrind.supp Modified: trunk/perl/MANIFEST trunk/perl/buildlib/Lucy/Build.pm Log: Limit scope of bundled Valgrind suppressions file to KinoSearch-specific issues. Generate per-Perl suppressions file on the fly. Added: trunk/devel/conf/kinoperl.supp =================================================================== --- trunk/devel/conf/kinoperl.supp (rev 0) +++ trunk/devel/conf/kinoperl.supp 2008-09-10 21:17:39 UTC (rev 3862) @@ -0,0 +1,162 @@ +{ + <insert a suppression name here> + Memcheck:Leak + fun:calloc + fun:kino_MemMan_wrapped_calloc + fun:kino_Obj_create + fun:kino_Hash_new + fun:kino_VTable_init_registry + fun:kino_VTable_add_to_registry + fun:kino_Boot_bootstrap + fun:boot_KinoSearch + fun:* +} +{ + <insert a suppression name here> + Memcheck:Leak + fun:malloc + fun:kino_MemMan_wrapped_malloc + fun:kino_Hash_store + fun:kino_VTable_add_to_registry + fun:kino_Boot_bootstrap + fun:boot_KinoSearch + fun:* +} +{ + <insert a suppression name here> + Memcheck:Leak + fun:calloc + fun:kino_MemMan_wrapped_calloc + fun:kino_Hash_store + fun:kino_VTable_add_to_registry + fun:kino_Boot_bootstrap + fun:boot_KinoSearch + fun:* +} +{ + <insert a suppression name here> + Memcheck:Leak + fun:malloc + fun:kino_MemMan_wrapped_malloc + fun:kino_Hash_store + fun:kino_VTable_add_to_registry + fun:kino_Boot_bootstrap + fun:boot_KinoSearch + fun:* +} +{ + <insert a suppression name here> + Memcheck:Leak + fun:calloc + fun:kino_MemMan_wrapped_calloc + fun:kino_FastObj_create + fun:kino_CB_new_from_trusted_utf8 + fun:kino_Hash_store + fun:kino_VTable_add_to_registry + fun:kino_Boot_bootstrap + fun:boot_KinoSearch + fun:* +} +{ + <insert a suppression name here> + Memcheck:Leak + fun:malloc + fun:kino_MemMan_wrapped_malloc + fun:kino_CB_new_from_trusted_utf8 + fun:kino_Hash_store + fun:kino_VTable_add_to_registry + fun:kino_Boot_bootstrap + fun:boot_KinoSearch + fun:* +} + +{ + <Snowball XS constructor> + Memcheck:Leak + fun:calloc + fun:Perl_safesyscalloc + fun:XS_Lingua__Stem__Snowball__Stemmifier_new + fun:* +} + +{ + <insert a suppression name here> + Memcheck:Leak + fun:calloc + fun:kino_MemMan_wrapped_calloc + fun:kino_Obj_create + fun:kino_Hash_new + fun:kino_VTable_init_registry + fun:kino_VTable_add_to_registry + fun:kino_Boot_bootstrap + fun:boot_KinoSearch + fun:* +} +{ + <insert a suppression name here> + Memcheck:Leak + fun:malloc + fun:kino_MemMan_wrapped_malloc + fun:kino_Hash_store + fun:kino_VTable_add_to_registry + fun:kino_Boot_bootstrap + fun:boot_KinoSearch + fun:* +} +{ + <insert a suppression name here> + Memcheck:Leak + fun:calloc + fun:kino_MemMan_wrapped_calloc + fun:kino_Hash_store + fun:kino_VTable_add_to_registry + fun:kino_Boot_bootstrap + fun:boot_KinoSearch + fun:* +} +{ + <insert a suppression name here> + Memcheck:Leak + fun:malloc + fun:kino_MemMan_wrapped_malloc + fun:kino_Hash_store + fun:kino_VTable_add_to_registry + fun:kino_Boot_bootstrap + fun:boot_KinoSearch + fun:* +} +{ + <insert a suppression name here> + Memcheck:Leak + fun:calloc + fun:kino_MemMan_wrapped_calloc + fun:kino_FastObj_create + fun:kino_CB_new_from_trusted_utf8 + fun:kino_Hash_store + fun:kino_VTable_add_to_registry + fun:kino_Boot_bootstrap + fun:boot_KinoSearch + fun:* +} +{ + <insert a suppression name here> + Memcheck:Leak + fun:malloc + fun:kino_MemMan_wrapped_malloc + fun:kino_CB_new_from_trusted_utf8 + fun:kino_Hash_store + fun:kino_VTable_add_to_registry + fun:kino_Boot_bootstrap + fun:boot_KinoSearch + fun:* +} + +{ + <Snowball XS constructor> + Memcheck:Leak + fun:calloc + fun:Perl_safesyscalloc + fun:XS_Lingua__Stem__Snowball__Stemmifier_new + fun:* +} + Deleted: trunk/devel/conf/p510_valgrind.supp =================================================================== --- trunk/devel/conf/p510_valgrind.supp 2008-09-10 19:04:00 UTC (rev 3861) +++ trunk/devel/conf/p510_valgrind.supp 2008-09-10 21:17:39 UTC (rev 3862) @@ -1,138 +0,0 @@ -{ - <insert a suppression name here> - Memcheck:Leak - fun:calloc - fun:kino_MemMan_wrapped_calloc - fun:kino_Obj_create - fun:kino_Hash_new - fun:kino_VTable_init_registry - fun:kino_VTable_add_to_registry - fun:kino_Boot_bootstrap - fun:boot_KinoSearch - fun:* -} -{ - <insert a suppression name here> - Memcheck:Leak - fun:malloc - fun:kino_MemMan_wrapped_malloc - fun:kino_Hash_store - fun:kino_VTable_add_to_registry - fun:kino_Boot_bootstrap - fun:boot_KinoSearch - fun:* -} -{ - <insert a suppression name here> - Memcheck:Leak - fun:calloc - fun:kino_MemMan_wrapped_calloc - fun:kino_Hash_store - fun:kino_VTable_add_to_registry - fun:kino_Boot_bootstrap - fun:boot_KinoSearch - fun:* -} -{ - <insert a suppression name here> - Memcheck:Leak - fun:malloc - fun:kino_MemMan_wrapped_malloc - fun:kino_Hash_store - fun:kino_VTable_add_to_registry - fun:kino_Boot_bootstrap - fun:boot_KinoSearch - fun:* -} -{ - <insert a suppression name here> - Memcheck:Leak - fun:calloc - fun:kino_MemMan_wrapped_calloc - fun:kino_FastObj_create - fun:kino_CB_new_from_trusted_utf8 - fun:kino_Hash_store - fun:kino_VTable_add_to_registry - fun:kino_Boot_bootstrap - fun:boot_KinoSearch - fun:* -} -{ - <insert a suppression name here> - Memcheck:Leak - fun:malloc - fun:kino_MemMan_wrapped_malloc - fun:kino_CB_new_from_trusted_utf8 - fun:kino_Hash_store - fun:kino_VTable_add_to_registry - fun:kino_Boot_bootstrap - fun:boot_KinoSearch - fun:* -} - -{ - <insert a suppression name here> - Memcheck:Addr4 - obj:/lib/ld-*.so - obj:* -} -{ - <insert a suppression name here> - Memcheck:Addr4 - obj:/lib/ld-*.so - fun:* -} -{ - <ld malloc fun> - Memcheck:Leak - fun:malloc - obj:/lib/ld-*.so - obj:* -} -{ - <ld malloc obj> - Memcheck:Leak - fun:malloc - obj:/lib/ld-*.so - fun:* -} -{ - <ld calloc obj> - Memcheck:Leak - fun:calloc - obj:/lib/ld-*.so - obj:* -} -{ - <ld calloc fun> - Memcheck:Leak - fun:calloc - obj:/lib/ld-*.so - fun:* -} -{ - <ld realloc obj> - Memcheck:Leak - fun:malloc - fun:realloc - obj:/lib/ld-*.so - obj:* -} -{ - <ld realloc fun> - Memcheck:Leak - fun:malloc - fun:realloc - obj:/lib/ld-*.so - fun:* -} - -{ - <Snowball XS constructor> - Memcheck:Leak - fun:calloc - fun:Perl_safesyscalloc - fun:XS_Lingua__Stem__Snowball__Stemmifier_new - fun:* -} - Deleted: trunk/devel/conf/p588_valgrind.supp =================================================================== --- trunk/devel/conf/p588_valgrind.supp 2008-09-10 19:04:00 UTC (rev 3861) +++ trunk/devel/conf/p588_valgrind.supp 2008-09-10 21:17:39 UTC (rev 3862) @@ -1,189 +0,0 @@ -{ - <insert a suppression name here> - Memcheck:Leak - fun:malloc - fun:kino_Obj_create - fun:kino_Hash_new - fun:kino_VTable_init_registry - fun:kino_VTable_register - fun:kino_Boot_bootstrap - fun:boot_KinoSearch - fun:Perl_pp_entersub - fun:Perl_runops_debug - fun:S_call_body - fun:Perl_call_sv - fun:S_call_list_body -} -{ - <insert a suppression name here> - Memcheck:Leak - fun:calloc - fun:rebuild_hash - fun:kino_Hash_store_bb - fun:kino_Hash_store - fun:kino_VTable_register - fun:kino_Boot_bootstrap - fun:boot_KinoSearch - fun:Perl_pp_entersub - fun:Perl_runops_debug - fun:S_call_body - fun:Perl_call_sv - fun:S_call_list_body -} -{ - <insert a suppression name here> - Memcheck:Leak - fun:malloc - fun:new_entry - fun:kino_Hash_store_bb - fun:kino_Hash_store - fun:kino_VTable_register - fun:kino_Boot_bootstrap - fun:boot_KinoSearch - fun:Perl_pp_entersub - fun:Perl_runops_debug - fun:S_call_body - fun:Perl_call_sv - fun:S_call_list_body -} -{ - <insert a suppression name here> - Memcheck:Leak - fun:malloc - fun:kino_FastObj_create - fun:kino_BB_new_str - fun:kino_BB_clone - fun:new_entry - fun:kino_Hash_store_bb - fun:kino_Hash_store - fun:kino_VTable_register - fun:kino_Boot_bootstrap - fun:boot_KinoSearch - fun:Perl_pp_entersub - fun:Perl_runops_debug -} -{ - <insert a suppression name here> - Memcheck:Leak - fun:malloc - fun:kino_BB_new_str - fun:kino_BB_clone - fun:new_entry - fun:kino_Hash_store_bb - fun:kino_Hash_store - fun:kino_VTable_register - fun:kino_Boot_bootstrap - fun:boot_KinoSearch - fun:Perl_pp_entersub - fun:Perl_runops_debug - fun:S_call_body -} - -{ - DynaLoader 1 - Memcheck:Leak - fun:malloc - fun:_dl_map_object_deps - fun:dl_open_worker - fun:_dl_catch_error - fun:_dl_open - fun:dlopen_doit - fun:_dl_catch_error - fun:_dlerror_run - fun:dlopen@@GLIBC_2.1 - fun:XS_DynaLoader_dl_load_file - fun:Perl_pp_entersub - fun:Perl_runops_debug -} -{ - DynaLoader 2 - Memcheck:Leak - fun:malloc - fun:_dl_new_object - fun:_dl_map_object_from_fd - fun:_dl_map_object - fun:dl_open_worker - fun:_dl_catch_error - fun:_dl_open - fun:dlopen_doit - fun:_dl_catch_error - fun:_dlerror_run - fun:dlopen@@GLIBC_2.1 - fun:XS_DynaLoader_dl_load_file -} -{ - DynaLoader 3 - Memcheck:Leak - fun:malloc - fun:_dl_map_object - fun:dl_open_worker - fun:_dl_catch_error - fun:_dl_open - fun:dlopen_doit - fun:_dl_catch_error - fun:_dlerror_run - fun:dlopen@@GLIBC_2.1 - fun:XS_DynaLoader_dl_load_file - fun:Perl_pp_entersub - fun:Perl_runops_debug -} -{ - DynaLoader 4 - Memcheck:Leak - fun:calloc - fun:_dl_check_map_versions - fun:dl_open_worker - fun:_dl_catch_error - fun:_dl_open - fun:dlopen_doit - fun:_dl_catch_error - fun:_dlerror_run - fun:dlopen@@GLIBC_2.1 - fun:XS_DynaLoader_dl_load_file - fun:Perl_pp_entersub - fun:Perl_runops_debug -} -{ - DynaLoader 5 - Memcheck:Leak - fun:calloc - fun:_dl_new_object - fun:_dl_map_object_from_fd - fun:_dl_map_object - fun:dl_open_worker - fun:_dl_catch_error - fun:_dl_open - fun:dlopen_doit - fun:_dl_catch_error - fun:_dlerror_run - fun:dlopen@@GLIBC_2.1 - fun:XS_DynaLoader_dl_load_file -} -{ - perl_parse - Memcheck:Leak - fun:malloc - fun:Perl_safesysmalloc - fun:Perl_savepvn - fun:Perl_gv_fetchpv - fun:S_init_main_stash - fun:S_parse_body - fun:perl_parse - fun:main -} -{ - local_closures - Memcheck:Leak - fun:malloc - fun:Perl_safesysmalloc - fun:Perl_savepvn - fun:Perl_gv_fetchpv - fun:Perl_gv_stashpvn - fun:Perl_gv_fetchmethod_autoload - fun:Perl_gv_fetchmethod - fun:S_method_common - fun:Perl_pp_method - fun:Perl_runops_debug - fun:S_run_body - fun:perl_run -} \ No newline at end of file Modified: trunk/perl/MANIFEST =================================================================== --- trunk/perl/MANIFEST 2008-09-10 19:04:00 UTC (rev 3861) +++ trunk/perl/MANIFEST 2008-09-10 21:17:39 UTC (rev 3862) @@ -343,6 +343,7 @@ t/999-remove_invindexes.t t/pod-coverage.t t/pod.t +t/valgrind_triggers.pl xs/KinoSearch/Analysis/LCNormalizer.c xs/KinoSearch/Analysis/Tokenizer.c xs/KinoSearch/Doc.c Modified: trunk/perl/buildlib/Lucy/Build.pm =================================================================== --- trunk/perl/buildlib/Lucy/Build.pm 2008-09-10 19:04:00 UTC (rev 3861) +++ trunk/perl/buildlib/Lucy/Build.pm 2008-09-10 21:17:39 UTC (rev 3862) @@ -296,27 +296,51 @@ } } +sub ACTION_suppressions { + my $self = shift; + my $LOCAL_SUPP = 'local.supp'; + return if $self->up_to_date('t/valgrind_triggers.pl', $LOCAL_SUPP); + + # Generate suppressions. + $self->add_to_cleanup('local.supp'); + my $command = "yes | " . $self->_valgrind_base_command . + "--gen-suppressions=yes " . $self->perl . " t/valgrind_triggers.pl 2>&1"; + my $suppressions = `$command`; + $suppressions =~ s/^==.*?\n//mg; + my $rule_number = 1; + while ($suppressions =~ /<insert a.*?>/ ) { + $suppressions =~ s/^\s*<insert a.*?>/{\n <core_perl_$rule_number>/m; + $rule_number++; + } + + # Write local suppressions file. + print "Writing $LOCAL_SUPP...\n"; + $self->add_to_cleanup($LOCAL_SUPP); + open(my $supp_fh, '>', $LOCAL_SUPP) + or confess("Can't open '$LOCAL_SUPP': $!"); + print $supp_fh $suppressions; +} + +sub _valgrind_base_command { + return "PERL_DESTRUCT_LEVEL=2 KINO_VALGRIND=1 valgrind " + . "--leak-check=yes " + . "--show-reachable=yes " + . "--suppressions=../devel/conf/kinoperl.supp "; +} + sub ACTION_test_valgrind { my $self = shift; - die "Must be run under Perl 5.8.8 or 5.10.0" - unless ( $] == 5.008008 or $] == 5.010 ); die "Must be run under a perl that was compiled with -DDEBUGGING" unless $Config{ccflags} =~ /-D?DEBUGGING\b/; $self->dispatch('code'); + $self->dispatch('suppressions'); - # Unbuffer STDOUT, grab test file names and suppressions file. + # Unbuffer STDOUT, grab test file names and suppressions files. $|++; my $t_files = $self->find_test_files; # not public M::B API, may fail - my $supp_file = "../devel/conf/"; - $supp_file .= - $] == 5.0008008 - ? "p588_valgrind.supp" - : "p510_valgrind.supp"; - my $valgrind_command - = "PERL_DESTRUCT_LEVEL=2 KINO_VALGRIND=1 valgrind " - . "--leak-check=yes " - . "--show-reachable=yes " - . "--suppressions=$supp_file "; + my $valgrind_command = $self->_valgrind_base_command; + $valgrind_command .= "--suppressions=local.supp "; + if ( my $local_supp = $self->args('suppressions') ) { for my $supp ( split( ',', $local_supp ) ) { $valgrind_command .= "--suppressions=$supp "; Added: trunk/perl/t/valgrind_triggers.pl =================================================================== --- trunk/perl/t/valgrind_triggers.pl (rev 0) +++ trunk/perl/t/valgrind_triggers.pl 2008-09-10 21:17:39 UTC (rev 3862) @@ -0,0 +1,7 @@ +# This file is used by the test_valgrind build target to generate a list of +# suppressions. +use strict; +use warnings; +use Time::HiRes; +use Lingua::Stem::Snowball; # triggers XSLoader/DynaLoader + _______________________________________________ kinosearch-commits mailing list kinosearch-commits [at] rectangular http://www.rectangular.com/mailman/listinfo/kinosearch-commits
|