Closed
Bug 468066
Opened 16 years ago
Closed 13 years ago
CreateRenderingContext causes crash
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: wildriding, Unassigned)
Details
(Keywords: crash, Whiteboard: [closeme 2011-06-09])
Program received signal SIGTRAP, Trace/breakpoint trap.
Break (
aMsg=0xbfe77fe0 "###!!! ASSERTION: CreateRenderingContext failure: 'Not Reached', file /mnt/sdb/build-tree/mozilla/layout/base/nsPresShell.cpp, line 6280")
at /mnt/sdb/build-tree/mozilla/xpcom/base/nsDebugImpl.cpp:481
481 }
(gdb) bt
#0 Break (
aMsg=0xbfe77fe0 "###!!! ASSERTION: CreateRenderingContext failure: 'Not Reached', file /mnt/sdb/build-tree/mozilla/layout/base/nsPresShell.cpp, line 6280")
at /mnt/sdb/build-tree/mozilla/xpcom/base/nsDebugImpl.cpp:481
#1 0xb67dc53b in NS_DebugBreak_P (aSeverity=1, aStr=0xb45ea304 "CreateRenderingContext failure",
aExpr=0xb45e37e0 "Not Reached",
aFile=0xb45e9f4c "/mnt/sdb/build-tree/mozilla/layout/base/nsPresShell.cpp", aLine=6280)
at /mnt/sdb/build-tree/mozilla/xpcom/base/nsDebugImpl.cpp:359
#2 0xb3e8414f in PresShell::DoReflow (this=0x87ffd18, target=0x88031bc)
at /mnt/sdb/build-tree/mozilla/layout/base/nsPresShell.cpp:6280
#3 0xb3e909ef in PresShell::ProcessReflowCommands (this=0x87ffd18, aInterruptible=0)
at /mnt/sdb/build-tree/mozilla/layout/base/nsPresShell.cpp:6430
#4 0xb3e90c2d in PresShell::DoFlushPendingNotifications (this=0x87ffd18, aType=Flush_Layout, aInterruptibleReflow=0)
at /mnt/sdb/build-tree/mozilla/layout/base/nsPresShell.cpp:4572
#5 0xb3e90e00 in PresShell::FlushPendingNotifications (this=0x87ffd18, aType=Flush_Layout)
at /mnt/sdb/build-tree/mozilla/layout/base/nsPresShell.cpp:4509
#6 0xb40d9f27 in nsDocument::FlushPendingNotifications (this=0x8744320, aType=Flush_Layout)
at /mnt/sdb/build-tree/mozilla/content/base/src/nsDocument.cpp:6244
#7 0xb3e8aaba in PresShell::ScrollContentIntoView (this=0x87ffd18, aContent=0x885b4a8, aVPercent=-2, aHPercent=-2)
at /mnt/sdb/build-tree/mozilla/layout/base/nsPresShell.cpp:3980
#8 0xb41d1005 in nsHTMLAnchorElement::SetFocus (this=0x885b4a8, aPresContext=0x87fbdf8)
at /mnt/sdb/build-tree/mozilla/content/html/content/src/nsHTMLAnchorElement.cpp:284
#9 0xb4188527 in nsEventStateManager::ChangeFocusWith (this=0x87fc030, aFocusContent=0x885b4a8,
aFocusedWith=eEventFocusedByMouse)
at /mnt/sdb/build-tree/mozilla/content/events/src/nsEventStateManager.cpp:3978
#10 0xb4196673 in nsEventStateManager::PostHandleEvent (this=0x87fc030, aPresContext=0x87fbdf8, aEvent=0xbfe78d60,
aTargetFrame=0x8889b60, aStatus=0xbfe78af8, aView=0x87fc8d0)
at /mnt/sdb/build-tree/mozilla/content/events/src/nsEventStateManager.cpp:2843
#11 0xb3e8550b in PresShell::HandleEventInternal (this=0x87ffd18, aEvent=0xbfe78d60, aView=0x87fc8d0, aStatus=0xbfe78af8)
at /mnt/sdb/build-tree/mozilla/layout/base/nsPresShell.cpp:5960
#12 0xb3e85f29 in PresShell::HandlePositionedEvent (this=0x87ffd18, aView=0x87fc8d0, aTargetFrame=0x8889b60,
aEvent=0xbfe78d60, aEventStatus=0xbfe78af8)
at /mnt/sdb/build-tree/mozilla/layout/base/nsPresShell.cpp:5827
#13 0xb3e864d7 in PresShell::HandleEvent (this=0x87ffd18, aView=0x87fc8d0, aEvent=0xbfe78d60, aEventStatus=0xbfe78af8)
at /mnt/sdb/build-tree/mozilla/layout/base/nsPresShell.cpp:5687
#14 0xb42c1abf in nsViewManager::HandleEvent (this=0x87fc870, aView=0x87fc8d0, aPoint=
{x = -1075344492, y = -1075344032}, aEvent=0xbfe78d60, aCaptured=0)
at /mnt/sdb/build-tree/mozilla/view/src/nsViewManager.cpp:1391
#15 0xb42c59b5 in nsViewManager::DispatchEvent (this=0x87fc870, aEvent=0xbfe78d60, aStatus=0xbfe78c10)
at /mnt/sdb/build-tree/mozilla/view/src/nsViewManager.cpp:1350
#16 0xb42bc573 in HandleEvent (aEvent=0xbfe78d60)
at /mnt/sdb/build-tree/mozilla/view/src/nsView.cpp:167
#17 0xb491e9cc in nsWindow::DispatchEvent (this=0x8888980, aEvent=0xbfe78d60, aStatus=@0xbfe78cd4)
at /mnt/sdb/build-tree/mozilla/widget/src/qt/nsWindow.cpp:2478
#18 0xb4923e52 in nsWindow::DispatchEvent (this=0x8888980, aEvent=0xbfe78d60)
at /mnt/sdb/build-tree/mozilla/widget/src/qt/nsWindow.h:243
#19 0xb4920e65 in nsWindow::OnButtonPressEvent (this=0x8888980, aEvent=0xbfe7927c)
at /mnt/sdb/build-tree/mozilla/widget/src/qt/nsWindow.cpp:1382
#20 0xb4930dfa in MozQWidget::event (this=0x8882bc8, e=0xbfe7927c)
at /mnt/sdb/build-tree/mozilla/widget/src/qt/mozqwidget.cpp:32
#21 0xb76d579c in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4
#22 0xb76ddfd1 in QApplication::notify () from /usr/lib/libQtGui.so.4
#23 0xb73b50d1 in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#24 0xb76dd25e in QApplicationPrivate::sendMouseEvent () from /usr/lib/libQtGui.so.4
#25 0xb7746dfd in ?? () from /usr/lib/libQtGui.so.4
#26 0xb7745be1 in QApplication::x11ProcessEvent () from /usr/lib/libQtGui.so.4
#27 0xb776f60a in ?? () from /usr/lib/libQtGui.so.4
#28 0xb6d801b8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#29 0xb6d83853 in ?? () from /usr/lib/libglib-2.0.so.0
#30 0x083ca490 in ?? ()
#31 0x00000000 in ?? ()
(gdb) frame 2
#2 0xb3e8414f in PresShell::DoReflow (this=0x87ffd18, target=0x88031bc)
at /mnt/sdb/build-tree/mozilla/layout/base/nsPresShell.cpp:6280
6280 NS_NOTREACHED("CreateRenderingContext failure");
(gdb) l 'PresShell::DoReflow(nsIFrame*)'
6266 mCaret->UpdateCaretPosition();
6267 }
6268 }
6269
6270 void
6271 PresShell::DoReflow(nsIFrame* target)
6272 {
6273 nsIFrame* rootFrame = FrameManager()->GetRootFrame();
6274
6275 nsCOMPtr<nsIRenderingContext> rcx;
(gdb)
6276 // Always create the rendering context relative to the root frame during
6277 // reflow; otherwise, it crashes on the mac (I'm not quite sure why)
6278 nsresult rv = CreateRenderingContext(rootFrame, getter_AddRefs(rcx));
6279 if (NS_FAILED(rv)) {
6280 NS_NOTREACHED("CreateRenderingContext failure");
6281 return;
6282 }
6283
6284 target->WillReflow(mPresContext);
6285
(gdb) l CreateRenderingContext
3446 return NS_OK;
3447 }
3448
3449 NS_IMETHODIMP
3450 PresShell::CreateRenderingContext(nsIFrame *aFrame,
3451 nsIRenderingContext** aResult)
3452 {
3453 NS_PRECONDITION(nsnull != aResult, "null ptr");
3454 if (nsnull == aResult) {
3455 return NS_ERROR_NULL_POINTER;
(gdb)
3456 }
3457
3458 nsIWidget* widget = nsnull;
3459 nsPoint offset(0,0);
3460 if (mPresContext->IsScreen()) {
3461 // Get the widget to create the rendering context for and calculate
3462 // the offset from the frame to it. (Calculating the offset is important
3463 // if the frame isn't the root frame.)
3464 nsPoint viewOffset;
3465 nsIView* view = aFrame->GetClosestView(&viewOffset);
(gdb)
3466 nsPoint widgetOffset;
3467 widget = view->GetNearestWidget(&widgetOffset);
3468 offset = viewOffset + widgetOffset;
3469 } else {
3470 nsIFrame* pageFrame = nsLayoutUtils::GetPageFrame(aFrame);
3471 // This might not always come up with a frame, i.e. during reflow;
3472 // that's fine, because the translation doesn't matter during reflow.
3473 if (pageFrame)
3474 offset = aFrame->GetOffsetTo(pageFrame);
3475 }
(gdb)
3476
3477 nsresult rv;
3478 nsIRenderingContext* result = nsnull;
3479 nsIDeviceContext *deviceContext = mPresContext->DeviceContext();
3480 if (widget) {
3481 rv = deviceContext->CreateRenderingContext(widget, result);
3482 }
3483 else {
3484 rv = deviceContext->CreateRenderingContext(result);
3485 }
(gdb)
3486 *aResult = result;
3487
3488 if (NS_SUCCEEDED(rv)) {
3489 result->Translate(offset.x, offset.y);
3490 }
3491
3492 return rv;
3493 }
3494
3495 NS_IMETHODIMP
(gdb) p rootFrame
$1 = (class nsIFrame *) 0x88031bc
(gdb) x/wa (void**) mPresContext
0x87fbdf8: 0xb466f1e8 <_ZTV13nsPresContext+8>
(gdb) p mPresContext
$2 = (class nsPresContext *) 0x87fbdf8
(gdb) p mPresContext->mMedium
$3 = (class nsIAtom *) 0x87b7ad8
(gdb) p nsGkAtoms::screen
$4 = (class nsIAtom *) 0x86de40c
(gdb) p mPresContext->mType
$5 = nsPresContext::eContext_Galley
(gdb) p mPresContext->mDeviceContext
$6 = (class nsIDeviceContext *) 0x87fbd78
(gdb) x/wa (void**) mPresContext->mDeviceContext
0x87fbd78: 0xb4811648 <_ZTV21nsThebesDeviceContext+8>
(gdb) p ((nsThebesDeviceContext*)mPresContext->mDeviceContext)->mPrintingSurface
$7 = {mRawPtr = 0x0}
------------------------------
We don't have printing enabled.
------------------------------
337 nsThebesDeviceContext::CreateRenderingContext(nsIRenderingContext *&aContext)
338 {
339 nsresult rv = NS_OK;
340
341 aContext = nsnull;
342 nsCOMPtr<nsIRenderingContext> pContext;
343 rv = CreateRenderingContextInstance(*getter_AddRefs(pContext));
----------------------------------
assuminig we succeed (if not, we're going to fail)
----------------------------------
344 if (NS_SUCCEEDED(rv)) {
--------------------------------
we don't have a printing surface
--------------------------------
345 if (mPrintingSurface)
346 rv = pContext->Init(this, mPrintingSurface);
347 else
348 rv = NS_ERROR_FAILURE;
----------
here we fail
-----------
349
---------
skip this
---------
350 if (NS_SUCCEEDED(rv)) {
351 pContext->Scale(mPrintingScale, mPrintingScale);
352 aContext = pContext;
353 NS_ADDREF(aContext);
354 }
355 }
356
-----
FAIL
-----
357 return rv;
358 }
Comment 1•16 years ago
|
||
Please don't put the trace in the comment, it makes it hard to read. It is better in an attachment.
Severity: normal → critical
Keywords: crash
(Eh, trace is fine there, for me anyway.)
One question -- by "We don't have printing enabled." does that mean --disable-printing or just that the surface is null, or what?
i didn't check while we were debugging, but typically i'd assume --disable-printing.
Reporter | ||
Comment 4•16 years ago
|
||
(In reply to comment #2)
> One question -- by "We don't have printing enabled." does that mean
> --disable-printing or just that the surface is null, or what?
just that mPrintingSurface is null, and we have --enable-printing.
Severity: critical → normal
Reporter | ||
Comment 5•16 years ago
|
||
Forgot to mention that this is Qt build.
the bug 468463 supposed to disable-printing by default for Qt build to make it more stable.
Reporter | ||
Comment 7•13 years ago
|
||
worksforme
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•