|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Apr 04, 2006 9:25 pm
Why am I cursed? |
Today I'm having a nervous breakdown...
I've been working on CMUD for weeks now without much trouble. Suddenly, today Delphi decides to crash in the middle of typing, losing about 2 hours of edits. Well, shit happens, right?
I restart Delphi and discover that if I place my cursor in a certain position of one of my source files and hit any key on the keyboard, Delphi will instantly hang, forcing me to terminate the process.
This is the SAME FILE I was working on yesterday with no problems.
OK, so naturally I reboot. No effect. So maybe the file got a corrupted control character in it somewhere? I scan the file in a hex editor and don't see anything. So I retype the entire file from scratch. Then Delphi hangs again.
I went over to my laptop which I haven't touched in two days. I open the same file, put my cursor in the magic location, hit a key, and poof, my laptop hangs too!
What the hell is going on here!?!?! This kind of stuff doesn't just happen like this. These are two completely separate computers, with different Windows installations. I was working on this file without any trouble just yesterday. How can this happen?
After FOUR HOURS OF WASTED TIME I disabled the CodeRush editor enhancement for Delphi and that fixed it. After another hour of messing around, it seems to be the Declaration View panel in CodeRush that causes the problem. Somehow it's doing some background parsing that is getting hung.
But this never happened before! I've been using the Declaration view in CodeRush for over 5 years without any trouble like this. And it worked fine yesterday. And yet it does the same exact thing on my laptop.
I reinstalled CodeRush and it didn't help. I'm just going to have to dump it for now. But I'm so mad at this I can hardly see straight. A whole day of coding has gotten totally blown by this. And I don't see any reason for this to have happened.
I swear I'm cursed. And today I just want to throw all of my computers off a cliff. I'm so sick of all of this. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Tue Apr 04, 2006 10:36 pm |
**Hug**
Bugs can be so evil. I seem to recall at some point I wrote my own loop iterator so it could time out and fail a loop untimately killing the entire process a little more gracefully. However I only ever used that for debugging tests. There are often things where loops can cause major problems from bad data, but there is nearly no way to anticipate those things. It might be worth the effort to examine what the interaction is at that point and try to understand specifically how the CodeRush stuff was failing. Sometimes it points to a potentially nasty bug in your code. I had to turn many of the background things off in my dev system because of stupid stuff like repeatedly popping up a mouse over hint for whatever my mouse is on, when I am typing someplace else and my mouse isn't moving. All too often little obvious things like this are overlooked and cause problems. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Apr 04, 2006 11:23 pm |
It makes no sense. Here is what I reduced the code to that still produced the error:
Code: |
function Add: Pointer;
begin
if (true) then Result := nil
else if (false) then Result := nil;
end; |
It hangs Delphi if I place the cursor before the "if" on the else-if line. If I place the cursor anywhere else, it works fine. Somehow changing the "if" to something else hangs the CodeRush background parser.
CodeRush has been around for years. Nobody else has reported anything like this. If this was my product and someone reported something obscure like this that I probably couldn't reproduce, I'd have no idea how to help them. I feel completely lost.
This is trivial code. It's a simple if-then-else-if statement. But if I put that single routine into it's own file and load it into Delphi with the CodeRush Declaration panel open, I get the hang, on both my desktop and laptop.
But I know that this hasn't happened in the past. You can see that this kind of code would come up all the time. And I've never had it hang like this before.
Maybe I just never got the cursor into the exact right position in the past. That's all I can think of. If it was just my desktop, then I could imagine all sorts of potential EXE or DLL corruptions, or a registry change, or something else. But that wouldn't effect the laptop.
That's why this has been SOOO frustrating. It defies everything that I know about software. It just can't break like this suddenly on two separate computers. |
|
|
|
Rainchild Wizard
Joined: 10 Oct 2000 Posts: 1551 Location: Australia
|
Posted: Wed Apr 05, 2006 12:18 am |
I don't pretend to know what coderush actually does, but if it analyzes your code maybe it's getting werded out beause 'if (true) then Result := nil else if (false) then Result := nil;' could be written as 'Result := nil;' since you're doing the same thing for both true and false clauses and it's going 'wtf' or something?
Anyway, /comfort. I'm kinda baffled that dev environments don't have an auto-save feature the same as MS word so that every 10 mins you get a backup somewhere, I hate it when you do a couple of hours, then 'poof'. Surely that's a fairly reasonable feature to expect? |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Apr 05, 2006 2:01 am |
No, that's just how I simplified the code to try and figure it out. The original code was the standard stuff like
if (Index < 0) then Result := nil
else if ...
I added the (true) and (false) just to see how simple the code could be and still crash. It doesn't crash if I remove the "else if..." statement.
CodeRush is an editor enhancement that does a *lot* of stuff for Delphi. Fortunately it's pretty modular, so you can turn stuff on and off. But each time I try a new setting and it crashes, it takes several minutes to restart Delphi. So the debugging process is very slow and painful.
The Declaration View is one of the most important and useful CodeRush features. It displays the declaration source code for the object that the cursor is over in a panel. So when I'm typing code, I can instantly see the declaration syntax for what I'm typing. Makes coding a lot easier and fewer mistakes. I've used it for so many years that it's tough to live without.
I just found another Delphi plugin that does an Auto-Save every few minutes. I'm going to at least start running this. Then if Delphi crashes like this at least I won't lose a couple of hours of edits. I always seem to have these kind of problems when I'm doing a lot of editing. Delphi normally saves the editor files each time you compile and run, but when I'm just editing I don't do these compiles and therefore don't get my files saved as often. |
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: Thu Apr 06, 2006 8:01 am |
Beginning of March seems to be about the time FastMM was installed. Maybe CodeRush and FastMM don't play well together? Or perhaps some other recent Delphi add-in is causing CodeRush to freak out. Just a thought.
|
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Thu Apr 06, 2006 11:58 am |
I was wondering about that too mr_kent.
|
|
_________________ Taz :) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Apr 06, 2006 4:53 pm |
Hmm, that's something I'll check. Originally I found FastMM because of CodeRush. There was a post in the CodeRush newsgroup that said one of the crash-on-exit bugs in CoreRush went away with FastMM. That's how I learned about FastMM. And yes, in addition to getting compiled into programs like CMUD, there is a replacement for the Delphi IDE memory manager too. I'll put the old one back and see if that makes any difference and let you know what happens.
I've turned off all of the other Delphi addons, so I don't think any of them are causing the problem. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Apr 06, 2006 5:27 pm |
That did it!!
Wow, you guys are great! I should have thought of this, but never did. Obviously CodeRush has some memory issues. I don't think it's a FastMM problem, but since FastMM is designed to pick out memory errors, my guess is that the CodeRush parser has some errors that they ignore and FastMM tries to force an exception that causes a hang in some other thread or something.
I can definitely live without FastMM in the Delphi IDE more than I can live without CodeRush. So thank you again! |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu May 04, 2006 8:55 pm |
Man, today I was "in the zone". I was having a good productive day. Then, our power goes out. And unfortunately, I hadn't taken the time lately to install the new docking library and DevExpress update on my laptop, so I can't even open the latest source code in Delphi and work on my laptop. Grr...
I think I've figured out what's causing all of my troubles. I blame it all on the Stargate under Cheyenne Mountain (about a half mile from our house). It would explain the unreliable power system we seem to have around here. I've never lived anywhere where the power fails as much as here. It fails about once every couple of months.
It would also explain the time distortion that seems to occur around release time. When I work for what seems to be only a week, and entire month seems to pass in the "real world". This could be explained by the Stargate connecting to one of those black holes again. Finally, the radiation given out by these accidents with the Stargate could explain why so many of my computers seem to suddenly die for no reason.
I think that explains everything. It's probably also another indication that I'm losing my mind. |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Thu May 04, 2006 11:41 pm |
*ROFL* I know the episode you're talking about :)
Don't forget the episode about the guy who makes the tv show about the stargate. So there you go fiction often based on fact |
|
_________________ Taz :) |
|
|
|
|
|