Hello,
I build linbox 1.1.5.rc2 on a x86-64 linux box with
* gmp 4.2.2
* linbox 3.2.10.rc1
* NTL 4.2.2
* ATLAS 3.8
and did run valgrind over the whole test suite. I found various
issues. In many cases I only copied only a subset of the issues,
but some of them actually cause segfaults in Sage. The complete
logs are at
http://sage.math.washington.edu/home/mabshoff/linbox-1.1.5.rc2-vglog/
Cheers,
Michael
The details:
Commentator issues:
From test-ntl-lzz_p:
==13812== Invalid read of size 1
==13812== at 0x4A1CD92: strlen (mc_replace_strmem.c:242)
==13812== by 0x5E6B469: std::basic_ostream<char,
std::char_traits<char> >& std::operator<< <std::char_traits<char>
>(std::basic_ostream<char, std::char_traits<char> >&, char const*)
(in /usr/lib/libstdc++.so.6.0.8)
==13812== by 0x409C05: LinBox::Commentator::stop(char const*, char
const*, char const*) (commentator.C:201)
==13812== by 0x42125B: bool
runFieldTests<LinBox::NTL_zz_p>(LinBox::NTL_zz_p const&, char const*,
unsigned, unsigned long, bool) (test-field.h:1009)
==13812== by 0x41000E: main (test-ntl-lzz_p.C:62)
==13812== Address 0x64aa328 is 24 bytes inside a block of size 71
free'd
==13812== at 0x4A1B5FC: operator delete(void*) (vg_replace_malloc.c:
342)
==13812== by 0x5E78929: std::string::~string() (in /usr/lib/libstdc+
+.so.6.0.8)
==13812== by 0x421138: bool
runFieldTests<LinBox::NTL_zz_p>(LinBox::NTL_zz_p const&, char const*,
unsigned, unsigned long, bool) (test-field.h:1003)
==13812== by 0x41000E: main (test-ntl-lzz_p.C:62)
Also: test-modular-short [this seems to be the same issue]:
==13520== Invalid read of size 1
==13520== at 0x4A1CD92: strlen (mc_replace_strmem.c:242)
==13520== by 0x5E6B469: std::basic_ostream<char,
std::char_traits<char> >& std::operator<< <std::char_traits<char>
>(std::basic_ostream<char, std::char_traits<char> >&, char const*)
(in /usr/lib/libstdc++.so.6.0.8)
==13520== by 0x4096A9: LinBox::Commentator::stop(char const*, char
const*, char const*) (commentator.C:201)
==13520== by 0x41C75A: bool
testRanditerBasic<LinBox::Modular<short> >(LinBox::Modular<short>
const&, char const*, unsigned) (test-field.h:989)
==13520== by 0x422153: bool
runBasicRingTests<LinBox::Modular<short> >(LinBox::Modular<short>
const&, char const*, unsigned, bool) (test-field.h:1038)
==13520== by 0x422321: bool runFieldTests<LinBox::Modular<short>
>(LinBox::Modular<short> const&, char const*, unsigned, unsigned long,
bool) (test-field.h:1008)
==13520== by 0x40F421: main (test-modular-short.C:71)
==13520== Address 0x64b0e28 is 24 bytes inside a block of size 77
free'd
==13520== at 0x4A1B5FC: operator delete(void*) (vg_replace_malloc.c:
342)
==13520== by 0x5E78929: std::string::~string() (in /usr/lib/libstdc+
+.so.6.0.8)
==13520== by 0x41C606: bool
testRanditerBasic<LinBox::Modular<short> >(LinBox::Modular<short>
const&, char const*, unsigned) (test-field.h:976)
==13520== by 0x422153: bool
runBasicRingTests<LinBox::Modular<short> >(LinBox::Modular<short>
const&, char const*, unsigned, bool) (test-field.h:1038)
==13520== by 0x422321: bool runFieldTests<LinBox::Modular<short>
>(LinBox::Modular<short> const&, char const*, unsigned, unsigned long,
bool) (test-field.h:1008)
==13520== by 0x40F421: main (test-modular-short.C:71)
From test-commentator:
==10748== ./test-commentator
==10748==
==10748== Conditional jump or move depends on uninitialised value(s)
==10748== at 0x40472B:
LinBox::MessageClass::checkConfig(std::list<std::pair<unsigned long,
unsigned long>, std::allocator<std::pair<unsigned long, unsigned long>
> >&, unsigned long, unsigned long) (commentator.C:635)
==10748== by 0x40B24B: LinBox::MessageClass::isPrinted(unsigned
long, unsigned long, char const*) (commentator.C:586)
==10748== by 0x40BA7B: LinBox::Commentator::isPrinted(unsigned
long, unsigned long, char const*, char const*) (commentator.C:360)
==10748== by 0x40E607: LinBox::Commentator::start(char const*, char
const*, unsigned long) (commentator.C:128)
==10748== by 0x40E7B2: runTestActivity(bool) (test-commentator.C:
52)
==10748== by 0x40EAD1: testBriefReport() (test-commentator.C:143)
==10748== by 0x40EBE6: main (test-commentator.C:177)
****************************************************************
test-isposdef leaks some serious memory:
==12374== LEAK SUMMARY:
==12374== definitely lost: 736 bytes in 4 blocks.
==12374== indirectly lost: 614,616 bytes in 25,631 blocks.
==12374== possibly lost: 8 bytes in 1 blocks.
==12374== still reachable: 64 bytes in 1 blocks.
==12374== suppressed: 0 bytes in 0 blocks.
For example:
==12374== 409,600 bytes in 4 blocks are indirectly lost in loss record
13 of 13
==12374== at 0x4A1C649: operator new(unsigned long)
(vg_replace_malloc.c:230)
==12374== by 0x41E215:
__gnu_cxx::new_allocator<Integer>::allocate(unsigned long, void
const*) (new_allocator.h:88)
==12374== by 0x41E23C: std::_Vector_base<Integer,
std::allocator<Integer> >::_M_allocate(unsigned long) (stl_vector.h:
127
)
==12374== by 0x41E26E: std::_Vector_base<Integer,
std::allocator<Integer> >::_Vector_base(unsigned long,
std::allocator<I
nteger> const&) (stl_vector.h:113)
==12374== by 0x420B05: std::vector<Integer, std::allocator<Integer>
>::vector(unsigned long, Integer const&, std::allocat
or<Integer> const&) (stl_vector.h:216)
==12374== by 0x420BD6:
LinBox::DenseMatrixBase<Integer>::DenseMatrixBase(unsigned long,
unsigned long) (dense.h:101)
==12374== by 0x424A16:
LinBox::DenseMatrix<LinBox::PID_integer>::DenseMatrix(LinBox::PID_integer
const&, unsigned long, u
nsigned long) (dense.h:98)
==12374== by 0x43045C: void
LinBox::MatrixHom::map<LinBox::PID_integer,
std::pair<std::vector<unsigned long, std::allocat
or<unsigned long> >, std::vector<Integer, std::allocator<Integer> > >,
LinBox::PID_integer>(LinBox::DenseMatrix<LinBox::PID_
integer>*&, LinBox::SparseMatrix<LinBox::PID_integer,
std::pair<std::vector<unsigned long, std::allocator<unsigned long> >,
std::vector<Integer, std::allocator<Integer> > > > const&,
LinBox::PID_integer const&) (matrix-hom.h:232)
==12374== by 0x44B2D6: bool
LinBox::isPositiveDefinite<LinBox::SparseMatrix<LinBox::PID_integer,
std::pair<std::vector<un
signed long, std::allocator<unsigned long> >, std::vector<Integer,
std::allocator<Integer> > > > >(LinBox::SparseMatrix<LinB
ox::PID_integer, std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<Integer, std::allocator<I
nteger> > > > const&, LinBox::RingCategories::IntegerTag const&,
LinBox::BlasEliminationTraits const&) (is-positive-definite
.h:116)
==12374== by 0x44B31B: bool
LinBox::isPositiveDefinite<LinBox::SparseMatrix<LinBox::PID_integer,
std::pair<std::vector<un
signed long, std::allocator<unsigned long> >, std::vector<Integer,
std::allocator<Integer> > > > >(LinBox::SparseMatrix<LinB
ox::PID_integer, std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<Integer, std::allocator<I
nteger> > > > const&, LinBox::RingCategories::IntegerTag const&,
LinBox::EliminationSpecifier const&) (is-positive-definite.
h:82)
==12374== by 0x44B3EE: bool
LinBox::isPositiveDefinite<LinBox::SparseMatrix<LinBox::PID_integer,
std::pair<std::vector<un
signed long, std::allocator<unsigned long> >, std::vector<Integer,
std::allocator<Integer> > > > >(LinBox::SparseMatrix<LinB
ox::PID_integer, std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<Integer, std::allocator<I
nteger> > > > const&, LinBox::RingCategories::IntegerTag const&,
LinBox::HybridSpecifier const&) (is-positive-definite.h:68)
==12374== by 0x44B431: bool
LinBox::isPositiveDefinite<LinBox::SparseMatrix<LinBox::PID_integer,
std::pair<std::vector<un
signed long, std::allocator<unsigned long> >, std::vector<Integer,
std::allocator<Integer> > > >, LinBox::HybridSpecifier>(L
inBox::SparseMatrix<LinBox::PID_integer,
std::pair<std::vector<unsigned long, std::allocator<unsigned long> >,
std::vector<I
nteger, std::allocator<Integer> > > > const&, LinBox::HybridSpecifier
const&) (is-positive-definite.h:35)
****************************************************************
Givaro related issues:
test-givaro-zpz:
==10917== Conditional jump or move depends on uninitialised value(s)
==10917== at 0x412BE5: ZpzDom<Std16>::init(short&, long) const
(givzpz16std.inl:341)
==10917== by 0x412CD2: ZpzDom<Std16>::assign(short&, long) const
(givzpz16std.inl:393)
==10917== by 0x412CFB: ZpzDom<Std16>::assign(short&, short) const
(givzpz16std.inl:409)
==10917== by 0x442687: bool
testRandomIteratorStep<LinBox::GivaroZpz<Std16>
>(LinBox::GivaroZpz<Std16> const&, char const*, unsigned, unsigned,
unsigned) (test-field.h:1123)
==10917== by 0x443AB9: bool
testRandomIterator<LinBox::GivaroZpz<Std16> >(LinBox::GivaroZpz<Std16>
const&, char const*, unsigned, unsigned, unsigned) (test-field.h:1069)
==10917== by 0x41037D: main (test-givaro-zpz.C:92)
test-givaro-zpzuns:
==11321== Conditional jump or move depends on uninitialised value(s)
==11321== at 0x4122A7: ZpzDom<Unsigned32>::assign(unsigned&, long)
const (givzpz32uns.inl:397)
==11321== by 0x412314: ZpzDom<Unsigned32>::assign(unsigned&,
unsigned) const (givzpz32uns.inl:414)
==11321== by 0x42CEE8: bool
testRandomIteratorStep<LinBox::GivaroZpz<Unsigned32>
>(LinBox::GivaroZpz<Unsigned32> const&,
char const*, unsigned, unsigned, unsigned) (test-field.h:1123)
==11321== by 0x42E30D: bool
testRandomIterator<LinBox::GivaroZpz<Unsigned32>
>(LinBox::GivaroZpz<Unsigned32> const&, char
const*, unsigned, unsigned, unsigned) (test-field.h:1069)
==11321== by 0x410167: main (test-givaro-zpzuns.C:84)
==11321== Invalid read of size 2
==11321== at 0x43EF1B:
...
read more »