-
Notifications
You must be signed in to change notification settings - Fork 6k
Fix data race in DartIsolateGroupData. #15949
Fix data race in DartIsolateGroupData. #15949
Conversation
This class is meant to be thread safe. In fact, its headerdoc statement on thread safety even mentions this. All fields on the class are readonly except the child isolate preparer. This field is set during VM instantiated isolate initialization. The VM may launch multiple isolate in the same isolate group on at the same time (each on a VM backed thread pool thread). Attempting to set the field without synchronization is a data race. Fixes flutter/flutter#49358 Fixes b/147798920
|
I believe this patch is necessary and sufficient to address the data race. I was having a chat with Jason about his hypothesis. I do not believe that proposal is thread-safe because the two threads could be racing to initialize the preparer and could have performed the get call and then simultaneously try to set the preparer leading to the exact same issue. However, both of us agree that the preparation routine is unnecessarily complicated (with the support for multiple kernel buffer mappings adding the most code complexity) and we are going to simplify the same. We also don't believe that the getter should ever be nullptr. So the entire thing should be simplified. Jason has volunteered to verify our hypothesis using logs while I am trying to preparing ASAN run to reproduce the race in unit-test. I want to put this patch out ASAP in case there are time constraints for having this fixed. |
|
LUCI is red because of a hot-fix patch. Will disregard that presubmit to get things going. |
flutter/engine@439a218...f10f03a git log 439a218..f10f03a --first-parent --oneline 2020-01-24 [email protected] Fix data race in DartIsolateGroupData. (flutter/engine#15949) 2020-01-23 [email protected] [fuchsia] Add LogSink to flutter_[jit & aot]_product_runner (flutter/engine#15697) 2020-01-23 [email protected] Do not produce timeline events in release mode (flutter/engine#15894) 2020-01-23 [email protected] Roll src/third_party/dart e84bea25df23..3eaae5405d37 (17 commits) (flutter/engine#15946) 2020-01-23 [email protected] Roll src/third_party/skia e4ddb8a7cddc..c88a3bc3f561 (24 commits) (flutter/engine#15945) 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
This class is meant to be thread safe. In fact, its headerdoc statement on thread safety even mentions this. All fields on the class are readonly except the child isolate preparer. This field is set during VM instantiated isolate initialization. The VM may launch multiple isolate in the same isolate group on at the same time (each on a VM backed thread pool thread). Attempting to set the field without synchronization is a data race. Fixes flutter/flutter#49358 Fixes b/147798920
This reverts commit 4ac8612.
This class is meant to be thread safe. In fact, its headerdoc statement on
thread safety even mentions this. All fields on the class are readonly except
the child isolate preparer. This field is set during VM instantiated isolate
initialization. The VM may launch multiple isolate in the same isolate group on
at the same time (each on a VM backed thread pool thread). Attempting to set the
field without synchronization is a data race.
Fixes flutter/flutter#49358
Fixes b/147798920