Advertisement
Promo

Become a member of the ZDNet UK community

PeterI

View blog's RSS Feed

Client taming

Taming the clients vision into either their budget or time scale...

Tuesday 28 October 2008, 8:22 PM

Heisenbugs

Posted by PeterI

If you're at the PDC, I can only suggest that you check the Microsoft Research Area. There are some great demos being given of Microsoft Chess. Chess is a tool Microsoft have created to help track down so called "heisenbugs". These are usually bugs where the act of trying to debug them, or putting in trace code, alters the relative timing of your application and causes the problem to disappear. In this new multi-core world that developers live in, as we add mulitple threads to our applications, we are much more likely to create this class of bug.

Chess is designed to solve this problem. It will help if you have unit tests for your application (you do, of course?), which Chess then runs multiple times, varying the timing across your threads, looking looking for problems such as data races. You can give some clues, but it will pre-empt scheduling and attempt to reschedule when variables which have been marked as being volatile change, or when the programmer uses mutexs to attempt to force threads to run singularly.

The demos (which I videoed but I'm have problem getting off my camera) are impressive, using PLINQ to generate a parallel program with a deliberate data race problem. The code usually runs correctly, but once in, say, a 1000 times, the code will fail. Using Chess as host for your tests it alters the order the threads run in (presumably by doing a relative drift), and the test eventually fails.

When the test fails, it generates some C# attributes you can then use to decorate your test methods (it seemed be a 100-200 character stream), which means that the test should always fail. What I'm not quite clear about is how robust these relative timing changes are in the face of your changing code, but its a good start.

Currently the testing environment is hosted using team foundation system and using the Microsoft unit-testing framework. For those folks who are using the downlevel Visual Studio editions, there is also a command-line version available.

It's not currently available, but I was told it would be in a couple of weeks. In the meanwhile, the project website is here: http://research.microsoft.com/chess/

Comments on this post

Xwindowsjunkie

Thank you for posting this note. I have had this very same problem. It seems to crop up when attempting to read a networked share drive that is sometimes busy.

Posted by Xwindowsjunkie on Nov 3, 2008 2:45 AM

PeterI
  • PeterI
  • Development Project Management, London
  • Member since: November 2006

Site Activity Rating 3

Contacts

Number of Contacts: 3

Contacts' Latest Discussions

Number of Tracked Discussions: 951

roger andre roger andre

Really?

Wednesday 4 November 2009, 10:25 AM

6 comments
roger andre roger andre

Energy Harvest Arrives

Tuesday 3 November 2009, 9:51 PM

6 comments

Contacts' Latest Blogs

Number of Contacts Blogs: 2


Skip Sub Navigation Links to CNET Brand Links

Help

Become part of the ZDNet community.

Newsletters