Skip to content

Iframe sometimes don't load and sometimes spit suspicious logs #3932

Closed

Description

@neojski

main.html

<html>
  <head>
    <meta charset="utf8" />
    <title>Iframe contentDocument test.</title>
  </head>
  <body>
    <iframe src="inner.html"></iframe>
    <div>test</div>
  </body>
</html>

inner.html

<html><body><div id="test">value</div></body></html>

I ran a script:

for i in $(seq 10); do
./mach run main.html
done

And I kept clicking close button of servo.

Results, on of the following (but not both):

  1. I saw value on the screen
  2. I saw test on the screen

Plus I the console, sometimes but I didn't notice any correlation with value or test thing:

task 'ScriptTask' failed at 'sending on a closed channel', /Users/larsberg/rust/src/libsync/comm/mod.rs:573
task 'ScriptTask' failed at 'DOMRefCell<T> already borrowed', dom/bindings/cell.rs:118
stack backtrace:
   1:        0x111272a69 - rt::backtrace::imp::write::he90f55e975dac19a1Tq
   2:        0x111276192 - failure::on_fail::h1aa28f9ec3f7fda6Far
   3:        0x11128b735 - unwind::begin_unwind_inner::h97f5bca93429abcaPQd
   4:        0x1102a305d - unwind::begin_unwind::h7245801774213734399
   5:        0x1107a69a7 - dom::bindings::cell::DOMRefCell<T>::borrow_mut::h526616531191942136
   6:        0x1107a68b8 - page::Page::mut_js_info::hbea4c5a061e75a6d1Gb
   7:        0x1107afc28 - script_task::ScriptMemoryFailsafe<'a>.Drop::drop::h33599202d108448549b
   8:        0x10fecf016 - script..script_task..ScriptMemoryFailsafe<'_>::glue_drop.11387::h219d9f320613cc06
   9:        0x10feb55f3 - script_task::ScriptTask.ScriptTaskFactory::create::closure.10697
  10:        0x110fad4d2 - rtinstrument::instrument::h777a086b61f9c892rTd
  11:        0x10fe9a841 - task::spawn_named_with_send_on_failure::closure.10177
  12:        0x10feb11b6 - task::TaskBuilder<S>::try_future::closure.10593
  13:        0x110ae37ed - task::bootstrap_green_task::closure.6832
  14:        0x11128c38c - rust_try_inner
  15:        0x11128c376 - rust_try
  16:        0x111288fb7 - unwind::try::hef59009c1de381e8xFd
  17:        0x111288e6c - task::Task::run::h6af0212431b92fd5MVc
  18:        0x110ae36b0 - task::bootstrap_green_task::hcb2cc30f27b6339465b

Activity

  1. jdm commented on Nov 7, 2014

    @jdm
    Member

    For investigating cases like this, running gdb --args target/servo, setting a breakpoint on rust_fail and looking at the backtrace is usually the most helpful. Alternatively, running with the RUST_BACKTRACE=1 environment variable would also do the same.

  2. neojski commented on Nov 9, 2014

    @neojski
    ContributorAuthor

    So with RUST_BACKTRACE=1 I get a little bit more of output:

    task 'ScriptTask' failed at 'sending on a closed channel', /Users/larsberg/rust/src/libsync/comm/mod.rs:573
    stack backtrace:
       1:        0x10970afe9 - rt::backtrace::imp::write::he90f55e975dac19a1Tq
       2:        0x10970e4d5 - failure::on_fail::h1aa28f9ec3f7fda6Far
       3:        0x109723cb5 - unwind::begin_unwind_inner::h97f5bca93429abcaPQd
       4:        0x109723973 - unwind::begin_unwind_fmt::h904d273690034602hOd
       5:        0x1097236e2 - rust_begin_unwind
       6:        0x1097486cc - failure::begin_unwind::h075fd6b86e2794c3opk
       7:        0x109748240 - atomic::AtomicInt::new::hb69abbaebf8ff771Gwj
       8:        0x108a058fb - comm::Sender<T>::send::h837414112622144701
       9:        0x108a28e54 - dom::node::Node::reap_layout_data::h0d2a2e70e42dfc91bD6
      10:        0x1086cd45a - dom::node::Node.Drop::drop::h2a1ad868b96845bfH14
      11:        0x1086cd3be - dom..node..Node::glue_drop.64514::h66f17b59816eff42
      12:        0x10876ce46 - dom..element..Element::glue_drop.67334::h599cb90b88e22d5e
      13:        0x10878ca7e - dom..htmlelement..HTMLElement::glue_drop.67949::hd0fd309cf12250b5
      14:        0x1087c43fe - dom..htmlhtmlelement..HTMLHtmlElement::glue_drop.68992::h418dd2d808eaf4c5
      15:        0x1087c43ac - Box<dom..htmlhtmlelement..HTMLHtmlElement>::glue_drop.68989::h244d27fe324fb20e
      16:        0x1087c40f2 - dom::bindings::codegen::Bindings::HTMLHtmlElementBinding::_finalize::__rust_abi
      17:        0x1087c4032 - dom::bindings::codegen::Bindings::HTMLHtmlElementBinding::_finalize::h28b624ef5bb12338NJK
      18:        0x108dca4f9 - _ZN2js2gcL14FinalizeArenasEPNS_6FreeOpEPPNS0_11ArenaHeaderERNS0_9ArenaListENS0_9AllocKindERNS_11SliceBudgetE
      19:        0x108dcb74f - _ZN2js2gc10ArenaLists20queueObjectsForSweepEPNS_6FreeOpE
      20:        0x108dd047f - _ZL23IncrementalCollectSliceP9JSRuntimexN2js8gcreason6ReasonENS1_18JSGCInvocationKindE
      21:        0x108dcec79 - _ZL7GCCycleP9JSRuntimebxN2js18JSGCInvocationKindENS1_8gcreason6ReasonE
      22:        0x108dccc79 - _ZL7CollectP9JSRuntimebxN2js18JSGCInvocationKindENS1_8gcreason6ReasonE
      23:        0x108da33a5 - _ZN2js14DestroyContextEP9JSContextNS_18DestroyContextModeE
      24:        0x108cc9ff5 - rust::Cx.Drop::drop::h0f7c6588f920ccbdZIc
      25:        0x108729c22 - js..rust..Cx::glue_drop.66249::h26f0641f514e6b73
      26:        0x108729940 - rc::Rc<T>.Drop::drop::h14182860636721081304
      27:        0x1087297fe - alloc..rc..Rc<js..rust..Cx>::glue_drop.66246::h0739dc8451f72e76
      28:        0x108825e35 - page..JSPageInfo::glue_drop.70947::h4b24778fd88ed6b6
      29:        0x108825df6 - core..option..Option<page..JSPageInfo>::glue_drop.70944::h9717b77a1086892a
      30:        0x108bc3fb3 - script_task::shut_down_layout::h923bfb78c726f87dg3e
      31:        0x108baeab4 - script_task::ScriptTask::handle_exit_pipeline_msg::h5cf8e41af75d2b5eNte
      32:        0x108b847a6 - script_task::ScriptTask::handle_msgs::h8864fd9085de6675U0d
      33:        0x108b82b12 - script_task::ScriptTask::start::h5fc91c7b7feb5870J0d
      34:        0x108330891 - script_task::ScriptTask.ScriptTaskFactory::create::closure.10734
      35:        0x1094ec362 - rtinstrument::instrument::h777a086b61f9c892rTd
      36:        0x108315b41 - task::spawn_named_with_send_on_failure::closure.10214
      37:        0x10832c4b6 - task::TaskBuilder<S>::try_future::closure.10630
      38:        0x108f51f2d - task::bootstrap_green_task::closure.6832
      39:        0x10972490c - rust_try_inner
      40:        0x1097248f6 - rust_try
      41:        0x109721537 - unwind::try::hef59009c1de381e8xFd
      42:        0x1097213ec - task::Task::run::h6af0212431b92fd5MVc
      43:        0x108f51df0 - task::bootstrap_green_task::hcb2cc30f27b6339465b
    task 'ScriptTask' failed at 'DOMRefCell<T> already borrowed', dom/bindings/cell.rs:118
    stack backtrace:
       1:        0x10970afe9 - rt::backtrace::imp::write::he90f55e975dac19a1Tq
       2:        0x10970e4d5 - failure::on_fail::h1aa28f9ec3f7fda6Far
       3:        0x109723cb5 - unwind::begin_unwind_inner::h97f5bca93429abcaPQd
       4:        0x108635dbd - unwind::begin_unwind::h9601284995082280284
       5:        0x108b45c97 - dom::bindings::cell::DOMRefCell<T>::borrow_mut::h4625136888716664407
       6:        0x108b45ba8 - page::Page::mut_js_info::h99bf7998c6f7b6655md
       7:        0x108b4ef08 - script_task::ScriptMemoryFailsafe<'a>.Drop::drop::h5ec9d1b4474454c58Pd
       8:        0x10834b396 - script..script_task..ScriptMemoryFailsafe<'_>::glue_drop.11453::he4f5b475115d8802
       9:        0x1083308f3 - script_task::ScriptTask.ScriptTaskFactory::create::closure.10734
      10:        0x1094ec362 - rtinstrument::instrument::h777a086b61f9c892rTd
      11:        0x108315b41 - task::spawn_named_with_send_on_failure::closure.10214
      12:        0x10832c4b6 - task::TaskBuilder<S>::try_future::closure.10630
      13:        0x108f51f2d - task::bootstrap_green_task::closure.6832
      14:        0x10972490c - rust_try_inner
      15:        0x1097248f6 - rust_try
      16:        0x109721537 - unwind::try::hef59009c1de381e8xFd
      17:        0x1097213ec - task::Task::run::h6af0212431b92fd5MVc
      18:        0x108f51df0 - task::bootstrap_green_task::hcb2cc30f27b6339465b
    

    Even more info with lldb:

      * frame #0: 0x00000001015044a0 servo`rust_fail
        frame #1: 0x0000000101504d54 servo`unwind::begin_unwind_inner::h97f5bca93429abcaPQd + 356
        frame #2: 0x0000000101504973 servo`unwind::begin_unwind_fmt::h904d273690034602hOd + 643
        frame #3: 0x00000001015046e2 servo`rust_begin_unwind + 66
        frame #4: 0x00000001015296cc servo`failure::begin_unwind::h075fd6b86e2794c3opk + 60
        frame #5: 0x0000000101529240 servo`failure::begin_unwind_string::h80299af30f7a9972gok + 112
        frame #6: 0x00000001007e68fb servo`comm::Sender$LT$T$GT$::send::h837414112622144701 + 459
        frame #7: 0x0000000100809e54 servo`script::dom::node::Node::reap_layout_data(self=0x000000010e49bc00) + 420 at node.rs:1593
        frame #8: 0x00000001004ae45a servo`script::dom::node::Node.Drop::drop(self=0x000000010e49bc00) + 58 at node.rs:172
        frame #9: 0x00000001004ae3be servo`dom..node..Node::glue_drop.64514::h66f17b59816eff42 + 110
        frame #10: 0x000000010054de46 servo`dom..element..Element::glue_drop.67334::h599cb90b88e22d5e + 54
        frame #11: 0x000000010056da7e servo`dom..htmlelement..HTMLElement::glue_drop.67949::hd0fd309cf12250b5 + 46
        frame #12: 0x00000001005a53fe servo`dom..htmlhtmlelement..HTMLHtmlElement::glue_drop.68992::h418dd2d808eaf4c5 + 46
        frame #13: 0x00000001005a53ac servo`Box$LT$dom..htmlhtmlelement..HTMLHtmlElement$GT$::glue_drop.68989::h244d27fe324fb20e + 76
        frame #14: 0x00000001005a50f2 servo`script::dom::bindings::codegen::Bindings::HTMLHtmlElementBinding::_finalize(fop=0x00000001161f9828, obj=0x0000000117b493a0) + 178 at HTMLHtmlElementBinding.rs:109
        frame #15: 0x00000001005a5032 servo`dom::bindings::codegen::Bindings::HTMLHtmlElementBinding::_finalize::h28b624ef5bb12338NJK + 66
        frame #16: 0x0000000100bab4f9 servo`js::gc::FinalizeArenas(js::FreeOp*, js::gc::ArenaHeader**, js::gc::ArenaList&, js::gc::AllocKind, js::SliceBudget&) [inlined] bool js::gc::FinalizeTypedArenas<JSObject>(src=<unavailable>) + 357 at jsobjinlines.h:235
        frame #17: 0x0000000100bab394 servo`js::gc::FinalizeArenas(fop=<unavailable>, src=<unavailable>, dest=<unavailable>, thingKind=<unavailable>, budget=<unavailable>) + 52 at jsgc.cpp:449
        frame #18: 0x0000000100bac74f servo`js::gc::ArenaLists::queueObjectsForSweep(this=<unavailable>, fop=<unavailable>) + 175 at jsgc.cpp:1627
        frame #19: 0x0000000100bb147f servo`IncrementalCollectSlice(rt=<unavailable>, budget=<unavailable>, reason=<unavailable>, gckind=<unavailable>) + 5199 at jsgc.cpp:3752
        frame #20: 0x0000000100bafc79 servo`GCCycle(rt=<unavailable>, incremental=<unavailable>, budget=<unavailable>, gckind=<unavailable>, reason=<unavailable>) + 681 at jsgc.cpp:4394
        frame #21: 0x0000000100badc79 servo`Collect(rt=<unavailable>, incremental=<unavailable>, budget=<unavailable>, gckind=<unavailable>, reason=<unavailable>) + 457 at jsgc.cpp:4506
        frame #22: 0x0000000100b843a5 servo`js::DestroyContext(cx=<unavailable>, mode=<unavailable>) + 261 at jscntxt.cpp:398
        frame #23: 0x0000000100aaaff5 servo`js::rust::Cx.Drop::drop(self=0x00000001161f99f0) + 69 at rust.rs:94
        frame #24: 0x000000010050ac22 servo`js..rust..Cx::glue_drop.66249::h26f0641f514e6b73 + 82
        frame #25: 0x000000010050a940 servo`rc::Rc$LT$T$GT$.Drop::drop::h14182860636721081304 + 320
        frame #26: 0x000000010050a7fe servo`alloc..rc..Rc$LT$js..rust..Cx$GT$::glue_drop.66246::h0739dc8451f72e76 + 46
        frame #27: 0x0000000100606e35 servo`page..JSPageInfo::glue_drop.70947::h4b24778fd88ed6b6 + 53
        frame #28: 0x0000000100606df6 servo`core..option..Option$LT$page..JSPageInfo$GT$::glue_drop.70944::h9717b77a1086892a + 102
        frame #29: 0x00000001009a4fb3 servo`script::script_task::shut_down_layout(page_tree=0x00000001161ff960, rt=0x000000010f3ac000) + 1667 at script_task.rs:1098
        frame #30: 0x000000010098fab4 servo`script::script_task::ScriptTask::handle_exit_pipeline_msg(self=0x00000001161ff960, id=(0)) + 1156 at script_task.rs:723
        frame #31: 0x00000001009657a6 servo`script::script_task::ScriptTask::handle_msgs(self=0x00000001161ff960) + 7302 at script_task.rs:532
        frame #32: 0x0000000100963b12 servo`script::script_task::ScriptTask::start(self=0x00000001161ff960) + 66 at script_task.rs:407
        frame #33: 0x0000000100111891 servo`script_task::ScriptTask.ScriptTaskFactory::create::closure.10734 + 1249
        frame #34: 0x00000001012cd362 servo`util::rtinstrument::instrument(f=<unavailable>) + 994 at rtinstrument.rs:98
        frame #35: 0x00000001000f6b41 servo`task::spawn_named_with_send_on_failure::closure.10214 + 145
        frame #36: 0x000000010010d4b6 servo`task::TaskBuilder$LT$S$GT$::try_future::closure.10630 + 70
        frame #37: 0x0000000100d32f2d servo`task::bootstrap_green_task::closure.6832 + 109
        frame #38: 0x000000010150590c servo`rust_try_inner + 12
        frame #39: 0x00000001015058f6 servo`rust_try + 6
        frame #40: 0x0000000101502537 servo`unwind::try::hef59009c1de381e8xFd + 71
        frame #41: 0x00000001015023ec servo`task::Task::run::h6af0212431b92fd5MVc + 124
        frame #42: 0x0000000100d32df0 servo`task::bootstrap_green_task::hcb2cc30f27b6339465b + 240
    

    So the thing I checked is that the offender is really sending to a closed channel in node.rs. I replaced send with send_opt and it looks like it no longer fails. However, it doesn't look like a fix and we should understand why is this happening and why the author did expect this LayoutChan to be alive. Any ideas?

  3. jdm commented on Nov 9, 2014

    @jdm
    Member

    Oh right, I remember coming across that in #2122.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions