Bug 485862

Summary: Crash after opening PartitionManager twice during move
Product: [Applications] partitionmanager Reporter: max.beikirch
Component: generalAssignee: Andrius Štikonas <andrius>
Status: RESOLVED DUPLICATE    
Severity: crash Keywords: drkonqi
Priority: NOR    
Version: 23.08.1   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description max.beikirch 2024-04-20 20:13:35 UTC
Application: partitionmanager (23.08.1)

Qt Version: 5.15.10
Frameworks Version: 5.110.0
Operating System: Linux 6.5.0-28-generic x86_64
Windowing System: X11
Distribution: Ubuntu 23.10
DrKonqi: 5.27.8 [KCrashBackend]

-- Information about the crash:
This might be very specific, but I wanted to look something up on the partitions while an instance of Partition Manager, that was currently moving an ntfs partition to the left, was running.
So, I repeatedly pressed Shift and the Partition Manager icon on the taskbar to get another instance of Partition Manager. That's when the original instance crashed, giving the attached stack trace.
Luckily, `kpmcore_externalcommand` is still running - so I suppose I'm safe from losing data over this.

The reporter is unsure if this crash is reproducible.

-- Backtrace:
Application: KDE-Partitionsverwaltung (partitionmanager), signal: Segmentation fault

[KCrash Handler]
#4  0x00007ca39d9f4f95 in Partition::sectorsUsed() const () from /lib/x86_64-linux-gnu/libkpmcore.so.12
#5  0x00007ca39da2406d in PartWidget::paintEvent(QPaintEvent*) () from /lib/x86_64-linux-gnu/libkpmcore.so.12
#6  0x00007ca39cbaeb28 in QWidget::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#7  0x00007ca39cb6bc82 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#8  0x00007ca39becc7a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007ca39cba6c69 in QWidgetPrivate::sendPaintEvent(QRegion const&) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#10 0x00007ca39cba7579 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007ca39cba88d6 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#12 0x00007ca39cba71ef in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#13 0x00007ca39cba88d6 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007ca39cba8739 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007ca39cba71ef in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007ca39cba88d6 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#17 0x00007ca39cba8739 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007ca39cba8739 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007ca39cba8739 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#20 0x00007ca39cba8739 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007ca39cba8739 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007ca39cba8739 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007ca39cba8739 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007ca39cba8739 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#25 0x00007ca39cba8739 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#26 0x00007ca39cba71ef in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#27 0x00007ca39cb7d1c1 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#28 0x00007ca39cbaf1b6 in QWidget::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#29 0x00007ca39d92ca5d in KXmlGuiWindow::event(QEvent*) () from /lib/x86_64-linux-gnu/libKF5XmlGui.so.5
#30 0x00007ca39cb6bc82 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#31 0x00007ca39becc7a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#32 0x00007ca39becfeb1 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#33 0x00007ca39bf286f7 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#34 0x00007ca39b13fb2c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#35 0x00007ca39b19b46f in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#36 0x00007ca39b13dd20 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#37 0x00007ca39bf27daa in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#38 0x00007ca39becb15b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#39 0x00007ca39bed3904 in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#40 0x000061c6f398c5b3 in ?? ()
#41 0x00007ca39b428150 in __libc_start_call_main (main=main@entry=0x61c6f398b920, argc=argc@entry=1, argv=argv@entry=0x7ffd50fa90a8) at ../sysdeps/nptl/libc_start_call_main.h:58
#42 0x00007ca39b428209 in __libc_start_main_impl (main=0x61c6f398b920, argc=1, argv=0x7ffd50fa90a8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd50fa9098) at ../csu/libc-start.c:360
#43 0x000061c6f398fd95 in ?? ()
[Inferior 1 (process 2546) detached]

Reported using DrKonqi
Comment 1 Andrius Štikonas 2024-04-20 20:30:04 UTC
You shouldn't be able to start partitionmanager twice, second instance should exist almost immediately after it checks dbus interface...
Crash might be coincidence.  This backtrace looks like #441916 though I can't reliably reproduce it.

kpmcore_externalcommand should finish currently running command, so hopefully your file system is mostly fine. But keep in mind that it will not run any further commands, so after the move (depending on the direction, you might need to adjust partition boundaries).

Luckily your move is to the left. I think you'll end up with partition that is larger than file system. So nothing serious, since fs is aware of its own size.
=================================
|moved file system|end of the old data|
I think another resize would fix the problem...

Move is to the right would have been trickier...
========================
|old data|moved file system|
This would need to move beginning of partition to where moved file system is.

*** This bug has been marked as a duplicate of bug 441916 ***