--export-latex crashes with a svg file

Bug #1464987 reported by Hiroshi Takekawa on 2015-06-14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Hiroshi Takekawa
Hiroshi Takekawa

Bug Description

I created time.svg with inkscape 0.48.x.
And I succeeded to convert to pdf and latex file with inkscape 0.48.x:
inkscape -D -z --file=time.svg --export-pdf=time.pdf --export-latex
But I failed with inkscape 0.91.
Please find time.svg attached.

Possible work-around patch is below (I'm not sure this is a correct patch, but it works):

--- src/libnrtype/Layout-TNG.h 2015-05-08 15:19:23 +0000
+++ src/libnrtype/Layout-TNG.h 2015-06-14 10:10:44 +0000
@@ -190,7 +190,7 @@
     /** For expressing paragraph alignment. These values are rotated in the
     case of vertical text, but are not dependent on whether the paragraph is
     rtl or ltr, thus LEFT is always either left or top. */
- enum Alignment {LEFT, CENTER, RIGHT, FULL};
+ enum Alignment {LEFT, CENTER, RIGHT, FULL, NONE};

     /** The CSS spec allows line-height:normal to be whatever the user agent
     thinks will look good. This is our value, as a multiple of font-size. */
@@ -1068,7 +1068,7 @@
     {return it._char_index == _characters.size() ? _paragraphs.size() - 1 : _characters[it._char_index].line(this).in_paragraph;}

 inline Layout::Alignment Layout::paragraphAlignment(iterator const &it) const
- {return _paragraphs[paragraphIndex(it)].alignment;}
+ {return (_paragraphs.size() == 0) ? NONE : _paragraphs[paragraphIndex(it)].alignment;}

 inline bool Layout::iterator::nextGlyph()

Hiroshi Takekawa (sian-ht) wrote :
su_v (suv-lp) on 2015-06-14
tags: added: cli exporting
su_v (suv-lp) on 2015-06-14
tags: removed: cli
su_v (suv-lp) wrote :

Reproduced with Inkscape 0.91 r13725 and 0.91+devel r14201 on OS X 10.7.5 - happens on the command line as well as when exporting via GUI (with latex-export enabled).

Attached is the reduced test case with the 'Flowed text' object which triggers the crash: AFAICT it is the last of the four empty flowed text elements in the original document, which - compared to the other three - lacks an empty <flowPara /> element.

The crash does not occur after manually adding the <flowPara /> element.

su_v (suv-lp) wrote :

Regression in >= 0.91 confirmed - export with 0.48.5 works without crash.

Changed in inkscape:
importance: Undecided → High
milestone: none → 0.92
status: New → Confirmed
tags: added: regression
su_v (suv-lp) wrote :

Backtrace of Inkscape 0.91+devel r14198 (cli export, OS X 10.7.5)

su_v (suv-lp) wrote :

Attaching proposed fix as diff file (to ease testing) - AFAICT it applies ok to 0.91.x (with offsets) and trunk (r14202).

su_v (suv-lp) wrote :

Based on tests with archived trunk builds:
- not reproduced with rev <= 10145,
- reproduced with rev >= 10166;
(no archived builds in-between available) this regression possibly is related to the changes in rev 10154-10156 for pdf+latex export:

jazzynico (jazzynico) wrote :

Patch tested successfully on Windows XP (32-bit), lp:inkscape/0.92.x rev. 15393.

Changed in inkscape:
milestone: 0.92 → 0.93
status: Confirmed → In Progress
jazzynico (jazzynico) wrote :

Updated patch for lp:inkscape/0.92.x.

jazzynico (jazzynico) wrote :

Fixed in lp:inkscape rev. 15544.
The patch works and looks obvious, but I'm not expert on that part of the code, so it would be nice if someone else could confirm there's no risk of regression before we backport to the 0.92.x branch.

@Hiroshi - Thanks for the patch! I'm assigning the report to you so that you are granted the fix in the logs.

Changed in inkscape:
assignee: nobody → Hiroshi Takekawa (sian-ht)
status: In Progress → Fix Committed
Hiroshi Takekawa (sian-ht) wrote :

I built rev. 15544 and confirmed the bug fixed.
Thank you for giving me some credit.

The patch was made as work-around, so I think it shouldn't make things worse.
(At least you get some output instead of crash...)

Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers