Bug 469919 - Spectacle crashes in SelectedActionWrapper::setEditAction() when starting second rectangular region capture after pressing Enter with empty text annotation
Summary: Spectacle crashes in SelectedActionWrapper::setEditAction() when starting sec...
Status: CONFIRMED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 23.04.1
Platform: Neon Linux
: HI crash
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords: drkonqi
: 471129 472401 473166 474719 475720 476332 478897 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-05-17 23:04 UTC by Andrei Rybak
Modified: 2023-12-22 23:33 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screen recording of the OBSERVED RESULT (105.33 KB, video/mp4)
2023-05-17 23:06 UTC, Andrei Rybak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Rybak 2023-05-17 23:04:10 UTC
Application: spectacle (23.04.1)

Qt Version: 5.15.9
Frameworks Version: 5.106.0
Operating System: Linux 5.19.0-41-generic x86_64
Windowing System: X11
Distribution: KDE neon 5.27
DrKonqi: 5.27.5 [KCrashBackend]

-- Information about the crash:
SUMMARY
If a user closes Spectacle by pressing Enter, Shift+Enter, or Ctrl+Enter, the application closes and notification "A screenshot was saved to your clipboard" appears. However, if Enter, Shift+Enter, or Ctrl+Enter was pressed during text input, then the next launch of Spectacle crashes.


STEPS TO REPRODUCE
1. Launch "Capture Rectangular Region" (default shortcut is Meta+Shift+Print)
2. Click on the button for the "Text" annotation tool
3. Click somewhere to start the "Text" annotation tool
4. Press button "Enter" on the keyboard (or Shift+Enter, or Ctrl+Enter)
5. Launch "Capture Rectangular Region" a second time

OBSERVED RESULT
After step 3, notification "A screenshot was saved to your clipboard" appears.
After step 5, notification about Spectacle crashing appears.

I will also attach a screen recording demostrating the crash.

EXPECTED RESULT
The crash after step 5 shouldn't happen. Maybe the behavior after step 4 should be changed as well (e.g. to just close the text input instead of closing Spectacle).

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9
Kernel Version: 5.19.0-41-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i5-8250U CPU @ 1.60GHz
Memory: 7.7 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Manufacturer: Dell Inc.
Product Name: Inspiron 5570

The crash can be reproduced every time.

-- Backtrace:
Application: Spectacle (spectacle), signal: Segmentation fault

[KCrash Handler]
#4  0x0000560d82653a1f in SelectedActionWrapper::setEditAction (this=0x560d83da1c50, action=0x0) at ./src/Gui/Annotations/AnnotationDocument.cpp:561
#5  0x0000560d8265a7b4 in AnnotationDocument::deselectAction (this=0x560d83dd0c60) at ./src/Gui/Annotations/AnnotationDocument.cpp:1436
#6  AnnotationDocument::clearAnnotations (this=0x560d83dd0c60) at ./src/Gui/Annotations/AnnotationDocument.cpp:928
#7  0x0000560d8264a201 in AnnotationDocument::clear (this=0x560d83dd0c60) at ./src/Gui/Annotations/AnnotationDocument.cpp:842
#8  operator() (screenImages=..., __closure=0x560d83dd9330) at ./src/SpectacleCore.cpp:129
#9  QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<const QVector<CanvasImage>&>, void, SpectacleCore::SpectacleCore(QObject*)::<lambda(const QVector<CanvasImage>&)> >::call (arg=<optimized out>, f=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:146
#10 QtPrivate::Functor<SpectacleCore::SpectacleCore(QObject*)::<lambda(const QVector<CanvasImage>&)>, 1>::call<QtPrivate::List<QVector<CanvasImage> const&>, void> (arg=<optimized out>, f=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:256
#11 QtPrivate::QFunctorSlotObject<SpectacleCore::SpectacleCore(QObject*)::<lambda(const QVector<CanvasImage>&)>, 1, QtPrivate::List<const QVector<CanvasImage>&>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x560d83dd9320, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:443
#12 0x00007fb22e8f41e4 in QtPrivate::QSlotObjectBase::call (a=0x7fffea53c7c0, r=0x7fffea53cd20, this=0x560d83dd9320) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#13 doActivate<false> (sender=0x560d83da1bf0, signal_index=6, argv=0x7fffea53c7c0) at kernel/qobject.cpp:3923
#14 0x00007fb22e8ed287 in QMetaObject::activate (sender=sender@entry=0x560d83da1bf0, m=m@entry=0x560d826b2640 <Platform::staticMetaObject>, local_signal_index=local_signal_index@entry=3, argv=argv@entry=0x7fffea53c7c0) at kernel/qobject.cpp:3983
#15 0x0000560d82670917 in Platform::newScreensScreenshotTaken (_t1=..., this=0x560d83da1bf0) at ./obj-x86_64-linux-gnu/src/spectacle_autogen/UWYFJWVAJO/moc_Platform.cpp:298
#16 PlatformXcb::doGrabNow (this=0x560d83da1bf0, theGrabMode=<optimized out>, theIncludePointer=<optimized out>, theIncludeDecorations=<optimized out>) at ./src/Platforms/PlatformXcb.cpp:713
#17 0x00007fb22e8f8306 in QtPrivate::QSlotObjectBase::call (a=0x7fffea53c830, r=<optimized out>, this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#18 QSingleShotTimer::timerEvent (this=0x560d85b8f2b0) at kernel/qtimer.cpp:320
#19 0x00007fb22e8e9b0f in QObject::event (this=0x560d85b8f2b0, e=0x7fffea53c9a0) at kernel/qobject.cpp:1369
#20 0x00007fb23016c793 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x560d85b8f2b0, e=0x7fffea53c9a0) at kernel/qapplication.cpp:3640
#21 0x00007fb22e8bc18a in QCoreApplication::notifyInternal2 (receiver=0x560d85b8f2b0, event=0x7fffea53c9a0) at kernel/qcoreapplication.cpp:1064
#22 0x00007fb22e914f1b in QTimerInfoList::activateTimers (this=0x560d83c23260) at kernel/qtimerinfo_unix.cpp:643
#23 0x00007fb22e91581c in timerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:183
#24 0x00007fb22c31bd3b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007fb22c3706c8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007fb22c3193e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007fb22e915be8 in QEventDispatcherGlib::processEvents (this=0x560d83c26ae0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#28 0x00007fb22e8baaab in QEventLoop::exec (this=this@entry=0x7fffea53cbe0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#29 0x00007fb22e8c3044 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#30 0x00007fb22ed36540 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1870
#31 0x00007fb23016c709 in QApplication::exec () at kernel/qapplication.cpp:2832
#32 0x0000560d8261c8d7 in main (argc=<optimized out>, argv=<optimized out>) at ./src/Main.cpp:127
[Inferior 1 (process 9827) detached]

Reported using DrKonqi
Comment 1 Andrei Rybak 2023-05-17 23:06:16 UTC
Created attachment 159052 [details]
Screen recording of the OBSERVED RESULT
Comment 2 Nate Graham 2023-05-19 19:33:41 UTC
Can reproduce the issue with those steps.
Comment 3 Nicolas Fella 2023-12-22 23:12:30 UTC
*** Bug 473166 has been marked as a duplicate of this bug. ***
Comment 4 Nicolas Fella 2023-12-22 23:13:28 UTC
*** Bug 472401 has been marked as a duplicate of this bug. ***
Comment 5 Nicolas Fella 2023-12-22 23:13:55 UTC
*** Bug 474719 has been marked as a duplicate of this bug. ***
Comment 6 Nicolas Fella 2023-12-22 23:14:50 UTC
*** Bug 478897 has been marked as a duplicate of this bug. ***
Comment 7 Nicolas Fella 2023-12-22 23:19:51 UTC
*** Bug 476332 has been marked as a duplicate of this bug. ***
Comment 8 Nicolas Fella 2023-12-22 23:23:43 UTC
*** Bug 475720 has been marked as a duplicate of this bug. ***
Comment 9 Nicolas Fella 2023-12-22 23:24:32 UTC
*** Bug 471129 has been marked as a duplicate of this bug. ***