Path Operations refactor branch.

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Konstantin
Posts: 261
Joined: Wed Jul 23, 2014 10:10 am

Re: Path Operations refactor branch.

Postby Konstantin » Tue Aug 29, 2017 8:04 pm

mlampert wrote:
Tue Aug 29, 2017 5:39 pm
Who would have thought I would ever install Russian on any of my boxes .... :D
Hm... is it a clean russian instalation, or you turned it on later? I don't know what and where exactly, but it always differ if you install it in other language and later switch to russian (by "dpkg --reconfigure locales" for example). And third way - if you just turn russian in freecad. And add a little more to that - there's a number of russian encodings, now utf is used in linux by default, but may it be that ocasionly choosed something else in systems locale? Oh, and... I live not in Russia, installing linux I choose russian language, but other country, so, maybe it matters somewhere while generating codes. So, what was it? :lol:

From "Â" symbols in your error message (red one) I see that it's not russian. I don't know, in what language this letters used? Maybe wrong encoding again, or maybe in conjunction with some other encoding you installed, it transforms russian letters like that? Does log parser transforms messages somehow? Then, maybe, in my installations it generates very baaaad symbols that causes segfaults?

I have run many times into problems with freecad because of russian locale (and we've been discussing about it several times, not only in Path module). It was on Ubuntu, with freecad from daily ppa (with all default systems settings), it was on Manjaro with packages from AUR, based on Qt4 and Qt5 and my local builds to. Not enough to switch freecad to english, I have to add LANG=C in all my freecad installations. Now I am sure, that segfaults happening if something throws "translated" message to the console. Not only in this exact situation with wrong angle. Maybe something in python and the way freecad uses it? I don't know.
I cannot reproduce the segfault though. I get the error message in the report view:
I'm cooler than you, because I can 8-)
Capture.PNG
You deed it so big to make me feel shame? :lol:
Hm,
Can you post a stack trace of the segfault?
Ofcourse I can :) Here:

Code: Select all

./FreeCAD
FreeCAD 0.17, Libs: 0.17R11935 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2017
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Path workbench activated
Program received signal SIGSEGV, Segmentation fault.
#0  /usr/lib/libc.so.6(+0x33940) [0x7f7e7c983940]
#1  0x7f7e7dd2d261 in QMapDataBase::rebalance(QMapNodeBase*) from /usr/lib/libQt5Core.so.5+0x31
#2  0x7f7e7dd2d863 in QMapDataBase::createNode(int, int, QMapNodeBase*, bool) from /usr/lib/libQt5Core.so.5+0x63
#3  /usr/lib/qt/plugins/styles/breeze.so(+0x3c676) [0x7f7e62427676]
#4  /usr/lib/qt/plugins/styles/breeze.so(+0x177ae) [0x7f7e624027ae]
#5  /usr/lib/qt/plugins/styles/breeze.so(+0x604e5) [0x7f7e6244b4e5]
#6  0x7f7e7ec0e7ef in QWidget::event(QEvent*) from /usr/lib/libQt5Widgets.so.5+0xc7f
#7  0x7f7e7ecfd053 in QLineEdit::event(QEvent*) from /usr/lib/libQt5Widgets.so.5+0xa3
#8  0x7f7e7ebcbe4c in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0x9c
#9  0x7f7e7ebd3926 in QApplication::notify(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0x2a6
#10  0x7f7e84392da8 in Gui::GUIApplication::notify(QObject*, QEvent*) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x88
#11  0x7f7e7dea4bd0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/libQt5Core.so.5+0x120
#12  0x7f7e7ec09db5 in QWidget::ensurePolished() const from /usr/lib/libQt5Widgets.so.5+0x65
#13  0x7f7e7ecf7b9e in QLineEdit::sizeHint() const from /usr/lib/libQt5Widgets.so.5+0x2e
#14  0x7f7e846514ca in Gui::InputField::InputField(QWidget*) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x18a
#15  0x7f7e8439defd in Gui::WidgetProducer<Gui::InputField>::Produce() const from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x1d
#16  0x7f7e838a0392 in Base::Factory::Produce(char const*) const from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADBase.so+0x212
#17  0x7f7e8466b7df in Gui::WidgetFactoryInst::createWidget(char const*, QWidget*) const from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0xf
#18  0x7f7e84670e32 in Gui::UiLoader::createWidget(QString const&, QWidget*, QString const&) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0xa2
#19  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x67a7c3) [0x7f7e846c97c3]
#20  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x689a25) [0x7f7e846d8a25]
#21  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x6955f0) [0x7f7e846e45f0]
#22  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x67998f) [0x7f7e846c898f]
#23  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x681f4d) [0x7f7e846d0f4d]
#24  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x685b15) [0x7f7e846d4b15]
#25  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x695819) [0x7f7e846e4819]
#26  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x689cce) [0x7f7e846d8cce]
#27  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x6955f0) [0x7f7e846e45f0]
#28  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x67998f) [0x7f7e846c898f]
#29  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x681f4d) [0x7f7e846d0f4d]
#30  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x685b15) [0x7f7e846d4b15]
#31  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x695819) [0x7f7e846e4819]
#32  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x689cce) [0x7f7e846d8cce]
#33  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x6955f0) [0x7f7e846e45f0]
#34  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x67998f) [0x7f7e846c898f]
#35  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x682949) [0x7f7e846d1949]
#36  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x6798fe) [0x7f7e846c88fe]
#37  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so(+0x6809b7) [0x7f7e846cf9b7]
#38  0x7f7e84671ac7 in Gui::UiLoaderPy::load(Py::Tuple const&) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x457
#39  0x7f7e8467337e in Py::PythonExtension<Gui::UiLoaderPy>::method_varargs_call_handler(_object*, _object*) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x1be
#40  /usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x35a) [0x7f7e8348967a]
#41  /usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x2d5) [0x7f7e834ea4c5]
#42  /usr/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x19) [0x7f7e835048f9]
#43  /usr/lib/libpython2.7.so.1.0(+0x15450f) [0x7f7e834f750f]
#44  /usr/lib/libpython2.7.so.1.0(PyRun_StringFlags+0x66) [0x7f7e834f9276]
#45  0x7f7e84670a56 in Gui::PySideUicModule::loadUi(Py::Tuple const&) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x246
#46  0x7f7e84672e9a in Py::ExtensionModule<Gui::PySideUicModule>::invoke_method_varargs(void*, Py::Tuple const&) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x3a
#47  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADBase.so(method_varargs_call_handler+0x177) [0x7f7e838744f7]
#48  /usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x35a) [0x7f7e8348967a]
#49  /usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0xeaf) [0x7f7e8348a1cf]
#50  /usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x2d5) [0x7f7e834ea4c5]
#51  /usr/lib/libpython2.7.so.1.0(+0xb469e) [0x7f7e8345769e]
#52  /usr/lib/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f7e834b50e3]
#53  /usr/lib/libpython2.7.so.1.0(+0xe261e) [0x7f7e8348561e]
#54  /usr/lib/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f7e834b50e3]
#55  /usr/lib/libpython2.7.so.1.0(+0xc5947) [0x7f7e83468947]
#56  /usr/lib/libpython2.7.so.1.0(+0xa4614) [0x7f7e83447614]
#57  /usr/lib/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f7e834b50e3]
#58  /usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5ccd) [0x7f7e8348efed]
#59  /usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0xeaf) [0x7f7e8348a1cf]
#60  /usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x2d5) [0x7f7e834ea4c5]
#61  /usr/lib/libpython2.7.so.1.0(+0xb469e) [0x7f7e8345769e]
#62  /usr/lib/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f7e834b50e3]
#63  /usr/lib/libpython2.7.so.1.0(+0xe261e) [0x7f7e8348561e]
#64  /usr/lib/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f7e834b50e3]
#65  /usr/lib/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x30) [0x7f7e834e9bd0]
#66  0x7f7e843442f4 in Py::Callable::apply(Py::Tuple const&) const from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x14
#67  0x7f7e8461c567 in Gui::ViewProviderPythonFeatureImp::setEdit(int) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x4a7
#68  0x7f7dee712487 in Gui::ViewProviderPythonFeatureT<PathGui::ViewProviderPath>::setEdit(int) from /Data1/kostia/Bin/git/FreeCAD/build/Mod/Path/PathGui.so+0x17
#69  0x7f7e845fa45a in Gui::ViewProvider::startEditing(int) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x3a
#70  0x7f7e84615498 in Gui::ViewProviderPy::startEditing(_object*) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x58
#71  0x7f7e846155c7 in Gui::ViewProviderPy::staticCallback_startEditing(_object*, _object*) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x37
#72  /usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x35a) [0x7f7e8348967a]
#73  /usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0xeaf) [0x7f7e8348a1cf]
#74  /usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x2d5) [0x7f7e834ea4c5]
#75  /usr/lib/libpython2.7.so.1.0(+0xb469e) [0x7f7e8345769e]
#76  /usr/lib/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f7e834b50e3]
#77  /usr/lib/libpython2.7.so.1.0(+0xe261e) [0x7f7e8348561e]
#78  /usr/lib/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f7e834b50e3]
#79  /usr/lib/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x30) [0x7f7e834e9bd0]
#80  /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADBase.so(PP_Run_Method+0xe7) [0x7f7e83929697]
#81  0x7f7e838a8839 in Base::InterpreterSingleton::runMethodVoid(_object*, char const*) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADBase.so+0x29
#82  0x7f7e843c2480 in Gui::PythonCommand::activated(int) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x90
#83  0x7f7e843c5fdb in Gui::Command::invoke(int) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x7b
#84  0x7f7e7ded4786 in QMetaObject::activate(QObject*, int, int, void**) from /usr/lib/libQt5Core.so.5+0x886
#85  0x7f7e7ebc5543 in QAction::triggered(bool) from /usr/lib/libQt5Widgets.so.5+0x43
#86  0x7f7e7ebc7d66 in QAction::activate(QAction::ActionEvent) from /usr/lib/libQt5Widgets.so.5+0xd6
#87  /usr/lib/libQt5Widgets.so.5(+0x3128dc) [0x7f7e7ed928dc]
#88  0x7f7e7ed92b45 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) from /usr/lib/libQt5Widgets.so.5+0xf5
#89  0x7f7e7ed7122b in QToolButton::mouseReleaseEvent(QMouseEvent*) from /usr/lib/libQt5Widgets.so.5+0xb
#90  0x7f7e7ec0dd68 in QWidget::event(QEvent*) from /usr/lib/libQt5Widgets.so.5+0x1f8
#91  0x7f7e7ed712c5 in QToolButton::event(QEvent*) from /usr/lib/libQt5Widgets.so.5+0x35
#92  0x7f7e7ebcbe4c in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0x9c
#93  0x7f7e7ebd3ea1 in QApplication::notify(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0x821
#94  0x7f7e84392da8 in Gui::GUIApplication::notify(QObject*, QEvent*) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x88
#95  0x7f7e7dea4bd0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/libQt5Core.so.5+0x120
#96  0x7f7e7ebd2e2a in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) from /usr/lib/libQt5Widgets.so.5+0x1da
#97  /usr/lib/libQt5Widgets.so.5(+0x1a8f51) [0x7f7e7ec28f51]
#98  /usr/lib/libQt5Widgets.so.5(+0x1ab691) [0x7f7e7ec2b691]
#99  0x7f7e7ebcbe4c in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0x9c
#100  0x7f7e7ebd3926 in QApplication::notify(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0x2a6
#101  0x7f7e84392da8 in Gui::GUIApplication::notify(QObject*, QEvent*) from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x88
#102  0x7f7e7dea4bd0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/libQt5Core.so.5+0x120
#103  0x7f7e7e4071e4 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) from /usr/lib/libQt5Gui.so.5+0x704
#104  0x7f7e7e408d46 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) from /usr/lib/libQt5Gui.so.5+0x136
#105  0x7f7e7e3e04ac in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt5Gui.so.5+0xac
#106  /usr/lib/libQt5XcbQpa.so.5(+0x99cc1) [0x7f7e72646cc1]
#107  /usr/lib/libglib-2.0.so.0(g_main_context_dispatch+0x2e7) [0x7f7e77b65a57]
#108  /usr/lib/libglib-2.0.so.0(+0x4ac88) [0x7f7e77b65c88]
#109  /usr/lib/libglib-2.0.so.0(g_main_context_iteration+0x2c) [0x7f7e77b65d1c]
#110  0x7f7e7deff061 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt5Core.so.5+0x61
#111  0x7f7e7dea2ffb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt5Core.so.5+0x13b
#112  0x7f7e7deac048 in QCoreApplication::exec() from /usr/lib/libQt5Core.so.5+0x98
#113  0x7f7e8433fd33 in Gui::Application::runApplication() from /Data1/kostia/Bin/git/FreeCAD/build/lib/libFreeCADGui.so+0x1153
#114  ./FreeCAD(main+0x61f) [0x55e45c7b13af]
#115  /usr/lib/libc.so.6(__libc_start_main+0xea) [0x7f7e7c9704ca]
#116  ./FreeCAD(_start+0x2a) [0x55e45c7b1f8a]
I never said I'm against your solution
Sorry, I used wrong word. And if you guys think that I claim on you, while reading my messages, please, it's not like that. It's just my english and my head.

Good night to you all.
Konstantin
Posts: 261
Joined: Wed Jul 23, 2014 10:10 am

Re: Path Operations refactor branch.

Postby Konstantin » Tue Aug 29, 2017 8:18 pm

Oh, stack trace... did you mean running with gdb? I will recompile freecad tomorrow with debugging and make it.
mlampert
Posts: 1347
Joined: Fri Sep 16, 2016 9:28 pm

Re: Path Operations refactor branch.

Postby mlampert » Tue Aug 29, 2017 9:08 pm

Konstantin wrote:
Tue Aug 29, 2017 8:18 pm
Oh, stack trace... did you mean running with gdb? I will recompile freecad tomorrow with debugging and make it.
No the one you provided is good - seems to happen somewhere in qt5 on the creation of the an InputField, which explains why I don't see it, I don't have qt5. Do we have someone with Qt5 who can look into this?
mlampert
Posts: 1347
Joined: Fri Sep 16, 2016 9:28 pm

Re: Path Operations refactor branch.

Postby mlampert » Tue Aug 29, 2017 9:13 pm

I did indeed just install the russian locale with "dpkg --reconfigure locales", didn't know there are differences
Konstantin wrote:
Tue Aug 29, 2017 8:04 pm
From "Â" symbols in your error message (red one) I see that it's not russian.
This also happens in English, I must have messed up the encoding.
You deed it so big to make me feel shame? :lol:
Yeah - I gotta figure out how to downsize my screenshots ;)
Sorry, I used wrong word. And if you guys think that I claim on you, while reading my messages, please, it's not like that. It's just my english and my head.
No worries - no offense taken. Just wanted to make sure you know we're not ignoring you or your expertise, we're just not ready to address that issue.
Konstantin
Posts: 261
Joined: Wed Jul 23, 2014 10:10 am

Re: Path Operations refactor branch.

Postby Konstantin » Wed Aug 30, 2017 9:05 am

mlampert wrote:
Tue Aug 29, 2017 9:13 pm
mlampert, sorry, I leaded you wrong way. again.
It's not tool angle problem, it is related to tool modification.

Now on this computer, where I am experimenting, I have one tool in tool library. Drill, 10mm, angle is set to 59°. Leave it like this, don't make changes in it. Because angle is < 90°, tip compensation works when I: add Job, delete default tool, add this tool and drilling operation and check tip compensation.

Second: if I first modify tool (make angle 118° for example), close FreeCAD (to apply changes in tool library part in config file), then start FreeCAD again, open my file, remove all jobs, create new job, add this tool (without making any additional changes), and when I add drilling operation - it works. If I check tip compensation, if angle is >90° - it throws error message, no segfaults.

But!
I delete this Job and everything in it, create new Job, delete default tool, open tool library, (now important) modify tool, set angle to 120° (And it looks, that angle is not important at all, I just change it somehow), press Ok, add this tool immediately to Job, and then add drilling operation - 100% segfault on Russian locale.

Because tool in my library has 59° I always tried to change it to 118° and check how it works immediately, it always segfaulted, and didn't apply changes in tool library in config file. So everytime I started again, and it leaded me to segfaults again. That's why I thought, that 59° works, and 118° not.

How it is related to locale? I don't know. I checked konsole, it does not throw any additional messages while doing changes in the tool and adding drilling.

Hope this time I get you closer to the problem.