I've taken a look at this, it's a SDL2/Mesa issue (see here) which gets triggered with the KMSDRM video driver.
TL;DR - using SDL_Quit in an atexit handler will lead to a segfault in this particular scenario. Various other programs have implemented alternative ways to cleanup SDL's state without triggering this bug (see here, here or the patch sent by @psyke83 for gzdoom here).
We'll see if the upstream projects wants to prevent this crash, which otherwise is harmless.