SVG import segfault

Post here for help on using FreeCAD's graphical user interface (GUI).
jalar
Posts: 8
Joined: Wed Jan 10, 2018 1:07 pm

SVG import segfault

Postby jalar » Wed Jan 10, 2018 1:19 pm

Hi,
When I try to import an SVG, freecad immediately segfaults.

openat(AT_FDCWD, "/path-to-file.svg", O_RDONLY) = 27
fstat(27, {st_mode=S_IFREG|0644, st_size=2234752, ...}) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x3a9} ---
write(2, "\33[1;31m", 7) = 7
write(2, "Program received signal SIGSEGV,"..., 53Program received signal SIGSEGV, Segmentation fault.
) = 53

#0 /lib/x86_64-linux-gnu/libc.so.6(+0x37140) [0x7fd97f382140]
#1 /lib/x86_64-linux-gnu/libexpat.so.1(XML_SetHashSalt+0x1b) [0x7fd976c411cb]
#2 /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so(+0x6968) [0x7fd90487a968]
...

Nobody else seems to have this problem, am I missing some dependencies? (ubuntu 17.10, freecad-daily just updated, but same behavior on freecad 0.16)
User avatar
Willem
Posts: 1199
Joined: Fri Aug 12, 2016 3:27 pm
Location: Lisse, The Netherlands

Re: SVG import segfault

Postby Willem » Wed Jan 10, 2018 1:42 pm

Hi, welcome to the forum
Can you upload your SVG file. I do not know with what program it is made.
With a bad SVG file I try to open it in Inkscape and when that succeeds I save it as a normal SVG, very often this trick works
jalar
Posts: 8
Joined: Wed Jan 10, 2018 1:07 pm

Re: SVG import segfault

Postby jalar » Wed Jan 10, 2018 2:47 pm

Doesn't help. The -normal.svg is saved from inkscape.

Even if there is something wrong with the SVG, why the segfault?
Attachments
Svg_example4-normal.svg
(808 Bytes) Downloaded 17 times
Svg_example4.svg
(292 Bytes) Downloaded 14 times
User avatar
Willem
Posts: 1199
Joined: Fri Aug 12, 2016 3:27 pm
Location: Lisse, The Netherlands

Re: SVG import segfault

Postby Willem » Wed Jan 10, 2018 3:49 pm

Hi, the SVG file has no problems on my system.

OS: Ubuntu 16.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12920 (Git)
Build type: None
Branch: master
Hash: 8faa9f38bb70a598afc2bc39ea1645d416ab057e
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: Dutch/Netherlands (nl_NL)




phpBB [video]
User avatar
Kunda1
Posts: 3829
Joined: Thu Jan 05, 2017 9:03 pm

Re: SVG import segfault

Postby Kunda1 » Wed Jan 10, 2018 4:28 pm

jalar wrote:
Wed Jan 10, 2018 1:19 pm
Nobody else seems to have this problem, am I missing some dependencies? (ubuntu 17.10, freecad-daily just updated, but same behavior on freecad 0.16)
This is why we ask to actually paste the contents of Help > About FreeCAD > copy to clipboard
to ascertain this point exactly. Per the forum guidelines.
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Chris_G
Posts: 953
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: SVG import segfault

Postby Chris_G » Wed Jan 10, 2018 4:41 pm

jalar wrote:
Wed Jan 10, 2018 1:19 pm
#0 /lib/x86_64-linux-gnu/libc.so.6(+0x37140) [0x7fd97f382140]
#1 /lib/x86_64-linux-gnu/libexpat.so.1(XML_SetHashSalt+0x1b) [0x7fd976c411cb]
#2 /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so(+0x6968) [0x7fd90487a968]
Maybe a libexpat problem ? :
https://forum.freecadweb.org/viewtopic. ... 68#p190355
jalar
Posts: 8
Joined: Wed Jan 10, 2018 1:07 pm

Re: SVG import segfault

Postby jalar » Wed Jan 10, 2018 5:35 pm

I did read the guidlines, but somehow missed that, sorry.

OS: Ubuntu 17.10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12920 (Git)
Build type: None
Branch: master
Hash: 8faa9f38bb70a598afc2bc39ea1645d416ab057e
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: Swedish/Sweden (sv_SE)

But in this case, does this really help?
jalar
Posts: 8
Joined: Wed Jan 10, 2018 1:07 pm

Re: SVG import segfault

Postby jalar » Thu Jan 11, 2018 9:39 am

libexpat is the problem.

On Ubuntu 17.10 artful, the libexpat package version is 2.2.3-1 (https://packages.ubuntu.com/artful/libexpat1). Crash on SVG import.

Manually installing libexpat-2.1.0-7ubuntu0.16.04.3 fixes the problem. No crash.
jalar
Posts: 8
Joined: Wed Jan 10, 2018 1:07 pm

Re: SVG import segfault

Postby jalar » Thu Jan 11, 2018 9:55 am

Steps to reproduce:

1) Command-line start `freecad Svg_example4.svg`
2) Segfault
jalar
Posts: 8
Joined: Wed Jan 10, 2018 1:07 pm

Re: SVG import segfault

Postby jalar » Thu Jan 11, 2018 10:00 am