Delphi 2010 BSOD Errors

We ported the application from Delphi 7 to Delphi 2010 and clients had intermittent BSOD (blue screen of death) errors while working under Windows XP. Errors are very sporadic and very difficult to track. FYI: We use the built-in memory manager from Delphi 2010.

Our first thought was a hardware problem, but updating the system drivers did not solve the problem.

Has anyone else encountered BSOD issues in XP with Delphi 2010 generated applications? If so, do you have any suggestions on how we can fix this problem?

Thank you for your help!

+4
source share
2 answers

There is nothing in Delphi core libraries that could call BSOD directly. As David noted, Delphi programs run in user space. However, if they send incorrect data to the kernel driver, this is another matter.

You said that the D7-D2010 update, and the first thing that happens to me is updating the line. The standard Delphi string type has been changed from AnsiString (1 byte per char) to UnicodeString (2 bytes per char) and if you send the wrong string type to the driver or system procedure, it may cause strange behavior somewhere.

The first thing I would like to do is run the full assembly and watch for the "implicit conversion" warnings from the compiler. This means that you are mixing string types. Find them and fix them and see if that helps.

Also, if you have any import units for external libraries and they use APIs that take a string parameter (or most likely PChar ), make sure they are converted to PAnsiChar . Delphi has already taken care of this for the Windows API materials used in windows.pas , but if you have any of your own, you need to take care of yourself.

+6
source

The BSOD can be analyzed by opening a WinDbg emergency dump or other tool capable of handling emergency dumps. Even "minidump" will give enough information to try to understand where and, I hope, why BSDO happens. WinDbg can be downloaded for free, and you do not need to install it on the target machine, you can ask your customers to send you emergency stalls, and you can analyze them offline. In any case, generating a BSOD from user mode code is usually very complex, but there are ways to minimize the system. What error is displayed by BSOD?

Update: if the error is PAGE_FAULT_IN_NONPAGED_AREA, this link explains what happened: http://technet.microsoft.com/en-us/library/cc957625.aspx . This is usually a memory problem, and it can happen that a D2010 that uses more memory than an older version may end up causing it. Can you run memtest on these machines (http://www.memtest.org/)?

Ntkrlnpa.exe is not a driver, it is an image containing the OS operating code and kernel code (version with PAE support). Using winDbg and a crash dump, you can get a call stack leading to a crash.

+3
source

All Articles