Bug 439871 - Konsole crashes when calling KWindowEffects::enableBlurBehind() on a nullptr
Summary: Konsole crashes when calling KWindowEffects::enableBlurBehind() on a nullptr
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR crash
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords: drkonqi
: 440900 441045 441085 441149 441215 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-07-15 07:37 UTC by netizen
Modified: 2021-08-21 14:27 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In: 21.12


Attachments
New crash information added by DrKonqi (4.69 KB, text/plain)
2021-08-13 14:16 UTC, Nikita
Details

Note You need to log in before you can comment on or make changes to this bug.
Description netizen 2021-07-15 07:37:02 UTC
Application: konsole (21.07.80)

Qt Version: 5.15.3
Frameworks Version: 5.85.0
Operating System: Linux 5.8.0-59-generic x86_64
Windowing System: X11
Drkonqi Version: 5.22.3
Distribution: KDE neon Testing Edition

-- Information about the crash:
- What I was doing when the application crashed:

Trying to open konsole

- System info
Up to date KDE neon Testing Edition distribution
KDE Plasma 5.22.3
Linux kernel 5.8.0.59-generic 64 bit

The crash can be reproduced every time.

-- Backtrace:
Application: Konsole (konsole), signal: Segmentation fault

[New LWP 77662]
[New LWP 77663]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007fdea635aaff in __GI___poll (fds=0x7ffe2df5c8f8, nfds=1, timeout=1000) at ../sysdeps/unix/sysv/linux/poll.c:29
[Current thread is 1 (Thread 0x7fdea14489c0 (LWP 77661))]

Thread 3 (Thread 0x7fde9f10f700 (LWP 77663)):
#0  __GI___libc_read (nbytes=16, buf=0x7fde9f10e9a0, fd=7) at ../sysdeps/unix/sysv/linux/read.c:26
#1  __GI___libc_read (fd=7, buf=0x7fde9f10e9a0, nbytes=16) at ../sysdeps/unix/sysv/linux/read.c:24
#2  0x00007fdea4909b2f in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fdea48c0ebe in g_main_context_check () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fdea48c1312 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fdea48c14a3 in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007fdea6927fcb in QEventDispatcherGlib::processEvents (this=0x7fde90000b60, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#7  0x00007fdea68cc25b in QEventLoop::exec (this=this@entry=0x7fde9f10ebb0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#8  0x00007fdea66e5c22 in QThread::exec (this=<optimized out>) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#9  0x00007fdea576bf4b in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#10 0x00007fdea66e6dbc in QThreadPrivate::start (arg=0x7fdea57efd80) at thread/qthread_unix.cpp:329
#11 0x00007fdea5282609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#12 0x00007fdea6367293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7fdea03d8700 (LWP 77662)):
#0  0x00007fdea635aaff in __GI___poll (fds=0x7fdea03d7ae8, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fdea44bbc1a in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007fdea44bd90a in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007fdea0b15e58 in QXcbEventQueue::run (this=0x557ba4568720) at qxcbeventqueue.cpp:228
#4  0x00007fdea66e6dbc in QThreadPrivate::start (arg=0x557ba4568720) at thread/qthread_unix.cpp:329
#5  0x00007fdea5282609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007fdea6367293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7fdea14489c0 (LWP 77661)):
[KCrash Handler]
#4  0x00007fdea6d757d5 in qGetPtrHelper<QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > const> (ptr=...) at ../../include/QtCore/../../src/corelib/global/qglobal.h:1143
#5  QWindow::d_func (this=0x0) at ../../include/QtGui/../../src/gui/kernel/qwindow.h:98
#6  QWindow::winId (this=this@entry=0x0) at kernel/qwindow.cpp:663
#7  0x00007fdea5fd0943 in KWindowEffects::enableBlurBehind (window=0x0, enable=<optimized out>, region=...) at ./src/kwindoweffects.cpp:45
#8  0x00007fdea7ce54d3 in Konsole::MainWindow::setBlur (blur=true, this=0x557ba47a8e40) at ./src/MainWindow.cpp:892
#9  Konsole::MainWindow::setBlur (this=0x557ba47a8e40, blur=<optimized out>) at ./src/MainWindow.cpp:876
#10 0x00007fdea7ce8c52 in Konsole::MainWindow::activeViewChanged (controller=0x557ba471f850, this=0x557ba47a8e40) at /usr/include/c++/9/bits/atomic_base.h:413
#11 Konsole::MainWindow::activeViewChanged (this=0x557ba47a8e40, controller=0x557ba471f850) at ./src/MainWindow.cpp:243
#12 0x00007fdea690477e in QtPrivate::QSlotObjectBase::call (a=0x7ffe2df5d820, r=0x557ba47a8e40, this=0x557ba4822590) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#13 doActivate<false> (sender=0x557ba47f6d70, signal_index=5, argv=0x7ffe2df5d820) at kernel/qobject.cpp:3886
#14 0x00007fdea7b78216 in Konsole::ViewManager::activeViewChanged(Konsole::SessionController*) () from /usr/lib/x86_64-linux-gnu/libkonsoleprivate.so.21
#15 0x00007fdea7ba838b in Konsole::ViewManager::controllerChanged(Konsole::SessionController*) () from /usr/lib/x86_64-linux-gnu/libkonsoleprivate.so.21
#16 0x00007fdea7ba8717 in Konsole::ViewManager::createController(Konsole::Session*, Konsole::TerminalDisplay*) () from /usr/lib/x86_64-linux-gnu/libkonsoleprivate.so.21
#17 0x00007fdea7ba8aa5 in Konsole::ViewManager::createView(Konsole::Session*) () from /usr/lib/x86_64-linux-gnu/libkonsoleprivate.so.21
#18 0x00007fdea7ce7684 in Konsole::MainWindow::createSession (this=this@entry=0x557ba47a8e40, profile=..., directory=...) at ./src/MainWindow.cpp:533
#19 0x00007fdea7ce38dd in Konsole::Application::newInstance (this=0x7ffe2df5dbc0) at /usr/include/c++/9/bits/atomic_base.h:318
#20 0x0000557ba3c9918c in main (argc=<optimized out>, argv=<optimized out>) at ./src/main.cpp:204
[Inferior 1 (process 77661) detached]

Possible duplicates by query: bug 364342, bug 352712, bug 350766, bug 348685, bug 348623.

Reported using DrKonqi
Comment 1 netizen 2021-07-15 07:56:35 UTC
I can open it from an xterm as root, gathering more info now...
Comment 2 Ahmad Samir 2021-07-23 14:29:17 UTC
There is a proposed fix already https://invent.kde.org/utilities/konsole/-/merge_requests/439 (for some reason our scripts didn't update the bug report when the merge request was created).
Comment 3 Kurt Hindenburg 2021-07-23 16:07:14 UTC
Git commit a6b2bd539162b39191e827566b656bd97266ffad by Kurt Hindenburg, on behalf of Ahmad Samir.
Committed on 23/07/2021 at 16:06.
Pushed by hindenburg into branch 'master'.

Fix crash when setting blur effect

Basically to use QWidget::windowHandle() to get a QWindow*, we need to first
set the Qt::WA_NativeWindow attribute on the QWidget. See:
https://phabricator.kde.org/D23108
FIXED-IN: 21.12

M  +11   -1    src/MainWindow.cpp

https://invent.kde.org/utilities/konsole/commit/a6b2bd539162b39191e827566b656bd97266ffad
Comment 4 David Redondo 2021-08-13 11:09:35 UTC
*** Bug 440900 has been marked as a duplicate of this bug. ***
Comment 5 Andreas Sturmlechner 2021-08-13 12:19:23 UTC
What about 21.08 branch?
Comment 6 Nikita 2021-08-13 14:16:21 UTC
Created attachment 140692 [details]
New crash information added by DrKonqi

konsole (21.08.0) using Qt 5.15.3

- What I was doing when the application crashed:

I updated my system and i rebooted.
I will try reboot system again.

App write in console:

KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = konsole path = /usr/bin pid = 8439
KCrash: Arguments: /usr/bin/konsole 
KCrash: Attempting to start /usr/lib/x86_64-linux-gnu/libexec/drkonqi

It is OK when it run from root.

Another apps based on konsole(yakuake, kate, dolphin) work OK.

-- Backtrace (Reduced):
#4  0x00007fed5e9107d5 in QWindow::winId() const () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#5  0x00007fed5db6a943 in KWindowEffects::enableBlurBehind(QWindow*, bool, QRegion const&) () from /lib/x86_64-linux-gnu/libKF5WindowSystem.so.5
#6  0x00007fed5f8804d3 in Konsole::MainWindow::setBlur (blur=true, this=0x562e08ef8ec0) at ./src/MainWindow.cpp:892
#7  Konsole::MainWindow::setBlur (this=0x562e08ef8ec0, blur=<optimized out>) at ./src/MainWindow.cpp:876
#8  0x00007fed5f883c52 in Konsole::MainWindow::activeViewChanged (controller=0x562e090196c0, this=0x562e08ef8ec0) at /usr/include/c++/9/bits/atomic_base.h:413
Comment 7 Ahmad Samir 2021-08-13 15:20:15 UTC
Git commit f24dd6acc28393ba6f731be1360731c01a9a1ef0 by Ahmad Samir.
Committed on 13/08/2021 at 15:19.
Pushed by ahmadsamir into branch 'release/21.08'.

Fix crash when setting blur effect

Basically to use QWidget::windowHandle() to get a QWindow*, we need to first
set the Qt::WA_NativeWindow attribute on the QWidget. See:
https://phabricator.kde.org/D23108
FIXED-IN: 21.12
(cherry picked from commit a6b2bd539162b39191e827566b656bd97266ffad)

M  +11   -1    src/MainWindow.cpp

https://invent.kde.org/utilities/konsole/commit/f24dd6acc28393ba6f731be1360731c01a9a1ef0
Comment 8 Ahmad Samir 2021-08-20 12:35:54 UTC
*** Bug 441149 has been marked as a duplicate of this bug. ***
Comment 9 Ahmad Samir 2021-08-20 12:36:06 UTC
*** Bug 441215 has been marked as a duplicate of this bug. ***
Comment 10 Ahmad Samir 2021-08-20 22:09:45 UTC
*** Bug 441045 has been marked as a duplicate of this bug. ***
Comment 11 Ahmad Samir 2021-08-20 22:10:13 UTC
*** Bug 441085 has been marked as a duplicate of this bug. ***