Tess4J node - Execute failed: Invalid memory access

Hi,

I have just been (re)examing the Tess4J node for OCR, and I thought what better place to start than the Example_Tess4J workflow(!).  However, I get an error in the Tess4J node when I try to run this:

ERROR     Tess4J                             Execute failed: Invalid memory access

The full entry from the log file is pasted below.  I am on the very latest KNIME (2.10.2) and nightly build for the KNIP nodes.  Also I have Xmx set to 4096m in the knime.ini file.

Any help/advice would be greatly appreciated!

 

Kind regards

James

2014-09-23 15:50:52,705 DEBUG main Table Cell Viewer : reset
2014-09-23 15:50:52,706 DEBUG main Table Cell Viewer : clean output ports.
2014-09-23 15:50:52,706 DEBUG main NodeContainer : Table Cell Viewer 2:5 has new state: IDLE
2014-09-23 15:50:52,706 DEBUG main NodeContainer : Example_Tess4J 2 has new state: IDLE
2014-09-23 15:50:52,706 DEBUG main Tess4J : reset
2014-09-23 15:50:52,706 DEBUG main Tess4J : clean output ports.
2014-09-23 15:50:52,706 DEBUG main NodeContainer : Tess4J 2:4 has new state: IDLE
2014-09-23 15:50:52,707 DEBUG main Tess4J : Configure succeeded. (Tess4J)
2014-09-23 15:50:52,707 DEBUG main NodeContainer : Tess4J 2:4 has new state: CONFIGURED
2014-09-23 15:50:52,707 DEBUG main Table Cell Viewer : Configure succeeded. (Table Cell Viewer)
2014-09-23 15:50:52,707 DEBUG main NodeContainer : Table Cell Viewer 2:5 has new state: CONFIGURED
2014-09-23 15:50:52,707 DEBUG main NodeContainer : Example_Tess4J 2 has new state: CONFIGURED
2014-09-23 15:50:54,236 DEBUG main ExecuteAction : Creating execution job for 1 node(s)...
2014-09-23 15:50:54,237 DEBUG main NodeContainer : Tess4J 2:4 has new state: CONFIGURED_MARKEDFOREXEC
2014-09-23 15:50:54,237 DEBUG main NodeContainer : Tess4J 2:4 has new state: CONFIGURED_QUEUED
2014-09-23 15:50:54,238 DEBUG main NodeContainer : Example_Tess4J 2 has new state: EXECUTING
2014-09-23 15:50:54,239 DEBUG KNIME-Worker-6 WorkflowManager : Tess4J 2:4 doBeforePreExecution
2014-09-23 15:50:54,239 DEBUG KNIME-Worker-6 NodeContainer : Tess4J 2:4 has new state: PREEXECUTE
2014-09-23 15:50:54,239 DEBUG KNIME-Worker-6 WorkflowManager : Tess4J 2:4 doBeforeExecution
2014-09-23 15:50:54,240 DEBUG KNIME-Worker-6 NodeContainer : Tess4J 2:4 has new state: EXECUTING
2014-09-23 15:50:54,240 DEBUG KNIME-Worker-6 LocalNodeExecutionJob : Tess4J 2:4 Start execute
2014-09-23 15:50:54,240 DEBUG KNIME-Worker-6 WorkflowFileStoreHandlerRepository : Adding handler 5c16bb8e-38d6-47a2-a928-7eeeada04676 (Tess4J 2:4: <no directory>) - 4 in total
2014-09-23 15:50:54,252 DEBUG KNIME-WFM-Parent-Notifier NodeContainer : ROOT  has new state: EXECUTING
2014-09-23 15:50:54,525 DEBUG KNIME-TableIO-2 MemoryObjectTracker : Adding org.knime.core.data.container.Buffer$BufferMemoryReleasable (5 in total)
2014-09-23 15:50:54,527 DEBUG KNIME-Worker-6 Tess4J : reset
2014-09-23 15:50:54,527 ERROR KNIME-Worker-6 Tess4J : Execute failed: Invalid memory access
2014-09-23 15:50:54,527 DEBUG KNIME-Worker-6 Tess4J : Execute failed: Invalid memory access
java.lang.Error: Invalid memory access
    at com.sun.jna.Native.invokePointer(Native Method)
    at com.sun.jna.Function.invokePointer(Function.java:470)
    at com.sun.jna.Function.invoke(Function.java:404)
    at com.sun.jna.Function.invoke(Function.java:315)
    at com.sun.jna.Library$Handler.invoke(Library.java:212)
    at com.sun.proxy.$Proxy26.TessBaseAPIGetUTF8Text(Unknown Source)
    at net.sourceforge.tess4j.Tesseract.getOCRText(Tesseract.java:244)
    at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:185)
    at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:260)
    at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:158)
    at org.knime.knip.tess4j.base.node.Tess4JNodeModel.compute(Tess4JNodeModel.java:151)
    at org.knime.knip.tess4j.base.node.Tess4JNodeModel.compute(Tess4JNodeModel.java:1)
    at org.knime.knip.base.node.ValueToCellNodeModel$1.getCells(ValueToCellNodeModel.java:377)
    at org.knime.core.data.container.RearrangeColumnsTable.calcNewCellsForRow(RearrangeColumnsTable.java:493)
    at org.knime.core.data.container.RearrangeColumnsTable.calcNewColsSynchronously(RearrangeColumnsTable.java:413)
    at org.knime.core.data.container.RearrangeColumnsTable.create(RearrangeColumnsTable.java:347)
    at org.knime.core.node.ExecutionContext.createColumnRearrangeTable(ExecutionContext.java:369)
    at org.knime.knip.base.node.ValueToCellNodeModel.execute(ValueToCellNodeModel.java:506)
    at org.knime.core.node.NodeModel.executeModel(NodeModel.java:552)
    at org.knime.core.node.Node.invokeNodeModelExecute(Node.java:1099)
    at org.knime.core.node.Node.execute(Node.java:948)
    at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:529)
    at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
    at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:179)
    at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:110)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:120)
    at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:240)
2014-09-23 15:50:54,528 DEBUG KNIME-Worker-6 WorkflowManager : Tess4J 2:4 doBeforePostExecution
2014-09-23 15:50:54,528 DEBUG KNIME-Worker-6 NodeContainer : Tess4J 2:4 has new state: POSTEXECUTE
2014-09-23 15:50:54,528 DEBUG KNIME-Worker-6 WorkflowManager : Tess4J 2:4 doAfterExecute - failure
2014-09-23 15:50:54,528 DEBUG KNIME-Worker-6 Tess4J : reset
2014-09-23 15:50:54,528 DEBUG KNIME-Worker-6 Tess4J : clean output ports.

Hi James,

which OS are you currently using?

Thanks,

Christian

 

Hello James,

 

as Christian mentioned already, some details regarding your system would be much appreciated.
This may include operating system (incl. distribution, if linux), arch (32/64 bit?), maybe even version of libc/libc++ (if mac or linux).

Do you by chance already have a version of tesseract installed?

 

Thank you in advance,

Jonathan

Hi Jonathan (and Christian),

I am running Windows 7 pro (SP1) 64-bit.  As far as I am aware the only installation of tesseract-related stuff on my system has been via the KNIP nodes...  (there are, however, many other places on my system where msvcp110.dll and msvcr110.dll might be found - may not be relevent, but I thought I should mention it).

Kind regards

James

Hi James,

thank you for your answer, I will have a look at this and write again once the problem is resolved, or when further information could be useful.

Kind regards,

Jonathan

Hi,

I am getting the same error message when using the Tess4J Example workflow. This is on 64-bits Windows 7 Pro SP1. I am using Knime 2.11.2 with  KNIME Image Processing - Tess4J Integration 0.9.1.201409151349. I have adjusted the heap space to 4 Gb.

Please advice!

this problem just went up in our priority list. we will inform you as soon as we fixed the problem. You can also check: https://github.com/knime-ip/knip-tess4j/issues/5 for the current status.

Sorry for the hassle!

 

Christian

OK, thanks!

Have you resolved this issue yet maybe?

Hello oszem,

I just updated the github issue and I will do my best to fix this bug next week. Thank you for your patience!

Jonathan

Hi all,


Jonathan worked hard the last week and he was able to fix several bugs and even increase the overall performance of the Tess4J-Node. All these changes are available in our current nightly built! It would be great if you could double-check and see if everything works fine now.

Please let us know if you have any further problems!

Thank you,


Christian

I encountered the same error today.

ERROR Tess4J               0:16       Execute failed: Invalid memory access

I debugged it myself, and found the problem to be on the input side of this node. My data table contained multiple instances of the same image, that were altered versions of themself. Here is a screenshot of the input table:

If I included Source Image in the input, the error was produced, if I removed it from the input, and only inputted the 'real image' from the first column it works fine. So perhaps you guys could restrict the inputtype of this node somehow to prevent this error?

EDIT:

As inserting an image doesnt work on this forum here is the link: http://i.imgur.com/kUA2ySl.png

Hi Luuklag,

thank you very much for debugging this issue. That's brilliant support for us! I suppose you are running KNIME 3.0.1?  Can you tell me which OS?

We will fix this error as soon as possible.

Christian

Yes most recent update of KNIME. Running on Win 10 -  64 bit version.

I encountered this problem again, however now with a different set-up.

I have this table: http://prntscr.com/99ghtz When I feed this to OCR it gives the error, so I thought I'd split the columns. After doing that, and feeding both to a different OCR one worked and the other threw the same error again. The column Source Image worked, whilst the column (First)CroppedImg threw the error.

The (First)CroppedImg is made from the Source Image using the segment cropper.

Anyone that has a thought on how to fix this? As using the original image, the only one that works does not result in satisfactory results, whilst using a manually cropped image does.

Jonathan will work on this bug, this and/or next week!

Good to know. Thanks a lot.

Hi Luuklag, 

I will be working on this today. See https://github.com/knime-ip/knip-tess4j/issues/9 for updates.

Greetings, Jonathan

Hi Luuklag,

Jonathan pushed fix to the project (Thanks Jonathan!!). The fix will be available tomorrow with the nightly build. If you can confirm that the error is fixed, I'm happy to cut a release of tess4j.

 

Christian