I recently used jvisualvm and jstack to analyse a Java 8u20 tomcat core dump. For most threads I am able to see a full stack trace e.g.
Thread 21234: (state = BLOCKED)
- sun.misc.Unsafe.park(boolean, long) ...
But for the current thread (the one that cause the core dump) there is no stack trace and all I see is:
Thread 28888: (state = IN_JAVA)
I found the following explanation of IN_JAVA:
NEW: Just starting up, i.e., in process of being initialized.
IN_NATIVE: Running in native code.
IN_NATIVE_TRANS: Corresponding transition state.
IN_VM: Running in VM.
IN_VM_TRANS: Corresponding transition state.
IN_JAVA: Running in Java or in stub code.
BLOCKED: Blocked in vm.
BLOCKED_TRANS: Corresponding transition state.
The he_err log shows the method from java that is calling into the VM native code but I am interested in the rest of the java side stack.
Any ideas as to why this is would be much appreciated!
Related
When I add the asynchronous timer, it gets stuck. How can I fix this?
It's not connected with the "asynchronous timer" (whatever it means), it's classic OutOfMemoryError exception
The reason is that JVM asks the underlying operating system to create a new native thread and the process fails somewhere somehow, the reasons could be in:
Java process doesn't have sufficient address space
The underlying OS lacks virtual memory
There is a limitation on the underlying OS level which doesn't allow that many native threads, i.e. /proc/sys/kernel/threads-max
So you either need to amend your JVM/OS configuration or will have to allocate another machine and switch to Distributed Testing
More information: java.lang.OutOfMemoryError: Unable to create new native thread
I'm using JMeter for load testing, how can I analyze the thread and heap dumps for the load test.
I'm on JMeter 5.1.1 version, under tools there are 2 options like create heap dump and create thread dump, what is the actual usage of them and how could we analyze the dump files.
using which tool we can analyse the dump files
Thread dump is a snapshot of the state of all threads that are part of the process. The state of each thread is presented with a so called stack trace, which shows the contents of a thread's stack. Some of the threads belong to the Java application you are running, while others are JVM internal threads
https://docs.oracle.com/cd/E13150_01/jrockit_jvm/jrockit/geninfo/diagnos/using_threaddumps.html
A heap dump is a snapshot of the memory of a Java™ process. The snapshot contains information about the Java objects and classes in the heap at the moment the snapshot is triggered. Because there are different formats for persisting this data, there might be some differences in the information provided.
https://www.ibm.com/support/knowledgecenter/en/SS3KLZ/com.ibm.java.diagnostics.memory.analyzer.doc/heapdump.html
https://dzone.com/articles/java-heap-dump-analyzer-1
You can search for various tools to analyse thread dump(https://fastthread.io/) and heap dump(https://www.yourkit.com/)
Hope this helps.
I have a Windows 10 machine where some UI process runs happily for days until it silently exits without any visible exception.
I have enabled ETW tracing but pretty much all call stacks come up with ???? marks. I suppose there was no proper ETW provider rundown happening in this process. After enabling Process Destruction call stacks I have found that one
[Root]
ntoskrnl.exe!KiPageFault
ntoskrnl.exe!KiInitiateUserApc
ntoskrnl.exe!KiDeliverApc
ntoskrnl.exe!KiSchedulerApcTerminate
ntoskrnl.exe!PsExitCurrentUserThread
ntoskrnl.exe!PspExitThread
ntoskrnl.exe!PspExitProcess
Does this indicate a page in error so I should suspect a hardware failure of the hard disc or memory?
I have found a failed file io request at that time:
The specified request is not a valid operation for the target device.
(0xc0000010) = Event SubType, FSCTL = Event Type, C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll
which makes me think that the hard disk has an issue.
I have seen a few crashes "in the wild" where the crash dump shows the code throwing an access violation inside _chkstk when attempting to expand the stack. Windbg shows that _chkstk is touching the guard page, however rather than expanding the stack as it should, it just throws an access violation.
I suspected this might be due to user mode structured exception handlers in the code, however my testing shows that under normal conditions the _chkstk guard page exceptions happen in kernel mode and never even reach the user mode exception handlers.
Hence in this case it looks like the kernel mode guard page exceptions are not being handled for some reason, and instead user mode access violations are triggered.
What could cause this to happen?
This turned out to be an XP/Server 2003 kernel specific issue. On those OS if one thread reads another threads stack then the guard page and TIB state get messed up and any subsequent attempts to grow the stack (_chkstk) result in an access violation. This does not happen on later OS.
In our case we were writing out an in-process minidump containing thread stacks, which would corrupt the stack state as described when the dbghelp library read each threads stack.
The moral of the story is that it is not safe to generate in-process minidumps, they should always be generated by an external process.
I have a signal 11 after a while with a c script in a connection handlers.
I have no memory problem and unit test work well !
I'd like to know if there is a debug mode with gwan for c scripts ? and how to activate it ?
Thanks by advance
Regards
Because they are at the core of Web development, servlets provide automatic crash reports (see the crash.c example).
But connection handlers lacked this feature introduced in G-WAN v3.6+. In this version and more recent releases, it can be enabled by a #pragma debug directive in the handler source code.
There's also a new and very detailled per-thread dump in v3.9+ to get a wider 'picture' of servlet/handler/libraries/server errors. It is stored in the ./trace file.
Your crash dump reports a libc call error. The main source of such errors has been found in memory allocations. G-WAN v3.4+ tried to catch them more effectively by using its own (wait-free) allocator.
BTW, siege is not performing very well whether this is on single-Cores or on multicore systems (for performance tests, weighttp will let you test the server instead of the client).