mirror of https://github.com/grpc/grpc.git
[exec-ctx] Remove ScopedTimeCache from ExecCtx on iOS (#34416)
Fix a crash on older iOS versions due to problematic thread-local variable initialization. See https://github.com/firebase/firebase-ios-sdk/issues/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 the `ExecCtx` class on iOS. This is a reasonable workaround because `ScopedTimeCache` 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.pull/34475/head
parent
fe70af228b
commit
df4c0c6325
1 changed files with 22 additions and 2 deletions
Loading…
Reference in new issue