Union: Input shape is null + SIGSEGV

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Premik
Posts: 10
Joined: Sat Aug 19, 2017 9:50 am

Union: Input shape is null + SIGSEGV

Post by Premik »

I have two Body parts. Each with one Sketch and one Pad. Please see the attachement.
The parts are in some strange state where they refuse any boolean operation.

Part/Union boolean:
Exception (Sun Sep 10 09:33:00 2017): Input shape is null

Part design/Union
SIGSEGV in opencascade (see below for the bt)

  • I've tried to move the parts closer together to get some overlap but it didn't change anything.
  • I can easily workaround this problem by copy-paste the two Sketches into a new file and recreating the two Bodies and Pads. So this is more to trace down what went wrong.
  • I don't remember exactly how I got to this situation. But it involved some copy+pase of the Sketches and moving them between different Body parts. It is probably not possible to reproduce by simply recreating the project from scratch.

Code: Select all

OS: "Arch Linux"
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11935 (Git)
Build type: Debug
Branch: master
Hash: a5bc70cca0d2eaa56709603521650ccb3d8d926c
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)

Code: Select all

#0  0x00007f110df6cd19 in TopoDS_Iterator::Initialize(TopoDS_Shape const&, bool, bool) () at /opt/opencascade7/lib/libTKBRep.so.7
#1  0x00007f110e56ab97 in  () at /opt/opencascade7/lib/libTKBO.so.7
#2  0x00007f110e56b5de in BOPDS_DS::Init(double) () at /opt/opencascade7/lib/libTKBO.so.7
#3  0x00007f110e5d6fea in BOPAlgo_PaveFiller::Init() () at /opt/opencascade7/lib/libTKBO.so.7
#4  0x00007f110e5d6dd1 in BOPAlgo_PaveFiller::PerformInternal() () at /opt/opencascade7/lib/libTKBO.so.7
#5  0x00007f110e5d775f in BOPAlgo_PaveFiller::Perform() () at /opt/opencascade7/lib/libTKBO.so.7
#6  0x00007f110e55f2a9 in BRepAlgoAPI_BooleanOperation::Build() () at /opt/opencascade7/lib/libTKBO.so.7
#7  0x00007f110e56437b in BRepAlgoAPI_Fuse::BRepAlgoAPI_Fuse(TopoDS_Shape const&, TopoDS_Shape const&) () at /opt/opencascade7/lib/libTKBO.so.7
#8  0x00007f110666ac3f in PartDesign::Boolean::execute() (this=0x102686fb0) at /tmp/makepkg/freecad-git/src/freecad-git/src/Mod/PartDesign/App/FeatureBoolean.cpp:133
#9  0x00007f1131acf155 in App::DocumentObject::recompute() (this=0x102686fb0) at /tmp/makepkg/freecad-git/src/freecad-git/src/App/DocumentObject.cpp:78
#10 0x00007f1111860bc0 in Part::Feature::recompute() (this=<optimized out>) at /tmp/makepkg/freecad-git/src/freecad-git/src/Mod/Part/App/PartFeature.cpp:83
#11 0x00007f1131a99c3c in App::Document::_recomputeFeature(App::DocumentObject*) (this=this@entry=0x102889d30, Feat=Feat@entry=0x102686fb0) at /tmp/makepkg/freecad-git/src/freecad-git/src/App/Document.cpp:2258
#12 0x00007f1131aa1600 in App::Document::recompute() (this=0x102889d30) at /tmp/makepkg/freecad-git/src/freecad-git/src/App/Document.cpp:2125
#13 0x00007f1131af54c5 in App::DocumentPy::recompute(_object*) (this=this@entry=0x101890240, args=<optimized out>) at /tmp/makepkg/freecad-git/src/freecad-git/src/App/DocumentPyImp.cpp:408
#14 0x00007f1131af5648 in App::DocumentPy::staticCallback_recompute(_object*, _object*) (self=0x101890248, args=<optimized out>) at /tmp/makepkg/freecad-git/src/freecad-git/src/App/DocumentPy.cpp:1718
#15 0x00007f11312c367a in PyEval_EvalFrameEx () at /usr/lib/libpython2.7.so.1.0
#16 0x00007f11313244c5 in PyEval_EvalCodeEx () at /usr/lib/libpython2.7.so.1.0
#17 0x00007f113133e8f9 in PyEval_EvalCode () at /usr/lib/libpython2.7.so.1.0
#18 0x00007f113133150f in run_mod () at /usr/lib/libpython2.7.so.1.0
#19 0x00007f1131333276 in PyRun_StringFlags () at /usr/lib/libpython2.7.so.1.0
#20 0x00007f11316d753a in Base::InterpreterSingleton::runString[abi:cxx11](char const*) (this=<optimized out>, sCmd=0x1026000d8 "App.ActiveDocument.recompute()") at /tmp/makepkg/freecad-git/src/freecad-git/src/Base/Interpreter.cpp:232
#21 0x00007f11321a6516 in Gui::Command::doCommand(Gui::Command::DoCmd_Type, char const*, ...) (eType=eType@entry=Gui::Command::App, sCmd=sCmd@entry=0x7f1132857d78 "App.ActiveDocument.recompute()")
    at /tmp/makepkg/freecad-git/src/freecad-git/src/Gui/Command.cpp:475
#22 0x00007f11321a7078 in Gui::Command::updateActive() () at /tmp/makepkg/freecad-git/src/freecad-git/src/Gui/Command.cpp:560
#23 0x00007f1106956ab2 in finishFeature(Gui::Command const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, App::DocumentObject*, bool) (cmd=cmd@entry=0x1022c21c0, FeatName="Boolean", prevSolidFeature=<optimized out>, prevSolidFeature@entry=0x0, hidePrevSolid=hidePrevSolid@entry=false) at /tmp/makepkg/freecad-git/src/freecad-git/src/Mod/PartDesign/Gui/Command.cpp:666
#24 0x00007f1106962bf1 in CmdPartDesignBoolean::activated(int) (this=0x1022c21c0, iMsg=<optimized out>) at /tmp/makepkg/freecad-git/src/freecad-git/src/Mod/PartDesign/Gui/Command.cpp:2158
#25 0x00007f11321aae3b in Gui::Command::invoke(int) (this=0x1022c21c0, i=0) at /tmp/makepkg/freecad-git/src/freecad-git/src/Gui/Command.cpp:300
#26 0x00007f11301459c5 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () at /usr/lib/libQtCore.so.4
#27 0x00007f113067f5e3 in QAction::triggered(bool) () at /usr/lib/libQtGui.so.4
#28 0x00007f11306809fb in QAction::activate(QAction::ActionEvent) () at /usr/lib/libQtGui.so.4
#29 0x00007f1130a64bd4 in  () at /usr/lib/libQtGui.so.4
#30 0x00007f1130a64d35 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () at /usr/lib/libQtGui.so.4
#31 0x00007f1130b2f89b in QToolButton::mouseReleaseEvent(QMouseEvent*) () at /usr/lib/libQtGui.so.4
#32 0x00007f11306dd748 in QWidget::event(QEvent*) () at /usr/lib/libQtGui.so.4
#33 0x00007f1130685714 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQtGui.so.4
#34 0x00007f113068d712 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQtGui.so.4
#35 0x00007f1132182009 in Gui::GUIApplication::notify(QObject*, QEvent*) (this=0x7fffffffd080, receiver=0x102441170, event=0x7fffffffc6d0) at /tmp/makepkg/freecad-git/src/freecad-git/src/Gui/GuiApplication.cpp:91
#36 0x00007f1130130f7e in QCoreApplication::notifyInternal(QObject*, QEvent*) () at /usr/lib/libQtCore.so.4
#37 0x00007f113068c34d in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () at /usr/lib/libQtGui.so.4
#38 0x00007f113070a2cb in  () at /usr/lib/libQtGui.so.4
#39 0x00007f1130709079 in QApplication::x11ProcessEvent(_XEvent*) () at /usr/lib/libQtGui.so.4
#40 0x00007f1130732380 in  () at /usr/lib/libQtGui.so.4
#41 0x00007f1128120a57 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#42 0x00007f1128120c88 in  () at /usr/lib/libglib-2.0.so.0
#43 0x00007f1128120d1c in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#44 0x00007f1130162268 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQtCore.so.4
#45 0x00007f1130732508 in  () at /usr/lib/libQtGui.so.4
#46 0x00007f113012f484 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQtCore.so.4
#47 0x00007f113012f7ef in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQtCore.so.4
#48 0x00007f1130135480 in QCoreApplication::exec() () at /usr/lib/libQtCore.so.4
#49 0x00007f1132139e33 in Gui::Application::runApplication() () at /tmp/makepkg/freecad-git/src/freecad-git/src/Gui/Application.cpp:1890
#50 0x0000000100002f66 in main(int, char**) (argc=<optimized out>, argv=0x7fffffffda68) at /tmp/makepkg/freecad-git/src/freecad-git/src/Main/MainGui.cpp:246

Attachments
TwoParts.fcstd
(15.09 KiB) Downloaded 69 times
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Union: Input shape is null + SIGSEGV

Post by wmayer »

Part/Union boolean:
Exception (Sun Sep 10 09:33:00 2017): Input shape is null
This is because Part tools don't know anything about bodies and since the bodies themselves have a null shape the boolean fails. What you would actually need is the tips of the bodies which usually are solids but this is not longer allowed with recent changes.
Part design/Union
SIGSEGV in opencascade (see below for the bt)
I am not familiar how PD booleans are supposed to work. But after playing a bit I also got a crash which shows a similar backtrace to yours. When checking this with the debugger then there is a null shape passed to BRepAlgoAPI_Fuse which of course is a bug.

What I did is:
* load your file
* activate the Long body
* select the Short body and press Boolean

As said above the body feature itself has a null shape but inside the algorithm there is no further validation check done and thus leads to the crash.

git commit 832e186
Premik
Posts: 10
Joined: Sat Aug 19, 2017 9:50 am

Re: Union: Input shape is null + SIGSEGV

Post by Premik »

Thanks. I didn't know about the body tips thing. After seting the tips to the pads the part-union booleans seems to work ok. And the part-design one doesn't crash anymore. At least in the version I have right now.

This also explains why copy-paste the shapes and recreating the pads+bodies solved the issue before. I think the tip is somehow set the the lates operation by default?
And this also solved another problem I had in a different project. Where I managed to get the tip set somewhere to the middle of the body. Good stuff.
Post Reply