Delphi Handbooks Collection


Delphi XE Handbook


Delphi 2010 Handbook


March 12, 2008

It's a bugs life, by Bart Roozendaal

Last week I did an unusual two days consulting project, to help a Delphi developer find a long lasting bug. He wrote his experience, giving me permission to publish it on my blog.

Last week I did an unusual two days consulting project, to help a Delphi developer find a long lasting bug. He wrote his experience, giving me permission to publish it on my blog. Incidentally, Bart works for Sevensteps, a company that's selling a very nice Delphi application to a some of the largest software companies in the world, including Microsoft, Google, and SAP. Yes, these companies use a Delphi application internally for documentation purposes.

It's a bugs life

I've been programming for ..., well, since ever really. The first programs I've written were on paper cards, ticking boxes with a pencil. Those cards were send to a computer center which returned me the output the following week. Yes, I'm that old.

For a decade or so, I've been working with Delphi and much to my pleasure I might add. But, two years ago something happened. I have a couple of programs out there with a couple of hundred users and some of them were sending in bug reports that I couldn't explain. I looked all over the place for the cause of these reports but I simply couldn't find it.

I knew they were related to this text editing control I was using abundantly, and I dug deep into the source code of it, but I couldn't find a problem there. I was beginning to doubt myself. I knocked on the door of the developer of the control, but he asked ridiculous prices, even to *start* looking at the bug. And for all I knew, the control was actually causing the problem. So, even though I was in big trouble, my pride told me not to pay for solving a bug - at least not to the one who caused it.

I continued my hunt, sometimes giving up, sometimes digging deep. I made some small progress, but nothing that completely took it away.

Then, one day, I saw a news posting somewhere that Marco Cantu was starting a new service to help you out if you have any problems in finding solutions in Delphi software. Although the posting focused on new software and thoughts, I contacted him to see if he wanted to dig into this existing problem.

Soon we agreed on a reasonable fee; one for when we would find a solution to the problem and one if we wouldn't. Now, that's confidence: no hassle, no long e-mails, more like a gentleman's agreement.

I made the necessary travel arrangements and went to Piacenza (near Milano) in Italy. After going through some things I found out earlier and showing some of the bug reports to Marco, he concluded it must be a problem with memory management. We grabbed WinDbg (Microsoft debugger) and very soon we cold confirm that there actually was a problem with that. After having a great lunch we worked a little more, but because of other arrangements I had to leave early that day. But, we already made some real progress.

The next day we soon were able to create a small program that reproduced the problem (something I wasn't able to do the previous two years) and after that, the rest was easy. There was a problem with heap memory and it was due to some timing problems inside the control. Working around the problem didn't take more that a couple of lines of code and I can tell you I was elated! Just by having the correct assessment of the problem we were able to come up with the solution I was looking for for two years.

I couldn't have done it without Marco's expertise and - in the end - it was really fun working together on this. Peer programming really is a joy if you make more progress than working on your own (which not always is the case really).

I can recommend Marco to anyone, not only to novice programmers, but to very experienced once also. He has a quick mind, great expertise and is very friendly and makes you feel welcome. I'm sure to contact him again is something comes up that I can't solve alone.

Bart Roozendaal, Sevensteps

Final Comment

What can I add, I really enjoyed working on this issue, which was far from simple, but as most programmers tackling challenging issues is something I like, even more if I can find a solution... I have to say I'm debugging a program of my own for several weeks now, with much less success... Maybe I need someone else to have a look!





 

3 Comments

Its a bugs life, by Bart Roozendaal 

It is truly amazing what a fresh pair of eyes makes. 
Being a lone developer can be really hard at times
just for this fact and with no one to check your work
it is often too easy just to say "That's good enough".
 It's difficult to take pride in ones code when no one
else is likely to ever see it.

Alister.
Comment by Alister Christie [http://codegearguru.com] on March 12, 22:28

Its a bugs life, by Bart Roozendaal 

Pair programming is one of the most useful parts of
XP. And it is amazing to have Marco your partner.
Worth the effort. Congratulation, Bart.
Comment by Lex Y. Li [http://lextm.blogspot.com] on March 13, 04:57

Its a bugs life, by Bart Roozendaal 

Peer programming might not always be optimal - but 
peer debugging sure is.  

Getting someone that are free of your own 
preconceptions, assumptions and suspicions, and that 
can take a fresh view - will always help.

Sometimes the problem cause can be so obvious that 
you look past it, and even just describing the 
problem verbally or in writing to someone else, may 
actually be enough to cut through your own 
confusion.  
Comment by Lars Fosdal [] on March 14, 15:15


Post Your Comment

Click here for posting your feedback to this blog.

There are currently 0 pending (unapproved) messages.