-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Segmentation fault on MacOS with libomp 12.0.0 #7039
Comments
Just to be clear - when everything was paired down to these 40 some lines of code, the seg fault 11 was replaced with the dumping of source code to the screen. i.e. "warnings.warn(". This line of code has shifted up or down a couple of times.
We believe that this code leakage is what is producing the seg fault on our much more complex program located at |
The last work around we figured out was importing xgboost immediately on start clears out the macos seg fault 11 issue. Our program had it imported only as necessary very late in the execution cycle. |
We noticed it on github action test. Seems to be a bug in libomp: https://bugs.llvm.org/show_bug.cgi?id=50579
|
TY hopefully this will document the workarounds for the next folks to fall into this trap |
If anyone else runs into this issue, I have a Homebrew tap for |
Maintainers of libomp have notice this issue, but they cannot reproduce the crash with my provided information. I am thinking that maybe you can take a look at this thread and provide more useful information (than mine😢) Thank you |
My apologies, I don't have a mac device and cannot provide any further information. If anyone is watching this thread please assist the libomp maintainers. |
I have a really simple test harness that reproduces the segmentation fault at |
Hello everyone, I tested libomp 13.0.0 today on my Macbook Pro and I was able to run the example script without any segfault. I'll close this issue once I test libomp 13.0.0 in CI. Ps. Some findings:
|
Update: I ran into another segfault, this time using libomp 13.0.0. #7618 is hanging too. It appears that two different versions of libomp are being loaded in, one from Conda ( Stack trace:
The undefined behavior must have been going on for a while, but went unnoticed until now. |
I'm inclined to adopt the fix from scikit-learn/scikit-learn#22109. The idea is to bundle 11.1.0 version of libomp into the Python wheel. This solution is known to work in the presence of other packages (scikit-learn/scikit-learn#21227 (comment)), and it's battle-tested. In the long term, the Python community will need a robust method to keep only one copy of OpenMP runtime running (scikit-learn/scikit-learn#21227 (review)), but for now this workaround is good enough. |
some data point, my unit test shows me:
so I installed by |
The problem still seems to exist for Here is my solution (8 Jul 2022):
|
- if the numerical module is loaded before numpy, a segmentation fault is produced with EXC_BAD_ACCESS. - This is a known issue (see dmlc/xgboost#7039). - We fix this by loading numpy and then deleting it - in the future we need to look into why exactly this happens
The following code results in a Python segmentation fault when executed with Python 3.x on MacOS with libomp 12.0.0. Downgrading to a previous version of libomp solves it.
The text was updated successfully, but these errors were encountered: