here is a test using <stdio.h> that illustrates a valgrind bug
that I think is related to the one we are seeing in libast::pathtemp()
it looks like valgrind may be getting confused by printf varargs
--
t.c
--
#include <stdio.h>
#include <string.h>
int main(int argc, char** argv)
{
char a[16];
char b[16];
strcpy(a, "0123456789abcd");
strcpy(b, "01.01");
printf("%s => %s\n", a, b);
return 0;
}
--
valgrind command and output
--
valgrind --tool=exp-sgcheck --trace-children=yes --read-var-info=yes
--num-callers=50 a.out
==24375== exp-sgcheck, a stack and global array overrun detector
==24375== NOTE: This is an Experimental-Class Valgrind Tool
==24375== Copyright (C) 2003-2011, and GNU GPL'd, by OpenWorks Ltd et al.
==24375== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==24375== Command: a.out
==24375==
==24375== Invalid read of size 1
==24375== at 0x4E6EF54: vfprintf (in /lib64/libc-2.11.3.so)
==24375== by 0x4E76329: printf (in /lib64/libc-2.11.3.so)
==24375== by 0x4005E1: main (t.c:11)
==24375== Address 0x7fefffda0 expected vs actual:
==24375== Expected: stack array "a" of size 16 in frame 2 back from here
==24375== Actual: stack array "b" of size 16 in frame 2 back from here
==24375== Actual: is 16 before Expected
==24375==
0123456789abcd => 01.01
==24375==
==24375== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers