Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1040907: aerc: Freeze when pasting to body on email compose

48 views
Skip to first unread message

Pelle

unread,
Jul 12, 2023, 5:20:05 AM7/12/23
to
Package: aerc
Version: 0.15.2-1
Severity: normal

Dear aerc maintainer,

I find that aerc almost always freezes when pasting into the compose area.

It can easily be reproduced here:
* Open aerc.
* Compose an email.
* Move cursor from headers onto the email body compose area.
* In another window, open a text editor, enter "hello world" 100 times and copy it.
* Back in aerc, paste into the compose area by `SHIFT+INSERT`
* Some of the text will be pasted, but then aerc will get stuck, sometimes like "hell|"
* Aerc stops responding to any input, including `CTRL+C`

I have tested an confirmed this is an issue whether using vim or nvim text editor, and whether using kitty, alacritty or foot terminal emulator.

-- System Information:
Debian Release: trixie/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.3.0-2-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages aerc depends on:
ii libc6 2.37-5
ii libnotmuch5 0.37-1+b1

Versions of packages aerc recommends:
ii dante-client 1.4.2+dfsg-7
ii gnupg 2.2.40-1.1
pn w3m <none>

Versions of packages aerc suggests:
ii notmuch 0.37-1+b1

-- no debconf information

Nilesh Patra

unread,
Jul 13, 2023, 1:40:04 PM7/13/23
to
Hi,

On Wed, 12 Jul 2023 11:09:03 +0200 Pelle <pe...@riseup.net> wrote:
> Package: aerc
> Version: 0.15.2-1
> Severity: normal
>
> I find that aerc almost always freezes when pasting into the compose area.
>
> It can easily be reproduced here:
> * Open aerc.
> * Compose an email.
> * Move cursor from headers onto the email body compose area.
> * In another window, open a text editor, enter "hello world" 100 times and copy it.
> * Back in aerc, paste into the compose area by `SHIFT+INSERT`
> * Some of the text will be pasted, but then aerc will get stuck, sometimes like "hell|"
> * Aerc stops responding to any input, including `CTRL+C`
>
> I have tested an confirmed this is an issue whether using vim or nvim text editor, and whether using kitty, alacritty or foot terminal emulator.

Thanks for reporting this, and I can confirm the behavior. @Robin, is
this an issue known to you as upstream?
Could you please take a look at this?

Best,
Nilesh
signature.asc

Robin Jarry

unread,
Jul 14, 2023, 12:00:06 PM7/14/23
to
Nilesh Patra, Jul 13, 2023 at 19:27:
Hi Nilesh,

I cannot reproduce this but maybe Tim can have a look.

What editor is this?

Nilesh Patra

unread,
Jul 14, 2023, 12:10:06 PM7/14/23
to
On Fri, Jul 14, 2023 at 05:49:41PM +0200, Robin Jarry wrote:
> I cannot reproduce this but maybe Tim can have a look.

This is an upstream bug, and I can repro it by building aerc via make,
i.e. there are no debian go packages at play here.

Interestingly, this bug does not get triggered when I use micro as my
editor (a golang based text editor).

Here's the way I could reproduce:

$ for in in {0..100}; do echo 'hello world' >> /tmp/hwl; done
$ cat /tmp/hwl | xclip -sel clipboard
$ EDITOR=vim ./aerc

:compose

Goto the body and try paste using ctrl+shift+v or shift+Ins (whatever
bindings are default for your terminal). You'll see it hanging --
sometimes with half-pasted text.

I get the same result when I try with EDITOR=nano.

Best,
Nilesh
signature.asc

pelle

unread,
Jul 14, 2023, 12:30:06 PM7/14/23
to
> Robin and I are both on wayland...I'm guessing with xclip you are on X? I wonder
> if that comes into play at all?

I'm having the issue in Sway. I've noticed that the freeze happens in vim when pasting with `CTRL+V` or `SHIFT+INSERT` while pasting works fine with `p`.

Nilesh Patra

unread,
Jul 14, 2023, 1:20:05 PM7/14/23
to
On Fri, Jul 14, 2023 at 11:19:32AM -0500, Tim Culverhouse wrote:
> I also can't repro. I tried pasting "hello world\n"x100, and "hello world"x100
> (all on the same line), both in vim and nvim, and in foot and wezterm - all of
> those combinations work.

I tried with qterminal, kitty and deepin-terminal and I could repro it in
all the three. I really doubt if it is specific to terminal.

And... I tried with wezterm. It worked on first try, but on trying to
paste the text 2-3 times in a row (on the same compose area) I'm able to
see a hang.

Are you using debian though?

> Robin and I are both on wayland...I'm guessing with xclip you are on X? I wonder
> if that comes into play at all?

It does not. I tried with a KDE with wayland now, and can repro.

Best,
Nilesh
signature.asc

Nilesh Patra

unread,
Jul 14, 2023, 1:40:05 PM7/14/23
to
On Fri, Jul 14, 2023 at 12:25:37PM -0500, Tim Culverhouse wrote:
> On Fri Jul 14, 2023 at 12:14 PM CDT, Nilesh Patra wrote:
> > And... I tried with wezterm. It worked on first try, but on trying to
> > paste the text 2-3 times in a row (on the same compose area) I'm able to
> > see a hang.
>
> Are you in insert mode when pasting?

Ofcourse!

> > Are you using debian though?
>
> No, I'm on Arch
> (btw).
^^^

Lol.

Best,
Nilesh
signature.asc

Nilesh Patra

unread,
Jul 14, 2023, 2:00:06 PM7/14/23
to
I fiddled a bit and noticed that it works OK on aerc 0.14.0 and I notice
the odd behavior on aerc 0.15.0.

Something changed between these two which causes it to explode.

Best,
Nilesh
signature.asc

Nilesh Patra

unread,
Jul 14, 2023, 2:10:05 PM7/14/23
to
On Fri, Jul 14, 2023 at 07:47:33PM +0200, Robin Jarry wrote:
> After aerc has died, share the trace.log file contents. Ideally via
> paste service, lists.sr.ht bounce emails that have attachments.

There you go

https://pb.envs.net/?816fb8c61575e2ba#4kD2xS4wJMGrsCd8tBhPfqHDJZ7qeM6qERaobgoYj46F

Best,
Nilesh
signature.asc

Koni Marti

unread,
Jul 14, 2023, 2:20:05 PM7/14/23
to
I can reproduce the issue on the released version (0.15.2). However, it
seems fixed on current master. I think commit 9a20640f ("ui: avoid races
with queue redraw") fixed this issue as well.

If I read your log correctly, you are running 0.15.0. Could you maybe
try the latest master?

Nilesh Patra

unread,
Jul 14, 2023, 2:30:05 PM7/14/23
to
I did a bisect meanwhile and found the commit that broke it.
Didn't review the diff but probably some race condition sneeked in
somewhere.

c7b122f4c4a87cd54402c78465e1a5c882f37aeb is the first bad commit
commit c7b122f4c4a87cd54402c78465e1a5c882f37aeb
Author: Tim Culverhouse <t...@timculverhouse.com>
Date: Sun Apr 23 08:01:23 2023 -0500

tcell-term: upgrade to latest release

Upgrade tcell-term to latest release.

This is a complete rewrite of tcell-term, and includes many minor bug
fixes and overall improvements. Notably:

- Improved parsing
- One fewer goroutine
- Improved API
- Improved redraw messaging
- Improved key support
- Improved mouse support

Signed-off-by: Tim Culverhouse <t...@timculverhouse.com>
Acked-by: Robin Jarry<ro...@jarry.cc>

go.mod | 6 +++---
go.sum | 10 +++++++---
widgets/terminal.go | 35 +++++++++++++++++++----------------
3 files changed, 29 insertions(+), 22 deletions(-)

Best,
Nilesh
signature.asc

Nilesh Patra

unread,
Jul 14, 2023, 2:40:06 PM7/14/23
to
On Fri, Jul 14, 2023 at 08:13:16PM +0200, Robin Jarry wrote:
> Nilesh Patra, Jul 14, 2023 at 19:59:
> Thanks a lot that helps. It looks like there is a deadlock due to two
> goroutines trying to interact with the terminal:

I'm going ahead with an upload in debian with this patch backported.
From a distro pov I consider this a major breakeage. Given that aerc is
designed to facilitate patch workflow as a goal, it makes it useless if
I can't paste more than 4-5 lines in one go.

If you disagree, feel free to revert the upload. You have the rights.

Best,
Nilesh
signature.asc

Nilesh Patra

unread,
Jul 14, 2023, 3:10:05 PM7/14/23
to
On Fri, Jul 14, 2023 at 09:02:31PM +0200, Robin Jarry wrote:
> Nilesh Patra, Jul 14, 2023 at 20:35:
> Sure thing. It is certainly less risky than tagging a release in a rush.

Thanks a lot for quick response and the patch!

Best,
Nilesh
signature.asc
0 new messages