|
From: Christoph B. <bar...@or...> - 2005-11-22 10:57:11
|
Hi,
I use the current SVN version of valgrind. On two of our machines running
RedHat Enterprise Linux 4 we get a strange error. On all other machines it
does not occur.
Essentially we have the following method:
static void
xrMessage()
{
/* Get time */
char t[24];
time_t timer;
time(&timer);
/* Write to stdout. */
strftime(t,24,"%b%d %H:%M:%S: ",localtime(&timer));
printf("%s\n", t);
}
On all machines besides the two ones we get here the current time in the
specified format. On the suspect ones localtime sometimes returns NULL or the
date is wrong.
When we run this code without valgrind or in a normal debugger this error does
not occur at all. Only when valgrind is involved.
Another strange thing is that within the same second (returned by time)
localtime has different results. But if we double the call to localtime both
calls are either wrong or correct.
There are no errors reported by valgrind before the wrong dates are printed.
Maybe this is an indication for an error on another location, but how can I
find it? Or is this an error inside of valgrind?
Greets,
Christoph Bartoschek
|