A: 

The first thing to try is to remove both add-on packages (GExperts and Delphi Speedup). It could be something they are doing.

The second is to do your best to reproduce and submit the issue.

The third is to upgrade to a new version of Delphi and hope that it solves your problems without creating new ones.

gbrandt
+3  A: 

The last time I have seen this, is when one of my source files had inconsistent line endings.

Make sure all your lines in all your source files end with CRLF.

--jeroen

Jeroen Pluimers
+1 for being a specific hint!
Andreas Rejbrand
ok i will check this, I had such problems in the past (when pasting code from other programs..) that cause breakpoints misplaced. I do not have the breakpoints problem now, but I think it worth rechecking this.
DamienD
Does anybody has a tip for quickly searching bad lines ending within delphi (an expert, or a trick with Search (ctrl+F) menu ?).I ask this because my project has more than 800 files to check... and I really want to make sure my problem is not related to this..
DamienD
@DamienD: It would not be hard to write a Delphi program that searches all files in a directory for 1) CRLF, and 2) LF not preceeded by CR.
Andreas Rejbrand
@Andres: and CR not followed by LF...
Jeroen Pluimers
@DamienD, do yourself a favour and by a decent regex tool. Powergrep and the accompanied RegExBuddy are (IMO) unmatched for a very fair price.
Lieven
@Lieven : I will check this. But I started writing a delphi progam as suggested. At the moment it works but is sloooow (reading files byte by byte..) and didn't found any CRLF problems. I consider turning it into a delphi expert (and learn about building experts at this occasion)
DamienD
A: 

If this happens on two separate computers, but the same project on both, then the problem is most likely in the project itself and not the IDE. Of course, you didn't post any of the code that causes the error message to appear, so it's hard to help you find out what the problem is with the code. I find it very unlikely that the problem is the IDE, though, or others would have reported the same problem (D2007 has been out and in use by millions of developers for years now).

If the problem is in the IDE itself, you should be able to reproduce it with a new, empty project. Copy and paste only enough of the code from the old project into the new one to allow the problem line to compile, and then replicate the same change->press Enter to add a new line - does the same assertion failure and then abnormal termination happen?

If you can't reproduce the problem in a new project, the problem is most likely with your code, and without seeing it it's hard to tell what might be causing it.

Ken White
+1  A: 

When I used 2007 and saw this, it only happened on very long units (10,000+ lines - having that many is an issue for another discussion :p) Usually the IDE would be fine, then typing would become fairly slow - I could see the letters I typed lagging behind in the code editor. Unless I paused and let the editor catch up, I'd get that error.

So, my fix was:

  • If you're in a large unit and the editor starts lagging, pause, immediately. Let it catch up, and keep going.

This is really annoying, but worked for me.

I also turned off many of the Code Insight features, but I don't know if they affected this particular issue or not. They did help general editing speed. Turning them off was recommended to me in the then-Codegear forums. I can't remember who by, but I have a vague feeling it may even have been one of the Codegear QA staff who was aware of the bug but was trying to see if I could narrow down what affected or caused it. This was a couple of years ago now though, so don't take that as gospel.

Splitting your files into smaller, say <5000 line units may also help. For me it only happened on large and complex files.

The issue seems to have been fixed in RAD Studio 2010. Another way to avoid the error would be to upgrade :) If you do, wait a few days or talk to their salespeople first. The next version, RAD Studio XE, is due out at any moment. I'd recommend upgrading anyway: you'll need to handle Unicode issues, but other than that the 2010 edition is the best version I've used, including its stability, and I've used Delphi since version 1.

David M
thank you for feedback, the unit where I experimented the issue is 28350 lines... (the biggest unit of this project, in fact.) I also think now that the problem can be "error insight" related, because I remember I had some false errors reported for this unit (unit not found, etc.) the last time I experimented the bug. Then restarting after the IDE crash, and after a pause (go make a coffee..), simply hitting space in the unit makes all "error insight" problems disappear... and then, impossible to reproduce the bug.
DamienD