Bug 469949 - kwin_wayland crashes randomly at pw_stream_queue_buffer()
Summary: kwin_wayland crashes randomly at pw_stream_queue_buffer()
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.27.4
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 467959 472827 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-05-18 13:49 UTC by grzegorz.halat
Modified: 2023-08-08 16:23 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 grzegorz.halat 2023-05-18 13:49:26 UTC
SUMMARY
kwin_wayland crashes randomly with the attached stack trace. I get this cash about once per week. The stack trace looks similar to bug 467959 but I'm not using OBS or any other screen recording software.

STEPS TO REPRODUCE
1. I don't know

OBSERVED RESULT

#0  0x00007f7ffafade69 in pw_stream_queue_buffer () at /lib64/libpipewire-0.3.so.0
#1  0x00005597826bcca0 in KWin::ScreenCastStream::enqueue() ()
#2  0x00007f7ffb2e8651 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5
#3  0x00007f7ffb2eb05d in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () at /lib64/libQt5Core.so.5
#4  0x00007f7ffb2eb8cb in QSocketNotifier::event(QEvent*) () at /lib64/libQt5Core.so.5
#5  0x00007f7ffa9aeb75 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#6  0x00007f7ffb2b3d48 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#7  0x00007f7ffb3039cf in QEventDispatcherUNIXPrivate::activateSocketNotifiers() () at /lib64/libQt5Core.so.5
#8  0x00007f7ffb303d50 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#9  0x0000559782778232 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
#10 0x00007f7ffb2b270b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#11 0x00007f7ffb2ba99b in QCoreApplication::exec() () at /lib64/libQt5Core.so.5
#12 0x0000559782692d64 in main ()


SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9

ADDITIONAL INFORMATION
Comment 1 grzegorz.halat 2023-05-18 15:19:23 UTC
(gdb) bt
#0  pw_stream_queue_buffer (stream=0x559786591870, buffer=0x559786591d00) at ../src/pipewire/stream.c:2354
#1  0x00005597826bcca0 in KWin::ScreenCastStream::enqueue() (this=0x5597864ef460) at /usr/src/debug/kwin-5.27.4.1-1.fc38.x86_64/src/plugins/screencast/screencaststream.cpp:653
#2  0x00007f7ffb2e8651 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fff38d5adb0, r=<optimized out>, this=0x55978636e2e0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#3  doActivate<false>(QObject*, int, void**) (sender=0x5597864aa9b0, signal_index=3, argv=0x7fff38d5adb0) at kernel/qobject.cpp:3923
#4  0x00007f7ffb2e34d7 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**)
    (sender=sender@entry=0x5597864aa9b0, m=m@entry=0x7f7ffb566420 <QSocketNotifier::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fff38d5adb0) at kernel/qobject.cpp:3983
#5  0x00007f7ffb2eb05d in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) (this=this@entry=0x5597864aa9b0, _t1=..., _t2=<optimized out>, _t3=...) at .moc/moc_qsocketnotifier.cpp:178
#6  0x00007f7ffb2eb8cb in QSocketNotifier::event(QEvent*) (this=0x5597864aa9b0, e=<optimized out>) at kernel/qsocketnotifier.cpp:302
#7  0x00007f7ffa9aeb75 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x5597864aa9b0, e=0x7fff38d5aec0) at kernel/qapplication.cpp:3640
#8  0x00007f7ffb2b3d48 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x5597864aa9b0, event=0x7fff38d5aec0) at kernel/qcoreapplication.cpp:1064
#9  0x00007f7ffb2b3f62 in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1462
#10 0x00007f7ffb3039cf in QEventDispatcherUNIXPrivate::activateSocketNotifiers() (this=this@entry=0x559784460a30) at kernel/qeventdispatcher_unix.cpp:304
#11 0x00007f7ffb303d50 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at kernel/qeventdispatcher_unix.cpp:511
#12 0x0000559782778232 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
#13 0x00007f7ffb2b270b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fff38d5b060, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#14 0x00007f7ffb2ba99b in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#15 0x00007f7ffb7606bd in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1863
#16 0x00007f7ffa9aeae9 in QApplication::exec() () at kernel/qapplication.cpp:2832
#17 0x0000559782692d64 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kwin-5.27.4.1-1.fc38.x86_64/src/main_wayland.cpp:628

(gdb) p *stream
$1 = {core = 0x5597865bd490, core_listener = {link = {next = 0x5597865bd4e8, prev = 0x5597861236d8}, cb = {funcs = 0x7f7ffaffc700 <core_events.lto_priv>, data = 0x559786591870}, removed = 0x0, priv = 0x0}, link = {
    next = 0x5597865bd5c8, prev = 0x5597865bd5c8}, name = 0x5597860e4fe0 "kwin-screencast-org.kde.konsole", properties = 0x5597863dbd80, node_id = 167, state = PW_STREAM_STATE_PAUSED, error = 0x0, listener_list = {list = {
      next = 0x5597864ef498, prev = 0x5597864ef498}}, proxy = 0x55978655bc20, proxy_listener = {link = {next = 0x55978655bc68, prev = 0x55978655bd60}, cb = {funcs = 0x7f7ffaffd1e0 <proxy_events>, data = 0x559786591870}, removed = 0x0, 
    priv = 0x0}, node_listener = {link = {next = 0x55978655a480, prev = 0x55978655bcf0}, cb = {funcs = 0x7f7ffaffd140 <node_events>, data = 0x559786591870}, removed = 0x0, priv = 0x0}, controls = {next = 0x559786591950, 
    prev = 0x559786591950}}

(gdb) list
2349            struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
2350            struct buffer *b = SPA_CONTAINER_OF(buffer, struct buffer, this);
2351            int res;
2352
2353            if (b->busy)
2354                    ATOMIC_DEC(b->busy->count);
2355
2356            pw_log_trace_fp("%p: queue buffer %d", stream, b->id);
2357            if ((res = queue_push(impl, &impl->queued, b)) < 0)
2358                    return res;

(gdb) p b->busy
$4 = (struct spa_meta_busy *) 0x7f7f8bb09240

(gdb) p b->busy->count
Cannot access memory at address 0x7f7f8bb09244

Maybe this is similar issue to https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3040
The status of stream passed to pw_stream_queue_buffer() is PW_STREAM_STATE_PAUSED
Comment 2 David Edmundson 2023-05-26 10:25:00 UTC
*** Bug 467959 has been marked as a duplicate of this bug. ***
Comment 3 Vlad Zahorodnii 2023-06-01 12:08:16 UTC
Should be fixed in 5.27.6. Reopen if it's still reproducible.
Comment 4 David Edmundson 2023-08-08 16:23:26 UTC
*** Bug 472827 has been marked as a duplicate of this bug. ***