Bug 379093 - Spectacle logs user out of the system when user clicks Export image > Share > Save as
Summary: Spectacle logs user out of the system when user clicks Export image > Share >...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR crash
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-22 20:07 UTC by ruudolfs.strazdins
Modified: 2017-06-03 20:18 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 ruudolfs.strazdins 2017-04-22 20:07:29 UTC
User is logged out of the system and sent to SDDM when user takes a rectangular region screenshot, then clicks Export image > Share > Save as. Sometimes a very long error message is displayed on windows titled purposeprocess and it reads "Could not write to /home/rudis/Documents/Skola/Informātika/Tower defense/tHopQrstU(...)AAAl14id.part" (truncation mine). Sometimes it saves an image normally.

Steps to reproduce:
1. In spectacle, choose a rectangular region
2. Take a screenshot
3. Click Export image > Share > Save as
4. Choose directory /home/rudis/Documents/Skola/Informātika/Tower defense/
5. Click run
6. Spectacle either logs the user out, displays the very long error, or saves image normally

I could reproduce this only when I chose the directory/home/rudis/Documents/Skola/Informātika/Tower defense/ and took a screenshot of a specific image. Other directories with spaces or non-ASCII characters in the title worked fine.

Version: Spectacle 17.04 on KDE Neon 5.9
Comment 1 Boudhayan Gupta 2017-04-23 01:44:26 UTC
This bug is so mind-bogglingly bizarre, I can only recommend that you use the normal Save As button (click the little arrow beside Save & Exit), instead of going through the Export menu.
Comment 2 ruudolfs.strazdins 2017-04-23 16:06:56 UTC
And it gets even more bizarre because sometimes the SDDM screen is windowed with the system title bar visible. I could resize the window, move it around, etc. And there's a notification in the system tray widget that reads Copying data:[,,,].

Here's the image that I tried to screenshot: http://i.imgur.com/Wv7RqyU.png?1
And here's the very long error window: http://i.imgur.com/GifQhpw.jpg
And here's the error itself: http://i.imgur.com/Mw0lEoC.gifv

Maybe the option to save the image from Export > Share > Save as should be removed since the image can already be saved.
Comment 3 Boudhayan Gupta 2017-04-23 22:54:01 UTC
Aleix,

Hope you don't mind, I'm reassigning this to you. The GIF gives a clue to the problem - it's apparently setting the whole data uri of the image as the filename.
Comment 4 Aleix Pol 2017-05-31 01:17:03 UTC
This is a behavior of KIO:
$ kdecp5 "data:,Hello%2C%20World!" .
$ ls -ltr
-rw-r--r--  1 apol apol        13 mai 31 03:10 ',Hello, World!'
Comment 5 Aleix Pol 2017-05-31 02:16:47 UTC
Git commit d14d86f2d6ae290740c825622cc38feca7e885bb by Aleix Pol.
Committed on 31/05/2017 at 02:15.
Pushed by apol into branch 'master'.

Workaround for data: URIs

Enforce "data" as name, rather than letting KIO come up with a name

M  +41   -9    src/plugins/saveas/saveasplugin.cpp

https://commits.kde.org/purpose/d14d86f2d6ae290740c825622cc38feca7e885bb
Comment 6 David Faure 2017-06-03 20:18:37 UTC
Git commit aafa5b7bbc89301c478f8089d6738a4c5896bcac by David Faure.
Committed on 03/06/2017 at 20:17.
Pushed by dfaure into branch 'master'.

Use "data" as filename when copying data urls

M  +13   -0    autotests/jobtest.cpp
M  +1    -0    autotests/jobtest.h
M  +2    -1    src/core/copyjob.cpp

https://commits.kde.org/kio/aafa5b7bbc89301c478f8089d6738a4c5896bcac