trunksd crashes during reboot |
|||
Issue descriptionDuring reboot trunksd crashes inside ~BackgroundCommandTransceiver(). It seems to happen when destroying WeakPtrFactory. The background thread at this point still runs through the message loop, and can be holding the WeakPointer to the transceiver. So, it will crash when invalidating the owner in the factory destructor, since the weak pointers must be invalidated from the same thread that acquired them. The likely fix is calling Thread::Stop for the background thread before destroying objects created by the main thread. The current destruction order is: - PowerManager - BackgroundCommandTransceiver - ResourceManager - TrunksFactoryImpl - and only then background thread. If one of these objects is accessed from a still running background thread during shutdown that may cause a crash. It is possible that in other cases (https://crbug.com/752811), the thread may crash on accessing ResourceManager instead of freeing the BackgroundCommandTransceiver.
,
Aug 22 2017
,
Sep 15 2017
The following revision refers to this bug: https://chromium.googlesource.com/aosp/platform/system/tpm/+/3964508230c148f65a5a3369e266a843af972baa commit 3964508230c148f65a5a3369e266a843af972baa Author: Andrey Pronin <apronin@chromium.org> Date: Fri Sep 15 01:24:01 2017 trunks: Stop background thread when exiting trunksd The background thread may access and holds references to BackgroundCommandTransceiver, ResourceManager and other objects, created by the main thread. Stop the background thread before these objects are destroyed when the daemon exits. BUG= chromium:754813 BUG=chromium:752811 TEST=reboot without trunksd coredump in /var/spool/crash Change-Id: I0ed0a2a6853114066a683ae6be977dcc977b4c34 Reviewed-on: https://chromium-review.googlesource.com/612265 Commit-Ready: Andrey Pronin <apronin@chromium.org> Tested-by: Andrey Pronin <apronin@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> (cherry picked from commit f5b51caa68658f1b5983d8de206775be46fe166a) [modify] https://crrev.com/3964508230c148f65a5a3369e266a843af972baa/trunks/trunksd.cc
,
Jan 2 2018
Issue 752812 has been merged into this issue. |
|||
►
Sign in to add a comment |
|||
Comment 1 by bugdroid1@chromium.org
, Aug 22 2017