Bug 353333

Summary: partitionmanager crashed on start
Product: [Applications] partitionmanager Reporter: Pavel ALexeev (aka Pahan-Hubbitus) <pahan>
Component: generalAssignee: Andrius Štikonas <andrius>
Status: RESOLVED FIXED    
Severity: crash CC: mustafa1024m, teo
Priority: NOR Keywords: drkonqi
Version First Reported In: 1.2.1   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Pavel ALexeev (aka Pahan-Hubbitus) 2015-09-29 18:49:08 UTC
Application: partitionmanager (1.2.1)

Qt Version: 5.5.0
Operating System: Linux 4.1.7-200.fc22.x86_64 x86_64
Distribution (Platform): Fedora RPMs

-- Information about the crash:
- What I was doing when the application crashed:

Just start newly installed application from official Fedora repos.

The crash can be reproduced every time.

-- Backtrace:
Application: Управление разделами KDE (partitionmanager), signal: Aborted
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f1de46778c0 (LWP 12781))]

Thread 3 (Thread 0x7f1dc68cd700 (LWP 12782)):
#0  0x00007f1dde65e2fd in poll () at /lib64/libc.so.6
#1  0x00007f1ddae98182 in _xcb_conn_wait () at /lib64/libxcb.so.1
#2  0x00007f1ddae99c77 in xcb_wait_for_event () at /lib64/libxcb.so.1
#3  0x00007f1dc8a5c999 in QXcbEventReader::run() () at /lib64/libQt5XcbQpa.so.5
#4  0x00007f1ddf26a54e in QThreadPrivate::start(void*) () at /lib64/libQt5Core.so.5
#5  0x00007f1ddbf7d555 in start_thread () at /lib64/libpthread.so.0
#6  0x00007f1dde669b9d in clone () at /lib64/libc.so.6

Thread 2 (Thread 0x7f1dbe782700 (LWP 12843)):
[KCrash Handler]
#5  0x00007f1dde59b9c8 in raise () at /lib64/libc.so.6
#6  0x00007f1dde59d65a in abort () at /lib64/libc.so.6
#7  0x00007f1ddeed5b4d in __gnu_cxx::__verbose_terminate_handler() () at /lib64/libstdc++.so.6
#8  0x00007f1ddeed3996 in  () at /lib64/libstdc++.so.6
#9  0x00007f1ddeed39e1 in  () at /lib64/libstdc++.so.6
#10 0x00007f1ddeed3bf9 in  () at /lib64/libstdc++.so.6
#11 0x00007f1ddf253bd2 in  () at /lib64/libQt5Core.so.5
#12 0x00007f1ddf2f9305 in QString::reallocData(unsigned int, bool) () at /lib64/libQt5Core.so.5
#13 0x00007f1ddf2f9b72 in QString::append(QString const&) () at /lib64/libQt5Core.so.5
#14 0x00007f1de41b4bfe in ExternalCommand::onReadOutput() () at /lib64/libpartitionmanagerprivate.so
#15 0x00007f1ddf47a15a in QMetaObject::activate(QObject*, int, int, void**) () at /lib64/libQt5Core.so.5
#16 0x00007f1ddf381e32 in QProcessPrivate::tryReadFromChannel(QProcessPrivate::Channel*) () at /lib64/libQt5Core.so.5
#17 0x00007f1ddf3e0ba5 in QProcessPrivate::waitForFinished(int) () at /lib64/libQt5Core.so.5
#18 0x00007f1ddf37b5df in QProcess::waitForFinished(int) () at /lib64/libQt5Core.so.5
#19 0x00007f1de41b6875 in ExternalCommand::waitFor(int) () at /lib64/libpartitionmanagerprivate.so
#20 0x00007f1de41b711a in ExternalCommand::run(int) () at /lib64/libpartitionmanagerprivate.so
#21 0x00007f1de41daba5 in FS::btrfs::readUsedCapacity(QString const&) const () at /lib64/libpartitionmanagerprivate.so
#22 0x00007f1dc568bb82 in LibPartedBackend::scanDevicePartitions(_PedDevice*, Device&, _PedDisk*) () at /usr/lib64/qt5/plugins/libpmlibpartedbackendplugin.so
#23 0x00007f1dc568c49f in LibPartedBackend::scanDevice(QString const&) () at /usr/lib64/qt5/plugins/libpmlibpartedbackendplugin.so
#24 0x00007f1dc568c9a7 in LibPartedBackend::scanDevices() () at /usr/lib64/qt5/plugins/libpmlibpartedbackendplugin.so
#25 0x00007f1de41ac61a in DeviceScanner::scan() () at /lib64/libpartitionmanagerprivate.so
#26 0x00007f1ddf26a54e in QThreadPrivate::start(void*) () at /lib64/libQt5Core.so.5
#27 0x00007f1ddbf7d555 in start_thread () at /lib64/libpthread.so.0
#28 0x00007f1dde669b9d in clone () at /lib64/libc.so.6

Thread 1 (Thread 0x7f1de46778c0 (LWP 12781)):
#0  0x00007f1dde65e2fd in poll () at /lib64/libc.so.6
#1  0x00007f1dda748dbc in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#2  0x00007f1dda748ecc in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#3  0x00007f1ddf4a1dab in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#4  0x00007f1ddf448daa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#5  0x00007f1ddf450e6c in QCoreApplication::exec() () at /lib64/libQt5Core.so.5
#6  0x00005555dca15167 in main ()

Reported using DrKonqi
Comment 1 Teo Mrnjavac 2016-02-18 11:49:19 UTC
This is also triggered in Calamares, it seems to be a KPMcore issue triggered by the presence of a Btrfs volume.
We got a full backtrace at https://calamares.io/bugs/browse/CAL-355
Comment 2 Andrius Štikonas 2016-02-18 13:44:04 UTC
Git commit 20bb8eba7ec9c57da4e24415e54a3b84909744c1 by Andrius Štikonas.
Committed on 18/02/2016 at 13:39.
Pushed by stikonas into branch 'master'.

Get btrfs used capacity from btrfs filesystem show --raw
It's output looks like:

Label: 'test'  uuid: d23f3138-c8ea-449e-9155-015ce4f6e2e6
        Total devices 1 FS bytes used 131072
        devid    1 size 981467136 used 252706816 path /dev/sdb1

FS bytes used number is actual data on btrfs volume. However,
to resize successfully we need to know actual space used by data
and metadata. That's why we read size from devid (i.e. 252706816).

Btrfs volumes can span over multiple devices, so we must make sure
that we are reading devid corresponding to the correct device node.

M  +2    -2    src/fs/btrfs.cpp

http://commits.kde.org/kpmcore/20bb8eba7ec9c57da4e24415e54a3b84909744c1
Comment 3 Andrius Štikonas 2016-02-18 13:58:45 UTC
*** Bug 351423 has been marked as a duplicate of this bug. ***