Menu

Segmentation fault on MacOS

Help
martin
2006-12-18
2013-04-25
  • martin

    martin - 2006-12-18

    I downloaded and applied the MacOS patch which
    made the compilation work fine. However,

    "tesseract phototest.tif test"

    still produces

    "Segmentation fault"

    Does know anything about this? I've got a
    PowerBook G4.

    /Martin

     
    • ian stevens

      ian stevens - 2007-01-31

      Hi, I'm having the same problem.  The error is occurring with the following stacktrace:

      #0  0x00108d2c in reverse32 (ptr=0xa40000) at callcpp.cpp:251
      #1  0x000ef9a4 in read_squished_dawg (filename=0xbfffef68 "/Users/istevens/Desktop/tesseract-1.02/tessdata/word-dawg", dawg=0xa05000, max_num_edges=60000) at dawg.cpp:292
      #2  0x000e56bc in init_permute () at permute.cpp:1007
      #3  0x000b4078 in init_ms_debug () at msmenus.cpp:86
      #4  0x000ac5ec in program_editup (configfile=0x0) at tface.cpp:79
      #5  0x000ac84c in start_recog (configfile=0x0, textbase=0xbffff75e "test.txt") at tface.cpp:67
      #6  0x00005124 in init_tesseract (arg0=0xbffff71c "/Users/istevens/Desktop/tesseract-1.02/tesseract", textbase=0xbffff75e "test.txt", configfile=0x0, configc=0, configv=0xbffff668) at tessedit.cpp:125
      #7  0x000049cc in main (argc=3, argv=0xbffff660) at tesseractmain.cpp:70

      Problem is dawg.cpp:292 is in a block of code which is designated as Intel:

      (gdb) list 280,292
      280       #ifdef __UNIX__
      281       file = open_file (filename, "r");
      282       #else
      283       file = open_file (filename, "rb");
      284       #endif
      285       fread (&num_edges,  sizeof (int),      1, file);
      286       if (__NATIVE__==INTEL)
      287         reverse32(&num_edges);
      288       fread (&dawg[0], sizeof (EDGE_RECORD), num_edges, file);
      289       fclose(file);
      290       if (__NATIVE__==INTEL)
      291         for (edge=0;edge<num_edges;edge++)
      292           reverse32(&dawg[edge]);

      The values for edges seem invalid:

      (gdb) p num_edges
      $1 = 1673199616
      (gdb) p edge
      $2 = 60416
      (gdb) p max_num_edges
      $3 = 60000

      I don't think reverse32 should be called for PowerPC machines.  Not sure why __NATIVE__ is INTEL as ./configure found that my Powerbook is big-endian.  Appending #define MOTOROLA_BYTE_ORDER to config_auto.h got rid of the segfault, but now I get an error of "DAWG Table is too full, nodes = 2440, edges = 3052, moves 36", so that probably wasn't a good change to make.

      Does anyone have any ideas as to why Tesseract won't run on the Powerbook?

      thanks,
      Ian

       
    • ian stevens

      ian stevens - 2007-01-31

      BTW, I made the change documented at http://sourceforge.net/forum/message.php?msg_id=3949305 and everything now works.

       
    • Emmanuel Fleury

      Emmanuel Fleury - 2007-02-01

      You'd better use the 64bits port of Tesseract-OCR:
      cvs -d :pserver:anonymous@tesseract-ocr.cvs.sourceforge.net:/cvsroot/tesseract-ocr checkout -r bokeoa-64bit-branch tesseract-ocr

       

Log in to post a comment.