Created attachment 681067 [details, diff]
When built with link time optimization, timidity binds to the wrong version of some symbols in libasound.so.2. This happens because it uses the old 0.9 API (it defines ALSA_PCM_OLD_HW_PARAMS_API), and in this case the alsa headers emit some global asm statements with .symver directives to make the linker bind to the old versions. That doesn't work with LTO, though: the asm statements and the code referencing the affected symbols may end up in different partitions, making the .symver statements ineffective.
So the real problem is in the alsa headers, but there's no easy way to fix it (at least for gcc before version 10). So I think we should fix the issue in timidity.
The attached patch contains a workaround for timidity; it disables LTO for the alsa backend. With the patch applied, timidity uses the correct version of the symbols and no longer causes segmentation faults in my tests.