EXCEPTION_ACCESS_VIOLATION

hi,

i have EXCEPTION_ACCESS_VIOLATION exception. it executes a program sc.exe(which is for starting/stopping windows services) by using Runtime.exec method. it gives the exception at that point (Runtime.exec(sc)) and quits.

the exception :

An unexpected exception has been detected in native code outside the VM.

Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x77EA4327

Function=QueueUserAPC+0x7BAE

Library=C:\WINDOWS\system32\kernel32.dll

Current Java thread:

at java.lang.Win32Process.create(Native Method)

at java.lang.Win32Process.<init>(Win32Process.java:63)

at java.lang.Runtime.execInternal(Native Method)

at java.lang.Runtime.exec(Runtime.java:566)

at java.lang.Runtime.exec(Runtime.java:428)

at hizmet.ServisIslemleri.executeSC(Service.java:109)

Dynamic libraries:

0x00400000 - 0x00406000 D:\jbuilder8\jdk1.4\bin\javaw.exe

0x77F50000 - 0x77FF6000 C:\WINDOWS\System32\ntdll.dll

0x77E60000 - 0x77F45000 C:\WINDOWS\system32\kernel32.dll

0x77DC0000 - 0x77E5B000 C:\WINDOWS\system32\ADVAPI32.dll

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

0x77D30000 - 0x77DB6000 C:\WINDOWS\system32\USER32.dll

0x77C60000 - 0x77CA0000 C:\WINDOWS\system32\GDI32.dll

0x77C00000 - 0x77C53000 C:\WINDOWS\system32\MSVCRT.dll

0x6D330000 - 0x6D45C000 D:\jbuilder8\jdk1.4\jre\bin\client\jvm.dll

0x76B30000 - 0x76B5C000 c:\WINDOWS\System32\WINMM.dll

0x6D1D0000 - 0x6D1D7000 D:\jbuilder8\jdk1.4\jre\bin\hpi.dll

0x6D300000 - 0x6D30D000 D:\jbuilder8\jdk1.4\jre\bin\verify.dll

0x6D210000 - 0x6D229000 D:\jbuilder8\jdk1.4\jre\bin\java.dll

0x6D320000 - 0x6D32D000 D:\jbuilder8\jdk1.4\jre\bin\zip.dll

0x6D000000 - 0x6D0FA000 D:\jbuilder8\jdk1.4\jre\bin\awt.dll

0x72FD0000 - 0x72FF3000 c:\WINDOWS\System32\WINSPOOL.DRV

0x76370000 - 0x7638A000 c:\WINDOWS\System32\IMM32.dll

0x771A0000 - 0x772B0000 C:\WINDOWS\system32\ole32.dll

0x10000000 - 0x10016000 C:\Documents and Settings\Serdar\Desktop\Yeni\eclipse\hizmet\TrayIcon12.dll

0x773C0000 - 0x77BAF000 C:\WINDOWS\system32\SHELL32.DLL

0x63180000 - 0x631E4000 C:\WINDOWS\system32\SHLWAPI.dll

0x71950000 - 0x71A34000 c:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll

0x77330000 - 0x773BB000 C:\WINDOWS\system32\comctl32.dll

0x5B2A0000 - 0x5B2D4000 c:\WINDOWS\system32\uxtheme.dll

0x6D180000 - 0x6D1D0000 D:\jbuilder8\jdk1.4\jre\bin\fontmanager.dll

0x51000000 - 0x5104D000 c:\WINDOWS\System32\ddraw.dll

0x73B90000 - 0x73B96000 c:\WINDOWS\System32\DCIMAN32.dll

0x6DEB0000 - 0x6DF21000 c:\WINDOWS\System32\D3DIM.DLL

0x6D2D0000 - 0x6D2DE000 D:\jbuilder8\jdk1.4\jre\bin\net.dll

0x71AC0000 - 0x71AC8000 c:\WINDOWS\System32\WSOCK32.dll

0x71AA0000 - 0x71AB5000 c:\WINDOWS\System32\WS2_32.dll

0x71A90000 - 0x71A98000 c:\WINDOWS\System32\WS2HELP.dll

0x71A40000 - 0x71A7B000 c:\WINDOWS\system32\mswsock.dll

0x71A80000 - 0x71A88000 c:\WINDOWS\System32\wshtcpip.dll

0x76C80000 - 0x76CA2000 C:\WINDOWS\system32\imagehlp.dll

0x6DAB0000 - 0x6DB2C000 C:\WINDOWS\system32\DBGHELP.dll

0x77BF0000 - 0x77BF7000 C:\WINDOWS\system32\VERSION.dll

0x76BE0000 - 0x76BEB000 c:\WINDOWS\System32\PSAPI.DLL

[3406 byte] By [semur8] at [2007-9-30 21:52:37]
# 1
I would suggest either - patch your OS http://windowsupdates.microsoft.com- ugrade your JVM to 1.4.2_06or both.This is a low level JVM error which is likely to be the result of a bug in the OS and/or JVM.
Peter-Lawrey at 2007-7-7 3:20:55 > top of Java-index,Java Essentials,Java Programming...
# 2

I experience the exact same problem, trying to start another JVM. The version of the VM that gets called seems to have no effect; the calling VM shows the same behavior with versions 1.4.2_03 and 1.4.2_06 on Windows XP with the latest patches applied (including SP2). I suspected DEP at first, but deactivating DEP does not resove the issue. Any help is highly appreciated.

vrenelisgaertli at 2007-7-7 3:20:55 > top of Java-index,Java Essentials,Java Programming...
# 3

After some research, it seems the problem was passing a String array of length 0 as Environment arguments:

Process process = Runtime.getRuntime().exec( myCall, new String[] {} );

^^^ this causes random crashes of the VM in certain situations (hard to reproduce)

Process process = Runtime.getRuntime().exec( myCall );

^^^ this works all right

vrenelisgaertli at 2007-7-7 3:20:55 > top of Java-index,Java Essentials,Java Programming...
# 4
Where did you find this solution? I'm having the same problem but I need the third argument to exec -- the File. I don't see any way to skip the second arg without passing in an empty array.
docscape at 2007-7-7 3:20:55 > top of Java-index,Java Essentials,Java Programming...
# 5
Can't you just pass "null" instead of an empty array? The Runtime.exec documentation says:The environment variable settings are specified by envp. If envp is null, the subprocess inherits the environment settings of the current process.
MLRon at 2007-7-7 3:20:55 > top of Java-index,Java Essentials,Java Programming...
# 6
yep. null works. I found that right after I posted that last commend. Bad on my part for posting before thinking. Thanks
docscape at 2007-7-7 3:20:55 > top of Java-index,Java Essentials,Java Programming...