Skip to content

ScriptThread panics when a timer fires after a pipeline has closed #14677

Closed

Description

@TraNzeM

ScriptThread: received fire timer msg for a pipeline not in this script thread. This is a bug.

URL: http://peacekeeper.futuremark.com/run.action

http://peacekeeper.futuremark.com/run.action

Servo Version:

Servo 0.0.1-641010e

Backtrace:


WARNING: <ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(9) }>: layout thread unreachable - leaking layout data
WARNING: <ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(9) }>: layout thread unreachable - leaking layout data
WARNING: <ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(9) }>: layout thread unreachable - leaking layout data
WARNING: <ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(9) }>: layout thread unreachable - leaking layout data
WARNING: <ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(9) }>: layout thread unreachable - leaking layout data
WARNING: <ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(9) }>: layout thread unreachable - leaking layout data
WARNING: <ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(9) }>: layout thread unreachable - leaking layout data
WARNING: <ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(9) }>: layout thread unreachable - leaking layout data
WARNING: <ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: 
...

This report was generated by the browser.html issue reporter.

Activity

  1. added
    C-reproduced
    I-panic
    on Dec 22, 2016
  2. jdm commented on Dec 22, 2016

    @jdm
    Member

    I can reproduce this by waiting for 30s in a debug build on the provided URL. Thanks for reporting it!

  3. jdm commented on Dec 22, 2016

    @jdm
    Member

    Unsurprisingly, if we log the output of the constellation we see:

    DEBUG:constellation::constellation: Loading http://peacekeeper.futuremark.com/runTest.action in pipeline (1,2).
    DEBUG:constellation::constellation: constellation got iframe URL load message PipelineId { namespace_id: PipelineNamespaceId(0), index: PipelineIndex(1) } Some(PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(2) }) PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(3) }
    DEBUG:constellation::constellation: constellation got set visibility change complete message
    DEBUG:constellation::constellation: constellation got set final url message
    DEBUG:constellation::constellation: constellation got activate document message
    DEBUG:constellation::constellation: Document ready to activate PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(3) }
    DEBUG:constellation::constellation: Setting frame (1,0) to be pipeline (1,3).
    DEBUG:constellation::constellation: Closing pipeline PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(2) }.
    DEBUG:constellation::pipeline: pipeline PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(2) } exiting
    DEBUG:constellation::constellation: Closed pipeline PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(2) }.
    ...
    DEBUG:constellation::constellation: Pipeline PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(2) } exited.
    ...
    ScriptThread: received fire timer msg for a pipeline not in this script thread. This is a bug. (thread ScriptThread PipelineId { namespace_id: PipelineNamespaceId(0), index: PipelineIndex(1) }, at ../src/libcore/option.rs:705)
    (lldb) f 8
    frame #8: 0x0000000102b5006f servo`script::script_thread::{{impl}}::handle_timer_event(self=0x00000001235fee08, timer_event=TimerEvent at 0x00000001235fb9b8) + 319 at script_thread.rs:1052
       1049	            TimerSource::FromWorker => panic!("Worker timeouts must not be sent to script thread"),
       1050	        };
       1051
    -> 1052	        let window = self.documents.borrow().find_window(pipeline_id)
       1053	            .expect("ScriptThread: received fire timer msg for a pipeline not in this script thread. This is a bug.");
       1054
       1055	        window.handle_fire_timer(id);
    (lldb) p pipeline_id
    (msg::constellation_msg::PipelineId) $0 = PipelineId {
    namespace_id: PipelineNamespaceId(1),
    index: PipelineIndex(2)
    }
    
  4. changed the title [-]ScriptThread: received fire timer msg for a pipeline not in this script thread. This is a bug.[/-] [+]ScriptThread panics when a timer fires after a pipeline has closed[/+] on Dec 22, 2016
  5. jdm commented on Dec 22, 2016

    @jdm
    Member

    For the purposes of this issue, I think it just makes sense to turn the panic into a warning. I'm worried that repeating timers will repeat for eternity after their associated document closes, though, so I've filed #14678 to fix that if necessary.

  6. jdm commented on Dec 22, 2016

    @jdm
    Member

    Easy demonstration:

    <iframe></iframe>
    <script>
      var i = document.querySelector('iframe');
      i.contentWindow.setInterval(function() {}, 100);
      i.remove();
    </script>
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

    C-reproducedI-panic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions