The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Diff Debugging

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Diff Debugging Posted: Jun 1, 2004 7:23 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Diff Debugging
Feed Title: David Buck - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/buck-rss.xml
Feed Description: Smalltalk can do that
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From David Buck - Blog

Advertisement
Alan Knight talked about Diff Debugging. I thought I'd pass along a personal experience with diff debugging. This is likely one of the most difficult debugging sessions I every had to do.

On a project I was on, we had a problem with garbage collection. Elliot Miranda suggested that we upgrade the virtual machine to the one for the next release and promised us that it would be backward compatible with the old image.

Everything worked fine except the calculation of one number in one of our tests. With the new virtual machine (and the same image), the number was coming out differently. By stepping two images simultaneously I determined that the values were identical going into a DLLCC call and different coming out.

I pulled out a C debugger and intercepted the DLLCC call. Inside the C function, the two systems differed in the 4th iteration of a loop. On one system, the C code took a branch and on the other it didn't. The strange thing is that the floating point variables that were being compared looked identical between the two systems.

Drop down to assembly language. The code loads floating point registers performs a multiplication, then compares values in the registers. The strange thing was that the numbers in the registers were slightly different between the two systems. It looked like one system was more accurate than the other.

Dig up specs on the floating point processor of the Pentium. Check the status words. The status words are different by one bit. That bit (according to the specs) forced calculations to be done in extended precision rather than double precision. It turns out that the new virtual machine switched the processor into extended precision mode.

I told this to Elliot who almost instantly knew what the problem was. We had a fixed virtual machine within a day or two.

This is the first time I ever had to go from Smalltalk to C to Assembly to bits in a status word of a floating point processor to diagnose a problem and all of it with diff debugging.

Read: Diff Debugging

Topic: Fixed comment feeds Previous Topic   Next Topic Topic: Niall Ross' StS 2004 report

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use