Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug a multithreaded application in C++ which is hung (deadlock)?

In java debugging a hung application is easy. You can take the memory dump of the application and use and use eclipse jvm dump analyser to see the status of the threads and where each threads were blocked?

Does something like this exists for C++?

like image 644
pankajt Avatar asked Oct 28 '25 04:10

pankajt


1 Answers

You can do the exact same thing with C++; force a core dump and look into it after.

Or, if you're using MSVC, you can simply attach the debugger to the application while it's running. Hit "break all" and poke around through the threads.

like image 172
Crashworks Avatar answered Oct 29 '25 18:10

Crashworks