blitzpp / blitz

Blitz++ Multi-Dimensional Array Library for C++
https://github.com/blitzpp/blitz/wiki
Other
405 stars 84 forks source link

use of unintialized value in array/methods.cc #66

Open slayoo opened 5 years ago

slayoo commented 5 years ago

Migrated from: https://sourceforge.net/p/blitz/bugs/21/

As reported by @tesch on 2010-01-15:

ordering(i) can be uninitialized when checked in the debug code... algorithm might still be ok, but the debug code is incorrect. this gives an error in valgrind:

==2279== Memcheck, a memory error detector
==2279== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==2279== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==2279== Command: ./peter-bienstman-5
==2279== Parent PID: 2278
==2279==
==2279== Conditional jump or move depends on uninitialised value(s)
==2279== at 0x4024DE: blitz::Array<float, 2>::Array<blitz::_bz_ArrayExprBinaryOp<blitz::FastArrayIterator<float, 2>, blitz::FastArrayIterator<float, 2>, blitz::Add<float, float> > >(blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::FastArrayIterator<float, 2>, blitz::FastArrayIterator<float, 2>, blitz::Add<float, float> > >) (methods.cc:36)
==2279== by 0x4013E9: main (peter-bienstman-5.cpp:23)
==2279==
==2279==
==2279== HEAP SUMMARY:
==2279== in use at exit: 0 bytes in 0 blocks
==2279== total heap usage: 10 allocs, 10 frees, 396 bytes allocated
==2279==
==2279== All heap blocks were freed -- no leaks are possible
==2279==
==2279== For counts of detected and suppressed errors, rerun with: -v
==2279== Use --track-origins=yes to see where uninitialised values come from
==2279== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 6 from 6)