Bug 391066 - Pressing the "Take a New Snapshot" button with the Space key causes KSnapshot to crash/hang
Summary: Pressing the "Take a New Snapshot" button with the Space key causes KSnapshot...
Status: RESOLVED UNMAINTAINED
Alias: None
Product: ksnapshot
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: 0.8.2
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Aaron J. Seigo
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2018-02-25 20:30 UTC by Sasha Unspecified
Modified: 2018-09-04 04:20 UTC (History)
0 users

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 Sasha Unspecified 2018-02-25 20:30:16 UTC
Application: ksnapshot (0.8.2)
KDE Platform Version: 4.14.16
Qt Version: 4.8.7
Operating System: Linux 4.4.0-109-generic x86_64
Distribution: Ubuntu 16.04.4 LTS

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

I ran KSnapshot, chose specific settings (see below), ensured that the "Take a New Snapshot" button is focused and pressed the Space key on my keyboard.
The KSnapshot entered "Select a region using the mouse. To take the snapshot, press the Enter key or double click. Press Esc to quit." mode (as usually).
But when I try to exit this mode, either by pressing Enter, or by double-clicking or by pressing Esc, it fails.
More specifically:
* if I press Enter, it seems to restart the region-selection mode (chosen rectange is reset);
* if I press Esc, I'm still in the region-selection mode;
* double-clicking usually causes KSnapshot to crash.

The problem doesn't occur when the "Take a New Snapshot" button is clicked by mouse.

- Custom settings of the application:

The problem occurs when the application is used with the following settings:
* Capture mode: Rectangular Region;
* Snapshot delay: No delay.

The problem seems not to occur in other modes (at least, I couldn't reproduce it in "Full Screen"+"No delay" and "Rectangular Region"+"1 second" modes).

The crash can be reproduced every time.

-- Backtrace:
Application: KSnapshot (ksnapshot), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[KCrash Handler]
#6  0x00007fb3f7baebd6 in QListData::size (this=0x7fb3f6688f28) at ../../include/QtCore/../../src/corelib/tools/qlist.h:98
#7  QList<QPostEvent>::size (this=0x7fb3f6688f28) at ../../include/QtCore/../../src/corelib/tools/qlist.h:137
#8  QCoreApplication::compressEvent (this=<optimized out>, event=0x1147b60, receiver=0x10d93d0, postedEvents=0x7fb3f6688f28) at kernel/qcoreapplication.cpp:1431
#9  0x00007fb3f7bb28de in QCoreApplication::postEvent (receiver=0x10d93d0, event=0x1147b60, priority=0) at kernel/qcoreapplication.cpp:1380
#10 0x0000000000413959 in ?? ()
#11 0x0000000000417439 in ?? ()
#12 0x00007fb3f7bc3010 in QMetaObject::activate (sender=0x1098640, m=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3567
#13 0x000000000041da3c in ?? ()
#14 0x00007fb3f6f48450 in QWidget::event (this=0x1098640, event=0x7ffd32a44480) at kernel/qwidget.cpp:8393
#15 0x00007fb3f6ef0fdc in QApplicationPrivate::notify_helper (this=this@entry=0xf2da40, receiver=receiver@entry=0x1098640, e=e@entry=0x7ffd32a44480) at kernel/qapplication.cpp:4570
#16 0x00007fb3f6ef80d6 in QApplication::notify (this=<optimized out>, receiver=0x1098640, e=0x7ffd32a44480) at kernel/qapplication.cpp:4113
#17 0x00007fb3f88c264a in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#18 0x00007fb3f7bae90d in QCoreApplication::notifyInternal (this=0x7ffd32a44cb0, receiver=receiver@entry=0x1098640, event=event@entry=0x7ffd32a44480) at kernel/qcoreapplication.cpp:955
#19 0x00007fb3f6ef76dd in QCoreApplication::sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#20 QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x1098640, event=event@entry=0x7ffd32a44480, alienWidget=alienWidget@entry=0x0, nativeWidget=nativeWidget@entry=0x1098640, buttonDown=buttonDown@entry=0x7fb3f7a1c368 <qt_button_down>, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3178
#21 0x00007fb3f6f753f2 in QETWidget::translateMouseEvent (this=this@entry=0x1098640, event=event@entry=0x7ffd32a447e0) at kernel/qapplication_x11.cpp:4638
#22 0x00007fb3f6f74c83 in QApplication::x11ProcessEvent (this=0x7ffd32a44cb0, event=event@entry=0x7ffd32a447e0) at kernel/qapplication_x11.cpp:3626
#23 0x00007fb3f6f9e542 in x11EventSourceDispatch (s=0xf40a80, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#24 0x00007fb3f300e197 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007fb3f300e3f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007fb3f300e49c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007fb3f7bdf2ae in QEventDispatcherGlib::processEvents (this=0xf2b5b0, flags=...) at kernel/qeventdispatcher_glib.cpp:450
#28 0x00007fb3f6f9e616 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#29 0x00007fb3f7bad18f in QEventLoop::processEvents (this=this@entry=0x7ffd32a44bc0, flags=...) at kernel/qeventloop.cpp:149
#30 0x00007fb3f7bad4f5 in QEventLoop::exec (this=this@entry=0x7ffd32a44bc0, flags=...) at kernel/qeventloop.cpp:204
#31 0x00007fb3f7bb34b9 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1227
#32 0x0000000000411441 in ?? ()
#33 0x00007fb3f62e4830 in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#34 0x0000000000411969 in _start ()

Reported using DrKonqi
Comment 1 Sasha Unspecified 2018-02-25 20:54:13 UTC
Notes:

1. Sorry, I described behavior imprecisely.

- Pressing Esc key (when in region-selection mode caused by pressing Space on the "Take a New Snapshot" button) exits region-selection mode. But, unlike the normal behavior (when in region-selection mode caused by clicking "Take a New Snapshot" with mouse), Esc needs to be pressed *twice*: first does nothing and second causes both the region-selection mode and KSnapshow to quit.

- Choosing a rectangle and double-clicking it (when in region-selection mode caused by pressing Space on the "Take a New Snapshot" button) hides the rectangle, but doesn't exit the region-selection mode. In this state, choosing a rectangle and double-clicking it again causes KSnapshow to crash in 100% cases (i.e. first selection and double-click does nothing, second selection and double-click causes crash).

- Pressing Enter (when in region-selection mode caused by pressing Space on the "Take a New Snapshot" button) causes some strange behavior. More than one rectangle-selector may appear and etc. But, no matter how many times I select the rectangle and press Enter, the region-selection mode is still on.

2. Surprisingly, pressing Enter on the "Take a New Snapshot" button behaves similarly to pressing it with mouse, not to pressing it with Space key. I.e. pressing Enter when the "Take a New Snapshot" button is focused causes the normal region-selection mode, which can be then finished/cancelled without any problems.
Comment 2 Sasha Unspecified 2018-07-06 14:38:26 UTC
Isn't this caused by #309335?
Comment 3 Sasha Unspecified 2018-07-06 14:41:34 UTC
I mean bug 309335.
Comment 4 Andrew Crouthamel 2018-09-04 04:20:57 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years and I will be closing this bug. Spectacle is the replacement for ksnapshot now. Please test again and file a new bug for Spectacle if you still have issues. Thank you!