|
From: Mathieu M. <mma...@ny...> - 2005-07-31 12:58:11
|
Hello,
I am runninng nightly tests with valgrind enabled on a project called:
CMake. Recently a bunch of error appears, when compiling CMake in
Release mode (-O3) and using an experimental g++ (gcc-snapshot debian
package). The errors look like:
...
==7829== Conditional jump or move depends on uninitialised value(s)
==7829== at 0x1BA2F155: __addvsi3 (in /lib/libgcc_s.so.1)
==7829== by 0x81EDD4F:
cmCommandArgumentParserHelper::AllocateParserType(cmCommandArgumentParserHelper::ParserType*,
char const*, int) (in
/home/mathieu/Dashboards/MyTests/CMake-gcc-snapshot/bin/ctest)
==7829== by 0x820E491:
cmCommandArgument_yylex(cmCommandArgumentParserHelper::ParserType*,
void*) (in /home/mathieu/Dashboards/MyTests/CMake-gcc-snapshot/bin/ctest)
...
I cannot reproduce those using g++-4.0 (debian package) or using
g++-snapshot in Debug mode (-g -O0).
Any advice on why this is happening ?
Thanks,
Mathieu
Ps: Extract of the code:
cmCommandArgumentParserHelper::AllocateParserType:
void
cmCommandArgumentParserHelper::AllocateParserType(cmCommandArgumentParserHelper::ParserType*
pt,
const char* str, int len)
{
pt->str = 0;
if ( len == 0 )
{
len = strlen(str);
}
if ( len == 0 )
{
return;
}
this->UnionsAvailable ++;
pt->str = new char[ len + 1 ];
strncpy(pt->str, str, len);
pt->str[len] = 0;
m_Variables.push_back(pt->str);
}
|
|
From: Nicholas N. <nj...@cs...> - 2005-07-31 14:45:17
|
On Sun, 31 Jul 2005, Mathieu Malaterre wrote: > I am runninng nightly tests with valgrind enabled on a project > called: CMake. Recently a bunch of error appears, when compiling CMake in > Release mode (-O3) and using an experimental g++ (gcc-snapshot debian > package). Julian may have more to say, but generally we don't recommend using Memcheck on code compiled at the highest optimisation levels for exactly this reason -- sometimes Memcheck gets fooled into flagging false positives. That would be why you have no problem at -O0. N |
|
From: Mathieu M. <mma...@ny...> - 2005-07-31 15:09:31
|
Nicholas Nethercote wrote: > On Sun, 31 Jul 2005, Mathieu Malaterre wrote: > >> I am runninng nightly tests with valgrind enabled on a project >> called: CMake. Recently a bunch of error appears, when compiling CMake >> in Release mode (-O3) and using an experimental g++ (gcc-snapshot >> debian package). > > > Julian may have more to say, but generally we don't recommend using > Memcheck on code compiled at the highest optimisation levels for exactly > this reason -- sometimes Memcheck gets fooled into flagging false > positives. That would be why you have no problem at -O0. Ah ok I see what you mean. My concern was that __addvsi3 is a dummy code that hasn't changed for years (implement signed overflow for addition). But in fact what changed really is the O3 optimization in gcc 4.1.x compared to 4.0.x. Thanks Mathieu |