Ctrl+S shortcut-key triggers too many XDG portal window when running on Xwayland leading to resources exhaustion
Categories
(Firefox Build System :: Third Party Packaging, defect, P2)
Tracking
(Not tracked)
People
(Reporter: earl.potters, Unassigned, NeedInfo)
References
(Blocks 4 open bugs)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0
Steps to reproduce:
System: Linux 5.15.0-37-generic #39-Ubuntu 22.04 GNU/Linux
Firefox version: 101.0.1
Spamming CTRL-S on Firfox current window
Actual results:
Firefox freezes current window
Expected results:
Not Freeze
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•2 years ago
|
Comment 2•2 years ago
|
||
We indeed trigger too many XDG portal file save dialog, I am unsure whether this is an issue on our side or elsewhere.
Comment 3•2 years ago
|
||
Do you repro that on a nightly from edge channel on snap ? It seems nightly does not exhibit this behavior.
Comment 4•2 years ago
|
||
STRs are a bit worse for me:
- Open a webpage
- CTRL+S, then Escape
- CTRL+S again, maybe twice quickly?
Expected:
One XDG portal window open
Actual:
The shadow around the XDG portal window increases to black, advocating we have many opened.
It's mostly 100% reliable. No repro on Nightly, or on MOZ_ENABLE_WAYLAND=1 firefox
so it seems to be due to XWayland
Updated•2 years ago
|
Reporter | ||
Comment 5•2 years ago
|
||
I have been able to fix my issue by changing WAYLAND to XORG display server.
I don't know if Firefox has current issues with Wayland
Updated•2 years ago
|
Updated•2 years ago
|
Comment 9•2 years ago
|
||
Nightly and forcing DISABLE_WAYLAND=1 MOZ_ENABLE_WAYLAND=0 snap run firefox
I can't reproduce.
Comment 10•2 years ago
|
||
Reproduced and logging on https://searchfox.org/mozilla-central/rev/5a49163b7012ded5fa1c4da5aa4f8d3f7c85a5e7/widget/gtk/nsFilePicker.cpp#349 shows a are hitting this code path each time a new portal is spawn, so whatever is happening seems to be triggered by us :(
Comment 11•2 years ago
|
||
And logging shows spam of OnKeyPressEvent
as well as key_press_event_cb
: https://searchfox.org/mozilla-central/rev/5a49163b7012ded5fa1c4da5aa4f8d3f7c85a5e7/widget/gtk/nsWindow.cpp#8227
Comment 12•2 years ago
|
||
With GTK_DEBUG=all
I get something?
13:57:51.141 -> keycode=37 modifiers=0x0000 keyval=65507 group=0 level=0 consumed_modifiers=0x6002
13:57:51.392 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:51.662 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
[...]
13:57:56.539 -> keycode=37 modifiers=0x0000 keyval=65507 group=0 level=0 consumed_modifiers=0x6002
13:57:56.999 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:57.164 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:57.242 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:57.768 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:57.898 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.098 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.098 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.099 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.203 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.349 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.353 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.353 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.354 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.354 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.638 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.638 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.638 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.638 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.740 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.742 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:58.864 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:59.244 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:59.244 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:59.245 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:59.245 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:59.348 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:59.476 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:59.976 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:59.981 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:59.982 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
13:57:59.982 -> keycode=39 modifiers=0x0004 keyval=115 group=0 level=0 consumed_modifiers=0x6083
First three lines are a first attempt, unsuccessfull. Upon the second attempts, I pressed a few times again and reproduced. Over all, the log for a few seconds contains 136 occurrences of those keycode = 39
lines.
Comment 13•2 years ago
|
||
Comment 14•2 years ago
|
||
This is direct output, performing only two/three consecutive CTRL+s
on the keyboard.
Updated•2 years ago
|
Updated•2 years ago
|
Comment 15•2 years ago
|
||
Disabling "Key repeat" in GNOME Control Center's Accessibility menu (Universal Access > Typing > Repeat Keys
), I cannot reproduce anymore. This is one of the documented STR of https://github.com/ueno/ibus-skk/issues/64 being referenced by https://gitlab.gnome.org/GNOME/mutter/-/issues/203.
As soon as I enable again the feature, I can reproduce.
Comment 16•2 years ago
|
||
This code should prevent us from doing bad things https://searchfox.org/mozilla-central/rev/fadd0a14d2a2724ee4733ef73970a2ddd457a43f/widget/gtk/nsFilePicker.cpp#351, but I can see we dont hit https://searchfox.org/mozilla-central/rev/fadd0a14d2a2724ee4733ef73970a2ddd457a43f/widget/gtk/nsFilePicker.cpp#515 when the issue reproduces.
Comment 17•2 years ago
|
||
(In reply to Alexandre LISSY :gerard-majax from comment #16)
This code should prevent us from doing bad things https://searchfox.org/mozilla-central/rev/fadd0a14d2a2724ee4733ef73970a2ddd457a43f/widget/gtk/nsFilePicker.cpp#351, but I can see we dont hit https://searchfox.org/mozilla-central/rev/fadd0a14d2a2724ee4733ef73970a2ddd457a43f/widget/gtk/nsFilePicker.cpp#515 when the issue reproduces.
This is simply because we get actual CTRL+s
events so we issue a whole new flow of "Save as" from https://searchfox.org/mozilla-central/rev/fadd0a14d2a2724ee4733ef73970a2ddd457a43f/toolkit/content/contentAreaUtils.js#108-151
Comment 18•2 years ago
|
||
Amin, what can we do to move forward on that issue ?
Comment 22•1 year ago
|
||
For what it's worth: this reproduces in flatpak-installed Firefox as well (on Ubuntu 22.04 at least).
Description
•