Bug 445434 - Gwenview crash when clicking "crop" button
Summary: Gwenview crash when clicking "crop" button
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 21.08.3
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2021-11-13 17:51 UTC by phrxmd
Modified: 2022-02-14 09:30 UTC (History)
1 user (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 phrxmd 2021-11-13 17:51:01 UTC
Application: gwenview (21.08.3)

Qt Version: 5.15.2
Frameworks Version: 5.87.0
Operating System: Linux 5.14.14-2-default x86_64
Windowing System: Wayland
Distribution: "openSUSE Tumbleweed"
DrKonqi: 5.23.2 [KCrashBackend]

-- Information about the crash:
- What I was doing when the application crashed:
Opened an image, selected the Crop tool from the toolbar on the left.

Gwenview reproducibly crashes for me when cropping any image.

The crash can be reproduced every time.

-- Backtrace:
Application: Gwenview (gwenview), signal: Segmentation fault
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = {<No data fields>}}
[KCrash Handler]
#6  QScreen::geometry (this=0x0) at kernel/qscreen.cpp:413
#7  0x00007f0f0f3319b5 in Gwenview::CropWidgetPrivate::initRatioComboBox (this=0x56366c4e9eb0) at /usr/src/debug/gwenview5-21.08.3-1.1.x86_64/lib/crop/cropwidget.cpp:203
#8  Gwenview::CropWidget::CropWidget (this=<optimized out>, parent=<optimized out>, imageView=<optimized out>, cropTool=<optimized out>, this=<optimized out>, parent=<optimized out>, imageView=<optimized out>, cropTool=<optimized out>) at /usr/src/debug/gwenview5-21.08.3-1.1.x86_64/lib/crop/cropwidget.cpp:396
#9  0x00007f0f0f332f70 in Gwenview::CropToolPrivate::setupWidget (this=0x56366c4ff7d0) at /usr/src/debug/gwenview5-21.08.3-1.1.x86_64/lib/crop/croptool.cpp:203
#10 Gwenview::CropTool::CropTool (this=<optimized out>, view=<optimized out>, this=<optimized out>, view=<optimized out>) at /usr/src/debug/gwenview5-21.08.3-1.1.x86_64/lib/crop/croptool.cpp:234
#11 0x000056366aab02cc in Gwenview::ImageOpsContextManagerItem::crop (this=0x56366c28b670) at /usr/src/debug/gwenview5-21.08.3-1.1.x86_64/app/imageopscontextmanageritem.cpp:264
#12 Gwenview::ImageOpsContextManagerItem::qt_static_metacall (_o=0x56366c28b670, _id=<optimized out>, _a=<optimized out>, _c=<optimized out>) at /usr/src/debug/gwenview5-21.08.3-1.1.x86_64/build/app/gwenview_autogen/EWIEGA46WW/moc_imageopscontextmanageritem.cpp:115
#13 0x00007f0f0d713078 in doActivate<false> (sender=0x56366c19ddc0, signal_index=4, argv=0x7fff03a218d0) at kernel/qobject.cpp:3898
#14 0x00007f0f0d70c50f in QMetaObject::activate (sender=sender@entry=0x56366c19ddc0, m=m@entry=0x7f0f0ea0c0a0, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fff03a218d0) at kernel/qobject.cpp:3946
#15 0x00007f0f0e4ed182 in QAction::triggered (this=this@entry=0x56366c19ddc0, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#16 0x00007f0f0e4efdb4 in QAction::activate (this=0x56366c19ddc0, event=<optimized out>) at kernel/qaction.cpp:1161
#17 0x00007f0f0e5e8a0a in QAbstractButtonPrivate::click (this=0x563672befd90) at widgets/qabstractbutton.cpp:398
#18 0x00007f0f0e5e8b63 in QAbstractButton::mouseReleaseEvent (this=0x563672bee010, e=0x7fff03a21e70) at widgets/qabstractbutton.cpp:1044
#19 0x00007f0f0e6e139a in QToolButton::mouseReleaseEvent (this=<optimized out>, e=<optimized out>) at widgets/qtoolbutton.cpp:622
#20 0x00007f0f0e53576e in QWidget::event (this=0x563672bee010, event=0x7fff03a21e70) at kernel/qwidget.cpp:9020
#21 0x00007f0f0e4f3a7f in QApplicationPrivate::notify_helper (this=this@entry=0x56366bccdb30, receiver=receiver@entry=0x563672bee010, e=e@entry=0x7fff03a21e70) at kernel/qapplication.cpp:3632
#22 0x00007f0f0e4fb584 in QApplication::notify (this=0x7fff03a21b90, receiver=0x563672bee010, e=0x7fff03a21e70) at kernel/qapplication.cpp:3076
#23 0x00007f0f0d6dc9fa in QCoreApplication::notifyInternal2 (receiver=0x563672bee010, event=0x7fff03a21e70) at kernel/qcoreapplication.cpp:1064
#24 0x00007f0f0e4fa093 in QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x563672bee010, event=event@entry=0x7fff03a21e70, alienWidget=alienWidget@entry=0x563672bee010, nativeWidget=0x56366bd33120, buttonDown=<optimized out>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at kernel/qapplication.cpp:2614
#25 0x00007f0f0e54e83c in QWidgetWindow::handleMouseEvent (this=0x56366c2d6e40, event=0x7fff03a22140) at kernel/qwidgetwindow.cpp:683
#26 0x00007f0f0e551c55 in QWidgetWindow::event (this=0x56366c2d6e40, event=0x7fff03a22140) at kernel/qwidgetwindow.cpp:300
#27 0x00007f0f0e4f3a7f in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x56366c2d6e40, e=0x7fff03a22140) at kernel/qapplication.cpp:3632
#28 0x00007f0f0d6dc9fa in QCoreApplication::notifyInternal2 (receiver=0x56366c2d6e40, event=0x7fff03a22140) at kernel/qcoreapplication.cpp:1064
#29 0x00007f0f0dda15c7 in QGuiApplicationPrivate::processMouseEvent (e=0x56366c50b3c0) at kernel/qguiapplication.cpp:2282
#30 0x00007f0f0dd7778c in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1169
#31 0x00007f0f0b906a80 in userEventSourceDispatch (source=source@entry=0x56366bd07fe0) at qeventdispatcher_glib.cpp:74
#32 0x00007f0f0af00d4f in g_main_dispatch (context=0x56366bcd48b0) at ../glib/gmain.c:3381
#33 g_main_context_dispatch (context=0x56366bcd48b0) at ../glib/gmain.c:4099
#34 0x00007f0f0af010d8 in g_main_context_iterate (context=context@entry=0x56366bcd48b0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4175
#35 0x00007f0f0af0118f in g_main_context_iteration (context=0x56366bcd48b0, may_block=1) at ../glib/gmain.c:4240
#36 0x00007f0f0d733ed4 in QEventDispatcherGlib::processEvents (this=0x56366bcfcaf0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#37 0x00007f0f0d6db3fb in QEventLoop::exec (this=this@entry=0x7fff03a22470, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#38 0x00007f0f0d6e36e0 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#39 0x00007f0f0dd9518c in QGuiApplication::exec () at kernel/qguiapplication.cpp:1867
#40 0x00007f0f0e4f39f5 in QApplication::exec () at kernel/qapplication.cpp:2824
#41 0x000056366aaaa783 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/gwenview5-21.08.3-1.1.x86_64/app/main.cpp:202
[Inferior 1 (process 28184) detached]

Possible duplicates by query: bug 442399, bug 441561.

Reported using DrKonqi
Comment 1 phrxmd 2022-01-19 13:22:41 UTC
Not reproducible anymore in 21.12.1.
Comment 2 Michael Olbrich 2022-02-12 16:42:25 UTC
I don't think that this is fixed: The problem is here and this code is still like this in master:

addRatioToComboBox(ratio(QGuiApplication::screenAt(QCursor::pos())->geometry().size()), i18n("This Screen"));

QGuiApplication::screenAt() may return nullptr (https://doc.qt.io/qt-5/qguiapplication.html#screenAt).
For me this happens happens on Wayland when I have at least two screens. It does not happen with just a single screen.
Comment 3 Laurent Montel 2022-02-14 09:30:46 UTC
Git commit 6aba8e56950afbff2a769c0dd15015ed35ac86d8 by Laurent Montel.
Committed on 14/02/2022 at 09:30.
Pushed by mlaurent into branch 'master'.

Fix Bug 445434: Gwenview crash when clicking "crop" button

M  +4    -1    lib/crop/cropwidget.cpp

https://invent.kde.org/graphics/gwenview/commit/6aba8e56950afbff2a769c0dd15015ed35ac86d8