Official builds: Remove static initializer in WelsThreadPool.cpp |
|||||||||
Issue descriptionIn a936b74d7db7335d0cfe10b506d79a508c21f0be, we had to increase the static initializer expectation count. This should always be 0 (no static initializers), but a regression likely slipped in due to the super-legacy way the script was run (c.f. issue 572393). I symbolized the static initializer on the bot: $ ./tools/mac/show_mod_init_func.py out/Release/Google\ Chrome\ Framework.framework/Google\ Chrome\ Framework out/Release/Google Chrome Framework.framework/Google Chrome Framework 0x00000000004b8990 @ 0x004b8990 (in Google Chrome Framework) + 0 $ atos -o ./out/Release/Google\ Chrome\ Framework.dSYM/Contents/Resources/DWARF/Google\ Chrome\ Framework 0x004b8990 _GLOBAL__sub_I_WelsThreadPool.cpp (in Google Chrome Framework) (WelsThreadPool.cpp:0) And it is likely from this static variable: https://cs.chromium.org/chromium/src/third_party/openh264/src/codec/common/inc/WelsThreadPool.h?l=103&rcl=3b51f16a4a41df729f8d647f03e48c5f272911ff https://cs.chromium.org/chromium/src/third_party/openh264/src/codec/common/src/WelsThreadPool.cpp?l=47&rcl=3b51f16a4a41df729f8d647f03e48c5f272911ff My guess is that the script was probably never doing the right thing on the Google Chrome bot (where the SI shows up), and on the Chromium bot that was working correctly, OpenH264 is not compiled. We should remove this static initializer and change the expectation count back to 0.
,
Oct 12
This is a third_party library not Google-owned, I'm not sure we want to make contributions to https://github.com/cisco/openh264 or maintain our own fork for the sake of a couple of static initializers? Reassigned to OpenH264 person.
,
Oct 12
To be clear: Getting rid of this static initializer is important. We have a strict policy of not allowing regressions in number of static initializers, we've delayed feature launches because they brought in libs using static initializers, and we've been at 0 static initializers on mac for like 6 years. So please don't call this "a couple of static initializers" and please fix it as soon as possible. In general, contributing patches upstream has a lower long-term cost, so if that's possible that's what I'd recommend. If it isn't, we need to carry a downstream patch.
,
Oct 12
I've created a pull request for OpenH264: https://github.com/cisco/openh264/pull/3029 In the past, they've accepted my pull request within a day so I hope that they can accept this one.
,
Oct 12
Awesome, thanks! https://github.com/cisco/openh264/pull/3029/files -- CWelsLock& GetInitLock() { static CWelsLock initLock; return initLock; } This fixes the static ctor, but still creates an exit-time dtor. Maybe `static CWelsLock *initLock = new CWelsLock; return *initLock;` is better?
,
Oct 12
> This fixes the static ctor, but still creates an exit-time dtor. Maybe `static CWelsLock *initLock = new CWelsLock; return *initLock;` is better? Done! forgot about that
,
Oct 15
Thanks for taking this on, I appreciate it.
,
Oct 22
Since this isn't merged yet, can we carry this as downstream diff?
,
Oct 22
,
Oct 22
Over to sprang@ for c#8
,
Oct 23
spang: Ping. This causes SI expectations to be different for official and regular builds, which makes many things very confusing. Let's get this fixed, please.
,
Oct 23
*sprang: ...
,
Oct 23
I have no idea if we can add a downstream diff to this. We're pulling from the github repo right? Do we even have a standard way of adding patches on top of that? How long does it typically take to have a change such as this merged? I think just waiting for that and rolling the openh264 version is easier. I'm not an owner of this component and not a even a chrome committer, so if you want this resolved very quickly this should probably be reassigned.
,
Oct 23
Who owns OpenH264 in chrome? what do we do when we need to quickly patch security issues?
,
Oct 24
hbos@ you'r at least in the OWNERS list. Do you know how patching would work?
,
Oct 30
I don't know how it works, I haven't touched this in several years and we've never maintained our own patches. Maybe ask chromium-third-party@google.com?
,
Oct 30
chromium-third-party is for legal reviews as far as I know (?) +mflodman, the other entry in third_party/openh264/OWNERS. Do you know anything about how we handle security patches to openh264?
,
Oct 30
Might want to hold off on patching for now since it looks like this might be getting merged upstream soon: https://github.com/cisco/openh264/pull/3029#issuecomment-434301344
,
Oct 31
Re #17 No, hbos has been the main person dealing with this from our side. AFAIK we haven't handled any security patches until know.
,
Nov 29
I was finally able to reach someone who could merge the pull request. What's the next step? Rolling openh264?
,
Nov 29
I'll send out a roll CL soon
,
Nov 29
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f688af0a875cd329bc64fd38099ec429eb6caf80 commit f688af0a875cd329bc64fd38099ec429eb6caf80 Author: Tom Anderson <thomasanderson@chromium.org> Date: Thu Nov 29 23:45:22 2018 Roll openh264 to 6f26bce Changelog https://chromium.googlesource.com/external/github.com/cisco/openh264/+log/3b51f16a4a41df729f8d647f03e48c5f272911ff..6f26bce0b1c4e8ce0e13332f7c0083788def5fdf BUG= 893594 TBR=mflodman,hbos Change-Id: I15409f2d1671f23fb785d63f1d3b2f1b0d4b5316 Reviewed-on: https://chromium-review.googlesource.com/c/1355253 Reviewed-by: Thomas Anderson <thomasanderson@chromium.org> Commit-Queue: Thomas Anderson <thomasanderson@chromium.org> Cr-Commit-Position: refs/heads/master@{#612440} [modify] https://crrev.com/f688af0a875cd329bc64fd38099ec429eb6caf80/DEPS [modify] https://crrev.com/f688af0a875cd329bc64fd38099ec429eb6caf80/third_party/openh264/README.chromium
,
Nov 30
Cool. Now we only need to lower static initializer expectations by 1 and this is all done, right?
,
Nov 30
,
Nov 30
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/28cb5d154f7dc3d4027ded9b7c09c6c6b6c998d7 commit 28cb5d154f7dc3d4027ded9b7c09c6c6b6c998d7 Author: Robert Sesek <rsesek@chromium.org> Date: Fri Nov 30 18:48:00 2018 Decrease the expected number of static initializers by 1. This brings EXPECTED_MAC_SI_COUNT back to 0, and reduces the number in Linux by 1. The SI in WelsThreadPool.cpp was removed. Bug: 893594 Change-Id: I6fc03be4b104a5f8afc4c2be1cebce36d322d116 Reviewed-on: https://chromium-review.googlesource.com/c/1356868 Reviewed-by: Dirk Pranke <dpranke@chromium.org> Commit-Queue: Robert Sesek <rsesek@chromium.org> Cr-Commit-Position: refs/heads/master@{#612709} [modify] https://crrev.com/28cb5d154f7dc3d4027ded9b7c09c6c6b6c998d7/infra/scripts/legacy/scripts/slave/chromium/sizes.py
,
Nov 30
,
Nov 30
Thanks for the team effort on this! https://logs.chromium.org/logs/chromium/bb/chromium.chrome/Google_Chrome_Mac/39233/+/recipes/steps/sizes/0/stdout |
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by thestig@chromium.org
, Oct 9