Windows 2008 Server Problem by use of DOA in Dlls

JuergenDe

Member
Hi,
Since a couple of years we are using your components. We programmed a Windows Service which starts Job-Processes. The job-application uses DOA components and a dll (with the job-code) which also uses DOA-Components.
This had worked fine for many years and on many machines with Windows 2000, Windows XP and Windows 2003 operation systems. But with the change to Windows 2008 Server the started job-processes (normal Windows applications) crashes after about 7 hours direct after they had been created. On our Test-System we started about 200 Job-Processes per minute. After a period of 7 hours all processes crashes with a KERNELBASE.dll error. Only after a restart of the Windows 2008 Server a job-process can be started again without a crash.

For analyzing the problem we reduced the job-dlls on a minimum on code. After we remove the Oracle-Units from the loaded dlls the job-processes didn't crash.

Oracle version: 11.2.0

Regards
Juergen
 
Can you try the following?

In Windows Server 2008 R2, right-click on "My Computer", select "Properties", click on "Advanced System Settings", select the "Advanced" tab, in the "Performance" section click on the "Settings" button, select the "Data Execution Prevention (DEP)" tab, and add your executable to the list of exceptions.
 
we tried it, but it was not the reason. We also disabled the virus access scanning, but after about 84.0000 successful process starts we must restart the server. we have the problem on different machines (e.g. machines of our customers).

If we remove the DOA-"Oracle" unit clause from the uses part the problem disappear.

As further Information: We start the processes by an Windows-Service.
 
The Oracle unit by itself does not do much. Do you have the source code available? If so, you can remove the Oracle unit initialization code to check if there is a specific line of code that leads to the error.
 
I did so. After I uncomment the following lines:

initialization
begin
...
//AllSessions := TThreadList.Create;
...
end
finalization
begin
...
//FreeAllSessions;;
...
end;

The problem disappear. After that I wrote a dll which opened a connection (TOracleSession) and the Problem appears again.

Further test shows me that problem always appears when I start
the processes as normal application and not as service. It seems to be that the Windows user session will be unusable. After the process crashes occur, it was not possible to start any further process. A further login with the same user was not possible. The Windows-Explorer couldn't be started again. I have to restart the Windows 2008 Server with an other account. This shows me that it is not an session0 Problem of the windows-Service-Environment.

I also try to use an other memory-manager (simplesharemem) in the DLL but the result was the same.

Now I wrote an further test application (server, client, dll) which reduces the problem on the essential code.

Is it possible to send you this application?

 
Can you create a little test DLL that simply does a TThreadList.Create and a subsequent Free, without using any DOA units?
 
Now we changed our test application, don't using any DOA component in the client application and dll. Instead of logging to DB we log to a different files. At last it also crashed after about 20.000 executions. We checked the units, and after removing the unit "Dialogs" (it was accidentally in the project ) the server didn't crash (we stop after 6 million executions). Now we ressume that this unit or any from this unit referenced units is the reason for the server crash. The unit is also used in the Oracle-Unit. This would mean I made an error by uncommenting the initialization and finalization part or it takes more time before the crash occurs if these parts are uncommented.
 
Hello Marco,
last week we got support from Embarcadero. They informed us about a problem by releasing records in the atom table by using the control-unit and sent us a bug fix. They wrote about a limitation of entries in the atom table for windows 2008 Server and Windows 7. If you will start thousands of applications (e.g. Job-Implementations) this will become a problem for the system.
With this bug fix the error disappears. I hope the bug fix will be part of Delphi XE3.

Thank you for your help and thoughts.
J
 
Back
Top