Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C#/.NET analysis tool to find race conditions/deadlocks

Is there a tool that analyses .NET code and finds race conditions?

I have a bit of code that has a public static property that gets or creates a private static field. It also has a public static method that sets this field to null (...yes, I know!..)

As there are no locks around either of these methods, it's a safe bet that things'll go horribly wrong in the future. I need a tool that'll recursively go through things that call either of these methods and see if anything was spawned on another thread.

I'm looking for a tool or perhaps an nDepend SQL script (if this is possible).

like image 255
Steve Dunn Avatar asked Mar 04 '10 13:03

Steve Dunn


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What is the full name of C?

In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr.

What is C in C language?

What is C? C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972. It is a very popular language, despite being old. C is strongly associated with UNIX, as it was developed to write the UNIX operating system.

Is C language easy?

C is a general-purpose language that most programmers learn before moving on to more complex languages. From Unix and Windows to Tic Tac Toe and Photoshop, several of the most commonly used applications today have been built on C. It is easy to learn because: A simple syntax with only 32 keywords.


2 Answers

You're probably looking for one of these:

  • CHESS
  • Typemock Racer

NOTE: This answer is from 2010. As with all recommendations answers, recommendations tend to change over time. There may be other products out there now, CHESS which was a Microsoft Research Labs project may have evolved into a final product or been scrapped altogether. Please take this answer with a grain of salt and conduct new research into which products are suitable now.

like image 119
Lasse V. Karlsen Avatar answered Sep 24 '22 16:09

Lasse V. Karlsen


Jinx will do this at runtime (not statically) but it may be worth looking at.

like image 24
John Gietzen Avatar answered Sep 23 '22 16:09

John Gietzen