Initial version really by Pawel, but many changes in between.
Big outstanding issues:
* span cache reclamation (unbounded memory otherwise...)
* bad block service detection and workarounds
* corrupted blocks detection and workaround
Co-authored-by: Paweł Dziepak <pawel.dziepak@xtxmarkets.com>
The main thing that's added is full RS support, but a lot of things
were rejigged along the way. The tests are still a bit lacking,
and will be augmented in future commits.
It is currently very fragile, due to:
* Differing versions of compilers/DWARF version result in a variety
of breakages in the our code which analyzes the DWARF info;
* With musl, libunwind seems to be currently unable to traverse
beyond signal handlers, due to the DWARF information not
being present in the signal frame.
See <https://maskray.me/blog/2022-04-10-unwinding-through-signal-handler>.
Note that I have not verified that the problem in the blog
post above is indeed what we're hitting, but it seems plausible.
Also, produce fully static binaries. This means that `gethostname`
does not work (doesn't work with static glibc unless you build it
with `--enable-static-nss`, which no distro builds glibc with).