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

Issue 762994 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug
Hotlist-MemoryInfra



Sign in to add a comment

EnableHeapProfiling creates background thread before sandbox initialization

Project Member Reported by kraynov@chromium.org, Sep 7 2017

Issue description

Chrome built on Linux with GN args: is_debug=false

$ out/build/chrome --enable-heap-profiling
[1:1:0907/172635.851041:FATAL:zygote_main_linux.cc(484)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded().
...
[2620:2620:0907/172635.853747:FATAL:zygote_host_impl_linux.cc(210)] Check failed: ReceiveFixedMessage(fds[0], kZygoteHelloMessage, sizeof(kZygoteHelloMessage), &real_pid).
...
(Browser not starting)


$ out/build/chrome --enable-heap-profiling --no-sandbox 
[3087:3087:0907/173050.543207:FATAL:zygote_main_linux.cc(484)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded().
...
Calling _exit(1). Core file will not be generated.
[0907/173050.546601:ERROR:nacl_helper_linux.cc(310)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
[3148:3148:0907/173051.937776:ERROR:sandbox_linux.cc(346)] InitializeSandbox() called with multiple threads in process gpu-process.
(Browser starts)

ssid@ any ideas? Thanks!
 
Cc: wkorman@chromium.org
Interesting thing that Memory Infra Tester
[1] https://build.chromium.org/p/chromium.android.fyi/builders/Memory%20Infra%20Tester?numbuilds=100
started failing for different reason ([FATAL:compositor_impl_android.cc(729)] Timed out waiting for GPU channel.) after that CL
[2] 
https://chromium.googlesource.com/chromium/src/+/caabcd74f118b4a2dc879c56df972453d65f2738

Comment 2 by ssid@chromium.org, Sep 7 2017

I'll fix it today.

Comment 3 by ssid@chromium.org, Sep 7 2017

Summary: EnableHeapProfiling creates background thread before sandbox initialization (was: Heap profiler (--enable-heap-profiling) is broken on tip of tree)
The issue is now to notify malloc dump provider for OnHeapProfilingEnabled() we create background thread. This is done very early in code and sandbox init does not expect any threads to be created by then. So, we should somehow avoid creating new thread in this case
Project Member

Comment 4 by bugdroid1@chromium.org, Sep 8 2017

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

commit 2d505f417ed6cca3f0df6ebbd491527e59b4c2c3
Author: Siddhartha <ssid@chromium.org>
Date: Fri Sep 08 23:20:31 2017

Do not create background thread if MDM is not initialized

If MDM is not initialized then a dump cannot be in progress. So,
OnHeapProfilingEnabled() can be called on any thread. Creating thread
at early startup causes crashes at sandbox initialization.

BUG= 762994 

Change-Id: Ia85fb6f1efbd4911b1ed56633b6af1c9bb201937
Reviewed-on: https://chromium-review.googlesource.com/655810
Reviewed-by: Primiano Tucci <primiano@chromium.org>
Commit-Queue: Siddhartha S <ssid@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500732}
[modify] https://crrev.com/2d505f417ed6cca3f0df6ebbd491527e59b4c2c3/base/trace_event/memory_dump_manager.cc
[modify] https://crrev.com/2d505f417ed6cca3f0df6ebbd491527e59b4c2c3/base/trace_event/memory_dump_manager.h
[modify] https://crrev.com/2d505f417ed6cca3f0df6ebbd491527e59b4c2c3/base/trace_event/memory_dump_provider.h

Comment 5 by ssid@chromium.org, Sep 9 2017

Labels: -Pri-1 Pri-2
Other thing might be related:
https://build.chromium.org/p/chromium.android.fyi/builders/Memory%20Infra%20Tester still failing with
[FATAL:compositor_impl_android.cc(733)] Timed out waiting for GPU channel.

Reproducible locally using
$ tools/perf/run_benchmark run system_health.memory_mobile --browser=android-chromium --extra-browser-args=--enable-heap-profiling --story-filter=load:search:google
Project Member

Comment 7 by bugdroid1@chromium.org, Sep 13 2017

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

commit 261f33bbf6cedb11de15eaaf2735bf4ea708e37c
Author: Siddhartha <ssid@chromium.org>
Date: Wed Sep 13 01:29:30 2017

MemoryInfra: Do not call OnHeapProfilingEnabled() for all providers

To call OnHeapProfilingEnabled() on all providers, it is required to
post task for each of them. This sometimes creates issues because the
task runner may not be available when enabling profiling. So, only call
on providers that support profiling.

BUG= 762994 

Change-Id: Ic428f7c772e982167d3eb2260197e11a1f8685cf
Reviewed-on: https://chromium-review.googlesource.com/657894
Reviewed-by: Primiano Tucci <primiano@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Siddhartha S <ssid@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501501}
[modify] https://crrev.com/261f33bbf6cedb11de15eaaf2735bf4ea708e37c/base/trace_event/memory_dump_manager.cc
[modify] https://crrev.com/261f33bbf6cedb11de15eaaf2735bf4ea708e37c/base/trace_event/memory_dump_manager_unittest.cc
[modify] https://crrev.com/261f33bbf6cedb11de15eaaf2735bf4ea708e37c/base/trace_event/memory_dump_provider.h
[modify] https://crrev.com/261f33bbf6cedb11de15eaaf2735bf4ea708e37c/third_party/WebKit/Source/platform/exported/Platform.cpp

Comment 8 by ssid@chromium.org, Sep 13 2017

Status: Fixed (was: Assigned)

Sign in to add a comment