Hi all,

I'm using Tesseract 3.03a on Mac OS X 10.9, built with Apple's tools 
(clang/++).  I was playing around with the Viewer described in 
http://code.google.com/p/tesseract-ocr/wiki/ViewerDebugging
 and tried changing the value of some config parameters by right-clicking 
in the Editor image window, choosing some parameter from the menu and 
entering a new value for it. However doing so had no effect, aside from 
causing the console to spit out: "w1:Setting ERROR: ParamContent::GetName() 
to"

I debugged with LLDB, and it turned out that in the ParamsEditor::Notify() 
method (in ccmain/paramsd.cpp) the ParamContent object returned was somehow 
getting its "param_type_" member messed with so that it ended up with a 
value other than its allowed values of 0, 1, 2 or 3 (corresponding to 
(VT_INTEGER, VT_BOOLEAN, VT_DOUBLE and VT_STRING).

Setting a watchpoint at the memory location of param_type_ of one of the 
ParamContent objects led me to discover that as soon as 
theParamsEditor::BuildListOfAllLeaves() method returns, the destructor for 
the local ParamContent_LIST object (vcList) gets called which in turn 
"zaps" all its elements. This is the backtrace from LLDB:

/**********************/
* thread #1: tid = 0x2dde5d, 0x00007fff94c3ff5f 
libsystem_malloc.dylib`tiny_free_list_add_ptr + 124, queue = 
'com.apple.main-thread, stop reason = watchpoint 1
    frame #0: 0x00007fff94c3ff5f 
libsystem_malloc.dylib`tiny_free_list_add_ptr + 124
    frame #1: 0x00007fff94c3c1ae 
libsystem_malloc.dylib`szone_free_definite_size + 1992
    frame #2: 0x00000001000639bd 
tesseract`ParamContent_zapper(link=0x0000000100c51330) + 45 at 
paramsd.cpp:55
    frame #3: 0x000000010026711a 
tesseract`ELIST::internal_clear(this=0x00007fff5fbfeaa0, 
zapper=0x0000000100063990)(ELIST_LINK*)) + 106 at elst.cpp:58
    frame #4: 0x00000001000682cc 
tesseract`ParamContent_LIST::clear(this=0x00007fff5fbfeaa0) + 28 at 
paramsd.h:86
    frame #5: 0x0000000100068291 
tesseract`ParamContent_LIST::~ParamContent_LIST(this=0x00007fff5fbfeaa0) + 
17 at paramsd.h:86
    frame #6: 0x0000000100066905 
tesseract`ParamContent_LIST::~ParamContent_LIST(this=0x00007fff5fbfeaa0) + 
21 at paramsd.h:86
    frame #7: 0x0000000100065264 
tesseract`ParamsEditor::BuildListOfAllLeaves(this=0x0000000100c46e60, 
tess=0x0000000101800000) + 3540 at paramsd.cpp:266
    frame #8: 0x000000010006594d 
tesseract`ParamsEditor::ParamsEditor(this=0x0000000100c46e60, 
tess=0x0000000101800000, sv=0x0000000100c46d50) + 253 at paramsd.cpp:301
    frame #9: 0x0000000100065845 
tesseract`ParamsEditor::ParamsEditor(this=0x0000000100c46e60, 
tess=0x0000000101800000, sv=0x0000000100c46d50) + 37 at paramsd.cpp:319
    frame #10: 0x0000000100069fcd 
tesseract`tesseract::Tesseract::pgeditor_main(this=0x0000000101800000, 
width=640, height=480, page_res=0x0000000100c5b170) + 205 at pgedit.cpp:350
    frame #11: 0x00000001000067fc 
tesseract`tesseract::TessBaseAPI::Recognize(this=0x00007fff5fbff998, 
monitor=0x0000000000000000) + 1100 at baseapi.cpp:845
    frame #12: 0x000000010000785f 
tesseract`tesseract::TessBaseAPI::ProcessPage(this=0x00007fff5fbff998, 
pix=0x0000000100d00e40, page_index=0, filename=0x00007fff5fbffcbc, 
retry_config=0x0000000000000000, timeout_millisec=0, 
renderer=0x0000000100d00e00) + 383 at baseapi.cpp:1153
    frame #13: 0x0000000100007285 
tesseract`tesseract::TessBaseAPI::ProcessPages(this=0x00007fff5fbff998, 
filename=0x00007fff5fbffcbc, retry_config=0x0000000000000000, 
timeout_millisec=0, renderer=0x0000000100d00e00) + 613 at baseapi.cpp:1025
    frame #14: 0x000000010000201d tesseract`main(argc=5, 
argv=0x00007fff5fbffb48) + 5485 at tesseractmain.cpp:295
    frame #15: 0x00007fff87b915fd libdyld.dylib`start + 1
    frame #16: 0x00007fff87b915fd libdyld.dylib`start + 1
/**********************/

My C++ is a bit fuzzy, so I'm not sure if this is to be expected; I can see 
that "vclist" is no longer in scope and hence is expected to be destroyed 
-  but there's also the consideration that the static variable "vcMap" 
holds pointers to the ParamContent objects. (I'm more used to Objective-C 
with automatic reference counting, hence my confusion!) Is this a bug?




-- 
-- 
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to