Bug 77268 - FILEOPEN: Loading of Inkscape and other Cairo based SVG is faulty on debug builds, general input/output error on Windows debug builds
Summary: FILEOPEN: Loading of Inkscape and other Cairo based SVG is faulty on debug bu...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
4.3.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: confirmed:4.4.0.0alpha2+:linuxDbg
Keywords:
Depends on:
Blocks: SVG-Open
  Show dependency treegraph
 
Reported: 2014-04-10 12:18 UTC by vvort
Modified: 2018-06-20 17:03 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Problematic SVG file (2.06 KB, image/svg)
2014-04-10 12:18 UTC, vvort
Details
Zip of two SVG text only, one saved as Inkscape normal and copy as Plain SVG (2.02 KB, application/zip)
2014-11-13 15:47 UTC, V Stuart Foote
Details
zip of three versions of Complex SVG (161.16 KB, application/zip)
2014-11-14 18:04 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vvort 2014-04-10 12:18:43 UTC
Created attachment 97164 [details]
Problematic SVG file

When I try to open SVG file in LibreOffice Draw, which is created with Inkscape, I am getting error:

General Error.
General input/output error.

OS: Windows 7 SP1 x64
Comment 1 Regina Henschel 2014-04-10 21:33:01 UTC
Please try to first open/new a Draw document, and then Insert > Image.

Your problem has likely the same reason as bug 32248. Opening your document in LibreOffice I do not get an error message, but the text in the svg graphic is missing.
Comment 2 vvort 2014-04-11 05:12:59 UTC
"Insert > Image" works, even text is shown correctly. But such object is not editable, which means that fileopen feature is still required.
---
Did you tried to open this file with Windows version of LO? I suppose this may be the key condition to get this error.
---
I can make Inkscape svg without a text - with simple rectangle for example - it will produce the same error. 
---
I have some guess about this error: if I remove Inkscape-specific data from SVG (like inkscape:label="Layer 1") - file starts to open without problems.
Comment 3 Jorendc 2014-05-18 10:39:52 UTC
Reproducible, tested using Windows 8.1 with LibreOffice Version: 4.3.0.0.alpha1+
Build ID: 48eccfb812284f43ba24c3be3903537ce954944d
TinderBox: Win-x86@39, Branch:master, Time: 2014-05-16_00:35:19

(In reply to comment #2)
> I have some guess about this error: if I remove Inkscape-specific data from
> SVG (like inkscape:label="Layer 1") - file starts to open without problems.

Mmh, nice research :-). So if I understand correctly, LibreOffice just outputs a general error because it can't handle that data?

Kind regards,
Joren
Comment 4 V Stuart Foote 2014-11-13 15:43:27 UTC
On Windows 7 sp1, 64-bit en-US
With current Debug TB39 builds of master we get the 

General input/output error

With release build the SVG opens blank
Version: 4.3.4.1
Build ID: bc356b2f991740509f321d70e4512a6a54c5f243

Version: 4.4.0.0.alpha2
Build ID: 24f0a5815f581dd9a7f09d30213a379edee6e9ac

-=-
Opened the attachment 97164 [details] -- hello.svg with
Inkscape 0.48.5 r10040 and save-as plain svg to remove Inkscape specifics.
No change, opens blank on TDF release builds, or throws General IO error opening with debug builds

-=-
Create two new SVGs in Inkscape, each with just two text objects a normal and a vertical text sample (attached). 

Saved once as Inkscape normal SVG then again as a Plain SVG. In LibreOffice both throw General input/output error when opened with debug build of master, and both open empty of lettering in a release build.

-=-
Also confirming on Linux with 32-bit debug build

Version: 4.4.0.0.alpha1+
Build ID: d59b9b4af36148e4d8df8f3e3492116d378642e2
TinderBox: Linux-rpm_deb-x86@45-TDF-dbg, Branch:master, Time: 2014-11-06_03:11:43

No crash or error, but with gdb running get these warnings on opening the SVG, they are blank with no text showing. The unknown factory seems like an issue.

[vsfoote@localhost program]$ ./soffice
warn:sfx.dialog:1742:1:sfx2/source/dialog/filtergrouping.cxx:361: already have an element for WordPerfect
warn:sfx.dialog:1742:1:sfx2/source/dialog/filtergrouping.cxx:361: already have an element for writerweb8_writer_template
warn:sfx.dialog:1742:1:sfx2/source/dialog/filtergrouping.cxx:361: already have an element for writerglobal8
warn:xmloff.core:1742:1:xmloff/source/core/xmlimp.cxx:760: SvXMLImport::endElement: popped context has wrong prefix
warn:xmloff.core:1742:1:xmloff/source/core/xmlimp.cxx:760: SvXMLImport::endElement: popped context has wrong prefix
warn:legacy.osl:1742:1:unotools/source/config/moduleoptions.cxx:585: unknown factory
warn:sfx.control:1742:1:sfx2/source/control/dispatch.cxx:1354: Childwindow slot missing: 10365
warn:sfx.control:1742:1:sfx2/source/control/dispatch.cxx:1354: Childwindow slot missing: 10365
warn:sfx.control:1742:1:sfx2/source/control/dispatch.cxx:1354: Childwindow slot missing: 10365
Comment 5 V Stuart Foote 2014-11-13 15:47:03 UTC
Created attachment 109427 [details]
Zip of two SVG text only, one saved as Inkscape normal and copy as Plain SVG
Comment 6 vvort 2014-11-14 04:58:55 UTC
Thanks!
Incorrect import of text is another problem.
And I think it is not related to General I/O error (which is the main problem of this report).
To test solely IO error, you can use geometric shapes instead of text in SVG - they are imported correctly.
Comment 7 V Stuart Foote 2014-11-14 18:04:37 UTC
Created attachment 109478 [details]
zip of three versions of Complex SVG

@vvort 
(In reply to vvort from comment #6)
> Thanks!
> Incorrect import of text is another problem.
> And I think it is not related to General I/O error (which is the main
> problem of this report).
> To test solely IO error, you can use geometric shapes instead of text in SVG
> - they are imported correctly.

Yes, I agree the issue is opening SVG with debug builds. Loss of text is just incidental and needs to be another bug. Adjusting the title.

Also, to make things interesting. The issue with the debug build filter import is affecting Inkscape's Cairo based 1.1 SVG. But not other non-Cairo SVG. Inkscape plain SVG is also Cairo based and it causes the error on the Debug builds. That kind of matches your finding with deletion of selected Inkscape format tagging. 

Attached is another example (the DIA render-test.dia sample) one in DIA's Cairo based SVG, the other in their native SVG. The Cairo SVG will throw the General input/output error, the non-Cairo SVG opens.

Also, opened the non-Cairo SVG in Inkscape and then saved as Plain SVG (Cairo based), it then causes the General IO error with the Debug builds.

All will open in a non-Debug build (Windows or Linux) of LibreOffice 4.3.x or master. And of course in other SVG renderers like FF.
Comment 8 V Stuart Foote 2014-11-15 00:55:33 UTC
The non-display of Text when an SVG is opened in Draw is bug 32248, suppressed text is likely not related to this issue.
Comment 9 vvort 2014-11-16 06:06:41 UTC
Fixed here:
https://gerrit.libreoffice.org/12472
Comment 10 Commit Notification 2014-11-17 09:23:38 UTC
Vort committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e353ecd3dbbe773f114908a3fd77d4ed460f00ed

fdo#77268 SVG Import: fix null pointer dereference

It will be available in 4.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Robinson Tryon (qubit) 2015-12-17 05:52:37 UTC
Migrating Whiteboard tags to Keywords: (filter:svgOpen)
[NinjaEdit]