Fixed init-order-fiasco for static slice table.#20052
Conversation
|
Specific change: since we cannot be certain of the ordering of global object initialization across compilation units, it is dangerous to define the static slice table globally. Instead, we use the static-function variable method which is guaranteed to initialize the table before the first access. |
|
Does this fix #19819? |
|
There seem to be a lot of failures |
Fixed, that's because of stuff in test/ that I didn't convert over. |
|
@AspirinSJL I haven't tested it on mac, but Linux has the exact same failure and I just confirmed that this fixes the issue on Linux. My guess is that it will fix the mac issue as well |
|
I'll review when the contents of |
|
Hmm, so actually this will break since this kind of static initialization appears to need libstdc++. Let me see if there are any alternatives... |
|
|
Fixes init-order bug affecting grpc#19819 which was first exposed by this commit: grpc@857375a
7b98c04 to
2767acc
Compare

Fixes init-order bug affecting #19819 which
was first exposed by this commit:
857375a
fix #19819