Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Issue 2743493003: [Device Sensors] Fix crash on shutdown (Closed)

Created:
3 years, 9 months ago by blundell
Modified:
3 years, 9 months ago
Reviewers:
timvolodine
CC:
chromium-reviews, riju_, timvolodine, mlamouri+watch-sensors_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Device Sensors] Fix crash on shutdown DataFetcherSharedMemoryBase has a thread to which it posts tasks. It currently stops this thread in its destructor. However, this behavior is problematic: the tasks call pure virtual methods of DataFetcherSharedMemoryBase, and stopping the thread ensures that all pending tasks are run. The combination of these facts mean that code gets run in the DataFetcherSharedMemoryBase that calls pure virtual methods of that class, which naturally causes crashes (as the subclass' vtable has been torn down at that point). This CL fixes the problem by stopping the thread in DataFetcherSharedMemoryBase::Shutdown(), at which point the subclass instance is guaranteed to still be alive. BUG=699496 Review-Url: https://codereview.chromium.org/2743493003 Cr-Commit-Position: refs/heads/master@{#455797} Committed: https://chromium.googlesource.com/chromium/src/+/55462c0bffc90caf9c5e11bdd6a5d611f187330d

Patch Set 1 #

Patch Set 2 : nits #

Patch Set 3 : Fix unittest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -4 lines) Patch
M device/sensors/data_fetcher_shared_memory_base.cc View 1 2 chunks +11 lines, -3 lines 0 comments Download
M device/sensors/data_fetcher_shared_memory_base_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 16 (12 generated)
blundell
3 years, 9 months ago (2017-03-09 16:31:41 UTC) #10
timvolodine
Yes most definitely, thanks for fixing this. How embarrassing, calling pure virtuals from destructors is ...
3 years, 9 months ago (2017-03-09 18:19:23 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2743493003/40001
3 years, 9 months ago (2017-03-09 18:22:01 UTC) #13
commit-bot: I haz the power
3 years, 9 months ago (2017-03-09 18:27:02 UTC) #16
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/55462c0bffc90caf9c5e11bdd6a5...

Powered by Google App Engine
This is Rietveld 408576698