tesseract: Failed to open tr file: shapeclustering. Segmentation fault (core dumped)
Environment
- Tesseract Version: tesseract 5.0.0-beta-20210815-6-g1d3d
- Commit Number: unknown
- Platform: “Linux danort-pc 5.4.0-84-generic 94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux”
Current Behavior:
Segmentation fault (core dumped) on shapeclustering execution:
:~$ shapeclustering -F font_properties -U unicharset -O "separados.unicharset" separados.test.tr
Reading shapeclustering ...
Failed to open tr file: shapeclustering
Reading separados.test.tr ...
Segmentation fault (core dumped)
Expected Behavior:
Run without issues and produce a “shapetable” file
Suggested Fix:
Unknown
Also reported by someone else on Stack Overflow: https://stackoverflow.com/questions/67613545/tesseract-failed-to-open-tr-file-issue and it works fine on Tesseract v5.0.0-alpha.20200328
(Attachments: files generated before the shapeclustering command [while not really specifically needed to reproduce the issue]) FilesGeneratedAndNeededUpToTheFailureStep.zip
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (11 by maintainers)
Commits related to this issue
- Fix crash of shapeclustering (fixes #3564) Fixes: 4415209fd667 ("Remove tessopt. This fixes mastertrainer test in shared build") Signed-off-by: Stefan Weil <sw@weilnetz.de> — committed to stweil/tesseract by stweil 3 years ago
- Merge pull request #3565 from stweil/issue3564 Fix crash of shapeclustering (fixes #3564) — committed to tesseract-ocr/tesseract by egorpugin 3 years ago
I can reproduce the issue. It was introduced between commits d30b5415fddab7ae5e5bc7d3491e6ee9ce24ac0d (good) and dd8ee23fa2bffd2b12f3a3bca59a8a0d62432c1e (bad).
4415209fd667722039c1a2ad71ef81a4f4854771 is the first bad commit. The problem is that arg0 (the program name) is used as tr file instead of reading
separados.test.tr, see extract from initial report:When I run it using a path, for example with
./shapeclustering, it opens the executable and tries to interpret it as tr file.