Bug 491133 - Powerdevil crashes inPowerDevil::Core::onKIdleTimeoutReached() once the screen poweroff timeout has been reached after manually powering off the display
Summary: Powerdevil crashes inPowerDevil::Core::onKIdleTimeoutReached() once the scree...
Status: RESOLVED DUPLICATE of bug 490421
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 6.1.3
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: wayland
Depends on:
Blocks:
 
Reported: 2024-08-01 16:44 UTC by MScattolin
Modified: 2024-08-01 18:32 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MScattolin 2024-08-01 16:44:27 UTC
Stack trace at the end, this happens on a desktop computer where the display can be individually powered off.
the crash, according to dr konqi, happens after the specified amount of inactivity time set on powerdevil's kcm, where the computer is idle and the monitor is powered off.

I can't really reproduce it every time, but this happened to me around 4 times in about a week

STEPS TO REPRODUCE
1. Turn off the display
2. Let the computer idling until the "Turn off screen" time has been reached

OBSERVED RESULT
Powerdevil crashes

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.10.1
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=11, no_tid=no_tid@entry=0)
    at pthread_kill.c:44
#1  0x00007b2e87ca5463 in __pthread_kill_internal (threadid=<optimized out>, signo=11) at pthread_kill.c:78
#2  0x00007b2e87c4c120 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
#3  0x00007b2e8942f643 in KCrash::defaultCrashHandler (sig=11) at /usr/src/debug/kcrash/kcrash-6.4.0/src/kcrash.cpp:597
#4  <signal handler called>
#5  0x0000000000000020 in ?? ()
#6  0x00007b2e893c0631 in PowerDevil::Core::onKIdleTimeoutReached (this=0x5aa46e92caa0, identifier=<optimized out>, 
    msec=<optimized out>) at /usr/src/debug/powerdevil/powerdevil-6.1.3/daemon/powerdevilcore.cpp:779
#7  0x00007b2e883a16f7 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, 
    this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:469
#8  doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4086
#9  0x00007b2e87a93679 in KIdleTime::timeoutReached (this=this@entry=0x5aa46ebfd180, _t1=<optimized out>, 
    _t2=<optimized out>, _t2@entry=300000)
    at /usr/src/debug/kidletime/build/src/KF6IdleTime_autogen/include/moc_kidletime.cpp:199
#10 0x00007b2e87a95aa3 in KIdleTimePrivate::timeoutReached (this=<optimized out>, msec=300000)
    at /usr/src/debug/kidletime/kidletime-6.4.0/src/kidletime.cpp:298
#11 operator() (__closure=<optimized out>, msec=300000) at /usr/src/debug/kidletime/kidletime-6.4.0/src/kidletime.cpp:88
#12 QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<int>, void, KIdleTime::KIdleTime()::<lambda(int)> >::call (f=..., arg=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:137
#13 QtPrivate::FunctorCallable<KIdleTime::KIdleTime()::<lambda(int)>, int>::call<QtPrivate::List<int>, void> (f=..., 
    arg=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:345
#14 QtPrivate::QCallableObject<KIdleTime::KIdleTime()::<lambda(int)>, QtPrivate::List<int>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=<optimized out>, r=<optimized out>, 
    a=<optimized out>, ret=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:555
#15 0x00007b2e883a16f7 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, 
    this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:469
#16 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4086
#17 0x00007b2e87a935c4 in KAbstractIdleTimePoller::timeoutReached (this=<optimized out>, _t1=<optimized out>)
    at /usr/src/debug/kidletime/build/src/KF6IdleTime_autogen/include/moc_kabstractidletimepoller_p.cpp:212
#18 0x00007b2e883a16f7 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, 
    this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:469
#19 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4086
#20 0x00007b2e85151596 in ffi_call_unix64 () at ../src/x86/unix64.S:104
#21 0x00007b2e8514e00e in ffi_call_int (cif=cif@entry=0x7fff923a4e80, fn=<optimized out>, rvalue=<optimized out>, 
    avalue=<optimized out>, closure=closure@entry=0x0) at ../src/x86/ffi64.c:673
#22 0x00007b2e85150bd3 in ffi_call (cif=cif@entry=0x7fff923a4e80, fn=<optimized out>, rvalue=rvalue@entry=0x0, 
    avalue=avalue@entry=0x7fff923a4f50) at ../src/x86/ffi64.c:710
#23 0x00007b2e85a7f860 in wl_closure_invoke (closure=closure@entry=0x7b2e70001530, target=<optimized out>, 
    target@entry=0x5aa46ebd6aa0, opcode=opcode@entry=0, data=<optimized out>, flags=1)
    at ../wayland-1.23.0/src/connection.c:1228
#24 0x00007b2e85a800d9 in dispatch_event (display=display@entry=0x5aa46e8f7e30, queue=queue@entry=0x5aa46e8f7f28)
    at ../wayland-1.23.0/src/wayland-client.c:1670
#25 0x00007b2e85a804f3 in dispatch_queue (display=0x5aa46e8f7e30, queue=0x5aa46e8f7f28)
    at ../wayland-1.23.0/src/wayland-client.c:1816
#26 wl_display_dispatch_queue_pending (display=0x5aa46e8f7e30, queue=0x5aa46e8f7f28)
    at ../wayland-1.23.0/src/wayland-client.c:2058
#27 0x00007b2e85aea0a6 in QtWaylandClient::QWaylandDisplay::flushRequests (this=<optimized out>)
    at /usr/src/debug/qt6-wayland/qtwayland/src/client/qwaylanddisplay.cpp:227
#28 0x00007b2e8838c00f in QObject::event (this=0x5aa46e8f7c00, e=0x7b2e70001620)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:1452
#29 0x00007b2e88344d28 in QCoreApplication::notifyInternal2 (receiver=0x5aa46e8f7c00, event=event@entry=0x7b2e70001620)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1142
#30 0x00007b2e883450eb in QCoreApplication::sendEvent (receiver=<optimized out>, event=0x7b2e70001620)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1583
#31 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x5aa46e8f15c0)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1940
#32 0x00007b2e885a49ec in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1797
#33 postEventSourceDispatch (s=0x5aa46e8f3bc0)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:244
#34 0x00007b2e8670eab9 in g_main_dispatch (context=0x7b2e78000f00) at ../glib/glib/gmain.c:3344
#35 0x00007b2e867709e7 in g_main_context_dispatch_unlocked (context=0x7b2e78000f00) at ../glib/glib/gmain.c:4152
#36 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7b2e78000f00, block=block@entry=1, 
    dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4217
#37 0x00007b2e8670dfc5 in g_main_context_iteration (context=0x7b2e78000f00, may_block=1) at ../glib/glib/gmain.c:4282
#38 0x00007b2e885a2cbd in QEventDispatcherGlib::processEvents (this=0x5aa46e8f4000, flags=...)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:394
#39 0x00007b2e8834f01e in QEventLoop::processEvents (this=0x7fff923a5550, flags=...)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:100
#40 QEventLoop::exec (this=0x7fff923a5550, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:182
#41 0x00007b2e8834934d in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qflags.h:74
#42 0x00005aa46d5be726 in main (argc=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/powerdevil/powerdevil-6.1.3/daemon/powerdevilapp.cpp:135
Comment 1 Nate Graham 2024-08-01 18:30:45 UTC
Crashing in this line of code:

> void Core::onKIdleTimeoutReached(int identifier, int msec)
> {
>     // Find which action(s) requested this idle timeout
>     for (auto i = m_registeredActionTimeouts.constBegin(), end = m_registeredActionTimeouts.constEnd(); i != end; ++i) {
>         if (i.value().contains(identifier)) {
>             i.key()->onIdleTimeout(std::chrono::milliseconds(msec)); <<<<<<<<<< HERE <<<<<<<<<<<<<<
> 
>             // And it will need to be awaken
>             m_pendingResumeFromIdleActions.insert(i.key());
>             break;
>         }
>     }
> 
>     // Catch the next resume event if some actions require it
>     if (!m_pendingResumeFromIdleActions.isEmpty()) {
>         KIdleTime::instance()->catchNextResumeEvent();
>     }
> }
Comment 2 Nate Graham 2024-08-01 18:32:20 UTC
Ah, it's already been fixed for Plasma 6.1.4!

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