Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now
4 of 8 deleted 57 characters in body

[not really an answer yet, sorry]

I can reproduce the bug with dash 0.5.8 from debian 9.8 stretch.

The current dash code from git.kernel.org doesn't show the bug.

Here is a simplified testcase:

for s in HUP INT; do
    trap '
        trap -- - '"$s"' EXIT || exit "$?"
        kill -s HUP -- "$$" || exit "$?" ' "$s"
kill -INT $$
$ dash dash-bug
dash-bug: 3: /home2/ahq/dash-bug: Syntax error: EOF in backquote substitution

Modifying the length or content of the quoted code may produce different and interesting corruptions, with random bytes appearing out of nowhere.

It remains to be seen if this severe heap corruption disappeared by accident in recent versions of dash (and it could be still triggered) or if it was properly fixed.