It looks like memory corruption, as the minor GC is moving a block where the header claims a size of more than 1TB.
I’ll need a bit more time to find where the corruption occurs.
If you want to look at it yourself too, I used rr record ./_build/default/getdents.exe foo/ until it failed, and then rr replay to get into the debugger, cont (in the debugger) to let the program go until the failure, and then a mix of reverse-* instructions to go back to the failing allocation.