openalpr / openalpr

Automatic License Plate Recognition library
http://www.openalpr.com
GNU Affero General Public License v3.0
11.05k stars 2.5k forks source link

Stack around the variable 'ctype' was corrupted. #154

Closed peters closed 9 years ago

peters commented 9 years ago

@matthill ,

Toolset: Visual Studio 2013 x64

I'm experiencing a "Run-Time Check Failure 2" when running the debug build of OpenALPR. This does not happen in the release build. I've done some investigation and the problem is located at:

https://github.com/openalpr/openalpr/blob/6308048d84c5dcee4d5135da9cb2f44e8e68eb38/src/openalpr/postprocess/regexrule.cpp#L78

https://github.com/openalpr/openalpr/blob/6308048d84c5dcee4d5135da9cb2f44e8e68eb38/src/openalpr/postprocess/regexrule.cpp#L82

If you change the double backward slash to a single forward slash (\\p -> \p), it works.

Attached screenshot:

image

peters commented 9 years ago

This patch allows me to develop in debug mode: https://gist.github.com/peters/8dd900ab8a8e5af17aa3

peters commented 9 years ago

@matthill Is the commit related to this issue?

peters commented 9 years ago

@matthill Could r2 replace oniguruma ? It supports unicode https://github.com/google/re2/wiki/Syntax

matthill commented 9 years ago

I looked at it when I was researching options. However, this made me disqualify it:

No attempt has been made to make RE2 compile on Windows, but if anyone would like to try, patches would be welcomed.

Onigurama required some patches to run on Windows, too. So maybe re2 would have been the better choice. I've used it on a different project and it worked great.

peters commented 9 years ago

Issue is now solved since the regex engine has been replaced by RE2.