Bug #6398
Tails OpenPGP Applet hangs on large text
100%
Description
When trying to decrypt large text using gpgApplet, the applet becomes unresponsive:
- Encrypt a large piece of text: hexdump /bin/bash | gpg --armor --encrypt
- Copy to the clipboard.
- Decrypt using gpgApplet.
The applet starts a GnuPG command (gpg --batch --no-tty --armor --decrypt
) but does not terminate even after 45 minutes. Meanwhile, clicking on the gpgApplet does nothing.
Decrypting such text on the command line is almost instantaneous.
Subtasks
History
#1 Updated by intrigeri 2013-11-03 06:30:56
> When trying to decrypt large text using gpgApplet, the applet becomes unresponsive:
Given our OpenPGP applet has been around for quite long, and now the
first time we are reported this problem, I guess this is not a common
usecase. Therefore, I propose we make this ticket low priority.
#2 Updated by sajolida 2013-11-04 06:31:33
- Priority changed from Normal to Low
#3 Updated by nodens 2014-08-02 11:58:37
It looks like a buffering problem.
However simply set the “direct” option on $gnupg->handles causes illegal seeks / print to closed FH, since we use the same FH to check whether it’s a message or not. So it would need a different approach (duplicate filehandle ?).
#4 Updated by nodens 2014-08-02 13:49:47
- Subject changed from gpgApplet hangs on large text to Tails OpenPGP Applet hangs on large text
#5 Updated by BitingBird 2015-01-04 17:41:43
- Affected tool set to OpenPGP Applet
#6 Updated by nodens 2016-09-13 02:31:06
For what it’s worth, this problem still exists after switching to gpg2 and gtk3 (which confirm the probable buffering pb in perl)
#7 Updated by nodens 2017-10-09 13:10:20
- Assignee set to nodens
I had a look into it again.
The issue is indeed a buffer deadlock problem. Both openpgp-applet and the spawned gpg process lock on write while decrypting the large block.
Mail::Gnupg, using GnuPG::Interface as well, used to have a similar problem, until it switched to a select(2) based loop to read/write simultaneously from the gpg process: https://rt.cpan.org/Public/Bug/Display.html?id=21276#txn-407915
We should do the same.
#8 Updated by nodens 2017-10-09 19:25:29
- Status changed from Confirmed to In Progress
- % Done changed from 0 to 70
- Feature Branch set to bug/6398-hangs_on_large_text
First tests are good!
I pushed it on the corresponding branch of openpgp-applet git repo.
I need to test all the cases for unforeseen breakage, but it should be ready for review & merge soon.
#9 Updated by nodens 2017-10-09 20:18:03
- Assignee changed from nodens to intrigeri
- % Done changed from 70 to 80
- QA Check set to Ready for QA
Tests are OK on my side.
Assigning to intrigeri since I’m not sure anyone else is familiar with OpenPGP Applet code anymore (beside me).
#10 Updated by intrigeri 2017-10-16 08:00:59
- Feature Branch changed from bug/6398-hangs_on_large_text to nodens/openpgp-applet.git:bug/6398-hangs_on_large_text
#11 Updated by intrigeri 2017-10-16 08:05:59
- Assignee changed from intrigeri to nodens
- % Done changed from 80 to 90
- QA Check changed from Ready for QA to Dev Needed
- Wrt.
my $DEBUG = 0;
, I generally prefer the more flexiblemy $DEBUG = $ENV{'DEBUG'};
that allows one to enable debugging output without editing the program itself. - Please keep imports (
use
) sorted (Errno
).
Other than these minor nitpicks, looks good to me!
#12 Updated by nodens 2017-10-17 08:36:39
- Status changed from In Progress to Fix committed
- % Done changed from 90 to 100
- QA Check deleted (
Dev Needed)
intrigeri wrote:
> * Wrt. my $DEBUG = 0;
, I generally prefer the more flexible my $DEBUG = $ENV{'DEBUG'};
that allows one to enable debugging output without editing the program itself.
Good idea. Done.
> * Please keep imports (use
) sorted (Errno
).
Done as well, except for Locale stuff which makes more sens appart IMO (it’s more configuration than import since we define the TextDomain).
> Other than these minor nitpicks, looks good to me!
Thanks, merged!
Will mark as resolved on next OpenPGP applet release.
#13 Updated by anonym 2017-11-15 11:54:20
- Target version set to Tails_3.5
We didn’t get this fix in Tails 3.3.
#14 Updated by intrigeri 2017-11-18 10:43:43
anonym wrote:
> We didn’t get this fix in Tails 3.3.
I’ve filed Bug #14982 to track the workflow issue that anonym has noticed here.
#15 Updated by intrigeri 2017-12-23 08:32:48
- Target version changed from Tails_3.5 to Tails_3.6
(I doubt we’ll bump our APT snapshots again for 3.5, so even if a new upstream release was uploaded to sid and we added APT pinning to get it, we would not have it in Tails 3.5.)
#16 Updated by nodens 2018-02-05 11:58:37
- Subject changed from Tails OpenPGP Applet hangs on large text to Tails OpenPGP Applet hangs on large text (fixed upstream)
- Status changed from Fix committed to Confirmed
- Assignee deleted (
nodens) - Priority changed from Low to Normal
- Feature Branch deleted (
nodens/openpgp-applet.git:bug/6398-hangs_on_large_text)
This this is fixed upstream, and the fix is in Debian, let’s try to fix the workflow by updating some fields ;)
The actual thing to do is take a newer snapshot from Sid. Or I can provide a backport in stretch-backport but it looks like useless work since we currently use a Sid snapshot…
#17 Updated by intrigeri 2018-02-06 17:52:54
- Assignee set to intrigeri
I’ll take a look to see if we can trivially install the new package in 3.6.
#18 Updated by intrigeri 2018-02-07 13:47:21
- Status changed from Confirmed to In Progress
- Assignee changed from intrigeri to nodens
- % Done changed from 100 to 50
- QA Check set to Info Needed
nodens wrote:
> This this is fixed upstream, and the fix is in Debian
In which version is this fixed, exactly? I see nothing about this in the 1.0-2 changelog entry.
#19 Updated by nodens 2018-02-07 15:33:12
- QA Check changed from Info Needed to Dev Needed
You’re right, I got confused, sorry.
There wasn’t any release since the fix was commited _
So let’s release 1.1 - well, maybe postpone the actual release until openpgp-applet.pages.debian.net is actually reachable using TLS.
#20 Updated by intrigeri 2018-02-08 05:35:11
> So let’s release 1.1 - well, maybe postpone the actual release until openpgp-applet.pages.debian.net is actually reachable using TLS.
If that’s not planned to happen by the end of the month, I’d rather not block on this.
#21 Updated by nodens 2018-02-09 14:13:44
Let’s encrypt wildcard support is planned for 02/27.
I’ll try to find out if it’s planned to have it right away on pages.debian.net, but anyway we can always release on salsa and communicate only after the homepage is actually working.
#22 Updated by nodens 2018-02-25 18:20:41
Upstream issue: https://salsa.debian.org/openpgp-applet-team/openpgp-applet/issues/3
Not closing it here since there is Tails’ work to be done to have it in Tails.
#23 Updated by intrigeri 2018-02-26 08:34:47
> Not closing it here since there is Tails’ work to be done to have it in Tails.
Right. Please ping me here if OpenPGP Applet reaches the Debian archive in time for the 3.6 freeze!
#24 Updated by nodens 2018-02-26 21:22:21
- Assignee changed from nodens to intrigeri
The new version has been uploaded a moment ago. It should reach the archive soon :)
https://tracker.debian.org/news/936454
#25 Updated by intrigeri 2018-02-27 08:18:18
- Feature Branch set to feature/6398-openpgp-applet-1.1
#26 Updated by intrigeri 2018-02-27 08:42:50
- Subject changed from Tails OpenPGP Applet hangs on large text (fixed upstream) to Tails OpenPGP Applet hangs on large text
#27 Updated by intrigeri 2018-02-27 10:36:46
- Assignee changed from intrigeri to bertagaz
- QA Check changed from Dev Needed to Ready for QA
Passes (locally) all scenarios that use OpenPGP Applet.
#28 Updated by nodens 2018-02-27 13:32:38
FYI, manual tests on en_US and fr_FR are OK too.
#29 Updated by bertagaz 2018-02-28 13:03:34
- Status changed from In Progress to Fix committed
- Assignee deleted (
bertagaz) - % Done changed from 50 to 100
- QA Check changed from Ready for QA to Pass
Ok, passes manual and automated tests, so I’ve merged it so that it will be shipped in 3.6. Congats!
#30 Updated by bertagaz 2018-03-14 11:06:26
- Status changed from Fix committed to Resolved