Crash due to possibly invalid encoding of clipboard content by Firefox

Asked by Björn on 2021-01-05

When copying a sequence of characters containing "ö", "ä" or "ü" from a website in Firefox and pasting it into a KeePass2 password field, KeePass2 and/or Ubuntu crashes. The latter depends on whether it's the "Open Database" dialog or the password field of a database entry. (No problems, when using Chrome)

When pasting into the "Open container" dialog, I get a "KeePass - Fatal Error" window, saying

> A fatal error has occurred!
>
> An extended error report has been copied to the clipboard.
>
> Cannot access a disposed object.
> Object name: 'KeePass.UI.CustomListViewEx'.

The error report reads as

> Cannot access a disposed object.
> Object name: 'KeePass.UI.CustomListViewEx'.
> System.Windows.Forms
> at System.Windows.Forms.Control.CreateHandle () [0x00016] in <a3daa9b84fd241a497578a25f68bc3c7>:0
> at System.Windows.Forms.ListView.CreateHandle () [0x00000] in <a3daa9b84fd241a497578a25f68bc3c7>:0
> at System.Windows.Forms.Control.get_Handle () [0x0002b] in <a3daa9b84fd241a497578a25f68bc3c7>:0
> at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control.get_Handle()
> at KeePass.Forms.MainForm.UpdateEntryList (KeePassLib.PwGroup pgSelected, System.Boolean bOnlyUpdateCurrentlyShown) [0x00023] in <15a3c3813eee42a48d65caee98f0310e>:0
> at KeePass.Forms.MainForm.UpdateUI (System.Boolean bRecreateTabBar, KeePass.UI.PwDocument dsSelect, System.Boolean bUpdateGroupList, KeePassLib.PwGroup pgSelect, System.Boolean bUpdateEntryList, KeePassLib.PwGroup pgEntrySource, System.Boolean bSetModified, System.Windows.Forms.Control cOptFocus) [0x00040] in <15a3c3813eee42a48d65caee98f0310e>:0
> at KeePass.Forms.MainForm.UpdateUI (System.Boolean bRecreateTabBar, KeePass.UI.PwDocument dsSelect, System.Boolean bUpdateGroupList, KeePassLib.PwGroup pgSelect, System.Boolean bUpdateEntryList, KeePassLib.PwGroup pgEntrySource, System.Boolean bSetModified) [0x00000] in <15a3c3813eee42a48d65caee98f0310e>:0
> at KeePass.Forms.MainForm.OnFormShown (System.Object sender, System.EventArgs e) [0x00024] in <15a3c3813eee42a48d65caee98f0310e>:0
> at System.Windows.Forms.Form.OnShown (System.EventArgs e) [0x0001c] in <a3daa9b84fd241a497578a25f68bc3c7>:0
> at System.Windows.Forms.Form.SetVisibleCore (System.Boolean value) [0x00183] in <a3daa9b84fd241a497578a25f68bc3c7>:0
> at KeePass.Forms.MainForm.SetVisibleCore (System.Boolean value) [0x00059] in <15a3c3813eee42a48d65caee98f0310e>:0
> at System.Windows.Forms.Control.set_Visible (System.Boolean value) [0x0000c] in <a3daa9b84fd241a497578a25f68bc3c7>:0
> at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control.set_Visible(bool)
> at System.Windows.Forms.Application.RunLoop (System.Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x0005f] in <a3daa9b84fd241a497578a25f68bc3c7>:0
> at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00014] in <a3daa9b84fd241a497578a25f68bc3c7>:0
> at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00006] in <a3daa9b84fd241a497578a25f68bc3c7>:0
> at KeePass.Program.MainPriv (System.String[] args) [0x0068b] in <15a3c3813eee42a48d65caee98f0310e>:0
> Void CreateHandle()

When pasting into the password field of a database entry, Ubuntu crashes and the login screen appears. I found the following part in /var/log/syslog but I'm unable to make sense of it.

> gnome-shell[10186]: **
> gnome-shell[10186]: mutter:ERROR:../src/x11/group.c:75:meta_group_new: assertion failed: (g_hash_table_lookup (x11_display->groups_by_leader, &group_leader) == NULL)
> gnome-shell[10186]: Bail out! mutter:ERROR:../src/x11/group.c:75:meta_group_new: assertion failed: (g_hash_table_lookup (x11_display->groups_by_leader, &group_leader) == NULL)
> gnome-shell[10186]: GNOME Shell crashed with signal 6
> gnome-shell[10186]: == Stack trace for context 0x56291fb9b440 ==
> update-notifier[11706]: Error reading events from display: Broken pipe
> gnome-terminal-[12097]: Error reading events from display: Broken pipe
> org.kde.kdeconnect.daemon.desktop[10448]: The Wayland connection broke. Did the Wayland compositor die?
> seahorse[11175]: Error reading events from display: Broken pipe
> evolution-alarm[10439]: Error reading events from display: Broken pipe
> gsd-wacom[10416]: Error reading events from display: Broken pipe
> gsd-keyboard[10378]: Error reading events from display: Broken pipe
> gsd-media-keys[10379]: Error reading events from display: Broken pipe
> gsd-power[10382]: Error reading events from display: Broken pipe
> gsd-color[10373]: Error reading events from display: Broken pipe
> nautilus[11104]: Error reading events from display: Broken pipe
> geany[11241]: Error reading events from display: Broken pipe
> systemd[10019]: gsd-media-keys.service: Main process exited, code=exited, status=1/FAILURE
> systemd[10019]: gsd-media-keys.service: Failed with result 'exit-code'.
> systemd[10019]: Stopped target GNOME Media keys handling.
> systemd[10019]: gnome-terminal-server.service: Main process exited, code=exited, status=1/FAILURE
> systemd[10019]: gnome-terminal-server.service: Failed with result 'exit-code'.
> systemd[10019]: Stopped target GNOME Keyboard handling.
> systemd[10019]: vte-spawn-bc6a095c-30e6-4d80-ba8d-224bc9a65d6a.scope: Succeeded.
> systemd[10019]: vte-spawn-43e4ff28-fe9f-48dd-aa2c-7d91ff051d9b.scope: Succeeded.
> systemd[10019]: gsd-wacom.service: Main process exited, code=exited, status=1/FAILURE
> systemd[10019]: gsd-wacom.service: Failed with result 'exit-code'.
> systemd[10019]: Stopped target GNOME Wacom handling.
> systemd[10019]: Stopped target GNOME Power management handling.
> systemd[10019]: gnome-shell-wayland.service: Main process exited, code=dumped, status=6/ABRT
> systemd[10019]: gsd-power.service: Main process exited, code=exited, status=1/FAILURE
> systemd[10019]: gsd-power.service: Failed with result 'exit-code'.
> systemd[10019]: Stopped GNOME Power management handling.
> systemd[10019]: gsd-power.service: Triggering OnFailure= dependencies.
> systemd[10019]: vte-spawn-ae5a443d-1353-4516-b4d3-361e28f3d006.scope: Succeeded.
> systemd[10019]: Started GNOME Session Failed lockdown screen (user).
> systemd[10019]: Reached target GNOME Session Failed.
> systemd[10019]: gsd-keyboard.service: Main process exited, code=exited, status=1/FAILURE
> systemd[10019]: gsd-keyboard.service: Failed with result 'exit-code'.
> systemd[10019]: Stopped GNOME Keyboard handling.
> systemd[10019]: gsd-keyboard.service: Triggering OnFailure= dependencies.
> systemd[10019]: gsd-color.service: Main process exited, code=exited, status=1/FAILURE
> systemd[10019]: gsd-color.service: Failed with result 'exit-code'.
> systemd[10019]: Stopped target GNOME Color management.
> gnome-shell[10277]: (EE) failed to read Wayland events: Broken pipe
> systemd[10019]: vte-spawn-32246aa8-54a8-49d7-95ab-c2340ab0e009.scope: Succeeded.
> gnome-session-f[14043]: Cannot open display:
> gnome-session-failed[14043]: Unable to init server: Could not connect: Connection refused
> systemd[10019]: gnome-session-failed.service: Main process exited, code=exited, status=1/FAILURE
> gnome-shell[13767]: Gdk-Message: 16:29:16.567: /usr/lib/firefox/firefox: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
> systemd[10019]: gnome-launched-geany.desktop-11241.scope: Succeeded.
> gsd-xsettings[10656]: gsd-xsettings: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.
> systemd[10019]: Stopped target GNOME Session Failed.
> systemd[10019]: gsd-xsettings.service: Main process exited, code=exited, status=1/FAILURE
> systemd[10019]: gsd-xsettings.service: Failed with result 'exit-code'.
> systemd[10019]: gsd-xsettings.service: Triggering OnFailure= dependencies.
> firefox[11435]: firefox: Fatal IO error 0 (Success) on X server :0.
> systemd[10019]: gnome-shell-wayland.service: Failed with result 'core-dump'.
> systemd[10019]: gnome-shell-wayland.service: Triggering OnFailure= dependencies.
> systemd[10019]: Stopped target GNOME Wayland Session (session: ubuntu).
> systemd[10019]: Stopped target Current graphical user session.
> systemd[10019]: unicast-local-avahi.path: Succeeded.
> systemd[10019]: Stopped Path trigger for Avahi .local domain notifications.
> systemd[10019]: update-notifier-crash.path: Succeeded.
> systemd[10019]: Stopped Path trigger for Apport crash notifications.
> systemd[10019]: update-notifier-release.path: Succeeded.
> ...

I'm using Ubuntu 20.04, Firefox 84.0 and KeePass 2.44.

For me it's unclear whether it's related to Ubuntu, Firefox or KeePass or multiple of them.

So far, I tried to compare the clipboard content with Chrome (87.0.4280.88). When copying the lower case "ö" in the first sentence of https://en.wikipedia.org/wiki/%C3%96 using Firefox and Chrome I get two different results, using shell command
> xclip -o -noutf8 | xxd
This returns 0xc3b6 for Chrome and 0xf6 for Firefox. 0xc3b6 is "ö" encoded with utf-8, but 0xf6 is simply the un-encoded unicode code-point for "ö". But I found no information, how the clipboard content should be encoded. Nor do I know if the above approach for comparing clipboard content is reasonable.

So maybe someone can tell me, where I should file a bug report.

Thank you.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Björn
Solved:
2021-01-08
Last query:
2021-01-08
Last reply:
2021-01-08
Bernard Stafford (bernard010) said : #1

"KeePass2 and/or Ubuntu crashes" My suggestion is to file a Bug Report using apport. Terminal : ubuntu-bug linux
This will start gathering information and automatically include it on your bug report.
https://wiki.ubuntu.com/Apport

Bernard Stafford (bernard010) said : #2

Please include a link to this question in the comments of your bug report.

Björn (bbc131) said : #3

Thank you Bernard,

up to your answer I thought it's not possible to add comments to a bug report. But now I read the apport documentation again and carefully and found out, that I have to enable it first manually.
Now it worked and I reported it, see
https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1910772