Delphi XE2 crash when opening the About dialog

 Delphi  Comments Off on Delphi XE2 crash when opening the About dialog
Dec 292017

Today I had a rather annoying problem with Delphi XE2. I only wanted to change the caption of a TListView column using the Columns Editor (right click -> Columns Editor). The IDE crashed on me with an Access Violation. So, I thought I had broken it again (things like this happen when you are developing IDE plugins) and uninstalled GExperts. After a restart I tried it again and got the same Access Violation, proving at least that GExperts was not the culprit.

So, which other IDE plugins were installed? To find out, I opened the Help -> About dialog, which immediately crashed on me with an Access Violation. It happened while it was drawing the list of Installed Products.

Next I tried to debug Delphi with itself, loading the GExperts sources. The problem at least was reproducible and the call stack told me the crash was in TCustomListView.CNNotify. That unfortunately wasn’t very helpful apart from telling me that it had something to do with custom drawing (which was deeper in the call stack) of a TListView, which was what both crashes shared: The About Dialog as well as the Columns Editor both use TListView and apparently do custom drawing.

So, I removed all experts that I had installed …

… and tried it again. At first, it seemed to work, I could open the About Dialog and nothing bad happened. Then I opened the project I was trying to change, called the Columns Editor and – boom – got the Access Violation.

I restarted the IDE again and looked into the About Dialog. There were only the Embarcadero Quality Insight and the JEDI Visual Component Library left. No crash occurred. I reloaded the project, opened the About Dialog again and got the now familiar Access Violation. WTF? Could it be the JVCL?

I renamed the JvCore160.bpl package that all jvcl packages load. And tried again. I got lots of error messages when I started the IDE and again when I opened my project, but I could successfully open the About Dialog.

So, if it really is the JVCL, why did the Access Violation only occur when my project was loaded?

I made the JvCore160.bpl package available again, restarted the IDE, but this time created a new VCL project and added a JVCL component to it. I opened the About Dialog and got the AV. I guess that proved the point.

That was when I remembered reading about Delphi 2005 (and later) loading packages on demand instead of on startup. This explains why the AV happens only after a JVCL component was used in a project: Because otherwise the packages simply were not loaded at all.

Unfortunately that didn’t help much, because my project needs the JVCL (in particular the TJvFilenameEdit component), so I could not simply uninstall it. Since I had not heard about this problem, I guess it isn’t wide spread. One possibility is that I have produced it myself by sticking with an older JCL/JVCL source code and simply patching it to make it compile with Delphi XE2 instead of keeping up with the latest version (The reason for that is that I don’t like the hassle with Git, so I stopped following the JEDI projects when the sources were moved from SourceForge to GitHub.)

I went to GitHub, downloaded the latest ZIP files from all three projects, put everything together and installed JCL and JVCL to Delphi XE2 (the JCL installer dialog looks intimidating if you have got 18 versions of Delphi installed). I then had to remove the directories from the library paths again and compile several of my packages that need the JCL or JVCL+JCL, which required me to make some small changes to my code. But it took only about half an hour, which is nothing compared to the several hours I had already wasted trying to find out what made Delphi XE2 crash.

I loaded the dreaded project again, and everything worked fine. I could finally change the List View captions which was all I wanted to do to start with.

Isn’t it great when everything just works?

 Posted by on 2017-12-29 at 18:16

new Seagate Barracuda drives are very slow

 Linux  Comments Off on new Seagate Barracuda drives are very slow
Dec 292017

Seagate has changed their Barracuda desktop 3,5″ 2 and 4 TB drives from using 3 platters to using only 2 while doubling the cache RAM from 128 to 256 MBs.

We have been buying this type of drives for various usages, one of them is the 4 TB drive for the backup of our main file server (using Dirvish). Before the change, an ext3 format under Ubuntu Linux took a few minutes. After the change, it now takes literally(!) hours. The inode tables counter grows very quickly until it has reached about 1000, after which it starts crawling upwards veeeeeerrrrryyyy sloooooowwwwwlyyyyyy. I guess about 1000 is when the cache has been filled and any further writing goes directly to the actual drive.

Once the formatting is done, the initial backup takes several days rather than the usual 8 to 12 hours it took before the change.

Once the initial backup is done, the incremental backups only take the usual 30 minutes unless there have been very many changes, then again you can see that the drive is very slow when writing large amounts of data.

It does not matter whether the drive is connected via USB 3 (which is the way we use it for the backup) or SATA, the slowdown is reproducible every time.

Another use for these drives was the 2 TB variant to store videos in our measurement vehicles. There are 2 of these drives in one PC which are used to write MJPEG streams of 2 HD cameras each. These cameras take a picture every metre, which comes out at about 22 pictures per second when driving at 80 km/h. Before the change that was no problem at all. We could even drive at 100 km/h (27 pictures per second). After the change, the videos suddenly had lots of lost frames because the drive is just too slow to write them.

For now the 1 TB variant seems to be as fast as ever.

So now we are looking for alternative drives to use. Until a few years ago we only bought Hitachi but switched to Seagate when Western Digital acquired HGST and raised the prices. I guess we’ll have to look into WD / HGST again as well as checking out other Seagate product lines.

 Posted by on 2017-12-29 at 14:25