Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenMP] Cannot ship libomp.dylib on a sandboxed macOS app #80165

Open
bvoq opened this issue Jan 31, 2024 · 3 comments
Open

[OpenMP] Cannot ship libomp.dylib on a sandboxed macOS app #80165

bvoq opened this issue Jan 31, 2024 · 3 comments

Comments

@bvoq
Copy link

bvoq commented Jan 31, 2024

My application runs fine with XCode and a self linked version of libomp.dylib (openmp) 17.0.6.
However, as soon as I enable the Sandbox on my macOS application the application throws (most likely because shared memory is unavailable).

Here is the exact error:

OMP: Error #179: Function Can't open TEMP failed:
OMP: System error #1: Operation not permitted
Assertion failure at kmp_runtime.cpp(6891): temp_reg_status_file_name.
OMP: Error #13: Assertion failure at kmp_runtime.cpp(6891).

Referencing this part of the code: https://github.com/llvm/llvm-project/blob/llvmorg-17.0.6/openmp/runtime/src/kmp_runtime.cpp#L6884-L6906

Has anyone tried shipping openmp with sandbox enabled and has found a workaround for this?

image
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 31, 2024

@llvm/issue-subscribers-openmp

Author: Kevin De Keyser (bvoq)

My application runs fine with XCode and a self linked version of libomp.dylib (openmp) 17.0.6. However, as soon as I enable the Sandbox on my macOS application the application throws (most likely because shared memory is unavailable).

Here is the exact error:

OMP: Error #<!-- -->179: Function Can't open TEMP failed:
OMP: System error #<!-- -->1: Operation not permitted
Assertion failure at kmp_runtime.cpp(6891): temp_reg_status_file_name.
OMP: Error #<!-- -->13: Assertion failure at kmp_runtime.cpp(6891).

Referencing this part of the code: https://github.com/llvm/llvm-project/blob/llvmorg-17.0.6/openmp/runtime/src/kmp_runtime.cpp#L6884-L6906

Has anyone tried shipping openmp with sandbox enabled and has found a workaround for this?

<img width="571" alt="image" src="https://github.com/llvm/llvm-project/assets/3169217/3c27dd91-cb22-427a-91f2-6de75356d803">

@shiltian shiltian changed the title Cannot ship openmp (libomp.dylib) on a sandboxed macOS app [OpenMP] Cannot ship libomp.dylib on a sandboxed macOS app Jan 31, 2024
@bvoq
Copy link
Author

bvoq commented Feb 1, 2024

For what it's worth, enabling hardened runtime support does work except for the Executable Memory Protection:
image

@shiltian
Copy link
Contributor

Probably we need to use some macOS specific APIs to create temp file here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants