Problem with vector and cilk_spawn

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



      Dear all,

It seems that there is a problem with dynamic allocation and cilk_spawn. The
following code fails randomly with GCC-6 and GCC-7 (it fails with ICE on
GCC-5). It works without any problems on one core machine. Some times it works
perfectly, some times it segfault. I also had some double free failure.

I don't know have any idea on how to get it down to a shorter code or to debug
it. Any suggestion ? Should I just report the bug ?

Best,

Florent Hivert


#include <vector>
#include <cilk/cilk.h>

void walk(std::vector<int> v, unsigned size) {
  if (v.size() < size)
    for (int i=0; i<8; i++) {
      std::vector<int> vnew(v);
      vnew.push_back(i);
      cilk_spawn walk(vnew, size);
    }
}

int main(int argc, char **argv) {
  std::vector<int> v{};
  walk(v, 5);
}



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux