New issue
Advanced search Search tips

Issue 875462 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 25
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 0
Type: Bug



Sign in to add a comment

TransitionalURLLoaderFactoryOwner::GetURLLoaderFactory() crashes on remoting host startup

Project Member Reported by lambroslambrou@chromium.org, Aug 17

Issue description

Remoting host process crashes soon after startup (debug and release builds). Probably related to this CL:
https://chromium-review.googlesource.com/c/chromium/src/+/1148471

Backtrace from starting the host process on Linux:

Command-line:
ninja -C out/linux-host remoting_dev_me2me_host
out/linux-host/remoting/chrome-remote-desktop --start -f

#0  0x0000000002e87dc7 in base::debug::(anonymous namespace)::DebugBreak() () at ../../base/debug/debugger_posix.cc:240
#1  0x0000000002e87da8 in base::debug::BreakDebugger() () at ../../base/debug/debugger_posix.cc:263
#2  0x0000000002c5c124 in logging::LogMessage::~LogMessage() (this=0x7f16d6247670) at ../../base/logging.cc:865
#3  0x000000000326611e in mojo::MessagePipe::MessagePipe() (this=0x7f16d62477f8) at ../../mojo/public/cpp/system/message_pipe.h:140
#4  0x00000000032658f7 in mojo::MakeRequest<network::mojom::URLLoaderClient>(mojo::InterfacePtr<network::mojom::URLLoaderClient>*, scoped_refptr<base::SingleThreadTaskRunner>) (ptr=0x2872f4facd48, runner=...) at ../../mojo/public/cpp/bindings/interface_request.h:138
#5  0x0000000004d2758d in network::TransitionalURLLoaderFactoryOwner::GetURLLoaderFactory() (this=0x2872f4facd40)
    at ../../services/network/transitional_url_loader_factory_owner.cc:92
#6  0x00000000043e9b12 in remoting::ChromotingHostContext::url_loader_factory() (this=0x2872f4ad2140)
    at ../../remoting/host/chromoting_host_context.cc:113
#7  0x0000000002beb777 in remoting::HostProcess::InitializeSignaling() (this=0x2872f4793c20)
    at ../../remoting/host/remoting_me2me_host.cc:1435
#8  0x0000000002bed01c in remoting::HostProcess::StartHost() (this=0x2872f4793c20) at ../../remoting/host/remoting_me2me_host.cc:1489
#9  0x0000000002be1f86 in remoting::HostProcess::StartHostIfReady() (this=0x2872f4793c20)
    at ../../remoting/host/remoting_me2me_host.cc:1476
#10 0x0000000002be0b36 in remoting::HostProcess::OnConfigUpdated(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) (this=0x2872f4793c20, serialized_config=...) at ../../remoting/host/remoting_me2me_host.cc:618
#11 0x0000000002be61e4 in remoting::HostProcess::StartOnNetworkThread() (this=0x2872f4793c20)
    at ../../remoting/host/remoting_me2me_host.cc:693
#12 0x00000000010d141f in base::internal::FunctorTraits<void (OAuth2AccessTokenFetcherImmediateError::FailCaller::*)(), void>::Invoke<void (OAuth2AccessTokenFetcherImmediateError::FailCaller::*)(), scoped_refptr<OAuth2AccessTokenFetcherImmediateError::FailCaller>>(void (OAuth2AccessTokenFetcherImmediateError::FailCaller::*)(), scoped_refptr<OAuth2AccessTokenFetcherImmediateError::FailCaller>&&) (method=(void (OAuth2AccessTokenFetcherImmediateError::FailCaller::*)(OAuth2AccessTokenFetcherImmediateError::FailCaller * const)) 0x2be6020 <remoting::HostProcess::StartOnNetworkThread()>, receiver_ptr=<unknown type in /usr/local/google/home/lambroslambrou/chromium/src/out/linux-host/remoting_me2me_host, CU 0x0, DIE 0x8188>) at ../../base/bind_internal.h:516
#13 0x00000000010d1394 in base::internal::InvokeHelper<false, void>::MakeItSo<void (OAuth2AccessTokenFetcherImmediateError::FailCaller::*)(), scoped_refptr<OAuth2AccessTokenFetcherImmediateError::FailCaller> >(void (OAuth2AccessTokenFetcherImmediateError::FailCaller::*&&)(), scoped_refptr<OAuth2AccessTokenFetcherImmediateError::FailCaller>&&) (functor=<unknown type in /usr/local/google/home/lambroslambrou/chromium/src/out/linux-host/remoting_me2me_host, CU 0x0, DIE 0x8118>, args=<unknown type in /usr/local/google/home/lambroslambrou/chromium/src/out/linux-host/remoting_me2me_host, CU 0x0, DIE 0x8125>) at ../../base/bind_internal.h:616
#14 0x00000000010d1340 in base::internal::Invoker<base::internal::BindState<void (OAuth2AccessTokenFetcherImmediateError::FailCaller::*)(), scoped_refptr<OAuth2AccessTokenFetcherImmediateError::FailCaller> >, void ()>::RunImpl<void (OAuth2AccessTokenFetcherImmediateError::FailCaller::*)(), std::__1::tuple<scoped_refptr<OAuth2AccessTokenFetcherImmediateError::FailCaller> >, 0ul>(void (OAuth2AccessTokenFetcherImmediateError::FailCaller::*&&)(), std::__1::tuple<scoped_refptr<OAuth2AccessTokenFetcherImmediateError::FailCaller> >&&, std::__1::integer_sequence<unsigned long, 0ul>) (functor=<unknown type in /usr/local/google/home/lambroslambrou/chromium/src/out/linux-host/remoting_me2me_host, CU 0x0, DIE 0x5361>, bound=<unknown type in /usr/local/google/home/lambroslambrou/chromium/src/out/linux-host/remoting_me2me_host, CU 0x0, DIE 0x536e>) at ../../base/bind_internal.h:689
#15 0x00000000010fd28c in base::internal::Invoker<base::internal::BindState<void (OAuth2TokenServiceRequest::Core::*)(), scoped_refptr<OAuth2TokenServiceRequest::Core> >, void ()>::Run(base::internal::BindStateBase*) (base=0x2872f526b9c0) at ../../base/bind_internal.h:671
#16 0x000000000101b43e in base::OnceCallback<void ()>::Run() && (this=0x7f16d624b8b8) at ../../base/callback.h:99
#17 0x0000000002c87df2 in base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) (this=0x2872f4c4d028, queue_function=0x3aa64b "MessageLoop::PostTask", pending_task=0x7f16d624b8b8) at ../../base/debug/task_annotator.cc:101
#18 0x0000000002c8513c in base::MessageLoop::RunTask(base::PendingTask*) (this=0x7f16d624c688, pending_task=0x7f16d624b8b8)
    at ../../base/message_loop/message_loop.cc:431
#19 0x0000000002c853be in base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) (this=0x7f16d624c688, pending_task=...)
    at ../../base/message_loop/message_loop.cc:442
#20 0x0000000002c85849 in base::MessageLoop::DoWork() (this=0x7f16d624c688) at ../../base/message_loop/message_loop.cc:514
#21 0x0000000002ebcaae in base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) (this=0x2872f4c32180, delegate=0x7f16d624c688)
    at ../../base/message_loop/message_pump_libevent.cc:210
#22 0x0000000002c8493b in base::MessageLoop::Run(bool) (this=0x7f16d624c688, application_tasks_allowed=true)
    at ../../base/message_loop/message_loop.cc:383
#23 0x0000000002d0311d in base::RunLoop::Run() (this=0x7f16d624c370) at ../../base/run_loop.cc:102
#24 0x000000000184cf7f in remoting::AutoThread::ThreadMain() (this=0x2872f4ad54a0) at ../../remoting/base/auto_thread.cc:226
#25 0x0000000002eb89dd in base::(anonymous namespace)::ThreadFunc(void*) (params=0x2872f4c78cf0)
    at ../../base/threading/platform_thread_posix.cc:76
#26 0x00007f16e45c4494 in start_thread (arg=0x7f16d624d700) at pthread_create.c:333
#27 0x00007f16de1c2a8f in clone () at /lib/x86_64-linux-gnu/libc.so.6

 
Labels: -Pri-1 Pri-0
Owner: lambroslambrou@chromium.org
That looks like a missing  mojo::core::Init();

(In main(), that is)
I tried adding
#include "mojo/core/embedder/embedder.h"
mojo::core::Init()
in remoting_me2me_host.cc

Unfortunately, building the host process on Linux gives the linker error below.

I don't think we're expecting to use mojo or any other form of IPC in the Linux remoting host process? The windows build works fine, because it is already using mojo for its multi-process architecture.

Linker error:
python "../../build/toolchain/gcc_link_wrapper.py" --output="./remoting_me2me_host" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--as-needed -fuse-ld=lld -Wl,--icf=all -Wl,--color-diagnostics -m64 -Werror -Wl,--gdb-index -rdynamic -nostdlib++ --sysroot=../../build/linux/debian_sid_amd64-sysroot -L../../build/linux/debian_sid_amd64-sysroot/usr/local/lib/x86_64-linux-gnu -Wl,-rpath-link=../../build/linux/debian_sid_amd64-sysroot/usr/local/lib/x86_64-linux-gnu -L../../build/linux/debian_sid_amd64-sysroot/lib/x86_64-linux-gnu -Wl,-rpath-link=../../build/linux/debian_sid_amd64-sysroot/lib/x86_64-linux-gnu -L../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu -Wl,-rpath-link=../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu -Wl,-rpath-link=. -Wl,--disable-new-dtags -o "./remoting_me2me_host" -Wl,--start-group @"./remoting_me2me_host.rsp"  -Wl,--end-group   -ldl -lpthread -lrt -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lpam -lnss3 -lnssutil3 -lsmime3 -lplds4 -lplc4 -lnspr4 -lexpat -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lresolv -lXext -lX11 -lXcomposite -lXrender -lm -lX11-xcb -lxcb -lXcursor -lXdamage -lXfixes -lXi -lXtst -lXrandr -luuid -ldbus-1 -lasound -lz -lpci -lXss 
ld.lld: error: undefined symbol: mojo::core::Init()
>>> referenced by remoting_me2me_host.cc:1725 (../../remoting/host/remoting_me2me_host.cc:1725)
>>>               remoting_me2me_host_static/remoting_me2me_host.o:(remoting::HostProcessMain()) in archive obj/remoting/host/libremoting_me2me_host_static.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)

One more note, removing the build ifdef will work for testing the fix, we would want to move it into the main deps block if it does.
Project Member

Comment 7 by bugdroid1@chromium.org, Aug 18

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

commit bfbe0350e78bc0da082faba02047b6eae3278aac
Author: Lambros Lambrou <lambroslambrou@chromium.org>
Date: Sat Aug 18 00:09:13 2018

[remoting host] Initialize mojo unconditionally

Mojo needs to be initialized, even in a single-process context, to fix
a crash on startup. This CL removes the condition on
remoting_multi_process for calling mojo::core::Init().

Bug:  875462 
Change-Id: I021e5248aae850962c4ef53a506a2d06413aaf77
Reviewed-on: https://chromium-review.googlesource.com/1180499
Commit-Queue: Lambros Lambrou <lambroslambrou@chromium.org>
Reviewed-by: Joe Downing <joedow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584250}
[modify] https://crrev.com/bfbe0350e78bc0da082faba02047b6eae3278aac/remoting/host/BUILD.gn
[modify] https://crrev.com/bfbe0350e78bc0da082faba02047b6eae3278aac/remoting/host/host_main.cc

Status: Fixed (was: Untriaged)

Sign in to add a comment