View Issue Details

IDProjectCategoryView StatusLast Update
0004247PartBugpublic2022-01-24 19:16
ReporterCyrilWaechter Assigned To 
PrioritynormalSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
PlatformGnu/Linux 64-bitsOSManjaro Linux (GNOME/gnome)OS Version5.4.6
Target Version0.20 
Summary0004247: GeometryCurvePy::intersect / GeometryCurvePy::intersectCC Segmentation Fault with OCC 7.4 (Fixed in OCC 7.5)
DescriptionCalling function intersect / intersectCC with 2 colinear lines crash FreeCAD with OCC 7.4.
Forum post : https://forum.freecadweb.org/viewtopic.php?f=19&t=42361

  • Error message :
  • Program received signal SIGSEGV, Segmentation fault.
    #0  /usr/lib/libc.so.6(+0x3bfb0) [0x7f1718865fb0]
    #1  0x7f168e3003a4 in Extrema_ExtCC::Points(int, Extrema_POnCurv&, Extrema_POnCurv&) const from /usr/lib/libTKGeomBase.so.7+0x54
    0000002  0x7f168eae20d7 in GeomAPI_ExtremaCurveCurve::Points(int, gp_Pnt&, gp_Pnt&) const from /usr/lib/libTKGeomAlgo.so.7+0x57
    0000003  0x7f1690dbe550 in Part::GeomCurve::intersect(opencascade::handle<Geom_Curve>, opencascade::handle<Geom_Curve>, std::vector<std::pair<Base::Vector3<double>, Base::Vector3<double> >, std::allocator<std::pair<Base::Vector3<double>, Base::Vector3<double> > > >&, double) from /usr/lib/freecad/lib/Part.so+0x3e0
    0000004  0x7f1690dbeb2e in Part::GeomCurve::intersect(Part::GeomCurve*, std::vector<std::pair<Base::Vector3<double>, Base::Vector3<double> >, std::allocator<std::pair<Base::Vector3<double>, Base::Vector3<double> > > >&, double) const from /usr/lib/freecad/lib/Part.so+0xfe
    0000005  0x7f1690cacfbe in Part::GeometryCurvePy::intersectCC(_object*) from /usr/lib/freecad/lib/Part.so+0x9e
    0000006  0x7f1690cad1af in Part::GeometryCurvePy::staticCallback_intersectCC(_object*, _object*) from /usr/lib/freecad/lib/Part.so+0x1f
    0000007  /usr/lib/libpython3.8.so.1.0(PyCFunction_Call+0xf3) [0x7f1719ffa5d3]
    0000008  /usr/lib/libpython3.8.so.1.0(_PyObject_MakeTpCall+0x230) [0x7f1719fa3220]
    0000009  /usr/lib/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x4c9a) [0x7f171a00c97a]
    0000010  /usr/lib/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x2fa) [0x7f1719fd809a]
    0000011  /usr/lib/libpython3.8.so.1.0(PyEval_EvalCodeEx+0x3a) [0x7f1719fd8cca]
    0000012  /usr/lib/libpython3.8.so.1.0(PyEval_EvalCode+0x1c) [0x7f171a06473c]
    0000013  0x7f171affbce6 in Gui::InteractiveInterpreter::runCode(PyCodeObject*) const from /usr/lib/freecad/lib/libFreeCADGui.so+0x66
    0000014  0x7f171affc54c in Gui::InteractiveInterpreter::runSource(char const*) const from /usr/lib/freecad/lib/libFreeCADGui.so+0xac
    0000015  0x7f171affc62d in Gui::InteractiveInterpreter::push(char const*) from /usr/lib/freecad/lib/libFreeCADGui.so+0xbd
    0000016  0x7f171affc834 in Gui::PythonConsole::runSource(QString const&) from /usr/lib/freecad/lib/libFreeCADGui.so+0xf4
    0000017  0x7f171affd107 in Gui::PythonConsole::runSourceFromMimeData(QString const&) from /usr/lib/freecad/lib/libFreeCADGui.so+0x737
    0000018  0x7f171affeeac in Gui::PythonConsole::insertFromMimeData(QMimeData const*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x1cc
    0000019  /usr/lib/libQt5Widgets.so.5(+0x356664) [0x7f1719b2d664]
    0000020  0x7f1719b32a13 in QWidgetTextControl::processEvent(QEvent*, QMatrix const&, QWidget*) from /usr/lib/libQt5Widgets.so.5+0x193
    0000021  0x7f1719b28b1c in QWidgetTextControl::processEvent(QEvent*, QPointF const&, QWidget*) from /usr/lib/libQt5Widgets.so.5+0x5c
    0000022  0x7f1719b03aa4 in QPlainTextEdit::keyPressEvent(QKeyEvent*) from /usr/lib/libQt5Widgets.so.5+0x254
    0000023  0x7f171b029653 in Gui::TextEdit::keyPressEvent(QKeyEvent*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x23
    0000024  0x7f171affe097 in Gui::PythonConsole::keyPressEvent(QKeyEvent*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x277
    0000025  0x7f1719976e1b in QWidget::event(QEvent*) from /usr/lib/libQt5Widgets.so.5+0x88b
    0000026  0x7f1719a2822f in QFrame::event(QEvent*) from /usr/lib/libQt5Widgets.so.5+0x1f
    0000027  0x7f1719a2af7a in QAbstractScrollArea::event(QEvent*) from /usr/lib/libQt5Widgets.so.5+0x26a
    0000028  0x7f1719b032b9 in QPlainTextEdit::event(QEvent*) from /usr/lib/libQt5Widgets.so.5+0xc9
    0000029  0x7f1719932472 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0x82
    0000030  0x7f171993c3c4 in QApplication::notify(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0xa74
    0000031  0x7f171ae1f069 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x89
    0000032  0x7f1718e99832 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/libQt5Core.so.5+0x182
    0000033  /usr/lib/libQt5Widgets.so.5(+0x1bdf3e) [0x7f1719994f3e]
    0000034  0x7f1719932472 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0x82
    0000035  0x7f171993bc89 in QApplication::notify(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0x339
    0000036  0x7f171ae1f069 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x89
    0000037  0x7f1718e99832 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/libQt5Core.so.5+0x182
    0000038  0x7f171925e66d in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) from /usr/lib/libQt5Gui.so.5+0x16d
    #39  0x7f17192639ba in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) from /usr/lib/libQt5Gui.so.5+0x26a
    #40  0x7f171923cc2c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt5Gui.so.5+0xbc
    0000041  /usr/lib/libQt5XcbQpa.so.5(+0x66a2c) [0x7f17133aba2c]
    0000042  /usr/lib/libglib-2.0.so.0(g_main_context_dispatch+0x27e) [0x7f17169d239e]
    0000043  /usr/lib/libglib-2.0.so.0(+0x6c1b1) [0x7f17169d41b1]
    0000044  /usr/lib/libglib-2.0.so.0(g_main_context_iteration+0x31) [0x7f17169d41f1]
    0000045  0x7f1718ef1cc0 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt5Core.so.5+0x60
    0000046  0x7f1718e9839c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt5Core.so.5+0x12c
    0000047  0x7f1718ea03a6 in QCoreApplication::exec() from /usr/lib/libQt5Core.so.5+0x96
    0000048  0x7f171ad93222 in Gui::Application::runApplication() from /usr/lib/freecad/lib/libFreeCADGui.so+0x15e2
    0000049  freecad(main+0x759) [0x5562249605d9]
    0000050  /usr/lib/libc.so.6(__libc_start_main+0xf3) [0x7f1718851153]
    0000051  freecad(_start+0x2e) [0x5562249608fe]
    
    Steps To Reproduce
    1. Open FreeCAD
    2. Run following code in python console :
    import Part
    
    doc = FreeCAD.newDocument()
    v = FreeCAD.Vector
    w1 = Part.makePolygon([v(0,0,0), v(0,10,0), v(-5, 5, 0), v(0,0,0)])
    w2 = Part.makePolygon([v(0,2,0), v(0,8,0), v(5, 5, 0), v(0,2,0)])
    Part.show(w1)
    Part.show(w2)
    e1 = w1.Edges[0]
    e2 = w2.Edges[0]
    e1.Curve.intersectCC(e2.Curve)
    
    Additional InformationBug confirmed by looo.
    Tracking this via OCC bugs in the bugtracker forum thread
    Tags#ready-for-migration, OCC 7.4, OCC 7.5, OCC Bug, regression, upstream
    FreeCAD InformationOS: Manjaro Linux (GNOME/gnome)
    Word size of OS: 64-bit
    Word size of FreeCAD: 64-bit
    Version: 0.19 (Git)
    Build type: Release
    Branch: master
    Hash: 49e4e45ff38b0459f0f9a76df634f6da4995b731
    Python version: 3.8.1
    Qt version: 5.14.0
    Coin version: 4.0.0a
    OCC version: 7.4.0
    Locale: French/Switzerland (fr_CH)

    Activities

    Kunda1

    2020-10-10 13:07

    administrator   ~0014819

    Someone volunteer to make an upstream ticket? (https://forum.freecadweb.org/viewtopic.php?f=19&t=42361&p=438189#p438189)

    chennes

    2020-11-11 20:21

    administrator   ~0014977

    I cannot reproduce using OCCT 7.5.0, so this may have already been fixed upstream. The output I get is:
    
    >>> e1.Curve.intersectCC(e2.Curve)
    Traceback (most recent call last):
      File "<input>", line 1, in <module>
    RuntimeError: NCollection_Sequence::Value
    

    Kunda1

    2020-12-03 22:55

    administrator   ~0015070

    Thanks @chennes!
    @CyrilWaechter can you reproduce with OCC 7.5 ?

    CyrilWaechter

    2020-12-04 14:46

    reporter   ~0015079

    Thanks @chennes for testing !
    @Kunda1 I waited a bit to update to OCCT 7.5.0 but I confirm that it is solved in OCCT 7.5.0. Should we close this issue keep it for a while until OCCT 7.4 «vanish» from most distros ?

    Kunda1

    2020-12-06 00:24

    administrator   ~0015089

    Good point. Lets resolve it but not close it. That way we can keep an eye on it.

    yorik

    2022-03-03 13:55

    administrator   ~0016856

    This ticket has been migrated to GitHub as issue 6022.

    Issue History

    Date Modified Username Field Change
    2020-01-13 13:50 CyrilWaechter New Issue
    2020-01-13 13:52 CyrilWaechter Tag Attached: OCC 7.4
    2020-10-10 13:05 Kunda1 Tag Attached: upstream
    2020-10-10 13:06 Kunda1 Tag Attached: regression
    2020-10-10 13:06 Kunda1 Tag Attached: OCC Bug
    2020-10-10 13:07 Kunda1 Status new => confirmed
    2020-10-10 13:07 Kunda1 Note Added: 0014819
    2020-10-10 13:29 Kunda1 Summary GeometryCurvePy::intersect / GeometryCurvePy::intersectCC Segmentation Fault with OCC 7.4 => GeometryCurvePy::intersect / GeometryCurvePy::intersectCC Segmentation Fault with OCC 7.4 (Upstream bug)
    2020-11-11 20:21 chennes Note Added: 0014977
    2020-12-03 22:55 Kunda1 Note Added: 0015070
    2020-12-04 14:46 CyrilWaechter Note Added: 0015079
    2020-12-06 00:24 Kunda1 Status confirmed => resolved
    2020-12-06 00:24 Kunda1 Resolution open => fixed
    2020-12-06 00:24 Kunda1 Note Added: 0015089
    2020-12-06 00:24 Kunda1 Summary GeometryCurvePy::intersect / GeometryCurvePy::intersectCC Segmentation Fault with OCC 7.4 (Upstream bug) => GeometryCurvePy::intersect / GeometryCurvePy::intersectCC Segmentation Fault with OCC 7.4 (Fixed in OCC 7.5)
    2020-12-06 00:25 Kunda1 Tag Attached: OCC 7.5
    2020-12-31 12:31 Kunda1 Additional Information Updated
    2021-02-06 06:46 abdullah Target Version => 0.20
    2022-01-24 19:16 Kunda1 Tag Attached: #ready-for-migration