[Bug 852760]

Kamil Dudka 852760 at bugs.launchpad.net
Sun Aug 5 13:34:21 UTC 2012


(In reply to comment #15)
Try to rebuild the library with -fno-builtin-strdup, chances are it will make valgrind working again.

-- 
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:
  New
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/valgrind/+bug/852760/+subscriptions




More information about the foundations-bugs mailing list