attestationd: stopping leads to crash |
||||||
Issue descriptionStopping attestationd leads to: CRIT attestationd[1953]: Check failed: origin_thread_id_ == base::PlatformThread::CurrentId() (1993 vs. 1953)#012/usr/lib64/libbase-core-395517.so(base::debug::StackTrace::StackTrace()+0x13) [0x795b96a29d63]#012
,
Jan 25 2017
The reason is default_tpm_utility_->Initialize() is called from AttestationService::InitializeTask() on worker_thread. Inside it creates tpm_manager_thread_, trunks_utility_, etc. These objects are destroyed in AttestationService::~AttestationService(), which is called on different thread - main dbus thread.
,
Jan 25 2017
Bottomline: need to move initialization from worker thread to the thread that calls Initialize().
,
Feb 18 2017
The following revision refers to this bug: https://chromium.googlesource.com/aosp/platform/system/tpm/+/6bc0da49ff76fbf33d8aad11b617667f33871801 commit 6bc0da49ff76fbf33d8aad11b617667f33871801 Author: Andrey Pronin <apronin@chromium.org> Date: Sat Feb 18 11:11:01 2017 attestation: fix shutdown for dbus threads Objects that communicate with trunksd and tpm_managerd over D-Bus must be destroyed on the same thread that initialized them. Their destructors call dbus::Bus::ShutdownAndBlock(), which require that they are called on the same thread that created dbus::Bus objects. That applies to: - tpm_manager::TpmOwnershipDBusProxy; - tpm_manager::TpmNvramDBusProxy; - trunks::TrunksDBusProxy (destructed in trunks::~TrunksFactoryImpl, in turn called from attestation::~TpmUtilityV2). Destruct such objects in CleanUp() hooks of the threads that created them. Doing it in these hooks, rather than posting a special shutdown task to that thread from the owning object destructor, ensures that these objects are not destructed while there are tasks left in the thread's message queue that might access the destructed objects. BUG= chromium:684269 TEST=Login, corp enrollment still succeeds. Unit tests pass. "stop attestationd" doesn't lead to a crash. Change-Id: I2576eb4cf8260092adb4d54cb3aeb5f662e85010 Reviewed-on: https://chromium-review.googlesource.com/444213 Commit-Ready: Andrey Pronin <apronin@chromium.org> Tested-by: Andrey Pronin <apronin@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> [modify] https://crrev.com/6bc0da49ff76fbf33d8aad11b617667f33871801/attestation/server/attestation_service.cc [modify] https://crrev.com/6bc0da49ff76fbf33d8aad11b617667f33871801/attestation/common/tpm_utility_v2.h [modify] https://crrev.com/6bc0da49ff76fbf33d8aad11b617667f33871801/attestation/server/attestation_service.h [modify] https://crrev.com/6bc0da49ff76fbf33d8aad11b617667f33871801/attestation/common/tpm_utility_v2.cc
,
Mar 1 2017
,
Apr 17 2017
,
May 30 2017
,
Aug 1 2017
,
Oct 14 2017
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by apronin@chromium.org
, Jan 25 2017