Valgrind is producing a finding under Fedora 22 and Debian 8. The
finding is shown below. The issue seems to appear in the latest GCC
compilers, like 4.9 and 5.1. Code produced by earlier compilers do not
produce a finding.

I see the "Uninitialised value was created by a stack allocation" and
the file and line number. The issue I am having is it points to the
last line of a [rather large] inline assembly block. To further
complicate matters, the routine makes use of the MMX coprocessor.

I tried using addr2line, but its not offering anything more than
Valgrind is reporting:

    $ addr2line -e cryptest.exe -a 0x51E41A
    0x000000000051e41a
    /home/jwalton/.../cryptopp-svn-5.6.3/salsa.cpp:474

I'm building with -Og and -g3. Can I get Valgrind to print its name
for me? Or, how can I get more information on the offending variable?

Thanks in advance.

**********

Line 474 reported below is actually line 468 of
http://www.cryptopp.com/docs/ref/salsa_8cpp_source.html (I'm tweaking
things trying to isolate the offender).

**********

$ valgrind --track-origins=yes ./cryptest.exe tv salsa
...

Testing SymmetricCipher algorithm Salsa20.
......==3890== Conditional jump or move depends on uninitialised value(s)
==3890==    at 0x4C2CC7C: strcmp (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==3890==    by 0x48744F: EqualStrings (datatest.cpp:23)
==3890==    by 0x48744F: TestSymmetricCipher(std::map<std::string,
std::string, std::less<std::string>,
std::allocator<std::pair<std::string const, std::string> > >&,
CryptoPP::NameValuePairs const&) (datatest.cpp:432)
==3890==    by 0x48B5F5: TestDataFile(std::string const&,
CryptoPP::NameValuePairs const&, unsigned int&, unsigned int&)
(datatest.cpp:714)
==3890==    by 0x48BCF7: RunTestDataFile(char const*,
CryptoPP::NameValuePairs const&, bool) (datatest.cpp:759)
==3890==    by 0x404FB0: main (test.cpp:266)
==3890==  Uninitialised value was created by a stack allocation
==3890==    at 0x51E3D3:
CryptoPP::Salsa20_Policy::OperateKeystream(CryptoPP::KeystreamOperation,
unsigned char*, unsigned char const*, unsigned long) (salsa.cpp:474)
==3890==
==3890== Conditional jump or move depends on uninitialised value(s)
==3890==    at 0x4C2CC6A: strcmp (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==3890==    by 0x48744F: EqualStrings (datatest.cpp:23)
==3890==    by 0x48744F: TestSymmetricCipher(std::map<std::string,
std::string, std::less<std::string>,
std::allocator<std::pair<std::string const, std::string> > >&,
CryptoPP::NameValuePairs const&) (datatest.cpp:432)
==3890==    by 0x48B5F5: TestDataFile(std::string const&,
CryptoPP::NameValuePairs const&, unsigned int&, unsigned int&)
(datatest.cpp:714)
==3890==    by 0x48BCF7: RunTestDataFile(char const*,
CryptoPP::NameValuePairs const&, bool) (datatest.cpp:759)
==3890==    by 0x404FB0: main (test.cpp:266)
==3890==  Uninitialised value was created by a stack allocation
==3890==    at 0x51E3D3:
CryptoPP::Salsa20_Policy::OperateKeystream(CryptoPP::KeystreamOperation,
unsigned char*, unsigned char const*, unsigned long) (salsa.cpp:474)
==3890==
==3890== Conditional jump or move depends on uninitialised value(s)
==3890==    at 0x487472: TestSymmetricCipher(std::map<std::string,
std::string, std::less<std::string>,
std::allocator<std::pair<std::string const, std::string> > >&,
CryptoPP::NameValuePairs const&) (datatest.cpp:432)
==3890==    by 0x48B5F5: TestDataFile(std::string const&,
CryptoPP::NameValuePairs const&, unsigned int&, unsigned int&)
(datatest.cpp:714)
==3890==    by 0x48BCF7: RunTestDataFile(char const*,
CryptoPP::NameValuePairs const&, bool) (datatest.cpp:759)
==3890==    by 0x404FB0: main (test.cpp:266)
==3890==  Uninitialised value was created by a stack allocation
==3890==    at 0x51E41A:
CryptoPP::Salsa20_Policy::OperateKeystream(CryptoPP::KeystreamOperation,
unsigned char*, unsigned char const*, unsigned long) (salsa.cpp:474)
==3890==
==3890== Use of uninitialised value of size 8
==3890==    at 0x53F635: CryptoPP::BaseN_Encoder::Put2(unsigned char
const*, unsigned long, int, bool) (basecode.cpp:85)
==3890==    by 0x571900: NextPutMaybeModifiable (filters.h:204)
==3890==    by 0x571900:
CryptoPP::FilterWithBufferedInput::PutMaybeModifiable(unsigned char*,
unsigned long, int, bool, bool) (filters.cpp:376)
==3890==    by 0x4F8CDB:
CryptoPP::BufferedTransformation::ChannelPut2(std::string const&,
unsigned char const*, unsigned long, int, bool) (cryptlib.cpp:432)
==3890==    by 0x56E9DD:
CryptoPP::StringStore::CopyRangeTo2(CryptoPP::BufferedTransformation&,
unsigned long long&, unsigned long long, std::string const&, bool)
const (filters.cpp:1091)
==3890==    by 0x56E96C:
CryptoPP::StringStore::TransferTo2(CryptoPP::BufferedTransformation&,
unsigned long long&, std::string const&, bool) (filters.cpp:1081)
==3890==    by 0x487578: Pump (filters.h:738)
==3890==    by 0x487578: TestSymmetricCipher(std::map<std::string,
std::string, std::less<std::string>,
std::allocator<std::pair<std::string const, std::string> > >&,
CryptoPP::NameValuePairs const&) (datatest.cpp:436)
==3890==    by 0x48B5F5: TestDataFile(std::string const&,
CryptoPP::NameValuePairs const&, unsigned int&, unsigned int&)
(datatest.cpp:714)
==3890==    by 0x48BCF7: RunTestDataFile(char const*,
CryptoPP::NameValuePairs const&, bool) (datatest.cpp:759)
==3890==    by 0x404FB0: main (test.cpp:266)
==3890==  Uninitialised value was created by a stack allocation
==3890==    at 0x51E3D3:
CryptoPP::Salsa20_Policy::OperateKeystream(CryptoPP::KeystreamOperation,
unsigned char*, unsigned char const*, unsigned long) (salsa.cpp:474)

------------------------------------------------------------------------------
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to