Skip to content

Seems it's not working in the tbb task. #303

Open
@wendajiang

Description

@wendajiang

My sample code is like this:

#include <iostream>
#include "backward.hpp"
#include <oneapi/tbb.h>

int main() {
  backward::SignalHandling sh;

  int sum = oneapi::tbb::parallel_reduce(
      oneapi::tbb::blocked_range<int>(1,101), 0,
      [](oneapi::tbb::blocked_range<int> const& r, int init) -> int {
        for (int v = r.begin(); v != r.end(); v++) {
          init += v;
        }
        char *nn = nullptr;
        nn[3] = 'a';
        return init;
      },
      [](int lhs, int rhs) -> int {
        return lhs + rhs;
      }
  );

  printf("sum: %d\n", sum);


  std::cout << "hello\n";
  return 0;
}

Look at the code char *nn = nullptr; nn[3] = 'a'; And the backward-cpp can not output the stack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions