[Bug sanitizer/55739] New: asan doesn't work on common symbols

hjl.tools at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Dec 19 13:20:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55739

             Bug #: 55739
           Summary: asan doesn't work on common symbols
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hjl.tools@gmail.com
                CC: dodji@gcc.gnu.org, dvyukov@gcc.gnu.org,
                    jakub@gcc.gnu.org, kcc@gcc.gnu.org


[hjl@gnu-6 bound-1]$ cat c.c
#include <stdio.h>

int c[30];

void
foo (int a[])
{
  printf ("10: %d\n", a[10]);
}
[hjl@gnu-6 bound-1]$ cat m.c
#include <stdio.h>

extern int c[];

void foo (int []);

int
main ()
{
  c[30] = 1;
  foo (c);
  printf ("30: %d\n", c[30]);
  return 0;
}
[hjl@gnu-6 bound-1]$ make
/export/build/gnu/gcc/build-x86_64-linux/gcc/../../release/usr/gcc-4.8.0/bin/gcc
-fsanitize=address -O -static-libasan   -c -o m.o m.c
/export/build/gnu/gcc/build-x86_64-linux/gcc/../../release/usr/gcc-4.8.0/bin/gcc
-fsanitize=address -O -static-libasan   -c -o c.o c.c
/export/build/gnu/gcc/build-x86_64-linux/gcc/../../release/usr/gcc-4.8.0/bin/gcc
-fsanitize=address -O -static-libasan -o x m.o c.o
./x
10: 0
30: 1
[hjl@gnu-6 bound-1]$



More information about the Gcc-bugs mailing list