Closed Bug 1661137 Opened 4 years ago Closed 4 years ago

Intermittent printing/<random>.html | assertion count 1 is more than expected 0 assertions after ASSERTION: User did not call nsIContentViewer::Destroy: '!mPresShell && !mPresContext', file /builds/worker/checkouts/gecko/layout/base/nsDocumentViewer.cpp

Categories

(Core :: Printing: Output, defect, P5)

defect

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox80 --- unaffected
firefox81 --- fixed
firefox82 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: emilio)

References

(Regression)

Details

(Keywords: assertion, intermittent-failure, regression)

Attachments

(1 file)

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE

Using a bug separate from bug 827183.

Status: RESOLVED → REOPENED
Flags: needinfo?(emilio)
Resolution: DUPLICATE → ---
Summary: Intermittent printing/test-unexpected-text.html print printing/test-unexpected-text-noref.html | assertion count 1 is more than expected 0 assertions → Intermittent printing/<random>.html | assertion count 1 is more than expected 0 assertions after
Summary: Intermittent printing/<random>.html | assertion count 1 is more than expected 0 assertions after → Intermittent printing/<random>.html | assertion count 1 is more than expected 0 assertions after ASSERTION: User did not call nsIContentViewer::Destroy: '!mPresShell && !mPresContext', file /builds/worker/checkouts/gecko/layout/base/nsDocumentViewer.cpp

I wonder if there's a pernosco recording of this.

Assignee: nobody → emilio

Ugh, it won't because these are disabled on Linux... Will push some try runs with this enabled to see if I catch it.

Regressed by: 1636728
Has Regression Range: --- → yes
Keywords: regression

Stack:

#13 0x000007a85baa987e in NS_DebugBreak(uint32_t, char const*, char const*, char const*, int32_t)
    (aSeverity=1, aStr=0x7a857a8f9ae "User did not call nsIContentViewer::Destroy", aExpr=0x7a857522f7c "!mPresShell && !mPresContext", aFile=0x7a8578a2000 "/home/emilio/src/moz/gecko-2/layout/base/nsDocumentViewer.cpp", aLine=574) at /home/emilio/src/moz/gecko-2/xpcom/base/nsDebugImpl.cpp:366
#14 0x000007a85eed57cb in nsDocumentViewer::~nsDocumentViewer() (this=0x9aa12589900) at /home/emilio/src/moz/gecko-2/layout/base/nsDocumentViewer.cpp:573
#15 0x000007a85eed6162 in nsDocumentViewer::~nsDocumentViewer() (this=0x9aa12589900) at /home/emilio/src/moz/gecko-2/layout/base/nsDocumentViewer.cpp:559
#16 0x000007a85eed5522 in nsDocumentViewer::Release() (this=0x9aa12589900) at /home/emilio/src/moz/gecko-2/layout/base/nsDocumentViewer.cpp:547
#17 0x000007a85f207cec in nsPagePrintTimer::~nsPagePrintTimer() (this=0x6febd280) at /home/emilio/src/moz/gecko-2/layout/printing/nsPagePrintTimer.cpp:17
#18 0x000007a85bb87119 in mozilla::Runnable::Release() (this=0x6febd280) at /home/emilio/src/moz/gecko-2/xpcom/threads/nsThreadUtils.cpp:68
#19 0x000007a85bb8808c in nsTimerImpl::Callback::clear() (this=0x7ffe6e6f2f10) at /home/emilio/src/moz/gecko-2/xpcom/threads/nsTimerImpl.h:107
#20 nsTimerImpl::Callback::~Callback() (this=0x7ffe6e6f2f10) at /home/emilio/src/moz/gecko-2/xpcom/threads/nsTimerImpl.h:104
#21 nsTimerImpl::Fire(int) (this=0x6fe9a190, aGeneration=1) at /home/emilio/src/moz/gecko-2/xpcom/threads/nsTimerImpl.cpp:597
#22 0x000007a85bb87d34 in nsTimerEvent::Run() (this=0x6fed5140) at /home/emilio/src/moz/gecko-2/xpcom/threads/TimerThread.cpp:251

It is the print document, set here, but the docshell gets destroyed before the print finishes:

#0  nsCOMPtr<nsIContentViewer>::assign_assuming_AddRef(nsIContentViewer*) (this=0x17046a731aa0, aNewPtr=0x0) at /home/emilio/src/moz/gecko-2/obj-debug-no-sccache/dist/include/nsCOMPtr.h:413
#1  nsCOMPtr<nsIContentViewer>::operator=(decltype(nullptr)) (this=0x17046a731aa0) at /home/emilio/src/moz/gecko-2/obj-debug-no-sccache/dist/include/nsCOMPtr.h:684
#2  nsDocShell::Destroy() (this=0x17046a731800) at /home/emilio/src/moz/gecko-2/docshell/base/nsDocShell.cpp:4223
#3  0x000007a85fe9f50a in nsWebBrowser::SetDocShell(nsDocShell*) (this=0x6fe8b4c0, aDocShell=0x0) at /home/emilio/src/moz/gecko-2/toolkit/components/browser/nsWebBrowser.cpp:1131
#4  0x000007a85fe9ec41 in nsWebBrowser::InternalDestroy() (this=0x6fe8b4c0) at /home/emilio/src/moz/gecko-2/toolkit/components/browser/nsWebBrowser.cpp:174
#5  0x000007a85fea1a8b in non-virtual thunk to nsWebBrowser::Destroy() () at /home/emilio/src/moz/gecko-2/toolkit/components/browser/nsWebBrowser.cpp:855

We do call nsDocumentViewer::Destroy from there, but we hit this condition and thus keep stuff alive.

That "blocked destroy count" gets decremented here, right before dropping the content viewer entirely:

#0  0x000007a85eedf5db in non-virtual thunk to nsDocumentViewer::DecrementDestroyBlockedCount() () at /home/emilio/src/moz/gecko-2/layout/base/nsDocumentViewer.cpp:3727
#1  0x000007a85f207c8e in nsPagePrintTimer::~nsPagePrintTimer() (this=0x6febd280) at /home/emilio/src/moz/gecko-2/layout/printing/nsPagePrintTimer.cpp:19
#2  0x000007a85f207cec in nsPagePrintTimer::~nsPagePrintTimer() (this=0x6febd280) at /home/emilio/src/moz/gecko-2/layout/printing/nsPagePrintTimer.cpp:17
#3  0x000007a85bb87119 in mozilla::Runnable::Release() (this=0x6febd280) at /home/emilio/src/moz/gecko-2/xpcom/threads/nsThreadUtils.cpp:68
#4  0x000007a85bb8808c in nsTimerImpl::Callback::clear() (this=0x7ffe6e6f2f10) at /home/emilio/src/moz/gecko-2/xpcom/threads/nsTimerImpl.h:107
#5  nsTimerImpl::Callback::~Callback() (this=0x7ffe6e6f2f10) at /home/emilio/src/moz/gecko-2/xpcom/threads/nsTimerImpl.h:104
#6  nsTimerImpl::Fire(int) (this=0x6fe9a190, aGeneration=1) at /home/emilio/src/moz/gecko-2/xpcom/threads/nsTimerImpl.cpp:597
#7  0x000007a85bb87d34 in nsTimerEvent::Run() (this=0x6fed5140) at /home/emilio/src/moz/gecko-2/xpcom/threads/TimerThread.cpp:251
#8  0x000007a85bb7994d in mozilla::SchedulerGroup::Runnable::Run() (this=0x6fea84c0) at /home/emilio/src/moz/gecko-2/xpcom/threads/SchedulerGroup.cpp:146
#9  0x000007a85bb80255 in mozilla::RunnableTask::Run() (this=0x6febd900) at /home/emilio/src/moz/gecko-2/xpcom/threads/TaskController.cpp:242

By the time we close the window, we're already done, nsPagePrintTimer::mDone is true.

Do it as soon as we're done printing, rather than waiting until the
print timer dies.

Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ede12aa1b8b5 Decrement the document viewer's destroy blocker earlier. r=bobowen

Set release status flags based on info from the regressing bug 1636728

Attachment #9172635 - Attachment description: Bug 1661137 - Decrement the document viewer's destroy blocker earlier. r=bobowen,jwatt → Bug 1661137 - Decrement the document viewer's destroy blocker earlier. r=bobowen
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e6ef511d20c9 Decrement the document viewer's destroy blocker earlier. r=bobowen
Flags: needinfo?(emilio)
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch

Comment on attachment 9172635 [details]
Bug 1661137 - Decrement the document viewer's destroy blocker earlier. r=bobowen

Beta/Release Uplift Approval Request

  • User impact if declined: Printing project
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Medium
  • Why is the change risky/not risky? (and alternatives if risky):
  • String changes made/needed:
Attachment #9172635 - Flags: approval-mozilla-beta?

Comment on attachment 9172635 [details]
Bug 1661137 - Decrement the document viewer's destroy blocker earlier. r=bobowen

Approved for 81.0b6.

Attachment #9172635 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: