I have a application, its consist of lot of custom controls and while process the operation the application is hangs and the deadlock occurs, i can't able to find the code for deadlock, could you please any one suggest how to find the code for deadlock or is there is any tool to find this?
Asked
Active
Viewed 3,308 times
1
-
2Breaking on the debugger doesn't show where it's at that point? – Sami Kuhmonen Apr 13 '16 at 10:18
-
welcome to the joys of programming – auburg Apr 13 '16 at 10:21
-
Hi Sami, debugger is not pointing, i have a very large application. – Farjana Parveen Ayubb Apr 13 '16 at 10:26
-
logging a.k.a. `Debug.Write` is your friend. riddle your code with logs and read the logs – Thomas Andreè Wang Apr 13 '16 at 10:36
-
Is there is any tool is available to find the dead lock? – Farjana Parveen Ayubb Apr 13 '16 at 10:49
-
Is the deadlock reproducible ? Have you tried simplifying your app (removing user controls / commenting out method calls etc) to narrow things down ? You need to have a general idea on when / how the hang occurs and take it from there. If you're completely stuck then roll up your sleeves and use windbg / sos - but that's not the easiest tool to use - see [msdn](https://msdn.microsoft.com/en-us/library/bb190764.aspx) – auburg Apr 13 '16 at 10:59
-
If you have a simple deadlock, pause execution in the debugger and inspect every thread. – yaakov Apr 17 '16 at 06:32
1 Answers
0
First of all you check if there is an exception which is thrown on background. In order to turn on the CLR exception to be thrown go Debug/Exception and check the Common Language Runtime Exception check-box. Secondly you can try to pause a debugging session, and try to see where is each thread at the time that the application was dead-locked and research the Callstack. In addition you can trace each place that probably can be a cause to dead-lock.
Here is some SO query that can help you:
Here are some tool that in my opinion can be useful in this case:
- OzCode - can help you to debug and manage situation in a better way(allows to trace the code in a better way and more...).
Regards,