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
- Is there some way to use printf to print a horizontal list of decrementing hex digits in NASM assembly on Linux
- Why does Hugo generate different taxonomy-related HTML on different OS's?
- Writes in io_uring do not advance the file offset
- Why `set -o pipefail` gives different output even though the pipe is not failing
- what really controls the permissions: UID or eUID?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Docker container unable to make HTTPS requests to external API
- Whow to use callback_query_handler in Python 3.10
- Create kea runtime directory at startup in Yocto image
- Problem on CPU scheduling algorithms in OS
- How to copy files into the singularity sandbox?
- Android kernel error: undefined reference to `get_hw_version_platform'
- Is there a need for BPF Linux namespace?
- Error when trying to execute a binary compiled in a Kali Linux machine on an Ubuntu system
- Issue with launching application after updating ElectronJs to version 28.0.0 on Windows and Linux
Related Questions in MULTITHREADING
- How can I outsource worker processes within a for loop?
- OpenMP & oneTbb difference
- Receiving Notifications for Individual Task Completion OmniThreadLibrary Parallel.ForEach
- C++ error: no matching member function for call to 'enqueue' futures.emplace_back(TP.enqueue(sum_plus_one, x, &M));
- How can I create a thread in Haskell that will restart if it gets killed due to any reason?
- Qt: running callback in the main thread from the worker thread
- Using `static` on a AVX2 counter function increases performance ~10x in MT environment without any change in Compiler optimizations
- Heap sort with multithreading
- windows multithreading CreateMutex
- The problem of "fine-grained locks and two-phase locking algorithm"
- OpenMP multi-threading not working if OpenMPI set to use one or two MPI processor
- WPF Windows Initializing is locking the separated thread in .Net 8
- TCP Client Losing Connection When Writing Data
- vc++ thread constructor throwing compiler error c2672
- ASP.NET Core 6 Web API : best way to pause before resending email
Related Questions in STACK-TRACE
- Angular - NG SERVE doesnt work outta nowhere / node:internal/errors:563 ErrorCaptureStackTrace(err);
- Stack Tracing Considering the ARM assembly language version mentioned below
- Why "current_thread" identifier is not in "_current_frames" dictionary?
- Rails 7.1.3 how to view stack traces in a production environment
- Azure calls waiting a long time
- Looking for a tool to monitor process exceptions with stack traces in real-time
- C++23 std::stacktrace in segmentation fault
- VSCode Extension Development: Rejected Promise Error When Running "sonarqube-scanner-npm"
- Extracting function name from boost stacktrace
- In internal testing, application crashed on start with Fatal Exception: java.lang.VerifyError
- Get stacktrace including child class method call when exception is raised from parent classmethod
- Print stacktrace of a function from a goroutine
- Parsing multiline python logs in fluentbit issue
- How to interpret the stack trace of an obfuscated app
- How to create stack trace for other process(out of process) when it crashes in google breakpad?
Related Questions in CALLSTACK
- Debugging MAUI issues from android playstore Crash details stacks
- Does JavaScript have an Event table?
- Java: Lazy object storage with auto key from stack trace
- Node Js:- RangeError: Maximum call stack size exceeded
- set_terminate unexplained behaviour with exception thrown from std::thread and libunwind
- Find the stack start address in runtime. cortexM4 processor
- How to free the call stack in C?
- Why don't I see task queue bunch up?
- call stack when Segmentation fault
- Order of processing microtasks in JavaScript
- How are python variable names resolved? (explanations on the web are a bit uncertain)
- What does (deleted) mean in android app crash callstack?
- Why are perf back traces on Linux skipping a function (or showing a call to _init), with DWARF, LBR, and even FP (frame pointers)?
- why setImmediate function executes after setTimeout
- How to create stack trace for other process(out of process) when it crashes in google breakpad?
Related Questions in PSTACK
- Taking a process stack(pstack) on a process (in linux) when the process is about to exit
- Apache PHP call stays in W status in server-status for minutes
- Waitpid waiting on defunct child process
- pstack not printing stack output
- how to see stack trace for a particular thread within a hanged process in Linux
- pstack equivalent in erlang
- Why does "pstack" only print one thread's content?
- How to disable symbol loading in gdb-7.10?
- Why pstack is much faster than gdb with just attaching, saving stacks and quitting?
- JVM freeze resolved by pstack
- How to resolve function name through memory address?
- Displaying all stack history of a process
- using pstack to print all threads stacktrace
- Intalling gdb and pstack on Amazon Linux AMI
- Alter code accessed by running cron
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 # Hahtags
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.