This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Fix seg fault in libomptarget when using Info with multiple threads
ClosedPublic

Authored by jhuber6 on Feb 1 2021, 7:38 AM.

Details

Summary

One option for the LIBOMPTARGET_INFO environment variable is to print the current status of the device's data mappings. These are a shared resource among threads so this needs to be protected when using multiple streams.

Diff Detail

Event Timeline

jhuber6 created this revision.Feb 1 2021, 7:38 AM
jhuber6 requested review of this revision.Feb 1 2021, 7:38 AM
This revision is now accepted and ready to land.Feb 1 2021, 7:39 AM
This revision was landed with ongoing or failed builds.Feb 1 2021, 8:22 AM
This revision was automatically updated to reflect the committed changes.
JonChesterfield added inline comments.
openmp/libomptarget/src/private.h
112

Is this stuff built with exceptions disabled? Used to seeing unlock() called from destructors.

jhuber6 added inline comments.Feb 1 2021, 8:49 AM
openmp/libomptarget/src/private.h
112

This is the same thing that the Device type uses to protect the data mapping when it adds or removes something so I'm assuming it's compatible.

jdoerfert added inline comments.Feb 1 2021, 8:58 AM
openmp/libomptarget/src/private.h
112

I highly doubt the runtime can recover from exceptions right now anyway.