[Mono-dev] Deadlock Detection in Mono Libraries

Arun K arun.k at iiitb.net
Sun Nov 7 21:05:59 EST 2010

Hi All,

I am performing a static analysis on the mono 2.4.x libraries. The aim of
this analysis is to detect potential deadlock scenarios within the
libraries. As a first step, I wanted to find if any synchronized method
invokes another synchronized method either directly or eventually. For
example, consider the two invocations, ==> A.x() calls B.y(); B.y() calls

Say, A.x() and D.w() are synchronized methods, then I will find all
occurrences of an eventual call between A.x() and D.w(). In this case, it is

I performed this analysis for all the dlls present in the /usr/lib/mono/gac
directory and was able to find 398 synchronized and 118746 non-synchronized
methods. But I could not find a single instance where an eventual call
between two synchronized methods occur. This is a bit surprising because a
similar analysis on the JRE-1.5 libraries resulted in a handful of such
instances. Hence I post the following questions to help ascertain my

1. Is there any guideline that requires such a scenario to be avoided by
design when developing mono libraries? (I mean the scenario where a
synchronized method eventually calls another synchronized method)

2. Is there anyone in the developer community who has seen a counter example
to this finding?

More details on the analysis can be found in the paper - "Deadlock-Detection
in Java-Library Using Static-Analysis" by Vivek K. Shanbhag.
Url: http://www.computer.org/portal/web/csdl/doi/10.1109/APSEC.2008.68

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20101108/490b5801/attachment.html 

More information about the Mono-devel-list mailing list