failure to load CDR file with large bitmap (libxml2 >= 2.9.0)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Inkscape |
Medium
|
Patrick Storz | ||
| 0.92.x |
Medium
|
Patrick Storz |
Bug Description
With libxml2 >= 2.9.0 loading of a CDR files with large embedded bitmap images fails in inkscape trunk with a parser error, for example:
Entity: line 12: parser error : AttValue length too long
A sample CDR file can be downloaded from this page:
<http://
Direct download link:
<https:/
With rev >= 12575, this parser error triggers a crash (so far confirmed for CDR files, possibly affects other file formats too):
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_
0x000000010007731c in SPDocument::getRoot (this=0x0) at document.h:125
125 SPRoot *getRoot() { return root; }
(gdb) bt
#0 0x000000010007731c in SPDocument::getRoot (this=0x0) at document.h:125
#1 0x000000010059927b in Inkscape:
#2 0x000000010057c253 in Inkscape:
#3 0x0000000100576e14 in Inkscape:
#4 0x000000010010460f in sp_file_open (uri=@0x7fff5fb
#5 0x000000010018dbc6 in sp_recent_open (recent_
Confirmed with r12708 on OS X 10.7.5 (libxml2 2.9.1, libcdr git master @b279f96).
Based on tests with archived builds (on OS X 10.7.5):
- crash not reproduced with rev <= 12571,
- crash reproduced with rev >= 12576,
the regression (crash instead of notification about failure to load) was likely introduced in
Revision 12575: Fix adding viewBox to new documents.
<http://
Note: AFAICT this regression does only occur with libxml2 >= 2.9.0 installed, which introduced default limits for attribute lengths:
<https:/
The fix likely requires two steps:
1) add 'XML_PARSE_HUGE' (or whatever parser option is required) to support long attributes used for embedded bitmap images
2) add checks to prevent crash if parsed document is not valid (?) - fixed in rev 12733.
summary: |
- trunk: libml2 >= 2.9.0: crash on load of CDR file with large bitmap (rev - >= 12575) + trunk: crash on load of CDR file with large bitmap (rev >= 12575, + libxml2 >= 2.9.0) |
su_v (suv-lp) wrote : Re: trunk: crash on load of CDR file with large bitmap (rev >= 12575, libxml2 >= 2.9.0) | #1 |
su_v (suv-lp) wrote : | #2 |
su_v (suv-lp) wrote : | #3 |
su_v (suv-lp) wrote : | #4 |
> Revision 12733: add some nullptr checking, should fix crash (couldn't test)
> <http://
@Johan - crash fix confirmed with r12734 on OS X 10.7.5: inkscape no longer crashes it if fails to parse the input.
Remaining issue:
- add adequate XMl parser flags to allow long attribute values.
description: | updated |
Changed in inkscape: | |
importance: | Undecided → Medium |
status: | New → Triaged |
summary: |
- trunk: crash on load of CDR file with large bitmap (rev >= 12575, - libxml2 >= 2.9.0) + trunk: fails to load CDR file with large bitmap (libxml2 >= 2.9.0) |
tags: |
added: cdr removed: crash regression |
Changed in inkscape: | |
milestone: | 0.91 → none |
summary: |
- trunk: fails to load CDR file with large bitmap (libxml2 >= 2.9.0) + failure to load CDR file with large bitmap (libxml2 >= 2.9.0) |
Patrick Storz (ede123) wrote : | #5 |
Crashing issue seems to have been fixed already.
Fix for the underlying import failure due to long attribute length pushed in
http://
Please test the change thoroughly. If no regressions are found I think this would be a good candidate for backporting to 0.92.x.
Changed in inkscape: | |
status: | Triaged → Fix Committed |
assignee: | nobody → Eduard Braun (eduard-braun2) |
Changed in inkscape: | |
milestone: | none → 0.93 |
tags: | added: backport-proposed |
jazzynico (jazzynico) wrote : | #6 |
Fix confirmed on Xubuntu 16.04, lp:inkscape rev. 15657. The file now loads correctly, with no console message.
Patrick Storz (ede123) wrote : | #7 |
Committed to stable branch in
http://
tags: | removed: backport-proposed |
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
Attaching the output of cdr2xhtml (command line tool installed with libcdr which wraps the SVG output into an XHTML file): AFAIU it contains the same SVG output which is read in by Inkcape's internal CDR input (and which inkscape fails to load due to a parser error if using libxml2 2.9.x).