Closed stweil closed 1 year ago
Thanks. Was that found by coverity scan?
No, only indirectly. I had run pageseg_reg
to examine a leak which was reported by coverity scan and detected this one.
Dan, Stefan,
How about adding a workflow that uses clang sanitizers with all Leptonica's programs? You can set it to run daily or weekly.
That might be too much for me to deal with, even assuming it is possible somehow to turn 300 programs into sanitizers. One thing we learned about sanitizers is that you don't want to test existing I/O libraries with it (it finds stuff you can't deal with), so for functions that need an image (most do), you need to use a simple encoding scheme -- Adam Korczynski and I settled on spix (un-encoded raster image) for payloads.
A first result of a local test with sanitizer flags shows indeed many issues (mainly from graphic libraries), but also detected the issue which I fixed in pull request #652.
The address sanitizer deteced some more issues. I added fixes for those to #652 now.
Stefan,
Another thing you can run on Leptonica's codebase is clang-tidy (it also has all the default checkers included by scan-build).
Signed-off-by: Stefan Weil sw@weilnetz.de