HOME, PRODUCTS, ARTICLESCONTACT

C++BUILDER AND DELPHI FEEDBACK

WORKAROUND FOR THE PERPETUAL DELPHI™ SHUTDOWN AV

A perpetual access violation at shutdown condition can affect Delphi projects after the development environment corrupts the project .dsk file.

Because the development environment has no power to repair or rectify the condition, and because this condition can recur even immediately after repair, this article shows how to build a simple system which instantly repairs the perpetual Delphi shutdown AV.

ACCESS VIOLATION AT ADDRESS 002BA534 IN MODULE 'VCL70.BPL'. WRITE OF ADDRESS 00000018.

  • The condition affects many versions of Delphi.
  • Other addresses may be affected.
  • A corrupted .dsk file causes the shutdown AV.
    • The corruption may result from flaws in code parsing processes.

      Higher incidence appears to accompany conditions which may stress parsing:

      • Multiple editors focused on the same source file(s);
      • Opened source files not belonging to the current project;
      • Saved desktops;
      • Larger projects or units;
      • Heavily remarked code.

      Each of these may be avoided to minimize incidence.

  • Sometimes the corruption is caused or accompanied by an access violation in the IDE which may suddenly close the development environment.
    • After repair, the inadvertent closure condition and shutdown AV can re-surface immediately.
      • This necessitates a system for repeatably fixing the AV condition.
  • Because the development environment evidently can neither repair or rectify the condition, and because the development environment always attempts to write to the .dsk file at shutdown... once the .dsk file has been corrupted, perpetual access violations at shutdown ensue.
    • The only way to fix the condition is to repair affected project .dsk files.
    • The system advocated by this article repairs the affected project .dsk file by restoring from a desirable copy.
      • If you do not do this, you can alternatively repair affected projects simply by deleting affected .dsk files.
        • The default settings which are then reproduced however destroy all specialized information.
  • Re-installing Delphi cannot repair the perpetual shutdown AV because this will not repair corrupted project .dsk files.

FIXING AFFECTED .DSK FILES

It may be advisable until you are familiar with this system,

  • To make backup copies of .dsk files and saved IDE desktop configurations from which the previous condition of your Delphi™ installation and projects can be restored.
  • To prove to yourself whether this process repairs your .dsk files (and whether damaged .dsk files are your current problem). Make a separate copy of your project in a test directory, and perform your first trials there.

REPAIR SYSTEM ELEMENTS

  • A _DSK project subdirectory contains:
    • The backup copy of the project .dsk file.
    • A RestoreDSK.bat file, which will copy the backup .dsk file to the project directory.
  • A shortcut invokes RestoreDSK.bat.

HOW BREAKPOINTS ARE AFFECTED BY RESTORATION

  • Breakpoints are stored to the .dsk file and cannot be restored usefully, because breakpoint data is shifted from the state it exists in at the time the backup .dsk file is recorded.
  • Consequently, there is little point in trying to preserve breakpoints in your backup .dsk file.
    • This means you will want to save your backup .dsk file after deleting breakpoints.

THE .DSK FILE REPAIR PROCESS

  1. Delete saved global desktop configurations which may preserve or perpetuate the corruption (View->Desktop->Delete).
    • If you never save a global desktop again, you will never have to perform this step again.
      • Desktop configurations are still saved to the project .dsk file which you repair.
  2. The restoration process copies the backup .dsk file to the project directory.
    1. To restore your .dsk file after suffering an AV at shutdown,
      1. Click the shortcut.
    2. To restore your .dsk file after suffering an AV at design time,
      1. Shut down your development environment.
      2. Click the shortcut.
      3. Restart your development environment.

EXAMPLE RESTOREDSK.BAT BATCH FILE

Copy code to clipboard (JavaScript/IE).

BACKING UP PROJECTS

We can also use such a system to back up projects.

  • An _A (archive) project subdirectory contains:
    • One or more batch files for copying all or specific source files from the project directory to a backup subdirectory.
    • Periodic subdirectories for each backup.

      To perform a backup:

      1. Add a periodic subdirectory.
        • Subdirectory naming conventions identify each backup and chronologically organize the backup directories.

          "20121221-01-BEFORE REVISE TREE" for instance may indicate that in the year 2012, in the 12th month of the year, on the 21st day of the month, the first backup of the day preserves the state of the project before revising a class tree.

      2. Drag a copy of the appropriate batch file from _A to the new backup subdirectory.
      3. Double-click the batch file.

EXAMPLE BACKUPPROJECT.BAT BATCH FILE

Copy code to clipboard (JavaScript/IE).

EXAMPLE BACKUPPROJECTVITALS.BAT BATCH FILE

Copy code to clipboard (JavaScript/IE).

© Copyright 1995-2007, by ADVANCE Information Systems, Inc. ALL RIGHTS RESERVED.Copyright 1995-2007, by ADVANCE Information Systems, Inc. ALL RIGHTS RESERVED.

Firefox™.Best viewed in Mozilla Firefox™.