Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying large images from Gimp crashes it. #636

Closed
Negirno opened this issue Feb 11, 2017 · 18 comments
Closed

Copying large images from Gimp crashes it. #636

Negirno opened this issue Feb 11, 2017 · 18 comments
Labels

Comments

@Negirno
Copy link

Negirno commented Feb 11, 2017

System: Ubuntu 16.04.2 LTS
CopyQ version: CopyQ Clipboard Manager v2.8.2 Built with: Qt 5.5.1, LibQxt 0.7.0 (downloaded from your repo)
Gimp version: 2.8.16 (the version available in the repositories)

Ever since I've installed this new version, when I copy something large to the clipboard, Gimp just exits, and the copied image doesn't appear in CopyQ.

Running it from the terminal gets me the following errors when copying:

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 23004 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:3913): LibGimpBase-WARNING **: script-fu: gimp_wire_read(): error

Interestingly, if I copy just a small part of the image, then this doesn't happen. It also didn't happen when I've tried to copy an empty image, although it does happen with very large ones (I tried 4096x4096 RGB color).

Edit: Forgot to mention it that this doesn't happen in Krita, even with large images (although it takes some time to appear in CopyQ)

@mutlay
Copy link

mutlay commented Feb 11, 2017

Yes, same issue, I had to uninstall CopyQ from 16.04 Ubuntu Gnome.

@hluk
Copy link
Owner

hluk commented Feb 12, 2017

Looks like Gimp bug.

Strangely this doesn't happen when getting copied image data with xclip.

@hluk
Copy link
Owner

hluk commented Feb 12, 2017

I wanted to debug this so I recompiled Gimp with debug symbols and I cannot reproduce this -- this is classic :(.

BTW, I'm using Arch Linux and Gimp 2.8.18. The version in from official package is affected with this bug.

Edit: I can actually reproduce this sometimes with debug version.

@hluk hluk closed this as completed in 495bb28 Feb 12, 2017
@hluk
Copy link
Owner

hluk commented Feb 12, 2017

Fixed. It seems it's partially an issue in Gimp and in Qt.

@rachmadaniHaryono
Copy link

rachmadaniHaryono commented Dec 4, 2018

@Hulk it seem the bug is still exist

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 263921 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:6014): LibGimpBase-WARNING **: 18:55:37.232: script-fu: gimp_wire_read(): error
  • GNU Image Manipulation Program version 2.10.6
  • copyq v3.7.0
  • Linux q-X201EP 4.18.0-11-generic #12-Ubuntu SMP Tue Oct 23 19:22:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • ubuntu 18.10

@hluk hluk reopened this Dec 4, 2018
@hluk hluk added the bug label Dec 4, 2018
hluk added a commit that referenced this issue Dec 4, 2018
Ignore clipboard data if accessing it takes long time.

Retrieves images last.

Fixes #636

Signed-off-by: Lukas Holecek <hluk@email.cz>
@hluk hluk closed this as completed in ebe060b Dec 5, 2018
@hluk
Copy link
Owner

hluk commented Dec 5, 2018

@rachmadaniHaryono I tried my best to fix this but the fixes I've implemented makes the bug only happen less frequently.

It's bug in Gimp (or in some libs it uses) because it definitely should not cause a crash. And it's possibly a bug in Qt because of how it retrieves X11 clipboard/selection.

@rachmadaniHaryono
Copy link

which mean even if i use similar script like on #561 it will still crash?

[Command]
Automatic=true
Command="
    copyq ignore
    sleep 10
    copyq copy"
Icon=\xf084
Name=Ignore gimp
Remove=true
Window=.* - GIMP$

@hluk
Copy link
Owner

hluk commented Dec 5, 2018

@rachmadaniHaryono It could crash even in that case since the clipboard content is retrieved before the command starts.

You would need to disable storing images (in "Items" configuration tab uncheck "Images" in the list).

@dniku
Copy link

dniku commented Apr 19, 2019

I'm getting a very similar crash with Shutter (a screenshot tool written in Perl).

The program 'shutter' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 18205 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.)

Also Inkscape suffers from the same issue: https://bugs.launchpad.net/inkscape/+bug/1589121
Also there is a bug report on Shutter itself: https://bugs.launchpad.net/shutter/+bug/1529259

@hluk
Copy link
Owner

hluk commented Apr 20, 2019

Probably partially problem in how Qt retrieves data but I don't see how it can crash foreign app just by requesting clipboard unless there is a bug in that app itself (or in an library it uses, XCB, X11).

@dniku
Copy link

dniku commented Apr 20, 2019

Shutter GUI is built on GTK. Not sure about Inkscape.

@sispus
Copy link

sispus commented Dec 3, 2020

Using gtk3 fixes this issue for gimp 2.99. Former versions of gimp uses gtk2.

@louisgag
Copy link

I have the same issue with Gimp 2.10.18 on Ubuntu 20.04.1 LTS with copyq v3.10.0

I get the same message as @dniku but noting shows up in Xorg.0.log, even when running with --sync

@sispus
Copy link

sispus commented Dec 23, 2020

Hi,
The issue is fixed in gimp with gtk3 (ver: 2.99). see: https://gitlab.gnome.org/GNOME/gimp/-/issues/789#note_844634
You can switch to latest development package of gimp or wait for stable version, but they won't fix it for gtk2.

@louisgag
Copy link

louisgag commented Dec 25, 2020

Thanks. Upgrading GIMP to beta works.
I had to first understand of to get the Flatpak system working, if anyone is wondering you need to run these two commands before doing the "standard" Flatpak gimp-beta installation.

sudo flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak install org.gnome.Platform

Too bad they won't fix it for all the other non-beta users.. I imagine there are a lot of people thinking that GIMP is unstable without knowing the bug comes from an incompatibility with CopyQ...

@hluk
Copy link
Owner

hluk commented Dec 27, 2020

@sispus, @louisgag Thanks for posting the issue details and solution!

@Minipada
Copy link

Instructions for installing the beta: https://www.gimp.org/downloads/devel/

@danielkrajnik
Copy link

danielkrajnik commented Jun 24, 2021

on kubuntu 20.04 both gimp 2.10 and 2.99 still seem to fail to paste large images copied into clipboard into chrome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants