LinBox 1.1.5.rc2 valgrind report

8 views
Skip to first unread message

mabshoff

unread,
Mar 10, 2008, 5:41:37 PM3/10/08
to linbox-use
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: ZpzDom<Log16>::ZpzDom(unsigned short)
(givzpz16table1.C:92)
==11321== by 0x42164A: LinBox::GivaroZpz<Log16>::GivaroZpz(Integer
const&) (givaro-zpz.h:102)
==11321== by 0x4103F6: main (test-givaro-zpzuns.C:104)
==11321== Address 0x7704cf2 is 0 bytes after a block of size 202
alloc'd
==11321== at 0x4A1C2C7: operator new[](unsigned long)
(vg_replace_malloc.c:274)
==11321== by 0x43ED1B: ZpzDom<Log16>::ZpzDom(unsigned short)
(givzpz16table1.C:20)
==11321== by 0x42164A: LinBox::GivaroZpz<Log16>::GivaroZpz(Integer
const&) (givaro-zpz.h:102)
==11321== by 0x4103F6: main (test-givaro-zpzuns.C:104)


****************************************************************

test-smith-form-iliopoulos loses a good chunk of memory in NTL. For
example:

==14126== 44,800 bytes in 400 blocks are indirectly lost in loss
record 36 of 36
==14126== at 0x4A1BDEB: malloc (vg_replace_malloc.c:207)
==14126== by 0x4392FE: _ntl_zsetlength (in /scratch/mabshoff/
linbox-1.1.5rc2/tests/mu/test-smith-form-iliopoulos)
==14126== by 0x421F09: NTL::ZZ::ZZ(NTL::INIT_SIZE_STRUCT const&,
long) (ZZ.h:49)
==14126== by 0x421F35: NTL::ZZ_p::ZZ_p(NTL::ZZ_p const&) (ZZ_p.h:
155)
==14126== by 0x421FA0: void std::_Construct<NTL::ZZ_p,
NTL::ZZ_p>(NTL::ZZ_p*, NTL::ZZ_p const&) (stl_construct.h:81)
==14126== by 0x421FF7: void
std::__uninitialized_fill_n_aux<NTL::ZZ_p*, unsigned long,
NTL::ZZ_p>(NTL::ZZ_p*, unsigned long, NTL::ZZ_p const&, __false_type)
(stl_uninitialized.h:194)
==14126== by 0x422075: void std::uninitialized_fill_n<NTL::ZZ_p*,
unsigned long, NTL::ZZ_p>(NTL::ZZ_p*, unsigned long, NTL::ZZ_p const&)
(stl_uninitialized.h:218)
==14126== by 0x4220A0: void
std::__uninitialized_fill_n_a<NTL::ZZ_p*, unsigned long, NTL::ZZ_p,
NTL::ZZ_p>(NTL::ZZ_p*, unsigned long, NTL::ZZ_p const&,
std::allocator<NTL::ZZ_p>) (stl_uninitialized.h:310)
==14126== by 0x4220FA: std::vector<NTL::ZZ_p,
std::allocator<NTL::ZZ_p> >::vector(unsigned long, NTL::ZZ_p const&,
std::allocator<NTL::ZZ_p> const&) (stl_vector.h:218)
==14126== by 0x422199:
LinBox::DenseMatrixBase<NTL::ZZ_p>::DenseMatrixBase(unsigned long,
unsigned long) (dense.h:101)
==14126== by 0x422516:
LinBox::DenseMatrix<LinBox::PIR_ntl_ZZ_p>::DenseMatrix(LinBox::PIR_ntl_ZZ_p
const&, unsigned long, unsigned long) (dense.h:98)
==14126== by 0x42ECB3:
LinBox::DenseMatrix<LinBox::NTL_ZZ>::rebind<LinBox::PIR_ntl_ZZ_p>::operator()
(LinBox::DenseMatrix<LinBox::PIR_ntl_ZZ_p>*&,
LinBox::DenseMatrix<LinBox::NTL_ZZ> const&, LinBox::PIR_ntl_ZZ_p
const&) (dense.h:176)


==14126== LEAK SUMMARY:
==14126== definitely lost: 176 bytes in 1 blocks.
==14126== indirectly lost: 48,048 bytes in 407 blocks.
==14126== possibly lost: 2,560 bytes in 22 blocks.
==14126== still reachable: 2,159 bytes in 5 blocks.
==14126== suppressed: 0 bytes in 0 blocks.

****************************************************************

test-moore-penrose leaks some serious memory:

==13526== LEAK SUMMARY:
==13526== definitely lost: 33,128 bytes in 303 blocks.
==13526== indirectly lost: 362,072 bytes in 1,620 blocks.
==13526== possibly lost: 0 bytes in 0 blocks.
==13526== still reachable: 64 bytes in 1 blocks.
==13526== suppressed: 0 bytes in 0 blocks.

==13526== 150,440 (11,200 direct, 139,240 indirect) bytes in 100
blocks are definitely lost in loss record 41 of 43
==13526== at 0x4A1C649: operator new(unsigned long)
(vg_replace_malloc.c:230)
==13526== by 0x4357DE:
LinBox::MoorePenrose<LinBox::SparseMatrix<LinBox::Modular<unsigned>,
std::pair<std::vector<unsigned long, std::allocator<unsigned long> >,
std::vector<unsigned, std::allocator<unsigned> > > >
>::MoorePenrose(LinBox::SparseMatrix<LinBox::Modular<unsigned>,
std::pair<std::vector<unsigned long, std::allocator<unsigned long> >,
std::vector<unsigned, std::allocator<unsigned> > > > const*, unsigned
long) (moore-penrose.h:86)
==13526== by 0x413D11: bool
testRandomApply1<LinBox::Modular<unsigned>, std::vector<unsigned,
std::allocator<unsigned> >, std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<unsigned,
std::allocator<unsigned> > > >(LinBox::Modular<unsigned>&, unsigned
long, unsigned long, unsigned long, unsigned, double,
LinBox::VectorStream<std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<unsigned,
std::allocator<unsigned> > > >&,
LinBox::VectorStream<std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<unsigned,
std::allocator<unsigned> > > >&,
LinBox::VectorStream<std::vector<unsigned, std::allocator<unsigned> >
>&) (test-moore-penrose.C:252)
==13526== by 0x41472B: main (test-moore-penrose.C:364)
==13526==
==13526==
==13526== 150,440 (11,200 direct, 139,240 indirect) bytes in 100
blocks are definitely lost in loss record 42 of 43
==13526== at 0x4A1C649: operator new(unsigned long)
(vg_replace_malloc.c:230)
==13526== by 0x435829:
LinBox::MoorePenrose<LinBox::SparseMatrix<LinBox::Modular<unsigned>,
std::pair<std::vector<unsigned long, std::allocator<unsigned long> >,
std::vector<unsigned, std::allocator<unsigned> > > >
>::MoorePenrose(LinBox::SparseMatrix<LinBox::Modular<unsigned>,
std::pair<std::vector<unsigned long, std::allocator<unsigned long> >,
std::vector<unsigned, std::allocator<unsigned> > > > const*, unsigned
long) (moore-penrose.h:87)
==13526== by 0x413D11: bool
testRandomApply1<LinBox::Modular<unsigned>, std::vector<unsigned,
std::allocator<unsigned> >, std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<unsigned,
std::allocator<unsigned> > > >(LinBox::Modular<unsigned>&, unsigned
long, unsigned long, unsigned long, unsigned, double,
LinBox::VectorStream<std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<unsigned,
std::allocator<unsigned> > > >&,
LinBox::VectorStream<std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<unsigned,
std::allocator<unsigned> > > >&,
LinBox::VectorStream<std::vector<unsigned, std::allocator<unsigned> >
>&) (test-moore-penrose.C:252)
==13526== by 0x41472B: main (test-moore-penrose.C:364)

==13526== 40,000 bytes in 100 blocks are indirectly lost in loss
record 43 of 43
==13526== at 0x4A1C649: operator new(unsigned long)
(vg_replace_malloc.c:230)
==13526== by 0x42B6BC:
__gnu_cxx::new_allocator<unsigned>::allocate(unsigned long, void
const*) (new_allocator.h:88)
==13526== by 0x42B6E4: std::_Vector_base<unsigned,
std::allocator<unsigned> >::_M_allocate(unsigned long) (stl_vector.h:
127)
==13526== by 0x42C40A: std::_Vector_base<unsigned,
std::allocator<unsigned> >::_Vector_base(unsigned long,
std::allocator<unsigned> const&) (stl_vector.h:113)
==13526== by 0x42C835: std::vector<unsigned,
std::allocator<unsigned> >::vector(unsigned long, unsigned const&,
std::allocator<unsigned> const&) (stl_vector.h:216)
==13526== by 0x4354B4:
LinBox::Submatrix<LinBox::SparseMatrix<LinBox::Modular<unsigned>,
std::pair<std::vector<unsigned long, std::allocator<unsigned long> >,
std::vector<unsigned, std::allocator<unsigned> > > >,
LinBox::VectorCategories::DenseVectorTag>::Submatrix(LinBox::SparseMatrix<LinBox::Modular<unsigned>,
std::pair<std::vector<unsigned long, std::allocator<unsigned long> >,
std::vector<unsigned, std::allocator<unsigned> > > > const*, unsigned
long, unsigned long, unsigned long, unsigned long) (submatrix.h:94)
==13526== by 0x4355FA:
LinBox::MoorePenrose<LinBox::SparseMatrix<LinBox::Modular<unsigned>,
std::pair<std::vector<unsigned long, std::allocator<unsigned long> >,
std::vector<unsigned, std::allocator<unsigned> > > >
>::MoorePenrose(LinBox::SparseMatrix<LinBox::Modular<unsigned>,
std::pair<std::vector<unsigned long, std::allocator<unsigned long> >,
std::vector<unsigned, std::allocator<unsigned> > > > const*, unsigned
long) (moore-penrose.h:79)
==13526== by 0x413D11: bool
testRandomApply1<LinBox::Modular<unsigned>, std::vector<unsigned,
std::allocator<unsigned> >, std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<unsigned,
std::allocator<unsigned> > > >(LinBox::Modular<unsigned>&, unsigned
long, unsigned long, unsigned long, unsigned, double,
LinBox::VectorStream<std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<unsigned,
std::allocator<unsigned> > > >&,
LinBox::VectorStream<std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<unsigned,
std::allocator<unsigned> > > >&,
LinBox::VectorStream<std::vector<unsigned, std::allocator<unsigned> >
>&) (test-moore-penrose.C:252)
==13526== by 0x41472B: main (test-moore-penrose.C:364)

****************************************************************

test-scalar-matrix

==14085== Conditional jump or move depends on uninitialised value(s)
==14085== at 0x5BB82C8: __gmpz_set (in /scratch/mabshoff/gmp-4.2.2-
bin/lib/libgmp.so.3.4.2)
==14085== by 0x417AF0: Integer::logcpy(Integer const&) (gmp+
+_int.inl:26)
==14085== by 0x417B1C: Integer::operator=(Integer const&) (gmp+
+_int.inl:31)
==14085== by 0x417B4C:
LinBox::ModularBase<unsigned>::cardinality(Integer&) const (modular.h:
143)
==14085== by 0x41AD41:
LinBox::ModularBase<unsigned>::RandIter::RandIter(LinBox::Modular<unsigned>
const&, Integer const&, Integer const&) (modular.h:262)
==14085== by 0x40BBF4: bool
testBlackbox<LinBox::ScalarMatrix<LinBox::Modular<unsigned> >
>(LinBox::ScalarMatrix<LinBox::Modular<unsigned> >&) (test-blackbox.h:
252)
==14085== by 0x40D831: main (test-scalar-matrix.C:51)

==14085== Conditional jump or move depends on uninitialised value(s)
==14085== at 0x410D09: __gmpz_get_ui (gmp.h:1675)
==14085== by 0x40415C: Integer::operator unsigned() const (gmp+
+_int_misc.C:236)
==14085== by 0x41ADC1:
LinBox::ModularBase<unsigned>::RandIter::RandIter(LinBox::Modular<unsigned>
const&, Integer const&, Integer const&) (modular.h:267)
==14085== by 0x40BBF4: bool
testBlackbox<LinBox::ScalarMatrix<LinBox::Modular<unsigned> >
>(LinBox::ScalarMatrix<LinBox::Modular<unsigned> >&) (test-blackbox.h:
252)
==14085== by 0x40D831: main (test-scalar-matrix.C:51)

==14085== Conditional jump or move depends on uninitialised value(s)
==14085== at 0x405078:
LinBox::MersenneTwister::randomIntRange(unsigned, unsigned) (mersenne-
twister.C:131)
==14085== by 0x411E52:
LinBox::MersenneTwister::randomIntRange(unsigned, unsigned) const
(mersenne-twister.h:49)
==14085== by 0x411E7A:
LinBox::ModularBase<unsigned>::RandIter::random(unsigned&) const
(modular.h:279)
==14085== by 0x40BC97: bool
testBlackbox<LinBox::ScalarMatrix<LinBox::Modular<unsigned> >
>(LinBox::ScalarMatrix<LinBox::Modular<unsigned> >&) (test-blackbox.h:
255)
==14085== by 0x40D831: main (test-scalar-matrix.C:51)
==14085==

==14085== Use of uninitialised value of size 8
==14085== at 0x5E54D3F: (within /usr/lib/libstdc++.so.6.0.8)
==14085== by 0x5E64936: std::ostreambuf_iterator<char,
std::char_traits<char> > std::num_put<char,
std::ostreambuf_iterator<char, std::char_traits<char> >
>::_M_insert_int<long>(std::ostreambuf_iterator<char,
std::char_traits<char> >, std::ios_base&, char, long) const (in /usr/
lib/libstdc++.so.6.0.8)
==14085== by 0x5E64BF6: std::num_put<char,
std::ostreambuf_iterator<char, std::char_traits<char> >
>::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >,
std::ios_base&, char, long) const (in /usr/lib/libstdc++.so.6.0.8)
==14085== by 0x5E6D00E: std::ostream::operator<<(int) (in /usr/lib/
libstdc++.so.6.0.8)
==14085== by 0x418BC2:
LinBox::ModularBase<unsigned>::write(std::ostream&, unsigned const&)
const (modular.h:222)
==14085== by 0x40B32C: bool
testLinearity<LinBox::Modular<unsigned>,
LinBox::ScalarMatrix<LinBox::Modular<unsigned> >,
std::vector<unsigned, std::allocator<unsigned> >
>(LinBox::Modular<unsigned>&,
LinBox::ScalarMatrix<LinBox::Modular<unsigned> >&,
LinBox::VectorStream<std::vector<unsigned, std::allocator<unsigned> >
>&, LinBox::VectorStream<std::vector<unsigned,
std::allocator<unsigned> > >&) (test-blackbox.h:170)
==14085== by 0x40BCF3: bool
testBlackbox<LinBox::ScalarMatrix<LinBox::Modular<unsigned> >
>(LinBox::ScalarMatrix<LinBox::Modular<unsigned> >&) (test-blackbox.h:
258)
==14085== by 0x40D831: main (test-scalar-matrix.C:51)

****************************************************************

test-zero-one

==14152== Conditional jump or move depends on uninitialised value(s)
==14152== at 0x416DC3: LinBox::ZeroOne<LinBox::Modular<unsigned>
>::_part(unsigned long, unsigned long, int&) const (zero
-one.inl:240)
==14152== by 0x417103: LinBox::ZeroOne<LinBox::Modular<unsigned>
>::_qsort(unsigned long, unsigned long, int&) const (zer
o-one.inl:215)
==14152== by 0x417172: LinBox::ZeroOne<LinBox::Modular<unsigned>
>::rowSort() const (zero-one.inl:193)
==14152== by 0x4173CE: std::vector<unsigned,
std::allocator<unsigned> >& LinBox::ZeroOne<LinBox::Modular<unsigned>
>::app
lySpecialization<std::vector<unsigned, std::allocator<unsigned> >,
std::vector<unsigned, std::allocator<unsigned> > >(std::v
ector<unsigned, std::allocator<unsigned> >&, std::vector<unsigned,
std::allocator<unsigned> > const&, LinBox::ZeroOne<LinBox
::Modular<unsigned> >::Mod32Field const&) const (zero-one.inl:328)
==14152== by 0x417641: std::vector<unsigned,
std::allocator<unsigned> >& LinBox::ZeroOne<LinBox::Modular<unsigned>
>::app
ly<std::vector<unsigned, std::allocator<unsigned> >,
std::vector<unsigned, std::allocator<unsigned> >
>(std::vector<unsigned
, std::allocator<unsigned> >&, std::vector<unsigned,
std::allocator<unsigned> > const&) const (zero-one.h:71)
==14152== by 0x40B3B1: bool
testLinearity<LinBox::Modular<unsigned>,
LinBox::ZeroOne<LinBox::Modular<unsigned> >, std::ve
ctor<unsigned, std::allocator<unsigned> >
>(LinBox::Modular<unsigned>&,
LinBox::ZeroOne<LinBox::Modular<unsigned> >&, LinBox
::VectorStream<std::vector<unsigned, std::allocator<unsigned> > >&,
LinBox::VectorStream<std::vector<unsigned, std::allocato
r<unsigned> > >&) (test-blackbox.h:173)
==14152== by 0x40BD29: bool
testBlackbox<LinBox::ZeroOne<LinBox::Modular<unsigned> >
>(LinBox::ZeroOne<LinBox::Modular<un
signed> >&) (test-blackbox.h:258)
==14152== by 0x40D956: main (test-zero-one.C:53)

==14152== Use of uninitialised value of size 8
==14152== at 0x417544: std::vector<unsigned,
std::allocator<unsigned> >& LinBox::ZeroOne<LinBox::Modular<unsigned>
>::applySpecialization<std::vector<unsigned, std::allocator<unsigned>
>, std::vector<unsigned, std::allocator<unsigned> >
>(std::vector<unsigned, std::allocator<unsigned> >&,
std::vector<unsigned, std::allocator<unsigned> > const&,
LinBox::ZeroOne<LinBox::Modular<unsigned> >::Mod32Field const&) const
(zero-one.inl:356)
==14152== by 0x417641: std::vector<unsigned,
std::allocator<unsigned> >& LinBox::ZeroOne<LinBox::Modular<unsigned>
>::apply<std::vector<unsigned, std::allocator<unsigned> >,
std::vector<unsigned, std::allocator<unsigned> >
>(std::vector<unsigned, std::allocator<unsigned> >&,
std::vector<unsigned, std::allocator<unsigned> > const&) const (zero-
one.h:71)
==14152== by 0x40B3B1: bool
testLinearity<LinBox::Modular<unsigned>,
LinBox::ZeroOne<LinBox::Modular<unsigned> >, std::vector<unsigned,
std::allocator<unsigned> > >(LinBox::Modular<unsigned>&,
LinBox::ZeroOne<LinBox::Modular<unsigned> >&,
LinBox::VectorStream<std::vector<unsigned, std::allocator<unsigned> >
>&, LinBox::VectorStream<std::vector<unsigned,
std::allocator<unsigned> > >&) (test-blackbox.h:173)
==14152== by 0x40BD29: bool
testBlackbox<LinBox::ZeroOne<LinBox::Modular<unsigned> >
>(LinBox::ZeroOne<LinBox::Modular<unsigned> >&) (test-blackbox.h:258)
==14152== by 0x40D956: main (test-zero-one.C:53)

****************************************************************

test-ispossemidef leaks some serious memory:

==12419== LEAK SUMMARY:
==12419== definitely lost: 736 bytes in 4 blocks.
==12419== indirectly lost: 614,624 bytes in 25,632 blocks.
==12419== possibly lost: 0 bytes in 0 blocks.
==12419== still reachable: 64 bytes in 1 blocks.
==12419== suppressed: 0 bytes in 0 blocks.

For example:

==12419== 409,600 bytes in 4 blocks are indirectly lost in loss record
12 of 12
==12419== at 0x4A1C649: operator new(unsigned long)
(vg_replace_malloc.c:230)
==12419== by 0x41E845:
__gnu_cxx::new_allocator<Integer>::allocate(unsigned long, void
const*) (new_allocator.h:88)
==12419== by 0x41E86C: std::_Vector_base<Integer,
std::allocator<Integer> >::_M_allocate(unsigned long) (stl_vector.h:
127
)
==12419== by 0x41E89E: std::_Vector_base<Integer,
std::allocator<Integer> >::_Vector_base(unsigned long,
std::allocator<I
nteger> const&) (stl_vector.h:113)
==12419== by 0x421135: std::vector<Integer, std::allocator<Integer>
>::vector(unsigned long, Integer const&, std::allocat
or<Integer> const&) (stl_vector.h:216)
==12419== by 0x421206:
LinBox::DenseMatrixBase<Integer>::DenseMatrixBase(unsigned long,
unsigned long) (dense.h:101)
==12419== by 0x425046:
LinBox::DenseMatrix<LinBox::PID_integer>::DenseMatrix(LinBox::PID_integer
const&, unsigned long, u
nsigned long) (dense.h:98)
==12419== by 0x430B0C: 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)
==12419== by 0x44C096: bool
LinBox::isPositiveSemiDefinite<LinBox::SparseMatrix<LinBox::PID_integer,
std::pair<std::vecto
r<unsigned long, std::allocator<unsigned long> >, std::vector<Integer,
std::allocator<Integer> > > > >(LinBox::SparseMatrix<
LinBox::PID_integer, std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<Integer, std::allocat
or<Integer> > > > const&, LinBox::RingCategories::IntegerTag const&,
LinBox::BlasEliminationTraits const&) (is-positive-semi
definite.h:116)
==12419== by 0x44C0DB: bool
LinBox::isPositiveSemiDefinite<LinBox::SparseMatrix<LinBox::PID_integer,
std::pair<std::vecto
r<unsigned long, std::allocator<unsigned long> >, std::vector<Integer,
std::allocator<Integer> > > > >(LinBox::SparseMatrix<
LinBox::PID_integer, std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<Integer, std::allocat
or<Integer> > > > const&, LinBox::RingCategories::IntegerTag const&,
LinBox::EliminationSpecifier const&) (is-positive-semid
efinite.h:82)
==12419== by 0x44C1AE: bool
LinBox::isPositiveSemiDefinite<LinBox::SparseMatrix<LinBox::PID_integer,
std::pair<std::vecto
r<unsigned long, std::allocator<unsigned long> >, std::vector<Integer,
std::allocator<Integer> > > > >(LinBox::SparseMatrix<
LinBox::PID_integer, std::pair<std::vector<unsigned long,
std::allocator<unsigned long> >, std::vector<Integer, std::allocat
or<Integer> > > > const&, LinBox::RingCategories::IntegerTag const&,
LinBox::HybridSpecifier const&) (is-positive-semidefini
te.h:68)
==12419== by 0x44C1F1: bool
LinBox::isPositiveSemiDefinite<LinBox::SparseMatrix<LinBox::PID_integer,
std::pair<std::vecto
r<unsigned long, std::allocator<unsigned long> >, std::vector<Integer,
std::allocator<Integer> > > >, LinBox::HybridSpecifie
r>(LinBox::SparseMatrix<LinBox::PID_integer,
std::pair<std::vector<unsigned long, std::allocator<unsigned long> >,
std::vect
or<Integer, std::allocator<Integer> > > > const&,
LinBox::HybridSpecifier const&) (is-positive-semidefinite.h:35)

mabshoff

unread,
Mar 12, 2008, 4:07:20 AM3/12/08
to linbox-use
I reran all the tests using linbox 1.1.5rc2-rc2912

Clement did fix a lot of the leaks and also a couple other
issues. I have left a number of NTL related memory issues
out of this summary since those are at least partially caused
by NTL internals. I hopefully will have time to track those
down soon since those have annoyed me in Sage enough to
finally do something about them.

Overall great progress since 1.1.5.rc2!

Cheers,

Michael

test-rational-solver, test-rational-solver-adaptive

==13731== Invalid read of size 1
==13731== at 0x4A1CDC2: strlen (mc_replace_strmem.c:242)
==13731== 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)
==13731== by 0x409ACD: LinBox::Commentator::stop(char const*, char
const*, char const*) (commentator.C:201)
==13731== by 0x45C5E7: bool testRandomSolve<LinBox::PID_integer,
LinBox::Modular<int>, std::vector<Integer, std::allocato
r<Integer> > >(LinBox::PID_integer const&, LinBox::Modular<int>
const&, LinBox::VectorStream<std::vector<Integer, std::alloc
ator<Integer> > >&, LinBox::VectorStream<std::vector<Integer,
std::allocator<Integer> > >&) (test-rational-solver.C:139)
==13731== by 0x40FB1D: main (test-rational-solver.C:172)
==13731== Address 0x64a8790 is 24 bytes inside a block of size 67
free'd
==13731== at 0x4A1B62C: operator delete(void*) (vg_replace_malloc.c:
342)
==13731== by 0x5E78929: std::string::~string() (in /usr/lib/libstdc+
+.so.6.0.8)
==13731== by 0x45BDC6: bool testRandomSolve<LinBox::PID_integer,
LinBox::Modular<int>, std::vector<Integer, std::allocato
r<Integer> > >(LinBox::PID_integer const&, LinBox::Modular<int>
const&, LinBox::VectorStream<std::vector<Integer, std::alloc
ator<Integer> > >&, LinBox::VectorStream<std::vector<Integer,
std::allocator<Integer> > >&) (test-rational-solver.C:28)
==13731== by 0x40FB1D: main (test-rational-solver.C:172)

################################################################

test-givaro-zpz

==23627== Invalid read of size 2
==23627== at 0x46A6DB: ZpzDom<Log16>::ZpzDom(unsigned short)
(givzpz16table1.C:92)
==23627== by 0x42985E: LinBox::GivaroZpz<Log16>::GivaroZpz(Integer
const&) (givaro-zpz.h:102)
==23627== by 0x4107B6: main (test-givaro-zpz.C:117)
==23627== Address 0x6c9d70a is 0 bytes after a block of size 202
alloc'd
==23627== at 0x4A1C2F7: operator new[](unsigned long)
(vg_replace_malloc.c:274)
==23627== by 0x46A4DB: ZpzDom<Log16>::ZpzDom(unsigned short)
(givzpz16table1.C:20)
==23627== by 0x42985E: LinBox::GivaroZpz<Log16>::GivaroZpz(Integer
const&) (givaro-zpz.h:102)
==23627== by 0x4107B6: main (test-givaro-zpz.C:117)

################################################################

test-givaro-zpzuns (very similar to the previous error)

==11587== Invalid read of size 2
==11587== at 0x43F7BB: ZpzDom<Log16>::ZpzDom(unsigned short)
(givzpz16table1.C:92)
==11587== by 0x42179A: LinBox::GivaroZpz<Log16>::GivaroZpz(Integer
const&) (givaro-zpz.h:102)
==11587== by 0x410546: main (test-givaro-zpzuns.C:104)
==11587== Address 0x76fbd2a is 0 bytes after a block of size 202
alloc'd
==11587== at 0x4A1C2F7: operator new[](unsigned long)
(vg_replace_malloc.c:274)
==11587== by 0x43F5BB: ZpzDom<Log16>::ZpzDom(unsigned short)
(givzpz16table1.C:20)
==11587== by 0x42179A: LinBox::GivaroZpz<Log16>::GivaroZpz(Integer
const&) (givaro-zpz.h:102)
==11587== by 0x410546: main (test-givaro-zpzuns.C:104)

################################################################

test-zero-one

==22836== Conditional jump or move depends on uninitialised value(s)
==22836== at 0x416E22: LinBox::ZeroOne<LinBox::Modular<unsigned>
>::_part(unsigned long, unsigned long, int&) const (zero
-one.inl:241)
==22836== by 0x417103: LinBox::ZeroOne<LinBox::Modular<unsigned>
>::_qsort(unsigned long, unsigned long, int&) const (zer
o-one.inl:215)
==22836== by 0x417172: LinBox::ZeroOne<LinBox::Modular<unsigned>
>::rowSort() const (zero-one.inl:193)
==22836== by 0x4173CE: std::vector<unsigned,
std::allocator<unsigned> >& LinBox::ZeroOne<LinBox::Modular<unsigned>
>::app
lySpecialization<std::vector<unsigned, std::allocator<unsigned> >,
std::vector<unsigned, std::allocator<unsigned> > >(std::v
ector<unsigned, std::allocator<unsigned> >&, std::vector<unsigned,
std::allocator<unsigned> > const&, LinBox::ZeroOne<LinBox
::Modular<unsigned> >::Mod32Field const&) const (zero-one.inl:328)
==22836== by 0x417641: std::vector<unsigned,
std::allocator<unsigned> >& LinBox::ZeroOne<LinBox::Modular<unsigned>
>::app
ly<std::vector<unsigned, std::allocator<unsigned> >,
std::vector<unsigned, std::allocator<unsigned> >
>(std::vector<unsigned
, std::allocator<unsigned> >&, std::vector<unsigned,
std::allocator<unsigned> > const&) const (zero-one.h:71)
==22836== by 0x40B3B1: bool
testLinearity<LinBox::Modular<unsigned>,
LinBox::ZeroOne<LinBox::Modular<unsigned> >, std::ve
ctor<unsigned, std::allocator<unsigned> >
>(LinBox::Modular<unsigned>&,
LinBox::ZeroOne<LinBox::Modular<unsigned> >&, LinBox
::VectorStream<std::vector<unsigned, std::allocator<unsigned> > >&,
LinBox::VectorStream<std::vector<unsigned, std::allocato
r<unsigned> > >&) (test-blackbox.h:173)
==22836== by 0x40BD29: bool
testBlackbox<LinBox::ZeroOne<LinBox::Modular<unsigned> >
>(LinBox::ZeroOne<LinBox::Modular<un
signed> >&) (test-blackbox.h:258)
==22836== by 0x40D956: main (test-zero-one.C:53)

################################################################

Small leaks in test-gmp-rational:

==10938== LEAK SUMMARY:
==10938== definitely lost: 57 bytes in 3 blocks.
==10938== possibly lost: 0 bytes in 0 blocks.
==10938== still reachable: 64 bytes in 1 blocks.
==10938== suppressed: 0 bytes in 0 blocks.

==10938== 8 bytes in 1 blocks are definitely lost in loss record 1 of
4
==10938== at 0x4A1BE1B: malloc (vg_replace_malloc.c:207)
==10938== by 0x5BA2D58: __gmp_default_allocate (in /scratch/
mabshoff/gmp-4.2.2-bin/lib/libgmp.so.3.4.2)
==10938== by 0x5BB1717: __gmpz_init (in /scratch/mabshoff/gmp-4.2.2-
bin/lib/libgmp.so.3.4.2)
==10938== by 0x41FC18: LinBox::GMPRationalField::convert(Integer&,
LinBox::GMPRationalElement const&) const (gmp-rational.h:146)
==10938== by 0x42093A: bool testField<LinBox::GMPRationalField
const>(LinBox::GMPRationalField const&, char const*, bool) (test-
field.h:125)
==10938== by 0x422B42: bool
runBasicRingTests<LinBox::GMPRationalField>(LinBox::GMPRationalField
const&, char const*, unsigned, bool) (test-field.h:1053)
==10938== by 0x422F86: bool
runFieldTests<LinBox::GMPRationalField>(LinBox::GMPRationalField
const&, char const*, unsigned, unsigned long, bool) (test-field.h:
1034)
==10938== by 0x40F8BB: main (test-gmp-rational.C:50)

################################################################

test-ispossemidef still leaks rather badly:

==12100== LEAK SUMMARY:
==12100== definitely lost: 736 bytes in 4 blocks.
==12100== indirectly lost: 614,624 bytes in 25,632 blocks.
==12100== possibly lost: 0 bytes in 0 blocks.
==12100== still reachable: 64 bytes in 1 blocks.
==12100== suppressed: 0 bytes in 0 blocks.

Clement told me in IRC that he looked at it, but couldn't find
anything yet.

################################################################

test-commentator

==27743== Conditional jump or move depends on uninitialised value(s)
==27743== 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)
==27743== by 0x40B24B: LinBox::MessageClass::isPrinted(unsigned
long, unsigned long, char const*) (commentator.C:586)
==27743== by 0x40BA7B: LinBox::Commentator::isPrinted(unsigned
long, unsigned long, char const*, char const*) (commentator.C:360)
==27743== by 0x40E607: LinBox::Commentator::start(char const*, char
const*, unsigned long) (commentator.C:128)
==27743== by 0x40E7B2: runTestActivity(bool) (test-commentator.C:
52)
==27743== by 0x40EAD1: testBriefReport() (test-commentator.C:143)
==27743== by 0x40EBE6: main (test-commentator.C:177)

mabshoff

unread,
Mar 13, 2008, 3:32:44 AM3/13/08
to linbox-use
Hello list,

I reran all the tests using linbox 1.1.5rc2-rc2916: Overall
much progress, i.e. the huge leaks and the segfault in
test-zero-one on Solaris has probably been fixed. There
are still four, five small issues left that I listed below.
So overall very nice work Clement :)

Memory wise the issues left are overwhelmingly in Givaro
and/or NTL, so I will start poking around there hopefully
soon.

Re r2916: It doesn't fix all Solaris related issues, i.e. _A
is still a problem. I should be building on Solaris some
time today, so I can come up with a patch in case I find
some issues.

Overall you can see the progress from the total size of
all the valgrind logs for all the tests:

1.5M linbox-1.1.5.rc2-vglog
804K linbox-1.1.5.rc2-r2911-vglog
788K linbox-1.1.5.rc2-r2912-vglog
700K linbox-1.1.5.rc2-r2916-vglog

All the logs can be found on sage.math, i.e.

http://sage.math.washington.edu/home/mabshoff/linbox-1.1.5.rc2-r2916-vglog/

Cheers,

Michael

################################################################

test-givaro-zpzuns and test-givaro-zpz

==1498== Invalid read of size 2
==1498== at 0x43F83B: ZpzDom<Log16>::ZpzDom(unsigned short)
(givzpz16table1.C:92)
==1498== by 0x421820: LinBox::GivaroZpz<Log16>::GivaroZpz(Integer
const&) (givaro-zpz.h:102)
==1498== by 0x410578: main (test-givaro-zpzuns.C:108)
==1498== Address 0x8756e52 is 0 bytes after a block of size 202
alloc'd
==1498== at 0x4A1C2F7: operator new[](unsigned long)
(vg_replace_malloc.c:274)
==1498== by 0x43F63B: ZpzDom<Log16>::ZpzDom(unsigned short)
(givzpz16table1.C:20)
==1498== by 0x421820: LinBox::GivaroZpz<Log16>::GivaroZpz(Integer
const&) (givaro-zpz.h:102)
==1498== by 0x410578: main (test-givaro-zpzuns.C:108)

################################################################

test-commentator

==31856== Conditional jump or move depends on uninitialised value(s)
==31856== 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)
==31856== by 0x40B24B: LinBox::MessageClass::isPrinted(unsigned
long, unsigned long, char const*) (commentator.C:586)
==31856== by 0x40BA7B: LinBox::Commentator::isPrinted(unsigned
long, unsigned long, char const*, char const*) (commentator.C:360)
==31856== by 0x40E607: LinBox::Commentator::start(char const*, char
const*, unsigned long) (commentator.C:128)
==31856== by 0x40E7B2: runTestActivity(bool) (test-commentator.C:
52)
==31856== by 0x40EAD1: testBriefReport() (test-commentator.C:143)
==31856== by 0x40EBE6: main (test-commentator.C:177)

################################################################

Some small leaks in test-gmp-rational left:

==32126== LEAK SUMMARY:
==32126== definitely lost: 57 bytes in 3 blocks.
==32126== possibly lost: 0 bytes in 0 blocks.
==32126== still reachable: 64 bytes in 1 blocks.
==32126== suppressed: 0 bytes in 0 blocks.

For example:

==32126== 8 bytes in 1 blocks are definitely lost in loss record 1 of
4
==32126== at 0x4A1BE1B: malloc (vg_replace_malloc.c:207)
==32126== by 0x5BA2D58: __gmp_default_allocate (in /scratch/
mabshoff/gmp-4.2.2-bin/lib/libgmp.so.3.4.2)
==32126== by 0x5BB1717: __gmpz_init (in /scratch/mabshoff/gmp-4.2.2-
bin/lib/libgmp.so.3.4.2)
==32126== by 0x41FC18: LinBox::GMPRationalField::convert(Integer&,
LinBox::GMPRationalElement const&) const (gmp-rational
.h:146)
==32126== by 0x42093A: bool testField<LinBox::GMPRationalField
const>(LinBox::GMPRationalField const&, char const*, bool)
(test-field.h:125)
==32126== by 0x422B42: bool
runBasicRingTests<LinBox::GMPRationalField>(LinBox::GMPRationalField
const&, char const*, uns
igned, bool) (test-field.h:1053)
==32126== by 0x422F86: bool
runFieldTests<LinBox::GMPRationalField>(LinBox::GMPRationalField
const&, char const*, unsigne
d, unsigned long, bool) (test-field.h:1034)
==32126== by 0x40F8BB: main (test-gmp-rational.C:50)

################################################################

test-rational-solver-adaptive, test-rational-solver:

==19625== Invalid read of size 1
==19625== at 0x4A1CDC2: strlen (mc_replace_strmem.c:242)
==19625== 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)
==19625== by 0x409ACD: LinBox::Commentator::stop(char const*, char
const*, char const*) (commentator.C:201)
==19625== by 0x45C6D7: bool testRandomSolve<LinBox::PID_integer,
LinBox::Modular<int>, std::vector<Integer, std::allocator<Integer> >
>(LinBox::PID_integer const&, LinBox::Modular<int> const&,
LinBox::VectorStream<std::vector<Integer, std::allocator<Integer> >
>&, LinBox::VectorStream<std::vector<Integer, std::allocator<Integer>
> >&) (test-rational-solver-adaptive.C:138)
==19625== by 0x40FB1D: main (test-rational-solver-adaptive.C:172)
==19625== Address 0x64a8790 is 24 bytes inside a block of size 67
free'd
==19625== at 0x4A1B62C: operator delete(void*) (vg_replace_malloc.c:
342)
==19625== by 0x5E78929: std::string::~string() (in /usr/lib/libstdc+
+.so.6.0.8)
==19625== by 0x45BFD2: bool testRandomSolve<LinBox::PID_integer,
LinBox::Modular<int>, std::vector<Integer, std::allocator<Integer> >
>(LinBox::PID_integer const&, LinBox::Modular<int> const&,
LinBox::VectorStream<std::vector<Integer, std::allocator<Integer> >
>&, LinBox::VectorStream<std::vector<Integer, std::allocator<Integer>
> >&) (test-rational-solver-adaptive.C:27)
==19625== by 0x40FB1D: main (test-rational-solver-adaptive.C:172)

################################################################

test-ntl-toeplitz: various NTL related deallocation issues:

==1540== LEAK SUMMARY:
==1540== definitely lost: 0 bytes in 0 blocks.
==1540== possibly lost: 432 bytes in 9 blocks.
==1540== still reachable: 56,727 bytes in 29 blocks.
==1540== suppressed: 0 bytes in 0 blocks.

The baseline NTL still reachable memory seems to be about 6
kb in 18 blocks, maybe a little less.

For example the following might still be deallocatable:

==1540== 32,768 bytes in 1 blocks are still reachable in loss record
33 of 33
==1540== at 0x4A1BE1B: malloc (vg_replace_malloc.c:207)
==1540== by 0x47C543: NTL::BitReverseCopy(long*, long const*, long)
(in /scratch/mabshoff/linbox/tests/mu/test-ntl-toeplitz)
==1540== by 0x47C669: NTL::FFT(long*, long const*, long, long, long
const*) (in /scratch/mabshoff/linbox/tests/mu/test-ntl-toeplitz)
==1540== by 0x444652: NTL::ToFFTRep(NTL::FFTRep&, NTL::ZZ_pX
const&, long, long, long) (in /scratch/mabshoff/linbox/tests/mu/test-
ntl-toeplitz)
==1540== by 0x4460F3: NTL::FFTMul(NTL::ZZ_pX&, NTL::ZZ_pX const&,
NTL::ZZ_pX const&) (in /scratch/mabshoff/linbox/tests/mu/test-ntl-
toeplitz)
==1540== by 0x4463E1: NTL::mul(NTL::ZZ_pX&, NTL::ZZ_pX const&,
NTL::ZZ_pX const&) (in /scratch/mabshoff/linbox/tests/mu/test-ntl-
toeplitz)
==1540== by 0x419F92: NTL::operator*(NTL::ZZ_pX const&, NTL::ZZ_pX
const&) (ZZ_pX.h:442)
==1540== by 0x41C619:
LinBox::UnparametricField<NTL::ZZ_pX>::mul(NTL::ZZ_pX&, NTL::ZZ_pX
const&, NTL::ZZ_pX const&) const (unparametric.h:177)
==1540== by 0x41C7F8: std::vector<NTL::ZZ_p,
std::allocator<NTL::ZZ_p> >& LinBox::Toeplitz<LinBox::NTL_ZZ_p,
LinBox::NTL_ZZ_pX>::applyTranspose<std::vector<NTL::ZZ_p,
std::allocator<NTL::ZZ_p> >, std::vector<NTL::ZZ_p,
std::allocator<NTL::ZZ_p> > >(std::vector<NTL::ZZ_p,
std::allocator<NTL::ZZ_p> >&, std::vector<NTL::ZZ_p,
std::allocator<NTL::ZZ_p> > const&) const (toeplitz.inl:366)
==1540== by 0x4118F2: main (test-ntl-toeplitz.C:91)

Clement Pernet

unread,
Mar 13, 2008, 1:45:48 PM3/13/08
to linbo...@googlegroups.com
Hi,

here is my last status report on these bugs:
> ################################################################
>
> test-givaro-zpzuns and test-givaro-zpz
>
>
This was a bug in givaro:
I fixed it upstream.
The patch is here:
http://sage.math.washington.edu/home/pernet/Patches/givarozpz16table1.patch
I also made a givaro-3.2.10rc2 tarball:
http://sage.math.washington.edu/home/pernet/givaro-3.2.10rc2.tar.gz

> ################################################################
>
> test-commentator
>
>
I gave up on this one, since the commentator gives me headache.
However, this code is not ran when compiling with -DDISABLE_COMMENTATOR


>
> Some small leaks in test-gmp-rational left:
>
>

fixed
> ################################################################
>
> test-rational-solver-adaptive, test-rational-solver:
>
>
fixed


> ################################################################
>
> test-ntl-toeplitz: various NTL related deallocation issues:
>
>

These leaks really look to be NTL's fault. So I did not look at it for
the moment.

David Saunders

unread,
Mar 13, 2008, 4:25:45 PM3/13/08
to linbo...@googlegroups.com
This is excellent. Michael, thanks for making trouble (very valuable!)
and Clement thanks for the good fight!

Regarding the commentator, there is value in it but it is due for an
overhaul. I have some ideas about that. To give a hint, the
commentator tries to be too many things for too many purposes, with the
result that none are served well. It can be modularized and simplified.
In particular, algorithm writer's interface to the commentator must be
dead simple. Algorithm writers have many other things on their minds.
Stack sniffing rather than algorithm writer input can handle nesting.
Wall clock monitoring can control output volume rather than multiple
categories of importance and message type. Thus user can direct with a
single <interval> parameter: "show me only the most important single
message you have from each <interval> seconds." In a separate thread,
semi-intelligent methods can filter the commentator message stream to
meet that goal, etc.

One suggestion I have is to make the disabled commentator the default.
One only gets commentator active by compiling with -DENABLE_COMMENTATOR.

-dave

mabshoff

unread,
Mar 13, 2008, 4:46:12 PM3/13/08
to linbox-use
Hello list,

I reran all the tests using linbox 1.1.5rc2-rc2920: Much
progress again thanks to Clement.

Work on Solaris is coming up.

http://sage.math.washington.edu/home/mabshoff/linbox-1.1.5.rc2-r2920-vglog/

Cheers,

Michael

################################################################

test-commentator

==31856== Conditional jump or move depends on uninitialised value(s)
==31856== 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)
==31856== by 0x40B24B: LinBox::MessageClass::isPrinted(unsigned
long, unsigned long, char const*) (commentator.C:586)
==31856== by 0x40BA7B: LinBox::Commentator::isPrinted(unsigned
long, unsigned long, char const*, char const*) (commentator.C:360)
==31856== by 0x40E607: LinBox::Commentator::start(char const*, char
const*, unsigned long) (commentator.C:128)
==31856== by 0x40E7B2: runTestActivity(bool) (test-commentator.C:
52)
==31856== by 0x40EAD1: testBriefReport() (test-commentator.C:143)
==31856== by 0x40EBE6: main (test-commentator.C:177)

Clement gave up on this one, so I might have to dig myself :)


################################################################

Some small leaks in test-gmp-rational left, improved relative to
r2916:

==20500== LEAK SUMMARY:
==20500== definitely lost: 16 bytes in 2 blocks.
==20500== possibly lost: 0 bytes in 0 blocks.
==20500== still reachable: 64 bytes in 1 blocks.
==20500== suppressed: 0 bytes in 0 blocks


################################################################

Issues in test-givaro-zpzuns and test-givaro-zpz are gone with
the new Givaro.

################################################################

test-rational-solver-adaptive, test-rational-solver (still present):
The following two code snippets at fault here:

str << "Testing Nonsingular Random Diagonal solve ";

commentator.start (str.str ().c_str (),
"testNonsingularRandomDiagonalSolve");

and

str << "Testing Nonsingular Random Diagonal solve ";

commentator.start (str.str ().c_str
(),"testNonsingularRandomDiagonalSolve", stream1.size());//
"testNonsingularRand
omMatrixSolve", stream1.m ());

Since Clement fixed the same bug in two other places already I
won't post a patch here so he will get credit [and I am lazy, too] :)


################################################################

I will skip over Givaro and NTL memleak issues until I do
some more digging there.

mabshoff

unread,
Mar 13, 2008, 5:35:27 PM3/13/08
to linbox-use


On Mar 13, 9:46 pm, mabshoff <Michael.Absh...@mathematik.uni-
dortmund.de> wrote:
> Hello list,
>

<SNIP>

> The following two code snippets at fault here:
>
> str << "Testing Nonsingular Random Diagonal solve ";
>
> commentator.start (str.str ().c_str (),
> "testNonsingularRandomDiagonalSolve");
>
> and
>
> str << "Testing Nonsingular Random Diagonal solve ";
>
> commentator.start (str.str ().c_str
> (),"testNonsingularRandomDiagonalSolve", stream1.size());//
> "testNonsingularRand
> omMatrixSolve", stream1.m ());
>
> Since Clement fixed the same bug in two other places already I
> won't post a patch here so he will get credit [and I am lazy, too] :)
>

Ok, I am doing my share, too. Clement is in some talk right now, so
here are the two trivial fixes for the above issue:

http://fsmath.mathematik.uni-dortmund.de/~mabshoff/patches/linbox-1.1.5rc2-r2920-fix-invalid-access-1.patch
http://fsmath.mathematik.uni-dortmund.de/~mabshoff/patches/linbox-1.1.5rc2-r2920-fix-invalid-access-2.patch

I am now working on Solaris to make sure it compiles there. Clement
suggested doing an rc3 afterwards.

Cheers,

Michael

mabshoff

unread,
Mar 14, 2008, 1:51:58 PM3/14/08
to linbox-use


On Mar 13, 10:35 pm, mabshoff <Michael.Absh...@mathematik.uni-
dortmund.de> wrote:
> On Mar 13, 9:46 pm, mabshoff <Michael.Absh...@mathematik.uni-
>
> dortmund.de> wrote:
> > Hello list,
>
> <SNIP>
>
>
>
> > The following two code snippets at fault here:
>
> > str << "Testing Nonsingular Random Diagonal solve ";
>
> > commentator.start (str.str ().c_str (),
> > "testNonsingularRandomDiagonalSolve");
>
> > and
>
> > str << "Testing Nonsingular Random Diagonal solve ";
>
> > commentator.start (str.str ().c_str
> > (),"testNonsingularRandomDiagonalSolve", stream1.size());//
> > "testNonsingularRand
> > omMatrixSolve", stream1.m ());
>
> > Since Clement fixed the same bug in two other places already I
> > won't post a patch here so he will get credit [and I am lazy, too] :)
>
> Ok, I am doing my share, too. Clement is in some talk right now, so
> here are the two trivial fixes for the above issue:
>
> http://fsmath.mathematik.uni-dortmund.de/~mabshoff/patches/linbox-1.1...http://fsmath.mathematik.uni-dortmund.de/~mabshoff/patches/linbox-1.1...

Oops, somehow I got my revisions mixed up and as Clement did point out
in IRC yesterday analog fixes are already in svn.

> I am now working on Solaris to make sure it compiles there. Clement
> suggested doing an rc3 afterwards.

I did build r2920 on Solaris and there is some trouble with Givaro
3.2.10.rc2 on Solaris 9 where fenv.h is not available per default. It
builds fine on Solaris 10 where we have fenv.h.

LinBox itself (with NTL and Givaro) passes all tests but the
Commentator test.

> Cheers,
>
> Michael

Cheers,

Michael
Reply all
Reply to author
Forward
0 new messages