-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[exec-ctx] Remove ScopedTimeCache from ExecCtx on iOS #34416
[exec-ctx] Remove ScopedTimeCache from ExecCtx on iOS #34416
Conversation
I don't have permissions to access the kokoro test results. Would you be able to give me access to the GCP project so I can view the test results? |
@dconeybe Thanks so much for working on this! I've seeing 2 failures right now but they don't really seem related to your change. (I don't know how to get your GCP access.. I think maybe you have to part of the grpc "organization" to see it? But i'm not sure i can add you to it.. @ctiller FYI in case you have an idea here :)) There is a merge conflict now though so you probably need to rebase your PR. I'll run the tests for you again and we can probably merge it if the tests seem non-related to this. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving an LGTM here and letting Eryu sort out any build/test issues.
Also noting that I'm ok with the ifdef mess here primarily because we're planning on removing ExecCtx in the medium term - otherwise I'd be hoping we could find a cleaner approach.
Thank you for the review, @ctiller. I completely agree that the |
LGTM, Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks everyone!!
I've enabled auto merge and hope it'll be merged soon! 😃
Fix a crash on older iOS versions due to problematic thread-local variable initialization.
See firebase/firebase-ios-sdk#11509
Basically, there appears to be a bug in Xcode where it generates assembly for thread-local variable initialization that is susceptible to a crash. For example, on arm64 the generated assembly relies on registers like x8 and x10 being preserved by the thread-local variable initialization routine; however, in some cases this thread-local variable initialization calls functions like
ImageLoaderMachOCompressed::doBindFastLazySymbol
which clobber these registers, leaving their values indeterminate when the caller resumes. When those indeterminate values are later used as memory addresses they are invalid and result in a crash.This PR works around this bug by removing the
ScopedTimeCache
member variable from theExecCtx
class on iOS. This is a reasonable workaround becauseScopedTimeCache
is only a slight optimization for data centers that entirely doesn't matter for mobile.See https://github.com/dconeybe/TlsCrashIos12 for a demo of this crash.
Googlers see b/300501963 for full details.