A user - maybe it was you? - already reported a crash of str_cmpi some time ago and we thoroughly checked that function on that occasion. So I'm pretty sure that str_cmpi is flawless. However it may have something to do with the rest of your project.
For instance, when internal memory is overwritten over the end of a STRING struct, then functions like str_cmpi can indeed crash. Overwriting internal memory can happen, for instance, by loading a file with faulty content.