After updating Alpine Linux on my VPS to version 3.14, I noticed that Midnight
mc) crashed with a segmentation fault around 90% of the time, and
at other times it ran, but refused to accept any input.
At first, I thought that it had to do with the OS update itself and something
was wrong with the version of
mc or some other package built in Alpine, so I
tried building mc with
ncurses instead of
slang as it was before, but to no
effect. To make matters worse, the bug disappeared when I tried to trace it in
Eventually, I figured out that the best way to find out the cause is to just
mc package with the debugging symbols. To do that in Alpine, you
need to modify the
APKBUILD file describing the package by adding a
$pkgname-dbg subpackage and setting a
!strip option, so that
doesn’t remove the debugging symbols and knows where to put them.
As a result, I was able to trace the bug to its source: a
operation that is called even though the pointer to the string is empty. As it
turned out, it’s a known issue listed as mc bug #4213.
Until the bug is fixed, the best option is to always run
mc with subshells
disabled. In my case, I just added the following string to my
alias mc='mc -u'