Bug 494869 - Passing certain arguments to `callDBus` crashes kwin
Summary: Passing certain arguments to `callDBus` crashes kwin
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: scripting (other bugs)
Version First Reported In: 6.2.1
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-16 13:54 UTC by Jin Liu
Modified: 2024-10-22 08:15 UTC (History)
3 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 Jin Liu 2024-10-16 13:54:46 UTC
STEPS TO REPRODUCE
1. `plasma-interactiveconsole --kwin`
2. enter `callDBus("receiver", "/path", "some.interface", "method", {"window": workspace.activeWindow});`
3. press "Execute"
4. kwin crashes

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.1
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.11.3-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 5600H with Radeon Graphics
Memory: 13.5 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Comment 1 Jin Liu 2024-10-16 13:55:49 UTC
Note: I know it is an invalid argument to `callDBus`.
Comment 2 David Edmundson 2024-10-16 13:59:43 UTC
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x0000760ab28a5463 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:78
#2  0x0000760ab284c120 in __GI_raise (sig=6) at ../sysdeps/posix/raise.c:26
#3  0x0000760ab7c5505c in KCrash::defaultCrashHandler (sig=6) at /home/david/projects/kde6/src/frameworks/kcrash/src/kcrash.cpp:596
#4  0x0000760ab284c1d0 in <signal handler called> () at /usr/lib/libc.so.6
#5  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#6  0x0000760ab28a5463 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:78
#7  0x0000760ab284c120 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x0000760ab28334c3 in __GI_abort () at abort.c:79
#9  0x0000760ab186d044 in _dbus_abort () at /usr/src/debug/dbus/dbus-1.14.10/dbus/dbus-sysdeps.c:101
#10 0x0000760ab18948eb in _dbus_warn_check_failed
    (format=0x760ab18a0080 "arguments to %s() were incorrect, assertion \"%s\" failed in file %s line %d.\nThis is normally a bug in some application using the D-Bus library.\n") at /usr/src/debug/dbus/dbus-1.14.10/dbus/dbus-internals.c:289
#11 0x0000760ab1883ca2 in dbus_message_new_method_call
    (destination=0x5cfd84a1b040 "receiver", path=0x5cfd84a9d270 "/path", iface=0x5cfd84a435e0 "some.interface", method=0x5cfd8448f750 "method")
    at /usr/src/debug/dbus/dbus-1.14.10/dbus/dbus-message.c:1375
#12 0x0000760ab35a0c65 in q_dbus_message_new_method_call
    (bus_name=0x5cfd84a1b040 "receiver", path=0x5cfd84a9d270 "/path", interface=0x5cfd84a435e0 "some.interface", method=0x760ab28a53f4 <__pthread_kill_implementation+276> "\211\303\367\333=") at /home/david/projects/kde6/src/qtbase/src/dbus/qdbus_symbols_p.h:353
#13 QDBusMessagePrivate::toDBusMessage (message=<optimized out>, capabilities=..., error=0x7fff3ff1f790)
    at /home/david/projects/kde6/src/qtbase/src/dbus/qdbusmessage.cpp:122
#14 0x0000760ab3588f2d in QDBusConnectionPrivate::sendWithReplyAsync
    (this=0x760a9c0016c0, message=..., receiver=<optimized out>, returnMethod=0x0, errorMethod=0x0, timeout=-1)
Comment 3 Jin Liu 2024-10-16 14:34:58 UTC
I can narrow it down to:

this crashes:

`callDBus("receiver", "/path", "some.interface", "method");`

this doesn't:

`callDBus("org.receiver", "/path", "some.interface", "method");`
Comment 4 Bug Janitor Service 2024-10-16 14:50:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6640
Comment 5 Jin Liu 2024-10-22 08:15:56 UTC
Fixed in upstream Qt dev and 6.8:
https://bugreports.qt.io/browse/QTBUG-130304