https://bugs.openldap.org/show_bug.cgi?id=10472
--- Comment #4 from Howard Chu hyc@openldap.org --- Currently MSYS2's method of sending signals to Win32 processes just forces them to exit, without regard to any specified signal handlers. So in the test suite, slapd is always being killed uncleanly and exiting with a non-zero status.
I've patched my build of MSYS2 to fix this but the patch is unlikely to be accepted upstream because it would make the MSYS2 runtime look like malware.
https://github.com/msys2/msys2-runtime/pull/342
Also, while the patch is sufficient for our needs, it's not general enough to handle the case of a Windows64 environment running 32bit processes, or foreign architecture processes (e.g. running on Windows for ARM64, with x86/x86-64 target processes). I'm not sure it's worth pursuing this further.
Also there's another issue with current msys2-3.6.9; slapd built with msys2's build of Cyrus SASL 2.1.28 crashes on exit because sasl_done() corrupts the heap. For now, in order to make progress in running the test suite, I've commented out the invocation of slap_sasl_destroy() in slap_shutdown().
Later I may try to build Cyrus SASL from source and see what it's doing...