Closed Bug 1703205 Opened 3 years ago Closed 3 years ago

Frequent hangs in SHAppBarMessage

Categories

(Core :: Widget: Win32, defect)

defect

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox87 --- unaffected
firefox88 --- fixed
firefox89 --- fixed

People

(Reporter: florian, Assigned: emilio)

References

(Regression)

Details

(Keywords: perf, regression)

Attachments

(2 files)

When looking at the BHR data for the 20210402 nightly, hangs in SHAppBarMessage represent more than %1 of the total reported hang time.

Here is the reported stack:

    NtUserFindWindowEx win32u
    FindWindowW user32
    SHAppBarMessage shell32
    nsLookAndFeel::NativeGetInt(mozilla::LookAndFeel::IntID, int&) xul
    mozilla::widget::AddIDsToMap(nsXPLookAndFeel*, mozilla::widget::FullLookAndFeel*, bool, bool) xul
    std::_Func_impl_no_alloc<`lambda at /builds/worker/checkouts/gecko/widget/RemoteLookAndFeel.cpp:216:39',void,const mozilla::widget::LookAndFeelTheme &,bool>::_Do_call(mozilla::widget::LookAndFeelTheme xul
    nsXPLookAndFeel::WithThemeConfiguredForContent(std::function<void (const mozilla::widget::LookAndFeelTheme &, bool)> const&) xul
    static mozilla::widget::RemoteLookAndFeel::ExtractData() xul
    static mozilla::dom::ContentParent::BroadcastThemeUpdate(mozilla::widget::ThemeChangeKind) xul
    nsPresContext::ThemeChangedInternal() xul
    mozilla::detail::RunnableMethodImpl<(anonymous namespace)::HangMonitorChild *,void ((anonymous namespace)::HangMonitorChild::*)(),0,mozilla::RunnableKind::Standard>::Run() xul
    mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex &> const&) xul

I don't remember seeing these stacks in hang data before; so it's either a recent regression in our code, or something external (OS code, or third party software).
Emilio, it looks like you touched the RemoteLookAndFeel::ExtractData code in this stack recently in bug 1701825. How likely is this to be a regression from bug 1701825?

Flags: needinfo?(emilio)

Fairly unlikely. If this is an issue, it is more likely to be from e.g. bug 1697607.

Bug 1701825 changed the stack (introduced the AddIDsToMap function), but there should be no meaningful behavior change on Windows from that bug.

Looking at the code, that points to this line of code. We are querying this in order to send it to the content process, but this particular value is only read from the parent process. So we could potentially optimize this out.

Flags: needinfo?(emilio)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #1)

Fairly unlikely. If this is an issue, it is more likely to be from e.g. bug 1697607.

Thanks!

Looking at the code, that points to this line of code. We are querying this in order to send it to the content process, but this particular value is only read from the parent process. So we could potentially optimize this out.

Would you be the right person to work on this? If not, do you have anybody in mind that we could needinfo?

Keywords: perf, regression
Regressed by: 1697607
Has Regression Range: --- → yes

Since it's not read by child processes and it seems it might be
expensive to get on windows.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

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

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b596dd98fa2e
Don't query AlertNotificationOrigin from RemoteLookAndFeel. r=cmartin
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch

Is this worth uplifting to Beta given where we are in the cycle? It'll need a bit of rebasing if yes.

Flags: needinfo?(emilio)
Attached file Beta patch

Approval Request Comment
[Feature/Bug causing the regression]: bug 1697607
[User impact if declined]: comment 0
[Is this code covered by automated tests?]: Yes
[Has the fix been verified in Nightly?]: No
[Needs manual test from QE? If yes, steps to reproduce]: No
[List of other uplifts needed for the feature/fix]: None
[Is the change risky?]: no
[Why is the change risky/not risky?]: Not query stuff that isn't needed.
[String changes made/needed]: none

Flags: needinfo?(emilio)
Attachment #9214143 - Flags: approval-mozilla-beta?

Comment on attachment 9214143 [details]
Beta patch

Approved for 88.0b9.

Attachment #9214143 - 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: