Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access violation in call to processTable() - (Win7 64bit) #23

Closed
gregbking opened this issue Apr 18, 2013 · 6 comments
Closed

Access violation in call to processTable() - (Win7 64bit) #23

gregbking opened this issue Apr 18, 2013 · 6 comments

Comments

@gregbking
Copy link

I'm getting an access violation when calling processTable() using the 0.3.4 version. Never had the issue in 0.3.3 and it occurs ~80% of the time now. I've tried to debug as best as possible and it appears the problem is happening in the native library as it's building up the list. It usually calls back into the Java realm, creating about 50 entries in the process array and then blows up. Nothing appears to be special about the process entry that it hits.

I modified the 0.3.4 jar file and replaced the native libraries with those from 0.3.3 and the problem goes away, so it appears that there is something different there. I'm not sure if it's changes in the source or something to do with how it was built. I don't have the environment setup to build 64 bit c apps, so I can't test anything in the native code.

I'm running on an Intel I5 with 64bit Windows 7.
The following is the contents of one of the PID logs.

A fatal error has been detected by the Java Runtime Environment:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000007fefb9a20f5, pid=7096, tid=7160

JRE version: 6.0_30-b12

Java VM: Java HotSpot(TM) 64-Bit Server VM (20.5-b03 mixed mode windows-amd64 compressed oops)

Problematic frame:

C [javasysmon67460144577357833730.dll+0x20f5]

If you would like to submit a bug report, please visit:

http://java.sun.com/webapps/bugreport/crash.jsp

The crash happened outside the Java Virtual Machine in native code.

See problematic frame for where to report the bug.

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

Current thread (0x000000000a018000): JavaThread "<...removed...>" [_thread_in_native, id=7160, stack(0x000000000f2d0000,0x000000000f3d0000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000000002e8070

Registers:
RAX=0x0000000000000001, RBX=0x0000000000000998, RCX=0x000000000f3cf4c0, RDX=0xfffffffff0f18bb0
RSP=0x000000000f3ce028, RBP=0x000000000f3ce130, RSI=0x00000000002e7f70, RDI=0x0000000000000000
R8 =0x0000000000000104, R9 =0x000000000000002e, R10=0x0000000000000017, R11=0x000000000f3cf3c0
R12=0x0000000000000000, R13=0x0000000000000000, R14=0x000000000a0181d0, R15=0x0000000000000030
RIP=0x000007fefb9a20f5, EFLAGS=0x0000000000010206

Top of Stack: (sp=0x000000000f3ce028)
0x000000000f3ce028: 000007fefb9a1833 0000000000000998
0x000000000f3ce038: 000000000f3ce130 00000000002e1ed0
0x000000000f3ce048: 0000000000000000 0000000000000ae0
0x000000000f3ce058: 000000000b656a68 000000000b656a60
0x000000000f3ce068: 000000000b656a58 0000000000021f23
0x000000000f3ce078: 000000000004a1ba 0000000006c61000
0x000000000f3ce088: 000000000c52b000 0000043800000250
0x000000000f3ce098: 0000000000000030 000000000a0181d0
0x000000000f3ce0a8: 0000000700000061 000000000000099c
0x000000000f3ce0b8: 000000000b656a50 0000000000000994
0x000000000f3ce0c8: 0000000000000000 00000000b4ed8ec2
0x000000000f3ce0d8: 000000000f3ce370 0000000052e06231
0x000000000f3ce0e8: 000000000b656030 00000000b4ed8ec2
0x000000000f3ce0f8: 0000000052e06231 00000000002e7f70
0x000000000f3ce108: 0000000140000000 00000000002e1ed0
0x000000000f3ce118: 0000000700000001 0000000000000000

Instructions: (pc=0x000007fefb9a20f5)
0x000007fefb9a20d5: c8 88 01 f6 c1 02 74 0f 48 83 e9 02 66 8b 04 0a
0x000007fefb9a20e5: 49 83 e8 02 66 89 01 f6 c1 04 74 0d 48 83 e9 04
0x000007fefb9a20f5: 8b 04 0a 49 83 e8 04 89 01 4d 8b c8 49 c1 e9 05
0x000007fefb9a2105: 75 50 4d 8b c8 49 c1 e9 03 74 14 48 83 e9 08 48

Register to memory mapping:

RAX=0x0000000000000001 is an unknown value
RBX=0x0000000000000998 is an unknown value
RCX=0x000000000f3cf4c0 is pointing into the stack for thread: 0x000000000a018000
RDX=0xfffffffff0f18bb0 is an unknown value
RSP=0x000000000f3ce028 is pointing into the stack for thread: 0x000000000a018000
RBP=0x000000000f3ce130 is pointing into the stack for thread: 0x000000000a018000
RSI=0x00000000002e7f70 is an unknown value
RDI=0x0000000000000000 is an unknown value
R8 =0x0000000000000104 is an unknown value
R9 =0x000000000000002e is an unknown value
R10=0x0000000000000017 is an unknown value
R11=0x000000000f3cf3c0 is pointing into the stack for thread: 0x000000000a018000
R12=0x0000000000000000 is an unknown value
R13=0x0000000000000000 is an unknown value
R14=0x000000000a0181d0 is an unknown value
R15=0x0000000000000030 is an unknown value

Stack: [0x000000000f2d0000,0x000000000f3d0000], sp=0x000000000f3ce028, free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [javasysmon67460144577357833730.dll+0x20f5] Java_com_jezhumble_javasysmon_WindowsMonitor_killProcess+0x575

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.jezhumble.javasysmon.WindowsMonitor.processTable()[Lcom/jezhumble/javasysmon/ProcessInfo;+0
j com.jezhumble.javasysmon.JavaSysMon.processTable()[Lcom/jezhumble/javasysmon/ProcessInfo;+3
<...removed...>
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub

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

Java Threads: ( => current thread )
0x000000000a019000 JavaThread "Thread-24" [_thread_blocked, id=472, stack(0x000000000f4e0000,0x000000000f5e0000)]
=>0x000000000a018000 JavaThread "<...removed...>" [_thread_in_native, id=7160, stack(0x000000000f2d0000,0x000000000f3d0000)]
0x000000000a017800 JavaThread "imqConsumerReader-0-7212301625736077312-0" [_thread_blocked, id=492, stack(0x000000000f1d0000,0x000000000f2d0000)]
0x000000000a016800 JavaThread "connector-timer-proxy" daemon [_thread_blocked, id=6224, stack(0x000000000f0d0000,0x000000000f1d0000)]
0x000000000a016000 JavaThread "Timer-0" daemon [_thread_blocked, id=5188, stack(0x000000000efd0000,0x000000000f0d0000)]
0x000000000a015000 JavaThread "iMQReadChannel-7" [_thread_in_native, id=7348, stack(0x000000000ec00000,0x000000000ed00000)]
0x000000000a014800 JavaThread "imqConnectionFlowControl-7" [_thread_blocked, id=2448, stack(0x000000000eb00000,0x000000000ec00000)]
0x000000000a013800 JavaThread "iMQReadChannel-6" [_thread_in_native, id=6024, stack(0x000000000ea00000,0x000000000eb00000)]
0x000000000a013000 JavaThread "imqConnectionFlowControl-6" [_thread_blocked, id=7552, stack(0x000000000e900000,0x000000000ea00000)]
0x000000000a012800 JavaThread "iMQReadChannel-5" [_thread_in_native, id=6040, stack(0x000000000e800000,0x000000000e900000)]
0x000000000a011800 JavaThread "imqConnectionFlowControl-5" [_thread_blocked, id=1148, stack(0x000000000e4e0000,0x000000000e5e0000)]
0x00000000067a2000 JavaThread "iMQReadChannel-4" [_thread_in_native, id=6356, stack(0x000000000e3e0000,0x000000000e4e0000)]
0x00000000067a1800 JavaThread "imqConnectionFlowControl-4" [_thread_blocked, id=7720, stack(0x000000000e2e0000,0x000000000e3e0000)]
0x00000000067a1000 JavaThread "iMQReadChannel-3" [_thread_in_native, id=7708, stack(0x000000000de80000,0x000000000df80000)]
0x00000000067a0000 JavaThread "imqConnectionFlowControl-3" [_thread_blocked, id=6212, stack(0x000000000dd80000,0x000000000de80000)]
0x000000000679f800 JavaThread "iMQReadChannel-2" [_thread_in_native, id=5852, stack(0x000000000e5e0000,0x000000000e6e0000)]
0x000000000679e800 JavaThread "imqConnectionFlowControl-2" [_thread_blocked, id=7572, stack(0x000000000dc80000,0x000000000dd80000)]
0x000000000679e000 JavaThread "iMQReadChannel-1" [_thread_in_native, id=7900, stack(0x000000000e700000,0x000000000e800000)]
0x000000000679d000 JavaThread "imqConnectionFlowControl-1" [_thread_blocked, id=6276, stack(0x000000000dfd0000,0x000000000e0d0000)]
0x000000000679c800 JavaThread "iMQReadChannel-0" [_thread_in_native, id=7628, stack(0x000000000e1e0000,0x000000000e2e0000)]
0x000000000679b800 JavaThread "imqConnectionFlowControl-0" [_thread_blocked, id=7360, stack(0x000000000e0e0000,0x000000000e1e0000)]
0x000000000679b000 JavaThread "p: default-threadpool; w: 7" daemon [_thread_blocked, id=4416, stack(0x000000000cbb0000,0x000000000ccb0000)]
0x000000000679a800 JavaThread "p: default-threadpool; w: 6" daemon [_thread_blocked, id=8156, stack(0x000000000cab0000,0x000000000cbb0000)]
0x0000000006799800 JavaThread "p: default-threadpool; w: 5" daemon [_thread_blocked, id=7600, stack(0x000000000c9b0000,0x000000000cab0000)]
0x0000000006799000 JavaThread "p: default-threadpool; w: 4" daemon [_thread_blocked, id=7024, stack(0x000000000c710000,0x000000000c810000)]
0x0000000006798000 JavaThread "p: default-threadpool; w: 3" daemon [_thread_blocked, id=6360, stack(0x000000000c4e0000,0x000000000c5e0000)]
0x0000000006797800 JavaThread "p: default-threadpool; w: 2" daemon [_thread_in_native, id=6076, stack(0x000000000c8b0000,0x000000000c9b0000)]
0x0000000006796800 JavaThread "p: default-threadpool; w: 1" daemon [_thread_in_native, id=8032, stack(0x000000000b330000,0x000000000b430000)]
0x0000000006796000 JavaThread "transaction-manager" daemon [_thread_blocked, id=5432, stack(0x0000000009160000,0x0000000009260000)]
0x0000000006795000 JavaThread "SelectorThread" daemon [_thread_in_native, id=5848, stack(0x000000000c610000,0x000000000c710000)]
0x0000000006794800 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=6464, stack(0x0000000006e40000,0x0000000006f40000)]
0x00000000067af000 JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=7508, stack(0x0000000006d40000,0x0000000006e40000)]
0x00000000067aa000 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=7904, stack(0x0000000006c40000,0x0000000006d40000)]
0x0000000006794000 JavaThread "Attach Listener" daemon [_thread_blocked, id=7740, stack(0x0000000006b40000,0x0000000006c40000)]
0x0000000006793000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=7124, stack(0x0000000006a40000,0x0000000006b40000)]
0x000000000052a800 JavaThread "Finalizer" daemon [_thread_blocked, id=4064, stack(0x0000000006940000,0x0000000006a40000)]
0x0000000000529000 JavaThread "Reference Handler" daemon [_thread_blocked, id=1420, stack(0x0000000006640000,0x0000000006740000)]
0x00000000005fe800 JavaThread "main" [_thread_blocked, id=3944, stack(0x0000000002420000,0x0000000002520000)]

Other Threads:
0x0000000000522800 VMThread [stack: 0x0000000006540000,0x0000000006640000] [id=6460]
0x00000000067c4000 WatcherThread [stack: 0x0000000006f40000,0x0000000007040000] [id=784]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
PSYoungGen total 266304K, used 83504K [0x00000007d5e00000, 0x00000007f0aa0000, 0x0000000800000000)
eden space 258560K, 29% used [0x00000007d5e00000,0x00000007da7fef50,0x00000007e5a80000)
from space 7744K, 99% used [0x00000007e5a80000,0x00000007e620d160,0x00000007e6210000)
to space 12608K, 0% used [0x00000007efe50000,0x00000007efe50000,0x00000007f0aa0000)
PSOldGen total 86272K, used 15310K [0x0000000781a00000, 0x0000000786e40000, 0x00000007d5e00000)
object space 86272K, 17% used [0x0000000781a00000,0x00000007828f39b8,0x0000000786e40000)
PSPermGen total 39488K, used 39387K [0x000000077c800000, 0x000000077ee90000, 0x0000000781a00000)
object space 39488K, 99% used [0x000000077c800000,0x000000077ee76e08,0x000000077ee90000)

Code Cache [0x0000000002520000, 0x0000000002820000, 0x0000000005520000)
total_blobs=849 nmethods=411 adapters=391 free_code_cache=47523136 largest_free_block=208064

Dynamic libraries:
0x0000000000400000 - 0x000000000042f000 C:\Java\jdk1.6.0_30\bin\java.exe
0x00000000778e0000 - 0x0000000077a89000 C:\WINDOWS\SYSTEM32\ntdll.dll
0x0000000077640000 - 0x000000007775f000 C:\WINDOWS\system32\kernel32.dll
0x000007fefd9a0000 - 0x000007fefda0b000 C:\WINDOWS\system32\KERNELBASE.dll
0x000007fefdea0000 - 0x000007fefdf7b000 C:\WINDOWS\system32\ADVAPI32.dll
0x000007fefe7d0000 - 0x000007fefe86f000 C:\WINDOWS\system32\msvcrt.dll
0x000007fefe230000 - 0x000007fefe24f000 C:\WINDOWS\SYSTEM32\sechost.dll
0x000007fefe060000 - 0x000007fefe18d000 C:\WINDOWS\system32\RPCRT4.dll
0x000007fefd7f0000 - 0x000007fefd847000 C:\WINDOWS\system32\apphelp.dll
0x0000000069a30000 - 0x0000000069a4a000 C:\WINDOWS\AppPatch\AppPatch64\EMET64.dll
0x0000000077760000 - 0x000000007785a000 C:\WINDOWS\system32\USER32.dll
0x000007fefde30000 - 0x000007fefde97000 C:\WINDOWS\system32\GDI32.dll
0x000007fefdf80000 - 0x000007fefdf8e000 C:\WINDOWS\system32\LPK.dll
0x000007fefdf90000 - 0x000007fefe059000 C:\WINDOWS\system32\USP10.dll
0x000007fefe200000 - 0x000007fefe22e000 C:\WINDOWS\system32\IMM32.DLL
0x000007fefe870000 - 0x000007fefe979000 C:\WINDOWS\system32\MSCTF.dll
0x000000006d8b0000 - 0x000000006e068000 C:\Java\jdk1.6.0_30\jre\bin\server\jvm.dll
0x000007fefb1c0000 - 0x000007fefb1fb000 C:\WINDOWS\system32\WINMM.dll
0x000000006d820000 - 0x000000006d82e000 C:\Java\jdk1.6.0_30\jre\bin\verify.dll
0x000000006d450000 - 0x000000006d477000 C:\Java\jdk1.6.0_30\jre\bin\java.dll
0x000000006d870000 - 0x000000006d882000 C:\Java\jdk1.6.0_30\jre\bin\zip.dll
0x000000006d6b0000 - 0x000000006d6c7000 C:\Java\jdk1.6.0_30\jre\bin\net.dll
0x000007fefe4d0000 - 0x000007fefe51d000 C:\WINDOWS\system32\WS2_32.dll
0x000007fefe190000 - 0x000007fefe198000 C:\WINDOWS\system32\NSI.dll
0x000007fefd030000 - 0x000007fefd085000 C:\WINDOWS\system32\mswsock.dll
0x000007fefd020000 - 0x000007fefd027000 C:\WINDOWS\System32\wship6.dll
0x000007fefc3d0000 - 0x000007fefc3e5000 C:\WINDOWS\system32\NLAapi.dll
0x000007fef94b0000 - 0x000007fef94c5000 C:\WINDOWS\system32\napinsp.dll
0x000007fef9500000 - 0x000007fef9519000 C:\WINDOWS\system32\pnrpnsp.dll
0x000007fefcf60000 - 0x000007fefcfbb000 C:\WINDOWS\system32\DNSAPI.dll
0x000007fef94a0000 - 0x000007fef94ab000 C:\WINDOWS\System32\winrnr.dll
0x000007fefcad0000 - 0x000007fefcad7000 C:\WINDOWS\System32\wshtcpip.dll
0x000007fefaa70000 - 0x000007fefaa97000 C:\WINDOWS\system32\IPHLPAPI.DLL
0x000007fefaa60000 - 0x000007fefaa6b000 C:\WINDOWS\system32\WINNSI.DLL
0x000007fef9540000 - 0x000007fef9548000 C:\WINDOWS\system32\rasadhlp.dll
0x000007fefa0e0000 - 0x000007fefa133000 C:\WINDOWS\System32\fwpuclnt.dll
0x000007fefd090000 - 0x000007fefd0a7000 C:\WINDOWS\system32\CRYPTSP.dll
0x000007fefce40000 - 0x000007fefce87000 C:\WINDOWS\system32\rsaenh.dll
0x000007fefcbf0000 - 0x000007fefcc0e000 C:\WINDOWS\system32\USERENV.dll
0x000007fefd8b0000 - 0x000007fefd8bf000 C:\WINDOWS\system32\profapi.dll
0x000007fefd740000 - 0x000007fefd74f000 C:\WINDOWS\system32\CRYPTBASE.dll
0x000000006d5f0000 - 0x000000006d5fa000 C:\Java\jdk1.6.0_30\jre\bin\management.dll
0x000000006d6d0000 - 0x000000006d6db000 C:\Java\jdk1.6.0_30\jre\bin\nio.dll
0x000007fefb9a0000 - 0x000007fefb9b0000 C:<...removed...>\Temp\javasysmon67460144577357833730.dll
0x0000000077aa0000 - 0x0000000077aa7000 C:\WINDOWS\system32\PSAPI.DLL

VM Arguments:
jvm_args: -DBASE_DIR=<...removed...>
java_command: <...removed...>
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=C:\Java\jdk1.6.0_30
PATH=c:\minGW\bin;C:\Java\jdk1.6.0_30\bin;C:\ghc\threadscope-0.2.2\bin;C:\WinAVR-20100110\bin;C:\WinAVR-20100110\utils\bin;C:\Perl\site\bin;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\apache-ant-1.8.3\bin;C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn;C:\Program Files\doxygen\bin;C:\Program Files (x86)\CMake 2.8\bin
USERNAME=<...removed...>
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel

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

OS: Windows 7 , 64 bit Build 7601 Service Pack 1

CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 42 stepping 7, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt

Memory: 4k page, physical 8273936k(3247828k free), swap 16546012k(11470452k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (20.5-b03) for windows-amd64 JRE (1.6.0_30-b12), built on Nov 10 2011 01:49:46 by "java_re" with MS VC++ 8.0 (VS2005)

time: Thu Apr 18 10:24:15 2013
elapsed time: 4 seconds

@gregbking
Copy link
Author

Ugggh! Sorry for the formatting. It didn't look like this when I copied it in. Maybe somebody knows how to edit it to clean it up.

@watsonmw
Copy link
Contributor

I think this may be the process_command_raw being double freed and copied from after being freed when you can't access the process memory in GetCommandLineFromPeb().

This may fix it (it nulls the pointer each time around the loop):

#22

@lukepalmer
Copy link

I also confirm this issue and that the same issue is not present in 0.33.

@starguy
Copy link

starguy commented May 14, 2014

Confirmation the second (same issue and not pressent in previous version 0.3.3).

Feeling some sadness that a confirmed bug added in the new version is to hard to be removed within 7 months.. :)

@jezhumble
Copy link
Owner

Sorry for the slow response. Unfortunately I am the only committer and I have been underwater the last year or so with other work. I didn't even notice that @watsonmw had sent a number of pull requests. Thanks @watsonmw.

@starguy
Copy link

starguy commented May 14, 2014

Thx for the fast response. I commit on the point concerning that there is always a lot of work out there ;)

A last proposal to your (in my opinion) great api: A download to previous compiled versions of javasysmon from the start page of this github project would be great (although I'm very happy that there are at least some compiled github projects to be found).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants