Bug 442424

Summary: Segmentation fault in Gwenview::FullScreenBarPrivate::slideInTriggerRect
Product: [Applications] gwenview Reporter: postix <postix>
Component: generalAssignee: Gwenview Bugs <gwenview-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate, postix
Priority: NOR    
Version: 21.12.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 21.12.2

Description postix 2021-09-14 11:38:20 UTC
SUMMARY

Gwenview has crashed when it was in fullscreen and I zoomed in and out. Stacktrace by Dr. Konqui:

```
Application: Gwenview (gwenview), signal: Segmentation fault
Content of s_kcrashErrorMessage: [Current thread is 1 (Thread 0x7f2366204a40 (LWP 21287))]
[KCrash Handler]
#6  QScreen::geometry (this=0x0) at kernel/qscreen.cpp:413
#7  0x00007f236bb1ce26 in Gwenview::FullScreenBarPrivate::slideInTriggerRect (this=0x55e398625380) at /usr/src/debug/gwenview5-21.08.1-1.1.x86_64/lib/fullscreenbar.cpp:88
#8  Gwenview::FullScreenBar::eventFilter (this=0x55e398ac32b0, object=<optimized out>, event=0x7ffe267cd3a0) at /usr/src/debug/gwenview5-21.08.1-1.1.x86_64/lib/fullscreenbar.cpp:236
#9  0x00007f2369eb161e in QCoreApplicationPrivate::sendThroughApplicationEventFilters (event=<optimized out>, receiver=<optimized out>, this=<optimized out>) at kernel/qcoreapplication.cpp:1172
#10 QCoreApplicationPrivate::sendThroughApplicationEventFilters (this=this@entry=0x55e3984d7f60, receiver=receiver@entry=0x55e3988f4e60, event=event@entry=0x7ffe267cd3a0) at kernel/qcoreapplication.cpp:1157
#11 0x00007f236acc2ab8 in QApplicationPrivate::notify_helper (this=0x55e3984d7f60, receiver=0x55e3988f4e60, e=0x7ffe267cd3a0) at kernel/qapplication.cpp:3603
#12 0x00007f2369eb19ea in QCoreApplication::notifyInternal2 (receiver=0x55e3988f4e60, event=0x7ffe267cd3a0) at kernel/qcoreapplication.cpp:1064
#13 0x00007f236a5705d7 in QGuiApplicationPrivate::processMouseEvent (e=0x55e398659560) at kernel/qguiapplication.cpp:2282
#14 0x00007f236a54679c in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1169
#15 0x00007f23642ddd0a in xcbSourceDispatch (source=source@entry=0x55e3985ba480) at qxcbeventdispatcher.cpp:105
#16 0x00007f236768280f in g_main_dispatch (context=0x7f235c005000) at ../glib/gmain.c:3337
#17 g_main_context_dispatch (context=0x7f235c005000) at ../glib/gmain.c:4055
#18 0x00007f2367682b98 in g_main_context_iterate (context=context@entry=0x7f235c005000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4131
#19 0x00007f2367682c4f in g_main_context_iteration (context=0x7f235c005000, may_block=1) at ../glib/gmain.c:4196
#20 0x00007f2369f08ec4 in QEventDispatcherGlib::processEvents (this=0x55e3985c9a10, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#21 0x00007f2369eb03eb in QEventLoop::exec (this=this@entry=0x7ffe267cd6d0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#22 0x00007f2369eb86d0 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#23 0x00007f236a56419c in QGuiApplication::exec () at kernel/qguiapplication.cpp:1867
#24 0x00007f236acc29f5 in QApplication::exec () at kernel/qapplication.cpp:2824
#25 0x000055e3974ce783 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/gwenview5-21.08.1-1.1.x86_64/app/main.cpp:202
[Inferior 1 (process 21287) detached]
```


SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20210910
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2
Kernel Version: 5.14.1-1-default (64-bit)
Graphics Platform: X11
Comment 1 postix 2021-09-19 13:58:03 UTC
I can reproduce it easily, just happened three times again.
Comment 2 postix 2022-01-08 20:32:30 UTC
Still happens on openSUSE TW (21.12.0), when going through images in fullscreen

```
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=11, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007f4e38bdf2d3 in __pthread_kill_internal (signo=11, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007f4e38b8f356 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
#3  0x00007f4e3760ed36 in KCrash::defaultCrashHandler (sig=11) at /usr/src/debug/kcrash-5.89.0-1.2.x86_64/src/kcrash.cpp:620
#4  <signal handler called>
#5  QScreen::geometry (this=0x0) at kernel/qscreen.cpp:413
#6  0x00007f4e3aef5fc6 in Gwenview::FullScreenBarPrivate::slideInTriggerRect (this=0x55b35413eee0) at /usr/src/debug/gwenview5-21.12.0-1.1.x86_64/lib/fullscreenbar.cpp:86
#7  Gwenview::FullScreenBar::eventFilter (this=0x55b354582b30, object=<optimized out>, event=0x7ffd4111aed0) at /usr/src/debug/gwenview5-21.12.0-1.1.x86_64/lib/fullscreenbar.cpp:234
#8  0x00007f4e3925d95e in QCoreApplicationPrivate::sendThroughApplicationEventFilters (event=<optimized out>, receiver=<optimized out>, this=<optimized out>) at kernel/qcoreapplication.cpp:1172
#9  QCoreApplicationPrivate::sendThroughApplicationEventFilters (this=this@entry=0x55b353fc6f30, receiver=receiver@entry=0x55b35442d8b0, event=event@entry=0x7ffd4111aed0) at kernel/qcoreapplication.cpp:1157
#10 0x00007f4e3a077ab8 in QApplicationPrivate::notify_helper (this=0x55b353fc6f30, receiver=0x55b35442d8b0, e=0x7ffd4111aed0) at kernel/qapplication.cpp:3603
#11 0x00007f4e3925dd2a in QCoreApplication::notifyInternal2 (receiver=0x55b35442d8b0, event=0x7ffd4111aed0) at kernel/qcoreapplication.cpp:1064
#12 0x00007f4e39925567 in QGuiApplicationPrivate::processMouseEvent (e=0x55b3554e8920) at kernel/qguiapplication.cpp:2282
#13 0x00007f4e398fb79c in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1169
#14 0x00007f4e33592cfa in xcbSourceDispatch (source=source@entry=0x55b3540a5b50) at qxcbeventdispatcher.cpp:105
#15 0x00007f4e36a77d9f in g_main_dispatch (context=0x7f4e2c005000) at ../glib/gmain.c:3381
#16 g_main_context_dispatch (context=0x7f4e2c005000) at ../glib/gmain.c:4099
#17 0x00007f4e36a78128 in g_main_context_iterate (context=context@entry=0x7f4e2c005000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4175
#18 0x00007f4e36a781df in g_main_context_iteration (context=0x7f4e2c005000, may_block=1) at ../glib/gmain.c:4240
#19 0x00007f4e392b5204 in QEventDispatcherGlib::processEvents (this=0x55b3540b5060, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#20 0x00007f4e3925c72b in QEventLoop::exec (this=this@entry=0x7ffd4111b200, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#21 0x00007f4e39264a10 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#22 0x00007f4e3991919c in QGuiApplication::exec () at kernel/qguiapplication.cpp:1867
#23 0x00007f4e3a0779f5 in QApplication::exec () at kernel/qapplication.cpp:2824
#24 0x000055b352dae75b in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/gwenview5-21.12.0-1.1.x86_64/app/main.cpp:197
```
Comment 3 Bug Janitor Service 2022-01-08 23:25:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/gwenview/-/merge_requests/129
Comment 4 Nicolas Fella 2022-01-10 16:03:34 UTC
Git commit d812d1df88bb2ffd1b7e4a4d049f798cadc47fd7 by Nicolas Fella.
Committed on 08/01/2022 at 23:24.
Pushed by ngraham into branch 'release/21.12'.

Guard against null QScreen

screenAt can give a nullptr, don't crash in that case

M  +7    -1    lib/fullscreenbar.cpp

https://invent.kde.org/graphics/gwenview/commit/d812d1df88bb2ffd1b7e4a4d049f798cadc47fd7