SIGSEGV, Segmentation fault: Access violation (Manipulator WB Annotate Plane)

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!
Post Reply
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

SIGSEGV, Segmentation fault: Access violation (Manipulator WB Annotate Plane)

Post by easyw-fc »

Hi,
I'm getting an Access violation with my latest version of Manipulator WB Annotate Plane...
I just restored a non working feature do to some recent FC code changing...

here the way to create the issue:
.
freecad_screencast.gif
freecad_screencast.gif (966.76 KiB) Viewed 410 times
.
is there I can do to avoid this issue or is that a FC internal code issue?
It seems related to the deletion of some objects
in Caliper.py Line 589
https://github.com/easyw/Manipulator/bl ... er.py#L589

Code: Select all

                              FreeCAD.ActiveDocument.removeObject(PC.Name)
                              FreeCAD.ActiveDocument.removeObject(PE.Name)
                              FreeCAD.ActiveDocument.removeObject(APName)
Last edited by easyw-fc on Fri Jul 01, 2022 8:17 pm, edited 1 time in total.
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Access violation (Manipulator WB Annotate Plane)

Post by easyw-fc »

ok, on win I get the error without a FC crash, on linux I get a segmentation fault

Code: Select all

freecad-daily
FreeCAD 0.21, Libs: 0.21R
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2022
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Sheet Metal workbench loaded
Assembly4 workbench (v0.11.5) loaded
KiCadStepUpWB.Activated(v 10.13.0)
Caliper version 1.6.2
Tabified done !
position set left
Caliper version 1.6.2
Caliper docked
Tabified done !
position set left
position written left
starting!
----------------
Linear dimension
p1: Vector (27.67481, -5.012637, 8.0)
p2: Vector (-17.14406, -46.0, 1.0658141036401503e-14)
dim_line: Vector (5.265375000000002, -25.5063185, 4.000000000000005)
Distance : 0.0 mm
Delta X  : 44.818870000000004
Delta Y  : 40.987363
Delta Z  : 7.999999999999989
position written left
removing observer
removing observer
position written left
starting!
position written left
removing observer
removing observer
position written left
starting!
Delta X  : 21.566973
Delta Y  : 40.987363
Delta Z  : 7.999999999999989
----------------
Upgrade objects
Found closed wires: creating faces
----------------
Linear dimension
p1: Vector (4.422913000000001, -5.012637, 8.0)
p2: Vector (-17.14406, -46.0, 1.0658141036401503e-14)
dim_line: Vector (-73.68746948242188, -46.000003814697266, -0.9013843536376953)
Distance : 0.0 mm
Delta X  : 21.566973
Delta Y  : 40.987363
Delta Z  : 7.999999999999989
Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x43090) [0x7fe87eb19090]
#1  0x7fe881496ef3 in Gui::DockWnd::SelectionView::onSelectionChanged(Gui::SelectionChanges const&) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x423
#2  0x7fe88174b9b0 in Gui::SelectionObserver::_onSelectionChanged(Gui::SelectionChanges const&) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x30
#3  0x7fe8814cb5ef in boost::signals2::detail::signal_impl<void (Gui::SelectionChanges const&), boost::signals2::optional_last_value<void>, int, std::less<int>, boost::function<void (Gui::SelectionChanges const&)>, boost::function<void (boost::signals2::connection const&, Gui::SelectionChanges const&)>, boost::signals2::mutex>::operator()(Gui::SelectionChanges const&) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x31f
#4  0x7fe881753544 in Gui::SelectionSingleton::notify(Gui::SelectionChanges&&) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x104
#5  0x7fe88175d207 in Gui::SelectionSingleton::addSelection(char const*, char const*, char const*, float, float, float, std::vector<Gui::SelectionSingleton::SelObj, std::allocator<Gui::SelectionSingleton::SelObj> > const*, bool) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0xa37
#6  0x7fe881555669 in Gui::SoFCUnifiedSelection::setSelection(std::vector<Gui::SoFCUnifiedSelection::PickedInfo, std::allocator<Gui::SoFCUnifiedSelection::PickedInfo> > const&, bool) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x9a9
#7  0x7fe881556ac9 in Gui::SoFCUnifiedSelection::handleEvent(SoHandleEventAction*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x139
#8  0x7fe87e517277 in SoAction::traverse(SoNode*) from /lib/x86_64-linux-gnu/libCoin.so.80c+0x67
#9  0x7fe87e6ae4d8 in SoChildList::traverse(SoAction*, int, int) from /lib/x86_64-linux-gnu/libCoin.so.80c+0x168
#10  0x7fe87e6f95ec in SoGroup::doAction(SoAction*) from /lib/x86_64-linux-gnu/libCoin.so.80c+0x5c
#11  0x7fe87e7131ec in SoSeparator::doAction(SoAction*) from /lib/x86_64-linux-gnu/libCoin.so.80c+0x2c
#12  0x7fe87e517277 in SoAction::traverse(SoNode*) from /lib/x86_64-linux-gnu/libCoin.so.80c+0x67
#13  0x7fe87e5209ab in SoHandleEventAction::beginTraversal(SoNode*) from /lib/x86_64-linux-gnu/libCoin.so.80c+0xab
#14  0x7fe87e51771a in SoAction::apply(SoNode*) from /lib/x86_64-linux-gnu/libCoin.so.80c+0x28a
#15  0x7fe87e6c6651 in SoEventManager::actuallyProcessEvent(SoEvent const*) from /lib/x86_64-linux-gnu/libCoin.so.80c+0x71
#16  0x7fe8815d9d22 in SIM::Coin3D::Quarter::QuarterWidget::processSoEvent(SoEvent const*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x22
#17  0x7fe8815e215b in SIM::Coin3D::Quarter::SoQTQuarterAdaptor::processSoEvent(SoEvent const*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x5b
#18  0x7fe881618f4d in Gui::View3DInventorViewer::processSoEventBase(SoEvent const*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0xd
#19  0x7fe8815e818d in Gui::NavigationStyle::processSoEvent(SoEvent const*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x2d
#20  0x7fe8815fb335 in Gui::GestureNavigationStyle::AwaitingMoveState::react(Gui::GestureNavigationStyle::Event const&) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x8a5
#21  0x7fe8815fbdd1 in boost::statechart::simple_state<Gui::GestureNavigationStyle::AwaitingMoveState, Gui::GestureNavigationStyle::NaviMachine, boost::mpl::list<mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, (boost::statechart::history_mode)0>::react_impl(boost::statechart::event_base const&, void const*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x21
#22  0x7fe8815f555b in Gui::GestureNavigationStyle::processSoEvent(SoEvent const*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x2cb
#23  0x7fe8815ec3a9 in Gui::NavigationStyle::processEvent(SoEvent const*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x79
#24  0x7fe881618ec0 in Gui::View3DInventorViewer::processSoEvent(SoEvent const*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x70
#25  0x7fe8815d2aaf in SIM::Coin3D::Quarter::EventFilter::eventFilter(QObject*, QEvent*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0xaf
#26  0x7fe87f14b51b in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) from /lib/x86_64-linux-gnu/libQt5Core.so.5+0x9b
#27  0x7fe87fb65a55 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x75
#28  0x7fe87fb6f343 in QApplication::notify(QObject*, QEvent*) from /lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x583
#29  0x7fe8812cb938 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x88
#30  0x7fe87f14b80a in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /lib/x86_64-linux-gnu/libQt5Core.so.5+0x18a
#31  0x7fe87fb6e457 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) from /lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x1b7
#32  /lib/x86_64-linux-gnu/libQt5Widgets.so.5(+0x1c935d) [0x7fe87fbc435d]
#33  /lib/x86_64-linux-gnu/libQt5Widgets.so.5(+0x1cc1ec) [0x7fe87fbc71ec]
#34  0x7fe87fb65a66 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x86
#35  0x7fe87fb6f0f0 in QApplication::notify(QObject*, QEvent*) from /lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x330
#36  0x7fe8812cb938 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x88
#37  0x7fe87f14b80a in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /lib/x86_64-linux-gnu/libQt5Core.so.5+0x18a
#38  0x7fe87f5367d3 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) from /lib/x86_64-linux-gnu/libQt5Gui.so.5+0x6e3
#39  0x7fe87f53810b in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) from /lib/x86_64-linux-gnu/libQt5Gui.so.5+0x25b
#40  0x7fe87f51235b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /lib/x86_64-linux-gnu/libQt5Gui.so.5+0xbb
#41  /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5(+0x7932e) [0x7fe878df132e]
#42  /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x27d) [0x7fe87cdc617d]
#43  /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x52400) [0x7fe87cdc6400]
#44  /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x33) [0x7fe87cdc64a3]
#45  0x7fe87f1a3435 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /lib/x86_64-linux-gnu/libQt5Core.so.5+0x65
#46  0x7fe87f14a3ab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /lib/x86_64-linux-gnu/libQt5Core.so.5+0x12b
#47  0x7fe87f152116 in QCoreApplication::exec() from /lib/x86_64-linux-gnu/libQt5Core.so.5+0x96
#48  0x7fe881236ab5 in Gui::Application::runApplication() from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x1935
#49  freecad-daily(+0x6fb6) [0x5607986aefb6]
#50  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7fe87eafa083]
#51  freecad-daily(+0x735e) [0x5607986af35e]

that is a very bad issue
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: SIGSEGV, Segmentation fault: Access violation (Manipulator WB Annotate Plane)

Post by easyw-fc »

some more details:
Caliper is using a SelectionObserver
during the selection a plane is created and after a selection on this plane, the plane is deleted.

This deletion is causing the

Code: Select all

Unhandled Base::Exception caught in selection observer
found at https://github.com/FreeCAD/FreeCAD/blob ... n.cpp#L150

This was not an issue in previous FC releases... (i.e. FC 01.9.4) but it is present in FC0.20 and 0.21
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: SIGSEGV, Segmentation fault: Access violation (Manipulator WB Annotate Plane)

Post by easyw-fc »

I've just pushed a fix..
still I don't know why I had a sigsegv that shouldn't happen in FC at all
Post Reply