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

Core Dump When Using OpenMP on AWS Lambda #53955

Closed
stuartmcmahon-h3d opened this issue Feb 20, 2022 · 4 comments
Closed

Core Dump When Using OpenMP on AWS Lambda #53955

stuartmcmahon-h3d opened this issue Feb 20, 2022 · 4 comments
Assignees
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] openmp

Comments

@stuartmcmahon-h3d
Copy link

Since AWS Lambda does not support /dev/shm the OpenMP runtime causes a core dump. Output below:

OMP: Error #179: Function Can't open SHM2 failed:
OMP: System error #2: No such file or directory

To fix the issue we have to switch to an OpenMP runtime earlier than this commit:
changing OMP rtl to use shared memory instead of env variable

Could you please consider adding a runtime check for /dev/shm creation and add a fall back?

I see there is already a compile time switch to turn it off for Android, I would guess other embedded systems may have the same issue.

@EugeneZelenko EugeneZelenko added crash Prefer [crash-on-valid] or [crash-on-invalid] openmp and removed new issue labels Feb 20, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Feb 20, 2022

@llvm/issue-subscribers-openmp

@jdoerfert
Copy link
Member

@AndreyChurbanov WDYT, can we check and use a tmp folder in case it's not available?

@AndreyChurbanov
Copy link
Collaborator

can we check and use a tmp folder in case it's not available?
@jdoerfert I think you are right. This sound better than fallback to using (potentially unsafe) environment variable.
If nobody jumps in, I will work on a patch in a week or so.

@stuartmcmahon-h3d
Copy link
Author

/tmp is available on AWS Lambda so would definitely work for us.

If the intent of the startup & shutdown code is to handle openMP versioning then a long term solution may be to remove it and let clients handle versioning themselves. Though I realise that is not backwards compatible.

@shiltian shiltian self-assigned this Jan 19, 2023
CarlosAlbertoEnciso pushed a commit to SNSystems/llvm-debuginfo-analyzer that referenced this issue Jan 25, 2023
When `libomp` is initialized, it creates a temp file in `/dev/shm` to store
registration flag. Some systems, like Android, don't have `/dev/shm`, then this
feature is disabled by the macro `KMP_USE_SHM`, though most Linux distributions
have that. However, some customized distribution, such as the one reported in
llvm/llvm-project#53955, doesn't support it either.
It causes a core dump. In this patch, if it is the case, we will try to create a
temporary file in `/tmp`, and if it still doesn't make it, then we error out.
Note that we don't consider in this patch if the temporary directory has been
set to `TMPDIR` in this patch. If `/tmp` is not accessible, we error out.

Fix #53955.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D142175
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] openmp
Projects
None yet
Development

No branches or pull requests

6 participants