flameshot-org / flameshot

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:
https://flameshot.org
GNU General Public License v3.0
24.61k stars 1.58k forks source link

Flameshot randomly freezes and locks entire screen #2964

Open kobaz opened 1 year ago

kobaz commented 1 year ago

Flameshot Version

Flameshot v12.1.0 (Debian 12.1.0-1~bpo11+1) Compiled with Qt 5.15.2

Installation Type

Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)

Operating System type and version

Debian Bullseye and others

Description

  1. run flameshot gui
  2. double click flameshot icon in tray
  3. sometimes, flameshot will mask the entire screen and give you the cross pointer but not allow you to select anything
  4. flameshot is now completely frozen and it's not possible to unmask the screen, leaving the desktop unusable
  5. ssh from another machine into the frozen flameshot machine, and killall -9 flameshot
  6. desktop session is now usable

Steps to reproduce

No response

Screenshots or screen recordings

No response

System Information

5 Screens on VisionTek Radeon HD 7750 Xorg AwesomeWM

mmahmoudian commented 1 year ago

You see, the flameshot gui should already take a screenshot and let you annotate it. You should not need to click on the tray icon. Are you sure this is how you are invoking Flameshot?!

kobaz commented 1 year ago

In order to take a screenshot I always just double click the tray icon.

Normally this works perfectly.

Occasionally it freezes the entire desktop with the overlay.

mmahmoudian commented 1 year ago

Double click? Doesn't single click work?

kobaz commented 1 year ago

Oh... single click does work! I'll start using that now.

Maybe the double click causes an issue since it might run twice?

mmahmoudian commented 1 year ago

Double clicking meant that you run two instances back to back, and your DE possible screws up what it grants focus and what it draws above the other one. In other words there is a chance that your DE end of giving focus to the flameshot instance that is not on the top.

Anyways, I'll close this issue as it is not a software bug.

kobaz commented 1 year ago

HI,

I am also a software developer... the software should prevent the user from causing a system issue if possible.

I would say this probably is a bug. The interface should prevent the user from causing problems. The backend for flameshot should serialize the clicks and make sure only one backend is running at a time.

mmahmoudian commented 1 year ago

@kobaz true, but since you are a software dev you should also:

  1. Know that Flameshot is not the only software in the mix when you double click. AwesomeWM is also a part of it and is the one that handles many of these moving parts
  2. Be familiar with PEBKAC. Ussr should know their software stack. For example user should know that in practically all WMs in all OSs, interacting with tray icon is with single click (e.g Windows, macOS, KDE, polybar, i3wm, sway, dwm bar, Gnome tray shell extension, ...) 😉

We have a part implemented that checks if Flameshot looses focus and alerts the user, we also have an option in the configuration to limit the number of Flameshot instances to 1, so that this issue can be prevented. By default it off and user can create as many as they want, and that is because users be able to use Flameshot to take screenshots of Flameshot bugs and send us.

kobaz commented 1 year ago

1) -- Agreed. But taking a screenshot and masking out the desktop seems fairly modal to me and should have the ability to prevent two masks to happen at the same time. I can't think of any legitimate use case for locking up the desktop a second time. If a mask is already present... then sure you can start a new screen capture but it should not draw another mask.

2) -- PEBKAC does exist buuuut, the software should prevent easily-preventable problems such as something running twice or locking twice.

kobaz commented 1 year ago

@mmahmoudian Update. This is definitely a bug.

I've switched to only single-clicking the flameshot icon in the tray for taking a screenshot. Today I got a crosshair and NO desktop mask. Flameshot was frozen and the desktop was frozen. but I can move the mouse around and had a crosshair cursor, but no apps were responding to clicks.

I got in on another machine and dumped the backtrace (attached) flameshot.txt

kobaz commented 1 year ago

Do you have a donate link? I would like to send you something for fixing this!

I found: https://rysolv.com/repos/detail/2ce10839-c350-47b1-89a4-2ee9cf0e0678

Does that work for you? Thanks!

mmahmoudian commented 1 year ago

Please read here:

https://flameshot.org/donate/

kobaz commented 1 year ago

I found an instance of Flameshot has frozen completely but has not locked up my screen

Backtrace:

#0  __GI___libc_write (nbytes=116, buf=0x5586332c9428, fd=2) at ../sysdeps/unix/sysv/linux/write.c:26
#1  __GI___libc_write (fd=2, buf=0x5586332c9428, nbytes=116) at ../sysdeps/unix/sysv/linux/write.c:24
#2  0x00007f1dbbf78665 in _IO_new_file_write (f=0x7f1dbc0cb5c0 <_IO_2_1_stderr_>, data=0x5586332c9428, n=116) at fileops.c:1181
#3  0x00007f1dbbf779d6 in new_do_write (fp=fp@entry=0x7f1dbc0cb5c0 <_IO_2_1_stderr_>,
    data=data@entry=0x5586332c9428 "flameshot: info: Capture saved to clipboard. Capture saved as /home/kobaz/Pictures/Screenshots/2023-01-06_15-40.png\n",
    to_do=to_do@entry=116) at libioP.h:948
#4  0x00007f1dbbf78d5e in _IO_new_file_xsputn (n=116, data=<optimized out>, f=<optimized out>) at fileops.c:1255
#5  _IO_new_file_xsputn (f=0x7f1dbc0cb5c0 <_IO_2_1_stderr_>, data=<optimized out>, n=116) at fileops.c:1197
#6  0x00007f1dbbf6d5bd in __GI__IO_fwrite (buf=0x5586332c9428, size=1, count=116, fp=0x7f1dbc0cb5c0 <_IO_2_1_stderr_>) at libioP.h:948
#7  0x00007f1dbc608af6 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007f1dbc5d47fa in QFileDevice::flush() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007f1dbc73438d in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007f1dbc7344b3 in QTextStream::~QTextStream() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00005586318f1410 in ?? ()
#12 0x00005586318f1590 in ?? ()
#13 0x00005586318fe40c in ?? ()
#14 0x00005586318ff2e2 in ?? ()
#15 0x00005586318eec1f in ?? ()
#16 0x00005586318f066c in ?? ()
#17 0x00005586318edab6 in ?? ()
#18 0x0000558631911b19 in ?? ()
#19 0x0000558631911ce9 in ?? ()
#20 0x00007f1dbc6d6daf in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007f1dbd16d15f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007f1dbc6aafca in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x00007f1dbc6ada01 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007f1dbc702e93 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x00007f1dbb506e6b in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007f1dbb507118 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007f1dbb5071cf in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007f1dbc70251f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x00007f1dbc6a998b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#30 0x00007f1dbc6b1c00 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x00005586318c2e3e in ?? ()
#32 0x00007f1dbbf1ed0a in __libc_start_main (main=0x5586318c0d00, argc=1, argv=0x7ffcd348fb28, init=<optimized out>, fini=<optimized out>,
    rtld_fini=<optimized out>, stack_end=0x7ffcd348fb18) at ../csu/libc-start.c:308
#33 0x00005586318c478a in ?? ()
kobaz commented 1 year ago

I have another backtrace from a frozen/lockedup frameshot

(gdb) bt
#0  __GI___libc_write (nbytes=116, buf=0x564bb682fc58, fd=2) at ../sysdeps/unix/sysv/linux/write.c:26
#1  __GI___libc_write (fd=2, buf=0x564bb682fc58, nbytes=116) at ../sysdeps/unix/sysv/linux/write.c:24
#2  0x00007f19512b6665 in _IO_new_file_write (f=0x7f19514095c0 <_IO_2_1_stderr_>, data=0x564bb682fc58, n=116) at fileops.c:1181
#3  0x00007f19512b59d6 in new_do_write (fp=fp@entry=0x7f19514095c0 <_IO_2_1_stderr_>,
    data=data@entry=0x564bb682fc58 "flameshot: info: Capture saved to clipboard. Capture saved as /home/kobaz/Pictures/Screenshots/2023-02-28_12                                                                -16.png\nh1.6v-6H18v-2l-2-2z\"/>\n</svg>", to_do=to_do@entry=116) at libioP.h:948
#4  0x00007f19512b6d5e in _IO_new_file_xsputn (n=116, data=<optimized out>, f=<optimized out>) at fileops.c:1255
#5  _IO_new_file_xsputn (f=0x7f19514095c0 <_IO_2_1_stderr_>, data=<optimized out>, n=116) at fileops.c:1197
#6  0x00007f19512ab5bd in __GI__IO_fwrite (buf=0x564bb682fc58, size=1, count=116, fp=0x7f19514095c0 <_IO_2_1_stderr_>) at libioP.h:948
#7  0x00007f1951946af6 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007f19519127fa in QFileDevice::flush() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007f1951a7238d in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007f1951a724b3 in QTextStream::~QTextStream() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x0000564bb5d60410 in ?? ()
#12 0x0000564bb5d60590 in ?? ()
#13 0x0000564bb5d6d40c in ?? ()
#14 0x0000564bb5d6e2e2 in ?? ()
#15 0x0000564bb5d5dc1f in ?? ()
#16 0x0000564bb5d5f66c in ?? ()
#17 0x0000564bb5d5cab6 in ?? ()
#18 0x0000564bb5d80b19 in ?? ()
#19 0x0000564bb5d80ce9 in ?? ()
#20 0x00007f1951a14daf in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007f19524ab15f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007f19519e8fca in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x00007f19519eba01 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007f1951a40e93 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x00007f1950844e6b in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007f1950845118 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007f19508451cf in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007f1951a4051f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x00007f19519e798b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
--Type <RET> for more, q to quit, c to continue without paging--
#30 0x00007f19519efc00 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x0000564bb5d31e3e in ?? ()
#32 0x00007f195125cd0a in __libc_start_main (main=0x564bb5d2fd00, argc=1, argv=0x7fff65573b18, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff65573b08)
    at ../csu/libc-start.c:308
#33 0x0000564bb5d3378a in ?? ()
kobaz commented 2 months ago

Just checking in. Still locking up about once a week.

#0  __GI___libc_write (nbytes=39, buf=0x7ffe50929b30, fd=2) at ../sysdeps/unix/sysv/linux/write.c:26
#1  __GI___libc_write (fd=2, buf=0x7ffe50929b30, nbytes=39) at ../sysdeps/unix/sysv/linux/write.c:24
#2  0x00007f75acc9ffc5 in _IO_new_file_write (f=0x7f75acdf2680 <_IO_2_1_stderr_>, data=0x7ffe50929b30, n=39) at ./libio/fileops.c:1180
#3  0x00007f75acc9f380 in new_do_write (fp=fp@entry=0x7f75acdf2680 <_IO_2_1_stderr_>, data=data@entry=0x7ffe50929b30 "QPainter::setBrush: Painter not active\n\nt active\no set rendering hints\n", to_do=to_do@entry=39)
    at ./libio/libioP.h:947
#4  0x00007f75acca06b1 in _IO_new_file_xsputn (n=39, data=<optimized out>, f=0x7f75acdf2680 <_IO_2_1_stderr_>) at ./libio/fileops.c:1254
#5  _IO_new_file_xsputn (f=0x7f75acdf2680 <_IO_2_1_stderr_>, data=<optimized out>, n=39) at ./libio/fileops.c:1196
#6  0x00007f75acc7d95b in buffered_vfprintf (s=0x7f75acdf2680 <_IO_2_1_stderr_>, format=format@entry=0x7f75ad196086 "%s\n", args=args@entry=0x7ffe5092bb70, mode_flags=mode_flags@entry=2) at ../libio/libioP.h:947
#7  0x00007f75acc7c953 in __vfprintf_internal (s=<optimized out>, format=0x7f75ad196086 "%s\n", ap=ap@entry=0x7ffe5092bb70, mode_flags=2) at ./stdio-common/vfprintf-internal.c:740
#8  0x00007f75acd359ef in ___fprintf_chk (fp=<optimized out>, flag=<optimized out>, format=<optimized out>) at ./debug/fprintf_chk.c:33
#9  0x00007f75acec7fb9 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007f75acec3b50 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007f75acec3c68 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007f75ace9053d in QMessageLogger::warning(char const*, ...) const () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007f75ad4ec2cb in ?? () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#14 0x00005566b156261d in ?? ()
#15 0x00005566b15610c9 in ?? ()
#16 0x00007f75adda58b3 in QWidget::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#17 0x00007f75add62fae in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007f75ad0b16f8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#19 0x00007f75add9d009 in QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#20 0x00007f75add9cf65 in QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007f75add9cf65 in QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007f75add9cf65 in QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007f75add9cf65 in QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007f75add9cf65 in QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#25 0x00007f75add9cf65 in QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#26 0x00007f75adda1c97 in QWidgetPrivate::prepareToRender(QRegion const&, QFlags<QWidget::RenderFlag>) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#27 0x00007f75adda2366 in QWidget::render(QPainter*, QPoint const&, QRegion const&, QFlags<QWidget::RenderFlag>) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#28 0x00007f75adda28a7 in QWidget::render(QPaintDevice*, QPoint const&, QRegion const&, QFlags<QWidget::RenderFlag>) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#29 0x00007f75adda2ade in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#30 0x00007f75ae10c4de in QGraphicsEffectSource::pixmap(Qt::CoordinateSystem, QPoint*, QGraphicsEffect::PixmapPadMode) const () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#31 0x00007f75ae10c678 in QGraphicsEffect::sourcePixmap(Qt::CoordinateSystem, QPoint*, QGraphicsEffect::PixmapPadMode) const () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#32 0x00007f75ae10ca3c in QGraphicsDropShadowEffect::draw(QPainter*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#33 0x00007f75add9e3dc in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#34 0x00007f75add9ecd6 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#35 0x00007f75add9eb39 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#36 0x00007f75add9d64c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#37 0x00007f75add74305 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#38 0x00007f75add74afa in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#39 0x00007f75addc124c in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#40 0x00007f75add62fae in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#41 0x00007f75ad0b16f8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#42 0x00007f75ad53e5cd in QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#43 0x00007f75ad511cac in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#44 0x00007f75a98bfeca in ?? () from /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#45 0x00007f75ac11e7a9 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#46 0x00007f75ac11ea38 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#47 0x00007f75ac11eacc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#48 0x00007f75ad109836 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#49 0x00007f75ad0b017b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#50 0x00007f75ad0b82d6 in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#51 0x00005566b14aaae6 in ?? ()
#52 0x00007f75acc4624a in __libc_start_call_main (main=main@entry=0x5566b14a8970, argc=argc@entry=1, argv=argv@entry=0x7ffe5092e2a8) at ../sysdeps/nptl/libc_start_call_main.h:58
essExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#43 0x00007f75ad511cac in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5

Click the screenshot button and then it just freezes after grabbing the screen. I need to SSH in from another box and kill -9 flameshot.

After restarting it works normally.

kobaz commented 2 months ago

flameshot 12.1.0-2