New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 750391 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[Chromecast] DCHECK GetKeyStorage () at ../../components/os_crypt/os_crypt_linux.cc:71

Project Member Reported by mbjorge@chromium.org, Jul 29 2017

Issue description

#0  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47
#1  0xb218cde4 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#2  0xb218dd56 in __GI_abort () at abort.c:89
#3  0xb4a35972 in base::debug::BreakDebugger() () at ../../base/debug/debugger_posix.cc:258
#4  0xb4a46d86 in ~LogMessage () at ../../base/logging.cc:784
#5  0xb5b8d8e0 in GetKeyStorage () at ../../components/os_crypt/os_crypt_linux.cc:71
#6  0xb5b8d9b4 in GetPasswordV11 () at ../../components/os_crypt/os_crypt_linux.cc:98
#7  0xb5b8d7b2 in GetEncryptionKey () at ../../components/os_crypt/os_crypt_linux.cc:118
#8  0xb5b8d542 in EncryptString () at ../../components/os_crypt/os_crypt_linux.cc:163
#9  0xb5b972f0 in SetDeviceCredentials () at ../../google_apis/gcm/engine/gcm_store_impl.cc:441
#10 0xb5b9c9f8 in Invoke<const scoped_refptr<gcm::GCMStoreImpl::Backend> &, const unsigned long long &, const unsigned long long &, const base::Callback<void (bool), base::internal::CopyMode::Copyable, base::internal::RepeatMode::Repeating> &>(void) () at ../../base/bind_internal.h:209
#11 0xb5b9c9ce in void base::internal::InvokeHelper<false, void>::MakeItSo<void (gcm::GCMStoreImpl::Backend::* const&)(unsigned long long, unsigned long long, base::Callback<void (bool), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&), scoped_refptr<gcm::GCMStoreImpl::Backend> const&, unsigned long long const&, unsigned long long const&, base::Callback<void (bool), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&>(void (gcm::GCMStoreImpl::Backend::* const&)(unsigned long long, unsigned long long, base::Callback<void (bool), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&), scoped_refptr<gcm::GCMStoreImpl::Backend> const&, unsigned long long const&, unsigned long long const&, base::Callback<void (bool), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) () at ../../base/bind_internal.h:275
#12 0xb5b9c9b2 in RunImpl<void (gcm::GCMStoreImpl::Backend::*const &)(unsigned long long, unsigned long long, const base::Callback<void (bool), base::internal::CopyMode::Copyable, base::internal::RepeatMode::Repeating> &), const std::__1::tuple<scoped_refptr<gcm::GCMStoreImpl::Backend>, unsigned long long, unsigned long long, base::Callback<void (bool), base::internal::CopyMode::Copyable, base::internal::RepeatMode::Repeating> > &, 0, 1, 2, 3>(void) () at ../../base/bind_internal.h:351
#13 0xb4aad43c in Run () at ../../base/callback.h:91
#14 RunTask () at ../../base/debug/task_annotator.cc:59
#15 0xb4a4d448 in RunTask () at ../../base/message_loop/message_loop.cc:422
#16 0xb4a4d828 in DeferOrRunPendingTask () at ../../base/message_loop/message_loop.cc:433
#17 0xb4a4da18 in DoWork () at ../../base/message_loop/message_loop.cc:540
#18 0xb4a4f3c4 in Run () at ../../base/message_loop/message_pump_default.cc:33
#19 0xb4a4d172 in Run () at ../../base/message_loop/message_loop.cc:369
#20 0xb4a67662 in Run () at ../../base/run_loop.cc:111
#21 0xb4a82a1a in Run () at ../../base/threading/thread.cc:255
#22 0xb4a82d84 in ThreadMain () at ../../base/threading/thread.cc:338
#23 0xb4a7d75e in ThreadFunc () at ../../base/threading/platform_thread_posix.cc:71
#24 0xb34885f0 in start_thread (arg=0x0) at pthread_create.c:335
#25 0xb22039dc in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:89 from /usr/local/google/home/bcf/src/master2/out/target/product/pineapple/symbols/root/lib/libc-2.23.so

When we picked up this CL: https://chromium-
review.googlesource.com/c/565567/ we started getting a crash loop from this DCHECK: 
DCHECK(g_cache.Get().config);
https://cs.chromium.org/chromium/src/components/os_crypt/os_crypt_linux.cc?type=cs&sq=package:chromium&l=72

It seems like before we were just getting the default global configuration, but now we need to set one explicitly?

We tried setting a blank confi gin PreMainMessageLoopRun and also in PreMainMessageLoopStart, but neither seemed to help

void CastBrowserMainParts::PreMainMessageLoopRun() {
  std::unique_ptr<os_crypt::Config> os_crypt_config(new os_crypt::Config());
  config->main_thread_runner = content::BrowserThread::GetTaskRunnerForThread(
      content::BrowserThread::UI);
  config->should_use_preference = false;
  OSCrypt::SetConfig(std::move(config));
  ...
}



(See also internal b/64155907)




 
Cc: bcf@chromium.org
We previously had no references to anything in os_crypt anywhere internall or under //chromecast/*, so I imagine we just need to set the simplest config, but I'm just not sure where
Cc: almasrymina@chromium.org
Owner: almasrymina@chromium.org
Status: Fixed (was: Untriaged)
ah, looks like almasrymina found the spot
Cc: cfroussios@chromium.org
Status: Untriaged (was: Fixed)
Hm, crash still happening
The code you posted seems correct. If Chromecast doesn't include a password store (kwallet, gnome-keyring), which I think is the case, then you don't need to set anything in the config.

If it is still failing, it means that the first use of de/encryption happens before CastBrowserMainParts::PreMainMessageLoopRun and you're setting the config too late. The DCHECK is there to verify exactly that.

In the browser, we do the initialisation in ChromeBrowserMainPartsLinux::PreProfileInit(). I don't know what the equivalent would be in Chromecast.
Project Member

Comment 7 by bugdroid1@chromium.org, Aug 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/21ab642e0d18f0926778e97416c9e9098b5c4033

commit 21ab642e0d18f0926778e97416c9e9098b5c4033
Author: Mike Bjorge <mbjorge@chromium.org>
Date: Tue Aug 01 17:44:20 2017

[Chromecast] Use os_crypt_posix.
    
Chromecast does not set USE_KEYRING, USE_LIBSECRET, or USE_KWALLET, so
there is no benefit os using os_crypt_linux over os_crypt_posix. Use
os_crypt_poxis instead because it does not require setting up an
os_crypt::Config.
    
BUG= 750391 

Change-Id: Ia320b6c058137d68a55af33bc8ffb9bf5226a325
Reviewed-on: https://chromium-review.googlesource.com/592847
Reviewed-by: Christos Froussios <cfroussios@chromium.org>
Commit-Queue: Mike Bjorge <mbjorge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491046}
[modify] https://crrev.com/21ab642e0d18f0926778e97416c9e9098b5c4033/components/os_crypt/BUILD.gn

Status: Fixed (was: Untriaged)

Sign in to add a comment