I'm having a strange crash - not sure if it's a problem with my code (well, 
not "my", but I'm trying to fix the issue) or tesseract. The stack trace 
looks like this:

#3  0x00007fdf1b7d4e0a in malloc_printerr (ar_ptr=<optimised out>, 
ptr=<optimised out>,
    str=0x7fdf1b8e20b2 "free(): invalid pointer", action=3) at malloc.c:5004
#4  _int_free (av=<optimised out>, p=<optimised out>, have_lock=0) at 
#5  0x00007fdf1b7d898c in __GI___libc_free (mem=<optimised out>) at 
#6  0x00007fdf1c14072b in TWERD::Clear() () from /usr/lib/libtesseract.so.3
#7  0x00007fdf1c15ae22 in WERD_RES::ClearResults() () from 
#8  0x00007fdf1c15c4e9 in WERD_RES::~WERD_RES() () from 
#9  0x00007fdf1c15c57e in WERD_RES_zapper(ELIST_LINK*) () from 
#10 0x00007fdf1c17e5f5 in ELIST::internal_clear(void (*)(ELIST_LINK*)) () 
from /usr/lib/libtesseract.so.3
#11 0x00007fdf1c155569 in ROW_RES_zapper(ELIST_LINK*) () from 
#12 0x00007fdf1c17e5f5 in ELIST::internal_clear(void (*)(ELIST_LINK*)) () 
from /usr/lib/libtesseract.so.3
#13 0x00007fdf1c155b19 in BLOCK_RES_c1_zapper(void*) () from 
#14 0x00007fdf1c17e5f5 in ELIST::internal_clear(void (*)(ELIST_LINK*)) () 
from /usr/lib/libtesseract.so.3
#15 0x00007fdf1bfe7392 in tesseract::TessBaseAPI::ClearResults() () from 
#16 0x00007fdf1bfe749f in tesseract::TessBaseAPI::InternalSetImage() () 
from /usr/lib/libtesseract.so.3
#17 0x00007fdf1bfe7581 in tesseract::TessBaseAPI::SetImage(Pix*) () from 
#18 0x00000000004157e7 in ocr_bitmap (arg=0x170d3d0, palette=0x25dad40, 
alpha=0x2828a80 "", indata=0xb0eddb0 "", w=720,
    h=36, copy=0x2a4f830) at ../src/lib_ccx/ocr.c:260
#19 0x000000000041797e in ocr_rect (arg=0x170d3d0, rect=0x29b9370, 
str=0x7ffc31572678, bgcolor=0, ocr_quantmode=0)
    at ../src/lib_ccx/ocr.c:807

The code at ../src/lib_ccx/ocr.c:225-260 is

        cpix = pixConvertRGBToGray(cpix, 0.0, 0.0, 0.0); // Abhinav95: 
Converting image to grayscale for OCR to avoid issues with transparency
        TessBaseAPISetImage2(ctx->api, cpix);

where ctx->api is obviously the tesseract handle and cpix is PIX *.
I don't know tesseract's internals, but what could be that free() call that 

The complete source code is here, in case someone has time to take a look 
at our whole thing: 



You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tesseract-ocr+unsubscr...@googlegroups.com.
To post to this group, send email to tesseract-ocr@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to