import iaik.pkcs.pkcs11.Module;
import iaik.pkcs.pkcs11.wrapper.CK_SLOT_INFO;
import iaik.pkcs.pkcs11.wrapper.PKCS11Connector;
import iaik.pkcs.pkcs11.wrapper.PKCS11Exception;
import iaik.pkcs.pkcs11.wrapper.PKCS11Implementation;
import java.io.IOException;
public class Testt {
public static void main(String[] args) throws IOException, PKCS11Exception, InterruptedException {
PKCS11Implementation pkcs11Module_ = (PKCS11Implementation) PKCS11Connector.connectToPKCS11Module(System.mapLibraryName("****"));
pkcs11Module_.C_Initialize(null, true);
//System.out.println(moduleInfo);
long[] slotsWithToken = pkcs11Module_.C_GetSlotList(Module.SlotRequirement.TOKEN_PRESENT);
//for (final long slota : slotsWithToken) {
final CK_SLOT_INFO ckSlotInfo = pkcs11Module_.C_GetSlotInfo(1l);
System.out.println(ckSlotInfo);
pkcs11Module_.C_Finalize(null);
}
}
当我运行上面的代码时,会生成hs_err_pid * .log文件。其内容如下:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGILL (0x4) at pc=0x00007fff8fe14caf, pid=1035, tid=2563
#
# JRE version: Java(TM) SE Runtime Environment (8.0_25-b17) (build 1.8.0_25-b17)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C [libsystem_platform.dylib+0x4caf] _os_lock_corruption_abort+0x0
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread is native thread
siginfo: si_signo: 4 (SIGILL), si_code: 1 (ILL_ILLOPC), si_addr: 0x00007fff8fe14caf
Registers:
RAX=0x0000000020534341, RBX=0x0000000000019000, RCX=0x00000000ffffffff, RDX=0x0000000129716000
RSP=0x0000000109ab8d38, RBP=0x0000000109ab8d70, RSI=0x000000012995e9a0, RDI=0x000000012995e9a8
R8 =0x0000000109ab8e50, R9 =0x0000000000000000, R10=0x0000000000000cb8, R11=0x00007fff8fecd764
R12=0x00000000ffffffff, R13=0x0000000000000002, R14=0x0000000000000001, R15=0x000000012995e9a8
RIP=0x00007fff8fe14caf, EFLAGS=0x0000000000010217, ERR=0x0000000000000000
TRAPNO=0x0000000000000006
我该如何解决这个问题?我的操作系统是Mac Yosemite,我使用的是java版“1.8.0_25” Java(TM)SE运行时环境(版本1.8.0_25-b17) Java HotSpot(TM)64位服务器VM(内置25.25-b02,混合模式)