Crash with BadWindow when cutting/copying objects

Bug #1589121 reported by Joshua Taillon
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

Version: Inkscape 0.91 r13725 (also occurs on latest compiled bzr branch)
OS: Arch Linux (using latest inkscape 0.91-18 package)
Kernel: 4.5.2-1-ARCH
DE: plasma-desktop 5.6.4
WM: kwin_x11 5.6.4

Using inkscape, cutting or copying an imported raster image object causes a crash with the following error:

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

Steps to reproduce:
-------------------
1. Create new inkscape svg file
2. Import a raster image file (I've seen this happen with multiple tif, jpg, and png files, so file format does not seem to be the deciding factor).
3. Cut the imported object using Ctrl-X shortcut
4. Typically, this will cause a crash, but sometimes will not. If it does not, usually repeated cutting/pasting will cause the crash.

Other notes:
------------
1. Importing a "regular" svg (of just a path) then cutting and pasting repeatedly does not trigger this crash.
2. Some imported raster images will not cause a crash, for some reason (one such image is attached).
3. Sometimes right before crashing, the following error message is printed:

(inkscape:8966): Gdk-CRITICAL **: IA__gdk_window_set_events: assertion 'GDK_IS_WINDOW (window)' failed

4. The crash will occur regardless of the "Image rendering mode" chosen during import.
5. Crash occurs regardless of image DPI option chosen.
6. Crash does NOT occur if "Link" is chosen instead of "Embed"

I have attached two raster images that I found did (and did not) trigger the crash. Hopefully someone can reproduce this. Please let me know if any other information is needed.

Revision history for this message
Joshua Taillon (jat255) wrote :
Revision history for this message
Joshua Taillon (jat255) wrote :
Revision history for this message
jazzynico (jazzynico) wrote :

Thanks for taking the time to file a report!

Not reproduced on Windows XP (32-bit), Inkscape 0.91 and trunk rev. 14998.

Revision history for this message
Joshua Taillon (jat255) wrote : Re: [Bug 1589121] Re: Crash with BadWindow when cutting/copying objects

Yes, I have a recent bzr branch of Inkscape built on my windows 8 machine
at work and have not noticed this happening there (although admittedly
haven't tested it very thoroughly), so I think it may be a Linux specific
issue, or perhaps DE related.

On Wed, Jun 22, 2016, 8:11 AM jazzynico <email address hidden> wrote:

> Thanks for taking the time to file a report!
>
> Not reproduced on Windows XP (32-bit), Inkscape 0.91 and trunk rev.
> 14998.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1589121
>
> Title:
> Crash with BadWindow when cutting/copying objects
>
> Status in Inkscape:
> New
>
> Bug description:
> Version: Inkscape 0.91 r13725 (also occurs on latest compiled bzr branch)
> OS: Arch Linux (using latest inkscape 0.91-18 package)
> Kernel: 4.5.2-1-ARCH
> DE: plasma-desktop 5.6.4
> WM: kwin_x11 5.6.4
>
> Using inkscape, cutting or copying an imported raster image object
> causes a crash with the following error:
>
> The program 'inkscape' received an X Window System error.
> This probably reflects a bug in the program.
> The error was 'BadWindow (invalid Window parameter)'.
> (Details: serial 16802 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.)
>
>
> Steps to reproduce:
> -------------------
> 1. Create new inkscape svg file
> 2. Import a raster image file (I've seen this happen with multiple tif,
> jpg, and png files, so file format does not seem to be the deciding factor).
> 3. Cut the imported object using Ctrl-X shortcut
> 4. Typically, this will cause a crash, but sometimes will not. If it
> does not, usually repeated cutting/pasting will cause the crash.
>
> Other notes:
> ------------
> 1. Importing a "regular" svg (of just a path) then cutting and pasting
> repeatedly does not trigger this crash.
> 2. Some imported raster images will not cause a crash, for some reason
> (one such image is attached).
> 3. Sometimes right before crashing, the following error message is
> printed:
>
> (inkscape:8966): Gdk-CRITICAL **: IA__gdk_window_set_events: assertion
> 'GDK_IS_WINDOW (window)' failed
>
> 4. The crash will occur regardless of the "Image rendering mode" chosen
> during import.
> 5. Crash occurs regardless of image DPI option chosen.
> 6. Crash does NOT occur if "Link" is chosen instead of "Embed"
>
> I have attached two raster images that I found did (and did not)
> trigger the crash. Hopefully someone can reproduce this. Please let me
> know if any other information is needed.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/inkscape/+bug/1589121/+subscriptions
>

Revision history for this message
jazzynico (jazzynico) wrote :

Tested again and not reproduced on Xubuntu 16.04 (64-bit), Inkscape 0.91 and trunk rev. 15000.
No crash, no error message.

Revision history for this message
Daniel Mulholland (dan-mulholland) wrote :

I still have this bug:

⋊> ~ uname -a 08:07:11
Linux XPS-13-9360 4.11.12-041112-generic #201707210350 SMP Fri Jul 21 07:53:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
⋊> ~ lsb_release -a 08:09:47
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 17.10
Release: 17.10
Codename: artful

⋊> ~ inkscape --version 08:11:21
Inkscape 0.92.2 (5c3e80d, 2017-08-06)

In the attached image, cutting half of the objects causes a consistent crash with the following error message:

⋊> ~ inkscape 08:06:44

(inkscape:23338): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",

(inkscape:23338): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",

** (inkscape:23338): WARNING **: Invalid borders specified for theme pixmap:
        /usr/share/themes/Breeze/gtk-2.0/../assets/line-h.png,
borders don't fit within the image
The program 'inkscape' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 33156 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.)

Revision history for this message
Matt Arcidy (marcidy) wrote :

Hi, same issue.

load attached file (Vanishing-pt.svg), Ctrl-A, crash. 100% reproducible for me with this file / my machine. I don't have access to other machines to test.
No work-around available that i can find.

os: debian stable
inkscape version: 0.92.1-1

Thank you

Revision history for this message
Zygmunt Pabian (zygmunt-pabian) wrote :

I had the same problem with Ctrl-C in inkscape on friend Ubuntu 17.10.
It turned out problem occured while doublecmd was on.
Removing doublecmd solved problem.

Revision history for this message
Boris Dalstein (dalboris) wrote :

Same error here. I have a file with an embedded raster image. Ctrl-A then Ctrl+C crashes Inkscape with the same error message as the OP, 100% reproducible.

OS: Kubuntu 16.04
Inkscape 0.91 r13725

Revision history for this message
Jan Pechek (honza-pechek) wrote :

Same problem here. If i copying imported raster image, Inkscape crash with "BadWindow" error message.

OS: Arch, Linux 4.15.15-1-ARCH
Inkscape 0.92.2 2405546, 2018-03-11

Revision history for this message
Daniel Mulholland (dan-mulholland) wrote :

Also experiencing this bug on Kubuntu 18.04 and Inkscape 0.92.3.

$ inkscape --sync

(inkscape:26961): Gtk-WARNING **: 07:14:51.548: Unable to locate theme engine in module_path: "adwaita",

(inkscape:26961): Gtk-WARNING **: 07:14:51.550: Unable to locate theme engine in module_path: "adwaita",

(inkscape:26961): GLib-GIO-CRITICAL **: 07:14:52.264: g_dbus_proxy_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

(inkscape:26961): GLib-GIO-CRITICAL **: 07:14:52.264: g_dbus_proxy_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

(inkscape:26961): GLib-GIO-CRITICAL **: 07:14:52.264: g_dbus_proxy_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

** (inkscape:26961): WARNING **: 07:14:53.687: Invalid borders specified for theme pixmap:
        /usr/share/themes/Breeze/gtk-2.0/../assets/line-h.png,
borders don't fit within the image
The program 'inkscape' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 86557 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.)
$ inkscape --version
Inkscape 0.92.3 (2405546, 2018-03-11)

Revision history for this message
Feng (fengatubuntuone) wrote :

Three years later....

This problem persists with my workstation and latop:

Distribution: MANJARO Linux and Arch Linux
platform: x86_64

This bug is not always reproducible. But once it happens, it will very likely to be reproducible in a short period. I mean, inkscape might crash when copying image 1 at the first time. If you reopen it, inkscape might work with image 1, but will crash when you are trying to copy image 2.

I have recompiled inkscape in debug mode, but unfortunately nothing useful produced. Just same message as was posted in the above threads:

```
26896 The program 'inkscape' received an X Window System error.
26897 This probably reflects a bug in the program.
26898 The error was 'BadWindow (invalid Window parameter)'.
26899 (Details: serial 233802 error_code 3 request_code 18 minor_code 0)
26900 (Note to programmers: normally, X errors are reported asynchronously;
26901 that is, you will receive the error a while after causing it.
26902 To debug your program, run it with the --sync command line
26903 option to change this behavior. You can then get a meaningful
26904 backtrace from your debugger if you break on the gdk_x_error() function.)
```

However, I have captured the information produced by running `strace -p ID`, hopefully it might help someone to look deeper into this bug. Please find it from attachment.

Revision history for this message
Feng (fengatubuntuone) wrote :

This happens again when copying an object import from a bmp file. Please find the report generated using command `strace inkscape &> inkscape.log`, with Inkscape 0.92.4

Revision history for this message
Nathan Lee (nathan.lee) wrote :

Closing because this issue is a duplicate of an (admitted newer) issue in gitlab (https://gitlab.com/inkscape/inkscape/issues/275).

As part of the bug migration, we are migrating old issues to gitlab manually (would love some help http://alpha.inkscape.org/bug-migration/).

Note: I believe this issue is related to Qlipper, Klipper, and other clipboard managers interacting with Inkscape (I've certainly replicated the issue with them). If you are using those tools, quitting/removing them provides a temporary workaround.

Closed by: https://gitlab.com/nathanal

Changed in inkscape:
status: New → Invalid
tbnorth (terry-n-brown)
tags: added: bug-migration
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.