I have done some code in C that happily send the full backtrace with function name and line number to a log file.
This was done using a mixture of backtrace, backtrace_symbols and dladdr and ADDR2LINE on LINUX. Also using the "execinfo.h" on…
My OS is RHEL 7, and I run a simple Go program:
package main
import (
"time"
)
func main() {
time.Sleep(1000 * time.Second)
}
During its running, I check the thread count of process:
# cat /proc/13858/status | grep Thread
Threads: …
In case of crash we dump the stack to get more information about the crash using below function:
static void dumpStack()
{
char buf[64];
pid_t pid = getpid();
sprintf( buf, "%d", pid );
pid_t fork_result =…
When a Erlang system hangs I want to know what the system is doing during that time. For a c/c++ program, I can easily run the pstack, but I didn't find out a handy tool for this purpose in Erlang.
What is the pstack equivalent in…
I have a requirement to take a process stack(pstack) on a process(cpp process) running in linux environment . The process can exit in various scenarios(normally or abnormally).So we are not sure when the process can exist , so is it still possible …
I am facing a strange problem solution: Our JVM (1.6) freezes from time to time (probably because of blocking threads or garbage collection) when running an application server. If we run the pstack command, the problem resolves.
Can somebody explain…
On multi-core RHEL6, there is a FIFO realtime process in a deadloop, so it occupies all the CPU resources on the core (process is bound to the core). However, the other cores are pretty fine.
At this time, pstack for the process in deadloop failed…
I have a strange situation. I have a web page that makes several AJAX calls to a php file. Some of these calls get stuck for several seconds to minutes - noticed that in Inspect Element on Google Chrome -> Network.
I checked the apache log, and…
I want to write a unix shell script to run a command 3 times in every 80 seconds and write the every sequence in a different line in a text file. And also if the all results are 10 or more in a line I want to kill the process:
for example:
pstack…
I am running pstack to find function stack for my application running on two machines (both RHEL)
In one of my machine it is working as expected
[root@civ4cez191 bin]# pstack 22947
Thread 2 (Thread 0x7f63cbe7d700 (LWP 22949)):
#0 …
I have a multi-threaded process that got stuck while running under Linux. But I don't have multi-threaded version to pstack (made alias with gstack). As such, gstack does not provide me anything. How can I (a) attach gdb to an already running…
In the old versions of gdb there was an option, -readnever, which suppressed symbol loading. Can I achieve the same result with gdb-7.10? This is needed to just stack traces, not for debugging.
I have a script, which runs gdb with command file like this:
set logging file file_name
set logging on
thread apply all bt
q
y
Why pstack is much faster than this script? Can I achive that fastness with gdb somehow?
EDIT: The difference was gdb…
Although Linux doesn't provide pstack as Solaris does, RedHat provides a script can do the same thing:
#!/bin/bash
if test $# -ne 1; then
echo "Usage: `basename $0 .sh` " 1>&2
exit 1
fi
if test ! -r /proc/$1; then
echo…