Like this: https://github.com/krkrz/krkr2/blob/master/kirikiri2/trunk/kirikiri2/src/cor...
I tried looking for differences, but that thing is huge and hard to follow, I couldn't find anything obviously relevant. The deadlocks, segfaults and timing dependencies make no sense either, Windows is usually pretty good at returning error codes instead.
...maybe I should run microkiri in Wine (!3938 edition), trace all calls into krmovie, make something headless that repeats them, submit that to testbot, and hope it doesn't return the same crazy segfaults. If it works, I can then trace all calls into VMR9 and reproduce that, then simplify it until I figure out what nonsense is going on here. That sure is some heavy work for testing a single function, but...