-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Bazel build broken on MacOS because of thread-local exec_ctx #13856
Comments
After discussing this with @yashykt : it seems similar in some ways to #13884 . I can confirm that if I manually change |
Also, it looks like the issue crops up only while linking which means that thread local support is not working for externally defined thread local variables on that version. |
Indeed, this is the only appearance of thread-local storage in any |
This appears to still be a problem in certain cases. Repro (on Mac):
This results in the same linker error as above. CC @vjpai |
Context: |
Because of this problem, we keep seeing |
Oh I didn't realize that I was assigned to this problem. I don't know the problem much so can you help me understand the problem? Is this something happening now? and is bazel build on the mac completely broken now because of this? |
The problem in short:
|
A few more observations:
@yashykt @vjpai would using C++11 |
That's a good suggestion @jtattermusch. I think using C++11 thread_local would be a good idea. |
@yashykt can you please comment more on the performance implications of using thread_local? (sounds like it could be slow when used in a shared library, see my comment above). Would we only use |
We have not focused any performance effort on MacOS, so we wouldn't be able to have concrete data for whether it will have a noticeable effect, but just based on the fear that dynamic initialization might be slower than static initialization, I don't think that matters to us since we mostly care about per-call performance. |
No. It was a build failure on Mac OS of exactly the sort mentioned in the original post here. They're seeing this problem with Bazel on Mac OS when pulling in gRPC Python (which is dynamically linked). It seems that the gcc TLS implementation is being picked instead of the pthread implementation. I've confirmed that switching to the pthread implementation fixes the problem. |
@gnossen Thanks! |
I made #24247 unifying TLS implementation across all platforms but it needs some changes on our supported platforms. It would take some time to bring all stakeholders on the same page. |
@veblush We are now using C++11 TLS on mac, and the problem we were experiencing under bazel was only for GCC_TLS. |
Please answer these questions before submitting your issue.
Should this be an issue in the gRPC issue tracker?
Yes, for tracking reasons
What version of gRPC and what language are you using?
1.9.0-dev
What operating system (Linux, Windows, …) and version?
MacOS
What runtime / compiler are you using (e.g. python version or version of gcc)
What did you do?
bazel build //:grpc
What did you expect to see?
Successful build as was possible before
exec_ctx
became a thread-local variableWhat did you see instead?
Anything else we should know about your project / environment?
A similar issue is reported (and unresolved) at tensorflow/serving#1 and other places in Github
The text was updated successfully, but these errors were encountered: