Why I Use Version Control
Date: 21/8/2013
Tags: coding crash
Apart from the replication functionality of version control I got to use the ability to rollback code for real this week. Normally it's a stop gap that you never really need to use, but in this case I came across a problem that had me stumped. Clearly in the past my software has worked fine, and so in the case where you literally have no idea whats wrong, or even what change you made broke things there is version control.

In a nut shell the Mac port of Scribe was broken, it would start and then crash somewhere inside the Carbon library. I tried valgrinding it and that basically led nowhere useful. So I put it off for a bit before deciding to bite the bullet and walk back through my SVN commits and isolate the change that causes the bug. I started by writing a small python script that took a date as a command line parameter, that checks out the source as it was on that date. I started early in the year, and checked the 1st of each month. Compile each checkout and test it for that crash. I worked my way through till the 1/7/2013, where is started crashing... then I went back to 15/6/2013... runs fine. Forward to 23/6/2013, crashes. So some commit between 15/6 and 23/6 was to blame. The revisions in Lgi were 906 to 931 or so.

I began walking the Lgi checkout forward one revision at a time with the command:
svn up -r [revision_number]
Then recompiling after each update and running the software to test for the crash. It didn't take long to figure out that revision 912 was to blame.

Now I was getting somewhere!

So I started looking at all the source code changes in that commit and quickly ruled out all but two. So to test which part of the commit caused the crash I checked out r911 into a temporary location on my Macbook, while having r912 checked out on my PC. Then I proceeded to WinMerge changes one by one over to the r911 checkout on the Mac. That isolated the change to GList.cpp as the cause of the crash.

The final analysis is that a mismatched call to GSurface::ClipRgn(NULL) was doing something bad to the Carbon API and it would all go south from there. Reasonably easy to fix once you know what the issue is.

Yay... for source control! ;-)
(0) Comments | Add Comment

Visual Studio 2005 crashes when debugging an application
Date: 1/8/2013
Tags: vs2005 crash
I've just spent the better part of a day trying to troubleshoot this crash, so I'm going to post this here so that Google indexes it for the next poor soul that stubs their toe on it. Firstly I'll just outline the possibly relevant pre-conditions for this problem:
  • Windows 7 64bit
  • Visual Studio 2005 sp1 (with Vista update)
  • Subsystem for UNIX-based Applications (SUA) previously installed, but currently not installed.
What happens is that after uninstalling SUA I could no longer debug any application in VS2005. The IDE would simply crash as soon as debugging started. The event log would contain the follow entry:
Faulting application name: devenv.exe, version: 8.0.50727.867, time stamp: 0x45d2c842
Faulting module name: KERNELBASE.dll, version: 6.1.7601.18015, time stamp: 0x50b83c8a
Exception code: 0xe0434f4d
Fault offset: 0x0000c41f
Faulting process id: 0x22e0
Faulting application start time: 0x01ce8e70ca7eef80
Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\devenv.exe
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
Report Id: 0fb5f65e-fa64-11e2-8627-e05815f5174c
No one seemed to have the same issue as me. I tried lots of different things. Anyway I eventually stumbled on the problem by mere blind luck. In the add-in manager for VS2005 there was a "VSAddin" plugin that describes itself as an Extension to the VS debugger to support debugging UNIX based applications. And since I had recently uninstalled SUA to fix an unrelated issue I immediately twigged that this add-in was probably causing the crash. So I disabled it and restarted the IDE.

Now it doesn't crash. *sigh*
(0) Comments | Add Comment