Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unexpected exception: EXCEPTION_ACCESS_VIOLATION

843829May 6 2003 — edited Jun 15 2003
Anyone know what such an error is, I have my java code trying to acess my native c code, which in turn is accessing stuff from a dll which in turn has its own accesses to another dll. I suspect there is some memory (probably for a dll) that i am not allocating but I cannot figure out where, because from the native side on down everything looks correct,a nd the dll's that the native c code is accessing have been tested with just regular c test code and it works fine. So this leads me to belive that somehow i am missing a step or something that is specific to JNI that I need to get and release memory.
some of the error outputted just by saying java myclass.class is:
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x7B1136E1
Function=mxCreateReference+0xB1
Library=e:\matlab6p5\bin\win32\libmx.dll

Current Java thread:
	at U_CLASS.Init(Native Method)
	at U_CLASS.<clinit>(APIScenario.java:11)

Dynamic libraries:
0x00400000 - 0x00406000 	f:\j2sdk1.4.0_01\bin\java.exe
0x77F60000 - 0x77FBE000 	C:\WINNT\System32\ntdll.dll
0x77DC0000 - 0x77DFF000 	C:\WINNT\system32\ADVAPI32.dll
0x77F00000 - 0x77F5E000 	C:\WINNT\system32\KERNEL32.dll
0x77E70000 - 0x77EC5000 	C:\WINNT\system32\USER32.dll
0x77ED0000 - 0x77EFC000 	C:\WINNT\system32\GDI32.dll
0x77E10000 - 0x77E67000 	C:\WINNT\system32\RPCRT4.dll
0x78000000 - 0x78044000 	C:\WINNT\system32\MSVCRT.dll
0x6D330000 - 0x6D445000 	f:\j2sdk1.4.0_01\jre\bin\client\jvm.dll
0x77FD0000 - 0x77FFA000 	C:\WINNT\System32\WINMM.dll
0x6BD10000 - 0x6BD3B000 	C:\WINNT\System32\au88nt30.dll
0x77C40000 - 0x77D7C000 	C:\WINNT\system32\SHELL32.dll
0x716F0000 - 0x7177A000 	C:\WINNT\system32\COMCTL32.dll
0x77A90000 - 0x77A9B000 	C:\WINNT\system32\VERSION.dll
0x779C0000 - 0x779C8000 	C:\WINNT\system32\LZ32.dll
0x6D1D0000 - 0x6D1D7000 	f:\j2sdk1.4.0_01\jre\bin\hpi.dll
0x6D300000 - 0x6D30D000 	f:\j2sdk1.4.0_01\jre\bin\verify.dll
0x6D210000 - 0x6D228000 	f:\j2sdk1.4.0_01\jre\bin\java.dll
0x6D320000 - 0x6D32D000 	f:\j2sdk1.4.0_01\jre\bin\zip.dll
0x10000000 - 0x10034000 	E:\ABFA_DEV\JAbfaAPI\abfa_glue.dll
0x0AD90000 - 0x0ADCF000 	E:\ABFA_DEV\JAbfaAPI\AbfaAPIDll.dll
0x0ADD0000 - 0x0AE8F000 	E:\ABFA_DEV\JAbfaAPI\abfamlbm.dll
0x0AE90000 - 0x0AF5D000 	e:\matlab6p5\bin\win32\libmatlb.dll
0x7B110000 - 0x7B138000 	e:\matlab6p5\bin\win32\libmx.dll
0x7A710000 - 0x7A7D0000 	e:\matlab6p5\bin\win32\libut.dll
0x77B20000 - 0x77BD7000 	C:\WINNT\system32\ole32.dll
0x65340000 - 0x653D5000 	C:\WINNT\system32\OLEAUT32.dll
0x76AC0000 - 0x76ADD000 	C:\WINNT\System32\IMAGEHLP.dll
0x7AF70000 - 0x7AF77000 	e:\matlab6p5\bin\win32\libmex.dll
0x7A5E0000 - 0x7A62F000 	e:\matlab6p5\bin\win32\numerics.dll
0x7AB50000 - 0x7AB5F000 	e:\matlab6p5\bin\win32\libmwlapack.dll
0x7AB60000 - 0x7ABBC000 	e:\matlab6p5\bin\win32\libmwfftw.dll
0x7AFB0000 - 0x7AFDB000 	e:\matlab6p5\bin\win32\libmwumfpack.dll
0x7A8A0000 - 0x7AA0F000 	e:\matlab6p5\bin\win32\m_parser.dll
0x7AA10000 - 0x7AA73000 	e:\matlab6p5\bin\win32\m_ir.dll
0x7AAA0000 - 0x7AB2B000 	e:\matlab6p5\bin\win32\mlib.dll
0x7AF80000 - 0x7AF93000 	e:\matlab6p5\bin\win32\libmwservices.dll
0x7A630000 - 0x7A644000 	e:\matlab6p5\bin\win32\mpath.dll
0x7AFE0000 - 0x7AFE6000 	e:\matlab6p5\bin\win32\m_dispatcher.dll
0x7AFF0000 - 0x7B017000 	e:\matlab6p5\bin\win32\libmwbuiltins.dll
0x7AFA0000 - 0x7AFA9000 	e:\matlab6p5\bin\win32\libmat.dll
0x77D80000 - 0x77DB2000 	C:\WINNT\system32\comdlg32.dll
0x77800000 - 0x7783A000 	C:\WINNT\system32\NETAPI32.dll
0x77840000 - 0x77849000 	C:\WINNT\system32\NETRAP.dll
0x777E0000 - 0x777ED000 	C:\WINNT\system32\SAMLIB.dll
0x7AE30000 - 0x7AF30000 	e:\matlab6p5\bin\win32\atlas_PIII.dll
0x7ABC0000 - 0x7AE26000 	e:\matlab6p5\bin\win32\lapack.dll
0x0B470000 - 0x0B4DE000 	e:\matlab6p5\bin\win32\DFORRT.dll
0x0BA10000 - 0x0BA1C000 	e:\matlab6p5\bin\win32\libmwcl.dll
0x71DC0000 - 0x71DCA000 	C:\WINNT\System32\PSAPI.DLL

Local Time = Tue May 06 14:52:56 2003
Elapsed Time = 0
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.0_01-b03 mixed mode)
#
# An error report file has been saved as hs_err_pid306.log.
# Please refer to the file for further information.
#
Then there is also my native method that i have:
JNIEXPORT void JNICALL Java_U_CLASS_Init
  (JNIEnv *env, jclass theClass, jint sources, jint recievers)
{
	//all calls into another dll
	Initialize(); //this works
	LoadDefaults("E:\\ABFA_DEV\\AbfaAPI\\", "Default"); //not commengint this out provides error above...
	theParameters = GetDefaultInfo(sources, recievers); //this works	


}
I realize that these functions mentioned above are proprietery to my api i am writing, and thusly the internals of them are basiaclly, initialize inits the dll that the glue is accessing, LoadDefaults loads some defaults into default arrayed structures from a file, and then the getdefault info, fills out a pointer to a structure with the default data that was loaded in loaddefaults. I realize this may be overly vague because of the nature of my proprietery code, but I am hoping someone has seen a similar error and that it is caused for similar reasons, like hey check your pointers or something like that... because as it stands, I do not know whats throwing that : EXCEPTION_ACCESS_VIOLATION
Sounds like memory management to me, but on the dll' sides that should be all kosher, the only thing I can think of is the native glue is missing steps to allocate memory for jni to play nice.
It should be noted that where i say "//this works" means that i just get further along in the code, it still dies in later classes with later native calls (thoguh it dies in the jvm.dll instead the matlab dll.)

basically the java code is accessing a JNI DLL that is in turn acessing a CAPI dll that access matlab code that was compiled from matlab .m files to a .dll

So any help or ideas in the right direction here would be greatly appreciated...Thanks!

Shane
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 13 2003
Added on May 6 2003
4 comments
313 views