Closed Bug 1998188 Opened 9 months ago Closed 8 months ago

Crash in [@ mozilla::EventTargetChainItem::HandleEventTargetChain]

Categories

(Core :: Widget: Gtk, defect, P2)

Unspecified
All
defect

Tracking

()

RESOLVED FIXED
147 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox146 + fixed
firefox147 --- fixed

People

(Reporter: diannaS, Assigned: stransky)

References

(Regression)

Details

(4 keywords, Whiteboard: [tbird crash])

Crash Data

Attachments

(4 files)

Crash report: https://crash-stats.mozilla.org/report/index/85a0b761-5b54-45e6-8b11-dafd30251104

Reason:

SIGSEGV / SEGV_MAPERR

Top 1 frame:

0  libxul.so  mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::Event...  dom/events/EventDispatcher.cpp:493

Crash report: https://crash-stats.mozilla.org/report/index/fa118784-e5e7-4976-8716-8c77e0251112

Reason:

SIGSEGV / SEGV_MAPERR

Top 2 frames:

0  libxul.so  nsCOMPtr<mozilla::dom::EventTarget>::nsCOMPtr(nsCOMPtr<mozilla::dom::EventTar...  xpcom/base/nsCOMPtr.h:385
0  libxul.so  mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::Event...  dom/events/EventDispatcher.cpp:495

This isn't actionable without some stack.

Severity: -- → S3
Priority: -- → P5

The bug is linked to a topcrash signature, which matches the following criterion:

  • Top 5 desktop browser crashes on Linux on beta

:edgar, could you consider increasing the severity of this top-crash bug?

For more information, please visit BugBot documentation.

Flags: needinfo?(echen)
Keywords: topcrash

gsvelto, the crash reports are very broken. Do you have any ideas about this?

Flags: needinfo?(gsvelto)

(In reply to Dianna Smith [:diannaS] from comment #0)

Crash report: https://crash-stats.mozilla.org/report/index/fa118784-e5e7-4976-8716-8c77e0251112

Bit flip confidence is 25 for this one. (Had trouble finding the other one in the relevant view.)

It must be some kind of stack-walking issue. We get the first frame on the stack, but then the stack walker immediately stumbles upon the end of the stack. I'm leaving the NI? because I have to investigate why that could be happening.

(Bumped to S2 due to the topcrash)

Severity: S3 → S2
Flags: needinfo?(echen)
Priority: P5 → P3

The crashes mostly happen on Linux. There was a recent change in the relevant code in bug 1992198 and it also seems to match the spike in crash reports. :stransky, could the spike be something related to the changes in bug 1992198? Thanks!

Flags: needinfo?(stransky)

Yes, looks like so. Where is the AppWindow::Center() used? Can it be tested somehow?

Flags: needinfo?(stransky) → needinfo?(echen)

That looks like bug 1999259, same issue?

Flags: needinfo?(gsvelto)

BTW this explains the broken stacks: the stackwalker is starting from a frame that is already outside of the stack mapping, so the walk stops straight away as it cannot find where the stack actually is.

(In reply to Martin Stránský [:stransky] (ni? me) from comment #9)

Yes, looks like so. Where is the AppWindow::Center() used? Can it be tested somehow?

AppWindow::Center() can be used while opening a top-level chrome window with centerscreen chrome flag, one case is "Create Profile Wizard", you can open it via clicking Create a New Profile in about:profiles.

But from the crash report in comment# 7, the uptime is pretty short (less than 10 sec) and I also see XPCOMSpinEventLoopStack has AppWindow::ShowModal. So it looks like the modal window is opened pretty soon after Firefox is launched, not sure what is it, can that be "Primary Password" dialog?

Flags: needinfo?(echen)

Isn't there a new "choose profile" dialog at startup?

This issue is triggered when attempting to open the developer tools in separate-window mode. (set devtools.toolbox.host to "window")

Opening the developer tools immediately and reliably causes a crash. Here's my crash report: https://crash-stats.mozilla.org/report/index/6b750483-7af4-4ae9-a439-1f62a0251121#tab-details

I got this after updating to 146.0b5.

Workaround: open about:config and set devtools.toolbox.host to bottom

Cool, Thanks.

Flags: needinfo?(stransky)

Thunderbird also has this crash signature. And like bug 1999259, approx 65% are startup crashes.

OS: Unspecified → All
Whiteboard: [tbird crash]

(In reply to Bala M:BalaM314 from comment #14)

This issue is triggered when attempting to open the developer tools in separate-window mode. (set devtools.toolbox.host to "window")

Opening the developer tools immediately and reliably causes a crash. Here's my crash report: https://crash-stats.mozilla.org/report/index/6b750483-7af4-4ae9-a439-1f62a0251121#tab-details

I got this after updating to 146.0b5.

Workaround: open about:config and set devtools.toolbox.host to bottom

Tested and can't reproduce. Can you attach your about:support page? It may be seen on particular resolution/scale.
Thanks.

Flags: needinfo?(stransky) → needinfo?(mail2balaadithya)

The bug is linked to a topcrash signature, which matches the following criteria:

  • Top 10 desktop browser crashes on nightly (startup)
  • Top 5 desktop browser crashes on Linux on beta

For more information, please visit BugBot documentation.

(In reply to Martin Stránský [:stransky] (ni? me) from comment #17)

Opening the developer tools immediately and reliably causes a crash. Here's my crash report: https://crash-stats.mozilla.org/report/index/6b750483-7af4-4ae9-a439-1f62a0251121#tab-details

FWIW, in the crash report, there is monitor information, not sure if this is what you are looking for, though..
"monitors":[{"screenWidth":1920,"screenHeight":1200,"defaultCSSScaleFactor":1.25,"contentsScaleFactor":1.25}]

Attached about:support page

Flags: needinfo?(mail2balaadithya)
See Also: → 2001561
Duplicate of this bug: 2002717
Attached file xulstore.json

I had the issue, as also already described it happens when opening the dev tools. As a workaround I could resolve it, by removing the xulstore.json from my profile.
I added the xulstore.json as attachment.

I have the suspicion that the last time I opened the dev tools (when it worked) was on an external monitor. But cannot say that for sure. Here is my output configuration from my laptop:

❯ swaymsg -t get_outputs
Output eDP-1 'BOE 0x0C8E Unknown' (focused)
  Current mode: 2560x1600 @ 240.000 Hz
  Power: on
  Position: 0,0
  Scale factor: 1.250000

I further looked into it, I can reproduce it with "width": "675", in the xulstore.json of the chrome://devtools/content/framework/toolbox-window.xhtml entry.

When changing it to 1015 (which was the value, after I removed the file) I can open the dev tools without any issue.

I think the crash in bug 2002717 is not a duplicate of this bug. Perhaps my problem is also related to a certain screen resolution combined with a certain scale. Therefore, I will add more details.

All the actions listed in this bug are normally worked out without crashes. Firefox crashes only when I trying to open the 'About Firefox' window.

I have Ubuntu 25.10 with current updates. The problem started reproducing from version 146, it wasn't reproducible before. It was reproduced today on the current beta of Firefox 146.0b9-1.
https://crash-stats.mozilla.org/report/index/bp-ab8c765a-c142-4ebe-bbcc-210b40251130

I have two screens on my laptop - own laptop screen and a 4K TV. The crashes only occur on the own laptop screen. It has the following parameters:
Resolution: 1920 x 1080 (16:9)
Scale: 125 %
Fractional scaling is enabled.

I should also add that in the current beta of Thunderbird 146.0b3-4, crashes on the same screen do not occur when the "About Thunderbird" window is opened.

I'm ready to provide additional information if necessary.

Flags: needinfo?(stransky)

(per comment #8, move to Widget: GTK for now)

Component: DOM: Events → Widget: Gtk

I tried with various screen resolution but I don't see it. Tested 1920x1200@1.25 and 1920x1080@1.25. I wonder if also titlebar is a factor here. Which desktop do you run? I'm testing under Gnome / Fedora 42.

Flags: needinfo?(stransky) → needinfo?(max)
Flags: needinfo?(mail2balaadithya)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #27)

I tried with various screen resolution but I don't see it. Tested 1920x1200@1.25 and 1920x1080@1.25. I wonder if also titlebar is a factor here. Which desktop do you run? I'm testing under Gnome / Fedora 42.

I am using sway and running Firefox without a titlebar. For me at least I can reproduce the error, when I change only the width (and leave the height untouched).

Usually when I then open the debugger tools, it tries to resize it to half my screen size.
But to be honest I am not sure how the half of my screen is 1015.

I have the following gap settings:

    smart_gaps on
    gaps inner 3
    gaps outer 0

    smart_borders on
    default_border pixel 2

With these settings I would assume the width to be 1014 (= 2560/2/1.25 - 10).

Note when I for example set it to another value which works (for example 615), and then open the debugger, restart Firefox, the settings are again set to "half screen size", i.e. 1015.

Can I do further things to help you debug? I will later look, if I can provide you with a more detailed stacktrace or something similar (now I have some other meetings first).

Duplicate of this bug: 2001561

Can you please try to run on terminal with MOZ_LOG="Widget:5,WidgetPopup:5" env variable, make it crash and attach the output here?
Thanks.

From all the reports it looks related to 125% screen scale, environment Sway/KDE/Gnome, Wayland and various resolutions.

Attached file moz-crash.log.gz

As the crash log became quite big, I gzipped it.

Note I had set the value in the xulstore.json to 675 and my screen was only half, as I had on the other half my terminal open.

Flags: needinfo?(max)

Thanks. Looks like rounding error while positioning the popup:

[Parent 37926: Main Thread]: D/Widget [7fc324d80600]: nsWindow::Move to [686 x 25] scale 1.250000 scaled [857.50 x 31.25]
[Parent 37926: Main Thread]: D/Widget [7fc324d80600]:   bounds 0 x 0
[Parent 37926: Main Thread]: D/Widget [7fc324d80600]: nsWindow::NativeMoveResize mLastMoveRequest [686,25] mClientMargin [0,0] move 1 resize 0 to [686,25] -> [675 x 1230]
[Parent 37926: Main Thread]: D/Widget [7fc324d80600]: nsWindow::Move to [687 x 25] scale 1.250000 scaled [858.75 x 31.25]
[Parent 37926: Main Thread]: D/Widget [7fc324d80600]:   bounds 686 x 25
[Parent 37926: Main Thread]: D/Widget [7fc324d80600]: nsWindow::NativeMoveResize mLastMoveRequest [687,25] mClientMargin [0,0] move 1 resize 0 to [687,25] -> [675 x 1230]
[Parent 37926: Main Thread]: D/Widget [7fc324d80600]: nsWindow::Move to [686 x 25] scale 1.250000 scaled [857.50 x 31.25]
[Parent 37926: Main Thread]: D/Widget [7fc324d80600]:   bounds 687 x 25
[Parent 37926: Main Thread]: D/Widget [7fc324d80600]: nsWindow::NativeMoveResize mLastMoveRequest [686,25] mClientMargin [0,0] move 1 resize 0 to [686,25] -> [675 x 1230]
[Parent 37926: Main Thread]: D/Widget [7fc324d80600]: nsWindow::Move to [687 x 25] scale 1.250000 scaled [858.75 x 31.25]
[Parent 37926: Main Thread]: D/Widget [7fc324d80600]:   bounds 686 x 25

so we're cycling over 687 x 25 / 686 x 25 values.

I think we need to update AppWindow::Center() to just skip if difference is +/- screen scale (1.25 is ceiled scale 2).

I am using GNOME 49.1 on Arch Linux.

Flags: needinfo?(abl9qezto)
Flags: needinfo?(stransky)
Flags: needinfo?(stransky)
Assignee: nobody → stransky
Status: NEW → ASSIGNED

The bug is marked as tracked for firefox146 (beta). However, the bug still has low priority.

:jstutte, could you please increase the priority for this tracked bug? If you disagree with the tracking decision, please talk with the release managers.

For more information, please visit BugBot documentation.

Flags: needinfo?(jstutte)
Flags: needinfo?(jstutte)
Priority: P3 → P2
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 147 Branch
Duplicate of this bug: 1999259
See Also: 1999259

Copying crash signatures from duplicate bugs.

Crash Signature: [@ mozilla::EventTargetChainItem::HandleEventTargetChain] → [@ mozilla::EventTargetChainItem::HandleEventTargetChain] [@ mozilla::EventTargetChainItem::HandleEvent] [@ mozilla::EventTargetChainItem::PostHandleEvent]

:stransky do you think this is low risk to uplift to the next planned dot release or should it ride the 147 train?

Crash Signature: [@ mozilla::EventTargetChainItem::HandleEventTargetChain] [@ mozilla::EventTargetChainItem::HandleEvent] [@ mozilla::EventTargetChainItem::PostHandleEvent] → [@ mozilla::EventTargetChainItem::HandleEventTargetChain] [@ mozilla::EventTargetChainItem::HandleEvent] [@ mozilla::EventTargetChainItem::PostHandleEvent]
Flags: needinfo?(stransky)

I think uplift is perfectly safe.

Flags: needinfo?(stransky)

Comment on attachment 9530802 [details]
Bug 1998188 Allow only one recursion of AppWindow::Center() r?emilio

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: Crashes on window centering on some screen sizes.
  • 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): We restrict maximal recursion for re-center.
  • String changes made/needed:
  • Is Android affected?: Yes
Attachment #9530802 - Flags: approval-mozilla-release?
QA Whiteboard: [qa-triage-done-c148/b147]
Duplicate of this bug: 2005883
Duplicate of this bug: 2005886

:stransky this doesn't cherry-pick cleanly to release (missing changes that were done in bug 1999619). Does bug 1999619 need to be uplifted as well? If not, could you submit a rebased patch for release? thank you!

Flags: needinfo?(stransky)

Yes, it should apply to release cleanly.

Flags: needinfo?(stransky)

Comment on attachment 9530802 [details]
Bug 1998188 Allow only one recursion of AppWindow::Center() r?emilio

Approved for 146.0.1 dot release

Attachment #9530802 - Flags: approval-mozilla-release? → approval-mozilla-release+
See Also: 2001561
Duplicate of this bug: 2006449
Duplicate of this bug: 2006616
See Also: → 2005592
Duplicate of this bug: 2005592

Copying crash signatures from duplicate bugs.

Crash Signature: [@ mozilla::EventTargetChainItem::HandleEventTargetChain] [@ mozilla::EventTargetChainItem::HandleEvent] [@ mozilla::EventTargetChainItem::PostHandleEvent] → [@ mozilla::EventTargetChainItem::HandleEventTargetChain] [@ mozilla::EventTargetChainItem::HandleEvent] [@ mozilla::EventTargetChainItem::PostHandleEvent] [@ https://crash-stats.mozilla.org/report/index/bp-84fb04e1-941e-42db-908c-a77c90251211 https://…
See Also: 2005592
Duplicate of this bug: 2008493
Duplicate of this bug: 2007784
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: