PRUNERS / archer

Archer, a data race detection tool for large OpenMP applications
https://pruners.github.io/archer
Apache License 2.0
62 stars 13 forks source link

Segmentation fault with OpenMP reduction #22

Closed peihunglin closed 7 years ago

peihunglin commented 7 years ago

For Archer using openmp/towards_tr4 and archer/towards_tr4, we encounter segmentation fault frequently with OpenMP reduction. The segmentation fault would show up when using more than 4 OpenMP threads in the testing.

dongahn commented 7 years ago

@peihunglin: thank you for reporting this. Do you actually have a reproducer? We probably want to put that into our CI testing.

peihunglin commented 7 years ago

One of the test is like the following and the test platform is Intel(R) Xeon(R) CPU E5-2699 v3:

#define num_steps 2000000000

int main(int argc, char** argv)
{
  double pi = 0;
  int i;
#pragma omp parallel for reduction(+:pi)
  for (i = 0; i < num_steps; i++) {
    pi += 1.0 / (i * 4.0 + 1.0);
  }
  pi = pi * 4.0;
  return 0;
}
jprotze commented 7 years ago

@peihunglin: thanks for reporting the issue and the reproducer. This issue is now fixed in OpenMPToolsInterface/LLVM-openmp@d081872ea4764a72f5955b8fd11513b5c3522f8d