Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BuiltinLongJmpTest fails on PowerPC #185

Closed
ramosian-glider opened this issue Aug 31, 2015 · 7 comments
Closed

BuiltinLongJmpTest fails on PowerPC #185

ramosian-glider opened this issue Aug 31, 2015 · 7 comments

Comments

@ramosian-glider
Copy link
Member

Originally reported on Google Code with ID 185

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();
}

Reported by konstantin.s.serebryany on 2013-05-15 14:51:56

@ramosian-glider
Copy link
Member Author

http://llvm.org/viewvc/llvm-project?rev=181890&view=rev disables the test

Reported by konstantin.s.serebryany on 2013-05-15 15:02:18

@ramosian-glider
Copy link
Member Author

Reported by konstantin.s.serebryany on 2013-05-15 15:04:27

  • Labels added: Arch-PowerPC

@ramosian-glider
Copy link
Member Author

Same problem on ARM

Reported by rengolin on 2014-10-14 12:25:45

@ramosian-glider
Copy link
Member Author

http://comments.gmane.org/gmane.comp.compilers.llvm.devel/77695

Reported by rengolin on 2014-10-14 12:26:38

@ramosian-glider
Copy link
Member Author

Reported by ramosian.glider on 2015-07-30 09:05:31

  • Labels added: ProjectAddressSanitizer

@ramosian-glider
Copy link
Member Author

Adding Project:AddressSanitizer as part of GitHub migration.

Reported by ramosian.glider on 2015-07-30 09:06:55

@kcc
Copy link
Contributor

kcc commented Dec 1, 2015

Closing as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants