Been spending the better of part of the last few days scratching my head over this. Couldn't find related bugs in the DB here, but I could certainly have missed something. If this bug affects more than just me, I'd be very surprised if it wasn't brought up before or fixed in later versions.
I'm running MariaDB 10.4.13 on Arch Linux (the latest version in the Arch repo), InnoDB on my table, and am consistently crashing the database when attempting to create indexes/primary keys. I have removed a couple seemingly irrelevant lines from the log and changed the index/db/table/column names, but otherwise should be as-is. The log appears to be essentially the same for each crash. Downgrading to 10.4.12 seems to have fixed it for now, but for the longest time I had thought I was doing something wrong in my code and lost time on that. `mysqlcheck --all-databases` yielded no corrupt tables, but I deleted several random schemas that I had laying around just in case but to no avail. Connecting and executing queries via Flask-SQLAlchemy (v2.4.3, SQLAlchemy v1.3.17) engine, problem seemed to persist between DBAPI drivers, as well as directly running queries in MySQL Workbench.