Login to participate
  
Register   Lost ID/password?

Louis Kessler’s Behold Blog

Unexplainable Programming Occurrences - Mon, 14 Dec 2009

These are difficult bugs I’m being given. Fortunately, I am getting through them. I had hoped to have another beta out by now, but theres a few more fixes to do first.

I had a couple of those unexplainable programming occurrences happen. The worst was after I had done those two very difficult fixes, with the help of Uwe in the comments on my last blog post, and with the help of the LMD people on their newsgroup. I made those fixes and then was getting ready to go forward to the next item, and all of a sudden the files were loading much slower. I mean like 20 times slower.

It took me a while to trace this to where it was happening. First I tried using Eric Grange’s Sampling profiler that I was hoping to use in the future for optimization. I was terribly disappointed in how it couldn’t get me close to where the problem was. It was listing system routines with 90% of the time being string copies. Well I know that is going on at the low levels. What I want to know is from whence that is being called.

So I went back to AQTime. They just put out version 6.30 which finally includes integration into Delphi 2009, so it was worthwhile me trying it again. Of course, they’re still behind the times, because Delphi 2010 has been out for awhile so they’re over a year behind in their Delphi integration.

The AQTime Delphi 2009 integration didn’t help. Seemed to be buggy and I couldn’t get it to profile by line. So I did it externally and right away found the line in question. Problem was, there was absolutely nothing wrong with the line.

I was using Delphi PChars, and adding the length of the block to the starting character pointer to tell it where to stop. But somehow, it did not add correctly, and subtracted 4 instead. So the entire block was being Encoded once for each record, rather than once for each block. And the code was correct. I couldn’t find what was wrong.

I went back to my earlier beta version. It had no problem. I checked my next build. It was okay. Then the next build - that one no longer worked. There was nothing different codewise. I spent a day on it. Possibly some compiling option got changed, or some memory got filled somewhere? I don’t know. But my major changes had happened in the 5 builds since then. After I gave up trying to fix the problem, I had to go back to the working version and add all the changes since then and check step by step that the problem did not reoccur. It did several times along the way. So I had to go back and make fewer changes at a time. Doing so finally got me to my current state without the PChar problem.

So I’m totally perplexed and don’t know what this was. I have to stem my curiosity or I would spend the next two weeks or longer trying to track this down.

But the important thing is to continue on with the beta. So as long as I’ve rid myself of this problem that shouldn’t have occurred anyway, I better just forget about it, pretend it didn’t happen, and just cross my fingers that it doesn’t happen again. I don’t expect that it will, but if it does, then I’ll nail it down and put it away for good.

I guess I had entered the Programmer’s Twilight Zone. Let’s hope I’m out.

All Directions At Once - Wed, 9 Dec 2009

There have not been a great number of problem reports with the beta of Behold so far, but it’s amazing how diverse these problems are. They cover all ends of the spectrum. Some are easy to find and others I don’t know what’s going on yet and require more debugging. Some are easy to fix, and others are very onerous.

I’ve fixed a few already and I’m in the process of fixing about 6 others at the same time.

One involves something that Delphi itself seems to have a problem with. I’ve got a question on StackOverflow for it and one of the resident experts there is helping me out.

Another is a problem with my ElXTree component, and I’ve reported the problem to the LMD people on their newsgroup, and they are helping me with that.

Then I’m debugging some bugs that crash Behold and fixing those. One is simply using the arrow up key to scroll up the window. I had thought I had debugged my Virtualization of the Richview window, but I guess I missed that.

Then there is one that links to the child of a person, but that child is actually the user’s parents. That one is also surprising to me. I checked the GEDCOM thoroughly and it appears to be correct. My linking of this sort has been working correctly for years, and I’m very perplexed by this one. I’ll be interested in seeing the reason.

Then there was someone reporting something in Windows 7 that I can’t reproduce in Vista. So I’ve been loading both Windows 7 and Windows XP into Virtual PC windows so I can reproduce the error and ensure that Behold runs okay under the two systems, without needing multiple computers. (I absolutely love Virtual PC!)

So lots going on here and I’m making good progress. Hopefully in a week I’ll get out a new beta with most of the problems fixed.

There is NO virus in Behold! - Thu, 3 Dec 2009

Fieke who has been testing the Behold beta was startled yesterday. In the background was running the antivirus program Avast. Avast Antivirus seemed to think there’s a virus in Behold. Avast kept warnings coming and then shut down Behold. Not only that, but the Behold install program was also being reported as to have a virus.

Something is Behold was causing Avast to think that Behold and its install program had a virus, when I knew they didn’t. And that’s why I code sign Behold - to make sure nothing happens to it before it reaches you. Fieke checked and told me that Behold’s signature was okay.

You couldn’t imagine my horror upon hearing that. Having that happen to your program is as bad as Tiger Wood’s little escapade the other day. The damage is irreparable.

I went to Avast’s online scanner and submitted Behold myself. Sure enough, it reported that Behold.exe was infected with Win32:Delf-MZG [Trj].

I immediately shot off an email to Avast. I was pleasantly surprised to receive a prompt response that said:

It was a false alarm of Avast virus database 091203-0. It was fixed in the latest virus database update, please update virus database. We deeply apologize for the problem.

Well that certainly made me feel better. Fieke let me know when Avast next updated its new virus database, the reporting of a virus was fixed. Today I went back to the Avast’s online scanner and sure enough, Behold is now reported as clean.

So after a heart numbing affair, I now find that a search on Google for: win32:delf-mzg [trj] gives a good number of “false positives” with Avast reporting every program from Skype to Spybot to a host of others. Avast had to fix this, because the mistake would ultimately have caused them even more anguish than they did me. Here’s one of the typical reports on this by Andrew Wee just posted today.

This is what programming’s all about. There’s always something new creeping up that you never expect. Avast, me hearties.