Crash on paste in text box

Bug #421597 reported by Diederik van Lierop
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
High
Unassigned
inkscape (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Inkscape crashes when pasting into a text box, i.e. while editing the text, but this is hard to reproduce. I've encountered this on two different documents.

ERROR:ui/clipboard.cpp:1084:void Inkscape::UI::ClipboardManagerImpl::_onGet(Gtk::SelectionData&, guint): assertion failed:(_clipboardSPDoc != NULL)

Program received signal SIGABRT, Aborted.
0x00000030a1e32f05 in raise () from /lib64/libc.so.6

We should at least get rid of this assertion! I'm on Fedora 11, using Inkscape build 22177. Here's a backtrace:

#0 0x00000030a1e32f05 in raise () from /lib64/libc.so.6
#1 0x00000030a1e34a73 in abort () from /lib64/libc.so.6
#2 0x0000003e9ba5d803 in g_assertion_message () from /lib64/libglib-2.0.so.0
#3 0x0000003e9ba5dca2 in g_assertion_message_expr () from /lib64/libglib-2.0.so.0
#4 0x00000000008473fd in Inkscape::UI::ClipboardManagerImpl::_onGet (this=0x597e1f0, sel=@0x7fffffffcf60)
    at ui/clipboard.cpp:1084
#5 0x000000000084c68b in sigc::bound_mem_functor2<void, Inkscape::UI::ClipboardManagerImpl, Gtk::SelectionData&, unsigned int>::operator() (this=0x59b4b58, _A_a1=@0x7fffffffcf60, _A_a2=@0x7fffffffcf5c)
    at /usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1917
#6 0x000000000084c6b7 in sigc::adaptor_functor<sigc::bound_mem_functor2<void, Inkscape::UI::ClipboardManagerImpl, Gtk::SelectionData&, unsigned int> >::operator()<Gtk::SelectionData&, unsigned int const&> (this=0x59b4b50, _A_arg1=@0x7fffffffcf60,
    _A_arg2=@0x7fffffffcf5c) at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:103
#7 0x000000000084c6ea in sigc::internal::slot_call2<sigc::bound_mem_functor2<void, Inkscape::UI::ClipboardManagerImpl, Gtk::SelectionData&, unsigned int>, void, Gtk::SelectionData&, unsigned int>::call_it (rep=0x59b4b20, a_1=@0x7fffffffcf60,
    a_2=@0x7fffffffcf5c) at /usr/include/sigc++-2.0/sigc++/functors/slot.h:173
#8 0x00000038bee7e74a in ?? () from /usr/lib64/libgtkmm-2.4.so.1
#9 0x0000003e9c20b7dd in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#10 0x0000003e9c2214bd in ?? () from /lib64/libgobject-2.0.so.0
#11 0x0000003e9c222b68 in g_signal_emit_valist () from /lib64/libgobject-2.0.so.0
#12 0x0000003e9c222ee7 in g_signal_emit_by_name () from /lib64/libgobject-2.0.so.0
#13 0x00000038b9382753 in gtk_selection_invoke_handler (widget=0x5783c70, data=0x7fffffffd420, time=8779709)
    at gtkselection.c:2953
#14 0x00000038b938372e in IA__gtk_selection_convert (widget=0x5783c70, selection=0x45, target=0xbb, time_=8779709)
    at gtkselection.c:1084
#15 0x00000038b944643c in IA__gtk_clipboard_wait_for_contents (clipboard=0x5768130, target=0xbb) at gtkclipboard.c:1310
#16 0x00000038bee7df03 in Gtk::Clipboard::wait_for_contents () from /usr/lib64/libgtkmm-2.4.so.1
#17 0x0000000000847d33 in Inkscape::UI::ClipboardManagerImpl::_retrieveClipboard (this=0x597e1f0, required_target=
          {static npos = 18446744073709551615, string_ = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x57914a8 "image/x-inkscape-svg"}}})
    at ui/clipboard.cpp:1044
#18 0x000000000084af82 in Inkscape::UI::ClipboardManagerImpl::paste (this=0x597e1f0, in_place=false) at ui/clipboard.cpp:314
#19 0x00000000004a8cfd in sp_selection_paste (desktop=0x1a36c00, in_place=false) at selection-chemistry.cpp:954
#20 0x0000000000594dd4 in Inkscape::EditVerb::perform (action=0x1a084d0, data=0x17) at verbs.cpp:852
#21 0x00000000006bf9bb in sp_action_perform (action=0x1a084d0, data=0x0) at helper/action.cpp:181
#22 0x00000000004bcb05 in sp_shortcut_invoke (shortcut=33554550, view=0x1a36c00) at shortcuts.cpp:55
#23 0x00000000006c7616 in on_window_key_press (event=0x577e2b0) at helper/window.cpp:34
#24 0x00000000006c76da in sigc::pointer_functor1<_GdkEventKey*, bool>::operator() (this=0x2c0b938, _A_a1=@0x7fffffffd8a8)
    at /usr/include/sigc++-2.0/sigc++/functors/ptr_fun.h:111
#25 0x00000000006c76fd in sigc::adaptor_functor<sigc::pointer_functor1<_GdkEventKey*, bool> >::operator()<_GdkEventKey* const&>
    (this=0x2c0b930, _A_arg1=@0x7fffffffd8a8) at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:84

Revision history for this message
Alvin Penner (apenner) wrote :

cannot reproduce on Windows build for 0.47pre2 rev 22153.
could you provide more details on steps to reproduce?

tags: added: crash
Revision history for this message
jazzynico (jazzynico) wrote :

Not reproduced on Ubuntu 9.04, Inkscape rev. 22183.
Did you copy from another application or from Inkscape?

Changed in inkscape:
importance: Undecided → High
Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

Three people helping out in triaging, ain't that great? What a lovely community we have! :-)

I copied from Inkscape to Inkscape, while editing text. So I pasted while the text cursor was blinking. I'm not sure what was on the clipboard, nor whether I tried pasting the style or tied basic pasting. I just tried again, but I haven't been able to reproduce this. Yesterday I succeeded in this, but only once.

When looking in the source code I found this comment below: I'm quite sure that I was pasting into Inkscape, but the crash occurred in code that handles pasting outside Inkscape. That's weird!

/**
 * @brief Callback called when some other application requests data from Inkscape
 *
 * Finds a suitable output extension to save the internal clipboard document,
 * then saves it to memory and sets the clipboard contents.
 */
void ClipboardManagerImpl::_onGet(Gtk::SelectionData &sel, guint /*info*/)
{
    g_assert( _clipboardSPDoc != NULL );

Revision history for this message
su_v (suv-lp) wrote :

@thanks Diederik - finally a clue to what is happening in (possibly related but not-crashing) these bugs:
Bug #347987 in Inkscape: “Strange random error message”
Bug #381540 in Inkscape: “Paste randomly invokes PDF import”
Bug #418242 in Inkscape: “uniconvertor error message about font substitution problems”

and probably others...

Revision history for this message
su_v (suv-lp) wrote :

Maybe this tool is helpful to monitor the content type of the clipboard:
<http://sourceforge.net/projects/dragndrop/> by Jon A. Cruz.

He mentioned it recently on inkscape-user in a thread about a clipboard issue on OS X:
<http://thread.gmane.org/gmane.comp.graphics.inkscape.user/12631/focus=12636>

I could not get it to display the clipboard _content_ though (only 'dragndrop' content like swatch colors or some text/numbers from the controls toolbar.

Revision history for this message
Guillermo Espertino (Gez) (gespertino-gmail) wrote :

I'm a reporter of two of the bugs cited by ~suv. In my case those errors are pretty random and hard to reproduce. It depends on what is being copied, and I can't reproduce the bug always, sometimes it happens, sometimes doesn't.
It may sound weird, but it also looks like it depends on the fonts installed in the system, or the programs running.

It's annoying and frustrating, since there isn't a way to reliably reproduce the error. But the error can be so frequent in a session that it can make it impossible to complete the work.

Acording my personal oppinion and experience, I think this bug is important enough to be marked as critical, and a showstopper for 0.47
Of course there are other important bugs, but this turns working with inkscape into a nightmare.

Revision history for this message
Guillermo Espertino (Gez) (gespertino-gmail) wrote :

Bug #347987 in Inkscape: “Strange random error message”
Bug #418242 in Inkscape: “uniconvertor error message about font substitution problems”

I just found out that these errors appeared when I had a java program running (Free Rapid) . It took me some time to know it because I never thought that a so unrelated program could be triggering the error.
Anyway, the error is in inkscape, so there's something going on with the copy procedure, that in some way interferes with or is interfered by that Java program.
When I kill Java, inkscape goes back to the normal behavior, without errors during copying and paste.
My first guess was the clipboard monitoring function of that Java program, but the errors appear even after I de-activated that function.

Could you please check this? Is your system running some java software when you get this crash?
Is that copy routine found by Diederik related to my problems with that java program?

Revision history for this message
Guillermo Espertino (Gez) (gespertino-gmail) wrote :

I did some cleanup and unified the previous reports in a single one.
Bug #418242 and its duplicates are probably consequences of the same behavior reported in comment #3.

Changed in inkscape:
status: New → Incomplete
su_v (suv-lp)
tags: added: clipboard
Revision history for this message
su_v (suv-lp) wrote :

possibly duplicates of this report:
Bug #496793 in Inkscape: “ctrl c ctrl v of text in edit mode crashes inkscape”
Bug #549219 in inkscape (Ubuntu): “crashes on copy/past in text mode”

both report the same error message:

Windows XP: Inkscape 0.48pre1 r9509
**
ERROR:src/ui/clipboard.cpp:1171:void Inkscape::UI::ClipboardManagerImpl::_onGet(Gtk::SelectionData&, guint): assertion failed: (_clipboardSPDoc != NULL)

Ubuntu 9.10: inkscape 0.47~pre4-0ubuntu1
**
ERROR:ui/clipboard.cpp:1086:void Inkscape::UI::ClipboardManagerImpl::_onGet(Gtk::SelectionData&, guint): assertion failed: (_clipboardSPDoc != NULL)

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

Changing the status from incomplete to confirmed. We even know exactly where inkscape crashes and have stack traces.

Changed in inkscape:
status: Incomplete → Confirmed
Changed in inkscape (Ubuntu):
status: New → Confirmed
Changed in inkscape (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Alex Valavanis (valavanisalex) wrote :

I think this is a duplicate of bug #496793. Both have the same backtrace, both are caused by copy/paste in text boxes and both are unrelated to java clipboard monitoring.

Please feel free to revert the duplicate status if you believe I am mistaken.

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.