View Issue Details

IDProjectCategoryView StatusLast Update
0002590File formats[All Projects] Generalpublic2019-02-27 21:49
ReporterlukasuboAssigned To 
PriorityhighSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSMintOS Version17.2
Product Version 
Target VersionFixed in Version 
Summary0002590: FreeCAD (0.17 Daily) crashes on exporting imported STEP as WebGL
DescriptionI imported a STEP file into FreeCAD, then attempted to export it as WebGL. FreeCAD crashed (segmentation fault). The error message displayed in the terminal is below the version information, and the log and relevant STEP file are attached.



OS: Linux Mint 17.2 Rafaela
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.7731 (Git)
Build type: None
Branch: master
Hash: dea884ab6a4a748cd61cb593ee91f0eef1bdb603
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17



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

Fasteners workbench Loaded
Segmentation fault
Steps To Reproduce1. Open attached STEP file in FreeCAD.
2. Attempt to export it as WebGL.
Additional InformationThe STEP file was created using FreeCAD (stable release version, I believe, but I may be wrong). I created another STEP file with only a simple cube primitive, and it does not cause this issue.
Tagsexport, import, OCC 7.3, OCC Bug, STEP, upstream, WebGL

Activities

lukasubo

2016-06-15 02:42

reporter  

Attachments.zip (7,890 bytes)

yorik

2016-06-15 14:04

administrator   ~0007149

Will have a look, but this file is huge... Probably what fails is the meshing, the internal mesher is known to have problems with huge objects

Kunda1

2017-01-17 01:19

administrator   ~0007824

Forum thread: http://forum.freecadweb.org/viewtopic.php?f=10&t=19963

maiden

2017-05-26 18:54

reporter   ~0009151

I can confirm, crashes on webGL export. STL export works.

I exported to .stl, imported then exported to WebGL and it did not crash, but the resulting html file is not scaled correctly? its huge..

test.html (560,472 bytes)

Kunda1

2017-05-26 19:06

administrator   ~0009152

Thanks for reproducing. Updated ticket status.

Kunda1

2017-05-26 19:15

administrator   ~0009153

Last edited: 2017-05-26 19:15

View 2 revisions

@maiden could you post a backtrace?
Also, forgot to mention: when reporting please always post your full FreeCAD version info found in Help > About Freecad > Copy to clipboard

maiden

2017-05-26 19:18

reporter   ~0009154

Last edited: 2017-05-26 19:21

View 2 revisions

from gdb:

Thread 1 "FreeCAD" received signal SIGSEGV, Segmentation fault.
0x00007fffb09ae80c in BRepAdaptor_CompCurve::Prepare(double&, double&, int&) const ()
   from /usr/lib/x86_64-linux-gnu/libTKBRep.so.10


maiden

2017-05-26 19:20

reporter   ~0009155

Sorry for the missing version:

OS: Ubuntu 17.04
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9586 (Git)
Build type: Unknown
Branch: master
Hash: 0e2cf2ebcaaa50723de608cf030af740cb6ad548
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

wmayer

2017-08-21 08:19

administrator   ~0009972

It's not the mesher where the crash happens because otherwise it would already fail when loading the file.
It appears that the crash occurs in the function discretize which is called in the importWebGL.py script inside the function getObjectData.
With this code snippet one can reliably reproduce the crash:

obj=App.ActiveDocument.Part__Feature
wires=[]
for f in obj.Shape.Faces:
  for w in f.Wires:
    wo = Part.Wire(Part.__sortEdges__(w.Edges))
    wires.append(wo)


wires[1].discretize(QuasiDeflection=0.1)
wires[19].discretize(QuasiDeflection=0.1)

It shows that the crash happens for the second and last wire in the list.

Running the Python code in the debugger reveals that the crash happens in OCC in the function QuasiFleche due to a stack overflow.

Kunda1

2017-08-28 11:48

administrator   ~0010014

@wmayer is this an upstream OCCT bug?

wmayer

2017-09-02 13:28

administrator   ~0010063

Yes, it's an occ bug. And it's still present in occ 7.2

amunizp

2018-07-10 13:55

reporter   ~0011509

Just ran into this bug today. Updated freeCAD and still happened. Pure FreeCAD file all done with part design (Not Step file). File Export to webGL crashes the system. I can confirm that importing STL file does work (but I need better colour contrast!) Using ubuntu 16.04
Hope this helps:
~$ freecad
FreeCAD 0.17, Libs: 0.17R13522 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2018
  ##### #### ### ####
  # # # # # #
  # ## #### #### # # # # #
  #### # # # # # # # ##### # #
  # # #### #### # # # # #
  # # # # # # # # # ## ## ##
  # # #### #### ### # # #### ## ## ##

not a freecad file: .STL
not a freecad file: .STEP
AttachEngine3D::calculateAttachedPlacement:InertialCS: inertia tensor has axis of symmetry. Second and third axes of inertia are undefined.
AttachEngine3D::calculateAttachedPlacement:InertialCS: inertia tensor has axis of symmetry. Second and third axes of inertia are undefined.
Program received signal SIGSEGV, Segmentation fault.
#0 /lib/x86_64-linux-gnu/libc.so.6(+0x354b0) [0x7f1a965444b0]
#1 0x7f1a4cf0ffbe in BRepAdaptor_CompCurve::Resolution(double) const from /usr/lib/x86_64-linux-gnu/libTKBRep.so.7+0xe
0000002 0x7f1a4bccf567 in GCPnts_QuasiUniformDeflection::Initialize(Adaptor3d_Curve const&, double, double, double, GeomAbs_Shape) from /usr/lib/x86_64-linux-gnu/libTKGeomBase.so.7+0x67
0000003 0x7f1a4bcd14cc in GCPnts_QuasiUniformDeflection::GCPnts_QuasiUniformDeflection(Adaptor3d_Curve const&, double, double, double, GeomAbs_Shape) from /usr/lib/x86_64-linux-gnu/libTKGeomBase.so.7+0x18c
0000004 0x7f1a5037d046 in Part::TopoShapeWirePy::discretize(_object*, _object*) from /usr/lib/freecad/lib/Part.so+0xa86
0000005 0x7f1a5037da2d in Part::TopoShapeWirePy::staticCallback_discretize(_object*, _object*, _object*) from /usr/lib/freecad/lib/Part.so+0x2d
0000006 /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6f55) [0x7f1a98108e75]
0000007 /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c) [0x7f1a9824005c]
0000008 /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6ffd) [0x7f1a98108f1d]
0000009 /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x7124) [0x7f1a98109044]
0000010 /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x7124) [0x7f1a98109044]
0000011 /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c) [0x7f1a9824005c]
0000012 /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCode+0x19) [0x7f1a98101da9]
0000013 /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyRun_StringFlags+0x76) [0x7f1a9817c1f6]
0000014 0x7f1a98692916 in Base::InterpreterSingleton::runString[abi:cxx11](char const*) from /usr/lib/freecad/lib/libFreeCADBase.so+0x66
0000015 0x7f1a991b03fd in Gui::Command::runCommand(Gui::Command::DoCmd_Type, char const*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x4d
0000016 0x7f1a99142e96 in Gui::Application::exportTo(char const*, char const*, char const*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x3a6
0000017 0x7f1a991bbef0 in StdCmdExport::activated(int) from /usr/lib/freecad/lib/libFreeCADGui.so+0x530
0000018 0x7f1a991b463c in Gui::Command::invoke(int) from /usr/lib/freecad/lib/libFreeCADGui.so+0x7c
0000019 0x7f1a97010010 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x4d0
0000020 0x7f1a97522d62 in QAction::triggered(bool) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x42
0000021 0x7f1a975240b3 in QAction::activate(QAction::ActionEvent) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x83
0000022 /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x6219fd) [0x7f1a979859fd]
0000023 /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x625de9) [0x7f1a97989de9]
0000024 0x7f1a9757f8d0 in QWidget::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x2a0
0000025 0x7f1a9798dffb in QMenu::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x6b
0000026 0x7f1a97528fdc in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x8c
0000027 0x7f1a975300d6 in QApplication::notify(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x476
0000028 0x7f1a9918f464 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x54
0000029 0x7f1a96ffb90d in QCoreApplication::notifyInternal(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x8d
0000030 0x7f1a9752f6dd in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x14d
0000031 /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x249d7c) [0x7f1a975add7c]
0000032 0x7f1a975acc83 in QApplication::x11ProcessEvent(_XEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x16b3
0000033 /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x272542) [0x7f1a975d6542]
0000034 /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x2a7) [0x7f1a8fc63197]
0000035 /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4a3f0) [0x7f1a8fc633f0]
0000036 /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c) [0x7f1a8fc6349c]
0000037 0x7f1a9702c2ae in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x7e
0000038 /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x272616) [0x7f1a975d6616]
#39 0x7f1a96ffa18f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x3f
#40 0x7f1a96ffa4f5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x1b5
0000041 0x7f1a970004b9 in QCoreApplication::exec() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x99
0000042 0x7f1a99148240 in Gui::Application::runApplication() from /usr/lib/freecad/lib/libFreeCADGui.so+0x15b0
0000043 freecad(main+0x8b4) [0x403804]
0000044 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f1a9652f830]
0000045 freecad(_start+0x29) [0x404a49]

Sweepv4.7.fcstd (677,356 bytes)

amunizp

2018-07-10 13:56

reporter   ~0011510

Full version details:
OS: Ubuntu 16.04.4 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13522 (Git)
Build type: None
Branch: releases/FreeCAD-0-17
Hash: 3bb5ff4e70c0c526f2d9dd69b1004155b2f527f2
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedKingdom (en_GB)

Kunda1

2018-07-10 14:00

administrator   ~0011512

It's an upstream OCC bug

Kunda1

2018-11-20 09:31

administrator   ~0012221

User @UR_ cannot recreate per https://forum.freecadweb.org/viewtopic.php?f=10&t=20264&p=269689#p269644
UR_ wrote

No crash here, while exporting Roller.step from tracker to webgl format

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15227 (Git)
Build type: Release
Branch: master
Hash: ddfa51056559c70bf8698c79af69eb74a339ba81
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

uwestoehr

2019-02-11 21:18

updater   ~0012629

I can confirm that this bug is fixed in OCC 7.3; forum thread: https://forum.freecadweb.org/viewtopic.php?p=286326#p286326

Kunda1

2019-02-27 21:49

administrator   ~0012795

Closing bug as it is not reproducible on OCC 7.3

Issue History

Date Modified Username Field Change
2016-06-15 02:42 lukasubo New Issue
2016-06-15 02:42 lukasubo File Added: Attachments.zip
2016-06-15 14:04 yorik Note Added: 0007149
2017-01-17 01:19 Kunda1 Note Added: 0007824
2017-01-28 13:14 Kunda1 Tag Attached: STEP
2017-05-26 18:54 maiden File Added: test.html
2017-05-26 18:54 maiden Note Added: 0009151
2017-05-26 19:06 Kunda1 Severity minor => crash
2017-05-26 19:06 Kunda1 Status new => confirmed
2017-05-26 19:06 Kunda1 Category => General
2017-05-26 19:06 Kunda1 Note Added: 0009152
2017-05-26 19:15 Kunda1 Note Added: 0009153
2017-05-26 19:15 Kunda1 Note Edited: 0009153 View Revisions
2017-05-26 19:18 maiden Note Added: 0009154
2017-05-26 19:20 maiden Note Added: 0009155
2017-05-26 19:21 Kunda1 Note Edited: 0009154 View Revisions
2017-07-11 10:58 Kunda1 Priority normal => high
2017-07-11 11:07 Kunda1 Tag Attached: import
2017-07-11 11:07 Kunda1 Tag Attached: WebGL
2017-07-11 11:08 Kunda1 Tag Attached: export
2017-08-21 08:19 wmayer Note Added: 0009972
2017-08-28 11:48 Kunda1 Note Added: 0010014
2017-09-02 13:28 wmayer Note Added: 0010063
2017-09-02 19:30 Kunda1 Tag Attached: OCC Bug
2017-09-02 19:30 Kunda1 Tag Attached: OCC NotOnRoadmap
2017-09-02 19:30 Kunda1 Tag Attached: upstream
2018-07-10 13:55 amunizp File Added: Sweepv4.7.fcstd
2018-07-10 13:55 amunizp Note Added: 0011509
2018-07-10 13:56 amunizp Note Added: 0011510
2018-07-10 14:00 Kunda1 Note Added: 0011512
2018-11-20 09:31 Kunda1 Note Added: 0012221
2019-02-11 21:18 uwestoehr Note Added: 0012629
2019-02-27 21:48 Kunda1 Tag Detached: OCC NotOnRoadmap
2019-02-27 21:48 Kunda1 Tag Attached: OCC 7.3
2019-02-27 21:49 Kunda1 Status confirmed => closed
2019-02-27 21:49 Kunda1 Resolution open => fixed
2019-02-27 21:49 Kunda1 Note Added: 0012795