Community

EXCEPTION_ACCESS_VIOLATION in Image.Helper.Pdf.dll when calling AddImageFileFromMemory

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.


Was this article helpful?

0 out of 0 found this helpful

Comments

5 comments

  • Avatar
    SDK_support

    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.

    0
  • Avatar
    Permanently deleted user

    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

    0
  • Avatar
    Permanently deleted user

    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);
    
    0
  • Avatar
    Permanently deleted user

    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).

    1
  • Avatar
    Permanently deleted user

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

    0

Please sign in to leave a comment.