Last Comment Bug 347367 - crash when print preview is opened on a certain file styled with meda=print [@ BasicTableLayoutStrategy::CalcPctAdjTableWidth]
: crash when print preview is opened on a certain file styled with meda=print [...
Status: VERIFIED FIXED
: crash, fixed1.8.1.15, testcase
Product: Core
Classification: Components
Component: Layout: Tables (show other bugs)
: Trunk
: All All
: -- critical (vote)
: ---
Assigned To: Bernd
:
Mentors:
http://www.tensen.net/research/firefo...
Depends on:
Blocks: 378027
  Show dependency treegraph
 
Reported: 2006-08-04 07:57 PDT by Dakota
Modified: 2013-01-26 16:45 PST (History)
9 users (show)
mats: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase from url (3.42 KB, text/html)
2006-08-04 12:34 PDT, Martijn Wargers [:mwargers] (gone per 2016-05-31 :-( )
no flags Details
patch (1.38 KB, patch)
2006-08-27 13:25 PDT, Bernd
roc: review+
roc: superreview+
dveditz: approval1.8.1.15+
Details | Diff | Review
patch (2.54 KB, patch)
2006-09-15 13:06 PDT, Bernd
roc: review+
roc: superreview+
dveditz: approval1.8.1.15+
Details | Diff | Review

Description Dakota 2006-08-04 07:57:25 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6

Using print preview on this page crashes firefox. The reason for this seems to be the implementation of CSS page breaking. This does not occur if there is only one page of information.

Reproducible: Always

Steps to Reproduce:
1. View file (http://www.tensen.net/research/firefox/display.html)
2. Print Preview
Actual Results:  
Firefox crashes and brings up the crash manager.

Expected Results:  
A preview of the document should have been generated styling the page with the CSS linked to with media=print according to the latest CSS standard published by the W3C.

This problem occured on
Microsoft Windows 2000 5.00.2195
Service Pack 4
Comment 1 Dakota 2006-08-04 08:07:41 PDT
This bug seems to apply only to the 'float' directive. This bug could lead to a loss of data in a different context (fill in a form on an affected page without submitting, print preview, crash, loss of data).
Comment 2 Steve England [:stevee] 2006-08-04 08:21:26 PDT
If firefox crashed and brought up the crash manager (called Talkback) did you submit crash data to mozilla? If so, what TalkbackID was it? (You can find talkback.exe in your firefox installation dir, run it, and it will list the crashes you have submitted).
Comment 3 Dakota 2006-08-04 08:46:30 PDT
These are two talkback ids associated with this problem.
TB21774577X
TB21774578Q
Comment 4 Adam Guthrie 2006-08-04 12:02:08 PDT
Incident ID: 21774578
Stack Signature	BasicTableLayoutStrategy::CalcPctAdjTableWidth d1220000
Product ID	Firefox15
Build ID	2006072814
Trigger Time	2006-08-04 07:32:54.0
Platform	Win32
Operating System	Windows NT 5.0 build 2195
Module	firefox.exe + (002f4691)
URL visited	http://www.tensen.net/research/firefox/display.html
User Comments	print preview on a page styled with media="print"
Since Last Crash	751 sec
Total Uptime	4645 sec
Trigger Reason	Access violation
Source File, Line No.	c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/tables/BasicTableLayoutStrategy.cpp, line 1285
Stack Trace 	
BasicTableLayoutStrategy::CalcPctAdjTableWidth  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/tables/BasicTableLayoutStrategy.cpp, line 1285]
BasicTableLayoutStrategy::AssignPctColumnWidths  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/tables/BasicTableLayoutStrategy.cpp, line 1382]
BasicTableLayoutStrategy::BalanceColumnWidths  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/tables/BasicTableLayoutStrategy.cpp, line 245]
nsTableFrame::BalanceColumnWidths  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/tables/nsTableFrame.cpp, line 3361]
nsTableFrame::ReflowTable  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/tables/nsTableFrame.cpp, line 2135]
nsTableFrame::Reflow  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/tables/nsTableFrame.cpp, line 1984]
nsContainerFrame::ReflowChild  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsContainerFrame.cpp, line 905]
nsTableOuterFrame::OuterReflowChild  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/tables/nsTableOuterFrame.cpp, line 1317]
nsTableOuterFrame::Reflow  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/tables/nsTableOuterFrame.cpp, line 1962]
nsBlockReflowContext::ReflowBlock  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockReflowContext.cpp, line 606]
nsBlockFrame::ReflowBlockFrame  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 3449]
nsBlockFrame::ReflowLine  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 2610]
nsBlockFrame::ReflowDirtyLines  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 2263]
nsBlockFrame::ComputeFinalSize  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 1332]
nsBlockFrame::Reflow  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 997]
nsBlockReflowContext::ReflowBlock  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockReflowContext.cpp, line 606]
nsBlockFrame::ReflowFloat  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 5925]
nsBlockReflowState::FlowAndPlaceFloat  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockReflowState.cpp, line 851]
nsBlockReflowState::AddFloat  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockReflowState.cpp, line 629]
nsLineLayout::ReflowFrame  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsLineLayout.cpp, line 1019]
nsBlockFrame::ReflowInlineFrame  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 4200]
nsBlockFrame::DoReflowInlineFrames  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 3853]
nsBlockFrame::ReflowInlineFrames  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 3735]
nsBlockFrame::ReflowLine  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 2729]
nsBlockFrame::ReflowDirtyLines  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 2263]
nsBlockFrame::Reflow  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 904]
nsBlockReflowContext::ReflowBlock  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockReflowContext.cpp, line 606]
nsBlockFrame::ReflowBlockFrame  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 3449]
nsBlockFrame::ReflowLine  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 2610]
nsBlockFrame::ReflowDirtyLines  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 2263]
nsBlockFrame::Reflow  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 904]
nsBlockReflowContext::ReflowBlock  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockReflowContext.cpp, line 606]
nsBlockFrame::ReflowBlockFrame  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 3449]
nsBlockFrame::ReflowLine  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 2610]
nsBlockFrame::ReflowDirtyLines  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 2263]
nsBlockFrame::Reflow  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsBlockFrame.cpp, line 904]
nsContainerFrame::ReflowChild  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsContainerFrame.cpp, line 905]
nsPageContentFrame::Reflow  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsPageContentFrame.cpp, line 103]
nsContainerFrame::ReflowChild  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsContainerFrame.cpp, line 905]
nsPageFrame::Reflow  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsPageFrame.cpp, line 210]
nsContainerFrame::ReflowChild  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsContainerFrame.cpp, line 905]
nsSimplePageSequenceFrame::Reflow  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsSimplePageSequence.cpp, line 405]
nsContainerFrame::ReflowChild  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsContainerFrame.cpp, line 905]
nsHTMLScrollFrame::ReflowScrolledFrame  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsGfxScrollFrame.cpp, line 523]
nsHTMLScrollFrame::ReflowContents  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsGfxScrollFrame.cpp, line 571]
nsHTMLScrollFrame::Reflow  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsGfxScrollFrame.cpp, line 769]
nsContainerFrame::ReflowChild  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsContainerFrame.cpp, line 905]
ViewportFrame::Reflow  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/generic/nsViewportFrame.cpp, line 240]
PresShell::InitialReflow  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/base/nsPresShell.cpp, line 2871]
nsPrintEngine::ReflowPrintObject  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/printing/nsPrintEngine.cpp, line 2731]
nsPrintEngine::ReflowDocList  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/printing/nsPrintEngine.cpp, line 2499]
nsPrintEngine::SetupToPrintContent  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/printing/nsPrintEngine.cpp, line 2309]
nsPrintEngine::DocumentReadyForPrinting  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/printing/nsPrintEngine.cpp, line 2135]
DocumentViewerImpl::PrintPreview  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/layout/base/nsDocumentViewer.cpp, line 3434]
XPTC_InvokeByIndex  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/xpcom/reflect/xptcall/src/md/win32/xptcinvoke.cpp, line 102]
XPCWrappedNative::CallMethod  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp, line 2155]
XPC_WN_CallMethod  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/js/src/xpconnect/src/xpcwrappednativejsops.cpp, line 1445]
js_Invoke  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/js/src/jsinterp.c, line 1188]
js_InternalInvoke  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/js/src/jsinterp.c, line 1285]
JS_CallFunctionValue  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/js/src/jsapi.c, line 4177]
XPC_NW_FunctionWrapper  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/js/src/xpconnect/src/XPCNativeWrapper.cpp, line 387]
js_Invoke  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/js/src/jsinterp.c, line 1188]
js_Interpret  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/js/src/jsinterp.c, line 3584]
js_Invoke  [c:/builds/tinderbox/Fx-Mozilla1.8.0-Release/WINNT_5.2_Depend/mozilla/js/src/jsinterp.c, line 1208]
Comment 5 Adam Guthrie 2006-08-04 12:06:05 PDT
This happens on Linux branch and trunk, too.
Comment 6 Martijn Wargers [:mwargers] (gone per 2016-05-31 :-( ) 2006-08-04 12:34:03 PDT
Created attachment 232185 [details]
testcase from url

Testcase from url, simplified a bit more, this crashes on print preview for me on current trunk build.
Comment 7 Dakota 2006-08-04 12:39:08 PDT
testcase created at 2006-08-04 12:34 PDT does not crash

Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4

but url does.
Comment 8 Martijn Wargers [:mwargers] (gone per 2016-05-31 :-( ) 2006-08-04 12:44:34 PDT
Sorry, indeed, the testcase is also only crashing in landscape format for me. It crashes also Mozilla1.7.12, so no (recent) regression.
Comment 9 Dakota 2006-08-04 12:48:38 PDT
It may be moot at this point since this bug seems to be platform independent, but the url also crashes

Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Comment 10 Bernd 2006-08-04 13:27:27 PDT
Martijn the stack is a typical cellmap crash watch for the rowgroups and how they split if you like to work on it, I am away till 06-08-21
Comment 11 Bernd 2006-08-27 13:25:40 PDT
Created attachment 235667 [details] [diff] [review]
patch
Comment 12 Bernd 2006-08-30 21:53:11 PDT
Comment on attachment 235667 [details] [diff] [review]
patch

have a look at OrderRowGroups to understand why reordering does not help with this.
Comment 13 Bernd 2006-09-02 23:13:30 PDT
fix checked in
Comment 14 Stephen Donner [:stephend] - PTO; back on 5/28 2006-09-10 14:33:08 PDT
(In reply to comment #8)
> Sorry, indeed, the testcase is also only crashing in landscape format for me.
> It crashes also Mozilla1.7.12, so no (recent) regression.

Don't we need a separate bug split off for this testcase using landscape?

I too no longer crash in portrait mode with the attachment, and neither landscape nor portrait with the live URL in comment 0, but I *do* still crash with Martijn's testcase in comment 8, with landscape.
Comment 15 Martijn Wargers [:mwargers] (gone per 2016-05-31 :-( ) 2006-09-11 05:43:12 PDT
(In reply to comment #14)
> I too no longer crash in portrait mode with the attachment, and neither
> landscape nor portrait with the live URL in comment 0, but I *do* still crash
> with Martijn's testcase in comment 8, with landscape.

Yeah, I'm crashing too with a 2006-09-07 trunk build, talkback ID: TB23149944K
This is still with the same kind of backtrace -> reopening

Comment 16 Bernd 2006-09-15 12:41:13 PDT
argh, I forgot the other half to get reviewed. The problem is that we need something like http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/tables/nsTableRowGroupFrame.cpp&rev=3.367&mark=1528-1531#1525
at the end of the ::reflow method instead of the incr. reflow methods.

If we do this the testcase, will trigger the float hang like bug 285608.
Comment 17 Bernd 2006-09-15 13:06:34 PDT
Created attachment 238671 [details] [diff] [review]
patch

Robert, I think this is the right thing to do, however once checked in the testcase will not crash but hang due to bug bug 285608. I am not sure that this is an improvement (other that we access deleted memory)
Comment 19 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2006-09-18 16:08:13 PDT
Comment on attachment 238671 [details] [diff] [review]
patch

I agree it's the right thing.
Comment 20 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2006-09-18 16:08:41 PDT
Comment on attachment 238671 [details] [diff] [review]
patch

I agree it's the right thing.
Comment 21 Bernd 2006-09-21 22:29:50 PDT
fix checked in. Please note that the new behavior on the test case could/should be a hang
Comment 22 Stephen Donner [:stephend] - PTO; back on 5/28 2006-10-01 11:49:21 PDT
Verified FIXED with the testcase at https://bugzilla.mozilla.org/attachment.cgi?id=232185 (no longer causes a crash, but hangs due to bug 285608) using build 2006-10-01-08 of SeaMonkey trunk under Windows XP.
Comment 23 Bernd 2008-03-24 13:10:30 PDT
Comment on attachment 235667 [details] [diff] [review]
patch

taking both patches fixes the crash on the dependent bug
Comment 24 Daniel Veditz [:dveditz] 2008-03-26 11:54:14 PDT
Comment on attachment 235667 [details] [diff] [review]
patch

approved for 1.8.1.14, a=dveditz for release-drivers
Comment 25 Daniel Veditz [:dveditz] 2008-03-26 11:55:15 PDT
Comment on attachment 238671 [details] [diff] [review]
patch

approved for 1.8.1.14, a=dveditz for release-drivers
Comment 26 Bernd 2008-03-26 22:27:04 PDT
fix checked in into branch
Comment 27 juan becerra [:juanb] 2008-06-10 14:33:12 PDT
Tried to verify on XP by checking to see if Firefox 2.0.0.14 (also 2.0.0.13) crashed with original test case, but it didn't. So I tried the test case mentioned in comment #8. Print preview in landscape mode crashed it. Then I looked at Firefox 2.0.0.15pre, but while it doesn't crash, it hangs, becomes unresponsive and eventually you get the option to kill it.

Comment 28 Mats Palmgren (:mats) 2013-01-26 05:58:34 PST
Crash test:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2ad79139e529
Comment 29 Ryan VanderMeulen [:RyanVM] 2013-01-26 16:45:47 PST
https://hg.mozilla.org/mozilla-central/rev/2ad79139e529

Note You need to log in before you can comment on or make changes to this bug.