We have been having random crashes when running the SF2SearchEx function. We use this for character recognition so we loop around this function x10 passing in each character model. We know the area of where these characters are located so we set the (Left, Top, Right, Bottom) image co-ordinates.
Although not the actual code we use on our system I have managed to make a quick test function to prove the fault. All the models are the same and the image is also the same each time I have made it so the search area changes each time but I can get it to happen very quickly on a fixed area.
See below the function I have created to force this fault using these fixed Co-Ordinate variables,
I am using Windows 10, Stemmer Version V13.04.000 (32 bit).
Thank you very much for the concise description, that was very helpful! I can confirm what you describe and I already have an idea what the reason is. If my assumptions turn out to be correct then I think I’ll be able to provide a fix early next week.
I will have a new build for you on Monday. The problem is now understood and has to do with the fact that the AOI is extending beyond the bottom edge of the image (image height is 300 - highest acceptable value for bottom is therefore 299) and will only occur if the search is limited to an AOI (as opposed to searching in the entire image). Of course this kind of situation must be handled gracefully, but due to a misconception in the creation of the internally used accumulator and a rounding effect the access does in fact touch unallocated memory, which gives rise to the access violation you saw.
Luckily the fix was not too complicated (correct the malformed generation of the accumulator so that it is robust versus the aforementioned rounding effect). As soon as the fixed version has passed the build and test farm I’ll post it here.