mozilla / fix-stacks

This program post-processes the stack frames produced by `MozFormatCodeAddress()`.
Apache License 2.0
21 stars 8 forks source link

Wrong stack when hitting assertion on a linux64 debug build #17

Closed emilio closed 4 years ago

emilio commented 4 years ago

I get this:

 4:16.44 GECKO(1292365) [Parent 1292446, Main Thread] ###!!! ASSERTION: Unexpected UpdateTransformLayer hint: '!(aChange & nsChangeHint_UpdateTransformLayer) || aFrame->IsTransformed() || aFrame->StyleDisplay()->HasTransformStyle()', file /home/emilio/src/moz/gecko-4/layout/base/RestyleManager.cpp, line 1168
 4:16.44 GECKO(1292365) #01: nsTArray_base<nsTArrayInfallibleAllocator, nsTArray_CopyWithMemutils>::Length() const (/home/emilio/src/moz/gecko-4/obj-debug/dist/include/nsTArray.h:339)
 4:16.44 GECKO(1292365) #02: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) (/home/emilio/src/moz/gecko-4/layout/base/PresShell.cpp:4080)
 4:16.44 GECKO(1292365) #03: ~RefPtr (/home/emilio/src/moz/gecko-4/obj-debug/dist/include/mozilla/RefPtr.h:80)
 4:16.44 GECKO(1292365) #04: nsINode::GetBoolFlag(nsINode::BooleanFlag) const (/home/emilio/src/moz/gecko-4/dom/base/nsINode.h:1704)
 4:16.45 GECKO(1292365) #05: mozilla::dom::Element::GetBoundingClientRect() (/home/emilio/src/moz/gecko-4/dom/base/Element.cpp:879)
 4:16.45 GECKO(1292365) #06: already_AddRefed<mozilla::dom::DOMRect>::take() (/home/emilio/src/moz/gecko-4/obj-debug/dist/include/mozilla/AlreadyAddRefed.h:146)
 4:16.45 GECKO(1292365) #07: bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ThrowExceptions>(JSContext*, unsigned int, JS::Value*) (/home/emilio/src/moz/gecko-4/dom/bindings/BindingUtils.cpp:3217)
 4:16.45 GECKO(1292365) #08: CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) (/home/emilio/src/moz/gecko-4/js/src/vm/Interpreter.cpp:477)
 4:16.45 GECKO(1292365) #09: js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) (/home/emilio/src/moz/gecko-4/js/src/vm/Interpreter.cpp:569)
 4:16.45 GECKO(1292365) #10: Interpret(JSContext*, js::RunState&) (Interpreter.cpp:?)
 4:16.45 GECKO(1292365) #11: js::RunScript(JSContext*, js::RunState&) (/home/emilio/src/moz/gecko-4/js/src/vm/Interpreter.cpp:449)
 4:16.45 GECKO(1292365) #12: js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) (/home/emilio/src/moz/gecko-4/js/src/vm/Interpreter.cpp:604)
 4:16.45 GECKO(1292365) #13: js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>, js::CallReason) (/home/emilio/src/moz/gecko-4/js/src/vm/Interpreter.cpp:649)
 4:16.45 GECKO(1292365) #14: js::jit::InvokeFunction(JSContext*, JS::Handle<JSObject*>, bool, bool, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (/home/emilio/src/moz/gecko-4/js/src/jit/VMFunctions.cpp:265)
 4:16.45 GECKO(1292365) #15: js::jit::InvokeFromInterpreterStub(JSContext*, js::jit::InterpreterStubExitFrameLayout*) (/home/emilio/src/moz/gecko-4/js/src/jit/VMFunctions.cpp:285)
 4:16.45 GECKO(1292365) #16: ??? (???:???)

Frames 1, 3, 4, and 5 are clearly wrong.

There are STR here for example (I don't think it's a very useful assertion: https://bugzilla.mozilla.org/show_bug.cgi?id=1332588).

emilio commented 4 years ago

cc @nnethercote

nnethercote commented 4 years ago

@emilio: I haven't yet enabled fix-stacks for Firefox test output; I'm about to land that change in https://bugzilla.mozilla.org/show_bug.cgi?id=1619837. So unless you are doing something unusual, the stack fixing is being performed by the old fix_linux_stack.py script, which uses addr2line.

Can you check if this is the case? Just look here in your copy of the code and see if it's using fix_linux_stack.py.

I will try to reproduce this myself and see how the old stack fixer compares against the new one.

nnethercote commented 4 years ago

Thinking some more: how are you running this? Is it just a normal browser run (mach run or similar), or are you running tests? I ask because no stack-fixing occurs on a normal browser run.

Also, I can't reproduce the assertion failure. Which STR from bug 1332588 should I use? I tried loading the test file and also loading mozilla.slack.com, but neither worked for me.

emilio commented 4 years ago

I was running a mochitest, and poking at the JS debugger which triggered some of these assertions.

emilio commented 4 years ago

But anyhow yeah wasn't doing anything fancy so probably not a fix-stacks issue...

nnethercote commented 4 years ago

I'd be interested to know if fix-stacks produces a better stack, once it's enabled for tests :)