This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Fix releasing of stack memory
ClosedPublic

Authored by protze.joachim on Jul 23 2020, 4:10 PM.

Details

Summary

Starting with 787eb0c637b I got spurious segmentation faults for some testcases. I could nail it down to brel trying to release the "memory" of the node allocated on the stack of __kmpc_omp_wait_deps. With this patch, you will see the assertion triggering for some of the tests in the test suite.

My proposed solution for the issue is to just patch __kmpc_omp_wait_deps:

  __kmp_init_node(&node);
-  node.dn.on_stack = 1;
+  // the stack owns the node
+  __kmp_node_ref(&node);

What do you think?

Diff Detail

Event Timeline

protze.joachim created this revision.Jul 23 2020, 4:10 PM
Herald added a project: Restricted Project. · View Herald Transcript

After harbormaster highlighted the issue, this is the patch to solve the issue.

This revision is now accepted and ready to land.Aug 5 2020, 11:44 AM
This revision was automatically updated to reflect the committed changes.