分享
 
 
 

以失败开始,Java调用汇编时的错误日志,有待继续学习

王朝java/jsp·作者佚名  2006-01-10
窄屏简体版  字體: |||超大  

#

# An unexpected error has been detected by HotSpot Virtual Machine:

#

# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10001053, pid=312, tid=1000

#

# Java VM: Java HotSpot(TM) Client VM (1.5.0_04-b05 mixed mode, sharing)

# Problematic frame:

# C [AsmTest.dll+0x1053]

#

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

Current thread (0x00035b60): JavaThread "main" [_thread_in_native, id=1000]

siginfo: ExceptionCode=0xc0000005, reading address 0xffffffff

Registers:

EAX=0x6c6c0200, EBX=0x26b24460, ECX=0x6f77206f, EDX=0x2164fa84

ESP=0x0007fa38, EBP=0x0007fa94, ESI=0x26b24460, EDI=0x0007fa94

EIP=0x10001053, EFLAGS=0x00010206

Top of Stack: (sp=0x0007fa38)

0x0007fa38: 00035b60 26b24460 26b24460 cccccccc

0x0007fa48: cccccccc cccccccc cccccccc cccccccc

0x0007fa58: cccccccc cccccccc cccccccc cccccccc

0x0007fa68: cccccccc cccccccc cccccccc cccccccc

0x0007fa78: cccccccc cccccccc cccccccc 6c6c6568

0x0007fa88: 6f77206f 21646c72 cccccc00 0007fac0

0x0007fa98: 00ae826f 00035c1c 0007fac8 0007faa4

0x0007faa8: 26b24460 0007facc 26b24690 00000000

Instructions: (pc=0x10001053)

0x10001043: 28 90 02 10 88 45 fc 66 8d 95 f0 ff ff ff b4 02

0x10001053: cd 21 5f 5e 5b 83 c4 50 3b ec e8 1e 00 00 00 8b

Stack: [0x00040000,0x00080000), sp=0x0007fa38, free space=254k

Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)

C [AsmTest.dll+0x1053]

j AsmTest.HelloWorld()V+0

j Test.main([Ljava/lang/String;)V+10

v ~StubRoutines::call_stub

V [jvm.dll+0x82696]

V [jvm.dll+0xd6fd9]

V [jvm.dll+0x82567]

V [jvm.dll+0x895e6]

C [java.exe+0x14c0]

C [java.exe+0x64cd]

C [kernel32.dll+0x2141a]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)

j AsmTest.HelloWorld()V+0

j Test.main([Ljava/lang/String;)V+10

v ~StubRoutines::call_stub

--------------- P R O C E S S ---------------

Java Threads: ( => current thread )

0x00a7e840 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=1032]

0x00a7d418 JavaThread "CompilerThread0" daemon [_thread_blocked, id=1784]

0x00a7c730 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=872]

0x0003fa48 JavaThread "Finalizer" daemon [_thread_blocked, id=1616]

0x00a57aa0 JavaThread "Reference Handler" daemon [_thread_blocked, id=720]

=>0x00035b60 JavaThread "main" [_thread_in_native, id=1000]

Other Threads:

0x00a77be0 VMThread [id=360]

0x00a992f0 WatcherThread [id=1028]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap

def new generation total 576K, used 230K [0x22ad0000, 0x22b70000, 0x22fb0000)

eden space 512K, 44% used [0x22ad0000, 0x22b09978, 0x22b50000)

from space 64K, 0% used [0x22b50000, 0x22b50000, 0x22b60000)

to space 64K, 0% used [0x22b60000, 0x22b60000, 0x22b70000)

tenured generation total 1408K, used 0K [0x22fb0000, 0x23110000, 0x26ad0000)

the space 1408K, 0% used [0x22fb0000, 0x22fb0000, 0x22fb0200, 0x23110000)

compacting perm gen total 8192K, used 337K [0x26ad0000, 0x272d0000, 0x2aad0000)

the space 8192K, 4% used [0x26ad0000, 0x26b246f8, 0x26b24800, 0x272d0000)

ro space 8192K, 66% used [0x2aad0000, 0x2b029dc0, 0x2b029e00, 0x2b2d0000)

rw space 12288K, 46% used [0x2b2d0000, 0x2b867e98, 0x2b868000, 0x2bed0000)

Dynamic libraries:

0x00400000 - 0x0040c000 C:\Program Files\Java\jdk1.5.0_04\bin\java.exe

0x77f50000 - 0x77ff7000 C:\WINDOWS\System32\ntdll.dll

0x77e40000 - 0x77f4e000 C:\WINDOWS\system32\kernel32.dll

0x77da0000 - 0x77e3b000 C:\WINDOWS\system32\ADVAPI32.dll

0x78000000 - 0x78087000 C:\WINDOWS\system32\RPCRT4.dll

0x77be0000 - 0x77c33000 C:\WINDOWS\system32\MSVCRT.dll

0x6d6b0000 - 0x6d839000 C:\Program Files\Java\jdk1.5.0_04\jre\bin\client\jvm.dll

0x77d10000 - 0x77d9c000 C:\WINDOWS\system32\USER32.dll

0x7f000000 - 0x7f041000 C:\WINDOWS\system32\GDI32.dll

0x76b10000 - 0x76b39000 C:\WINDOWS\System32\WINMM.dll

0x76300000 - 0x7631c000 C:\WINDOWS\System32\IMM32.DLL

0x62c20000 - 0x62c28000 C:\WINDOWS\System32\LPK.DLL

0x72f10000 - 0x72f6a000 C:\WINDOWS\System32\USP10.dll

0x6d2f0000 - 0x6d2f8000 C:\Program Files\Java\jdk1.5.0_04\jre\bin\hpi.dll

0x76bc0000 - 0x76bcb000 C:\WINDOWS\System32\PSAPI.DLL

0x6d680000 - 0x6d68c000 C:\Program Files\Java\jdk1.5.0_04\jre\bin\verify.dll

0x6d370000 - 0x6d38d000 C:\Program Files\Java\jdk1.5.0_04\jre\bin\java.dll

0x6d6a0000 - 0x6d6af000 C:\Program Files\Java\jdk1.5.0_04\jre\bin\zip.dll

0x10000000 - 0x10033000 C:\AsmTest.dll

VM Arguments:

java_command: Test

Environment Variables:

CLASSPATH=.;C:\Program Files\Java\jdk1.5.0_04\lib\tools.jar

PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Rational\common;;C:\Program Files\Java\jdk1.5.0_04\bin

USERNAME=Ahui

OS=Windows_NT

PROCESSOR_IDENTIFIER=x86 Family 6 Model 11 Stepping 1, GenuineIntel

--------------- S Y S T E M ---------------

OS: Windows XP Build 2600 Service Pack 1

CPU:total 1 family 6, cmov, cx8, fxsr, mmx, sse

Memory: 4k page, physical 392688k(213184k free), swap 1174376k(963184k free)

vm_info: Java HotSpot(TM) Client VM (1.5.0_04-b05) for windows-x86, built on Jun 3 2005 02:10:41 by "java_re" with MS VC++ 6.0

-----------------------------------------------

以上是运行时Jvm产生的错误日志

因为java可以通过jni调用c++或者C,而它们又可以调用汇编语言,所以java应该可以通过这一系列的调用达到调用汇编的目的,

java语言的部分就不用说了,我的cpp实现如下:

----------------------------------------------

#include"AsmTest.h"

#include"iostream.h"

JNIEXPORT void JNICALL Java_AsmTest_HelloWorld

(JNIEnv *, jobject){

char mess[]="hello world!";

_asm{

push edx

push eax

lea edx,mess

mov eax,00000900h;

int 21h;

pop eax

pop edx

}

}

-----------------------------------------------

开始没有对对edx,eax保护时也出现上边的错误日志,于是怀疑是用c++实现输出用到的寄存器破坏了jvm的运行,可以加上保护之后还是一样。

由于c语言的一些基本函数也是用汇编实现的,理论上来说直接在c++里嵌入汇编,然后由java调用也是可以实现的,不知道什么原因不能实现

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有