[neomutt-devel] Lua in neomutt | systematically finding segmentation faults

toogley toogley at nixnet.email
Tue Mar 2 20:27:55 CET 2021

Hello everybody,

1) Lua

tldr; i think Lua bindings are of no use at the moment and could be

So a few years ago, i suggested to implement lua bindings but i think i
have never really talked about the use-case. So a few years late i want
to explain what i thought back then.

So neomutt has a few quite complicated things, for instance index_format
or something:

set index_format='%4C %Z %<[y?%<[m?%<[d?%[%H:%M ]&%[%a %d]>&%[%b %d]>&%[%m/%y ]> %-15.15L (%?l?%4l&%4c?) %s'

i have seen some much more complicated examples but this gives you an
idea. So these things are not that readable and probably not so much
good to debug. So i thought, with some beautiful lua bindings this could
be made more readable.

But i think it is not worth the effort. Such index_formats are hard to
write but i think readability is not so important as you don't edit it
probably that often.

And the development effort is probably huge to make this more readable
and i think it is better to spend that on other parts of neomutt, for
instance the refactoring.

2) finding segmentation faults

tldr; OpenBSD is more strict about memory errors. We can use that in our
CI setup and create functional tests.

i've seen many times on github: users report crashes but either don't
include steps to reproduce, a good backtrace with debug symbols or other
things. And even then, devs have to try to reproduce that which is
sometimes hard.

And as far as i understand OpenBSD is more strict about memory errors
compared to most linux distros and crashes therefore more often when
something slightly is wrong.

So i thought: hey, we can use that for our advantage! We could rent a
builds.sr.ht machine and configure it so it runs with every pull
request. After building and running the tests, we can start the neomutt
binary with some very complicated neomutt configs and see if it crashes.

If it crashes, builds.sr.ht provides the ability to SSH into the build
VM. This is great because devs have automatically a working environment
where they can attach to gdb and look around. Probably it is also very

We could also try to start a mail server on localhost and send mails
with those complicated neomutt configs and see if it crashes.

But unfortunately i don't have time at the moment to implement that so
i'm writing here.

More information about the neomutt-devel mailing list