Skip to content

Arithmetic Overflow when scrolling #9006

Closed

Description

@dzbarsky
➜  servo git:(scissor) ✗ ./mach run -d https://www.khronos.org/registry/webgl/sdk/tests/conformance/attribs/gl-matrix-attributes.html\?webglVersion\=1\&quiet\=0
thread '<unnamed>' panicked at 'arithmetic operation overflowed', /Users/dzbarsky/mozilla/servo/components/compositing/scrolling.rs:60
stack backtrace:
   1:        0x10b1318e8 - sys::backtrace::tracing::imp::write::hca66179add43b2e5lLt
   2:        0x10b1339af - panicking::log_panic::_<closure>::closure.40842
   3:        0x10b133452 - panicking::log_panic::h7a04edac7e1f2797HEx
   4:        0x10b11f266 - sys_common::unwind::begin_unwind_inner::h39a94087039ae0efnOs
   5:        0x10b11f64e - sys_common::unwind::begin_unwind_fmt::h7be0824d83765cd5tNs
   6:        0x10b130f07 - rust_begin_unwind
   7:        0x10b156010 - panicking::panic_fmt::h871c0ef100fda9e9LFK
   8:        0x10b15630c - panicking::panic::hbe2e3a5159c3d178iEK
   9:        0x109d88096 - scrolling::_<impl>::run::h8d99d47b851932a5yZg
  10:        0x109d87c9d - scrolling::_<impl>::new::_<closure>::closure.33728
  11:        0x109d876df - std::thread::_<impl>::spawn::_<closure>::_<closure>::closure.33717
  12:        0x109d87669 - sys_common::unwind::try::try_fn::try_fn::h12018874347137073100
  13:        0x10b130d28 - __rust_try
  14:        0x10b12de2e - sys_common::unwind::try::inner_try::h819d2da8e3dc4516VKs
  15:        0x109d875d2 - sys_common::unwind::try::try::h14640882492384793102
  16:        0x109d8740b - std::thread::_<impl>::spawn::_<closure>::closure.33714
  17:        0x109d87ee0 - boxed::_<impl>::call_box::call_box::h6108671541456513336
  18:        0x10b132c3d - sys::thread::_<impl>::new::thread_start::h328957c252b95d3cOYw
  19:     0x7fff9f31dc12 - _pthread_body
  20:     0x7fff9f31db8f - _pthread_start
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', ../src/libcore/result.rs:741
stack backtrace:
   1:        0x10b1318e8 - sys::backtrace::tracing::imp::write::hca66179add43b2e5lLt
   2:        0x10b1339af - panicking::log_panic::_<closure>::closure.40842
   3:        0x10b133452 - panicking::log_panic::h7a04edac7e1f2797HEx
   4:        0x10b11f266 - sys_common::unwind::begin_unwind_inner::h39a94087039ae0efnOs
   5:        0x10b11f64e - sys_common::unwind::begin_unwind_fmt::h7be0824d83765cd5tNs
   6:        0x10b130f07 - rust_begin_unwind
   7:        0x10b156010 - panicking::panic_fmt::h871c0ef100fda9e9LFK
   8:        0x109d882d2 - result::_<impl>::unwrap::unwrap::h5866065750796944517
   9:        0x109d8ab72 - scrolling::_<impl>::shutdown::hc9e090c277b2c1e3kZg
  10:        0x108702545 - compositor::_<impl>::finish_shutting_down::finish_shutting_down::h12203205293516776426
  11:        0x1086f43d6 - compositor::_<impl>::handle_browser_message::handle_browser_message::h11774076941811829808
  12:        0x1086f3de2 - compositor::_<impl>::handle_events::handle_events::h12047551615251732495
  13:        0x10883a748 - _<impl>::handle_events::h1169c8c565313f92Tda
  14:        0x1086b7fec - main::hb77cfbfb032d8741Laa
  15:        0x10b1331d2 - sys_common::unwind::try::try_fn::h9781900235654175042
  16:        0x10b130d28 - __rust_try
  17:        0x10b133079 - rt::lang_start::h7f8cb47bb0ba3293PBx
  18:        0x1087ab3e9 - main
Servo exited with return value 101

(Loaded the page and scrolled down)

Activity

  1. added
    I-panic
    on Dec 17, 2015
  2. jdm commented on Dec 17, 2015

    @jdm
    Member
    59             let target = timestamp + TIMEOUT;
    60             let delta_ns = target - time::precise_time_ns();
    

    It's unclear to me why overflow occurred!

  3. jdm commented on Dec 17, 2015

    @jdm
    Member

    I guess if a ScrollEventProcessedMsg is received with a timestamp that is more than TIMEOUT ns in the past?

  4. njskalski commented on Dec 25, 2015

    @njskalski
    Contributor

    well, I tried to reproduce, and received something different: https://paste.ee/p/n6B2T

    I trired to add some println to .cargo/git/checkouts/rust-offscreen-rendering-context-49a578ae84e64b98/master/src/draw_buffer.rs

    and then rebuilt servo, but either stdout is dropped or println in unsafe doesn't work, or - most probably - it hasn't rebuilt "rust-offscreen-rendering". How to force a rebuild?

  5. njskalski commented on Dec 27, 2015

    @njskalski
    Contributor

    Hi, I started to investigate the issue (on Linux) and I added a XErrorHandler to offscreen rendering. Here it is
    https://github.com/askalski/rust-offscreen-rendering-context/tree/add_error_naming_to_glx
    if someone finds it helpful

  6. njskalski commented on Dec 27, 2015

    @njskalski
    Contributor

    and for some reason my attempt to add error handler was unsuccessful - for some reason it's never called. Any clues will be appreciated.

  7. emilio commented on Dec 27, 2015

    @emilio
    Member

    Hi @askalski,

    The callback provided to XSetErrorHandler is only executed on protocol errors I think, not on other kind of errors.

    Also, glutin already adds a custom error handler (see https://github.com/servo/glutin/blob/servo/src/api/x11/xdisplay.rs#L34), and even more info will be available when upstream is merged again (see rust-windowing/glutin#675 and potentially rust-windowing/glutin#679).

    I think this error is not related to X errors though. If you're having issues with the WebGL implementation it's probably a different issue, and I'd like to hear about it :).

  8. njskalski commented on Dec 31, 2015

    @njskalski
    Contributor

    @ecoal95
    The reason I attempted to add XSetErrorHandler is that on my machine, I have different run result : https://paste.ee/p/LhdcQ , most notably, the assertion that fails is:

    thread 'WebGLTask' panicked at 'called `Result::unwrap()` on an `Err` value: "glx::MakeCurrent"', ../src/libcore/result.rs:741
    

    this, as far as I understand your code, points to failed glx::MakeCurrent call, which has like 7 possible reasons to check. I attempted to figure out which one was that.

    Can somebody try to reproduce? I don't even know if it's the same bug.

  9. emilio commented on Jan 1, 2016

    @emilio
    Member

    Hum... It definitely isn't the same bug, and I can't reproduce it.

    I think I know what may cause it, even though it'd be really weird (rebinding the context to another thread returns an error in your glx implementation).

    May you apply this patch and tell me if it solves that issue?

  10. njskalski commented on Jan 8, 2016

    @njskalski
    Contributor

    @ecoal95 after applying this patch to today's upstream/master and clean build, I have no crash, and all tests succeed. So again, unable to reproduce original bug :).

    my stuff: Ubuntu Mate 14.04 LTS on Lenovo Thinkpad W530, so intel i7, nvidia quadro M2000 (proprietary drivers from Ubuntu's repo)

  11. added a commit that references this issue on Jan 8, 2016
  12. jrasanen commented on Mar 29, 2016

    @jrasanen
    Contributor
    Render took 45.57361499999996ms & will cause frame drop
    Unhandled error occured
    ReferenceError: navigator.mozSettings API is not available
    Render took 34.53955599999972ms & will cause frame drop
    Render took 17.389828999999736ms & will cause frame drop
    Render took 27.411798000001ms & will cause frame drop
    Render took 74.53840300000047ms & will cause frame drop
    Render took 16.766426999998657ms & will cause frame drop
    .getCanGoBack is not supported by runtime
    .getCanGoForward is not supported by runtime
    Error: Network request to http://ac.duckduckgo.com/ac/?q=http://v4-alpha.getbootstrap.com/examples/starter-template/&type=list has failed:
    ERROR:js::rust: Error at http://v4-alpha.getbootstrap.com/dist/js/bootstrap.min.js:6:2416: Bootstrap tooltips require Tether (http://github.hubspot.com/tether/)
    
    thread '<main>' panicked at 'arithmetic operation overflowed', /Users/jrasanen/Development/servo/.cargo/git/checkouts/webrender-ec406de34643a7ef/master/src/renderer.rs:1152
    stack backtrace:
       1:        0x1130111d8 - sys::backtrace::tracing::imp::write::h3153bab3099b48114Zu
       2:        0x113014dc9 - panicking::default_handler::_$u7b$$u7b$closure$u7d$$u7d$::closure.43920
       3:        0x1130149f8 - panicking::default_handler::h1183b2a11c8682560zz
       4:        0x112ffffd6 - sys_common::unwind::begin_unwind_inner::h1f97bc9e4cfe0396LZt
       5:        0x113000e6e - sys_common::unwind::begin_unwind_fmt::hda8646f04aa67d8aRYt
       6:        0x113010577 - rust_begin_unwind
       7:        0x11303a0b0 - panicking::panic_fmt::h40f5ec0cdc3fc429FRL
       8:        0x11303a3ac - panicking::panic::hf105884501521a8dcQL
       9:        0x112e65d5c - renderer::Renderer::draw_layer::hf2779d07523702cd6jt
      10:        0x112e5312b - renderer::Renderer::draw_frame::he267807767a62ad3kOt
      11:        0x112e5098a - renderer::Renderer::render::_$u7b$$u7b$closure$u7d$$u7d$::closure.32669
      12:        0x112e50874 - profiler::TimeProfileCounter::profile::h11434346125577385277
      13:        0x112e50648 - renderer::Renderer::render::hb6d8796d145efc28SIs
      14:        0x1100556d8 - compositing::compositor::IOCompositor<Window>::composite_specific_target::_$u7b$$u7b$closure$u7d$$u7d$::closure.32323
      15:        0x110054fb0 - time::profile::h15327050848834622159
      16:        0x11004fd0b - compositor::IOCompositor<Window>::composite_specific_target::h11804973444044785746
      17:        0x110082acf - compositor::IOCompositor<Window>::composite::h16540612542168815107
      18:        0x11008a46b - compositor::IOCompositor<Window>.CompositorEventListener::repaint_synchronously::h16477718676245144558
      19:        0x110097d94 - Browser::repaint_synchronously::hdce78a1aaa5c9f52bfa
      20:        0x11008b029 - BrowserWrapper.app..NestedEventLoopListener::handle_event_from_nested_event_loop::h4e5cb3da43383343Uda
      21:        0x11171b488 - window::Window::nested_window_resize::h0528312bd16c5c8fIAa
      22:        0x1118ea4f9 - api::cocoa::WindowDelegate::class::window_did_resize::__rust_abi
      23:        0x1118e5f30 - api::cocoa::WindowDelegate::class::window_did_resize::h901b55cf2f0b43f7aya
      24:     0x7fff94ee7bbb - __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
      25:     0x7fff94ee7b4e - ___CFXRegistrationPost_block_invoke
      26:     0x7fff94ee7ac6 - _CFXRegistrationPost
      27:     0x7fff94ee7831 - ___CFXNotificationPost_block_invoke
      28:     0x7fff94ea45e1 - -[_CFXNotificationRegistrar find:object:observer:enumerator:]
      29:     0x7fff94ea3834 - _CFXNotificationPost
      30:     0x7fff98d62fd9 - -[NSNotificationCenter postNotificationName:object:userInfo:]
      31:     0x7fff90813b4d - -[NSWindow _setFrameCommon:display:stashSize:]
      32:     0x7fff90812d8b - -[NSWindow _setFrame:display:allowImplicitAnimation:stashSize:]
      33:     0x7fff90812ca6 - -[NSWindow setFrame:display:]
      34:     0x7fff910b9ccb - -[NSWindow(NSWindowResizing) _resizeSetFrame:withEvent:shouldSnapWidth:shouldSnapHeight:]
      35:     0x7fff90acabee - -[NSWindow(NSWindowResizing) _resizeWithEvent:]
      36:     0x7fff909b480c - -[NSThemeFrame mouseDown:]
      37:     0x7fff90f0e468 - -[NSWindow _handleMouseDownEvent:isDelayedEvent:]
      38:     0x7fff90f0f44c - -[NSWindow _reallySendEvent:isDelayedEvent:]
      39:     0x7fff9094e63c - -[NSWindow sendEvent:]
      40:     0x7fff908ceb3b - -[NSApplication sendEvent:]
      41:        0x111a020fc - message::_(A,).MessageArguments::invoke::h4095820892457552890
      42:        0x111a02027 - message::send_unverified::h9425227248575933783
      43:        0x111a02d06 - appkit::id.NSApplication::sendEvent_::h9e1913a2dc7d4c4azrb
      44:        0x1118ebbc7 - api::cocoa::NSEventToEvent::h3b03b2c0ffb29e5bWJb
      45:        0x1118ed47d - api::cocoa::WaitEventsIterator<'a>.Iterator::next::h49d4059490ebd6eebQa
      46:        0x11175854b - window::WaitEventsIterator<'a>.Iterator::next::h5b97d3190e99b494dIe
      47:        0x1117580b6 - window::Window::handle_next_event::hde02b43fb2f08647HKa
      48:        0x11175899f - window::Window::wait_events::hb6334eed59ce50e1qLa
      49:        0x10ff7f868 - main::h816805d8d509cd3eMaa
      50:        0x113014602 - sys_common::unwind::try::try_fn::h13791246699442426615
      51:        0x11301050b - __rust_try
      52:        0x1130144c0 - rt::lang_start::h32ace63a1577ce666rz
      53:        0x11008aed9 - main
    Servo exited with return value 101
    

    I can reproduce this on OS X (video):

    1. ./mach run -d --browserhtml
    2. Open any URL
    3. Resize the window

    Note: Crash only happens when browserhtml is enabled.

  13. mrobinson commented on Jan 17, 2018

    @mrobinson
    Member

    The final backtrace that reproduced an issue like this referred to the old pre-WebRender compositor, so I feel pretty confident about closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-gfx/compositingI-panic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions