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 <pid> does not provide me anything. How can I (a) attach gdb to an already running process (b) get stack trace of individual threads (c) know threadids of a running process (d) from threadid (if known) how can I see the stack trace / call stack for a running thread under stuck process?
how to see stack trace for a particular thread within a hanged process in Linux
2.3k Views Asked by Dr. Debasish Jana At
1
There are 1 best solutions below
Related Questions in LINUX
- How do I recursively find and replace only in files named index.php on Linux webserver?
- passing text with \n as one argument in shell
- kernel module does not print packet info
- How to send ESC/POS commands to thermal printer in Linux
- (x64 Nasm) Writeline function on Linux
- How do I set the Hive user to something different than the Spark user from within a Spark program?
- Default priority of thread with SCHED_FIFO
- Calling a python function with options from shell script
- How to split a directory into parts without compressing or archiving?
- Cross compile simple standard C program on Linux for Mac
- How to offload NAPI poll function to workqueue
- python netifaces - How to get currently used network interface
- Unexpected output from function
- mingw-64 conflicting declarations when cross-compiling
- Different behavior of async with Visual Studio 2013(Windows8.1) and GCC 4.9(Ubuntu14.10)
Related Questions in MULTITHREADING
- new thread blocks main thread
- WPF MessageBox Cancel checkbox check
- How to avoid concurrent access to a resource?
- run oncomplete event in async
- Threading Segfault when reading members
- Function timeouts in C and thread
- How are multiple requests to Task.Run handled from a resource management standpoint?
- Acumatica perfomance with threads
- Wait and Notify in Java threads for a given interval
- Different behavior of async with Visual Studio 2013(Windows8.1) and GCC 4.9(Ubuntu14.10)
- How to return blocking queue to the right object?
- background thread using Task.Run
- deletion and cleanup of worker thread in Qt crashes
- Pipeline-like operation using TChan
- implementing in app purchase on android
Related Questions in STACK-TRACE
- How to print the first line from a traceback stack
- How to change unittest.TestResult to disable/remove traceback on Failures?
- What's Dead & Exploded in Swift's exception stack?
- How can I tell if a function is called in a loop within python's tracer function?
- No line numbers in stacktrace on OS X with DNX - dnxcore50 - am I missing a PDB-file?
- Get actual class from stack trace element
- Python Django not showing stack trace
- Stack trace not found in Output during Netbeans 7.4 debugging session
- access to original dict after a KeyError
- Stacktrace and error monads in Clojure
- Exception printing is disabled by default for security reasons. Error log record number:
- Can `window.onerror` be used to log the error's stack trace as a global error handler
- Java - how to get the stack trace from before a Runnable?
- iOS - Symbolicate Stack trace symbols
- Stack trace of the application specific java threads
Related Questions in CALLSTACK
- The call stack size of quick sort
- How to print call stack in Swift?
- Accessing call stack depth in Scheme
- Passing variadic template argument pack to next function
- What does Opt.out mean?
- Why are python generator frames' (gi_frame) f_back attribute always none?
- Inspect live objects/stack in node.js
- How to get main thread callstack on other thread in swift
- Can code that produces deep call stacks be considered as an anti-pattern?
- latin-square.js Maximum call stack size exceeded
- Why is this causing a maximum call stack error?
- how to analyse call stack info of c# app where my database say access exception, attempt to read or write memory is corrupt
- Generating a tree of all possible call stacks
- python traceback - performance problems
- Share variables between expression trees
Related Questions in PSTACK
- Why A Linux Process Is Too Busy To Be Attached (ptrace or so)?
- Why pstack is much faster than gdb with just attaching, saving stacks and quitting?
- How to disable symbol loading in gdb-7.10?
- pstack not printing stack output
- Displaying all stack history of a process
- how to see stack trace for a particular thread within a hanged process in Linux
- How do i get last n line stack using pstack command?
- Does any one know the side effect of Solaris p series command(pstack, pmap)?
- Alter code accessed by running cron
- Unusable pstack output for core dump on Solaris
- JVM freeze resolved by pstack
- Apache PHP call stays in W status in server-status for minutes
- pstack equivalent in erlang
- using pstack to print all threads stacktrace
- Taking a process stack(pstack) on a process (in linux) when the process is about to exit
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
At first, compile it with options
-O0 -ggdbfor best debugging.If you can run in under gdb, just run
And just wait problem. When process get stuck, just press
^Cand you in.If you can't run under gdb, just:
At both cases, type
info threadsand you will see all your threads. Then select one and you can seebtor anything else.