Need help fixing a Seg Fault

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
kc
Reply | Threaded
Open this post in threaded view
|

Need help fixing a Seg Fault

kc
LibreCAD v2.2.1 - running under Ubuntu

I'm a new user of LibreCAD, and have immediately hit frustration at triggering a seg-fault and losing my work!

I've managed to reproduce the problem:
1. Draw a line
2. Select the "offset" tool
3. Double click the line to get it's properties
4. Press escape to close the properties
5. Double click the line again to get it's properties
6. Press escape again to close the properties.... and this is the step where things go bad.

I've managed to build a debug build and run it with valgrind to produce the following when you press escape the second time.

==3316157== Invalid read of size 8
==3316157==    at 0x490BCA: operator() (rs_actionmodifyentity.cpp:59)
==3316157==    by 0x490BCA: std::_Sp_counted_deleter<bool*, RS_ActionModifyEntity::trigger()::{lambda(bool*)#1}, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (shared_ptr_base.h:442)
==3316157==    by 0x490EEA: _M_release (shared_ptr_base.h:168)
==3316157==    by 0x490EEA: ~__shared_count (shared_ptr_base.h:705)
==3316157==    by 0x490EEA: ~__shared_ptr (shared_ptr_base.h:1154)
==3316157==    by 0x490EEA: ~shared_ptr (shared_ptr.h:122)
==3316157==    by 0x490EEA: RS_ActionModifyEntity::trigger() (rs_actionmodifyentity.cpp:86)
==3316157==    by 0x35282A: RS_EventHandler::mouseReleaseEvent(QMouseEvent*) (rs_eventhandler.cpp:167)
==3316157==    by 0x4E87BF: QG_GraphicView::mouseReleaseEvent(QMouseEvent*) (qg_graphicview.cpp:543)
==3316157==    by 0x4B014ED: QWidget::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x4ABE712: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x4AC6363: QApplication::notify(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x59ACE39: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3)
==3316157==    by 0x4AC4E46: QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x4B1AD3F: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x4B1DFD4: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x4ABE712: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==  Address 0xaa51120 is 176 bytes inside a block of size 184 free'd
==3316157==    at 0x484BB6F: operator delete(void*, unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==3316157==    by 0x3525C8: _M_release (shared_ptr_base.h:168)
==3316157==    by 0x3525C8: ~__shared_count (shared_ptr_base.h:705)
==3316157==    by 0x3525C8: ~__shared_ptr (shared_ptr_base.h:1154)
==3316157==    by 0x3525C8: ~shared_ptr (shared_ptr.h:122)
==3316157==    by 0x3525C8: node_destruct (qlist.h:481)
==3316157==    by 0x3525C8: erase (qlist.h:566)
==3316157==    by 0x3525C8: RS_EventHandler::cleanUp() (rs_eventhandler.cpp:618)
==3316157==    by 0x352F8C: RS_EventHandler::mouseEnterEvent() (rs_eventhandler.cpp:225)
==3316157==    by 0x4E5F59: QG_GraphicView::enterEvent(QEvent*) (qg_graphicview.cpp:706)
==3316157==    by 0x4B014ED: QWidget::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x4ABE712: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x59ACE39: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3)
==3316157==    by 0x4AC481B: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x4B198BF: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x4B1E058: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x4ABE712: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x59ACE39: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3)
==3316157==  Block was alloc'd at
==3316157==    at 0x4849013: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==3316157==    by 0x4E40E9: editAction (qg_graphicview.cpp:177)
==3316157==    by 0x4E40E9: (anonymous namespace)::launchEditProperty(QG_GraphicView&, RS_Entity*) (qg_graphicview.cpp:194)
==3316157==    by 0x4E85B3: showEntityPropertiesDialog (qg_graphicview.cpp:218)
==3316157==    by 0x4E85B3: QG_GraphicView::mouseDoubleClickEvent(QMouseEvent*) (qg_graphicview.cpp:474)
==3316157==    by 0x4B01E78: QWidget::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x4ABE712: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x4AC6363: QApplication::notify(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x59ACE39: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3)
==3316157==    by 0x4AC4E46: QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x4B1AD3F: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x4B1DFD4: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x4ABE712: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3)
==3316157==    by 0x59ACE39: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3)
==3316157== 

And at this point i'm a bit out of my depth - any help would be appreciated!
Reply | Threaded
Open this post in threaded view
|

Re: Need help fixing a Seg Fault

dxli
I added a fix to the 2.2.1 branch:

https://github.com/LibreCAD/LibreCAD/commit/399878877058cc75415c10256c06777f1f5a2e86

It appears that the snapcraft building is currently broken, so please build from source before snapcraft is fixed for the CI pipeline.

This is a serious and long existing bug, so a 2.2.1.1 bug fix release should be there quickly.
kc
Reply | Threaded
Open this post in threaded view
|

Re: Need help fixing a Seg Fault

kc
Brilliant! Many thanks - I've just tested it and it looks good!