[Bug 852760] Re: valgrind false positives on gcc-generated string routines
Bug Watch Updater
852760 at bugs.launchpad.net
Sat Sep 17 19:16:45 UTC 2011
** Changed in: valgrind (ALT Linux)
Status: Unknown => New
** Changed in: valgrind (ALT Linux)
Importance: Unknown => Medium
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to valgrind in Ubuntu.
https://bugs.launchpad.net/bugs/852760
Title:
valgrind false positives on gcc-generated string routines
Status in “valgrind” package in Ubuntu:
New
Status in “valgrind” package in ALT Linux:
New
Status in “valgrind” package in Fedora:
Unknown
Bug description:
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
main()
{
char *a = malloc(1);
a[0] = '\0';
printf("%lu\n", (unsigned long)strlen(a));
}
Compile with "gcc -O2" and run valgrind.
==5977== Invalid read of size 4
==5977== at 0x400494: main (x.c:9)
==5977== Address 0x51ce040 is 0 bytes inside a block of size 1 alloc'd
==5977== at 0x4C28F9F: malloc (vg_replace_malloc.c:236)
==5977== by 0x40048D: main (x.c:7)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/valgrind/+bug/852760/+subscriptions
More information about the foundations-bugs
mailing list