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

Issue 614151 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 614840

Blocking:
issue 606016



Sign in to add a comment

Investigate why scrollbar layer ends up with wrong effect tree index

Project Member Reported by jaydasika@chromium.org, May 23 2016

Issue description

In LayerImpl::UpdatePropertyTreeOpacity we check if effect tree index is greater than size of effect tree and return if that's true. This should never be true, but it is becoming true for scrollbars in some cases (Crashes in  crbug.com/613904  are becuase of this). 
 
Cc: dskiba@chromium.org
Pasting dskiba's comment from the crash bug :

I think something is concurrently modifying cc::LayerImpl::effect_tree_index_.

I was able to attach to a about-to-crash renderer, and index passed to PropertyTree::Node() is 6 (but number of elements is 5). However, if I go up to cc::LayerImpl::UpdatePropertyTreeOpacity() and check value of effect_tree_index_, it's 1:


#2  0xddea38c4 in cc::PropertyTree<cc::TreeNode<cc::EffectNodeData> >::Node (this=0xef64fcb4, this@entry=0xef64fd68, i=6)
    at ../../cc/trees/property_tree.h:357
(gdb) p i
$12 = 6
(gdb) p *this
$19 = {
  nodes_ = {
    <std::__1::__vector_base<cc::TreeNode<cc::EffectNodeData>, std::__1::allocator<cc::TreeNode<cc::EffectNodeData> > >> = {
      <std::__1::__vector_base_common<true>> = {<No data fields>}, 
      members of std::__1::__vector_base<cc::TreeNode<cc::EffectNodeData>, std::__1::allocator<cc::TreeNode<cc::EffectNodeData> > >: 
      __begin_ = 0xb7762780, 
      __end_ = 0xb77628ac, 
      __end_cap_ = {
        <std::__1::__libcpp_compressed_pair_imp<cc::TreeNode<cc::EffectNodeData>*, std::__1::allocator<cc::TreeNode<cc::EffectNodeData> >, 2u>> = {
          <std::__1::allocator<cc::TreeNode<cc::EffectNodeData> >> = {<No data fields>}, 
          members of std::__1::__libcpp_compressed_pair_imp<cc::TreeNode<cc::EffectNodeData>*, std::__1::allocator<cc::TreeNode<cc::EffectNodeData> >, 2u>: 
          __first_ = 0xb77628ac
        }, <No data fields>}
    }, <No data fields>}, 
  needs_update_ = false, 
  property_trees_ = 0xef64fc1c
}
(gdb) p (0xb77628ac - 0xb7762780) / sizeof(cc::TreeNode<cc::EffectNodeData>)
$20 = 5


#4  cc::LayerImpl::UpdatePropertyTreeOpacity (this=0xba6fb124, this@entry=0xdbbc5000) at ../../cc/layers/layer_impl.cc:711
711	    EffectNode* node = property_trees->effect_tree.Node(effect_tree_index_);
(gdb) p effect_tree_index_
$24 = 1
(gdb) p *this
$25 = {
  _vptr.LayerImpl = 0x2, 
  parent_ = 0xe081828c <vtable for std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >+12>, 
  children_ = {
    <std::__1::__vector_base<cc::LayerImpl*, std::__1::allocator<cc::LayerImpl*> >> = {
      <std::__1::__vector_base_common<true>> = {<No data fields>}, 
      members of std::__1::__vector_base<cc::LayerImpl*, std::__1::allocator<cc::LayerImpl*> >: 
      __begin_ = 0xe08181b8 <vtable for std::__1::basic_streambuf<char, std::__1::char_traits<char> >+8>, 
      __end_ = 0xe096d648 <std::__1::locale::__imp& std::__1::(anonymous namespace)::make<std::__1::locale::__imp, unsigned int>(unsigned int)::buf>, 
      __end_cap_ = {
        <std::__1::__libcpp_compressed_pair_imp<cc::LayerImpl**, std::__1::allocator<cc::LayerImpl*>, 2u>> = {
          <std::__1::allocator<cc::LayerImpl*>> = {<No data fields>}, 
          members of std::__1::__libcpp_compressed_pair_imp<cc::LayerImpl**, std::__1::allocator<cc::LayerImpl*>, 2u>: 
          __first_ = 0x0
        }, <No data fields>}
    }, <No data fields>}, 
  mask_layer_id_ = 0, 
  mask_layer_ = 0x0, 
  replica_layer_id_ = -1208223296, 
  replica_layer_ = 0xb7fbf9ee, 
  layer_id_ = -1208223233, 
  layer_tree_impl_ = 0x41, 
  test_properties_ = {
    __ptr_ = {
      <std::__1::__libcpp_compressed_pair_imp<cc::LayerImplTestProperties*, std::__1::default_delete<cc::LayerImplTestProperties>, 2u>> = {
        <std::__1::default_delete<cc::LayerImplTestProperties>> = {<No data fields>}, 
        members of std::__1::__libcpp_compressed_pair_imp<cc::LayerImplTestProperties*, std::__1::default_delete<cc::LayerImplTestProperties>, 2u>: 
        __first_ = 0x3f
      }, <No data fields>}
  }, 
  bounds_delta_ = {
    x_ = -3.00378306e-05, 
    y_ = -3.00379143e-05
  }, 
  bounds_ = 16x-527355852, 
  scroll_clip_layer_id_ = 4098, 
  offset_to_transform_parent_ = {
    x_ = 8.40779079e-45, 
    y_ = 0
  }, 
  main_thread_scrolling_reasons_ = 0, 
  user_scrollable_horizontal_ = false, 
  user_scrollable_vertical_ = false, 
  should_flatten_transform_from_property_tree_ = false, 
  layer_property_changed_ = false, 
  masks_to_bounds_ = false, 
  contents_opaque_ = false, 
  use_parent_backface_visibility_ = false, 
  use_local_transform_for_backface_visibility_ = false, 
  should_check_backface_visibility_ = false, 
  draws_content_ = false, 
  is_drawn_render_surface_layer_list_member_ = false, 
  is_affected_by_page_scale_ = false, 
  was_ever_ready_since_last_transform_animation_ = false, 
  non_fast_scrollable_region_ = {
    skregion_ = {
      static kOpCnt = 6, 
      fBounds = {
        fLeft = -1167085268, 
        fTop = -526985656, 
        fRight = 0, 
        fBottom = 0
      }, 
      fRunHead = 0x0
    }
  }, 
  touch_event_handler_region_ = {
    skregion_ = {
      static kOpCnt = 6, 
      fBounds = {
        fLeft = 0, 
        fTop = 0, 
        fRight = 0, 
        fBottom = 0
      }, 
      fRunHead = 0x0
    }
  }, 
  background_color_ = 0, 
  safe_opaque_background_color_ = 0, 
  opacity_ = 0, 
  blend_mode_ = 32, 
  draw_blend_mode_ = 29, 
  position_ = -5.1338608e+19,4.97460955e-43, 
  transform_ = {
    matrix_ = {
      fMat = {{-1.91581858e-05, -0.000914362492, -7.86214036e+17, -1.06010513e+17}, {-0.000914364588, -0.000914363889, -7.86199467e+17, 1}, {
          0, 1.40129846e-45, -1.46114689e-05, -0.000914366683}, {-7.86182975e+17, -9.49878013e-05, -1.46114689e-05, -9.499304e-05}}, 
      fTypeMask = 2
    }
  }, 
  clip_rect_in_target_space_ = 1142358016,0 1x-1194904528, 
  transform_tree_index_ = -1167084888, 
  effect_tree_index_ = 1, 
  clip_tree_index_ = -1167084828, 
  scroll_tree_index_ = -587855876, 
  filters_ = {
    operations_ = {
      <std::__1::__vector_base<cc::FilterOperation, std::__1::allocator<cc::FilterOperation> >> = {
        <std::__1::__vector_base_common<true>> = {<No data fields>}, 
        members of std::__1::__vector_base<cc::FilterOperation, std::__1::allocator<cc::FilterOperation> >: 
        __begin_ = 0x2, 
        __end_ = 0xdcfe4dcc <base::MessageLoop::DeferOrRunPendingTask(base::PendingTask const&)+196>, 
        __end_cap_ = {
          <std::__1::__libcpp_compressed_pair_imp<cc::FilterOperation*, std::__1::allocator<cc::FilterOperation>, 2u>> = {
            <std::__1::allocator<cc::FilterOperation>> = {<No data fields>}, 
            members of std::__1::__libcpp_compressed_pair_imp<cc::FilterOperation*, std::__1::allocator<cc::FilterOperation>, 2u>: 
            __first_ = 0x2
          }, <No data fields>}
      }, <No data fields>}
  }, 
  background_filters_ = {
    operations_ = {
      <std::__1::__vector_base<cc::FilterOperation, std::__1::allocator<cc::FilterOperation> >> = {
        <std::__1::__vector_base_common<true>> = {<No data fields>}, 
        members of std::__1::__vector_base<cc::FilterOperation, std::__1::allocator<cc::FilterOperation> >: 
        __begin_ = 0xdcfe4e94 <base::MessageLoop::RunTask(base::PendingTask const&)+160>, 
        __end_ = 0x2, 
        __end_cap_ = {
          <std::__1::__libcpp_compressed_pair_imp<cc::FilterOperation*, std::__1::allocator<cc::FilterOperation>, 2u>> = {
            <std::__1::allocator<cc::FilterOperation>> = {<No data fields>}, 
            members of std::__1::__libcpp_compressed_pair_imp<cc::FilterOperation*, std::__1::allocator<cc::FilterOperation>, 2u>: 
            __first_ = 0xdcfe5184 <base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask const&)+172>
          }, <No data fields>}
      }, <No data fields>}
  }, 
  sorting_context_id_ = 2, 
  current_draw_mode_ = 3706745292, 
  element_id_ = 12297160564, 
  mutable_properties_ = 3710810704, 
  update_rect_ = 2,-588244496 -278594560x-278223232, 
  damage_rect_ = -1167084888,-278215120 -1167084884x18, 
  copy_requests_ = {
    <std::__1::__vector_base<std::__1::unique_ptr<cc::CopyOutputRequest, std::__1::default_delete<cc::CopyOutputRequest> >, std::__1::allocator<std::__1::unique_ptr<cc::CopyOutputRequest, std::__1::default_delete<cc::CopyOutputRequest> > > >> = {
      <std::__1::__vector_base_common<true>> = {<No data fields>}, 
      members of std::__1::__vector_base<std::__1::unique_ptr<cc::CopyOutputRequest, std::__1::default_delete<cc::CopyOutputRequest> >, std::__1::allocator<std::__1::unique_ptr<cc::CopyOutputRequest, std::__1::default_delete<cc::CopyOutputRequest> > > >: 
      __begin_ = 0x2, 
      __end_ = 0xdd2e8054 <cc::PictureLayerImpl::PushPropertiesTo(cc::LayerImpl*)+208>, 
      __end_cap_ = {
        <std::__1::__libcpp_compressed_pair_imp<std::__1::unique_ptr<cc::CopyOutputRequest, std::__1::default_delete<cc::CopyOutputRequest> >*, std::__1::allocator<std::__1::unique_ptr<cc::CopyOutputRequest, std::__1::default_delete<cc::CopyOutputRequest> > >, 2u>> = {
          <std::__1::allocator<std::__1::unique_ptr<cc::CopyOutputRequest, std::__1::default_delete<cc::CopyOutputRequest> > >> = {<No data fields>}, 
          members of std::__1::__libcpp_compressed_pair_imp<std::__1::unique_ptr<cc::CopyOutputRequest, std::__1::default_delete<cc::CopyOutputRequest> >*, std::__1::allocator<std::__1::unique_ptr<cc::CopyOutputRequest, std::__1::default_delete<cc::CopyOutputRequest> > >, 2u>: 
          __first_ = 0x2
        }, <No data fields>}
    }, <No data fields>}, 
  draw_properties_ = {
    target_space_transform = {
      matrix_ = {
        fMat = {{-5.5356892e+17, 412, 604, 412}, {3457, 0, 0, 0}, {0, 0, 0, -9.499304e-05}, {-9.49878013e-05, 2.80259693e-45, 0, 
            1.35925951e-43}}, 
        fTypeMask = 0
      }
    }, 
    screen_space_transform = {
      matrix_ = {
        fMat = {{0, -7.08672315e+28, 8.40779079e-45, 2.52233724e-44}, {-0.000914386706, -6.25087184e+28, -6.28390574e+28, 0}, {
            -0.000914380187, -5.53815211e+17, 1.35925951e-43, 2.52233724e-44}, {1.35925951e-43, -7.26207784e+28, -1.06033603e+17, 
            -7.08672315e+28}}, 
        fTypeMask = 3127882516
      }
    }, 
    occlusion_in_content_space = {
      draw_transform_ = {
        matrix_ = {
          fMat = {{-5.53987559e+17, -7.26207784e+28, -7.26207784e+28, -0.000914383912}, {-7.85890779e+17, -0.000914386706, -6.25087184e+28, 
              -6.28390574e+28}, {0, -0.000914383912, -1.06033603e+17, -7.26207784e+28}, {-7.08672315e+28, -0.000914386706, -6.25087184e+28, 
              -0.000914385775}}, 
          fTypeMask = 3710812060
        }
      }, 
      occlusion_from_outside_target_ = {
        rect_ = -1216888064,-608413056 -278594560x-1216888064
      }, 
      occlusion_from_inside_target_ = {
        rect_ = -608413056,-278594560 -1167084636x-571375304
      }
    }, 
    opacity = -0.0009143895, 
    screen_space_transform_is_animating = false, 
    can_use_lcd_text = false, 
    is_clipped = false, 
    visible_layer_rect = 0,-1216886768 1x-1178100480, 
    drawable_content_rect = 97,-1216886768 49x1065353216, 
    clip_rect = -278229504,-278593024 -1167084568x-527009679, 
    maximum_animation_contents_scale = -0.00091439602, 
    starting_animation_contents_scale = -5.5582017e+17
  }, 
  performance_properties_ = {
    num_fixed_point_hits = 1, 
    translation_from_last_frame = -4.64232979e+31, 
    last_commit_screen_space_transform = {
      matrix_ = {
        fMat = {{2.80259693e-45, -3.43854341e+33, 2.80259693e-45, -5.71808719e+17}, {2.80259693e-45, -5.71827273e+17, 2.80259693e-45, 
            -5.72589097e+17}, {2.80259693e-45, -5.72593907e+17, 2.80259693e-45, -5.72610125e+17}, {2.80259693e-45, -5.72624006e+17, 
            2.80259693e-45, -5.72641461e+17}}, 
        fTypeMask = 2
      }
    }
  }, 
  owned_debug_info_ = {
    __ptr_ = {
      <std::__1::__libcpp_compressed_pair_imp<base::trace_event::ConvertableToTraceFormat*, std::__1::default_delete<base::trace_event::ConvertableToTraceFormat>, 2u>> = {
        <std::__1::default_delete<base::trace_event::ConvertableToTraceFormat>> = {<No data fields>}, 
        members of std::__1::__libcpp_compressed_pair_imp<base::trace_event::ConvertableToTraceFormat*, std::__1::default_delete<base::trace_event::ConvertableToTraceFormat>, 2u>: 
        __first_ = 0x0
      }, <No data fields>}
  }, 
  debug_info_ = 0x3, 
  render_surface_ = {
    __ptr_ = {
      <std::__1::__libcpp_compressed_pair_imp<cc::RenderSurfaceImpl*, std::__1::default_delete<cc::RenderSurfaceImpl>, 2u>> = {
        <std::__1::default_delete<cc::RenderSurfaceImpl>> = {<No data fields>}, 
        members of std::__1::__libcpp_compressed_pair_imp<cc::RenderSurfaceImpl*, std::__1::default_delete<cc::RenderSurfaceImpl>, 2u>: 
        __first_ = 0xe0967871 <base::trace_event::(anonymous namespace)::g_category_group_enabled+25>
      }, <No data fields>}
  }, 
  scrolls_drawn_descendant_ = 56, 
  has_will_change_transform_hint_ = 31
}
Cc: aelias@chromium.org
ScrollbarLayerImpl::PushPropertiesTo is causing the mismatch. 
It first calls LayerImpl::PushPropertiesTo (which sets the new effect tree index) and then calls ScrollbarLayerImpl::SetScrollLayerId which calls LayerImpl::OnOpacityAnimated. LayerImpl at this point has the new effect tree index but we still have the old property trees (because during activation, new property trees are pushed 'after' pushing layer properties).  
Blockedon: 614840
Status: Fixed (was: Started)

Sign in to add a comment