Closed Bug 1555645 Opened 5 years ago Closed 4 years ago

Crash in [@ mozilla::PresShell::EventHandler::MaybeFlushThrottledStyles]

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P2)

67 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox-esr60 --- wontfix
firefox67 --- wontfix
firefox67.0.1 --- wontfix
firefox68 --- fixed
firefox69 --- fixed

People

(Reporter: philipp, Assigned: masayuki)

References

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

This bug is for crash report bp-485be257-dcbc-4ca5-aaef-7be9c0190530.

Top 10 frames of crashing thread:

0 xul.dll class nsIFrame* mozilla::PresShell::EventHandler::MaybeFlushThrottledStyles layout/base/PresShell.cpp:7334
1 xul.dll nsresult mozilla::PresShell::EventHandler::HandleEventUsingCoordinates layout/base/PresShell.cpp:6672
2 xul.dll mozilla::PresShell::EventHandler::HandleEvent layout/base/PresShell.cpp:6613
3 xul.dll bool mozilla::PresShell::EventHandler::MaybeHandleEventWithAnotherPresShell layout/base/PresShell.cpp:7230
4 xul.dll mozilla::PresShell::EventHandler::HandleEvent layout/base/PresShell.cpp:6600
5 xul.dll nsViewManager::DispatchEvent view/nsViewManager.cpp:752
6 xul.dll nsEventStatus nsView::HandleEvent view/nsView.cpp:1072
7 xul.dll mozilla::widget::PuppetWidget::DispatchEvent widget/PuppetWidget.cpp:390
8 xul.dll mozilla::layers::APZCCallbackHelper::DispatchWidgetEvent gfx/layers/apz/util/APZCCallbackHelper.cpp:544
9 xul.dll void mozilla::dom::BrowserChild::HandleRealMouseButtonEvent dom/ipc/BrowserChild.cpp:1663

this crash signature is showing up cross-platform since firefox 67 (in low volume though), possibly related to the changes from bug 1466208.

It seems like a regression of bug 1466208, could you take a look, Masayuki? Thanks.

Flags: needinfo?(masayuki)

Looks like that this is not a regression of it. We have crash reports around there with same reason even before that:
https://crash-stats.mozilla.org/report/index/1d6da93c-2f09-4539-885d-245990190603
https://hg.mozilla.org/releases/mozilla-esr60/annotate/79253cb82ff8d415746056b6ee6a01a0564b7c50/layout/base/PresShell.cpp#l6551
Anyway, looks like that GetRootPresShell() may return nullptr.

Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Flags: needinfo?(masayuki)
No longer regressed by: 1466208
Keywords: regression
Priority: -- → P2

The crash reports just tell us that the crash occur due to referring around
address 0 in PresShell::EventHandler::MaybeFlushThrottledStyles().
Therefore, I'm not sure which is the actual reason of the crashes though,
this patch makes it null-check root PresShell and its Document before
accessing the latter.

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/9550b1e1dfb1
Make PresShell::EventHandler::MaybeFlushThrottledStyles() stop handling it when the PresShell does not have root PreShell nor Document r=smaug
Crash Signature: [@ mozilla::PresShell::EventHandler::MaybeFlushThrottledStyles] → [@ mozilla::PresShell::EventHandler::MaybeFlushThrottledStyles] [@ mozilla::PresShell::HandleEvent(nsIFrame*, mozilla::WidgetGUIEvent*, bool, nsEventStatus*)
Crash Signature: [@ mozilla::PresShell::EventHandler::MaybeFlushThrottledStyles] [@ mozilla::PresShell::HandleEvent(nsIFrame*, mozilla::WidgetGUIEvent*, bool, nsEventStatus*) → [@ mozilla::PresShell::EventHandler::MaybeFlushThrottledStyles] [@ mozilla::PresShell::HandleEvent(nsIFrame*, mozilla::WidgetGUIEvent*, bool, nsEventStatus*)]
Crash Signature: [@ mozilla::PresShell::EventHandler::MaybeFlushThrottledStyles] [@ mozilla::PresShell::HandleEvent(nsIFrame*, mozilla::WidgetGUIEvent*, bool, nsEventStatus*)] → [@ mozilla::PresShell::EventHandler::MaybeFlushThrottledStyles] [@ mozilla::PresShell::HandleEvent]

Comment on attachment 9069830 [details]
Bug 1555645 - Make PresShell::EventHandler::MaybeFlushThrottledStyles() stop handling it when the PresShell does not have root PreShell nor Document

Beta/Release Uplift Approval Request

  • User impact if declined: May meet this crash.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Just adding nullptr checks.
  • String changes made/needed: none.
Attachment #9069830 - Flags: approval-mozilla-beta?
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69

Comment on attachment 9069830 [details]
Bug 1555645 - Make PresShell::EventHandler::MaybeFlushThrottledStyles() stop handling it when the PresShell does not have root PreShell nor Document

nullptr checks, approved for 68.0b9

Attachment #9069830 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Reopening since the crash still persists. e.g. bp-5c551a82-1ea7-4c5b-ad66-d9d3b0200423

I haven't audited all crash reports, but as far as I can tell the call stack is including MaybeHandleEventWithAnotherPresShell which means the crash happened inside a nested document. And the crash happened at the code around we tried to get the root pres shell, it may be possible that the root pres shell is an ancestor of the initial target pres shell, I am quite unsure though.

Anyways, my question is "do we really need to flush throttled styles for the root pres shell?". My answer is "no". Given that we've already called MaybeFlushPendingNotifications just before we call MaybeFlushThrottledStyles, it would be sufficient.

As a side note about MaybeFlushThrottledStyles, emilo has a plan to drop the MaybeFlushThrottledStyles call.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Can we track the remaining issues in a new bug rather than reopen this?

See Also: → 1633019

Filed bug 1633019.

Status: REOPENED → RESOLVED
Closed: 5 years ago4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: