Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Delphi 2007 IDE hangs the PC on loading the executable image for running


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 15 - Last Post: Mar 20, 2016 12:51 PM Last Post By: Ross McMillan
Ross McMillan

Posts: 14
Registered: 7/1/97
Delphi 2007 IDE hangs the PC on loading the executable image for running  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 11, 2016 4:54 PM
This question was posted on stackoverflow, but was closed by a drive-by robot because it didn't attract an answer. I found [this post here|https://forums.embarcadero.com/thread.jspa?threadID=106362] which is a similar issue, and also have gone a bit further characterizing the problem.

I have a real show-stopper of a problem. When I compile a program from the Delphi IDE and run it, sometimes the PC hangs. Not just Delphi - everything. The only exit is the long press of the power button. I can't raise task manager. The clock in the tray keeps running, however.

In my investigations I have determined:

- it doesn't always happen - probably 1 time in 4.
- the problem is not confined to one application. I have had it occur on large applications and on test programs of a few dozen lines.
- the problem never occurs when compiling the same application with the command-line compiler.
- If I compile with the IDE, and then run the resulting executable directly (i.e. not from the IDE) the problem never occurs.
- if I compile with the IDE, run from the IDE, and the machine hangs, then after a reboot I can still run the executable that was left on disk by that last compile without any problems. I.e. the problem doesn't seem to be a bad exe.
- the problem leaves the PC with the curious half-rendered line of the event log as shown in the screen-shot (excuse the quality - no screen grab available when this happens!). The module last loaded is not always the same as shown here however - I have seen it freeze on MSCTF.dll, LIBEAY32.dll and NETAPI32.dll also.
- If I build, then start the run with F8, the cursor will end up on the begin in the DPR file. The freeze can occur before that point, or after. I'm assuming that none of my unit initialisation sections execute until I move off the first begin (please correct me if that's not the case, and I'll start adding some debug writes to the initialisation sections of my library units).
- the PC (Dell 8700 with 16G RAM) passes a rigorous memory check.
- I can now also confirm that it also happens with my other development PC (a Toshiba P50 laptop).
- The problem can also occur when I load the executable with the IDE (Run/Load Process). This is whether or not the checkbox Execute startup code on Load is checked or not.
- Disabling MadExcept has no effect.
- Excluding the project files from Antivirus real-time-protection scanning doesn't help.

Any ideas on where to look or the best way to determine the cause?

[Screenshot|https://dl.dropboxusercontent.com/u/311035/D2007Hang.jpg]
david hoke

Posts: 616
Registered: 2/9/07
Re: Delphi 2007 IDE hangs the PC on loading the executable image for running [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 12, 2016 5:21 AM   in response to: Ross McMillan in response to: Ross McMillan
Ross McMillan wrote:

Any ideas on where to look or the best way to determine the cause?

The symptoms sound characteristic of a possible memory issue to me.

Have you checked the OS system logs for possible memory errors, or
tried to run any sort of memory diagnostics?

Tried reseating/replacing any memory chips/simms/dimms/etc.?

Tried a different PC?
Robert Triest

Posts: 687
Registered: 3/24/05
Re: Delphi 2007 IDE hangs the PC on loading the executable image for running  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 12, 2016 5:29 AM   in response to: Ross McMillan in response to: Ross McMillan
How long are you using Delphi 2007 on that machine? If longer, didn't you had this problem before? What Windows version are you using?
Ross McMillan

Posts: 14
Registered: 7/1/97
Re: Delphi 2007 IDE hangs the PC on loading the executable image for running  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 12, 2016 2:18 PM   in response to: Robert Triest in response to: Robert Triest
Robert Triest wrote:
How long are you using Delphi 2007 on that machine? If longer, didn't you had this problem before? What Windows version are you using?

Both machines are running Windows 10 Home 64 bit. I have been running Delphi 2006/7 for may years, but my impression is that the problem has either appeared or got worse with Windows 8/10 or moving from D2006 to D2007.appeared with Windows 8 or 10.

To be honest, system crashes are common enough anyway in my S/W development, but normally its just an IDE crash or an AV from my app, and these crashes never took down my whole system like this one does.

Extensive memory tests have been run on both machines. I never have this sort of crash when rurning other applications. I've pretty much ruled out a hardware problem because the problem occurs on two disparate pieces of hardware.and only when a particular operation (Delphi IDE loading an EXE for execution).
Robert Triest

Posts: 687
Registered: 3/24/05
Re: Delphi 2007 IDE hangs the PC on loading the executable image for running  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 12, 2016 11:52 PM   in response to: Ross McMillan in response to: Ross McMillan
the problem has either appeared or got worse with Windows 8/10 or moving from D2006 to D2007.appeared with Windows 8 or 10.
My feeling is that it might have something to do with that Delphi 2007 (IDE) has problem supporting Win 10.
Carl-Henrik Nil...

Posts: 53
Registered: 3/26/02
Re: Delphi 2007 IDE hangs the PC on loading the executable image for running  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 13, 2016 12:04 AM   in response to: Robert Triest in response to: Robert Triest
Robert Triest wrote:
My feeling is that it might have something to do with that Delphi 2007 (IDE) has problem supporting Win 10.

Unfortunately it's not just a D2007 problem. See this thread:
https://forums.embarcadero.com/thread.jspa?threadID=119617&tstart=0
--
C-H
Angus Robertson

Posts: 205
Registered: 3/17/00
Re: Delphi 2007 IDE hangs the PC on loading the executable image for  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 13, 2016 12:28 AM   in response to: Robert Triest in response to: Robert Triest
My feeling is that it might have something to do with that Delphi
2007 (IDE) has problem supporting Win 10.

I've been using Delphi 2007 heavily for the last six months on Windows
10 (in place update from W7) without any new problems. DelphiSpeedUp
and IDEFixPack were installed.

Rarely with D2007, there is a massive memory leak in the IDE that
finally makes it grind to a halt, simple restart and it's happy for a
few more weeks. Even more rarely, the IDE just crashes on it's own. But
none of this stops it being very productive.

Just changed to a new PC so now have a fresh D2007 install, hope it's
as reliable.

Angus
Beurnie von Diek

Posts: 1
Registered: 2/29/16
Re: Delphi 2007 IDE hangs the PC on loading the executable image for running  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 1, 2016 2:03 AM   in response to: Ross McMillan in response to: Ross McMillan
Hello everyone,

I have the exact same problem. I'm using delphi 2007.
Windows 10 64 bit PC and Laptop, it happens on both of them.

Is there a way to fix this problem? It's pretty annoying when you have to restart everything.

kin antoine

Posts: 4
Registered: 5/28/00
Re: Delphi 2007 IDE hangs the PC on loading the executable image for running  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 12, 2016 8:29 AM   in response to: Beurnie von Diek in response to: Beurnie von Diek
Beurnie von Diek wrote:
Hello everyone,

I have the exact same problem. I'm using delphi 2007.
Windows 10 64 bit PC and Laptop, it happens on both of them.

Is there a way to fix this problem? It's pretty annoying when you have to restart everything.


I have the same problem. But the strange thing is that it it doesn't happen with all programs (compile and running from the IDE). With a number of existing programs it never happens.

To date the ituation is getting worse because if I simply open Delpi7 and run it (ctrl F9) with the standard form generated by D7 when it opens, the same thing hapens; compiles ok but hangs on running. I have to kill Delphi7 with the task manager. When after killing D7 i reload it and rerun compilation, I get a message saying that it cannot generate the output file. If I reload W10 and rerun D7 it's ok. This mean that the program is loaded in memory but doesn't show up in the task manager !

So far I have uninstalled then reinstalled D7, but to no avail. I have disconnected the anti-virus (macAfee) also to no avail. So I suspect that somethin has change in Delphi register entries.

But what , I don't have any clues.

Best regards Antoine

Edited by: kin antoine on Mar 12, 2016 10:54 AM

I have been running Delphi 7 on Windows 10 for about 5 months without any problems. The bad thing started on the 9th of march. I am going to uninstall all Windows updates from this date. Let you know.
Ross McMillan

Posts: 14
Registered: 7/1/97
Re: Delphi 2007 IDE hangs the PC on loading the executable image for running  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 12, 2016 1:27 PM   in response to: kin antoine in response to: kin antoine
Hi Antoine,

I have seen that behaviour also - where I can force close the IDE, but the my application's EXE is somehow held open and I can't compile again because of that. I have found in this situation that I am able to delete the EXE however and then things proceed as normal.

When the compile/run hangs the IDE I almost always need to restart the PC although the other day I was able to recover by force closing BDS.EXE from the task manager

Do you have the feeling that this only became a problem with an upgrade (upgrade?} from xp to Windows 8/10?.

kin antoine wrote:
Beurnie von Diek wrote:
Hello everyone,

I have the exact same problem. I'm using delphi 2007.
Windows 10 64 bit PC and Laptop, it happens on both of them.

Is there a way to fix this problem? It's pretty annoying when you have to restart everything.


I have the same problem. But the strange thing is that it it doesn't happen with all programs (compile and running from the IDE). With a number of existing programs it never happens.

To date the ituation is getting worse because if I simply open Delpi7 and run it (ctrl F9) with the standard form generated by D7 when it opens, the same thing hapens; compiles ok but hangs on running. I have to kill Delphi7 with the task manager. When after killing D7 i reload it and rerun compilation, I get a message saying that it cannot generate the output file. If I reload W10 and rerun D7 it's ok. This mean that the program is loaded in memory but doesn't show up in the task manager !

So far I have uninstalled then reinstalled D7, but to no avail. I have disconnected the anti-virus (macAfee) also to no avail. So I suspect that somethin has change in Delphi register entries.

But what , I don't have any clues.

Best regards Antoine

Edited by: kin antoine on Mar 12, 2016 10:54 AM

I have been running Delphi 7 on Windows 10 for about 5 months without any problems. The bad thing started on the 9th of march. I am going to uninstall all Windows updates from this date. Let you know.
kin antoine

Posts: 4
Registered: 5/28/00
Re: Delphi 2007 IDE hangs the PC on loading the executable image for running  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 13, 2016 4:42 AM   in response to: Ross McMillan in response to: Ross McMillan
Hi Ross,

I just uninstalled the last windows 10 updates. Nothing changed. Again, what puzzles me is that on the 9th of march I discovered that the compile/debug process of one program hangs, as discribed. But when I recompile/debug other existing programs they run fine and those are very complex ones, whereas the one causing problems is very simple. Furthermore, now, if I open Delphi7 IDE and press F9 to compile/debug 'Project1' it hangs. If I compare the environment of those programs I cannot see any meaningfull differences. The real bad thing is that I cannot anymore execute in debug mode.

The only unusual thing I remember when all this started to happen is that I was compiling/debugging a project stored on a local NAS and, this I did before without problems. Consequently, I seems to me that there is something that interacts between Delphi7 and the system preventing the program to run although it is loaded in memory. The task manager doesn't list it but it is in memory because when you abort Delphi and reload it and recompile your program, you get a message saying the the output file cannot be created, meaning it is in memory. To compile you have to reload Windows . Anti-virus ?

Best regards and many thanks for caring answering

Ross McMillan wrote:
Hi Antoine,

I have seen that behaviour also - where I can force close the IDE, but the my application's EXE is somehow held open and I can't compile again because of that. I have found in this situation that I am able to delete the EXE however and then things proceed as normal.

When the compile/run hangs the IDE I almost always need to restart the PC although the other day I was able to recover by force closing BDS.EXE from the task manager

Do you have the feeling that this only became a problem with an upgrade (upgrade?} from xp to Windows 8/10?.

kin antoine wrote:
Beurnie von Diek wrote:
Hello everyone,

I have the exact same problem. I'm using delphi 2007.
Windows 10 64 bit PC and Laptop, it happens on both of them.

Is there a way to fix this problem? It's pretty annoying when you have to restart everything.


I have the same problem. But the strange thing is that it it doesn't happen with all programs (compile and running from the IDE). With a number of existing programs it never happens.

To date the ituation is getting worse because if I simply open Delpi7 and run it (ctrl F9) with the standard form generated by D7 when it opens, the same thing hapens; compiles ok but hangs on running. I have to kill Delphi7 with the task manager. When after killing D7 i reload it and rerun compilation, I get a message saying that it cannot generate the output file. If I reload W10 and rerun D7 it's ok. This mean that the program is loaded in memory but doesn't show up in the task manager !

So far I have uninstalled then reinstalled D7, but to no avail. I have disconnected the anti-virus (macAfee) also to no avail. So I suspect that somethin has change in Delphi register entries.

But what , I don't have any clues.

Best regards Antoine

Edited by: kin antoine on Mar 12, 2016 10:54 AM

I have been running Delphi 7 on Windows 10 for about 5 months without any problems. The bad thing started on the 9th of march. I am going to uninstall all Windows updates from this date. Let you know.
kin antoine

Posts: 4
Registered: 5/28/00
Re: Delphi 2007 IDE hangs the PC on loading the executable image for running  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 16, 2016 10:47 AM   in response to: kin antoine in response to: kin antoine
Hi Ross,

I found a solution. Damn it !

Because it was so straightforward. I went to the Borland folder, up to Delphi.exe, then right clicked on it -> compatibility etc... and now everything is perfect.

What puzzles me is that my program had been running under Windows 10 for more than 6 months and I changed nothing in the system.

Best regards Antoine

kin antoine wrote:

Hi Ross,

I just uninstalled the last windows 10 updates. Nothing changed. Again, what puzzles me is that on the 9th of march I discovered that the compile/debug process of one program hangs, as discribed. But when I recompile/debug other existing programs they run fine and those are very complex ones, whereas the one causing problems is very simple. Furthermore, now, if I open Delphi7 IDE and press F9 to compile/debug 'Project1' it hangs. If I compare the environment of those programs I cannot see any meaningfull differences. The real bad thing is that I cannot anymore execute in debug mode.

The only unusual thing I remember when all this started to happen is that I was compiling/debugging a project stored on a local NAS and, this I did before without problems. Consequently, I seems to me that there is something that interacts between Delphi7 and the system preventing the program to run although it is loaded in memory. The task manager doesn't list it but it is in memory because when you abort Delphi and reload it and recompile your program, you get a message saying the the output file cannot be created, meaning it is in memory. To compile you have to reload Windows . Anti-virus ?

Best regards and many thanks for caring answering

Ross McMillan wrote:
Hi Antoine,

I have seen that behaviour also - where I can force close the IDE, but the my application's EXE is somehow held open and I can't compile again because of that. I have found in this situation that I am able to delete the EXE however and then things proceed as normal.

When the compile/run hangs the IDE I almost always need to restart the PC although the other day I was able to recover by force closing BDS.EXE from the task manager

Do you have the feeling that this only became a problem with an upgrade (upgrade?} from xp to Windows 8/10?.

kin antoine wrote:
Beurnie von Diek wrote:
Hello everyone,

I have the exact same problem. I'm using delphi 2007.
Windows 10 64 bit PC and Laptop, it happens on both of them.

Is there a way to fix this problem? It's pretty annoying when you have to restart everything.



I have the same problem. But the strange thing is that it it doesn't happen with all programs (compile and running from the IDE). With a number of existing programs it never happens.

To date the ituation is getting worse because if I simply open Delpi7 and run it (ctrl F9) with the standard form generated by D7 when it opens, the same thing hapens; compiles ok but hangs on running. I have to kill Delphi7 with the task manager. When after killing D7 i reload it and rerun compilation, I get a message saying that it cannot generate the output file. If I reload W10 and rerun D7 it's ok. This mean that the program is loaded in memory but doesn't show up in the task manager !

So far I have uninstalled then reinstalled D7, but to no avail. I have disconnected the anti-virus (macAfee) also to no avail. So I suspect that somethin has change in Delphi register entries.

But what , I don't have any clues.

Best regards Antoine

Edited by: kin antoine on Mar 12, 2016 10:54 AM

I have been running Delphi 7 on Windows 10 for about 5 months without any problems. The bad thing started on the 9th of march. I am going to uninstall all Windows updates from this date. Let you know.
Ross McMillan

Posts: 14
Registered: 7/1/97
Re: Delphi 2007 IDE hangs the PC on loading the executable image for running  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 16, 2016 10:16 PM   in response to: kin antoine in response to: kin antoine
Hey Antoine,

Brilliant Brilliant Brilliant Brilliant Brilliant Brilliant Brilliant Brilliant Brilliant Brilliant Brilliant Brilliant Brilliant Brilliant Brilliant !!

So far the fix has worked for me on my development machine at work. I'll try it on the laptop when I get home. I would have expected the problem to have occurred by now, but so far, I have had a happy afternoon compiling and running from the IDE with no issues. Keep me informed if anything changes at your end and I will do likewise.

I let the troubleshooter suggest which compatibility mode to use, and it chose "Vista".

Many, many thanks,
Ross

kin antoine wrote:
Hi Ross,

I found a solution. Damn it !

Because it was so straightforward. I went to the Borland folder, up to Delphi.exe, then right clicked on it -> compatibility etc... and now everything is perfect.

What puzzles me is that my program had been running under Windows 10 for more than 6 months and I changed nothing in the system.

Best regards Antoine

kin antoine wrote:

Hi Ross,

I just uninstalled the last windows 10 updates. Nothing changed. Again, what puzzles me is that on the 9th of march I discovered that the compile/debug process of one program hangs, as discribed. But when I recompile/debug other existing programs they run fine and those are very complex ones, whereas the one causing problems is very simple. Furthermore, now, if I open Delphi7 IDE and press F9 to compile/debug 'Project1' it hangs. If I compare the environment of those programs I cannot see any meaningfull differences. The real bad thing is that I cannot anymore execute in debug mode.

The only unusual thing I remember when all this started to happen is that I was compiling/debugging a project stored on a local NAS and, this I did before without problems. Consequently, I seems to me that there is something that interacts between Delphi7 and the system preventing the program to run although it is loaded in memory. The task manager doesn't list it but it is in memory because when you abort Delphi and reload it and recompile your program, you get a message saying the the output file cannot be created, meaning it is in memory. To compile you have to reload Windows . Anti-virus ?

Best regards and many thanks for caring answering

Ross McMillan wrote:
Hi Antoine,

I have seen that behaviour also - where I can force close the IDE, but the my application's EXE is somehow held open and I can't compile again because of that. I have found in this situation that I am able to delete the EXE however and then things proceed as normal.

When the compile/run hangs the IDE I almost always need to restart the PC although the other day I was able to recover by force closing BDS.EXE from the task manager

Do you have the feeling that this only became a problem with an upgrade (upgrade?} from xp to Windows 8/10?.

kin antoine wrote:
Beurnie von Diek wrote:
Hello everyone,

I have the exact same problem. I'm using delphi 2007.
Windows 10 64 bit PC and Laptop, it happens on both of them.

Is there a way to fix this problem? It's pretty annoying when you have to restart everything.



I have the same problem. But the strange thing is that it it doesn't happen with all programs (compile and running from the IDE). With a number of existing programs it never happens.

To date the ituation is getting worse because if I simply open Delpi7 and run it (ctrl F9) with the standard form generated by D7 when it opens, the same thing hapens; compiles ok but hangs on running. I have to kill Delphi7 with the task manager. When after killing D7 i reload it and rerun compilation, I get a message saying that it cannot generate the output file. If I reload W10 and rerun D7 it's ok. This mean that the program is loaded in memory but doesn't show up in the task manager !

So far I have uninstalled then reinstalled D7, but to no avail. I have disconnected the anti-virus (macAfee) also to no avail. So I suspect that somethin has change in Delphi register entries.

But what , I don't have any clues.

Best regards Antoine

Edited by: kin antoine on Mar 12, 2016 10:54 AM

I have been running Delphi 7 on Windows 10 for about 5 months without any problems. The bad thing started on the 9th of march. I am going to uninstall all Windows updates from this date. Let you know.
Ross McMillan

Posts: 14
Registered: 7/1/97
Re: Delphi 2007 IDE hangs the PC on loading the executable image for running  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2016 3:40 AM   in response to: kin antoine in response to: kin antoine
Sad news... I spoke too soon. Although I tweaked the compatibility mode setting and it made my system reliable again, it was only for a day or so. The next day I had it hang on a compile from the IDE in the usual manner.

But it was definitely more reliable. I had several dozen compiles before it crashed, when I was getting a crash after 1 or 2 compiles before.

Here's the strange thing. I had intended making the same change to the compatibility settings on my home machine - a Toshiba P50 laptop - as well, but I decided first just to confirm that compiles were unreliable with compatibility mode turned off.

I couldn't get the laptop to misbehave.!

I'm now starting to wonder if the unreliability was due to something in Windows 10 that they coincidentally fixed in an update.

I have no idea what is going on.

R

kin antoine wrote:
Hi Ross,

I found a solution. Damn it !

Because it was so straightforward. I went to the Borland folder, up to Delphi.exe, then right clicked on it -> compatibility etc... and now everything is perfect.

What puzzles me is that my program had been running under Windows 10 for more than 6 months and I changed nothing in the system.

Best regards Antoine

kin antoine wrote:

Hi Ross,

I just uninstalled the last windows 10 updates. Nothing changed. Again, what puzzles me is that on the 9th of march I discovered that the compile/debug process of one program hangs, as discribed. But when I recompile/debug other existing programs they run fine and those are very complex ones, whereas the one causing problems is very simple. Furthermore, now, if I open Delphi7 IDE and press F9 to compile/debug 'Project1' it hangs. If I compare the environment of those programs I cannot see any meaningfull differences. The real bad thing is that I cannot anymore execute in debug mode.

The only unusual thing I remember when all this started to happen is that I was compiling/debugging a project stored on a local NAS and, this I did before without problems. Consequently, I seems to me that there is something that interacts between Delphi7 and the system preventing the program to run although it is loaded in memory. The task manager doesn't list it but it is in memory because when you abort Delphi and reload it and recompile your program, you get a message saying the the output file cannot be created, meaning it is in memory. To compile you have to reload Windows . Anti-virus ?

Best regards and many thanks for caring answering
h>
Ross McMillan wrote:
Hi Antoine,

I have seen that behaviour also - where I can force close the IDE, but the my application's EXE is somehow held open and I can't compile again because of that. I have found in this situation that I am able to delete the EXE however and then things proceed as normal.

When the compile/run hangs the IDE I almost always need to restart the PC although the other day I was able to recover by force closing BDS.EXE from the task manager

Do you have the feeling that this only became a problem with an upgrade (upgrade?} from xp to Windows 8/10?.

kin antoine wrote:
Beurnie von Diek wrote:
Hello everyone,

I have the exact same problem. I'm using delphi 2007.
Windows 10 64 bit PC and Laptop, it happens on both of them.

Is there a way to fix this problem? It's pretty annoying when you have to restart everything.



I have the same problem. But the strange thing is that it it doesn't happen with all programs (compile and running from the IDE). With a number of existing programs it never happens.

To date the ituation is getting worse because if I simply open Delpi7 and run it (ctrl F9) with the standard form generated by D7 when it opens, the same thing hapens; compiles ok but hangs on running. I have to kill Delphi7 with the task manager. When after killing D7 i reload it and rerun compilation, I get a message saying that it cannot generate the output file. If I reload W10 and rerun D7 it's ok. This mean that the program is loaded in memory but doesn't show up in the task manager !

So far I have uninstalled then reinstalled D7, but to no avail. I have disconnected the anti-virus (macAfee) also to no avail. So I suspect that somethin has change in Delphi register entries.

But what , I don't have any clues.

Best regards Antoine

Edited by: kin antoine on Mar 12, 2016 10:54 AM

I have been running Delphi 7 on Windows 10 for about 5 months without any problems. The bad thing started on the 9th of march. I am going to uninstall all Windows updates from this date. Let you know.

Edited by: Ross McMillan on Mar 20, 2016 11:40 PM
kin antoine

Posts: 4
Registered: 5/28/00
Re: Delphi 2007 IDE hangs the PC on loading the executable image for running  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2016 8:10 AM   in response to: Ross McMillan in response to: Ross McMillan
Hi, Ross,

Bad news indeed. Browsing the net for this matter, I found an article on the French site 'Developpez.com'. This talks about XpMan and also about a 'manifest' file for windows that you compile with BRCC32.

Steps for Manifest:

Create file 'WindowsXP.manisfest'

?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
name="DelphiApplication"
processorArchitecture="x86"
version="5.1.0.0"
type="win32"/>
<description>Windows Shell</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

In the same folder create file 'WindowsXP.rc' containing this line: "WindowsXP.manifest"

Then you compile the ressource file with BRCC32.exe WindowsXp. It creates a .res file

In your program include :

implementation

{$R *.dfm}
{$R WindowsXP.Res} // <- Here

I haven't tested this at all and to tell the truth, I don't fully understand what they explain. But they feel very confident. I understand all this is to tell the OS to execute the program with XP compatibility.

Did you try compatibility mode XP ? Delphi 7 was native XP, isn't it ? If there is something knew, please let me know.

For your information, I am quite happy to use Delphi7 with Firebird (2.1.7) databases and IBexpress.

So far, for me the compatibily mode (windows 8) is still ok. If it ever goes wrong, I would reset it to WindowsXP.

Best regards. Antoine


Ross McMillan wrote:
This question was posted on stackoverflow, but was closed by a drive-by robot because it didn't attract an answer. I found [this post here|https://forums.embarcadero.com/thread.jspa?threadID=106362] which is a similar issue, and also have gone a bit further characterizing the problem.

I have a real show-stopper of a problem. When I compile a program from the Delphi IDE and run it, sometimes the PC hangs. Not just Delphi - everything. The only exit is the long press of the power button. I can't raise task manager. The clock in the tray keeps running, however.

In my investigations I have determined:

- it doesn't always happen - probably 1 time in 4.
- the problem is not confined to one application. I have had it occur on large applications and on test programs of a few dozen lines.
- the problem never occurs when compiling the same application with the command-line compiler.
- If I compile with the IDE, and then run the resulting executable directly (i.e. not from the IDE) the problem never occurs.
- if I compile with the IDE, run from the IDE, and the machine hangs, then after a reboot I can still run the executable that was left on disk by that last compile without any problems. I.e. the problem doesn't seem to be a bad exe.
- the problem leaves the PC with the curious half-rendered line of the event log as shown in the screen-shot (excuse the quality - no screen grab available when this happens!). The module last loaded is not always the same as shown here however - I have seen it freeze on MSCTF.dll, LIBEAY32.dll and NETAPI32.dll also.
- If I build, then start the run with F8, the cursor will end up on the begin in the DPR file. The freeze can occur before that point, or after. I'm assuming that none of my unit initialisation sections execute until I move off the first begin (please correct me if that's not the case, and I'll start adding some debug writes to the initialisation sections of my library units).
- the PC (Dell 8700 with 16G RAM) passes a rigorous memory check.
- I can now also confirm that it also happens with my other development PC (a Toshiba P50 laptop).
- The problem can also occur when I load the executable with the IDE (Run/Load Process). This is whether or not the checkbox Execute startup code on Load is checked or not.
- Disabling MadExcept has no effect.
- Excluding the project files from Antivirus real-time-protection scanning doesn't help.

Any ideas on where to look or the best way to determine the cause?

[Screenshot|https://dl.dropboxusercontent.com/u/311035/D2007Hang.jpg]
Ross McMillan

Posts: 14
Registered: 7/1/97
Re: Delphi 2007 IDE hangs the PC on loading the executable image for running  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2016 11:55 AM   in response to: kin antoine in response to: kin antoine
Hi Antoine,

If [this|http://www.developpez.net/forums/d402878/environnements-developpement/delphi/debutant/changer-l-interface-delphi-6-windows-xp/] is the article you are referring to, it seems to be concerned with making a program run with an XP theme. I can't find any reference to programs hanging on execute.

Also, a fix of this sort would affect the generated executable, but I believe I have determined that the problem is not one of bad code in the executable, but rather, a problem when the IDE tries to load and run the executable. The same executable runs fine from the command line.

I'm running Delphi 2007, not Delphi 7 btw. I'll try XP compatibilty mode.

Best regards,
Ross

UPDATE just had it hang with XP compatibility mode :-(

kin antoine wrote:
Hi, Ross,

Bad news indeed. Browsing the net for this matter, I found an article on the French site 'Developpez.com'. This talks about XpMan and also about a 'manifest' file for windows that you compile with BRCC32.

Steps for Manifest:

Create file 'WindowsXP.manisfest'

?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
name="DelphiApplication"
processorArchitecture="x86"
version="5.1.0.0"
type="win32"/>
<description>Windows Shell</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

In the same folder create file 'WindowsXP.rc' containing this line: "WindowsXP.manifest"

Then you compile the ressource file with BRCC32.exe WindowsXp. It creates a .res file

In your program include :

implementation

{$R *.dfm}
{$R WindowsXP.Res} // <- Here

I haven't tested this at all and to tell the truth, I don't fully understand what they explain. But they feel very confident. I understand all this is to tell the OS to execute the program with XP compatibility.

Did you try compatibility mode XP ? Delphi 7 was native XP, isn't it ? If there is something knew, please let me know.

For your information, I am quite happy to use Delphi7 with Firebird (2.1.7) databases and IBexpress.

So far, for me the compatibily mode (windows 8) is still ok. If it ever goes wrong, I would reset it to WindowsXP.

Best regards. Antoine


Ross McMillan wrote:
This question was posted on stackoverflow, but was closed by a drive-by robot because it didn't attract an answer. I found [this post here|https://forums.embarcadero.com/thread.jspa?threadID=106362] which is a similar issue, and also have gone a bit further characterizing the problem.

I have a real show-stopper of a problem. When I compile a program from the Delphi IDE and run it, sometimes the PC hangs. Not just Delphi - everything. The only exit is the long press of the power button. I can't raise task manager. The clock in the tray keeps running, however.

In my investigations I have determined:

- it doesn't always happen - probably 1 time in 4.
- the problem is not confined to one application. I have had it occur on large applications and on test programs of a few dozen lines.
- the problem never occurs when compiling the same application with the command-line compiler.
- If I compile with the IDE, and then run the resulting executable directly (i.e. not from the IDE) the problem never occurs.
- if I compile with the IDE, run from the IDE, and the machine hangs, then after a reboot I can still run the executable that was left on disk by that last compile without any problems. I.e. the problem doesn't seem to be a bad exe.
- the problem leaves the PC with the curious half-rendered line of the event log as shown in the screen-shot (excuse the quality - no screen grab available when this happens!). The module last loaded is not always the same as shown here however - I have seen it freeze on MSCTF.dll, LIBEAY32.dll and NETAPI32.dll also.
- If I build, then start the run with F8, the cursor will end up on the begin in the DPR file. The freeze can occur before that point, or after. I'm assuming that none of my unit initialisation sections execute until I move off the first begin (please correct me if that's not the case, and I'll start adding some debug writes to the initialisation sections of my library units).
- the PC (Dell 8700 with 16G RAM) passes a rigorous memory check.
- I can now also confirm that it also happens with my other development PC (a Toshiba P50 laptop).
- The problem can also occur when I load the executable with the IDE (Run/Load Process). This is whether or not the checkbox Execute startup code on Load is checked or not.
- Disabling MadExcept has no effect.
- Excluding the project files from Antivirus real-time-protection scanning doesn't help.

Any ideas on where to look or the best way to determine the cause?

[Screenshot|https://dl.dropboxusercontent.com/u/311035/D2007Hang.jpg]

Edited by: Ross McMillan on Mar 21, 2016 8:49 AM

Edited by: Ross McMillan on Mar 21, 2016 8:51 AM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02