CauldronDevelopmentLLC / CAMotics

Open-Source Simulation & Computer Aided Machining - A 3-axis CNC GCode simulator
Other
622 stars 143 forks source link

Starting camotics with no *.camotcis file available ends up with core dump. #375

Closed sergey-239 closed 2 years ago

sergey-239 commented 2 years ago

Steps to reproduce:

  1. ensure that there is no .camotics files could be found in examples nor in any other location.
  2. start the camotics

What happens: The app shows the dialog box to choose units and tool table for a new project, then after confirming selections it core dumped on assertion inside stl_vector

Stack trace:

#0  0x00007f02fa48ec4c in __pthread_kill_implementation () from /lib64/libc.so.6
#1  0x00007f02fa43e9c6 in raise () from /lib64/libc.so.6
#2  0x00007f02fa4287f4 in abort () from /lib64/libc.so.6
#3  0x00007f02ff4d7dd0 in std::__glibcxx_assert_fail(char const*, int, char const*, char const*) () from /lib64/libstdc++.so.6
#4  0x0000561e0e11940f in std::vector<float, std::allocator<float> >::operator[] (this=<optimized out>, __n=<optimized out>) at /usr/include/c++/12/bits/stl_vector.h:1142
#5  std::vector<float, std::allocator<float> >::operator[] (__n=<optimized out>, this=<optimized out>, this=<optimized out>, __n=<optimized out>) at /usr/include/c++/12/bits/stl_vector.h:1140
#6  CAMotics::Mesh::add (this=<optimized out>, vertices=..., normals=...) at src/camotics/view/Mesh.cpp:54
#7  0x0000561e0e0cd0e2 in std::function<void (std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&)>::operator()(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&) const (__args#1=..., __args#0=..., this=0x7ffc0d6bd2b0) at /usr/include/c++/12/bits/std_function.h:591
#8  CAMotics::TriangleSurface::getVertices(std::function<void (std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&)>) const (cb=..., this=<optimized out>)
    at src/camotics/contour/TriangleSurface.cpp:153
#9  CAMotics::View::updateModel (this=0x561e0ffada70) at src/camotics/view/View.cpp:255
#10 0x0000561e0e0cd3ed in CAMotics::View::glDraw (this=0x561e0ffada70) at src/camotics/view/View.cpp:328
#11 0x0000561e0e10002f in CAMotics::GLView::paintGL (this=<optimized out>) at src/camotics/qt/GLView.cpp:138
#12 0x00007f02fb810d05 in QOpenGLWidgetPrivate::invokeUserPaint() () from /lib64/libQt5Widgets.so.5
#13 0x00007f02fb7f1828 in QWidget::event(QEvent*) () from /lib64/libQt5Widgets.so.5
#14 0x00007f02fb7aed22 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#15 0x0000561e0e109f5c in CAMotics::QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=<optimized out>) at src/camotics/qt/QApplication.cpp:34
#16 0x00007f02faaa8218 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#17 0x00007f02fb7e9ac9 in QWidgetPrivate::sendPaintEvent(QRegion const&) () from /lib64/libQt5Widgets.so.5
#18 0x00007f02fb7ea811 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib64/libQt5Widgets.so.5
#19 0x00007f02fb7eb676 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /lib64/libQt5Widgets.so.5
#20 0x00007f02fb7e9d92 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib64/libQt5Widgets.so.5
#21 0x00007f02fb7eb676 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /lib64/libQt5Widgets.so.5
#22 0x00007f02fb7e9d92 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib64/libQt5Widgets.so.5
#23 0x00007f02fb7eb676 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /lib64/libQt5Widgets.so.5
#24 0x00007f02fb7e9d92 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib64/libQt5Widgets.so.5
#25 0x00007f02fb7eb676 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /lib64/libQt5Widgets.so.5
#26 0x00007f02fb7e9d92 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib64/libQt5Widgets.so.5
#27 0x00007f02fb7eb676 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /lib64/libQt5Widgets.so.5
#28 0x00007f02fb7e9d92 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib64/libQt5Widgets.so.5
#29 0x00007f02fb7eb676 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /lib64/libQt5Widgets.so.5
#30 0x00007f02fb7e9d92 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib64/libQt5Widgets.so.5
#31 0x00007f02fb7eb676 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /lib64/libQt5Widgets.so.5
#32 0x00007f02fb7e9d92 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib64/libQt5Widgets.so.5
#33 0x00007f02fb7c0115 in QWidgetRepaintManager::paintAndFlush() () from /lib64/libQt5Widgets.so.5
#34 0x00007f02fb7f1ae8 in QWidget::event(QEvent*) () from /lib64/libQt5Widgets.so.5
#35 0x00007f02fb7aed22 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#36 0x0000561e0e109f5c in CAMotics::QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=<optimized out>) at src/camotics/qt/QApplication.cpp:34
#37 0x00007f02faaa8218 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#38 0x00007f02faaab584 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt5Core.so.5
#39 0x00007f02faaf9457 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5Core.so.5
#40 0x00007f02f9273faf in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#41 0x00007f02f92c92c8 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#42 0x00007f02f9271940 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#43 0x00007f02faaf8f4a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#44 0x00007f02faaa6c6a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#45 0x00007f02faaaed32 in QCoreApplication::exec() () from /lib64/libQt5Core.so.5
--Type <RET> for more, q to quit, c to continue without paging--
#46 0x0000561e0e066fd6 in CAMotics::QtApp::run (this=0x7ffc0d6c0140) at src/camotics/qt/QtApp.cpp:131
#47 0x0000561e0e0671e7 in cb::doApplication<CAMotics::QtApp> (argc=1, argv=0x7ffc0d6c0718) at /builddir/build/BUILD/cbang-0d749646f2855e839ef22cd7fa16d8e5f8d62621/src/cbang/ApplicationMain.h:54
sergey-239 commented 2 years ago

The creation of the new project when camotics.camotics is available at its default location also leads to the core dump.

*********************************** CAMotics ***********************************
    Version: 1.2.2
     Author: Joseph Coffland <joseph@cauldrondevelopment.com>
        Org: Cauldron Development LLC
  Copyright: 2011-2019, Joseph Coffland
   Homepage: https://camotics.org/
    License: https://www.gnu.org/licenses/gpl-2.0.txt
       Date: Sep 13 2022
       Time: 22:17:33
   Compiler: GNU 12.2.1 20220819 (Red Hat 12.2.1-1)
    Options: -faligned-new -std=c++17 -fsigned-char -Wno-deprecated-declarations
             -g -Wall -fno-pie -O2 -flto=auto -ffat-lto-objects -fexceptions -g
             -grecord-gcc-switches -pipe -Wall -Werror=format-security
             -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
             -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
             -fstack-protector-strong
             -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
             -fasynchronous-unwind-tables -fstack-clash-protection
             -fcf-protection -Wno-deprecated-declarations -fPIC
   Platform: linux 5.19.6-200.fc36.x86_64
       Bits: 64
       Mode: Debug
************************************ CBang *************************************
       Date: Sep 13 2022
       Time: 00:00:00
   Compiler: GNU 12.2.1 20220819 (Red Hat 12.2.1-1)
    Options: -faligned-new -std=c++17 -fsigned-char -g -Wall -fno-pie -O2
             -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches
             -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
             -Wp,-D_GLIBCXX_ASSERTIONS
             -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
             -fstack-protector-strong
             -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
             -fasynchronous-unwind-tables -fstack-clash-protection
             -fcf-protection -Wno-deprecated-declarations -fPIC
   Platform: linux 5.19.6-200.fc36.x86_64
       Bits: 64
       Mode: Debug
************************************ System ************************************
        CPU: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
     CPU ID: GenuineIntel Family 6 Model 142 Stepping 9
       CPUs: 4
     Memory: 7.55GiB
Free Memory: 755.91MiB
    Threads: POSIX_THREADS
 OS Version: 5.19
Has Battery: true
 On Battery: false
 UTC Offset: 3
        PID: 574098
        CWD: /var/lib/mock/fedora-36-x86_64/root/builddir/build/BUILD/CAMotics-1a5cbe93e3d6711744ba733101f13418d9006cf7
       Exec: /var/lib/mock/fedora-36-x86_64/root/builddir/build/BUILD/CAMotics-1a5cbe93e3d6711744ba733101f13418d9006cf7/camotics
        DPI: 96
********************************************************************************
DEBUG(1):Loading machine Yohudi from /var/lib/mock/fedora-36-x86_64/root/builddir/build/BUILD/CAMotics-1a5cbe93e3d6711744ba733101f13418d9006cf7/machines/yohudi.json
DEBUG(1):Loading machine Taig Mini Mill from /var/lib/mock/fedora-36-x86_64/root/builddir/build/BUILD/CAMotics-1a5cbe93e3d6711744ba733101f13418d9006cf7/machines/taig.json
Opening /var/lib/mock/fedora-36-x86_64/root/builddir/build/BUILD/CAMotics-1a5cbe93e3d6711744ba733101f13418d9006cf7/examples/camotics/camotics.camotics
GCode::Tool Path bounds ((0,0,-1.5), (119.349,16.163,3)) dimensions (119.349,16.163,4.5)
Computing surface at 3 mins 01 secs
DEBUG(1):Times: start=0.00 secs end=3 mins 01 secs duration=3 mins 01 secs
DEBUG(1):GCode::Moves: first=0 last=372
DEBUG(1):AABBTree boxes=754 height=14
DEBUG(1):Partitioned in to 16 jobs
Computing surface bounded by ((-3.2375,-3.175,-3.1625), (122.237,18.175,0.1625)) at 0.175 grid resolution
DEBUG(1):Render time 1.23 secs
Time: 1.43 secs Triangles: 521484 Triangles/sec: 363964.49
Computing surface at 3 mins 01 secs
DEBUG(1):Times: start=3 mins 01 secs end=3 mins 01 secs duration=0.00 secs
DEBUG(1):GCode::Moves: first=372 last=372
DEBUG(1):AABBTree boxes=2 height=2
DEBUG(1):Partitioned in to 0 jobs
Computing surface bounded by ((-3.2375,-3.175,-3.1625), (122.237,18.175,0.1625)) at 0.175 grid resolution
DEBUG(1):Render time 0.00 secs
Time: 0.12 secs Triangles: 521484 Triangles/sec: 4446405.44
New project
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 835, resource id: 10701167, major code: 40 (TranslateCoords), minor code: 0
Computing surface at 0.00 secs
DEBUG(1):AABBTree boxes=0 height=1
WARNING:Empty workpiece, nothing to simulate
DEBUG(1):Render time 0.00 secs
Time: 0.00 secs Triangles: 0 Triangles/sec: 0.00
/usr/include/c++/12/bits/stl_vector.h:1142: std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = float; _Alloc = std::allocator<float>; const_reference = const float&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Aborted (core dumped)