title: How to detect circular calls?
body: <p>I've been looking for causes for deadlocks and strategies/tools to avoid and detect them.</p>
  
  <p>Another potential cause for deadlocks is to have blocking functions calling other blocking functions in a circular way, so that eventually a call never returns.</p>
  
  <p>Sometimes this is hard to discover, specially in very large projects.</p>
  
  <p>So, are there any tools/libraries/techiques that allow to automate the detection of circular calls in a program?</p>
  
  <p><strong>EDIT:</strong>
  I code mostly in C and C++ so, if possible, give any information about the topic that is applicable to those languages. </p>
  
  <p>Nevertheless, it seems this topic is scarcely covered in SO, so answers for other languages are ok too. <em>although maybe those deserve a topic of its own if someone finds it relevant</em></p>
  
  <p>Thanks.</p>