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

Issue 670464 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Last visit 15 days ago
Closed: Feb 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Blocked on:
issue 771171



Sign in to add a comment

enable_profiling makes ChromePublic.apk crash

Project Member Reported by xunji...@chromium.org, Dec 1 2016

Issue description

Steps to repro:

1. Sync to latest build (mine is at 8a905053d9c4b7eb7b238356d52e6d0e24bc40b6)

2. Set GN args to the following:

target_os = "android"
arm_use_thumb = false
enable_profiling = true

3. Build chrome_public_apk
4. Launch ChromePublic.apk
(crashes with and without enable-heap-profiling command line flag)

Doesn't repro if I get rid of "arm_use_thumb" and "enable_profiling" GN args.


I/cr_BrowserStartup( 2553): Initializing chromium process, singleProcess=false
I/        ( 2553): =================================================================
I/        ( 2553): ==2553==ERROR: AddressSanitizer: SEGV on unknown address 0xffffffec (pc 0x7b05eb88 bp 0xbeb542e4 sp 0xbeb542d0 T0)
I/        ( 2553): ==2553==The signal is caused by a READ memory access.
I/cr_base_multidex( 2700): Skipping multidex installation: not needed for process.
I/cr_CommandLineInitUtil( 2700): Using alternative command line file in /data/local/tmp/chrome-command-line
I/cr_ChildProcessService( 2700): Creating new ChildProcessService pid=2700
I/        ( 2553):     #0 _Unwind_VRS_Pop /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/Unwind/Unwind-EHABI.cpp:923
I/        ( 2553):     #1 _Unwind_VRS_Interpret /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/Unwind/Unwind-EHABI.cpp:270
I/        ( 2553):     #2 _Unwind_Backtrace /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/Unwind/UnwindLevel1-gcc-ext.c:163
I/        ( 2553):     #3 base::debug::StackTrace::StackTrace() /usr/local/google/home/xunjieli/chrome/src/out/test/../../base/debug/stack_trace_android.cc:72
I/        ( 2553):     #4 BrowserProcessImpl::BrowserProcessImpl(base::SequencedTaskRunner*, base::CommandLine const&) /usr/local/google/home/xunjieli/chrome/src/out/test/../../chrome/browser/browser_process_impl.cc:224
I/        ( 2553):     #5 ChromeBrowserMainParts::PreCreateThreadsImpl() /usr/local/google/home/xunjieli/chrome/src/out/test/../../chrome/browser/chrome_browser_main.cc:991
I/        ( 2553):     #6 ChromeBrowserMainParts::PreCreateThreads() /usr/local/google/home/xunjieli/chrome/src/out/test/../../chrome/browser/chrome_browser_main.cc:933
I/        ( 2553):     #7 ChromeBrowserMainPartsAndroid::PreCreateThreads() /usr/local/google/home/xunjieli/chrome/src/out/test/../../chrome/browser/chrome_browser_main_android.cc:78
I/        ( 2553):     #8 content::BrowserMainLoop::PreCreateThreads() /usr/local/google/home/xunjieli/chrome/src/out/test/../../content/browser/browser_main_loop.cc:751
I/        ( 2553):     #9 base::internal::RunMixin<base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> >::Run() const /usr/local/google/home/xunjieli/chrome/src/out/test/../../base/callback.h:85
I/        ( 2553):     #10 base::internal::RunMixin<base::Callback<void (), (base::internal::CopyMode)0, (base::internal::RepeatMode)0> >::Run() && /usr/local/google/home/xunjieli/chrome/src/out/test/../../base/callback.h:68
I/        ( 2553):     #11 base::MessageLoop::RunTask(base::PendingTask*) /usr/local/google/home/xunjieli/chrome/src/out/test/../../base/message_loop/message_loop.cc:413
I/        ( 2553):     #12 base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) /usr/local/google/home/xunjieli/chrome/src/out/test/../../base/message_loop/message_loop.cc:422
I/        ( 2553):     #13 base::MessageLoop::DoWork() /usr/local/google/home/xunjieli/chrome/src/out/test/../../base/message_loop/message_loop.cc:515
I/        ( 2553):     #14 DoRunLoopOnce /usr/local/google/home/xunjieli/chrome/src/out/test/../../base/message_loop/message_pump_android.cc:44
I/        ( 2553):     #15 Java_org_chromium_base_SystemMessageHandler_nativeDoRunLoopOnce /usr/local/google/home/xunjieli/chrome/src/out/test/gen/base/base_jni_headers/base/jni/SystemMessageHandler_jni.h:46
I/        ( 2553):     #16 0x4401dbcd  (/system/lib/libdvm.so+0x1dbcd)
I/        ( 2553): AddressSanitizer can not provide additional info.
I/        ( 2553): SUMMARY: AddressSanitizer: SEGV (/data/app-lib/org.chromium.chrome-1/libbase.cr.so+0x168b89)
I/        ( 2553): ==2553==ABORTING
I/ActivityManager(  586): Process org.chromium.chrome (pid 2553)

 
Owner: dskiba@chromium.org
Status: Assigned (was: Untriaged)
Hmm, I've seen this before, but I thought Samsung phone was to blame. So the thing here is that _Unwind_VRS_Pop() caused SIGSEGV, and I wonder if that's because prebuilt libc++ is in THUMB mode.

Don't know about other things. I am on a Nexus 7 KitKat. 
Thanks for looking into this. Is there a way to work around this problem?
So when I had this problem I was in a hurry and just commented out _Unwind_Backtrace() call in base/debug/stack_trace_android.cc:72. Hack, but works :)
I encountered this again today with ToT. 
It will be nice if it doesn't crash :)

I/        ( 8445): ==8445==ERROR: AddressSanitizer: SEGV on unknown address 0xffffffec (pc 0x7e27aa44 bp 0xbed893b4 sp 0xbed893a0 T0)
I/        ( 8445): ==8445==The signal is caused by a READ memory access.
I/cr_ChildProcessService( 8593): Creating new ChildProcessService pid=8593
I/        ( 8445):     #0 _Unwind_VRS_Pop /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/Unwind/Unwind-EHABI.cpp:923
I/        ( 8445):     #1 _Unwind_VRS_Interpret /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/Unwind/Unwind-EHABI.cpp:270
I/        ( 8445):     #2 _Unwind_Backtrace /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/Unwind/UnwindLevel1-gcc-ext.c:163
I/        ( 8445):     #3 base::debug::StackTrace::StackTrace(unsigned int) /usr/local/google/home/xunjieli/chrome/src/out/memory_android/../../base/debug/stack_trace_android.cc:76
I/        ( 8445):     #4 base::debug::StackTrace::StackTrace() /usr/local/google/home/xunjieli/chrome/src/out/memory_android/../../base/debug/stack_trace.cc:195
I/        ( 8445):     #5 BrowserProcessImpl::BrowserProcessImpl(base::SequencedTaskRunner*, base::CommandLine const&) /usr/local/google/home/xunjieli/chrome/src/out/memory_android/../../chrome/browser/browser_process_impl.cc:226
I/        ( 8445):     #6 ChromeBrowserMainParts::PreCreateThreadsImpl() /usr/local/google/home/xunjieli/chrome/src/out/memory_android/../../chrome/browser/chrome_browser_main.cc:1009
I/        ( 8445):     #7 ChromeBrowserMainParts::PreCreateThreads() /usr/local/google/home/xunjieli/chrome/src/out/memory_android/../../chrome/browser/chrome_browser_main.cc:951
I/        ( 8445):     #8 ChromeBrowserMainPartsAndroid::PreCreateThreads() /usr/local/google/home/xunjieli/chrome/src/out/memory_android/../../chrome/browser/chrome_browser_main_android.cc:85
I/        ( 8445):     #9 content::BrowserMainLoop::PreCreateThreads() /usr/local/google/home/xunjieli/chrome/src/out/memory_android/../../content/browser/browser_main_loop.cc:850
I/        ( 8445):     #10 base::internal::RunMixin<base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> >::Run() const /usr/local/google/home/xunjieli/chrome/src/out/memory_android/../../base/callback.h:85
I/        ( 8445):     #11 base::internal::RunMixin<base::Callback<void (), (base::internal::CopyMode)0, (base::internal::RepeatMode)0> >::Run() && /usr/local/google/home/xunjieli/chrome/src/out/memory_android/../../base/callback.h:68
I/        ( 8445):     #12 base::MessageLoop::RunTask(base::PendingTask*) /usr/local/google/home/xunjieli/chrome/src/out/memory_android/../../base/message_loop/message_loop.cc:423
I/        ( 8445):     #13 base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) /usr/local/google/home/xunjieli/chrome/src/out/memory_android/../../base/message_loop/message_loop.cc:434
I/        ( 8445):     #14 base::MessageLoop::DoWork() /usr/local/google/home/xunjieli/chrome/src/out/memory_android/../../base/message_loop/message_loop.cc:527
I/        ( 8445):     #15 DoRunLoopOnce /usr/local/google/home/xunjieli/chrome/src/out/memory_android/../../base/message_loop/message_pump_android.cc:44
I/        ( 8445):     #16 0x4401dbcd  (/system/lib/libdvm.so+0x1dbcd)
I/        ( 8445): AddressSanitizer can not provide additional info.
I/        ( 8445): SUMMARY: AddressSanitizer: SEGV (/data/app-lib/org.chromium.chrome-1/libchrome.so+0x3960a45)
I/        ( 8445): ==8445==ABORTING

I am not sure that asan can work in arm mode. The problem is that asan+profiling is a configuration that is never tested anywhere and hence very likely to be broken.
Why do you need to run asan on a profiling build in the first place?
I didn't run asan build.

I have

enable_profiling = true
is_debug = false
target_os = "android"
arm_use_thumb = false

This is the recommended GN args (except the is_debug) listed in https://chromium.googlesource.com/chromium/src/+/master/docs/memory-infra/heap_profiler.md

Comment 8 by dskiba@chromium.org, Feb 16 2017

This is caused by BrowserProcessImpl having a StackTrace member. I'll send CL removing it, and we'll see how useful it is.

Long term solution would be to understand and fix why exactly _Unwind_ function crashes.
Uhm but your log says:
I/        ( 2553): ==2553==ERROR: AddressSanitizer: SEGV on unknown address 0xffffffec 

Is Asan somehow incorrectly triggered by those flags?
I double-checked that I have the exact 4 flags in my local build. 
I might have run "tools/android/asan/third_party/asan_device_setup.sh --lib third_party/llvm-build/Release+Asserts/lib/clang/*/lib/linux/libclang_rt.asan-arm-android.so" on that device in the past. I am not sure if that's related

In any case, this is of low priority. I am using the hack suggested by dskiba@ so I am not blocked on anything.
Fun! Enabling Android native heap profiling on N crashes Chrome in the same function:

  025abf78  _Unwind_VRS_Pop                                                                                                                                                                                                                                                                     /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/Unwind/Unwind-EHABI.cpp:923
  025abc2b  _Unwind_VRS_Interpret                                                                                                                                                                                                                                                               /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/Unwind/Unwind-EHABI.cpp:270
  v------>  __cxxabiv1::continue_unwind(_Unwind_Control_Block*, _Unwind_Context*)                                                                                                                                                                                                               /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/cxa_personality.cpp:1050
  025a3fe3  __gxx_personality_v0                                                                                                                                                                                                                                                                /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/cxa_personality.cpp:1182
  0001f61f  <unknown>                                                                                                                                                                                                                                                                           /system/lib/libc_malloc_debug.so
  00007447  <unknown>                                                                                                                                                                                                                                                                           /system/lib/libc_malloc_debug.so
  00004973  <unknown>                                                                                                                                                                                                                                                                           /system/lib/libc_malloc_debug.so
  v------>  ShimCalloc                                                                                                                                                                                                                                                                          /usr/local/google/code/clankium/src/base/allocator/allocator_shim.cc:200
  0028ff27  __wrap_calloc                                                                                                                                                                                                                                                                       /usr/local/google/code/clankium/src/base/allocator/allocator_shim_override_linker_wrapped_symbols.h:21
  025a575f  newlocale                                                                                                                                                                                                                                                                           /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/android/support/src/locale/newlocale.c:46
  02593421  std::__ndk1::__cloc()                                                                                                                                                                                                                                                               /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/locale.cpp:52
  v------>  __time_put                                                                                                                                                                                                                                                                          /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/include/locale:2588
  v------>  time_put                                                                                                                                                                                                                                                                            /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/include/locale:2608
  v------>  std::__ndk1::time_put<char, std::__ndk1::ostreambuf_iterator<char, std::__ndk1::char_traits<char> > >& std::__ndk1::(anonymous namespace)::make<std::__ndk1::time_put<char, std::__ndk1::ostreambuf_iterator<char, std::__ndk1::char_traits<char> > >, unsigned int>(unsigned int)  /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/locale.cpp:74
  0259d85d  __imp                                                                                                                                                                                                                                                                               /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/locale.cpp:206
  v------>  std::__ndk1::locale::__imp& std::__ndk1::(anonymous namespace)::make<std::__ndk1::locale::__imp, unsigned int>(unsigned int)                                                                                                                                                        /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/locale.cpp:74
  v------>  std::__ndk1::locale::__imp::make_classic()                                                                                                                                                                                                                                          /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/locale.cpp:469
  0259dbe1  std::__ndk1::locale::classic()                                                                                                                                                                                                                                                      /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/locale.cpp:476
  v------>  std::__ndk1::locale::__imp::make_global()                                                                                                                                                                                                                                           /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/locale.cpp:485
  0259dd7f  std::__ndk1::locale::__global()                                                                                                                                                                                                                                                     /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/locale.cpp:492
  0259ddd7  locale                                                                                                                                                                                                                                                                              /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/locale.cpp:497
  v------>  basic_streambuf                                                                                                                                                                                                                                                                     /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:163
  02590edd  __stdinbuf                                                                                                                                                                                                                                                                          /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/include/__std_stream:44
  02590b21  Init                                                                                                                                                                                                                                                                                /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/iostream.cpp:38
  v------>  __cxx_global_var_init                                                                                                                                                                                                                                                               /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/iostream.cpp:34
  02591995  _GLOBAL__sub_I_iostream.cpp                                                                                                                                                                                                                                                         /data/app/com.google.android.apps.chrome-1/lib/arm/libchrome.so
  000063f9  __dl__ZN6soinfo13call_functionEPKcPFvvE+84                                                                                                                                                                                                                                          /system/bin/linker


03-03 12:03:15.788 22999 22999 F DEBUG   : pid: 22924, tid: 22924, name: oid.apps.chrome  >>> com.google.android.apps.chrome <<<
03-03 12:03:15.788 22999 22999 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x31
03-03 12:03:15.788 22999 22999 F DEBUG   :     r0 00000031  r1 00000035  r2 00000004  r3 00000000
03-03 12:03:15.788 22999 22999 F DEBUG   :     r4 00000004  r5 00000000  r6 00000000  r7 bea94d98
03-03 12:03:15.788 22999 22999 F DEBUG   :     r8 bea952a8  r9 000040d0  sl 00000001  fp bea94d84
03-03 12:03:15.788 22999 22999 F DEBUG   :     ip 9062e190  sp bea94d70  lr 904665fb  pc 90465f78  cpsr 00070030


Cc: jbudorick@chromium.org
This seems to be fixed by switching to NDK 14 (we're at 12b now).

jbudorick@ when we're expected to switch to r14? (There is a small __NDK_FPABI__ fix involved.)
There's no immediate plan. GCC is deprecated starting in r13, and I was unsuccessful at getting it to even compile: https://bugs.chromium.org/p/chromium/issues/detail?id=668202#c8

We could switch to clang, but there's a size penalty associated with doing so: https://bugs.chromium.org/p/chromium/issues/detail?id=563748

In any event, I can at least get r14 checked in to https://chromium.googlesource.com/android_ndk.git over the next week or so.
that said: we can cherry-pick things back to r12 if necessary.
Hmm, I thought that copying libunwind from r13 would work, but it didn't. Apparently libc++abi also needs to be copied, but that means bringing whole libc++ too.
Components: -Platform>DevTools>Memory

Comment 17 by agrieve@google.com, Oct 24 2017

Blockedon: 771171
Cc: erikc...@chromium.org
Status: WontFix (was: Assigned)
This should be fixed as we upgraded to NDK r16.

Sign in to add a comment