Bug 452053 - Labplot crashes when importing CSV data
Summary: Labplot crashes when importing CSV data
Status: RESOLVED FIXED
Alias: None
Product: LabPlot2
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2022-03-29 20:37 UTC by Nicolas Fella
Modified: 2022-03-30 20:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.9
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Fella 2022-03-29 20:37:08 UTC
Application: labplot2 (2.9.0.beta)
 (Compiled from sources)
Qt Version: 5.15.3
Frameworks Version: 5.93.0
Operating System: Linux 5.14.21-2-MANJARO x86_64
Windowing System: Wayland
Distribution: Manjaro Linux
DrKonqi: 5.24.80 [KCrashBackend]

-- Information about the crash:
- What I was doing when the application crashed:
1. On an empty project 
2. Add New > Spreadsheet
3. Close Spreadsheet window
4. Right click on spreadsheet in project explorer, Import > From File
5. Select a CSV file
6. Click Ok

The crash can be reproduced every time.

-- Backtrace:
Application: LabPlot (labplot2), signal: Segmentation fault
Content of s_kcrashErrorMessage: {_M_t = {<std::__uniq_ptr_impl<char, std::default_delete<char []> >> = {_M_t = std::tuple containing = {[1] = 0x0, [2] = {<No data fields>}}}, <No data fields>}}
[KCrash Handler]
#5  AbstractAspect::children (this=0x0) at /home/nico/kde/src/labplot/src/backend/core/AbstractAspect.cpp:610
#6  AbstractAspect::children<Column> (this=0x0, flags=...) at /home/nico/kde/src/labplot/src/backend/core/AbstractAspect.h:291
#7  0x00005614ccbfec70 in Spreadsheet::rowCount (this=<optimized out>) at /home/nico/kde/src/labplot/src/backend/spreadsheet/Spreadsheet.cpp:158
#8  0x00005614ccc0f6f4 in SpreadsheetModel::suppressSignals (this=0x5614cf18fb20, value=value@entry=false) at /home/nico/kde/src/labplot/src/backend/spreadsheet/SpreadsheetModel.cpp:66
#9  0x00005614ccc0080f in Spreadsheet::finalizeImport (this=0x5614cef76550, columnOffset=2, startColumn=<optimized out>, endColumn=2, dateTimeFormat=..., importMode=AbstractFileFilter::ImportMode::Append) at /home/nico/kde/src/labplot/src/backend/spreadsheet/Spreadsheet.cpp:1126
#10 0x00005614ccb8db40 in AsciiFilterPrivate::readDataFromDevice (this=0x7f7f14008820, device=..., dataSource=0x5614cef76550, importMode=AbstractFileFilter::ImportMode::Append, lines=206) at /home/nico/kde/src/labplot/src/backend/datasources/filters/AsciiFilter.cpp:1331
#11 0x00005614ccb8dfe0 in AsciiFilterPrivate::readDataFromFile (this=0x7f7f14008820, fileName=..., dataSource=0x5614cef76550, importMode=AbstractFileFilter::ImportMode::Append) at /home/nico/kde/src/labplot/src/backend/datasources/filters/AsciiFilter.cpp:688
#12 0x00005614ccae8413 in ImportFileDialog::importTo (this=this@entry=0x5614ceff7970, statusBar=0x5614ce361360) at /home/nico/kde/src/labplot/src/kdefrontend/datasources/ImportFileDialog.cpp:208
#13 0x00005614ccabe034 in MainWin::importFileDialog (this=0x5614ce46dc30, fileName=...) at /home/nico/kde/src/labplot/src/kdefrontend/MainWin.cpp:2521
#14 0x00005614ccabe110 in operator() (__closure=<optimized out>, __closure=<optimized out>) at /home/nico/kde/src/labplot/src/kdefrontend/MainWin.cpp:1965
#15 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, MainWin::handleAspectAdded(const AbstractAspect*)::<lambda()> >::call (arg=<optimized out>, f=...) at /home/nico/kde/usr/include/QtCore/qobjectdefs_impl.h:146
#16 QtPrivate::Functor<MainWin::handleAspectAdded(const AbstractAspect*)::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...) at /home/nico/kde/usr/include/QtCore/qobjectdefs_impl.h:256
#17 QtPrivate::QFunctorSlotObject<MainWin::handleAspectAdded(const AbstractAspect*)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=<optimized out>, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /home/nico/kde/usr/include/QtCore/qobjectdefs_impl.h:443
#18 0x00007f7f2114c203 in QtPrivate::QSlotObjectBase::call (a=0x7ffd340e4950, r=0x5614ce46dc30, this=0x5614ce646150) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#19 doActivate<false> (sender=0x5614cef76550, signal_index=18, argv=0x7ffd340e4950) at kernel/qobject.cpp:3886
#20 0x00007f7f2114c203 in QtPrivate::QSlotObjectBase::call (a=0x7ffd340e4a80, r=0x5614cef76550, this=0x5614cf174c60) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#21 doActivate<false> (sender=0x5614cf191940, signal_index=4, argv=0x7ffd340e4a80) at kernel/qobject.cpp:3886
#22 0x00007f7f211456cf in QMetaObject::activate (sender=sender@entry=0x5614cf191940, m=m@entry=0x7f7f2230fc20 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffd340e4a80) at kernel/qobject.cpp:3946
#23 0x00007f7f21df1da2 in QAction::triggered (this=this@entry=0x5614cf191940, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#24 0x00007f7f21df49d4 in QAction::activate (this=0x5614cf191940, event=<optimized out>) at kernel/qaction.cpp:1161
#25 0x00007f7f21f78a82 in QMenuPrivate::activateCausedStack (this=this@entry=0x5614cf092a30, causedStack=..., action=action@entry=0x5614cf191940, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1384
#26 0x00007f7f21f80551 in QMenuPrivate::activateAction (this=0x5614cf092a30, action=0x5614cf191940, action_e=QAction::Trigger, self=<optimized out>) at widgets/qmenu.cpp:1461
#27 0x00007f7f21e3a60e in QWidget::event (this=0x5614cf31a900, event=0x7ffd340e5090) at kernel/qwidget.cpp:9033
#28 0x00007f7f21df869f in QApplicationPrivate::notify_helper (this=this@entry=0x5614ce2f2b70, receiver=receiver@entry=0x5614cf31a900, e=e@entry=0x7ffd340e5090) at kernel/qapplication.cpp:3637
#29 0x00007f7f21e002c4 in QApplication::notify (this=0x7ffd340e4db0, receiver=0x5614cf31a900, e=0x7ffd340e5090) at kernel/qapplication.cpp:3081
#30 0x00007f7f21115a0a in QCoreApplication::notifyInternal2 (receiver=0x5614cf31a900, event=0x7ffd340e5090) at kernel/qcoreapplication.cpp:1064
#31 0x00007f7f21dfedc3 in QApplicationPrivate::sendMouseEvent (receiver=0x5614cf31a900, event=event@entry=0x7ffd340e5090, alienWidget=0x0, nativeWidget=0x5614cf31a900, buttonDown=<optimized out>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at kernel/qapplication.cpp:2619
#32 0x00007f7f21e541c3 in QWidgetWindow::handleMouseEvent (this=0x5614cf27c7b0, event=0x7ffd340e5360) at kernel/qwidgetwindow.cpp:580
#33 0x00007f7f21e56925 in QWidgetWindow::event (this=0x5614cf27c7b0, event=0x7ffd340e5360) at kernel/qwidgetwindow.cpp:300
#34 0x00007f7f21df869f in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5614cf27c7b0, e=0x7ffd340e5360) at kernel/qapplication.cpp:3637
#35 0x00007f7f21115a0a in QCoreApplication::notifyInternal2 (receiver=0x5614cf27c7b0, event=0x7ffd340e5360) at kernel/qcoreapplication.cpp:1064
#36 0x00007f7f216e6427 in QGuiApplicationPrivate::processMouseEvent (e=0x7f7f14007460) at kernel/qguiapplication.cpp:2282
#37 0x00007f7f216bc2dc in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1169
#38 0x00007f7f1b155e30 in userEventSourceDispatch (source=<optimized out>) at qeventdispatcher_glib.cpp:74
#39 0x00007f7f1b6da163 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#40 0x00007f7f1b7309e9 in ?? () from /usr/lib/libglib-2.0.so.0
#41 0x00007f7f1b6d76c5 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#42 0x00007f7f2116d0c4 in QEventDispatcherGlib::processEvents (this=0x5614ce345100, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#43 0x00007f7f2111440b in QEventLoop::exec (this=this@entry=0x7ffd340e5700, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#44 0x00007f7f21f7e014 in QMenuPrivate::exec(QPoint const&, QAction*, std::function<QPoint (QSize const&)>) (this=0x5614cf07dd60, p=..., action=action@entry=0x0, positionFunction=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#45 0x00007f7f21f7e13f in QMenu::exec (this=this@entry=0x5614cf292260, p=..., action=action@entry=0x0) at widgets/qmenu.cpp:2687
#46 0x00005614ccdfed42 in ProjectExplorer::contextMenuEvent (this=0x5614ce6bd000, event=0x7ffd340e59c0) at /home/nico/kde/src/labplot/src/commonfrontend/ProjectExplorer.cpp:213
#47 0x00007f7f21e3a60e in QWidget::event (this=0x5614ce6bd000, event=0x7ffd340e59c0) at kernel/qwidget.cpp:9033
#48 0x00007f7f21df869f in QApplicationPrivate::notify_helper (this=this@entry=0x5614ce2f2b70, receiver=receiver@entry=0x5614ce6bd000, e=e@entry=0x7ffd340e59c0) at kernel/qapplication.cpp:3637
#49 0x00007f7f21dffbf4 in QApplication::notify (this=<optimized out>, receiver=0x5614ce85e2a0, e=0x7ffd340e5c10) at kernel/qapplication.cpp:3243
#50 0x00007f7f21115a0a in QCoreApplication::notifyInternal2 (receiver=0x5614ce85e2a0, event=0x7ffd340e5c10) at kernel/qcoreapplication.cpp:1064
#51 0x00007f7f21e53e24 in QWidgetWindow::handleMouseEvent (this=0x5614ce62a600, event=0x7ffd340e5f20) at kernel/qwidgetwindow.cpp:691
#52 0x00007f7f21e56925 in QWidgetWindow::event (this=0x5614ce62a600, event=0x7ffd340e5f20) at kernel/qwidgetwindow.cpp:300
#53 0x00007f7f21df869f in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5614ce62a600, e=0x7ffd340e5f20) at kernel/qapplication.cpp:3637
#54 0x00007f7f21115a0a in QCoreApplication::notifyInternal2 (receiver=0x5614ce62a600, event=0x7ffd340e5f20) at kernel/qcoreapplication.cpp:1064
#55 0x00007f7f216e6427 in QGuiApplicationPrivate::processMouseEvent (e=0x7f7f14006660) at kernel/qguiapplication.cpp:2282
#56 0x00007f7f216bc2dc in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1169
#57 0x00007f7f1b155e30 in userEventSourceDispatch (source=<optimized out>) at qeventdispatcher_glib.cpp:74
#58 0x00007f7f1b6da163 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#59 0x00007f7f1b7309e9 in ?? () from /usr/lib/libglib-2.0.so.0
#60 0x00007f7f1b6d76c5 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#61 0x00007f7f2116d0c4 in QEventDispatcherGlib::processEvents (this=0x5614ce345100, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#62 0x00007f7f2111440b in QEventLoop::exec (this=this@entry=0x7ffd340e62b0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#63 0x00007f7f2111c6e0 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#64 0x00007f7f216d9fbc in QGuiApplication::exec () at kernel/qguiapplication.cpp:1867
#65 0x00007f7f21df8615 in QApplication::exec () at kernel/qapplication.cpp:2829
#66 0x00005614ccab3129 in main (argc=<optimized out>, argv=<optimized out>) at /home/nico/kde/src/labplot/src/kdefrontend/LabPlot.cpp:229
[Inferior 1 (process 85812) detached]

Reported using DrKonqi
Comment 1 Alexander Semke 2022-03-30 19:02:20 UTC
Git commit d4c61765d657b6ad4dfc4db3c082a16e7cdb954d by Alexander Semke.
Committed on 30/03/2022 at 19:02.
Pushed by asemke into branch 'master'.

[spreadsheet] changed the ownership of SpreadsheetModel  -  make Spreadsheet owning it and not SpreadsheetView,  to make sure spreadsheet's children columns are not deleted when the view is closed and the model is deleted.
FIXED-IN: 2.9

M  +9    -3    src/backend/spreadsheet/Spreadsheet.cpp
M  +1    -2    src/backend/spreadsheet/Spreadsheet.h
M  +0    -2    src/backend/spreadsheet/SpreadsheetModel.cpp
M  +1    -2    src/commonfrontend/spreadsheet/SpreadsheetView.cpp

https://invent.kde.org/education/labplot/commit/d4c61765d657b6ad4dfc4db3c082a16e7cdb954d
Comment 2 Alexander Semke 2022-03-30 20:54:50 UTC
(In reply to Nicolas Fella from comment #0)
> Application: labplot2 (2.9.0.beta)
>  (Compiled from sources)
> Qt Version: 5.15.3
> Frameworks Version: 5.93.0
> Operating System: Linux 5.14.21-2-MANJARO x86_64
> Windowing System: Wayland
> Distribution: Manjaro Linux
> DrKonqi: 5.24.80 [KCrashBackend]
> 
> -- Information about the crash:
> - What I was doing when the application crashed:
> 1. On an empty project 
> 2. Add New > Spreadsheet
> 3. Close Spreadsheet window
> 4. Right click on spreadsheet in project explorer, Import > From File
> 5. Select a CSV file
> 6. Click Ok
> 
> The crash can be reproduced every time.
Thank you for trying out the beta and reporting bugs! I did a fix and it will be available in the next nightly build from us. You can safely install the nightly build now - it's more or less what was released as a beta recently plus some additional fixes that were done after that.