crash (Pattern to Objects, Clip > Release) with xml:space="preserve"

Bug #854617 reported by su_v
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Johan Engelen

Bug Description

Steps to reproduce:
1) download sample SVG file [1]
2) open in Inkscape
3) select rectangle (background) with checkerboard pattern
4) apply 'Object > Pattern > Pattern to objects'

-> no crash in 0.48.2 (but console warnings)
-> crash in current trunk (backtrace attached, note the difference between debug and optimized build)

Not reproduced when transferring the pattern with 'copy&paste style' into a new Inkscape document (sample SVG attached, with manually added viewBox definition and size of pattern-filled rect changed to "100%")

Tested on Mac OS X 10.5.8 (i386), with
- Inkscape 0.48.1, 0.48.2,
- Inkscape 0.48+devel r10325, 0.48+devel r10639

[1] Source of Latin-1 encoded file:
<http://apike.ca/prog_svg_clip.html>
<http://apike.ca/media/svg/exampleClip2.svg> (Encoding: ISO-8859-1)
(problem noticed while testing for bug #567014)

Alternatively, open the files in inkscape (cli only) from the web directly:
$ inkscape http://apike.ca/media/svg/exampleClip2.svg
$ inkscape http://imgh.us/pattern-to-object-3-viewBox-scaled-5.svg
or
$ inkscape https://bugs.launchpad.net/inkscape/+bug/854617/+attachment/2430497/+files/pattern-to-object-3-viewBox-scaled-5.svg

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

Crash reproduced on Windows XP, Inkscape trunk revisions 10614 and 10568.
Warning messages also noticed with 0.48.2.

But changing the encoding attribute with UTF-8 doesn't fix the issue. What makes you think it's related to encoding?

Changed in inkscape:
status: New → Confirmed
Revision history for this message
jazzynico (jazzynico) wrote :

Apparently, removing the xml:space="preserve" attribute in the svg element fixes the document.

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

> What makes you think it's related to encoding?

Desperation? ;) I tried so many different subtle changes to both files (downloaded, and recreated in Inkscape), and could not reduce it to one local change to consistently let inkscape crash (or reproduce it with a newly created file).

At one point, the encoding seemed the only difference left… but when I wanted to verify it again before filing the report, suddenly it didn't make a difference any more. I left it in the summary anyway (who knows - maybe it does matter when parsing/solving the URI reference to the pattern?).

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

Adding the line
   xml:space="preserve"
to the top-level <svg> node in the file 'pattern-to-object-3-viewBox-scaled-5.svg' does not allow to reproduce the crash for me (pattern converts to objects (2 rects), with the known warnings on the console, but no crash).

Revision history for this message
jazzynico (jazzynico) wrote :

I guess the crash can be triggered by the combination of xml:space="preserve" and white spaces badly placed in the document (probably in the pattern's definition).

Revision history for this message
jazzynico (jazzynico) wrote :

Got it! Removing all the white spaces in the pattern element value fixes the crash.
Minimal test files attached.

Revision history for this message
jazzynico (jazzynico) wrote :
Revision history for this message
jazzynico (jazzynico) wrote :
summary: - crash (Pattern to Objects) in ISO-Latin-1 encoded file
+ crash (Pattern to Objects) with xml:space="preserve"
Revision history for this message
jazzynico (jazzynico) wrote : Re: crash (Pattern to Objects) with xml:space="preserve"

Still crashing on Windows XP, Inkscape trunk 11655.

Setting importance to medium (crash under very obscure or unlikely circumstances).

Changed in inkscape:
importance: Undecided → Medium
status: Confirmed → Triaged
Revision history for this message
su_v (suv-lp) wrote : Re: [Bug 854617] crash (Pattern to Objects) with xml:space="preserve"

Based on the same original file, current trunk (r11891) also crashes
when releasing a clip if the attribute 'xml:space="preserve"' is present
for the top-level <svg> node.

su_v (suv-lp)
tags: added: clipping
summary: - crash (Pattern to Objects) with xml:space="preserve"
+ crash (Pattern to Objects, Clip > Release) with xml:space="preserve"
su_v (suv-lp)
Changed in inkscape:
milestone: none → 0.49
Revision history for this message
Johan Engelen (johanengelen) wrote :

should be fixed in r12742

Revision history for this message
jazzynico (jazzynico) wrote :

Fix confirmed on Windows XP, trunk revision 12742.

Changed in inkscape:
milestone: 0.49 → none
status: Triaged → Fix Released
Changed in inkscape:
assignee: nobody → Johan Engelen (johanengelen)
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.