Bug 397266

Summary: Kate crashed after switching tabs on Wayland
Product: [Applications] kate Reporter: Alexander Mentyu <notuxius>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: awilfox, sandy.8925
Priority: NOR Keywords: drkonqi
Version: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.50
Sentry Crash Report:

Description Alexander Mentyu 2018-08-08 10:09:08 UTC
Application: kate (18.11.70)

Qt Version: 5.11.1
Frameworks Version: 5.49.0
Operating System: Linux 4.15.0-29-generic x86_64
Distribution: KDE neon Developer Edition

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

Was using Kate with multiple tabs opened, upon activity in the editor - switching tabs AFAIR - Kate crashed

-- Backtrace:
Application: Kate (kate), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f2c91589900 (LWP 2455))]

Thread 2 (Thread 0x7f2c767ec700 (LWP 2458)):
#0  0x00007f2c8bc0874d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007f2c85e5138c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f2c85e5149c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f2c8c8290bb in QEventDispatcherGlib::processEvents (this=0x7f2c700008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#4  0x00007f2c8c7d05ba in QEventLoop::exec (this=this@entry=0x7f2c767ebc80, flags=..., flags@entry=...) at kernel/qeventloop.cpp:214
#5  0x00007f2c8c6055e4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:525
#6  0x00007f2c8cc70f35 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#7  0x00007f2c8c610727 in QThreadPrivate::start (arg=0x7f2c8cee9d60) at thread/qthread_unix.cpp:367
#8  0x00007f2c87aa06ba in start_thread (arg=0x7f2c767ec700) at pthread_create.c:333
#9  0x00007f2c8bc1441d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7f2c91589900 (LWP 2455)):
[KCrash Handler]
#6  0x00007f2c8bed1db8 in main_arena () from /lib/x86_64-linux-gnu/libc.so.6
#7  0x00007f2c8d4fd5fc in QWindowPrivate::setVisible (this=0x2a569e0, visible=visible@entry=false) at kernel/qwindow.cpp:401
#8  0x00007f2c8dd540bd in QWidgetWindow::setNativeWindowVisibility (this=this@entry=0x2a5e060, visible=visible@entry=false) at kernel/qwidgetwindow.cpp:205
#9  0x00007f2c8dd2ed3a in QWidgetPrivate::hide_sys (this=this@entry=0x2afc080) at kernel/qwidget.cpp:8240
#10 0x00007f2c8dd3662d in QWidgetPrivate::hide_helper (this=this@entry=0x2afc080) at kernel/qwidget.cpp:8168
#11 0x00007f2c8dd3b428 in QWidget::setVisible (this=0x2518b40, visible=<optimized out>) at kernel/qwidget.cpp:8370
#12 0x00007f2c8dd369c8 in QWidgetPrivate::close_helper (this=0x2afc080, mode=QWidgetPrivate::CloseNoEvent) at kernel/qwidget.cpp:8499
#13 0x00007f2c8dd36f70 in QWidget::~QWidget (this=0x2518b40, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1635
#14 0x00007f2c9106f0f1 in KateTextPreview::~KateTextPreview (this=0x2518b40, __in_chrg=<optimized out>) at /workspace/build/src/view/katetextpreview.cpp:43
#15 KateTextPreview::~KateTextPreview (this=0x2518b40, __in_chrg=<optimized out>) at /workspace/build/src/view/katetextpreview.cpp:45
#16 0x00007f2c9105fb58 in KateScrollBar::showTextPreview (this=0x26df290) at /workspace/build/src/view/kateviewhelpers.cpp:455
#17 0x00007f2c9106be48 in KateScrollBar::mouseMoveEvent (this=0x26df290, e=<optimized out>) at /workspace/build/src/view/kateviewhelpers.cpp:352
#18 0x00007f2c8dd3b778 in QWidget::event (this=this@entry=0x26df290, event=event@entry=0x7fffbf171450) at kernel/qwidget.cpp:9281
#19 0x00007f2c8ddeb245 in QAbstractSlider::event (this=this@entry=0x26df290, e=e@entry=0x7fffbf171450) at widgets/qabstractslider.cpp:956
#20 0x00007f2c8de8cd2b in QScrollBar::event (this=0x26df290, event=0x7fffbf171450) at widgets/qscrollbar.cpp:490
#21 0x00007f2c8dcfc39c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x26df290, e=0x7fffbf171450) at kernel/qapplication.cpp:3727
#22 0x00007f2c8dd03db3 in QApplication::notify (this=<optimized out>, receiver=0x26df290, e=0x7fffbf171450) at kernel/qapplication.cpp:3203
#23 0x00007f2c8c7d2228 in QCoreApplication::notifyInternal2 (receiver=receiver@entry=0x26df290, event=event@entry=0x7fffbf171450) at kernel/qcoreapplication.cpp:1048
#24 0x00007f2c8dd02faf in QCoreApplication::sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:234
#25 QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x26df290, event=event@entry=0x7fffbf171450, alienWidget=alienWidget@entry=0x26df290, nativeWidget=0x236d120, buttonDown=buttonDown@entry=0x7f2c8e4058d0 <qt_button_down>, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:2695
#26 0x00007f2c8dd55abd in QWidgetWindow::handleMouseEvent (this=this@entry=0x286c310, event=event@entry=0x7fffbf171850) at kernel/qwidgetwindow.cpp:659
#27 0x00007f2c8dd584cb in QWidgetWindow::event (this=0x286c310, event=0x7fffbf171850) at kernel/qwidgetwindow.cpp:280
#28 0x00007f2c8dcfc39c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x286c310, e=0x7fffbf171850) at kernel/qapplication.cpp:3727
#29 0x00007f2c8dd03ab0 in QApplication::notify (this=0x7fffbf171d90, receiver=0x286c310, e=0x7fffbf171850) at kernel/qapplication.cpp:3486
#30 0x00007f2c8c7d2228 in QCoreApplication::notifyInternal2 (receiver=receiver@entry=0x286c310, event=event@entry=0x7fffbf171850) at kernel/qcoreapplication.cpp:1048
#31 0x00007f2c8d4f13cf in QCoreApplication::sendSpontaneousEvent (event=0x7fffbf171850, receiver=0x286c310) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:237
#32 QGuiApplicationPrivate::processMouseEvent (e=0x2b14430) at kernel/qguiapplication.cpp:2082
#33 0x00007f2c8d4f3415 in QGuiApplicationPrivate::processWindowSystemEvent (e=e@entry=0x2b14430) at kernel/qguiapplication.cpp:1817
#34 0x00007f2c8d4cde1b in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1032
#35 0x00007f2c7c09342b in QPAEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5WaylandClient.so.5
#36 0x00007f2c8c7d05ba in QEventLoop::exec (this=this@entry=0x7fffbf171ac0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:214
#37 0x00007f2c8c7d96c4 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1336
#38 0x00007f2c8d4e7f8c in QGuiApplication::exec () at kernel/qguiapplication.cpp:1762
#39 0x00007f2c8dcfc2f5 in QApplication::exec () at kernel/qapplication.cpp:2901
#40 0x000000000042a0bd in main (argc=3, argv=<optimized out>) at /workspace/build/kate/main.cpp:595

Reported using DrKonqi
Comment 1 Dominik Haumann 2018-08-15 21:51:32 UTC
Git commit 9c035669190bfb53f0a18b29da880debbabe662a by Dominik Haumann.
Committed on 15/08/2018 at 21:51.
Pushed by dhaumann into branch 'master'.

Fix crash when hiding the TextPreview widget

The problem was that the passed parent to the text preview
widget was the KateView, which is incorrect. The correct
parent is 'this', i.e. once the KateIconBorder, and once
the KateScrollBar.
FIXED-IN: 5.50
Reviewed-By: d_ed

M  +2    -2    src/view/katetextpreview.cpp
M  +1    -1    src/view/katetextpreview.h
M  +2    -2    src/view/kateviewhelpers.cpp

https://commits.kde.org/ktexteditor/9c035669190bfb53f0a18b29da880debbabe662a
Comment 2 Dominik Haumann 2018-08-15 21:54:17 UTC
*** Bug 397298 has been marked as a duplicate of this bug. ***
Comment 3 Sven Brauch 2018-08-16 18:55:31 UTC
*** Bug 397170 has been marked as a duplicate of this bug. ***