tesseract icon indicating copy to clipboard operation
tesseract copied to clipboard

App crash ucrtbase.dll when using TesseractEngine

Open Norc89 opened this issue 4 years ago • 3 comments

Hi, In step where i'm using TesseartEngine i get random crash from TesseractEngine. When this crash happen none try/catch/handling can help also the Visual studio just stop debugging. Crash i get when reading from page.

                var text = page.GetText();
                readedText.AppendLine(text);
                using (var iter = page.GetIterator())
                {
                    iter.Begin();
                    do
                    {
                        do
                        {
                            do
                            {
                                do
                                {  
                                    readedText.AppendLine(iter.GetText(PageIteratorLevel.Word));                                    
                                } while (iter.Next(PageIteratorLevel.TextLine, PageIteratorLevel.Word));
                            } while (iter.Next(PageIteratorLevel.Para, PageIteratorLevel.TextLine));
                        } while (iter.Next(PageIteratorLevel.Block, PageIteratorLevel.Para));
                    } while (iter.Next(PageIteratorLevel.Block));
                }

to_blocks->singleton():Error:Assert failed:in file C:\Users\charl\Development\tesseract-native\tesseract\src\ccmain\pagesegmain.cpp, line 305

Faulting module name: ucrtbase.dll, version: 10.0.17763.719, time stamp: 0xa18cd287 Exception code: 0xc0000409 Fault offset: 0x000a522b

Norc89 avatar Mar 31 '21 10:03 Norc89

Does your OS have AVX2 enabled? I'm not familiar with that specific symptom but some versions crash if they don't have AVX2 instructions available. 5.0 and newer does not have that problem.

tdhintz avatar Mar 31 '21 11:03 tdhintz

AVX2 instructions shouldn't be a problem in the latest/released version as library has been compiled with them disabled. I'd also expect it to reliably crash, i.e. whenever it executed that instruction.

What version of .net are you targeting?

On Wed, 31 Mar 2021, 22:04 Hintz, @.***> wrote:

Does your OS have AVX2 enabled? I'm not familiar with that specific symptom but some versions crash if they don't have AVX2 instructions available. 5.0 and newer does not have that problem.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/charlesw/tesseract/issues/548#issuecomment-810978093, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB7HSCFM7ENIVXRTJW25TLTGL6VJANCNFSM42EIVDGA .

charlesw avatar Mar 31 '21 20:03 charlesw

I can't speak to this specific build, but normally AVX2 detection at run-time is dynamic.

tdhintz avatar Mar 31 '21 20:03 tdhintz