Hi.

We are using Java under Windows to call the FineReader Engine 11. Sometimes, when executing the code below, an EXCEPTION_ACCESS_VIOLATION occurs in Image.Helper.Pdf.dll and the Java Virtual Machine is terminated.

Here's the relevant code:

public void train(IEngine engine, String targetClass, byte[] pdfContent, int page) { IFRDocument rawDocument = engine.CreateFRDocument(); IPrepareImageMode pim = ... rawDocument.AddImageFileFromMemory(pdfContent,null, pim, null, "some.pdf"); ... }

The error occurs when calling rawDocument.AddImageFileFromMemory. It does not seem to be related to a single, possibly broken PDF file. For different PDFs calling AddImageFileFromMemory works most of the time, while occasionally we get the EXCEPTION_ACCESS_VIOLATION error.

Any hint on how to fix or circumvent this error would be highly appreciated

Kind Regards

Bernd

Here's the error as reported by the JVM


A fatal error has been detected by the Java Runtime Environment:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000000a00aa9e, pid=5868, tid=5072

JRE version: 7.0_25-b17 Java VM: Java HotSpot(TM) 64-Bit Server VM (23.25-b01 mixed mode windows-amd64 compressed oops) Problematic frame: C [Image.Helper.Pdf.dll+0xaa9e] GetAPDFLWrapper+0x93de

Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

An error report file with more information is saved as: C:\Users\myhome\eclipse\hs_err_pid5868.log

If you would like to submit a bug report, please visit: http://bugreport.sun.com/bugreport/crash.jsp The crash happened outside the Java Virtual Machine in native code. See problematic frame for where to report the bug.


asked 15 Apr '14, 18:17

bernd's gravatar image

bernd
112


I would like to add that the OpenImageFileFromMemory does not work if the Engine object is created using the OutprocLoader object. You could find this remark in the "OpenImageFileFromMemory Method of the Engine Object" article of the Developer's Help (section Remarks).

link

answered 10 Apr '15, 15:11

Natalia%20Karaseva's gravatar image

Natalia Kara...
3214

We would be very grateful if you send the description of the issue and all related materials to this e-mail TechSupport_eu@abbyy.com.

link

answered 16 Apr '14, 13:56

SDK_support's gravatar image

SDK_support ♦♦
2763

I got the same error today when opening a PDF file with a call to engine.OpenImageFileFromMemory:

A fatal error has been detected by the Java Runtime Environment:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000000d11abae, pid=4564, tid=540

JRE version: Java(TM) SE Runtime Environment (7.0_51-b13) (build 1.7.0_51-b13)

Java VM: Java HotSpot(TM) 64-Bit Server VM (24.51-b03 mixed mode windows-amd64 )

Problematic frame:

C [Image.Helper.Pdf.dll+0xabae]

Core dump written. Default location: W:\jboss-7.1.1\bin\hs_err_pid4564.mdmp

...

Stack: [0x0000000020830000,0x0000000020930000], sp=0x000000002092bf50, free space=1007k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [Image.Helper.Pdf.dll+0xabae]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j com.abbyy.FREngine.IEngine.OpenImageFileFromMemory([BLcom/abbyy/FREngine/IImagePasswordCallback;Lcom/abbyy/FREngine/IPrepareImageMode;Ljava/lang/String;)Lcom/abbyy/FREngine/IImageDocument;+0 j com.real.aof.tools.utils.ExtractTextAndConvertToPdf.getPreprocessedImageDocument([B)Lcom/abbyy/FREngine/IImageDocument;+30

link

answered 08 Apr '15, 16:32

maol's gravatar image

maol
2911

For info, I found the cause of the exception: I had multiple threads trying to process documents at the same time. The engine is not thread-safe by default.

I had to create the engine by using:

engineLoader = Engine.CreateEngineOutprocLoader();
engine = engineLoader.GetEngineObject(serialNumber);
link

answered 10 Apr '15, 12:46

maol's gravatar image

maol
2911

Indeed, I needed to use FRDocument.AddImageFileFromStream instead to make it work with OutprocLoader.

link

answered 10 Apr '15, 15:42

maol's gravatar image

maol
2911

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×58
×47
×46
×9

Asked: 15 Apr '14, 18:17

Seen: 2,398 times

Last updated: 10 Apr '15, 15:42

© 2016 ABBYY. All rights Reserved. www.ABBYY.com | Privacy Policy | Legal