Bug 451572

Summary: Crash when closing main window while being prompted for root password
Product: [Applications] partitionmanager Reporter: Flupp <Flupp+bugs.kde.org>
Component: generalAssignee: Andrius Štikonas <andrius>
Status: RESOLVED FIXED    
Severity: crash Keywords: drkonqi
Priority: NOR    
Version First Reported In: 21.12.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Flupp 2022-03-16 13:30:50 UTC
Application: partitionmanager (21.12.3)

Qt Version: 5.15.3
Frameworks Version: 5.91.0
Operating System: Linux 5.16.14-arch1-1 x86_64
Windowing System: X11
Distribution: Arch Linux
DrKonqi: 5.24.3 [KCrashBackend]

-- Information about the crash:
When starting KDE Partition Manager as a regular user, it prompts for the root passwort. While the prompt is shown, the main window is blocked by a modal window with the title “Scanning devices …”. The modal window can be closed by pressing escape. Afterwards also the main window can be closed. Then, when closing the password prompt, another password prompt appears. After closing this one, another one appears, and so on. After closing several password prompts, KDE Partition Manager crashes.

Besides fixing the crash, I think KDE Partition Manager should not immediately ask for the root password again if the user just refused to enter it. It should be easily possible to leave the applicaion without providing the root password.

The crash can be reproduced every time.

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

[KCrash Handler]
#4  0x00007f0b2264af51 in QTreeWidget::columnCount() const () from /usr/lib/libQt5Widgets.so.5
#5  0x000055a6f38d6b2a in PartitionManagerWidget::loadConfig (this=0x55a6f4df2920) at /usr/src/debug/partitionmanager-21.12.3/src/gui/partitionmanagerwidget.h:121
#6  PartitionManagerWidget::init (ostack=<optimized out>, this=0x55a6f4df2920) at /usr/src/debug/partitionmanager-21.12.3/src/gui/partitionmanagerwidget.cpp:100
#7  MainWindow::init (this=0x55a6f4c51d10) at /usr/src/debug/partitionmanager-21.12.3/src/gui/mainwindow.cpp:133
#8  0x000055a6f38babdd in MainWindow::MainWindow (parent=0x0, this=0x55a6f4c51d10, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/partitionmanager-21.12.3/src/gui/mainwindow.cpp:103
#9  main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/partitionmanager-21.12.3/src/main.cpp:74
[Inferior 1 (process 134896) detached]

Possible duplicates by query: bug 291671, bug 271900, bug 266156.

Reported using DrKonqi
Comment 1 Andrius Štikonas 2022-03-16 13:38:05 UTC
This is partially fixed (it does not ask for password repeatedly).

Although there is still crash if you close the main window and then close polkit authentication dialog
Comment 2 Andrius Štikonas 2024-07-10 00:23:22 UTC
Crash is caused by event loop that we started here https://invent.kde.org/system/partitionmanager/-/blob/master/src/gui/mainwindow.cpp?ref_type=heads#L193


When MainWindow::closeEvent is called, we need to handle the case that polkit authorization might be in progress and quit that event loop first.
Comment 3 Andrius Štikonas 2024-07-10 18:08:26 UTC
Git commit 39c73d36eae90ccbe415c75ffb6e6846594bfaad by Andrius Štikonas.
Committed on 10/07/2024 at 18:06.
Pushed by stikonas into branch 'master'.

Fix crash when closing main window while prompted for root password.

M  +6    -5    src/gui/mainwindow.cpp
M  +1    -0    src/gui/mainwindow.h

https://invent.kde.org/system/partitionmanager/-/commit/39c73d36eae90ccbe415c75ffb6e6846594bfaad