~rjarry/aerc-devel

5 2

Panic when used from xdg-open

Details
Message ID
<CWXTIIXMCFP1.2IADPEGAINNVL@thomasvoss.com>
DKIM signature
missing
Download raw message
Hi,                                                                                       
                                                                                          
In an attempt to set aerc as my main email-client when clicking on                        
‘mailto’ links, I added the following line to my ~/.config/mimeapps.list:                 
                                                                                          
  [Default Applications]                                                                  
  …                                                                                       
  x-scheme-handler/mailto=aerc.desktop                                                    
                                                                                          
When I attempt to run the ‘xdg-open mailto:…’ however, aerc panics.  I’ve                 
pasted the generated log file here: https://paste.thomasvoss.com/358.                     
                                                                                          
--                                                                                        
— Thomas
Details
Message ID
<CWYFWZUJ93M7.2RSRUHOJTIZMG@ringo>
In-Reply-To
<CWXTIIXMCFP1.2IADPEGAINNVL@thomasvoss.com> (view parent)
DKIM signature
missing
Download raw message
Hi Thomas,

next time, it will be simpler if you include the panic trace directly 
inline:

################################################################################
                                  PANIC CAUGHT!
                        2023-11-13T17:09:49.360857+0100
################################################################################

aerc has encountered a critical error and has terminated. Please help us fix
this by sending this log and the steps to reproduce the crash to:
~rjarry/aerc-devel@lists.sr.ht

Thank you

Version: 0.15.2 +notmuch (go1.21.1 amd64 linux)
Error: input/output error

goroutine 1 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:24 +0x5e
git.sr.ht/~rjarry/aerc/log.PanicHandler()
	git.sr.ht/~rjarry/aerc/log/panic-logger.go:49 +0x66a
panic({0x55584965fe80?, 0x555849b4a548?})
	runtime/panic.go:920 +0x270
main.main()
	git.sr.ht/~rjarry/aerc/main.go:256 +0xbf8

I have checked in detail and I don't see how there could by any crash at 
line 256 of main.go for version 0.15.2. Are you using a patched version? 
What distro are you on?

The "input/output error" is rather obscure too.

PS: your message has trailing white space on *all* lines until column 
84. This is very weird, you should check your editor.

--------8<------------------------------------------------------------------
Hi,                                                                        =
              =20
                                                                           =
              =20
In an attempt to set aerc as my main email-client when clicking on         =
              =20
=E2=80=98mailto=E2=80=99 links, I added the following line to my ~/.config/=
mimeapps.list:                =20
                                                                           =
              =20
  [Default Applications]                                                   =
              =20
  =E2=80=A6                                                                =
                      =20
  x-scheme-handler/mailto=3Daerc.desktop                                   =
                =20
                                                                           =
              =20
When I attempt to run the =E2=80=98xdg-open mailto:=E2=80=A6=E2=80=99 howev=
er, aerc panics.  I=E2=80=99ve                =20
pasted the generated log file here: https://paste.thomasvoss.com/358.      =
              =20
                                                                           =
              =20
--                                                                         =
              =20
=E2=80=94 Thomas                                                           =
                      =20
------------------------------------------------------------------>8--------
Details
Message ID
<CWYG4HCHC6NE.3TG7V9TRLTKCP@thomasvoss.com>
In-Reply-To
<CWYFWZUJ93M7.2RSRUHOJTIZMG@ringo> (view parent)
DKIM signature
missing
Download raw message
Hi Robin,

> next time, it will be simpler if you include the panic trace directly 
> inline:
No worries, I’ll do that next time.

> I have checked in detail and I don't see how there could by any crash at 
> line 256 of main.go for version 0.15.2. Are you using a patched version? 
> What distro are you on?
Arch Linux.  I got Aerc straight from the ‘extra’ repositories, so it
shouldn’t have any weird patches or anything enabled.

> PS: your message has trailing white space on *all* lines until column 
> 84. This is very weird, you should check your editor.
That’s… odd.  I can’t say it’s ever happened before, but I’ll take a look
at it.  Thanks for the heads-up.

-- 
— Thomas
Details
Message ID
<CWYG6V371I7C.1RAU63E0TGU3I@thomasvoss.com>
In-Reply-To
<CWYG4HCHC6NE.3TG7V9TRLTKCP@thomasvoss.com> (view parent)
DKIM signature
missing
Download raw message
Just a quick something I noticed by the way.  Aerc is listed on the Arch
repos as being v1.16:

    $ pacman -Q aerc
    aerc 0.16.0-1

However despite having it ‘up-to-date’, Aerc claims I am running 1.15.2:

    $ aerc -v
    aerc 0.15.2 +notmuch (go1.21.1 amd64 linux)

Not sure if this is something you handle, or something that the Arch repo
maintainers need to handle, but just letting you know.

-- 
— Thomas
Details
Message ID
<CWYGGBF635HW.3L8MSLEXF4MW8@ringo>
In-Reply-To
<CWYG6V371I7C.1RAU63E0TGU3I@thomasvoss.com> (view parent)
DKIM signature
missing
Download raw message
Thomas Voss, Nov 14, 2023 at 11:03:
> Just a quick something I noticed by the way.  Aerc is listed on the Arch
> repos as being v1.16:
>
>     $ pacman -Q aerc
>     aerc 0.16.0-1

Ah that makes more sense now :)

I assume that you don't already have an aerc instance running and that 
you are clicking on a mailto: link.

What is happening is that aerc is started by xdg-open without a host 
terminal and cannot initialize the UI. The "input/output error" most 
likely occurs here:

https://git.sr.ht/~rjarry/aerc/tree/0.16.0/item/lib/ui/ui.go#L55

I am not sure why xdg-open is not starting a terminal but it may be 
because glib is not finding a suitable one. The preference order is 
here:

https://gitlab.gnome.org/GNOME/glib/-/blob/dd9bc7cf5956740f94acb4a0a7cd4945a9701449/gio/gdesktopappinfo.c#L2640-2650

If you run xdg-open manually from a terminal, it should start aerc and 
work properly (in theory). Also, if aerc is already running, it will 
start a composer in here.

> However despite having it ‘up-to-date’, Aerc claims I am running 1.15.2:
>
>     $ aerc -v
>     aerc 0.15.2 +notmuch (go1.21.1 amd64 linux)
>
> Not sure if this is something you handle, or something that the Arch repo
> maintainers need to handle, but just letting you know.

About the wrongly reported version. That's my fault. It has been fixed 
here (not released yet):

https://git.sr.ht/~rjarry/aerc/commit/d179485eefe50da9d21abdd392cffd865e369509
Details
Message ID
<CWYGMQONDHQH.1D7ZYDFLGWUK5@thomasvoss.com>
In-Reply-To
<CWYGGBF635HW.3L8MSLEXF4MW8@ringo> (view parent)
DKIM signature
missing
Download raw message
On Tue Nov 14, 2023 at 11:16 AM CET, Robin Jarry wrote:
> Thomas Voss, Nov 14, 2023 at 11:03:
> > Just a quick something I noticed by the way.  Aerc is listed on the Arch
> > repos as being v1.16:
> >
> >     $ pacman -Q Aerc
> >     Aerc 0.16.0-1
>
> Ah that makes more sense now :)
>
> I assume that you don't already have an Aerc instance running and that 
> you are clicking on a mailto: link.

You’re right in that I don’t have an existing instance running, but wrong
in that I am not clicking on a ‘mailto’ link.  I did do that too, but I
also just tried running xdg-open from the console directly.

Actually, here’s something interesting!  I was writing the following part
of this email in Aerc:

> Here’s what I get when I try using xdg-open in my terminal:
>
>     $ xdg-open mail@thomasvoss.com

and to get the output of the command, I ran the following (after closing
my current Aerc instance)

    $ xdg-open mail@thomasvoss.com |& wl-copy

Instead of panicking like it usually does, it seems that redirecting the
standard error away from a terminal caused it to actually behave
completely normally?  It just opened aerc with the mail filled in
properly!  I still get a panic if I don’t redirect though.

-- 
— Thomas
Reply to thread Export thread (mbox)