Bug 503124 - Copy/Paste causes Inkscape to crash
Summary: Copy/Paste causes Inkscape to crash
Status: RESOLVED DOWNSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: Clipboard widget & pop-up (other bugs)
Version First Reported In: 6.3.4
Platform: Arch Linux Linux
: NOR crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL: https://gitlab.com/inkscape/inkscape/...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-21 16:13 UTC by Jens Lallensack
Modified: 2025-04-29 15:44 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
coredumpctl --reverse running Inkscape (25.67 KB, text/plain)
2025-04-21 22:44 UTC, Jens Lallensack
Details
gdb inkscape (3.90 KB, text/plain)
2025-04-21 22:48 UTC, Jens Lallensack
Details
gdb inkscape (2.66 KB, text/plain)
2025-04-22 18:36 UTC, Jens Lallensack
Details
gdb backtrace (3.89 KB, text/plain)
2025-04-22 21:15 UTC, Jens Lallensack
Details
gdb inkscape backtrace full terminal log (11.08 KB, text/plain)
2025-04-22 21:57 UTC, Jens Lallensack
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Lallensack 2025-04-21 16:13:32 UTC
SUMMARY

A bug in Plasma Klipper (the default clipboard applet) causes Inkscape to crash when trying to copy and paste a shape within Inkscape on Wayland.

STEPS TO REPRODUCE
1. Open Inkscape, draw a shape (like a simple rectangle)
2. Copy the shape (ctrl + c). 
3. Insert the copied shape.
4. Insert it a second time.

OBSERVED RESULT
After the first insertion, the spash screen of Inkscape briefly appears. After the second, the program crashes. After the crash, the xml code of the copied shape appears in the clipboard history.

EXPECTED RESULT
No crash

SOFTWARE/OS VERSIONS
Inkscape 1.4

ADDITIONAL INFORMATION
The crashes disappear when I disable Klipper and use an alternative such as CopyQ. The bug therefore clearly lies in Plasma, not in Inkscape.

There is a fixed bug that is very similar:
https://bugs.kde.org/show_bug.cgi?id=501623
However, this was apparently fixed for Plasma 6.3.4, but I am on 6.3.4 and the issue is still there.
Comment 1 TraceyC 2025-04-21 22:19:24 UTC
As the message at the top of the template says, if something crashed, we need a backtrace of it so we can figure out what's going on. Can you please attach a backtrace of the crash using the coredumpctl command-line program, as detailed in [https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl](https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl)?
Thanks.
Comment 2 Jens Lallensack 2025-04-21 22:44:30 UTC
Created attachment 180500 [details]
coredumpctl --reverse running Inkscape

coredumpctl --reverse
This tells me that some file is missing; not sure if it is useful
Comment 3 Jens Lallensack 2025-04-21 22:48:00 UTC
Created attachment 180502 [details]
gdb inkscape

I also did this trace (reproducing the crash while gdb is running). However, this time Inkscape only froze and did not crash.
Comment 4 Jens Lallensack 2025-04-21 22:49:01 UTC
(In reply to TraceyC from comment #1)

Thank you. I tried that, but not sure if the output is useful. Please let me know if you need anything else. Thanks!
Comment 5 TraceyC 2025-04-22 15:36:40 UTC
There's a similar report in bug 501623, and there was a pull request to fix that crash that fixes it in Plasma 6.3.4

Please share this information as asked for in the bug template

SOFTWARE/OS VERSIONS
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version:
Comment 6 Jens Lallensack 2025-04-22 15:40:01 UTC
Yes, I mentioned that bug in my initial report above, but the point is that I am on 6.3.4 and the issue persists!

Operating System: EndeavourOS 
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.12.0
Qt Version: 6.9.0
Kernel Version: 6.14.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × 12th Gen Intel® Core™ i7-1260P
Memory: 31,2 GiB of RAM
Graphics Processor: Mesa Intel® Iris® Xe Graphics
Manufacturer: Star Labs
Product Name: StarBook
System Version: 1.0
Comment 7 TraceyC 2025-04-22 16:33:51 UTC
Thanks for the additional system information. From the backtrace, there are still missing symbols for Inkscape itself. Can you please install the debug package for Inkscape and send a new backtrace? 

Thanks

I did some reading about the bug that was fixed, and that did look to be a bug in the Plasma clipboard app (klipper)
This backtrace is different.
There's discussion in this Inkscape gitlab issue about them working on their end of the problem:
https://gitlab.com/inkscape/inkscape/-/issues/5528
Comment 8 Jens Lallensack 2025-04-22 17:20:36 UTC
Sorry, I did what I can but I am unable to get a useful trace. I now see that the coredumpctl --reverse command you suggested gives only a very old dump according to the timestamp, and that it cannot find a current one, so that trace is definitely useless. Reproducing the crash within GDL (my second attached file) should have all the debugging symbols already, but it does not look useful (in Arch, these are installed by gdl on the fly using Debuginfod, and gdl did install them, and I couldn't find any specific package to install).
Comment 9 TraceyC 2025-04-22 18:05:03 UTC
After you install the debug packages, you can re-run the backtrace on a past entry in coredumpctl 
Alternatively you can do gdb again. It is necessary to have the debug package for Inkscape, however
You might try reaching out to the EndeavourOS folks to find out how to get it installed, or get the necessary symbols
Comment 10 Jens Lallensack 2025-04-22 18:36:17 UTC
Created attachment 180533 [details]
gdb inkscape

I was able to install the debug package. Here the gdb backtrace (trace attached).

This time, I had to copy/paste four times, after which Inkscape froze. After each copy/paste, it seems to try to start a new Inkscape instance (I think so since it is extremely laggy and the splash screen appears).

In addition, the gdl output contained this error (only in the terminal, not in the saved trace):

Script Error
----
Traceback (most recent call last):
  File "/usr/share/inkscape/extensions/gimp_xcf.py", line 201, in <module>
    GimpXcf().run()
    ~~~~~~~~~~~~~^^
  File "/usr/share/inkscape/extensions/inkex/base.py", line 255, in run
    self.save_raw(self.effect())
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/share/inkscape/extensions/inkex/base.py", line 301, in save_raw
    self.save(self.options.output)
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/inkscape/extensions/gimp_xcf.py", line 196, in save
    with open(xcf, "rb") as fhl:
         ~~~~^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/gimp-out-e8rf1gk6/document.xcf'
----

I didn't call that gimp plugin at all, nor did I create any .xcf file (I just created a new rectangle using the "Rectangle tool" and copy/pasted it within the Inkscape window), so this one is mysterious to me.

Hope this helps!
Comment 11 TraceyC 2025-04-22 20:16:11 UTC
From the last attachment, it doesn't look like you ran "backtrace" in gdb.

Take a look at "Retrieving a backtrace with GDB" on
https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Backtraces
Comment 12 Jens Lallensack 2025-04-22 21:15:05 UTC
Created attachment 180538 [details]
gdb backtrace

Sorry for my lack of expertise. I think I got it now; does the attached backtrace look right? Thanks.
Comment 13 TraceyC 2025-04-22 21:42:46 UTC
Thanks for all your efforts into testing this.
I'm not seeing anything about Inkscape in that backtrace. To be clear, did you run Inkscape before backtrace?

gdb inkscape
(gdb) run
(cause crash)
(gdb) backtrace
Comment 14 Jens Lallensack 2025-04-22 21:57:20 UTC
Created attachment 180542 [details]
gdb inkscape backtrace full terminal log

Yes, this is exactly what I did. I just tried it again, and this time attached the full terminal content, including all commands that I entered.
Comment 15 TraceyC 2025-04-29 15:09:30 UTC
Searchable backtrace



Thread 1 "inkscape" received signal SIGPIPE, Broken pipe.
0x00007ffff5eabbe2 in ?? () from /usr/lib/libc.so.6
(gdb) backtrace
#0  0x00007ffff5eabbe2 in ?? () from /usr/lib/libc.so.6
#1  0x00007ffff5e9fe33 in ?? () from /usr/lib/libc.so.6
#2  0x00007ffff5e9fe74 in ?? () from /usr/lib/libc.so.6
#3  0x00007ffff5f1b52e in write () from /usr/lib/libc.so.6
#4  0x00007ffff3efd51e in g_unix_output_stream_write (stream=0x555559fb10e0, buffer=0x555559a03880, count=539,
    cancellable=0x0, error=0x7fffffffcec0) at ../glib/gio/gunixoutputstream.c:363
#5  0x00007ffff3ebd9a5 in write_async_pollable (stream=stream@entry=0x555559fb10e0, task=task@entry=0x55555a037990)
    at ../glib/gio/goutputstream.c:2428
#6  0x00007ffff3ebdb0d in g_output_stream_real_write_async (stream=0x555559fb10e0, buffer=0x555559a03880,
    count=539, io_priority=<optimized out>, cancellable=<optimized out>,
    callback=0x7ffff3eb68e0 <async_ready_write_callback_wrapper>, user_data=0x555559fb1370)
    at ../glib/gio/goutputstream.c:2471
#7  0x00007ffff3eb6bf7 in g_output_stream_write_async (stream=0x555559fb10e0, buffer=0x555559a03880, count=539,
    io_priority=io_priority@entry=0, cancellable=0x555559abcbb0, callback=0x7ffff491cc30 <async_write_data_cb>,
    user_data=0x555559ad7520) at ../glib/gio/goutputstream.c:1067
#8  0x00007ffff492a2c9 in async_write_data_write (write_data=<optimized out>)
    at ../gtk/gdk/wayland/gdkselection-wayland.c:819
#9  stored_selection_notify_write (stored_selection=<optimized out>)
    at ../gtk/gdk/wayland/gdkselection-wayland.c:398
#10 gdk_wayland_selection_store (window=<optimized out>, type=0x8f, mode=GDK_PROP_MODE_REPLACE,
    data=0x555559045060 "\n<!DOCTYPE html>\n<html>\n<head>\n    <title>Inkscape Output</title>\n</head>\n<body>\n    <canvas id='canvas' width='169' height='139'></canvas>\n    <script>\n    var ctx = document.getElementById(\"canvas\")"..., len=<optimized out>) at ../gtk/gdk/wayland/gdkselection-wayland.c:907
#11 gdk_wayland_window_change_property (property=<optimized out>, window=<optimized out>, type=0x8f,
    format=<optimized out>, mode=GDK_PROP_MODE_REPLACE,
    data=0x555559045060 "\n<!DOCTYPE html>\n<html>\n<head>\n    <title>Inkscape Output</title>\n</head>\n<body>\n    <canvas id='canvas' width='169' height='139'></canvas>\n    <script>\n    var ctx = document.getElementById(\"canvas\")"..., nelements=539) at ../gtk/gdk/wayland/gdkwindow-wayland.c:4887
#12 gdk_wayland_window_change_property (window=<optimized out>, property=<optimized out>, type=0x8f,
    format=<optimized out>, mode=GDK_PROP_MODE_REPLACE,
    data=0x555559045060 "\n<!DOCTYPE html>\n<html>\n<head>\n    <title>Inkscape Output</title>\n</head>\n<body>\n    <canvas id='canvas' width='169' height='139'></canvas>\n    <script>\n    var ctx = document.getElementById(\"canvas\")"..., nelements=539) at ../gtk/gdk/wayland/gdkwindow-wayland.c:4878
#13 0x00007ffff44bed87 in _gtk_selection_request (widget=0x5555599fbd80, event=event@entry=0x555558f65bb0)
    at ../gtk/gtk/gtkselection.c:2650
#14 0x00007ffff42b39aa in _gtk_marshal_BOOLEAN__BOXEDv (closure=0x55555564c610, return_value=0x7fffffffd2c0,
    instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>,
    param_types=0x55555564c780) at gtk/gtkmarshalers.c:130
#15 0x00007ffff5bf4e5c in _g_closure_invoke_va (closure=0x55555564c610, return_value=0x7fffffffd2c0,
    instance=0x5555599fbd80, args=0x7fffffffd3b0, n_params=1, param_types=0x55555564c780)
    at ../glib/gobject/gclosure.c:896
#16 signal_emit_valist_unlocked (instance=instance@entry=0x5555599fbd80, signal_id=signal_id@entry=108,
    detail=detail@entry=0, var_args=var_args@entry=0x7fffffffd3b0) at ../glib/gobject/gsignal.c:3438
#17 0x00007ffff5bf4f72 in g_signal_emit_valist (instance=0x5555599fbd80, signal_id=108, detail=0,
    var_args=var_args@entry=0x7fffffffd3b0) at ../glib/gobject/gsignal.c:3277
#18 0x00007ffff5bf5034 in g_signal_emit (instance=instance@entry=0x5555599fbd80, signal_id=<optimized out>,
    detail=detail@entry=0) at ../glib/gobject/gsignal.c:3597
#19 0x00007ffff459a8ed in gtk_widget_event_internal.part.0.lto_priv.0 (widget=0x5555599fbd80, event=0x555558f65bb0)
    at ../gtk/gtk/gtkwidget.c:7822
#20 0x00007ffff4427b7f in gtk_main_do_event (event=<optimized out>) at ../gtk/gtk/gtkmain.c:1861
#21 gtk_main_do_event (event=<optimized out>) at ../gtk/gtk/gtkmain.c:1691
#22 0x00007ffff48e0457 in _gdk_event_emit (event=0x555558f65bb0) at ../gtk/gdk/gdkevents.c:73
#23 _gdk_event_emit (event=0x555558f65bb0) at ../gtk/gdk/gdkevents.c:67
#24 0x00007ffff491b210 in gdk_event_source_dispatch (base=base@entry=0x5555555d6090, callback=<optimized out>,
    data=<optimized out>) at ../gtk/gdk/wayland/gdkeventsource.c:124
#25 0x00007ffff65061e4 in g_main_dispatch (context=0x5555555cfc00) at ../glib/glib/gmain.c:3398
#26 0x00007ffff6569e97 in g_main_context_dispatch_unlocked (context=0x5555555cfc00) at ../glib/glib/gmain.c:4249
#27 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x5555555cfc00, block=block@entry=1,
    dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4314
#28 0x00007ffff6505615 in g_main_context_iteration (context=context@entry=0x5555555cfc00,
    may_block=may_block@entry=1) at ../glib/glib/gmain.c:4379
#29 0x00007ffff3f0f7d6 in g_application_run (application=0x55555574a980, argc=<optimized out>,
--Type <RET> for more, q to quit, c to continue without paging--c
    argv=<optimized out>) at ../glib/gio/gapplication.c:2715
#30 0x0000555555556cbe in main (argc=<optimized out>, argv=0x5555555aac90)
    at /usr/include/glibmm-2.4/glibmm/refptr.h:405
Comment 16 TraceyC 2025-04-29 15:44:39 UTC
Thanks for your persistence and the detailed backtrace. I am not seeing any klipper or KDE related code in it. 

In the Inkscape bug I sent the link for, someone else looks to have encountered the same crash and has the same backtrace:
https://gitlab.com/inkscape/inkscape/-/issues/5528#note_2399268227

This bug appears to be within Inkscape, I recommend following the bug on the Inkscape tracker. I'll close this out, since there's no code the KDE developers can fix. Thanks for your understanding.