Home
Shotgun Debugging Print
User Rating: / 0
PoorBest 
Written by Brenden   
Wednesday, 25 November 2009
Wikipedia describes shotgun debugging as " a process of making relatively undirected changes to software in the hope that a bug will be perturbed out of existence."  I think that's a simple misconception of whoever wrote the jargon file, which is what this Wiki page is based on.  I've used what I describe as 'Shotgun Debugging' successfully on dozens of bugs.   Read more to get details of the latest (for anyone who cares).

My primary project makes heavy use of Firebird SQL Server (open source database engine) on large databases (30+gigs) for a Point of Sale system.  Recently a major performance enhancement was made to Firebird SQL, which also introduced a few problems.  We had customers who's server would stop accepting new connections after a database backup, we pulled that customers entire computer (sent a replacement of course) and were entirely unable to duplicate in house.  The problem was intermittent at many locations, and only duplicatable at one.

 As they need to run their business, we only had one chance per day to try things out.   We started working with the Firebird Foundation trying to track down the root cause.  6 weeks later, no success.

 At this point I decided I'd better just download the source (public open source), and start debugging.

 As I could't reasonably install Visual Studio at the customer site and debug live, the only choice was the shotgun approach.  We had errors in the firebird log, so I simple found the areas of code that can raise that error, and starter liberally sprinkling debug output into those areas.  Pretty much output of things like "opening receive map", "mapping view"..etc..  

Using this technique I was able to track down the problem (timeout on client side) and describe the entire sequence of events in 2 cycles (took 2 days as mentioned above we could only get one cycle per day).  Third day I had a patched version to confirm the fix, and problem fixed.

 I did in 3 days what the 'experts' couldn't do in 6 weeks using this tactic.  If you find yourself stuck with third party bugs, and source is available I strongly recommend this technique as the first thing to do.

 
< Prev   Next >
© 2012 Diablo Professional Services
Joomla! is Free Software released under the GNU/GPL License.