copypixelbuffer causes crash#10326
Conversation
chinmaygarde
left a comment
There was a problem hiding this comment.
This patch is not thread safe and I don't think we should land this. Admittedly, the FlutterTexture protocol is not documented and it is not apparent to the caller that the pixel buffer will be copied on an engine managed thread. Instead of changing the behavior now (and affecting all plugin code already written), it would be better to better document the same.
shell/common/shell.cc
Outdated
| } | ||
| }); | ||
| if (rasterizer_) { | ||
| if (auto* registry = rasterizer_->GetTextureRegistry()) { |
There was a problem hiding this comment.
The rasterizer and the texture registry is only safe to access on the GPU task runner. This call happens on the platform task runner. This is not thread safe.
There was a problem hiding this comment.
You are right, the patch is not thread safe. There is another solution, we can avoiding the object implementing FlutterTexture protocol to be released too early by simply retaining it in engine.
[email protected]:flutter/engine.git/compare/1d62160fdb2f...4a849e0 git log 1d62160..4a849e0 --no-merges --oneline 2019-10-08 [email protected] Color matrix doc (flutter/engine#12982) 2019-10-07 [email protected] Use the standard gen_snapshot target unless the platform requires host_targeting_host (flutter/engine#12988) 2019-10-07 [email protected] Roll src/third_party/dart 8413a0db0d..8ba6f7e2eb (39 commits) (flutter/engine#12981) 2019-10-07 [email protected] Unblock Fuchsia roll (flutter/engine#12977) 2019-10-06 [email protected] Update buildroot to pull in ubsan updates. (flutter/engine#12821) 2019-10-05 [email protected] Roll src/third_party/skia 95edac1c9a4a..4c82a9fc83a5 (13 commits) (flutter/engine#12818) 2019-10-05 [email protected] Enable sanitizer build variants. (flutter/engine#12816) 2019-10-05 [email protected] Revert "Adding Link SemanticsFlag (#12453)" (flutter/engine#12815) 2019-10-04 [email protected] Use the x64 host toolchain for x86 target gen_snapshot only on Linux (flutter/engine#12809) 2019-10-04 [email protected] add option for bulk-updating screenshots; update screenshots (flutter/engine#12797) 2019-10-04 [email protected] unbreak unopt fuchsia (flutter/engine#12805) 2019-10-04 [email protected] Build gen_snapshot with a 64-bit host toolchain even if the target platform is 32-bit (flutter/engine#12802) 2019-10-04 [email protected] [flutter_runner] a11y updates, tests! (flutter/engine#12380) 2019-10-04 [email protected] Fix crash in copypixelbuffer (flutter/engine#10326) 2019-10-04 [email protected] Roll src/third_party/dart d6c6d12ebf..8413a0db0d (2 commits) 2019-10-04 [email protected] Roll fuchsia/sdk/core/mac-amd64 from JyZWz... to kwa2O... (flutter/engine#12803) 2019-10-04 [email protected] Adding Link SemanticsFlag (flutter/engine#12453) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
[email protected]:flutter/engine.git/compare/1d62160fdb2f...4a849e0 git log 1d62160..4a849e0 --no-merges --oneline 2019-10-08 [email protected] Color matrix doc (flutter/engine#12982) 2019-10-07 [email protected] Use the standard gen_snapshot target unless the platform requires host_targeting_host (flutter/engine#12988) 2019-10-07 [email protected] Roll src/third_party/dart 8413a0db0d..8ba6f7e2eb (39 commits) (flutter/engine#12981) 2019-10-07 [email protected] Unblock Fuchsia roll (flutter/engine#12977) 2019-10-06 [email protected] Update buildroot to pull in ubsan updates. (flutter/engine#12821) 2019-10-05 [email protected] Roll src/third_party/skia 95edac1c9a4a..4c82a9fc83a5 (13 commits) (flutter/engine#12818) 2019-10-05 [email protected] Enable sanitizer build variants. (flutter/engine#12816) 2019-10-05 [email protected] Revert "Adding Link SemanticsFlag (flutter#12453)" (flutter/engine#12815) 2019-10-04 [email protected] Use the x64 host toolchain for x86 target gen_snapshot only on Linux (flutter/engine#12809) 2019-10-04 [email protected] add option for bulk-updating screenshots; update screenshots (flutter/engine#12797) 2019-10-04 [email protected] unbreak unopt fuchsia (flutter/engine#12805) 2019-10-04 [email protected] Build gen_snapshot with a 64-bit host toolchain even if the target platform is 32-bit (flutter/engine#12802) 2019-10-04 [email protected] [flutter_runner] a11y updates, tests! (flutter/engine#12380) 2019-10-04 [email protected] Fix crash in copypixelbuffer (flutter/engine#10326) 2019-10-04 [email protected] Roll src/third_party/dart d6c6d12ebf..8413a0db0d (2 commits) 2019-10-04 [email protected] Roll fuchsia/sdk/core/mac-amd64 from JyZWz... to kwa2O... (flutter/engine#12803) 2019-10-04 [email protected] Adding Link SemanticsFlag (flutter/engine#12453) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
UnregisterTextureandcopypixelbufferare called on different thread. It may cause crash when user callunregisterTextureand release registered object which implements FlutterTexture protocol on GPU thread while main thread is executing methodcopypixelbuffer. It would be better to call these functions on a same thread.