Closed Bug 1292280 Opened 8 years ago Closed 8 years ago

Stylo Assertion failure: aNode->IsDirtyForServo() || aNode->HasDirtyDescendantsForServo(), at layout/style/ServoStyleSet.cpp

Categories

(Core :: DOM: HTML Parser, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: cpeterson, Assigned: emilio)

References

Details

(Keywords: assertion, Whiteboard: [stylo:m2])

Attachments

(1 file, 1 obsolete file)

To reproduce, run `./mach reftest --disable-e10s <filename>` or replace <filename> with `layout/reftest/reftest.list`.

TEST-UNEXPECTED-FAIL | file:///home/shinglyu/workspace/stylo/gecko-dev/layout/reftests/pagination/abspos-breaking-003.html | application terminated with exit code 11
REFTEST PROCESS-CRASH | file:///home/shinglyu/workspace/stylo/gecko-dev/layout/reftests/pagination/abspos-breaking-003.html | application crashed [None]

Assertion failure: aNode->IsDirtyForServo() || aNode->HasDirtyDescendantsForServo(), at /files/mozilla/stylo/bb/gecko/layout/style/ServoStyleSet.cpp:421
I went through this, and it's sort of scary.

First of all, backtrace:

#0  0x00007fffe4bf6c16 in mozilla::ServoStyleSet::RestyleSubtree(nsINode*) (this=0x7fffb42c0ac0, aNode=0x7fffc9ad9640)
    at /home/emilio/projects/moz/stylo/gecko/layout/style/ServoStyleSet.cpp:464
#1  0x00007fffe4bf51d4 in mozilla::ServoStyleSet::StartStyling(nsPresContext*) (this=0x7fffb42c0ac0, aPresContext=0x7fffb5ab7800)
    at /home/emilio/projects/moz/stylo/gecko/layout/style/ServoStyleSet.cpp:81
#2  0x00007fffe4e8011e in PresShell::Initialize(int, int) (this=0x7fffb42b2c00, aWidth=48000, aHeight=60000) at /home/emilio/projects/moz/stylo/gecko/layout/base/nsPresShell.cpp:1686
#3  0x00007fffe4e41722 in nsDocumentViewer::InitPresentationStuff(bool) (this=0x7fffb043cbd0, aDoInitialReflow=true)
    at /home/emilio/projects/moz/stylo/gecko/layout/base/nsDocumentViewer.cpp:675
#4  0x00007fffe4e425b8 in nsDocumentViewer::InitInternal(nsIWidget*, nsISupports*, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const&, bool, bool, bool) (this=0x7fffb043cbd0, aParentWidget=0x0, aState=0x0, aBounds=..., aDoCreation=true, aNeedMakeCX=false, aForceSetNewDocument=false) at /home/emilio/projects/moz/stylo/gecko/layout/base/nsDocumentViewer.cpp:887
#5  0x00007fffe4e4f9e3 in nsDocumentViewer::SetPageMode(bool, nsIPrintSettings*) (this=0x7fffb043cbd0, aPageMode=true, aPrintSettings=0x7fffbe7640a0)
    at /home/emilio/projects/moz/stylo/gecko/layout/base/nsDocumentViewer.cpp:4363
#6  0x00007fffe0faa68c in NS_InvokeByIndex(nsISupports*, uint32_t, uint32_t, nsXPTCVariant*) (that=0x7fffb043cbd0, methodIndex=33, paramCount=2, params=0x7fffffff8508)
    at /home/emilio/projects/moz/stylo/gecko/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_unix.cpp:182
#7  0x00007fffe2007161 in CallMethodHelper::Invoke() (this=0x7fffffff84c0) at /home/emilio/projects/moz/stylo/gecko/js/xpconnect/src/XPCWrappedNative.cpp:2064
#8  0x00007fffe2004ce1 in CallMethodHelper::Call() (this=0x7fffffff84c0) at /home/emilio/projects/moz/stylo/gecko/js/xpconnect/src/XPCWrappedNative.cpp:1383
#9  0x00007fffe1fe97b1 in XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode) (ccx=..., mode=XPCWrappedNative::CALL_METHOD)
    at /home/emilio/projects/moz/stylo/gecko/js/xpconnect/src/XPCWrappedNative.cpp:1350
#10 0x00007fffe1ff286e in XPC_WN_CallMethod(JSContext*, unsigned int, JS::Value*) (cx=0x7fffdd262000, argc=2, vp=0x7fffd2c27130)
    at /home/emilio/projects/moz/stylo/gecko/js/xpconnect/src/XPCWrappedNativeJSOps.cpp:1143
#11 0x00007fffe6fffb86 in js::CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), JS::CallArgs const&) (cx=0x7fffdd262000, native=0x7fffe1ff2559 <XPC_WN_CallMethod(JSContext*, unsigned int, JS::Value*)>, args=...) at /home/emilio/projects/moz/stylo/gecko/js/src/jscntxtinlines.h:235
#12 0x00007fffe6fc6dc5 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (cx=0x7fffdd262000, args=..., construct=js::NO_CONSTRUCT)
    at /home/emilio/projects/moz/stylo/gecko/js/src/vm/Interpreter.cpp:453
#13 0x00007fffe6fc70ec in InternalCall(JSContext*, js::AnyInvokeArgs const&) (cx=0x7fffdd262000, args=...) at /home/emilio/projects/moz/stylo/gecko/js/src/vm/Interpreter.cpp:498
#14 0x00007fffe6fc7116 in js::CallFromStack(JSContext*, JS::CallArgs const&) (cx=0x7fffdd262000, args=...) at /home/emilio/projects/moz/stylo/gecko/js/src/vm/Interpreter.cpp:504
#15 0x00007fffe6fd4325 in Interpret(JSContext*, js::RunState&) (cx=0x7fffdd262000, state=...) at /home/emilio/projects/moz/stylo/gecko/js/src/vm/Interpreter.cpp:2881
#16 0x00007fffe6fc6a47 in js::RunScript(JSContext*, js::RunState&) (cx=0x7fffdd262000, state=...) at /home/emilio/projects/moz/stylo/gecko/js/src/vm/Interpreter.cpp:399
#17 0x00007fffe6fc6e94 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (cx=0x7fffdd262000, args=..., construct=js::NO_CONSTRUCT)
    at /home/emilio/projects/moz/stylo/gecko/js/src/vm/Interpreter.cpp:471
#18 0x00007fffe6fc70ec in InternalCall(JSContext*, js::AnyInvokeArgs const&) (cx=0x7fffdd262000, args=...) at /home/emilio/projects/moz/stylo/gecko/js/src/vm/Interpreter.cpp:498
#19 0x00007fffe6fc7183 in js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>) (cx=0x7fffdd262000, fval=$jsval((JSObject *) 0x7fffc93ba0c0 [object Function "OnDocumentLoad"]), thisv=$jsval((JSObject *) 0x7fffb5bdee20 [object ContentFrameMessageManager] delegate), args=..., rval=JSVAL_VOID)
    at /home/emilio/projects/moz/stylo/gecko/js/src/vm/Interpreter.cpp:517
#20 0x00007fffe6d5ef48 in JS_CallFunctionValue(JSContext*, JS::Handle<JSObject*>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) (cx=0x7fffdd262000, obj=(JSObject * const) 0x7fffb5bdee20 [object ContentFrameMessageManager] delegate, fval=$jsval((JSObject *) 0x7fffc93ba0c0 [object Function "OnDocumentLoad"]), args=..., rval=JSVAL_VOID)
    at /home/emilio/projects/moz/stylo/gecko/js/src/jsapi.cpp:2777
#21 0x00007fffe1fe3c1f in nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS*, unsigned short, XPTMethodDescriptor const*, nsXPTCMiniVariant*) (this=0x7fffbc8fbe20, wrapper=0x7fffbc04b480, methodIndex=3, info_=0x7fffdd3b3250, nativeParams=0x7fffffffaf20) at /home/emilio/projects/moz/stylo/gecko/js/xpconnect/src/XPCWrappedJSClass.cpp:1211
#22 0x00007fffe1fdeba7 in nsXPCWrappedJS::CallMethod(unsigned short, XPTMethodDescriptor const*, nsXPTCMiniVariant*) (this=0x7fffbc04b480, methodIndex=3, info=0x7fffdd3b3250, params=0x7fffffffaf20) at /home/emilio/projects/moz/stylo/gecko/js/xpconnect/src/XPCWrappedJS.cpp:613
#23 0x00007fffe0faabf5 in PrepareAndDispatch(nsXPTCStubBase*, uint32_t, uint64_t*, uint64_t*, double*) (self=0x7fffbc347c80, methodIndex=3, args=0x7fffffffb0b0, gpregs=0x7fffffffb030, fpregs=0x7fffffffb060) at /home/emilio/projects/moz/stylo/gecko/xpcom/reflect/xptcall/md/unix/xptcstubs_x86_64_linux.cpp:122
#24 0x00007fffe0faac8d in SharedStub () at /home/emilio/projects/moz/stylo/gecko/xpcom/reflect/xptcall/md/unix/xptcstubs_x86_64_linux.cpp:128
#25 0x00007fffe3c69c3f in mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, nsIDOMEvent*, mozilla::dom::EventTarget*) (this=0x7fffb64acbc0, aListener=0x7fffbc050638, aDOMEvent=0x7fffb457bd60, aCurrentTarget=0x7fffb046e790) at /home/emilio/projects/moz/stylo/gecko/dom/events/EventListenerManager.cpp:1133
#26 0x00007fffe3c6a3b6 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, nsIDOMEvent**, mozilla::dom::EventTarget*, nsEventStatus*) (this=0x7fffb64acbc0, aPresContext=0x7fffb5d05800, aEvent=0x7fffffffb6c0, aDOMEvent=0x7fffffffb4b0, aCurrentTarget=0x7fffb046e790, aEventStatus=0x7fffffffb4b8)
    at /home/emilio/projects/moz/stylo/gecko/dom/events/EventListenerManager.cpp:1286
#27 0x00007fffe3c834f8 in mozilla::EventListenerManager::HandleEvent(nsPresContext*, mozilla::WidgetEvent*, nsIDOMEvent**, mozilla::dom::EventTarget*, nsEventStatus*) (this=0x7fffb64acbc0, a---Type <return> to continue, or q <return> to quit---
PresContext=0x7fffb5d05800, aEvent=0x7fffffffb6c0, aDOMEvent=0x7fffffffb4b0, aCurrentTarget=0x7fffb046e790, aEventStatus=0x7fffffffb4b8)
    at /home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/dist/include/mozilla/EventListenerManager.h:375
#28 0x00007fffe3c86910 in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) (this=0x7fffcc9be030, aVisitor=..., aCd=...)
    at /home/emilio/projects/moz/stylo/gecko/dom/events/EventDispatcher.cpp:278
#29 0x00007fffe3c627a8 in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) (aChain=nsTArray<mozilla::EventTargetChainItem> & = {...}, aVisitor=..., aCallback=0x0, aCd=...)
    at /home/emilio/projects/moz/stylo/gecko/dom/events/EventDispatcher.cpp:358
#30 0x00007fffe3c63bf7 in mozilla::EventDispatcher::Dispatch(nsISupports*, nsPresContext*, mozilla::WidgetEvent*, nsIDOMEvent*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsTArray<mozilla::dom::EventTarget*>*) (aTarget=0x7fffbbc18020, aPresContext=0x7fffb5d05800, aEvent=0x7fffffffb6c0, aDOMEvent=0x0, aEventStatus=0x7fffffffb76c, aCallback=0x0, aTargets=0x0)
    at /home/emilio/projects/moz/stylo/gecko/dom/events/EventDispatcher.cpp:712
#31 0x00007fffe4e42c90 in nsDocumentViewer::LoadComplete(nsresult) (this=0x7fffb043cbd0, aStatus=nsresult::NS_OK)
    at /home/emilio/projects/moz/stylo/gecko/layout/base/nsDocumentViewer.cpp:996
#32 0x00007fffe54dba41 in nsDocShell::EndPageLoad(nsIWebProgress*, nsIChannel*, nsresult) (this=0x7fffbe9ac000, aProgress=0x7fffbe9ac028, aChannel=0x7fffbebeea90, aStatus=nsresult::NS_OK)
    at /home/emilio/projects/moz/stylo/gecko/docshell/base/nsDocShell.cpp:7601
#33 0x00007fffe54dae45 in nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult) (this=0x7fffbe9ac000, aProgress=0x7fffbe9ac028, aRequest=0x7fffbebeea90, aStateFlags=131088, aStatus=nsresult::NS_OK) at /home/emilio/projects/moz/stylo/gecko/docshell/base/nsDocShell.cpp:7402
#34 0x00007fffe227b618 in nsDocLoader::DoFireOnStateChange(nsIWebProgress*, nsIRequest*, int&, nsresult) (this=0x7fffbe9ac000, aProgress=0x7fffbe9ac028, aRequest=0x7fffbebeea90, aStateFlags=@0x7fffffffc08c: 131088, aStatus=nsresult::NS_OK) at /home/emilio/projects/moz/stylo/gecko/uriloader/base/nsDocLoader.cpp:1252
#35 0x00007fffe227a108 in nsDocLoader::doStopDocumentLoad(nsIRequest*, nsresult) (this=0x7fffbe9ac000, request=0x7fffbebeea90, aStatus=nsresult::NS_OK)
    at /home/emilio/projects/moz/stylo/gecko/uriloader/base/nsDocLoader.cpp:836
#36 0x00007fffe2279c49 in nsDocLoader::DocLoaderIsEmpty(bool) (this=0x7fffbe9ac000, aFlushLayout=true) at /home/emilio/projects/moz/stylo/gecko/uriloader/base/nsDocLoader.cpp:726
#37 0x00007fffe227968b in nsDocLoader::OnStopRequest(nsIRequest*, nsISupports*, nsresult) (this=0x7fffbe9ac000, aRequest=0x7fffbe80d4c0, aCtxt=0x0, aStatus=nsresult::NS_OK)
    at /home/emilio/projects/moz/stylo/gecko/uriloader/base/nsDocLoader.cpp:608
#38 0x00007fffe10b3a50 in mozilla::net::nsLoadGroup::RemoveRequest(nsIRequest*, nsISupports*, nsresult) (this=0x7fffc97c5260, request=0x7fffbe80d4c0, ctxt=0x0, aStatus=nsresult::NS_OK)
    at /home/emilio/projects/moz/stylo/gecko/netwerk/base/nsLoadGroup.cpp:633
#39 0x00007fffe2aaea8a in nsDocument::DoUnblockOnload() (this=0x7fffbec44000) at /home/emilio/projects/moz/stylo/gecko/dom/base/nsDocument.cpp:9190
#40 0x00007fffe2aae7a0 in nsDocument::UnblockOnload(bool) (this=0x7fffbec44000, aFireSync=true) at /home/emilio/projects/moz/stylo/gecko/dom/base/nsDocument.cpp:9118
#41 0x00007fffe2a9f26a in nsDocument::DispatchContentLoadedEvents() (this=0x7fffbec44000) at /home/emilio/projects/moz/stylo/gecko/dom/base/nsDocument.cpp:5248
#42 0x00007fffe2b4281f in mozilla::detail::RunnableMethodArguments<>::applyImpl<nsDocument, void (nsDocument::*)()>(nsDocument*, void (nsDocument::*)(), mozilla::Tuple<>&, mozilla::IndexSequence<>) (o=0x7fffbec44000, m=(void (nsDocument::*)(nsDocument * const)) 0x7fffe2a9ea80 <nsDocument::DispatchContentLoadedEvents()>, args=...)
    at /home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/dist/include/nsThreadUtils.h:729
#43 0x00007fffe2b42700 in mozilla::detail::RunnableMethodArguments<>::apply<nsDocument, void (nsDocument::*)()>(nsDocument*, void (nsDocument::*)()) (this=0x7fffbec70c70, o=0x7fffbec44000, m=(void (nsDocument::*)(nsDocument * const)) 0x7fffe2a9ea80 <nsDocument::DispatchContentLoadedEvents()>)
    at /home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/dist/include/nsThreadUtils.h:736
#44 0x00007fffe2b4244f in mozilla::detail::RunnableMethodImpl<void (nsDocument::*)(), true, false>::Run() (this=0x7fffbec70c40)
    at /home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/dist/include/nsThreadUtils.h:764
#45 0x00007fffe0f804be in nsThread::ProcessNextEvent(bool, bool*) (this=0x7ffff6bbca00, aMayWait=false, aResult=0x7fffffffc83f)
    at /home/emilio/projects/moz/stylo/gecko/xpcom/threads/nsThread.cpp:1058
#46 0x00007fffe0fe93aa in NS_ProcessNextEvent(nsIThread*, bool) (aThread=0x7ffff6bbca00, aMayWait=false) at /home/emilio/projects/moz/stylo/gecko/xpcom/glue/nsThreadUtils.cpp:290
#47 0x00007fffe1721211 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) (this=0x7fffdeae3180, aDelegate=0x7ffff6bdb0b0)
    at /home/emilio/projects/moz/stylo/gecko/ipc/glue/MessagePump.cpp:96
#48 0x00007fffe168fe1d in MessageLoop::RunInternal() (this=0x7ffff6bdb0b0) at /home/emilio/projects/moz/stylo/gecko/ipc/chromium/src/base/message_loop.cc:232
#49 0x00007fffe168fdb0 in MessageLoop::RunHandler() (this=0x7ffff6bdb0b0) at /home/emilio/projects/moz/stylo/gecko/ipc/chromium/src/base/message_loop.cc:225
#50 0x00007fffe168fd89 in MessageLoop::Run() (this=0x7ffff6bdb0b0) at /home/emilio/projects/moz/stylo/gecko/ipc/chromium/src/base/message_loop.cc:205
#51 0x00007fffe49e48c2 in nsBaseAppShell::Run() (this=0x7fffd2c2ef20) at /home/emilio/projects/moz/stylo/gecko/widget/nsBaseAppShell.cpp:156
#52 0x00007fffe59ac04d in nsAppStartup::Run() (this=0x7fffd2c8d290) at /home/emilio/projects/moz/stylo/gecko/toolkit/components/startup/nsAppStartup.cpp:284
#53 0x00007fffe5a6cb67 in XREMain::XRE_mainRun() (this=0x7fffffffced0) at /home/emilio/projects/moz/stylo/gecko/toolkit/xre/nsAppRunner.cpp:4306
#54 0x00007fffe5a6d10e in XREMain::XRE_main(int, char**, nsXREAppData const*) (this=0x7fffffffced0, argc=4, argv=0x7fffffffe328, aAppData=0x7fffffffe0d0)
    at /home/emilio/projects/moz/stylo/gecko/toolkit/xre/nsAppRunner.cpp:4433
---Type <return> to continue, or q <return> to quit---
#55 0x00007fffe5a6d3de in XRE_main(int, char**, nsXREAppData const*, uint32_t) (argc=4, argv=0x7fffffffe328, aAppData=0x7fffffffe0d0, aFlags=0)
    at /home/emilio/projects/moz/stylo/gecko/toolkit/xre/nsAppRunner.cpp:4524
#56 0x0000000000405a3d in do_main(int, char**, char**, nsIFile*) (argc=4, argv=0x7fffffffe328, envp=0x7fffffffe350, xreDirectory=0x7ffff6b54b40)
    at /home/emilio/projects/moz/stylo/gecko/browser/app/nsBrowserApp.cpp:259
#57 0x0000000000405d26 in main(int, char**, char**) (argc=4, argv=0x7fffffffe328, envp=0x7fffffffe350) at /home/emilio/projects/moz/stylo/gecko/browser/app/nsBrowserApp.cpp:392
Some things like nsDocumentViewer::SetPageMode recreate the presShell, so we
can't rely on the root flags being correctly set always.
Assignee: nobody → ecoal95
Status: NEW → ASSIGNED
Attachment #8784983 - Flags: review?(bobbyholley)
Comment on attachment 8784983 [details] [diff] [review]
Force a full document restyle on ServoStyleset::StartStyling

Review of attachment 8784983 [details] [diff] [review]:
-----------------------------------------------------------------

This needs rebasing.
Attachment #8784983 - Flags: review?(bobbyholley)
Attachment #8784983 - Attachment is obsolete: true
Comment on attachment 8785531 [details]
Bug 1292280: Force a full document restyle on ServoStyleSet::StartStyling.

https://reviewboard.mozilla.org/r/74708/#review72566

r=me with that.

::: layout/style/ServoStyleSet.cpp:483
(Diff revision 1)
>      ClearDirtyBits(n);
>    }
>  }
>  
>  void
> -ServoStyleSet::StyleDocument(bool aLeaveDirtyBits)
> +ServoStyleSet::StyleDocument(bool aLeaveDirtyBits, bool aForce)

I'd really not add another bool parameter.

Instead, how about just having StartStyling mark the document as dirty, and then unmark the dirty it on the document in the !root case? That should be equivalent.
Attachment #8785531 - Flags: review?(bobbyholley) → review+
Comment on attachment 8785531 [details]
Bug 1292280: Force a full document restyle on ServoStyleSet::StartStyling.

https://reviewboard.mozilla.org/r/74708/#review72566

> I'd really not add another bool parameter.
> 
> Instead, how about just having StartStyling mark the document as dirty, and then unmark the dirty it on the document in the !root case? That should be equivalent.

Given we restyle from the root element, servo has no way to know the document is dirty. We need to mark the root as dirty. I can set the root as dirty directly though, if that's what you meant.
Comment on attachment 8785531 [details]
Bug 1292280: Force a full document restyle on ServoStyleSet::StartStyling.

https://reviewboard.mozilla.org/r/74708/#review72566

> Given we restyle from the root element, servo has no way to know the document is dirty. We need to mark the root as dirty. I can set the root as dirty directly though, if that's what you meant.

Oh yeah I see. Yeah I think I'd prefer to grab the root element (if it exists) in the caller and mark it as dirty. We can shuffle things around later if it becomes clear that a different approach makes sense.
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/3cd14570a06e
Force a full document restyle on ServoStyleSet::StartStyling. r=bholley
https://hg.mozilla.org/mozilla-central/rev/3cd14570a06e
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: