GIMP crashing when a Qt clipboard manager or another Qt application with similar clipboard interaction is running
- Fixed in: Qt 5.12.12, 6.1.3, 6.2.0 Beta3, 6.3.0 Alpha (cf. bug report)
- The patch to backport (for older-version Qt packagers): https://codereview.qt-project.org/c/qt/qtbase/+/306771
@schumaml
Edit on 2021-08-13 byThe Qt bug (QTBUG-56595) causing this has been fixed - see #789 (comment 1246287). Once updated Qt versions (or backports) spread across distros, the crashes with GTK 2.x applications will disappear, and with GTK 3.x applications copy&paste should start to work in previously affected environments.
Edit on 2020-12-03 by Jehan
It would appear that the main reason is a Qt bug (QTBUG-56595) which doesn't properly follow the INCR protocol (apparently some X11 inter-client communication protocol for sending data incrementally) and closes the communication too early while a GTK program would continue to send data on a now-invalid communication channel (named "window", or so I guess, hence the BadWindow error from X11).
Anyway to this day, the situation is:
- The root bug still exists on Qt.
- The crash still affects any GTK+2 software (e.g. GIMP 2.10.x) and chances of this being fixed are slim.
- The crash doesn't happen anymore on GTK+3 software (e.g. dev versions GIMP 2.99.x and future GIMP 3) but trying to copy-paste large image will fail if you use a Qt application which interferes with the standard copy-paste process.
Interfering applications are Qt clipboard managers (you probably have one running by default if you use KDE, even if you don't know about it; apparently reporters have been citing klipper, qlipper or copyq for instance), but also some other Qt programs such as TeamViewer, xnviewmp and Telegram (tdesktop) (though apparently they got a fix using GTK just for the clipboard interaction recently so recent version of Telegram might fix it!).
What GIMP can do: not much. The bug lies within Qt as far as we understand, so this report only exists to inform people. The only workaround so far is to disable your Qt-based clipboard manager and to close any other Qt application with clipboard interference.
If you find any other interfering application which triggers the same issue, feel free to post a comment so that we can update this description.
Submitted by Jan Prunk
Link to original bug (#757070)
Description
Hello !
I noticed GIMP crashing in LXQT on Debian stable when copying cropped image into clipboard. The error is:
~$ gimp DSC04720.jpg
(gimp:21861): Gimp-Widgets-CRITICAL **: gimp_device_info_set_device: assertion '(info->device == NULL && GDK_IS_DEVICE (device)) || (GDK_IS_DEVICE (info->device) && device == NULL)' failed
While parsing XMP metadata:
Error: No XMP packet found
The program 'gimp' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 145808 error_code 3 request_code 18 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
(script-fu:21866): LibGimpBase-WARNING **: script-fu: gimp_wire_read(): error
~$ dpkg -l |grep lxqt
ii liblxqt-globalkeys-ui0 0.9.0+20150926-1~bpo8+1 amd64 daemon used to register global keyboard shortcuts (ui files)
ii liblxqt-globalkeys0 0.9.0+20150926-1~bpo8+1 amd64 daemon used to register global keyboard shortcuts (shared libs)
ii liblxqt0:amd64 0.9.0+20151024-1~bpo8+1 amd64 Shared libraries for LXQt desktop environment (libs)
ii lxqt 0.9.0-5~bpo8+1 all Metapackage for LXQt
ii lxqt-about 0.9.0+20150902-2~bpo8+1 amd64 About screen for LXQt
ii lxqt-admin 0.9.0+20150830-2~bpo8+1 amd64 Admin tools for LXQt
ii lxqt-common 0.9.1+20151003-1~bpo8+1 all Common files for LXQt
ii lxqt-config 0.9.0+20150923-1~bpo8+1 amd64 LXQt system settings center
ii lxqt-core 0.9.0-5~bpo8+1 all Metapackage for the LXQt core
ii lxqt-globalkeys 0.9.0+20150926-1~bpo8+1 amd64 daemon used to register global keyboard shortcuts (appl.)
ii lxqt-notificationd 0.9.0+20150903-1~bpo8+1 amd64 LXQt notification daemon
ii lxqt-openssh-askpass 0.9.0+20150830-1~bpo8+1 amd64 OpenSSH user/password GUI dialog for LXQt
ii lxqt-panel 0.9.0+20150925-1~bpo8+1 amd64 LXQt desktop panel
ii lxqt-policykit 0.9.0+20150830-1~bpo8+1 amd64 LXQt authentication agent for PolicyKit
ii lxqt-powermanagement 0.9.0+20150930-1~bpo8+1 amd64 power management module for LXQt
ii lxqt-qtplugin 0.9.0+20150924-1~bpo8+1 amd64 LXQt system integration plugin for Qt
ii lxqt-runner 0.9.0+20150831-1~bpo8+1 amd64 LXQt program launcher
ii lxqt-session 0.9.0+20151023-1~bpo8+1 amd64 session manager component for LXQt
ii lxqt-sudo 0.9.0+20150908-1~bpo8+1 amd64 Graphical QT frontend for plain sudo
~$ dpkg -l |grep gimp
ii gimp 2.8.14-1+b1 amd64 The GNU Image Manipulation Program
ii gimp-data 2.8.14-1 all Data files for GIMP
ii libgimp2.0 2.8.14-1+b1 amd64 Libraries for the GNU Image Manipulation Program
Kind regards,
Jan
Version: 2.8.14