External exception C0000006 [closed]

closed . This question needs details or to be clearer and is not currently accepting answers.

want to improve this question? Add details and make it clearer what problem is being solved by editing this post .

Closed 1 year ago .

improve this question

This week I'm hitting this error on some machines where the system is running.

Excepção externa C0000006 EXCEPTION_IN_PAGE_ERROR

Machines have access to system by a shared folder on the network. I don't know how to fix it.

Give to solve the error via programming and how would it be?

Author: Edu Mendonça, 2019-04-11

1 answers

This message occurs when your system is started by The Path (UNC ) or when there is a mapping to a given drive, both cases accessing Windows Servers that use File control Block ( FCB) for all user connections.
for example: \ server_name\system_access in TS environment.

This issue has been reported by Microsoft several times by Delphi developers and end users, also considering a problem with Windows Memory Management.

The incident External Exception C0000006 is an IO page error and may occur when Windows tries to load the application in parts in memory.

1. Case

  • an application is not fully loaded into memory, the system operational tries to fetch more of the application on HD disk so that it keep running.
  • the operating system does not load the part required program in memory and presents a missing page ( file Control block-FCB ).
  • after page failure, the operating system terminates the application with a ExternalException, because it cannot continue to execute the application.
  • file removed or inaccessible;

2. Solution

  • Best Solution: run the application locally, instead of running the from a shared folder on the same server. This prevents the problem from occurring, which indicates that this is a problem in the operating system. When running the application locally on each workstation, this will require a distributed model or client/server for application updates as opposed to a centralized model (which was previously possible with a shared folder location/path UNC).

  • possible solution: add compiler directive to application project:

    {$SetPEFlags IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP}
    {$DEFINE IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE = $ 8000}
    {$SetPEOptFlags IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE}
    {$SetPEFlags IMAGE_FILE_RELOCS_STRIPPED or
             IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP or
             IMAGE_FILE_NET_RUN_FROM_SWAP}
    

This directive will force the program to be fully loaded into memory and may prevent the external exception from occurring randomly.

Microsoft has published a hot-fix to address an instance of the problem reported in http://support.microsoft.com/kb/294816 .

See also this guidance on the website of embarcadero .

 2
Author: ProsTecnologia, 2019-04-13 12:25:22