New issue
Advanced search Search tips

Issue 834444 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Apr 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug
Proj-XR



Sign in to add a comment

VR instrumentation tests with native pages flakily crashing

Project Member Reported by bsheedy@chromium.org, Apr 18 2018

Issue description

Since sometime on 4/16, VrShellNativeUiTest#testUrlOnNativeUi and VrShellNavigationTest#testNativeNavigationAndInteraction have been flakily crashing due to hitting a check in ring_buffer.cc. The only thing these have in common is that they load native pages (e.g. the New Tab Page), so it's likely related to that.

I haven't been able to reproduce locally, but it's happening every few runs on the bots running a Pixel XL with N.

Symbolized stack trace:
signal 6 (SIGABRT), code -6 in tid 16393 (chromium.chrome), pid 16393 (chromium.chrome)
pid: 16393, tid: 16393, name: chromium.chrome  >>> org.chromium.chrome <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
[FATAL:ring_buffer.cc(38)] Check failed: !blocks_.empty(). no free blocks
Stack Trace:
  RELADDR   FUNCTION                                                     FILE:LINE
  00e84415  logging::LogMessage::~LogMessage()                           ../../base/logging.cc:594:29
  01765529  gpu::RingBuffer::FreeOldestBlock()                           ../../gpu/command_buffer/client/ring_buffer.cc:38:3
  0176569d  gpu::RingBuffer::Alloc(unsigned int)                         ../../gpu/command_buffer/client/ring_buffer.cc:70:5
  01765ffb  gpu::TransferBuffer::AllocUpTo(unsigned int, unsigned int*)  ../../gpu/command_buffer/client/transfer_buffer.cc:170:24
-----------------------------------------------------
     r0 00000000  r1 00004009  r2 00000006  r3 00000008
     r4 00004009  r5 00004009  r6 fff9867c  r7 0000010c
     r8 00000000  r9 d0d75130  sl fff98b20  fp fff98b1c
     ip fff986d5  sp fff98668  lr ecca4bdf  pc ecc9e5ec
Stack Trace:
  RELADDR   FUNCTION                                                                                                                                                                                                 FILE:LINE
  0001a5ec  <UNKNOWN>                                                                                                                                                                                                /system/lib/libc.so
  v------>  base::debug::(anonymous namespace)::DebugBreak()                                                                                                                                                         ../../base/debug/debugger_posix.cc:228:5
  00e73707  base::debug::BreakDebugger()                                                                                                                                                                             ../../base/debug/debugger_posix.cc:258:0
  00e8462b  logging::LogMessage::~LogMessage()                                                                                                                                                                       ../../base/logging.cc:855:7
  01765529  gpu::RingBuffer::FreeOldestBlock()                                                                                                                                                                       ../../gpu/command_buffer/client/ring_buffer.cc:38:3
  0176569b  gpu::RingBuffer::Alloc(unsigned int)                                                                                                                                                                     ../../gpu/command_buffer/client/ring_buffer.cc:70:5
  01765ff9  gpu::TransferBuffer::AllocUpTo(unsigned int, unsigned int*)                                                                                                                                              ../../gpu/command_buffer/client/transfer_buffer.cc:170:24
  017660d5  gpu::ScopedTransferBufferPtr::Reset(unsigned int)                                                                                                                                                        ../../gpu/command_buffer/client/transfer_buffer.cc:235:31
  019052f7  gpu::ScopedTransferBufferPtr::ScopedTransferBufferPtr(unsigned int, gpu::CommandBufferHelper*, gpu::TransferBufferInterface*)                                                                            ../../gpu/command_buffer/client/transfer_buffer.h:167:5
  019077db  gpu::gles2::GLES2Implementation::TexSubImage2D(unsigned int, int, int, int, int, int, unsigned int, unsigned int, void const*)                                                                           ../../gpu/command_buffer/client/gles2_implementation.cc:2829:27
  018f77cb  viz::TextureAllocation::UploadStorage(gpu::gles2::GLES2Interface*, gpu::Capabilities const&, viz::ResourceFormat, gfx::Size const&, viz::TextureAllocation const&, gfx::ColorSpace const&, void const*)  ../../components/viz/common/gpu/texture_allocation.cc:125:9
  018d4d7d  cc::LayerTreeHostImpl::CreateUIResource(int, cc::UIResourceBitmap const&)                                                                                                                                ../../cc/trees/layer_tree_host_impl.cc:4583:7
  018da019  cc::LayerTreeImpl::ProcessUIResourceRequestQueue()                                                                                                                                                       ../../cc/trees/layer_tree_impl.cc:1709:21
  018d1913  cc::LayerTreeHostImpl::ActivateSyncTree()                                                                                                                                                                ../../cc/trees/layer_tree_host_impl.cc:2478:19
  018ee567  cc::SingleThreadProxy::ScheduledActionActivateSyncTree()                                                                                                                                                 ../../cc/trees/single_thread_proxy.cc:818:15
  018a41d5  cc::Scheduler::ProcessScheduledActions()                                                                                                                                                                 ../../cc/scheduler/scheduler.cc:748:18
  018a4791  cc::Scheduler::NotifyReadyToCommit()                                                                                                                                                                     ../../cc/scheduler/scheduler.cc:167:3
  018ee2fd  cc::SingleThreadProxy::BeginMainFrame(viz::BeginFrameArgs const&)                                                                                                                                        ../../cc/trees/single_thread_proxy.cc:756:3
  00e6b521  base::OnceCallback<void ()>::Run() &&                                                                                                                                                                    ../../base/callback.h:95:12
  00e73cf9  base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*)                                                                                                                                     ../../base/debug/task_annotator.cc:101:33
  00e88867  base::internal::IncomingTaskQueue::RunTask(base::PendingTask*)                                                                                                                                           ../../base/message_loop/incoming_task_queue.cc:124:19
  00e8a21b  base::MessageLoop::RunTask(base::PendingTask*)                                                                                                                                                           ../../base/message_loop/message_loop.cc:319:25
  00e8a421  base::MessageLoop::DeferOrRunPendingTask(base::PendingTask)                                                                                                                                              ../../base/message_loop/message_loop.cc:329:5
  00e8a4ef  base::MessageLoop::DoWork()                                                                                                                                                                              ../../base/message_loop/message_loop.cc:373:16
  00e8b2a7  base::MessagePumpForUI::DoRunLoopOnce(_JNIEnv*, base::android::JavaParamRef<_jobject*> const&, unsigned char)                                                                                            ../../base/message_loop/message_pump_android.cc:60:14
  00e8b279  Java_org_chromium_base_SystemMessageHandler_nativeDoRunLoopOnce                                                                                                                                          gen/base/base_jni_headers/base/jni/SystemMessageHandler_jni.h:46:18
  00041ddd  <UNKNOWN>                                                                                                                                                                                                /data/app/org.chromium.chrome-WLZhd0xngpDH9vqgZ9j8PQ==/oat/arm/base.odex
 
This is the same stack that we've seen a few times with when entering VR, where a device gets into a bad state.

If we can run a modified version of the test to dump the size we are trying to allocate, and the maximum size possible, we can test my hypothesis that we are allocating too much.
This seems to only happen on build226-b4--device4 and build226-b4--device2.
Actually - the dchecks indicate we aren't allocating more than the total size, but we run out of free blocks to free.  This probably means that GetLargestFreeSizeNoWaiting is returning unexpected values.

free_offset_ vs. in_use_offset_ being out of sync could cause this.


Logcat output of a failed run with some additional logging about allocs/frees.
ring_buffer_logcat.txt
216 KB View Download
Issue 821352 has been merged into this issue.
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 19 2018

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

commit 0b3868aa32759ac4dc1a6dba3794dfeb33c7ebbd
Author: bsheedy <bsheedy@chromium.org>
Date: Thu Apr 19 19:38:26 2018

Fix GPU Ring Buffer alignment crash

Fixes an issue in gpu::RingBuffer where requesting an Alloc with the
value returned by RingBuffer::GetLargestFreeOrPendingSize would result
in trying to allocate more memory than the maximum buffer size if the
ring buffer's size was not aligned.

Bug:  834444 
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I672f67944a1ae4c5e34fe5b6d9f209f4a9112400
Reviewed-on: https://chromium-review.googlesource.com/1018525
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Bill Orr <billorr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552118}
[modify] https://crrev.com/0b3868aa32759ac4dc1a6dba3794dfeb33c7ebbd/gpu/command_buffer/client/ring_buffer.cc
[modify] https://crrev.com/0b3868aa32759ac4dc1a6dba3794dfeb33c7ebbd/gpu/command_buffer/client/ring_buffer.h
[modify] https://crrev.com/0b3868aa32759ac4dc1a6dba3794dfeb33c7ebbd/gpu/command_buffer/client/ring_buffer_test.cc
[modify] https://crrev.com/0b3868aa32759ac4dc1a6dba3794dfeb33c7ebbd/gpu/command_buffer/client/transfer_buffer.cc

Status: Fixed (was: Available)
Labels: Test-Complete
Components: Internals>XR
Labels: -VR-Caught-By-Test XR-Caught-By-Test

Sign in to add a comment