SVG import segfault

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: SVG import segfault

Post by Kunda1 »

is this an upstream expat issue?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
jalar
Posts: 8
Joined: Wed Jan 10, 2018 1:07 pm

Re: SVG import segfault

Post by jalar »

Cannot say, I only know what I told in the bug report.

I do not even know the cause of the segfault, only that an earlier version of the library works.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: SVG import segfault

Post by wmayer »

It's a dependency problem that two packages (Coin3d and Python) use different versions of the libexpat library. The Path/CAM guys encountered this issue a couple of months ago. For more details see:
https://forum.freecadweb.org/viewtopic.php?f=10&t=24268
https://forum.freecadweb.org/viewtopic.php?f=15&t=23380

The reason is that Coin3d has its own private expat version that is binary incompatible to the system-wide version and that's why it causes the crash.
As a workaround you should keep your libexpat package downgraded until it's fixed by the package maintainer of Coin3d who preferably fixes the switch to link against the system-wide expat version.

So, the bug you reported can be closed again as not fixable because from FreeCAD point of view there is nothing we can do.
jalar
Posts: 8
Joined: Wed Jan 10, 2018 1:07 pm

Re: SVG import segfault

Post by jalar »

OK, thanks for the info!
edub
Posts: 10
Joined: Wed Apr 08, 2015 3:10 pm
Location: Bozen

Re: SVG import segfault

Post by edub »

I am running into this problem now as I would like to import an SVG file as geometry and extrude it.

Perhaps a stupid question: how do I go about downgrading libexpat in Ubuntu and to which version?

Thanks in advance!
User avatar
Chris_G
Veteran
Posts: 2579
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: SVG import segfault

Post by Chris_G »

The packages from Ubuntu xenial work fine :
https://packages.ubuntu.com/xenial/expat
https://packages.ubuntu.com/xenial/libexpat1
I have also this one, but I don't know if it is really needed :
https://packages.ubuntu.com/xenial/libexpat1-dev

Then in the folder where you downloaded the packages :

Code: Select all

sudo dpkg -i ./expat_2.1.0-7ubuntu0.16.04.3_amd64.deb
sudo echo expat hold | sudo dpkg --set-selections
sudo dpkg -i ./libexpat1_2.1.0-7ubuntu0.16.04.3_amd64.deb
sudo echo libexpat1 hold | sudo dpkg --set-selections
sudo dpkg -i ./libexpat1-dev_2.1.0-7ubuntu0.16.04.3_amd64.deb
sudo echo libexpat1-dev hold | sudo dpkg --set-selections
edub
Posts: 10
Joined: Wed Apr 08, 2015 3:10 pm
Location: Bozen

Re: SVG import segfault

Post by edub »

Worked! Thanks!
jgbarah
Posts: 1
Joined: Thu Apr 26, 2018 5:13 pm

Re: SVG import segfault

Post by jgbarah »

I'm experiencing the same behavior with appimage binaries in Debian Testing, both with FreeCAD_0.17.13509.glibc2.17-x86_64.AppImage and with FreeCAD_0.18.13516.glibc2.17-x86_64.AppImage.

I find this weird, since they are supposed to be static, aren't they?

The message I get is pretty much the same, the error too (SEGFAULT when trying to load any svg file produced by Inkscape). Curiously enough, if I import the same file as Drawing, I can see it with no error (but same failure if I import it as "SVG as geometry").

I get the error as follows:

Code: Select all

$ ./FreeCAD_0.18.13516.glibc2.17-x86_64.AppImage /tmp/drawing.svg 
FreeCAD 0.18, Libs: 0.18R13516 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2018
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

not a freecad file: .SVG
not a freecad file: .DXF
not a freecad file: .SVG
not a freecad file: .SVG

** (freecad-daily:28319): WARNING **: 18:56:48.837: invalid source position for vertical gradient

** (freecad-daily:28319): WARNING **: 18:56:48.837: invalid source position for vertical gradient
Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x34f00) [0x7f4ee9e33f00]
#1  /lib/x86_64-linux-gnu/libexpat.so.1(XML_SetHashSalt+0x1b) [0x7f4edf8fdfbb]
#2  /tmp/.mount_freecammFrx0/usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so(+0x3e32) [0x7f4e8484be32]
#3  /tmp/.mount_freecammFrx0/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x4d4e) [0x7f4eeba4e24e]
joel
Posts: 195
Joined: Thu Jan 26, 2017 8:17 pm
Location: Thonon les Bains

Re: SVG import segfault

Post by joel »

Chris_G wrote: Thu Apr 19, 2018 8:45 am The packages from Ubuntu xenial work fine :
https://packages.ubuntu.com/xenial/expat
https://packages.ubuntu.com/xenial/libexpat1
I have also this one, but I don't know if it is really needed :
https://packages.ubuntu.com/xenial/libexpat1-dev
it's work, many thanks
amunizp
Posts: 5
Joined: Wed Sep 20, 2017 9:27 am

Re: SVG import segfault

Post by amunizp »

Chris_G wrote: Thu Apr 19, 2018 8:45 am The packages from Ubuntu xenial work fine :
https://packages.ubuntu.com/xenial/expat
https://packages.ubuntu.com/xenial/libexpat1
I have also this one, but I don't know if it is really needed :
https://packages.ubuntu.com/xenial/libexpat1-dev

Then in the folder where you downloaded the packages :

Code: Select all

sudo dpkg -i ./expat_2.1.0-7ubuntu0.16.04.3_amd64.deb
sudo echo expat hold | sudo dpkg --set-selections
sudo dpkg -i ./libexpat1_2.1.0-7ubuntu0.16.04.3_amd64.deb
sudo echo libexpat1 hold | sudo dpkg --set-selections
sudo dpkg -i ./libexpat1-dev_2.1.0-7ubuntu0.16.04.3_amd64.deb
sudo echo libexpat1-dev hold | sudo dpkg --set-selections
Thank you
This worked for me even with the errors by libexpat:

Code: Select all

amunizp@amunizp-U33Jc:~/Downloads$ sudo dpkg -i ./e
eggbot2.8.0_manual/                     expat_2.1.0-7ubuntu0.16.04.3_amd64.deb  
amunizp@amunizp-U33Jc:~/Downloads$ sudo dpkg -i ./expat_2.1.0-7ubuntu0.16.04.3_amd64.deb 
Selecting previously unselected package expat.
(Reading database ... 555662 files and directories currently installed.)
Preparing to unpack .../expat_2.1.0-7ubuntu0.16.04.3_amd64.deb ...
Unpacking expat (2.1.0-7ubuntu0.16.04.3) ...
Setting up expat (2.1.0-7ubuntu0.16.04.3) ...
Processing triggers for man-db (2.8.3-2) ...
amunizp@amunizp-U33Jc:~/Downloads$ sudo echo expat hold | sudo dpkg --set-selections
amunizp@amunizp-U33Jc:~/Downloads$ sudo dpkg -i ./libexpat1
libexpat1_2.1.0-7ubuntu0.16.04.3_amd64.deb      libexpat1-dev_2.1.0-7ubuntu0.16.04.3_amd64.deb
amunizp@amunizp-U33Jc:~/Downloads$ sudo dpkg -i ./libexpat1_2.1.0-7ubuntu0.16.04.3_amd64.deb 
dpkg: warning: downgrading libexpat1:amd64 from 2.2.5-3 to 2.1.0-7ubuntu0.16.04.3
(Reading database ... 555667 files and directories currently installed.)
Preparing to unpack .../libexpat1_2.1.0-7ubuntu0.16.04.3_amd64.deb ...
De-configuring libexpat1:i386 (2.2.5-3) ...
Unpacking libexpat1:amd64 (2.1.0-7ubuntu0.16.04.3) over (2.2.5-3) ...
dpkg: error processing package libexpat1:amd64 (--install):
 package libexpat1:amd64 2.1.0-7ubuntu0.16.04.3 cannot be configured because libexpat1:i386 is at a different version (2.2.5-3)
dpkg: error processing package libexpat1:i386 (--install):
 package libexpat1:i386 2.2.5-3 cannot be configured because libexpat1:amd64 is at a different version (2.1.0-7ubuntu0.16.04.3)
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Errors were encountered while processing:
 libexpat1:amd64
 libexpat1:i386
amunizp@amunizp-U33Jc:~/Downloads$ sudo echo libexpat1 hold | sudo dpkg --set-selections
amunizp@amunizp-U33Jc:~/Downloads$ sudo dpkg -i ./libexpat1
libexpat1_2.1.0-7ubuntu0.16.04.3_amd64.deb      libexpat1-dev_2.1.0-7ubuntu0.16.04.3_amd64.deb
amunizp@amunizp-U33Jc:~/Downloads$ sudo dpkg -i ./libexpat1-dev_2.1.0-7ubuntu0.16.04.3_amd64.deb 
dpkg: warning: downgrading libexpat1-dev:amd64 from 2.2.5-3 to 2.1.0-7ubuntu0.16.04.3
(Reading database ... 555667 files and directories currently installed.)
Preparing to unpack .../libexpat1-dev_2.1.0-7ubuntu0.16.04.3_amd64.deb ...
Unpacking libexpat1-dev:amd64 (2.1.0-7ubuntu0.16.04.3) over (2.2.5-3) ...
dpkg: dependency problems prevent configuration of libexpat1-dev:amd64:
 libexpat1-dev:amd64 depends on libexpat1 (= 2.1.0-7ubuntu0.16.04.3); however:
  Package libexpat1:amd64 is not configured yet.

dpkg: error processing package libexpat1-dev:amd64 (--install):
 dependency problems - leaving unconfigured
Processing triggers for doc-base (0.10.8) ...
Processing 1 changed doc-base file...
Registering documents with scrollkeeper...
Errors were encountered while processing:
 libexpat1-dev:amd64
amunizp@amunizp-U33Jc:~/Downloads$ sudo echo libexpat1-dev hold | sudo dpkg --set-selections
amunizp@amunizp-U33Jc:~/Downloads$ freecad
FreeCAD 0.17, Libs: 0.17R13541 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2018
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

not a freecad file: .BMP
not a freecad file: .JPG
not a freecad file: .JPG
not a freecad file: .STL
processing element 1: svg
existing group transform: []
name: svg1457
done processing element 1
processing element 2: defs
existing group transform: [Matrix ((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1))]
name: defs1451

(...)

Post Reply