<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>490356</bug_id>
          
          <creation_ts>2024-07-16 12:41:10 +0000</creation_ts>
          <short_desc>PowerDevil crash in Core::onResumingFromIdle()</short_desc>
          <delta_ts>2024-07-26 11:27:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>Powerdevil</product>
          <component>general</component>
          <version>6.1.2</version>
          <rep_platform>Fedora RPMs</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.kde.org/show_bug.cgi?id=490421</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>drkonqi</keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anton Valishin">anton</reporter>
          <assigned_to name="Plasma Bugs List">plasma-bugs-null</assigned_to>
          <cc>gufideg</cc>
    
    <cc>jpetso</cc>
    
    <cc>kde115599</cc>
    
    <cc>kevin.legouguec</cc>
    
    <cc>me</cc>
    
    <cc>naohoshino</cc>
    
    <cc>natalie_clarius</cc>
    
    <cc>nate</cc>
    
    <cc>stakanov</cc>
          
          <cf_commitlink>https://invent.kde.org/plasma/powerdevil/-/commit/8c1686c9e97edb9a06e06e2f41cfe5351cef7986</cf_commitlink>
          <cf_versionfixedin>6.1.4</cf_versionfixedin>
          <cf_sentryurl>https://crash-reports.kde.org/organizations/kde/issues/45975/events/306d328ccd7b474798db7503c975865d/</cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2337716</commentid>
    <comment_count>0</comment_count>
    <who name="Anton Valishin">anton</who>
    <bug_when>2024-07-16 12:41:10 +0000</bug_when>
    <thetext>Application: org_kde_powerdevil (6.1.2)

Qt Version: 6.7.2
Frameworks Version: 6.3.0
Operating System: Linux 6.9.8-200.fc40.x86_64 x86_64
Windowing System: Wayland
Distribution: &quot;Fedora Linux 40.20240715.0 (Kinoite)&quot;
DrKonqi: 6.1.2 [CoredumpBackend]

-- Information about the crash:
Power Manager crashed and reset monitor (DisplayPort) backlight to 0 (dpms)

The reporter is unsure if this crash is reproducible.

-- Backtrace:
Application: KDE Power Management System (org_kde_powerdevil), signal: Segmentation fault


This GDB supports auto-downloading debuginfo from the following URLs:
  &lt;https://debuginfod.fedoraproject.org/&gt;
Enable debuginfod for this session? (y or [n]) [answered N; input not from terminal]
Debuginfod has been disabled.
To make this setting permanent, add &apos;set debuginfod enabled off&apos; to .gdbinit.
[New LWP 2093]
[New LWP 2153]
[New LWP 2441]
[New LWP 2168]
[New LWP 2182]
[New LWP 2167]
[New LWP 2184]
[New LWP 2154]
[New LWP 2152]
[New LWP 2183]
[Thread debugging using libthread_db enabled]
Using host libthread_db library &quot;/lib64/libthread_db.so.1&quot;.
Core was generated by `/usr/libexec/org_kde_powerdevil&apos;.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f66b72a84a4 in __pthread_kill_implementation () from /lib64/libc.so.6
[Current thread is 1 (Thread 0x7f66afccc400 (LWP 2093))]
Cannot QML trace cores :(
[Current thread is 1 (Thread 0x7f66afccc400 (LWP 2093))]

Thread 10 (Thread 0x7f6683e006c0 (LWP 2183)):
#0  0x00007f66b731c67d in poll () from /lib64/libc.so.6
#1  0x00007f66b60bbc34 in g_main_context_iterate_unlocked.isra () from /lib64/libglib-2.0.so.0
#2  0x00007f66b605b383 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3  0x00007f66b605b3e1 in glib_worker_main () from /lib64/libglib-2.0.so.0
#4  0x00007f66b608a813 in g_thread_proxy () from /lib64/libglib-2.0.so.0
#5  0x00007f66b72a6507 in start_thread () from /lib64/libc.so.6
#6  0x00007f66b732a40c in clone3 () from /lib64/libc.so.6

Thread 9 (Thread 0x7f66a1e006c0 (LWP 2152)):
#0  0x00007f66b731c67d in poll () from /lib64/libc.so.6
#1  0x00007f66b60bbc34 in g_main_context_iterate_unlocked.isra () from /lib64/libglib-2.0.so.0
#2  0x00007f66b605b383 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3  0x00007f66b7c850a3 in QEventDispatcherGlib::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) () from /lib64/libQt6Core.so.6
#4  0x00007f66b79a3b03 in QEventLoop::exec(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) () from /lib64/libQt6Core.so.6
#5  0x00007f66b7ab7e4f in QThread::exec() () from /lib64/libQt6Core.so.6
#6  0x00007f66b8b6ae41 in QDBusConnectionManager::run() () from /lib64/libQt6DBus.so.6
#7  0x00007f66b7b5463c in QThreadPrivate::start(void*) () from /lib64/libQt6Core.so.6
#8  0x00007f66b72a6507 in start_thread () from /lib64/libc.so.6
#9  0x00007f66b732a40c in clone3 () from /lib64/libc.so.6

Thread 8 (Thread 0x7f66a0a006c0 (LWP 2154)):
#0  0x00007f66b731c67d in poll () from /lib64/libc.so.6
#1  0x00007f66b4eeedf5 in QtWaylandClient::EventThread::run() () from /lib64/libQt6WaylandClient.so.6
#2  0x00007f66b7b5463c in QThreadPrivate::start(void*) () from /lib64/libQt6Core.so.6
#3  0x00007f66b72a6507 in start_thread () from /lib64/libc.so.6
#4  0x00007f66b732a40c in clone3 () from /lib64/libc.so.6

Thread 7 (Thread 0x7f66834006c0 (LWP 2184)):
#0  0x00007f66b731c67d in poll () from /lib64/libc.so.6
#1  0x00007f66b60bbc34 in g_main_context_iterate_unlocked.isra () from /lib64/libglib-2.0.so.0
#2  0x00007f66b605ff37 in g_main_loop_run () from /lib64/libglib-2.0.so.0
#3  0x00007f66b0030682 in gdbus_shared_thread_func.lto_priv () from /lib64/libgio-2.0.so.0
#4  0x00007f66b608a813 in g_thread_proxy () from /lib64/libglib-2.0.so.0
#5  0x00007f66b72a6507 in start_thread () from /lib64/libc.so.6
#6  0x00007f66b732a40c in clone3 () from /lib64/libc.so.6

Thread 6 (Thread 0x7f66996006c0 (LWP 2167)):
#0  0x00007f66b72a2be9 in __futex_abstimed_wait_common () from /lib64/libc.so.6
#1  0x00007f66b72a5639 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libc.so.6
#2  0x00007f66998a7cfd in cnd_wait () from /usr/lib64/dri/iris_dri.so
#3  0x00007f6699884acb in util_queue_thread_func () from /usr/lib64/dri/iris_dri.so
#4  0x00007f66998a7c2c in impl_thrd_routine () from /usr/lib64/dri/iris_dri.so
#5  0x00007f66b72a6507 in start_thread () from /lib64/libc.so.6
#6  0x00007f66b732a40c in clone3 () from /lib64/libc.so.6

Thread 5 (Thread 0x7f6688c006c0 (LWP 2182)):
#0  0x00007f66b73281dd in syscall () from /lib64/libc.so.6
#1  0x00007f66b60b8ccd in g_cond_wait () from /lib64/libglib-2.0.so.0
#2  0x00007f66b602461b in g_async_queue_pop_intern_unlocked () from /lib64/libglib-2.0.so.0
#3  0x00007f66b608ba03 in g_thread_pool_spawn_thread () from /lib64/libglib-2.0.so.0
#4  0x00007f66b608a813 in g_thread_proxy () from /lib64/libglib-2.0.so.0
#5  0x00007f66b72a6507 in start_thread () from /lib64/libc.so.6
#6  0x00007f66b732a40c in clone3 () from /lib64/libc.so.6

Thread 4 (Thread 0x7f6698c006c0 (LWP 2168)):
#0  0x00007f66b72a2be9 in __futex_abstimed_wait_common () from /lib64/libc.so.6
#1  0x00007f66b72a5639 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libc.so.6
#2  0x00007f66998a7cfd in cnd_wait () from /usr/lib64/dri/iris_dri.so
#3  0x00007f6699884acb in util_queue_thread_func () from /usr/lib64/dri/iris_dri.so
#4  0x00007f66998a7c2c in impl_thrd_routine () from /usr/lib64/dri/iris_dri.so
#5  0x00007f66b72a6507 in start_thread () from /lib64/libc.so.6
#6  0x00007f66b732a40c in clone3 () from /lib64/libc.so.6

Thread 3 (Thread 0x7f6682a006c0 (LWP 2441)):
#0  0x00007f66b72f2a53 in clock_nanosleep@GLIBC_2.2.5 () from /lib64/libc.so.6
#1  0x00007f66b72fea87 in nanosleep () from /lib64/libc.so.6
#2  0x00007f66b7329f1a in usleep () from /lib64/libc.so.6
#3  0x00007f66b717396e in ddc_watch_displays_using_udev () from /lib64/libddcutil.so.5
#4  0x00007f66b608a813 in g_thread_proxy () from /lib64/libglib-2.0.so.0
#5  0x00007f66b72a6507 in start_thread () from /lib64/libc.so.6
#6  0x00007f66b732a40c in clone3 () from /lib64/libc.so.6

Thread 2 (Thread 0x7f66a14006c0 (LWP 2153)):
#0  0x00007f66b72a2be9 in __futex_abstimed_wait_common () from /lib64/libc.so.6
#1  0x00007f66b72a5639 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libc.so.6
#2  0x00007f66b7b60efb in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /lib64/libQt6Core.so.6
#3  0x00007f66b4eeed8e in QtWaylandClient::EventThread::run() () from /lib64/libQt6WaylandClient.so.6
#4  0x00007f66b7b5463c in QThreadPrivate::start(void*) () from /lib64/libQt6Core.so.6
#5  0x00007f66b72a6507 in start_thread () from /lib64/libc.so.6
#6  0x00007f66b732a40c in clone3 () from /lib64/libc.so.6

Thread 1 (Thread 0x7f66afccc400 (LWP 2093)):
[KCrash Handler]
#4  0x0000000000000000 in ?? ()
#5  0x00007f66b8eb70fa in PowerDevil::Core::onResumingFromIdle() () from /lib64/libpowerdevilcore.so.2
#6  0x00007f66b79fc872 in void doActivate&lt;false&gt;(QObject*, int, void**) () from /lib64/libQt6Core.so.6
#7  0x00007f66b7ee6b54 in QtPrivate::QCallableObject&lt;KIdleTime::KIdleTime()::{lambda()#1}, QtPrivate::List&lt;&gt;, void&gt;::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) () from /lib64/libKF6IdleTime.so.6
#8  0x00007f66b79fc872 in void doActivate&lt;false&gt;(QObject*, int, void**) () from /lib64/libQt6Core.so.6
#9  0x00007f66b79fc872 in void doActivate&lt;false&gt;(QObject*, int, void**) () from /lib64/libQt6Core.so.6
#10 0x00007f66b276c056 in ffi_call_unix64 () from /lib64/libffi.so.8
#11 0x00007f66b27686a0 in ffi_call_int.lto_priv () from /lib64/libffi.so.8
#12 0x00007f66b276b4ee in ffi_call () from /lib64/libffi.so.8
#13 0x00007f66b54bdf2e in wl_closure_invoke.constprop () from /lib64/libwayland-client.so.0
#14 0x00007f66b54be7a3 in dispatch_event.isra () from /lib64/libwayland-client.so.0
#15 0x00007f66b54bea4c in wl_display_dispatch_queue_pending () from /lib64/libwayland-client.so.0
#16 0x00007f66b4eeec52 in QtWaylandClient::QWaylandDisplay::flushRequests() () from /lib64/libQt6WaylandClient.so.6
#17 0x00007f66b79edd4b in QObject::event(QEvent*) () from /lib64/libQt6Core.so.6
#18 0x00007f66b7996dc8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt6Core.so.6
#19 0x00007f66b799ab91 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt6Core.so.6
#20 0x00007f66b7c858ef in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt6Core.so.6
#21 0x00007f66b6059e8c in g_main_context_dispatch_unlocked.lto_priv () from /lib64/libglib-2.0.so.0
#22 0x00007f66b60bbc98 in g_main_context_iterate_unlocked.isra () from /lib64/libglib-2.0.so.0
#23 0x00007f66b605b383 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#24 0x00007f66b7c850a3 in QEventDispatcherGlib::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) () from /lib64/libQt6Core.so.6
#25 0x00007f66b79a3b03 in QEventLoop::exec(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) () from /lib64/libQt6Core.so.6
#26 0x00007f66b799f9bc in QCoreApplication::exec() () from /lib64/libQt6Core.so.6
#27 0x0000555f2c24ee6c in main ()

Reported using DrKonqi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2337719</commentid>
    <comment_count>1</comment_count>
    <who name="Anton Valishin">anton</who>
    <bug_when>2024-07-16 12:42:25 +0000</bug_when>
    <thetext>It happened after waking up display from sleep mode</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2338204</commentid>
    <comment_count>2</comment_count>
    <who name="Jakob Petsovits">jpetso</who>
    <bug_when>2024-07-18 11:35:05 +0000</bug_when>
    <thetext>Likely also fixed by https://invent.kde.org/plasma/powerdevil/-/merge_requests/406, although the initial target of that fix was the backtrace of Bug 490421. Thanks for reporting!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2338207</commentid>
    <comment_count>3</comment_count>
    <who name="Jakob Petsovits">jpetso</who>
    <bug_when>2024-07-18 11:39:08 +0000</bug_when>
    <thetext>*** Bug 489923 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2338208</commentid>
    <comment_count>4</comment_count>
    <who name="Jakob Petsovits">jpetso</who>
    <bug_when>2024-07-18 11:41:40 +0000</bug_when>
    <thetext>Renaming from the original title &quot;Power Manager crashed and reset monitor (DisplayPort) backlight to 0 (dpms)&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2338317</commentid>
    <comment_count>5</comment_count>
    <who name="Jakob Petsovits">jpetso</who>
    <bug_when>2024-07-18 17:14:01 +0000</bug_when>
    <thetext>Git commit 7a929fa01ed036f60c5a15c72416b4e40eb03160 by Jakob Petsovits.
Committed on 18/07/2024 at 12:25.
Pushed by jpetso into branch &apos;master&apos;.

daemon: Don&apos;t leave dangling Action pointers in idle-time containers

If we delete the Action but don&apos;t clean up related map/set elements,
the powerdevil daemon can crash e.g. in Core::onResumingFromIdle()
and Core::onKIdleTimeoutReached().

This has been an issue since commit 584cfdf0 (or d91bc62f on 6.1)
which made it possible for already-created actions to get deleted
again at a later time.
Related: bug 490421

M  +10   -4    daemon/powerdevilcore.cpp

https://invent.kde.org/plasma/powerdevil/-/commit/7a929fa01ed036f60c5a15c72416b4e40eb03160</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2338320</commentid>
    <comment_count>6</comment_count>
    <who name="Jakob Petsovits">jpetso</who>
    <bug_when>2024-07-18 17:17:58 +0000</bug_when>
    <thetext>Git commit 8c1686c9e97edb9a06e06e2f41cfe5351cef7986 by Jakob Petsovits.
Committed on 18/07/2024 at 17:14.
Pushed by jpetso into branch &apos;Plasma/6.1&apos;.

daemon: Don&apos;t leave dangling Action pointers in idle-time containers

If we delete the Action but don&apos;t clean up related map/set elements,
the powerdevil daemon can crash e.g. in Core::onResumingFromIdle()
and Core::onKIdleTimeoutReached().

This has been an issue since commit 584cfdf0 (or d91bc62f on 6.1)
which made it possible for already-created actions to get deleted
again at a later time.
Related: bug 490421


(cherry picked from commit 7a929fa01ed036f60c5a15c72416b4e40eb03160)

Co-authored-by: Jakob Petsovits &lt;jpetso@petsovits.com&gt;

M  +10   -4    daemon/powerdevilcore.cpp

https://invent.kde.org/plasma/powerdevil/-/commit/8c1686c9e97edb9a06e06e2f41cfe5351cef7986</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2339101</commentid>
    <comment_count>7</comment_count>
    <who name="Jakob Petsovits">jpetso</who>
    <bug_when>2024-07-22 08:40:59 +0000</bug_when>
    <thetext>Sorry about the version tag, the fix didn&apos;t make it into Plasma 6.1.3 but instead will be in 6.1.4 initially.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2339737</commentid>
    <comment_count>8</comment_count>
    <who name="Jakob Petsovits">jpetso</who>
    <bug_when>2024-07-24 10:24:46 +0000</bug_when>
    <thetext>*** Bug 490508 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2340288</commentid>
    <comment_count>9</comment_count>
    <who name="Nicolas Fella">nicolas.fella</who>
    <bug_when>2024-07-26 11:26:46 +0000</bug_when>
    <thetext>*** Bug 490836 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2340290</commentid>
    <comment_count>10</comment_count>
    <who name="Nicolas Fella">nicolas.fella</who>
    <bug_when>2024-07-26 11:27:04 +0000</bug_when>
    <thetext>*** Bug 490841 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>