Bug 485407

Summary: polkit-kde-agent crashes with nullptr in PolicyKitListener::finishObtainPrivilege() when run in Hyprland
Product: [Plasma] policykit-kde-agent-1 Reporter: jorgylbrandon
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: VERIFIED FIXED    
Severity: crash CC: continue2015, drf, fabian.arndt, hetlachendevosje, hunterofgypsy, jgrulich, jreznik, krinpaus, MatthewMoore757, nate, norbert.pfeiler+bugs.kde.org, s_chriscollins, typingcat
Priority: NOR    
Version: master   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=485937
Latest Commit: Version Fixed In: 6.0.5
Attachments: GDB log
GDB attachment as html

Description jorgylbrandon 2024-04-12 01:24:19 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY
The daemon launches and runs like expected but then silently crashes. The daemon isn't running in the background because ```appFilePath points to nullptr!```. I don't know what it means but it happens every time like clock work on both of my systems.

STEPS TO REPRODUCE
1. have it get executed during startup
2. launch an application with elevated privileges
3. launch a second application and see it not launch or show a banner across the top.

OBSERVED RESULT
the daemon runs once and silently closes in the background.

EXPECTED RESULT
The daemon runs every time there is a requested privalage escalation.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Hyprland / archlinux - 6.8.4-zen1-1-zen
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: qt6-wayland-6.7.0-1

ADDITIONAL INFORMATION
```[lee@Monolith ~]$ /usr/lib/polkit-kde-authentication-agent-1
New PolkitAgentListener  0x5bf069048780
Adding new listener  PolkitQt1::Agent::Listener(0x746b20008f90) for  0x5bf069048780
Listener online
Authentication agent result: true
Listener adapter polkit_qt_listener_initiate_authentication
GSimpleAsyncResult: 0x5bf06917c410
polkit_qt_listener_initiate_authentication callback for  0x5bf069048780
Initiating authentication
Action description has been found
kf.kirigami.platform: Failed to find a Kirigami platform plugin for style "Fusion"
User:  "unix-user:lee"
Trying again
REQUEST
Request:  "Password: "
Dialog accepted
COMPLETED
Completed:  true
Finishing obtaining privileges
Listener adapter polkit_qt_listener_initiate_authentication_finish
polkit_qt_listener_initiate_authentication_finish callback for  0x5bf069048780
Finish obtain authorization: true
Dialog cancelled
Finishing obtaining privileges
KCrash: appFilePath points to nullptr!
KCrash: Application '<unknown>' crashing... crashRecursionCounter = 2
Segmentation fault ```
Comment 1 hunterofgypsy 2024-04-17 04:38:56 UTC
I'm having the same issue. Polkit keeps crashing. I can run 

$ /usr/lib/polkit-kde-authentication-agent-1

it will allow one authentication and then crash

this is what the crash says:

$ /usr/lib/polkit-kde-authentication-agent-1
New PolkitAgentListener  0x5741f2fdc720
Adding new listener  PolkitQt1::Agent::Listener(0x5741f30612d0) for  0x5741f2fdc720
Listener online
Authentication agent result: true
Listener adapter polkit_qt_listener_initiate_authentication
GSimpleAsyncResult: 0x5741f2ff63d0
polkit_qt_listener_initiate_authentication callback for  0x5741f2fdc720
Initiating authentication
Action description has been found
User:  "unix-user:user"
Trying again
REQUEST
Request:  "Password: "
qrc:/qt/qml/org/kde/desktop/private/TextFieldContextMenu.qml:235:5: QML MenuItem: Binding loop detected for property "implicitWidth"
Dialog accepted
COMPLETED
Completed:  true
Finishing obtaining privileges
Listener adapter polkit_qt_listener_initiate_authentication_finish
polkit_qt_listener_initiate_authentication_finish callback for  0x5741f2fdc720
Finish obtain authorization: true
Dialog cancelled
Finishing obtaining privileges
KCrash: appFilePath points to nullptr!
KCrash: Application '<unknown>' crashing... crashRecursionCounter = 2
Segmentation fault
Comment 2 hunterofgypsy 2024-04-17 04:41:31 UTC
Furthermore, I have downgraded polkit to 6.0.0 and 6.0.1 and the behavior is identical, so there is some other package causing this.

This is on Artix Linux
Comment 3 continue2015 2024-04-17 14:12:41 UTC
I can confirm this bug in my computers running Hyprland(Arch Linux) and KDE Plasma(Arch Linux), and my friend's computer running KDE Plasma(Arch Linux). 
When using Hyprland, '/usr/lib/polkit-kde-authentication-agent-1' is start manually, and it failed with SIGSEGV after the first authentication, no matter the authentication itself is successful or not.
On Plasma it does fail, but silently, because in Plasma, polkit-kde-authentication-agent-1 is started by user service 'plasma-polkit-agent.service', and the service itself configured as 'Restart=on-failure', so the problem can be ignored.

I downloaded debug symbols and debugged with gdb, here is what I found.

Thread 1 "polkit-kde-auth" received signal SIGSEGV, Segmentation fault.
QObject::deleteLater (this=0x0)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0/src/corelib/kernel/qobject.cpp:2456
2456	       Q_D(QObject);
(gdb) c
Continuing.

Thread 1 "polkit-kde-auth" received signal SIGSEGV, Segmentation fault.
0x0000722e4fcab32c in ?? () from /usr/lib/libc.so.6
(gdb) c

It seems that the problem is caused by qt 6.7.0 but not polkit-kde-agent, since the process failed in the function 'QObject::deleteLater()' when accessing a nullptr, and this code belongs to qt6-base but not the polkit component.

Further more, I found in qt 6.7.0, the commit https://github.com/qt/qtbase/commit/d50746e changed the way the 'QObject::deleteLater()' function works, so it might be a bug upstream caused by qt 6.7.0.
Comment 4 continue2015 2024-04-17 15:01:53 UTC
Workaround: For Arch Linux Users, downgrading to qt6-base 6.7.0beta3 can solve this problem. The problem appeared since qt6-base 6.7.0-rc1. I saw the latest commit added some code to avoid nullptr, and it might be fixed, we can just wait for the latest release of qt.
Comment 5 Matthew Moore 2024-04-19 02:05:01 UTC
I am having this problem, but on only one of my computers. I'm running Arch Linux on both machines, both have the same version of the qtbase, and the same version of polkit-kde-agent. They are basically two identical installations. Same package set, Same versions, Even the same theme and wallpaper. Two almost identical installations. The only real difference between these machines is, one is an Intel Laptop, and the other is an AMD Gaming PC. The AMD system has no problem. But the Intel system fails every single time. I can manually start /usr/lib/polkit-kde-authentication-agent-1 from a terminal. The moment i use it, it will authenticate once, and then crash.  The output it exactly as others have posted (See below).  Why it works on my AMD system, and Not my Intel system, is a bit strange. I would be curious how many people reporting this bug are on Intel systems vs AMD. That could be valuable information. 

$ /usr/lib/polkit-kde-authentication-agent-1
New PolkitAgentListener  0x5741f2fdc720
Adding new listener  PolkitQt1::Agent::Listener(0x5741f30612d0) for  0x5741f2fdc720
Listener online
Authentication agent result: true
Listener adapter polkit_qt_listener_initiate_authentication
GSimpleAsyncResult: 0x5741f2ff63d0
polkit_qt_listener_initiate_authentication callback for  0x5741f2fdc720
Initiating authentication
Action description has been found
User:  "unix-user:user"
Trying again
REQUEST
Request:  "Password: "
qrc:/qt/qml/org/kde/desktop/private/TextFieldContextMenu.qml:235:5: QML MenuItem: Binding loop detected for property "implicitWidth"
Dialog accepted
COMPLETED
Completed:  true
Finishing obtaining privileges
Listener adapter polkit_qt_listener_initiate_authentication_finish
polkit_qt_listener_initiate_authentication_finish callback for  0x5741f2fdc720
Finish obtain authorization: true
Dialog cancelled
Finishing obtaining privileges
KCrash: appFilePath points to nullptr!
KCrash: Application '<unknown>' crashing... crashRecursionCounter = 2
Segmentation fault
Comment 6 hunterofgypsy 2024-04-19 02:11:49 UTC
(In reply to Matthew Moore from comment #5)
> I am having this problem, but on only one of my computers. I'm running Arch
> Linux on both machines, both have the same version of the qtbase, and the
> same version of polkit-kde-agent. They are basically two identical
> installations. Same package set, Same versions, Even the same theme and
> wallpaper. Two almost identical installations. The only real difference
> between these machines is, one is an Intel Laptop, and the other is an AMD
> Gaming PC. The AMD system has no problem. But the Intel system fails every
> single time. I can manually start /usr/lib/polkit-kde-authentication-agent-1
> from a terminal. The moment i use it, it will authenticate once, and then
> crash.  The output it exactly as others have posted (See below).  Why it
> works on my AMD system, and Not my Intel system, is a bit strange. I would
> be curious how many people reporting this bug are on Intel systems vs AMD.
> That could be valuable information. 
> 
> $ /usr/lib/polkit-kde-authentication-agent-1
> New PolkitAgentListener  0x5741f2fdc720
> Adding new listener  PolkitQt1::Agent::Listener(0x5741f30612d0) for 
> 0x5741f2fdc720
> Listener online
> Authentication agent result: true
> Listener adapter polkit_qt_listener_initiate_authentication
> GSimpleAsyncResult: 0x5741f2ff63d0
> polkit_qt_listener_initiate_authentication callback for  0x5741f2fdc720
> Initiating authentication
> Action description has been found
> User:  "unix-user:user"
> Trying again
> REQUEST
> Request:  "Password: "
> qrc:/qt/qml/org/kde/desktop/private/TextFieldContextMenu.qml:235:5: QML
> MenuItem: Binding loop detected for property "implicitWidth"
> Dialog accepted
> COMPLETED
> Completed:  true
> Finishing obtaining privileges
> Listener adapter polkit_qt_listener_initiate_authentication_finish
> polkit_qt_listener_initiate_authentication_finish callback for 
> 0x5741f2fdc720
> Finish obtain authorization: true
> Dialog cancelled
> Finishing obtaining privileges
> KCrash: appFilePath points to nullptr!
> KCrash: Application '<unknown>' crashing... crashRecursionCounter = 2
> Segmentation fault

I'm on AMD/AMD, so that's not it. The guy above says downgrading QT-BASE to beta3 will resolve. I aliased /usr/lib/polkit-kde-authentication-agent-1 as polkitty as a workaround for the time being.
Comment 8 Fabian Arndt 2024-05-02 01:59:09 UTC
Please have a look at bug 485937.
Can  somebody check if the QT style is overridden or if forcing it to fusion fixes the issue?
Comment 9 jorgylbrandon 2024-05-02 22:07:31 UTC
Created attachment 169118 [details]
GDB log

This is my best attempt of a back trace, I hope it's useful.
Comment 10 jorgylbrandon 2024-05-02 22:08:52 UTC
This is my best attempt getting a backtrace. I hope you find this useful.
Comment 11 vosjedev 2024-05-13 15:21:11 UTC
Created attachment 169441 [details]
GDB attachment as html

I added my GDB log as well, but as html exported from konsole, so the colors are preserved and the file is less messy (does not contain progress bars etc ;D)
Comment 12 Nate Graham 2024-05-14 23:39:02 UTC
Thanks, pasting it inline:

Thread 1 "polkit-kde-auth" received signal SIGSEGV, Segmentation fault.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=11, no_tid=no_tid@entry=0) at pthread_kill.c:44

                                                                                                         
44	      return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=11, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff52ac203 in __pthread_kill_internal (signo=11, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007ffff5258d70 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff7ea845f in KCrash::defaultCrashHandler (sig=11) at /usr/src/debug/kcrash/kcrash-6.1.0/src/kcrash.cpp:593
#4  0x00007ffff5258e20 in <signal handler called> () at /usr/lib/libc.so.6
#5  QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::get (this=0x8, this=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/tools/qscopedpointer.h:110
#6  qGetPtrHelper<QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > > (ptr=..., ptr=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qtclasshelpermacros.h:79
#7  QObject::d_func (this=0x0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.h:107
#8  QObject::deleteLater (this=0x0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:2456
#9  0x000055555555d6e8 in PolicyKitListener::finishObtainPrivilege (this=0x7fffec009010) at /usr/src/debug/polkit-kde-agent/polkit-kde-agent-1-6.0.4/policykitlistener.cpp:205
#10 0x00007ffff599797b in doActivate<false> (sender=0x5555556a1180, signal_index=4, argv=0x7fffffffb2e8) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4090
#11 0x00007ffff599797b in doActivate<false> (sender=0x5555555b1d90, signal_index=79, argv=0x7fffffffb910) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4090
#12 0x00007ffff7351ca0 in QQmlVMEMetaObject::metaCall (this=0x555555949d30, o=<optimized out>, c=QMetaObject::InvokeMetaMethod, _id=122, a=0x7fffffffb910) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/qml/qqmlvmemetaobject.cpp:1121
#13 0x00007ffff72d57f4 in QQmlObjectOrGadget::metacall (this=0x7fffffffbb80, type=QMetaObject::InvokeMetaMethod, index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/qml/qqmlobjectorgadget.cpp:14
#14 0x00007ffff71bd114 in QV4::CallMethod (callType=QMetaObject::InvokeMetaMethod, callArgs=<optimized out>, engine=0x555555620b30, argTypes=0x0, argCount=0, returnType=..., index=<optimized out>, object=...) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/jsruntime/qv4qobjectwrapper.cpp:1663
#15 QV4::CallPrecise (object=..., data=<optimized out>, engine=<optimized out>, engine@entry=0x555555620b30, callArgs=<optimized out>, callArgs@entry=0x7fffe81bf580, callType=callType@entry=QMetaObject::InvokeMetaMethod) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/jsruntime/qv4qobjectwrapper.cpp:1956
#16 0x00007ffff71c0e29 in operator() (__closure=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/jsruntime/qv4qobjectwrapper.cpp:2924
#17 operator()<QV4::QObjectMethod::callInternal(const QV4::Value*, const QV4::Value*, int) const::<lambda()> > (call=<optimized out>, __closure=<synthetic pointer>) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/jsruntime/qv4qobjectwrapper.cpp:2901
#18 QV4::QObjectMethod::callInternal (this=0x7fffffffbc90, thisObject=<optimized out>, argv=0x7fffe81bf500, argc=0) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/jsruntime/qv4qobjectwrapper.cpp:2924
#19 0x00007ffff7208ae3 in QV4::Moth::VME::interpret (frame=0x7fffffffc040, engine=0x555555620b30, code=0x555555781380 "P\025\031\367\377\177") at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/jsruntime/qv4vme_moth.cpp:798
#20 0x00007ffff720c1c4 in QV4::Moth::VME::exec (frame=<optimized out>, engine=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/jsruntime/qv4vme_moth.cpp:487
#21 0x00007ffff71751fe in QV4::doCall (self=<optimized out>, thisObject=thisObject@entry=0x555555761370, argv=<optimized out>, argc=<optimized out>, context=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/jsruntime/qv4function.cpp:54
#22 0x00007ffff7179b2c in QV4::Function::call (this=this@entry=0x555555761370, thisObject=0x555555761370, argv=argv@entry=0x7fffe81bf4f0, argc=argc@entry=1, context=context@entry=0x7fffebe46bb0) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/jsruntime/qv4function.cpp:79
#23 0x00007ffff7179e16 in operator() (argc=1, argv=0x7fffe81bf4f0, thisObject=<optimized out>, __closure=<synthetic pointer>) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/jsruntime/qv4function.cpp:30
#24 QV4::convertAndCall<QV4::Function::call(QObject*, void**, const QMetaType*, int, QV4::ExecutionContext*)::<lambda(const QV4::Value*, const QV4::Value*, int)> > (call=..., argc=1, types=0x7fffffffc318, a=0x7fffffffde00, thisObject=0x5555555b1d90, engine=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/jsruntime/qv4jscall_p.h:194
#25 QV4::Function::call (this=0x555555761370, thisObject=0x5555555b1d90, a=0x7fffffffde00, types=0x7fffffffc318, argc=1, context=0x7fffebe46bb0) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/jsruntime/qv4function.cpp:27
#26 0x00007ffff72a2917 in QQmlJavaScriptExpression::evaluate (this=<optimized out>, a=<optimized out>, types=<optimized out>, argc=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/qml/qqmljavascriptexpression_p.h:248
#27 0x00007ffff7252a81 in QQmlBoundSignalExpression::evaluate (this=this@entry=0x555555a2dc80, a=a@entry=0x7fffffffde00) at /usr/include/qt6/QtCore/qvarlengtharray.h:85
#28 0x00007ffff72576eb in QQmlBoundSignal_callback (a=0x7fffffffde00, e=0x555555a2db40) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/qml/ftw/qqmlrefcount_p.h:73
#29 QQmlBoundSignal_callback (e=0x555555a2db40, a=0x7fffffffde00) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/qml/qqmlboundsignal.cpp:293
#30 0x00007ffff72c2ad7 in QQmlNotifier::emitNotify (endpoint=<optimized out>, a=0x7fffffffde00) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0/src/qml/qml/qqmlnotifier.cpp:70
#31 0x00007ffff59974aa in doActivate<false> (sender=0x5555555b1d90, signal_index=41, argv=0x7fffffffde00) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:3970
#32 0x00007ffff784f954 in QQuickWindowQmlImpl::visibleChanged (this=<optimized out>, _t1=<optimized out>) at /usr/src/debug/qt6-declarative/build/src/quick/Quick_autogen/include/moc_qquickwindowmodule_p.cpp:390
#33 0x00007ffff5997679 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffdf30, r=0x5555555b1d90, this=0x555555937e10, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:469
#34 doActivate<false> (sender=0x5555555b1d90, signal_index=15, argv=0x7fffffffdf30) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4078
#35 0x00007ffff5fcc66e in QWindow::visibleChanged (_t1=false, this=0x5555555b1d90) at /usr/src/debug/qt6-base/build/src/gui/Gui_autogen/include/moc_qwindow.cpp:901
#36 QWindowPrivate::setVisible (this=0x55555568cd60, visible=false) at /usr/src/debug/qt6-base/qtbase/src/gui/kernel/qwindow.cpp:349
#37 0x00007ffff5988454 in QObject::event (this=0x5555555b1d90, e=0x7fffdc007c90) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:1446
#38 0x00007ffff68fbfcb in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5555555b1d90, e=0x7fffdc007c90) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3287
#39 0x00007ffff593db38 in QCoreApplication::notifyInternal2 (receiver=0x5555555b1d90, event=event@entry=0x7fffdc007c90) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1134
#40 0x00007ffff593dec4 in QCoreApplication::sendEvent (event=0x7fffdc007c90, receiver=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1575
#41 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x55555559f520) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1932
#42 0x00007ffff5b860f4 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1789
#43 postEventSourceDispatch (s=0x5555555cf7c0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:244
#44 0x00007ffff570d199 in g_main_dispatch (context=0x7fffec000f00) at ../glib/glib/gmain.c:3344
#45 0x00007ffff576c3bf in g_main_context_dispatch_unlocked (context=0x7fffec000f00) at ../glib/glib/gmain.c:4152
#46 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7fffec000f00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4217
#47 0x00007ffff570c712 in g_main_context_iteration (context=0x7fffec000f00, may_block=1) at ../glib/glib/gmain.c:4282
#48 0x00007ffff5b83e04 in QEventDispatcherGlib::processEvents (this=0x5555555a1af0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:394
#49 0x00007ffff5945cce in QEventLoop::processEvents (flags=..., this=0x7fffffffe3c0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:100
#50 QEventLoop::exec (this=0x7fffffffe3c0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:182
#51 0x00007ffff5941738 in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qflags.h:74
#52 0x00007ffff68f851a in QApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2555
#53 0x000055555555b74a in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/polkit-kde-agent/polkit-kde-agent-1-6.0.4/main.cpp:80
Comment 13 Bug Janitor Service 2024-05-14 23:50:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/polkit-kde-agent-1/-/merge_requests/41
Comment 14 Nate Graham 2024-05-14 23:50:43 UTC
It would be lovely if anyone affected could test that ^^
Comment 15 Nate Graham 2024-05-15 13:02:27 UTC
Git commit de434550e7c41ac685e42b35b9d076a6948e7bc2 by Nate Graham.
Committed on 14/05/2024 at 23:43.
Pushed by ngraham into branch 'master'.

Fix crash on hyprland

In policykitlistener.cpp, we check to see if m_session is null.
Regardless of whether it was or wasn't, we later call
m_session.data()->deleteLater(), which explodes if it was.

Only do this if it was not null.
FIXED-IN: 6.1

M  +1    -1    policykitlistener.cpp

https://invent.kde.org/plasma/polkit-kde-agent-1/-/commit/de434550e7c41ac685e42b35b9d076a6948e7bc2
Comment 16 Nate Graham 2024-05-15 13:04:58 UTC
Git commit 4d480a9f86421613242f3064ef1b92c2c57530d5 by Nate Graham.
Committed on 15/05/2024 at 13:03.
Pushed by ngraham into branch 'Plasma/6.0'.

Fix crash on hyprland

In policykitlistener.cpp, we check to see if m_session is null.
Regardless of whether it was or wasn't, we later call
m_session.data()->deleteLater(), which explodes if it was.

Only do this if it was not null.
FIXED-IN: 6.1


(cherry picked from commit de434550e7c41ac685e42b35b9d076a6948e7bc2)

M  +1    -1    policykitlistener.cpp

https://invent.kde.org/plasma/polkit-kde-agent-1/-/commit/4d480a9f86421613242f3064ef1b92c2c57530d5
Comment 17 vosjedev 2024-05-15 14:54:25 UTC
I tested the latest git  commit (using the aur `-git` package which just downloads the latest commit using git) and can confirm it now works.

It was a hell to install due to all the `-git` dependencies that needed to be downloaded, but it works.
I am now going to revert those versions to their non-git variants and await the release of the next version, thanks for fixing I guess.
Comment 18 Nate Graham 2024-05-15 15:03:18 UTC
Excellent, thanks for testing!

It'll be released with Plasma 6.0.5 in about a week.
Comment 19 vosjedev 2024-05-15 15:06:08 UTC
Ah, as I am on hyprland (and my pinetab running kde broke) I don't follow the releases that much. I do use as much kde/Qt software as possible though. I guess when it is out I will see the update appear on pacman I guess.
Comment 20 Sin Jeong-hun 2024-05-17 01:45:22 UTC
I think "Hyperland" is not related. I am using Plasma X11 (version 6.0.4), and it happens, too. Took me hours to find out this is a bug, because I thought it was a problem of polkit rules and tried modifying rules.
Comment 21 S. Christian Collins 2024-05-17 06:03:08 UTC
(In reply to Sin Jeong-hun from comment #20)
> I think "Hyperland" is not related. I am using Plasma X11 (version 6.0.4),
> and it happens, too. Took me hours to find out this is a bug, because I
> thought it was a problem of polkit rules and tried modifying rules.

Yeah, I experience this bug as described by the OP under KDE neon User Edition on my two native installs (my two VirtualBox installs are unaffected). I can only assume it's the same cause, but I guess I'll find out once 6.0.5 is released.