failure to load CDR file with large bitmap (libxml2 >= 2.9.0)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Fix Released
|
Medium
|
Patrick Storz | ||
0.92.x |
Fix Released
|
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) |
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) |
Changed in inkscape: | |
milestone: | none → 0.93 |
tags: | added: backport-proposed |
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).