Answer the question
In order to leave comments, you need to log in
How to understand and fix EXCEPTION_ACCESS_VIOLATION when calling jni method when using packer in exe file javafxpackager and x86_64 version of java?
I'm on the task of developing a java application installer that uses the rhvoice
speech synthesis voice engine . The main goal is to eliminate the requirement for administrator rights. This means you can't use the sapi version of the engine, as it requires privilege escalation to install it.
The solution is quite simple, the necessary code is already in the rhvoice project for android, you need to make a minimum of formal changes in order to build the jni library for windows (they are assembled immediately for both x86 and x86_64 architectures).
In general, both dlls are built, and the java application successfully uses them and everything works on both architectures if you run the application using the java virtual machine.
But if you assemble the resulting application (a set of jar files, rhvoice language pack data and compiled dlls) using javafxpackager (this is a regular javafx application for building an exe version that uses jvm.dll that comes with java) or the same packr , then when you start The 64-bit version throws an exception (the 32-bit version works without problems):
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff83fa36b2d, pid=110316, tid=0x0000000000019f60
#
# JRE version: OpenJDK Runtime Environment (8.0_201-b09) (build 1.8.0_201-1-ojdkbuild-b09)
# Java VM: OpenJDK 64-Bit Server VM (25.201-b09 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [RHVoice.64.dll+0x6b2d]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
...
Stack: [0x000000dd61600000,0x000000dd61ad0000], sp=0x000000dd61acf030, free space=4924k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [RHVoice.64.dll+0x6b2d]
C 0x000002990001962e
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.github.olga_yakovleva.rhvoice.TTSEngine.doGetVoices()[Lcom/github/olga_yakovleva/rhvoice/VoiceInfo;+0
j com.github.olga_yakovleva.rhvoice.TTSEngine.getVoices()Ljava/util/List;+1
j com.github.olga_yakovleva.rhvoice.Test.go()V+17
j com.github.olga_yakovleva.rhvoice.Test.main([Ljava/lang/String;)V+34
v ~StubRoutines::call_stub
Answer the question
In order to leave comments, you need to log in
If I solved this problem some time ago, I found a bug in the rhvoice code, the pointer was saved to a 4-byte variable (and then transferred to an 8-byte long java), when 8 bytes are needed immediately for 64-bit systems.
The rhvoice developers were informed about this, but the bug has not yet been fixed, it 's here , long needs to be replaced with auto
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question