[Solved] SVG as geometry import crashed Freecad

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!
ouinouin
Posts: 18
Joined: Mon Oct 26, 2015 9:41 am

[Solved] SVG as geometry import crashed Freecad

Postby ouinouin » Fri Feb 16, 2018 2:29 pm

Hi,

I m actually try to import some svg as Geometry for my models, and importing SVG (svg as geometry) is always crashing freecad whatever the way to do it :
by opening directly the svg with freecad
or by selecting import in the file menu of freecad.

i tried with many svgs created with different softwares but couldnt open any of those. i tried also on freecad 0.16 and it is also crashing.
here is basicalle the SVG i d like to import :
https://upload.wikimedia.org/wikipedia/ ... h_grid.svg

crash with freecad 0.17 :
OS: Ubuntu 17.10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13247 (Git)
Build type: None
Branch: master
Hash: 5022c8df5cef0690f2c8acff4bcebd82655a5f04
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: French/France (fr_FR)

here is the result while launching frecad 0.17 from a console ( the "not a freecad file .DXF" comes also from nowhere anytime i open a freecad session but this is another subject) and the importing the svg file as geometry.

Code: Select all

FreeCAD 0.17, Libs: 0.17R13247 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2018
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Sheet Metal workbench loaded
not a freecad file: .DXF
Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x37140) [0x7fd2960a2140]
#1  /lib/x86_64-linux-gnu/libexpat.so.1(XML_SetHashSalt+0x1b) [0x7fd28d9621cb]
#2  /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so(+0x6968) [0x7fd210d15968]
#3  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x8b7b) [0x7fd297c8550b]
#4  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x8eaa) [0x7fd297c8583a]
#5  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x8eaa) [0x7fd297c8583a]
#6  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x8eaa) [0x7fd297c8583a]
#7  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8) [0x7fd297dadb88]
#8  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCode+0x19) [0x7fd297c7c7f9]
#9  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyRun_StringFlags+0x76) [0x7fd297d25e76]
#10  0x7fd2981f6966 in Base::InterpreterSingleton::runString[abi:cxx11](char const*) from /usr/lib/freecad-daily/lib/libFreeCADBase.so+0x66
#11  0x7fd298cf4a63 in Gui::Command::doCommand(Gui::Command::DoCmd_Type, char const*, ...) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x123
#12  0x7fd298c80938 in Gui::Application::importFrom(char const*, char const*, char const*) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x118
#13  0x7fd298cffeca in StdCmdImport::activated(int) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x60a
#14  0x7fd298cf901b in Gui::Command::invoke(int) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x7b
#15  0x7fd296b86f70 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x4d0
#16  0x7fd297098dc2 in QAction::triggered(bool) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x42
#17  0x7fd29709a113 in QAction::activate(QAction::ActionEvent) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x83
#18  /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x62236d) [0x7fd2974fc36d]
#19  /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x626759) [0x7fd297500759]
#20  0x7fd2970f5930 in QWidget::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x2a0
#21  0x7fd29750496b in QMenu::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x6b
#22  0x7fd29709f03c in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x8c
#23  0x7fd2970a6136 in QApplication::notify(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x476
#24  0x7fd298cd28f8 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x88
#25  0x7fd296b728ad in QCoreApplication::notifyInternal(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x8d
#26  0x7fd2970a573d in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x14d
#27  /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x249ddc) [0x7fd297123ddc]
#28  0x7fd297122ce3 in QApplication::x11ProcessEvent(_XEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x16b3
#29  /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x272592) [0x7fd29714c592]
#30  /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x2e7) [0x7fd28f772fb7]
#31  /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4b1f0) [0x7fd28f7731f0]
#32  /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c) [0x7fd28f77327c]
#33  0x7fd296ba320e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x7e
#34  /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x272666) [0x7fd29714c666]
#35  0x7fd296b7112f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x3f
#36  0x7fd296b71495 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x1b5
#37  0x7fd296b77459 in QCoreApplication::exec() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x99
#38  0x7fd298c8a5f0 in Gui::Application::runApplication() from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x13a0
#39  freecad-daily(main+0x6db) [0x557bc26574db]
#40  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1) [0x7fd29608c1c1]
#41  freecad-daily(_start+0x2a) [0x557bc265868a]

another try with freecad 0.16 :
OS: Ubuntu 17.10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6712 (Git)
Build type: None
Branch: releases/FreeCAD-0-16
Hash: da2d364457257a7a8c6fb2137cea12c45becd71a
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

gives us :

Code: Select all

FreeCAD 0.16, Libs: 0.16R6712 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2015
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Sheet Metal workbench loaded
*** Abort *** an exception was raised, but no catch was found.
	... The exception is:SIGSEGV 'segmentation violation' detected. Address 3d9

this bug coupled with buggy DXF is a showstopper to import some texts and other 2D elements on freecad.
Anybody else impacted by this bug ?


Regards.
Last edited by ouinouin on Fri Feb 16, 2018 3:31 pm, edited 1 time in total.
User avatar
sgrogan
Posts: 5798
Joined: Wed Oct 22, 2014 5:02 pm

Re: SVG as geometry import crashed Freecad

Postby sgrogan » Fri Feb 16, 2018 2:34 pm

ouinouin wrote:
Fri Feb 16, 2018 2:29 pm
this bug coupled with buggy DXF is a showstopper to import some texts and other 2D elements on freecad.
Anybody else impacted by this bug ?
For .svg see here: https://forum.freecadweb.org/viewtopic. ... 91#p208742
For .dxf maybe you can expand on the problems your having.
ouinouin
Posts: 18
Joined: Mon Oct 26, 2015 9:41 am

Re: SVG as geometry import crashed Freecad

Postby ouinouin » Fri Feb 16, 2018 2:57 pm

Arf,
I got this post edit since 8 days (searched the forum and didnt find any occurence of this issue) , didnt post due to a lack of bandwitdh where i m sitting :p and here I got a fellow 17.10 user :)

for the DXF, first I dont understand why freecad is telling me "not a DXF file at the beginning of my freecad session.
the other part of the problem is that i m unable to import DXF, at the best it gives me only few lines or garbage, but I have only inkscape export as a mean of testing, so it might be also on the inkscape side of the force Luke, I got to investigate.

Edit : downgrading libexpat solved the issue for me but take care, for myself I had to install the AMD64 AND the I386 package + also the libexpat1-dev package otherwise the next apt-get dist upgrade would mark distro as broken.

i manually downloaded https://packages.ubuntu.com/xenial-updates/libexpat1 : I386 and AMD64 versions
https://packages.ubuntu.com/xenial/libexpat1-dev

then

Code: Select all

sudo dpkg -i --force-all *.deb 
you also have to "pin " the packages for ubuntu not to pass on your back while doing upgrades :
put the following content in a file named : /etc/apt/preferences.d/libexpatfreecad

Code: Select all

Package: libexpat1
Pin: release n=artful
Pin-Priority: -10

Package: libexpat1:i386
Pin: release n=artful
Pin-Priority: -10

Package: libexpat1-dev
Pin: release n=artful
Pin-Priority: -10
remember to remove it when the issue wille be closed :-)
User avatar
witenite
Posts: 10
Joined: Sat Mar 31, 2018 9:54 pm
Location: New Zealand

Re: [Solved] SVG as geometry import crashed Freecad

Postby witenite » Fri Jan 04, 2019 10:33 pm

Hi,

just want to add my small contribution here. I am experiencing the same issue. If I try to open an SVG file (using FreeCAD 0.17 running on an Ubuntu 18.04 system) FreeCAD just crashes. This is a good system from a hardware perspective (4.1GHz Quad core I7, 16GB RAM etc.) so no issues there.

I have a drawing generated using OpenSCAD (standalone, not using the OpenSCAD tools found in FreeCAD). I have tried exporting as a DXF file, and then importing this into FreeCAD, which works just fine, however I find that OpenSCAD generates 1000's of line segments for all the arcs and circles (holes) in my sheet metal model. For CNC punching purposes, I need actual arcs/circles. I then wished to try using the option of importing SVG geometry, but I now have this crash. For the purpose of this discussion, the arc/circle issues I am experiencing are irrelevant, I simply want to point out the fact that I am experiencing the same issues with importing SVG files, using the latest version OS and FreeCAD software.
ubiquity
Posts: 35
Joined: Fri Nov 03, 2017 7:40 pm

Re: [Solved] SVG as geometry import crashed Freecad

Postby ubiquity » Mon Jan 27, 2020 10:24 am

I too am experiencing the crash issue with import of Inkscape 0.92.4 svg files, both drawing and geometry.
I have so far tried switching bounding box settings and saving both Inkscape svg and plain svg.
I get the drawing/geometry dialogue but FreeCAD just crashes thereafter.
OS: Linux 4.16.12-rt5-kona-rt
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14555 (Git shallow)
Build type: Release
Branch: (HEAD detached at 0.18.4)
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 2.7.15
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Australia (en_AU)
OS - Linux Mint 19 & Win10 (both 64bit)
IT Training & Support (retired)
Cheers Paul
openBrain
Posts: 3852
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Solved] SVG as geometry import crashed Freecad

Postby openBrain » Mon Jan 27, 2020 10:38 am

You have to downgrade and hold libexpat as explained above. ;)