[KinoSearch] Re: Backtrace of segfault when building inverted index
Marvin Humphrey
marvin at rectangular.com
Tue Jul 1 16:36:40 PDT 2008
On Jun 28, 2008, at 6:13 AM, Peter Karman wrote:
> I also read the pod for Test::Valgrind. I *think* smoke.pl could be
> altered to use it conditionally when it is installed.
Hmm, turns out I had some trouble with false passes using
Test::Valgrind 0.04. It happily installed on my system, but there
don't seem to be any tests in Test::Valgrind's test suite which probe
for anything other than a clean run, so it's not clear whether it
really works as intended. When I alter a test from the KS suite which
I *know* to leak right now (patch below), Test::Valgrind gives it a
clean bill of health, but doesn't seem to run the actual test (output
below).
Nevertheless, as of r3554, KS has a test_valgrind build target,
consisting of what was in trunk/devel/bin/valgrind_test.plx augmented
with screen-scraping. That was the lazy way out, since rooting around
in Test::Valgrind looked kind of tricky.
Marvin Humphrey
Rectangular Research
http://www.rectangular.com/
PATCH:
Index: t/210-deldocs.t
===================================================================
--- t/210-deldocs.t (revision 3553)
+++ t/210-deldocs.t (working copy)
@@ -2,8 +2,11 @@
use warnings;
use lib 'buildlib';
-use Test::More tests => 13;
+use Test::More;
+use Test::Valgrind diag => 1;
use KinoSearch::Index::DelDocs;
Test::Valgrind OUTPUT:
marvin at linlin:~/projects/ks/perl$ /usr/local/debugperl/bin/perl5.10.0 -
Mblib t/210-deldocs.t
1..5
# valgrind --tool=memcheck --leak-check=full --leak-resolution=high --
num-callers=50 --error-limit=yes --suppressions=/usr/local/debugperl/
lib/site_perl/5.10.0/i686-linux/Test/Valgrind/perlTestValgrind.supp --
show-reachable=yes --leak-check=full /usr/local/debugperl/bin/
perl5.10.0 -Ibuildlib -I/home/marvin/projects/ks/perl/blib/arch -I/
home/marvin/projects/ks/perl/blib/lib -I/usr/local/debugperl/lib/
5.10.0/i686-linux -I/usr/local/debugperl/lib/5.10.0 -I/usr/local/
debugperl/lib/site_perl/5.10.0/i686-linux -I/usr/local/debugperl/lib/
site_perl/5.10.0 -I. -MTest::Valgrind=run,1 /usr/local/debugperl/lib/
site_perl/5.10.0/i686-linux/Test/Valgrind.pm
# ==17956== Memcheck, a memory error detector.
# ==17956== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward
et al.
# ==17956== Using LibVEX rev 1732, a library for dynamic binary
translation.
# ==17956== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
# ==17956== Using valgrind-3.2.3-Debian, a dynamic binary
instrumentation framework.
# ==17956== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward
et al.
# ==17956== For more details, rerun with: -v
# ==17956==
# Subroutine import redefined at /usr/local/debugperl/lib/site_perl/
5.10.0/i686-linux/Test/Valgrind.pm line 78.
# ==17956==
# ==17956== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 63
from 3)
# ==17956== malloc/free: in use at exit: 2,771 bytes in 15 blocks.
# ==17956== malloc/free: 43,148 allocs, 43,133 frees, 2,086,050 bytes
allocated.
# ==17956== For counts of detected errors, rerun with: -v
# ==17956== searching for pointers to 15 not-freed blocks.
# ==17956== checked 300,652 bytes.
# ==17956==
# ==17956== LEAK SUMMARY:
# ==17956== definitely lost: 0 bytes in 0 blocks.
# ==17956== possibly lost: 0 bytes in 0 blocks.
# ==17956== still reachable: 0 bytes in 0 blocks.
# ==17956== suppressed: 2,771 bytes in 15 blocks.
ok 1 - valgrind errors
ok 2 - valgrind definitely lost
ok 3 - valgrind indirectly lost
ok 4 - valgrind possibly lost
ok 5 - valgrind still reachable
marvin at linlin:~/projects/ks/perl$
_______________________________________________
KinoSearch mailing list
KinoSearch at rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch
More information about the kinosearch
mailing list