Debug why MySQL/mariadb table is crashing
Turns out I ran into this 5-yr-old bug: http://bugs.mysql.com/bug.php?id=54828 in combination with a leftover (no idea from where) zero-byte file.

How I debugged it: I set up the query log:

set global general_log 'mysql.log';
set global general_log = 'ON';


which turned out to write to a file far below /tmp/systemd-private... because I'm running systemd. tail -f that file showed the crash happened when the application I'm running executed "OPTIMIZE TABLE".

Invoking that manually showed error message:

Can't create new tempfile: '/var/lib/mysql/zxnifltlapzlcumb/items.TMM'
Operation failed    


and that happened because a month-old zero-byte file already was in that place. I deleted it, and the problem went away.