steleman / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

BuiltinLongJmpTest fails on PowerPC #185

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
For yet unknown reason BuiltinLongJmpTest from asan test suite fails on 
PowerPC. 
This is a very minor issue so I'll just disable this test on PowerPC for now. 

Repro: 
% clang -fsanitize=address  ~/tmp/__builtin_longjmp.cc ; ./a.out 
main
ASAN:SIGSEGV
=================================================================
==30905==ERROR: AddressSanitizer: SEGV on unknown address 0x0fff00000000 (pc 
0x0fffb43fd254 sp 0x0fffd1011fe0 bp 0x0fffd1013048 T0)
AddressSanitizer can not provide additional info.
Segmentation fault

#include <setjmp.h>
#include <stdio.h>

int *Ident(int *a) { return a; }

void BuiltinLongJmpFunc1(jmp_buf buf) {
  // create three red zones for these two stack objects.
  int a;
  int b;

  int *A = Ident(&a);
  int *B = Ident(&b);
  *A = *B;
  __builtin_longjmp((void**)buf, 1);
}

void TouchStackFunc() {
  int a[100];  // long array will intersect with redzones from LongJmpFunc1.
  int *A = Ident(a);
  for (int i = 0; i < 100; i++)
    A[i] = i*i;
}

void test() {
  static jmp_buf buf;
  if (!__builtin_setjmp((void**)buf)) {
    fprintf(stderr, "foo\n");
    BuiltinLongJmpFunc1(buf);
  } else {
    TouchStackFunc();
    fprintf(stderr, "bar\n");
  }
}

int main() {
  fprintf(stderr, "main\n");
  test();
}

Original issue reported on code.google.com by konstant...@gmail.com on 15 May 2013 at 2:51

GoogleCodeExporter commented 9 years ago
http://llvm.org/viewvc/llvm-project?rev=181890&view=rev disables the test

Original comment by konstant...@gmail.com on 15 May 2013 at 3:02

GoogleCodeExporter commented 9 years ago

Original comment by konstant...@gmail.com on 15 May 2013 at 3:04

GoogleCodeExporter commented 9 years ago
Same problem on ARM

Original comment by rengo...@gmail.com on 14 Oct 2014 at 12:25

GoogleCodeExporter commented 9 years ago
http://comments.gmane.org/gmane.comp.compilers.llvm.devel/77695

Original comment by rengo...@gmail.com on 14 Oct 2014 at 12:26