Closed Bug 997709 Opened 12 years ago Closed 11 years ago

crash in mozalloc_abort(char const*) | Abort | NS_DebugBreak | nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext*, nsIFrame*, nsIFrame*, bool) on print/print preview

Categories

(Core :: Layout, defect)

defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: martijn.martijn, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: crash, testcase)

Crash Data

Attachments

(6 files)

Attached file crash1.htm —
See testcase, which crashes on printing/print preview. This bug was filed from the Socorro interface and is report bp-8d181892-3e96-4e09-9445-fb3092140417. ============================================================= 0 libmozalloc.dylib mozalloc_abort(char const*) memory/mozalloc/mozalloc_abort.cpp 1 XUL Abort xpcom/base/nsDebugImpl.cpp 2 XUL NS_DebugBreak xpcom/base/nsDebugImpl.cpp 3 XUL nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext*, nsIFrame*, nsIFrame*, bool) layout/base/nsCSSFrameConstructor.cpp 4 XUL nsBlockFrame::ReflowBlockFrame(nsBlockReflowState&, nsLineList_iterator, bool*) layout/generic/nsBlockFrame.cpp 5 XUL nsBlockFrame::ReflowDirtyLines(nsBlockReflowState&) layout/generic/nsBlockFrame.cpp 6 XUL nsBlockFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) layout/generic/nsBlockFrame.cpp 7 XUL nsComboboxControlFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) layout/forms/nsComboboxControlFrame.cpp 8 XUL nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame*, nsPresContext*, nsHTMLReflowState const&, nsRect const&, bool, nsIFrame*, unsigned int&, nsOverflowAreas*) layout/generic/nsAbsoluteContainingBlock.cpp 9 XUL nsAbsoluteContainingBlock::Reflow(nsContainerFrame*, nsPresContext*, nsHTMLReflowState const&, unsigned int&, nsRect const&, bool, bool, bool, nsOverflowAreas*) layout/generic/nsAbsoluteContainingBlock.cpp 10 XUL nsFrame::ReflowAbsoluteFrames(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&, bool) layout/generic/nsFrame.cpp
Assignee: nobody → mats
OS: Mac OS X → All
Attached file Testcase #2 —
We're trying to split a nsComboboxDisplayFrame which isn't supported. The frame dump shows the root of the problem: note that the frame is on its own line (with state=block) and the dropdown button on the next line. A single line block isn't splittable but a two-line block is. The reason is that the (red) frame has been blockified in ApplyStyleFixups because the parent context has display:flex. This not only causes the Print crash but also wrong layout as can be seen by just loading Testcase #2 (but don't Print/Preview it!). This is a general problem with that code when the frame ctor ignores display:flex/grid when constructing the frame.
Attachment #8610263 - Attachment description: Framedump + stack of Testcase #2 in Print Preview (crashing) → Framedump + stack of Testcase #2 in Print Preview
This fixes the crash, but the layout is still wrong.
Attachment #8610264 - Flags: review?(cam)
This fixes the layout by suppressing the ApplyStyleFixups blockification for the anonymous nsComboboxDisplayFrame.
Attachment #8610265 - Flags: review?(cam)
It wouldn't surprise me if other frame types have wrong layout with display:flex/grid due to this bogus blockification.
(In reply to Mats Palmgren (:mats) from comment #6) > It wouldn't surprise me if other frame types have wrong layout with > display:flex/grid due to this bogus blockification. Yeah. Is there any general rule that we could apply here to determine whether the blockification should be skipped? Nothing comes to me, but if there is, it might make sense to add the logic for skipping blockification to ApplyStyleFixups itself. Will you audit other frames to make sure we're not blockifying other anonymous box children unnecessarily?
Attachment #8610264 - Flags: review?(cam) → review+
Comment on attachment 8610265 [details] [diff] [review] part 2 - Prevent the nsComboboxDisplayFrame from being blockified if the parent context has display:flex/grid Review of attachment 8610265 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/style/nsStyleSet.h @@ +193,5 @@ > mozilla::dom::Element* aPseudoElement = nullptr); > > + /** > + * Bit-flags that can be passed to ResolveAnonymousBoxStyle, GetContext, > + * in its parameter 'aFlags'. s/, GetContext, in its/ and GetContext in their/
Attachment #8610265 - Flags: review?(cam) → review+
Attachment #8610266 - Flags: review+
Flags: in-testsuite+
Blocks: 1169627
(In reply to Cameron McCormack (:heycam) from comment #7) > (In reply to Mats Palmgren (:mats) from comment #6) > > It wouldn't surprise me if other frame types have wrong layout with > > display:flex/grid due to this bogus blockification. > > Yeah. Is there any general rule that we could apply here to determine > whether the blockification should be skipped? Nothing comes to me, but if > there is, it might make sense to add the logic for skipping blockification > to ApplyStyleFixups itself. I don't see simple solution for this specific case since we would need the parent frame type to determine if its 'display' was "ignored" or not. > Will you audit other frames to make sure we're not blockifying other > anonymous box children unnecessarily? Filed bug 1169627.
Verified fixed, using the latest trunk build on MacOSX10.9.5
Status: RESOLVED → VERIFIED
Depends on: 1340622
Depends on: 1353423
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: