Subject: bug#53246: Flameshot crashes on screen capture

From: Jacob Hrbek <[email-masked]>
Date: Fri, 14 Jan 2022 05:58:06 +0000

bash-5.0$ flameshot
(process:6205): Gtk-WARNING **: 06:51:44.636: Locale not supported by C 
library.
     Using the fallback 'C' locale.
QSettings::value: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setCompositionMode: Painter not active
QPainter::translate: Painter not active
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::setBrush: Painter not active
[source ] [function ] [line ] Locales on your system are not properly 
configured. Falling back to defaults
terminate called after throwing an instance of 'std::runtime_error'
   what():  locale::facet::_S_create_c_locale name not valid
Aborted

Steps to reproduce:
1. Install flameshot e.g. `guix install flameshot`
2. Run `flameshot` in a terminal
3. Invoke the flameshot gui e.g. by clicking on the flameshot icon in 
the icon tray
4. Try to save screenshot and expect the failure above.

Info

GNU GuixSD (374fea0f3bc8035f626cb29e6045130df9ffdaf8)

bash-5.0$ cat /etc/config.scm
;; This is an operating system configuration generated
;; by the graphical installer.

(use-modules (gnu))
(use-service-modules
   cups
   desktop
   networking
   ssh
   xorg)

(operating-system
   (locale "en_US.utf8")
   (timezone "Europe/Prague")
   (keyboard-layout (keyboard-layout "us"))
   (host-name "leonid")
   (users (cons* (user-account
                   (name "kreyren")
                   (comment "Jacob Hrbek")
                   (group "users")
                   (home-directory "/home/kreyren")
                   (supplementary-groups
                     '("wheel" "netdev" "audio" "video")))
                 %base-user-accounts))
   (packages
     (append
       (list (specification->package "nss-certs"))
       %base-packages))
   (services
       (append (list
          (service xfce-desktop-service-type)
             (service openssh-service-type)
             (service tor-service-type)
             (set-xorg-configuration
               (xorg-configuration
                 (keyboard-layout keyboard-layout)))) %desktop-services))))
   (bootloader
     (bootloader-configuration
       (bootloader grub-bootloader)
       (targets (list "/dev/sda"))
       (keyboard-layout keyboard-layout)))
   ;; SECURITY(Krey): Swap partition is not zero-ed on reboot so it 
should reside on an encrypted device -- 
https://guix.gnu.org/en/manual/devel/en/html_node/Swap-Space.html
   ;;(swap-space
     ;;(target (uuid "c965c556-351d-4007-9d33-e7ffbc9c1701")))
   (mapped-devices
     (list (mapped-device
             (source
               (uuid "c3ff1f21-b82f-4566-b8a3-274352f40dd4"))
             (target "cryptroot")
             (type luks-device-mapping))
           (mapped-device
             (source
               (uuid "82c4852c-a46b-43e3-abdb-15600ae61e2e"))
             (target "cryptboot")
             (type luks-device-mapping))
           (mapped-device
             (source
               (uuid "b14e499f-0c4f-46f6-9adb-1b020f460b11"))
             (target "crypthome_kreyren")
             (type luks-device-mapping))))
   (file-systems
     (cons* (file-system
              (mount-point "/")
              (device "/dev/mapper/cryptroot")
              (type "btrfs")
              (dependencies mapped-devices))
            (file-system
              (mount-point "/boot")
              (device "/dev/mapper/cryptboot")
              (type "btrfs")
              (dependencies mapped-devices))
            (file-system
              (mount-point "/home/kreyren")
              (device "/dev/mapper/crypthome_kreyren")
              (type "btrfs")
              (dependencies mapped-devices))
            %base-file-systems)))
bash-5.0$ uname -r
5.14.14-gnu