ctrl c ctrl v of text in edit mode crashes inkscape

Bug #496793 reported by Giuseppe Cirillo
86
This bug affects 11 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Chris Bainbridge
Nominated for 0.47.x by MOW
inkscape (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Hi All.

This bug crashes inkscape if I try to copy and paste text while the text is still in an edit box.

I'm running Inkscape 0.47 in Windows 7.

Steps:
Open inkscape
Create some text eg(Word 1)
select the text as an object, and copy & paste it using ctrl C, ctrl V.
Open the text using the text editor.
Change the text to something else eg(Word 2)
While the text edit box is open, use ctrl c, ctrl v to copy the text.
At this point inkscape crashes.

It is not a major issue, but extremely painful, when the changes are not automatically saved!
I will try get a backtrace of the error and submit it.

Thanks for any help on this

Related branches

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

not reproduced with Inkscape 0.47 on OS X 10.5.8

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

Not reproduced on Windows XP, Inkscape 0.47.

Changed in inkscape:
importance: Undecided → High
Revision history for this message
Alvin Penner (apenner) wrote :

@Giuseppe, could you attach the original .svg file, since there are possibly different formats that the text may be in, depending on how it is created.
Also, it may be worthwhile to try to trap any exit messages that are generated, using the method outlined in :
http://kaioa.com/node/63
This will involve running a small program called Inkscapec.exe from a DOS prompt, in the same directory where Inkscape is.

Revision history for this message
Giuseppe Cirillo (joshlcirillo) wrote : Re: [Bug 496793] Re: ctrl c ctrl v of text in edit mode crashes inkscape

I am away till the weekend, but will try run it through this Sat.

Thanks very much for your help.

On Tue, Dec 15, 2009 at 9:15 PM, Alvin Penner <email address hidden> wrote:

> @Giuseppe, could you attach the original .svg file, since there are
> possibly different formats that the text may be in, depending on how it is
> created.
> Also, it may be worthwhile to try to trap any exit messages that are
> generated, using the method outlined in :
> http://kaioa.com/node/63
> This will involve running a small program called Inkscapec.exe from a DOS
> prompt, in the same directory where Inkscape is.
>
> --
> ctrl c ctrl v of text in edit mode crashes inkscape
> https://bugs.launchpad.net/bugs/496793
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Inkscape: A Vector Drawing Tool: New
>
> Bug description:
> Hi All.
>
> This bug crashes inkscape if I try to copy and paste text while the text is
> still in an edit box.
>
> I'm running Inkscape 0.47 in Windows 7.
>
> Steps:
> Open inkscape
> Create some text eg(Word 1)
> select the text as an object, and copy & paste it using ctrl C, ctrl V.
> Open the text using the text editor.
> Change the text to something else eg(Word 2)
> While the text edit box is open, use ctrl c, ctrl v to copy the text.
> At this point inkscape crashes.
>
> It is not a major issue, but extremely painful, when the changes are not
> automatically saved!
> I will try get a backtrace of the error and submit it.
>
> Thanks for any help on this
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/inkscape/+bug/496793/+subscribe
>

--

Jonathan Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html>
- "May you live every day of your life."

Revision history for this message
MOW (wolter) wrote :

I can reproduce this on the current 0.47-3 release, downloaded just today, running on Windows XP SP3:

A text object, when selected in Selection mode, copys and pastes just fine.
However when I change to text edit mode by double-clicking the text object, and THEN try copy/paste, Inkscape crashes on paste.

Additionally, it throws a second dialog box after the crash notice saying it failed to do an emergency save. This just cost me about 1hr of work.
Thus I think this should be marked critical and release-blocker.

MfG MOW

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

cannot reproduce this on Windows XP, Inkscape bzr 9192. Could you provide a sample .svg file that crashes, plus steps to reproduce?

Revision history for this message
OC (olivier-c) wrote :

Cannot reproduce on Ubuntu 10.04, Inkscape 0.47 stable or 0.47+9590+1+1004 snapshot build.

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

confirmed on Windows XP, Inkscape 0.48pre1 r9509 (Jun 21 2010)

this is a bit tricky to reproduce, but is consistent with comment 5 above.
- load the attached file
- with the Select tool active, copy and paste the text successfully
- double-click on original text to switch to text edit mode
- now use ctrl-C and ctrl-V again
- crash with the message:

D:\Program Files\Inkscape>inkscape
**
ERROR:src/ui/clipboard.cpp:1171:void Inkscape::UI::ClipboardManagerImpl::_onGet(
Gtk::SelectionData&, guint): assertion failed: (_clipboardSPDoc != NULL)

Emergency save activated!

Emergency save document locations:
  C:\WINDOWS\Temp\496793.svg.2010_07_10_18_23_23.0.svg
Emergency save completed. Inkscape will close now.

Changed in inkscape:
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

same error message from comment #8 in

Bug #421597 in Inkscape: “Crash on paste in text box”
Bug #549219 in inkscape (Ubuntu): “crashes on copy/past in text mode”

duplicate of bug #421597?

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

I had previously been running java (Netbeans) before the crash. So just as a double-check, I did a full restart of the machine and confirmed that the crash is still present without java present.

Revision history for this message
OC (olivier-c) wrote :

Reproduced once in 0.47 on Ubuntu 10.04

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

with successful emergency save.
But the bug seems to appear randomly, I just cannot reproduce predictably.

Revision history for this message
MOW (wolter) wrote :

So the emergency save is now successful? At least that's a big improvement.

JFTR, I didn't have any clipboard monitoring software running, there were only Inkscape, Firefox and a few explorer windows open, at some point iirc also Scribus, and the only 3rd party software in systray are AntiVir and DTemp.
Java was not explicitly running either.
I do not think this bug should be considered a duplicate, the assert is probably reached another way.

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

Bug #421597 is _not _ known or confirmed to be triggered by clipboard managers or java (else it would have been marked as duplicate of bug #418242).

Revision history for this message
Cameron McCormack (cam-mcc) wrote :

Just another data point: I get this crash running 0.47 on Windows 7, and pjrm does too with revision 9449 on GNU/Linux.

Revision history for this message
Jeff Leonard (jsleonard) wrote :

Reproduced with .47 on Windows XP.
Only happens in text edit mode.
Happens in any size document.
Emergency save works on small files (A4), but fails on very large files (I tried with a 4'x10' banner and it failed).

Revision history for this message
Alisher Niyazov (zman69) wrote :

confirmed on 0.47 under Windows7

extra info: emergency save worked fine, .svg file shows two text objects created before crash

error output:
----------------

C:\Program Files\Inkscape>inkscapec.exe

(inkscape.exe:3080): Gtk-WARNING **: Could not find the icon 'object-visible'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
        http://icon-theme.freedesktop.org/releases
**
ERROR:src/ui/clipboard.cpp:1086:void Inkscape::UI::ClipboardManagerImpl::_onGet(Gtk::SelectionData&, guint): assertion failed: (_clipboardSPDoc != NULL)

Emergency save activated!

Emergency save document locations:
  C:\Users\Zman\New document 1.2010_08_16_10_17_59.0.svg
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at www.inkscape.org
with a detailed description of the steps leading to the crash, so we can fix it.
--------

Revision history for this message
Dennis Dillert (dennis-dillert) wrote :

Same here on Ubuntu 10.10 and Inkscape 0.48.

Revision history for this message
Dennis Dillert (dennis-dillert) wrote :

I noted that it only happens when I have JDownloader running. JDownloader is JAVA based and takes some control of your keys. It has a CTRL+C sniffing feature that lets you easily copy and paste links from websites into the application.

When I restart my machine and do not use it, everything seems to be working fine and I was not able to reproduce the bug.

Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Confirmed on Ubuntu Natty with inkscape_0.48.0-1ubuntu2. Backtrace attached.

I'm fairly certain that this is a duplicate of bug #421597... they have identical backtraces, and are both triggered by pasting in a text box. There is more information here about how to reproduce the bug, so I'll mark bug #421597 as a duplicate of this one.

Please feel free to revert if I'm wrong about the duplicate status.

Changed in inkscape (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in inkscape:
status: Confirmed → Triaged
Revision history for this message
Andrzej (ndrwrdck) wrote :

Encountered in 0.49-devel r10505.

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

Revision history for this message
Weon Design (w3ondesign) wrote :

Encountered in Inkscape
Version: 0.48.2 r9819
System: WinXP

Easy way to reproduce:
1. Add a text object (F8) put a string into it e.g. "a"
2. Switch to Object Selection Mode (F1)
3. Copy (CTRL-C) that newly created text object
4. Switch to Text Edit Mode (F8)
5. Copy (CTRL-C) & Paste (CTRL-V)

These steps lead to that Runtime Error in 100% trys on the given system. Note, those steps above are not what i want to achive, just an simplified way to reproduce that error.

tags: added: testcase
Revision history for this message
Chris Bainbridge (chris-bainbridge) wrote :

The problem is that when text is copied the clipboard is cleared, but clipboard->set_text is not called to replace it if the selected text is empty. This results in the clipboard being NULL.

in ClipboardManagerImpl::copy

tools_isactive(desktop, TOOLS_TEXT) // is TRUE
_discardInternalClipboard(); // _clipboardSPDoc = NULL
_clipboard->set_text(selected_text); // only called when selected_text != ""
_onGet // assert _clipboardSPDoc != NULL fail

Fix attached.

tags: added: patch
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "inkscape-clipboard-fix.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

Revision history for this message
yossi (farjoun) wrote :

Confirmed inscape 0.48 on OSX 10.7

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

On 21/11/2011 23:28, Chris Bainbridge wrote:
> The problem is that when text is copied the clipboard is cleared, but
> clipboard->set_text is not called to replace it if the selected text is
> empty. This results in the clipboard being NULL.

This finally gave me the clue how to reproduce it on OS X: the crash does not occur if 'Ctrl+C' in the text tool context actually copies a highlighted portion of the text content, it is only triggered if nothing is copied to the clipboard because nothing is selected (I never had tried that, apparently because 'Ctrl+C' with nothing selected didn't make sense to me).

Patch tested and fix confirmed with
Inkscape 0.48+devel r10873 on OS X 10.7.2 Lion

@JazzyNico - would you mind testing the patch on Windows?

jazzynico (jazzynico)
Changed in inkscape:
status: Triaged → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

Fix confirmed with the patch on Windows XP and Ubuntu 11.04, Inkscape trunk revision 10873.
No regression noticed. Proposing to commit in the trunk and branch.

Changed in inkscape:
assignee: nobody → Chris Bainbridge (chris-bainbridge)
milestone: none → 0.48.3
Revision history for this message
su_v (suv-lp) wrote :

JazzyNico wrote:
> Fix confirmed (…) on Windows XP and Ubuntu 11.04 (…) No regression noticed.

Patch also tested and fix confirmed (no regressions noticed in quick test) with
Inkscape 0.48+devel r10875, Gtk+/Quartz 2.24.8 on Mac OS X 10.5.8 Leopard (32bit).

> Proposing to commit in the trunk and branch.

Agreed.

@Chris - many thanks for investigating and sharing the patch!

Revision history for this message
jazzynico (jazzynico) wrote :

Patch committed in the trunk (revision 10876) and the branch (revision 9853).
Thanks, Chris!

Changed in inkscape:
status: In Progress → Fix Committed
Ted Gould (ted)
Changed in inkscape:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package inkscape - 0.48.3-0ubuntu1

---------------
inkscape (0.48.3-0ubuntu1) precise; urgency=low

  * New upstream release (LP: #933188). Fixes several Ubuntu bugs:
    - inkscape fails to build with glib 2.31 (LP: #898538)
    - ctrl c ctrl v of text in edit mode crashes inkscape (LP: #496793)
    - Completely replace lcms1 by lcms2 in Ubuntu (LP: #885324)
    - parameters ending with '\' causes python to bomb (LP: #168417)
    - Extensions with <check> tags fail to load (LP: #668895)
    - ESC doesn't cancel move when using the Node Tool (LP: #788560)
    - unable to edit attributes in Inkscape XML Editor (LP: #884368)
    - Some layers should be visible by default in Layers dialog (LP: #902054)
    - Path Effect List is hidden (LP: #909958)
    - Input Devices > Hardware > Tree of devices is hidden (LP: #910467)
    - Glyphs Font styles are hidden (LP: #911079)
    - Error messages from Extensions hidden (LP: #911079)
    - Messages dialog doesn't work (LP: #911123)
  * Drop 02-add-shebangs-and-fix-permissions.dpatch: Applied upstream.
  * Drop build-dependency on specific libwpd/libwpg version.
 -- Alex Valavanis <email address hidden> Thu, 16 Feb 2012 14:33:40 +0000

Changed in inkscape (Ubuntu):
status: Triaged → Fix Released
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.