android/java/c++态库出现EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006b935c4b, pid=19520, tid

在尝试连接Android动态库时遇到EXCEPTION_ACCESS_VIOLATION错误,最初误认为是JVM问题,实则是C/C++中强制类型转换导致。错误出现在env->XxxXxxXxx(y)调用,传入参数应为JNI定义的值,而非C/C++的值。
摘要由CSDN通过智能技术生成

在研究android 连接动态库的时候出现以下错误,被以为是jvmde的问题,其实不是,而是自己做强制转换的shih时候导致的:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006b935c4b, pid=19520, tid=0x0000000000000cb8
#
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V  [jvm.dll+0x145c4b]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x0000000004cb2800):  JavaThread "main" [_thread_in_vm, id=3256, stack(0x0000000002f10000,0x0000000003010000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x0000000300000070

Registers:
RAX=0x000000000000000c, RBX=0x0000000004cb2800, RCX=0x0000000300000064, RDX=0x000000000000000c
RSP=0x000000000300f490, RBP=0x000000000300f4e0, RSI=0x0000000020200021, RDI=0x00000000207b2d70
R8 =0x0000000000000000, R9 =0x0000000000000000, R10=0x0000004f000000a0, R11=0x00000000207b2d70
R12=0x0000000000000000, R13=0x000000001e222b30, R14=0x000000000300f798, R15=0x0000000004cb2800
RIP=0x000000006b935c4b, EFLAGS=0x0000000000010202

Top of Stack: (sp=0x000000000300f490)
0x000000000300f490:   0000000004cb2800 000000006b9cad2e
0x000000000300f4a0:   000000000300f798 000000000300f5a8
0x000000000300f4b0:   000000000300f5a8 00007ffdad4f161d
0x000000000300f4c0:   000000001e222b30 cccccccccccccccc
0x000000000300f4d0:   cccccccccccccccc cccccccccccccccc
0x000000000300f4e0:   cccccccccccccccc cccccccccccccccc
0x000000000300f4f0:   cccccccccccccccc cccccccccccccccc
0x000000000300f500:   cccccccccccccccc cccccccccccccccc
0x000000000300f510:   cccccccccccccccc cccccccccccccccc
0x000000000300f520:   cccccccccccccccc cccccccccccccccc
0x000000000300f530:   cccccccccccccccc cccccccccccccccc
0x000000000300f540:   cccccccccccccccc cccccccccccccccc
0x000000000300f550:   cccccccccccccccc cccccccccccccccc
0x000000000300f560:   cccccccccccccccc cccccccccccccccc
0x000000000300f570:   cccccccccccccccc cccccccccccccccc
0x000000000300f580:   cccccccccccccccc cccccccccccccccc 

Instructions: (pc=0x000000006b935c4b)
0x000000006b935c2b:   02 00 00 06 00 00 00 80 3d 78 77 6c 00 00 48 8b
0x000000006b935c3b:   0f b8 10 00 00 00 ba 0c 00 00 00 0f 45 c2 48 98
0x000000006b935c4b:   8b 3c 08 c7 83 70 02 00 00 07 00 00 00 83 3d d9
0x000000006b935c5b:   84 6c 00 01 75 09 80 3d 4b 77 6c 00 00 74 18 80 


Register to memory mapping:

RAX=0x000000000000000c is an unknown value
RBX=0x0000000004cb2800 is a thread
RCX=0x0000000300000064 is an unknown value
RDX=0x000000000000000c is an unknown value
RSP=0x000000000300f490 is pointing into the stack for thread: 0x0000000004cb2800
RBP=0x000000000300f4e0 is pointing into the stack for thread: 0x0000000004cb2800
RSI=0x0000000020200021 is an unknown value
RDI=0x00000000207b2d70 is an unknown value
R8 =0x0000000000000000 is an unknown value
R9 =0x0000000000000000 is an unknown value
R10=0x0000004f000000a0 is an unknown value
R11=0x00000000207b2d70 is an unknown value
R12=0x0000000000000000 is an unknown value
R13={method} {0x000000001e222b38} 'giveArray' '([I)V' in 'com/llc/jni/JniTest'
R14=0x000000000300f798 is pointing into the stack for thread: 0x0000000004cb2800
R15=0x0000000004cb2800 is a thread


Stack:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值