commit | cd573482b86b0ce3476e8e5ee777a7f6d271988d | [log] [tgz] |
---|---|---|
author | Chris Bracken <chris@bracken.jp> | Wed Jun 19 02:08:17 2019 +0000 |
committer | CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> | Wed Jun 19 02:08:17 2019 +0000 |
tree | a33685c20dfc8a89b655df48ff4c68015623a188 | |
parent | 1ceca7f6ab8989ef94ace501519e32c7c5a88337 [diff] |
[flutter] Re-enable unhandled error reporting This re-enables unhandled Dart error handling in Flutter applications, which was removed in a76b958. The error handling as originally landed was unsafe. Specifically, in the case where the unhandled error handler was triggered during shutdown, there was a race condition which could cause a crash in the following scenario: 1. Runner::OnApplicationTerminate() is triggered, which posts a task to the application's platform thread will free the Application instance and terminate the platform thread. 2. Before that task is serviced, the unhandled error handler is called (by hooks.dart -> window.cc -> ui_dart_state.cc) on the UI thread. 3. The kill task is serviced and the Application dtor and Thread::Quit() are called, terminating the platform thread. 4. The unhandled error handler attempts to post a task to the platform thread, whose thread was killed in step 3. This triggers a crash. Fixing this requires a mechanism for the message loop to know that the associated thread has been terminated out from under it. This patch adds mitigation for this scenario, but remains non-threadsafe/racy. We pass the unhandled error handler a weak pointer to the Application and check it before posting a task to the platform thread. This has two issues: 1. WeakPtr isn't threadsafe, and assumes that all operations occur on a single thread. We're checking its value (which is mutated on the platform thread) on the UI thread without synchronization. 2. Even with a guarantee that the WeakPtr state were synchronized, there's a window between when we check the weak pointer and when we post to the platform thread in which application shutdown and thread destruction may occur. This unsafe mitigation is being landed in order to unblock a high priority bug (FL-256) on a short schedule, and a proper refactoring will be required to make this properly threadsafe. Change-Id: If60d1d3ca5799d82597f8a3acc4ddd3871058972
Topaz augments system functionality by implementing interfaces defined by underlying layers. Topaz contains four major categories of software: modules, agents, shells, and runners.
For example, modules include the dashboard, and runners include the Web, Dart, and Flutter runners.
Looking for something that used to be in this repository? The list below provides a code location and sha that can be used to checkout dead code that has been removed. Please note, it is unlikely the code will build or work correctly shas are provided for reference only. Code can be checked out with:
git checkout <sha> -- $FUCHSIA_DIR/<location>