View Issue Details

IDProjectCategoryView StatusLast Update
0004031ExpressionsBugpublic2021-02-06 06:30
Reporterdhka2 Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
Status confirmedResolutionopen 
PlatformLinuxOSArch 
Target Version0.20 
Summary0004031: Crash upon solving expression referencing named Constraint
DescriptionFreecad git build as of 18.06.2019 sometimes crashes with signal 11 upon referencing a named constraint in an expression. This is width python 3 and qt5.

stdout output:

Program received signal SIGSEGV, Segmentation fault.
#0  /lib/libc.so.6(+0x378b0) [0x7f160e65a8b0]
#1  0x7f160fe90f76 in App::ObjectIdentifier::Component::get(Py::Object const&) const from /usr/lib/freecad/lib/libFreeCADApp.so+0x1c6
0000002  0x7f160fe96638 in App::ObjectIdentifier::access(App::ObjectIdentifier::ResolveResults const&, Py::Object*) const from /usr/lib/freecad/lib/libFreeCADApp.so+0x1b8
0000003  0x7f160fe9ae14 in App::ObjectIdentifier::getPyValue(bool, bool*) const from /usr/lib/freecad/lib/libFreeCADApp.so+0x84
0000004  0x7f160fe04ca2 in App::VariableExpression::_getPyValue(int*) const from /usr/lib/freecad/lib/libFreeCADApp.so+0x62
0000005  0x7f160fdf3e2c in App::Expression::getPyValue(int, int*) const from /usr/lib/freecad/lib/libFreeCADApp.so+0x4c
0000006  0x7f160fdf4f62 in App::Expression::eval(int) const from /usr/lib/freecad/lib/libFreeCADApp.so+0x42
0000007  0x7f16105e2cfc in Gui::Dialog::DlgExpressionInput::textChanged(QString const&) from /usr/lib/freecad/lib/libFreeCADGui.so+0x1fc
0000008  0x7f160ec388e7 in QMetaObject::activate(QObject*, int, int, void**) from /lib/libQt5Core.so.5+0x777
0000009  0x7f160f15c963 in QLineEdit::textChanged(QString const&) from /lib/libQt5Widgets.so.5+0x33
0000010  /lib/libQt5Widgets.so.5(+0x29c662) [0x7f160f163662]
0000011  0x7f160ec388e7 in QMetaObject::activate(QObject*, int, int, void**) from /lib/libQt5Core.so.5+0x777
0000012  0x7f160f164276 in QWidgetLineControl::textChanged(QString const&) from /lib/libQt5Widgets.so.5+0x36
0000013  0x7f160f167710 in QWidgetLineControl::finishChange(int, bool, bool) from /lib/libQt5Widgets.so.5+0x2a0
0000014  0x7f160f16abaf in QWidgetLineControl::processKeyEvent(QKeyEvent*) from /lib/libQt5Widgets.so.5+0xebf
0000015  0x7f160f15caeb in QLineEdit::keyPressEvent(QKeyEvent*) from /lib/libQt5Widgets.so.5+0x1b
0000016  0x7f161053668f in Gui::ExpressionLineEdit::keyPressEvent(QKeyEvent*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x1f
0000017  0x7f160f060b88 in QWidget::event(QEvent*) from /lib/libQt5Widgets.so.5+0x258
0000018  0x7f160f162ebb in QLineEdit::event(QEvent*) from /lib/libQt5Widgets.so.5+0xab
0000019  0x7f160f01fda4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /lib/libQt5Widgets.so.5+0x84
0000020  0x7f160f02833c in QApplication::notify(QObject*, QEvent*) from /lib/libQt5Widgets.so.5+0x118c
0000021  0x7f1610539019 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x89
0000022  0x7f160ec0def9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /lib/libQt5Core.so.5+0x179
0000023  /lib/libQt5Widgets.so.5(+0x1b7b42) [0x7f160f07eb42]
0000024  0x7f160f01fda4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /lib/libQt5Widgets.so.5+0x84
0000025  0x7f160f0273c1 in QApplication::notify(QObject*, QEvent*) from /lib/libQt5Widgets.so.5+0x211
0000026  0x7f1610539019 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x89
0000027  0x7f160ec0def9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /lib/libQt5Core.so.5+0x179
0000028  0x7f160ce9a50d in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) from /lib/libQt5Gui.so.5+0x16d
0000029  0x7f160ce9f526 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) from /lib/libQt5Gui.so.5+0x116
0000030  0x7f160ce7a55c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /lib/libQt5Gui.so.5+0xbc
0000031  /lib/libQt5XcbQpa.so.5(+0x6db7c) [0x7f16088f2b7c]
0000032  /lib/libglib-2.0.so.0(g_main_context_dispatch+0x2bf) [0x7f160c2ca90f]
0000033  /lib/libglib-2.0.so.0(+0x6d869) [0x7f160c2cc869]
0000034  /lib/libglib-2.0.so.0(g_main_context_iteration+0x2e) [0x7f160c2cc8ae]
0000035  0x7f160ec63079 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /lib/libQt5Core.so.5+0x69
0000036  0x7f160ec0cabc in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /lib/libQt5Core.so.5+0x13c
0000037  0x7f160f21864e in QDialog::exec() from /lib/libQt5Widgets.so.5+0x1de
0000038  0x7f153a96cc92 in openEditDatumDialog(Sketcher::SketchObject*, int) from /usr/lib/freecad/lib/SketcherGui.so+0x422
#39  0x7f153a96d77f in finishDistanceConstraint(Gui::Command*, Sketcher::SketchObject*, bool) from /usr/lib/freecad/lib/SketcherGui.so+0x19f
#40  0x7f153a970f66 in CmdSketcherConstrainDistanceY::activated(int) from /usr/lib/freecad/lib/SketcherGui.so+0xb86
0000041  0x7f161056a30c in Gui::Command::invoke(int, Gui::Command::TriggerSource) from /usr/lib/freecad/lib/libFreeCADGui.so+0x36c
0000042  0x7f160ec388e7 in QMetaObject::activate(QObject*, int, int, void**) from /lib/libQt5Core.so.5+0x777
0000043  0x7f160f0195e3 in QAction::triggered(bool) from /lib/libQt5Widgets.so.5+0x43
0000044  0x7f160f01bcca in QAction::activate(QAction::ActionEvent) from /lib/libQt5Widgets.so.5+0xfa
0000045  0x7f160f01c5d5 in QAction::event(QEvent*) from /lib/libQt5Widgets.so.5+0x55
0000046  0x7f160f01fda4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /lib/libQt5Widgets.so.5+0x84
0000047  0x7f160f0273c1 in QApplication::notify(QObject*, QEvent*) from /lib/libQt5Widgets.so.5+0x211
0000048  0x7f1610539019 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x89
0000049  0x7f160ec0def9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /lib/libQt5Core.so.5+0x179
0000050  0x7f160cec8890 in QShortcutMap::dispatchEvent(QKeyEvent*) from /lib/libQt5Gui.so.5+0x110
0000051  0x7f160cec8973 in QShortcutMap::tryShortcut(QKeyEvent*) from /lib/libQt5Gui.so.5+0x63
0000052  0x7f160ce7dedc in QWindowSystemInterface::handleShortcutEvent(QWindow*, unsigned long, int, QFlags<Qt::KeyboardModifier>, unsigned int, unsigned int, unsigned int, QString const&m /lib/libQt5Gui.so.5+0x18c
0000053  0x7f160ce9a42e in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) from /lib/libQt5Gui.so.5+0x8e
0000054  0x7f160ce9f526 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) from /lib/libQt5Gui.so.5+0x116
0000055  0x7f160ce7a55c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /lib/libQt5Gui.so.5+0xbc
0000056  /lib/libQt5XcbQpa.so.5(+0x6db7c) [0x7f16088f2b7c]
0000057  /lib/libglib-2.0.so.0(g_main_context_dispatch+0x2bf) [0x7f160c2ca90f]
0000058  /lib/libglib-2.0.so.0(+0x6d869) [0x7f160c2cc869]
0000059  /lib/libglib-2.0.so.0(g_main_context_iteration+0x2e) [0x7f160c2cc8ae]
0000060  0x7f160ec63079 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /lib/libQt5Core.so.5+0x69
0000061  0x7f160ec0cabc in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /lib/libQt5Core.so.5+0x13c
0000062  0x7f160ec14c46 in QCoreApplication::exec() from /lib/libQt5Core.so.5+0x96
0000063  0x7f16104ba880 in Gui::Application::runApplication() from /usr/lib/freecad/lib/libFreeCADGui.so+0x1570
0000064  freecad(main+0x6ef) [0x55727def245f]
0000065  /lib/libc.so.6(__libc_start_main+0xf3) [0x7f160e646ce3]
0000066  freecad(_start+0x2e) [0x55727def277e]
Steps To Reproduce1. open TestPlate.FCStd
2. go to part design workbench
4. create sketch
5. draw circle somewhere
5. create vertical constraint between center and origin.
6. click on expression button
7. type in Sketch.Constraints.w
8. observe crash
Additional InformationOS: Arch Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18336 (Git)
Build type: Release
Branch: makepkg
Hash: 52d0f1db0905f11497241aa2ed35d5d990eda53f
Python version: 3.7.3
Qt version: 5.12.4
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
TagsNo tags attached.
FreeCAD Information

Relationships

duplicate of 0003379 assignedeivindkvedalen Expressions Certain identifiers (like h, rad) cannot be used as names for constraints for usage in expressions 
related to 0004003 new Spreadsheet Renaming spreadsheet no longer has any affect on field tags. 

Activities

dhka2

2019-06-20 13:03

reporter  

TestPlate.FCStd (32,769 bytes)

openBrain

2019-06-20 16:34

developer   ~0013279

@dhka2 : thanks a lot for reporting with valuable information.
However as requested in the bug reporting policy (in the giant yellow banner on top of this page, and in the "Read this before reporting" on the left), it is advised to first open a dedicated topic on the Help subforum. This will allow other forumers to confirm the issue and help finding the root cause. Once issue is eventually confirmed, forum thread & ticket can be crosslinked to ease bug fixing.
Thanks

openBrain

2019-06-20 16:44

developer   ~0013280

Looks to me as a duplicate of 0004003 thus of 0003379 as 'w' is unit symbol for Watt.
@dhka2 : according previous tickets, it should work with "Sketch.Constraints.<<w>>". Could you please confirm ?

dhka2

2019-06-20 18:06

reporter   ~0013281

However as requested in the bug reporting policy (in the giant yellow banner on top of this page, and in the "Read this before reporting" on the left), it is advised to first open a dedicated topic on the Help subforum. This will allow other forumers to confirm the issue and help finding the root cause. Once issue is eventually confirmed, forum thread & ticket can be crosslinked to ease bug fixing.

openBrain

The forum sticky suggests a forum post is only necessary if it is unclear if encountered behaviour is a bug or a featureTM. "2. If you are unsure, discuss the problem on the forum first. ". As a segmentation fault is always a bug i thought it not necessary. If the intent is to always have a forum post before a bug report this is a documentation bug.

Indeed this is related to 0004003 and 003379 however these bug reports do not state that a crash occurs. Indeed all reserved letters input into the expression window in this manner result in a crash.

openBrain

2019-06-20 19:08

developer   ~0013282

The forum sticky suggests a forum post is only necessary if it is unclear if encountered behaviour is a bug or a featureTM. "2. If you are unsure, discuss the problem on the forum first. ". If the intent is to always have a forum post before a bug report this is a documentation bug.

dhka2
Indeed a forum post is always expected. The flow diagram of the bug submission guidelines topic is clear about it. And you can see in the posts following the OP that there is a discussion to clarify also that in the text. :)

As a segmentation fault is always a bug i thought it not necessary.

dhka2
The reason for which a forum thread is asked is more than a bug can have external reason or specificity (OS, libraries, hardware, ...). This is what we try to identify in the forum so the ticket is as precise as possible. ;)

Just ways to improve your next bug reporting. ;)

Kunda1

2019-06-28 10:47

administrator   ~0013317

@eivindkvedalen care to take a look at this ?

ezzieyguywuf

2019-12-01 04:52

developer   ~0013853

I'm struggling to reproduce this: what is the "expression button" referenced in step 6?

Kunda1

2019-12-01 05:44

administrator   ~0013854

@ezzieyguywuf
I believe it's this: https://www.freecadweb.org/wiki/File:Sketcher_Expressions.png

mikeprice99

2020-07-02 11:54

reporter   ~0014611

Last edited: 2020-07-02 12:01

Just a few observations:
1/ A vertical constraint does not take a parameter, so no expression button is available. Did you mean vertical distance constraint?
2/ 'Sketch' in your sample file does not include a constraint called 'w' (Did you mean Spreadsheet.w )?
3/ If I use a vertical distance constraint and enter the value Sketch002.Constraints.Nw (which does exist!) it works.

So I guess either
a) the bug does not affect Windows
b) it has been fixed since revision 18336
c) it is particular to branch makepkg


My test environment:
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21769 (Git)
Build type: Release
Branch: master
Hash: 801bfe4ba5f0910e9b2885917c521ab7fd8e9020
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)

yorik

2022-03-03 13:55

administrator   ~0016784

This ticket has been migrated to GitHub as issue 5950.

Issue History

Date Modified Username Field Change
2019-06-20 13:03 dhka2 New Issue
2019-06-20 13:03 dhka2 File Added: TestPlate.FCStd
2019-06-20 16:34 openBrain Note Added: 0013279
2019-06-20 16:44 openBrain Note Added: 0013280
2019-06-20 16:45 openBrain Priority urgent => normal
2019-06-20 16:45 openBrain Status new => feedback
2019-06-20 16:45 openBrain Relationship added duplicate of 0003379
2019-06-20 18:06 dhka2 Note Added: 0013281
2019-06-20 18:06 dhka2 Status feedback => new
2019-06-20 19:08 openBrain Note Added: 0013282
2019-06-28 10:46 Kunda1 Relationship added related to 0004003
2019-06-28 10:47 Kunda1 Note Added: 0013317
2019-06-28 10:49 Kunda1 Status new => confirmed
2019-06-28 10:49 Kunda1 Project FreeCAD => Expressions
2019-12-01 04:52 ezzieyguywuf Note Added: 0013853
2019-12-01 05:44 Kunda1 Note Added: 0013854
2020-07-02 11:54 mikeprice99 Note Added: 0014611
2020-07-02 12:01 mikeprice99 Note Edited: 0014611
2021-02-06 06:30 abdullah Target Version => 0.20