Skip to main content
GameDev.net gamedev.net
🔒 Locked

Weirdest Errors

Started by Thrump Sep 14, 2000 at 2:14 PM 14 replies 750+ views
Original Post
Thrump
Thrump
Hey everybody, what''s the weirdest error you have ever gotten (and probably not solved)? Mine is, I was programming a game using Allegro for DJGPP, and if my lines of code went over a certain limit, the palette would screw up. At first, the lines I added were being executed, but in later testing, I uncommented and commented lines that were NEVER executed, for I would return from main early. It was probably some memory corruption thing, but it drove me mad back then, and hopefully all traces of code have been destroyed.
clonemaker
clonemaker
quote:
Original post by Thrump

Hey everybody, what''s the weirdest error you have ever gotten (and probably not solved)?

Mine is, I was programming a game using Allegro for DJGPP, and if my lines of code went over a certain limit, the palette would screw up. At first, the lines I added were being executed, but in later testing, I uncommented and commented lines that were NEVER executed, for I would return from main early.

It was probably some memory corruption thing, but it drove me mad back then, and hopefully all traces of code have been destroyed.


i dont remember the wierdest bug i ever got. So many. wierd bugs usually happen when code doesn''t crash when it should have crashed. or it works correctly by accident. even sometimes code i write as debug code ends up having bugs.

cmaker

- its not the principle. its the money.
cmaker- I do not make clones.
Knarkles
Knarkles
I hunted one strange memory overwrite bug for several weeks. My program crashed inside malloc. I concluded it was a bug in the compiler (Watcom C/C++ 10.6), as me and several other coders couldn''t find a solution.

-Jussi
null_pointer
null_pointer
The strangest error I ever got was while programming my thread class. This is basically what it said:

"Visual C++ Run-time error! The value of ecx was not saved properly across a function call!"

It would only happen occasionally, and it seemed more or less random. Later, I found out that it had something to do with my WndProc function, and that DX would lock up the whole machine in exclusive mode.

Know what causes this error? Forget to use the CALLBACK when defining the WndProc function, and also cast it to the correct type (like the API docs advise) when assigning it to the WNDCLASS structure. DX windowed mode can handle my WndProc then, but exclusive mode could not.

Odd, no?



- null_pointer
Sabre Multimedia
baskuenen
baskuenen
Well, there's one error I can't seem to get rid of. Every time I run Windows this message appears :




But I found a solution! Never press that button left down in the corner :






Edited by - baskuenen on September 14, 2000 6:15:02 PM
Blackstream
Blackstream
Hmmm, good question. The best answer I''ve got for you was when I was using the introductory version of C++ Builder. Sometimes the compiler would mess up and be unable to create a map file. The only way to fix the error was to restart my computer. As for actual programming bugs, instead of compiler bugs, lets see.... Hmmm, almost all my bugs are completely maddening bugs, until a see I put in a colen instead of a semi-colen.

Oh, I remember a weird bug. I was programming for DirectX, trying to put pictures in. The pictures sorta looked like the pictures I made, but the colors were messed up. It turns out that a ddutil function I used, DDLoadPalette, or something like that, didn''t load palettes from files. Because it didn''t, the default palette stayed, making my image look... weird. That is all I can think of off the top of my head.

-Blackstream

"See you later, I'm going to go grab a few Bytes. I'm so thirsty, I could drink a whole data stream."
-Blackstream Will you, won't you, will you, won't you, won't you take my virus?-The Mad HackerBlackstream's Webpage
Metron
Metron
Hi,

one weird thing that happened to me was this :

I had this little if statement :

if ( pObject )
{
[bla bla... uninteresting stuff]
}

pObject was set to NULL. Now, the application always entered the curly bracets. Even when debugging I saw that pObject was NULL. But it would go into the bracets.

I finally debugged it in assembler code and found out that the compiler would generate wrong assembler code for this single statement (and only at this place since it was ok in other locations). That was back when I was using VC++ 5.x...

I changed the code to
if ( pObject != NULL )
and everything went fine.

A service pack solved the problem later on...

Metron
----------------------------------------http://www.sidema.be----------------------------------------
Quantum
Quantum
hmm... weird errors....

i remember one
once, after testing my program in release mode, and changing back to debug mode, i got a really really weird error

"Visual C++: Debug Assertion error: str!=NULL"

i must have spent days trying to find what the hell that meant.
i didn''t have any "str"''s in my code, and coudn''t find anything at all that would cause that
and the stranger thing was, it worked fine in release mode!!
anyway, the problem ended up being that i had one of my bitmap files in the release folder, and not in the debug folder!
kwall
kwall
This isn''t a programming error, but a few weeks ago at a lan party a friend of mine got a cool error, it said.
There is an error, you must reinstall windows.
No bull, this really happened.

He rebooted and everything was fine.
Muzzafarath
Muzzafarath
Don''t know if it classifies as an error... But anyway, I was using VC++, and I forgot an ) character and several ; characters in an if statement. Like this:

if(functioncall()
{
do_this()
}

But it would still compile and work correctly... Weird...
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Quantum
Quantum
kwall: that happened to me once too, i didn''t even reboot, just freed up some memory ( i think i had about 1% free resources ) and everything worked fine
Yanroy
Yanroy
I had one real bad bug when I was writing my string library (yes, a whole library). The Substring() function worked just fine, but the Parse() function, which called Substring, didn't work right. It always returned garbage from the after the Substring call. This was when I was using CodeWarrior, so I didn't have a debugger worth its weight in photons. I put in TONS of debug code... the ratio of debug code to function code was about 3:1. I finally tracked the problem down to an if statement that had the call to Substring in it (this is where I found out substring wasn't working). It looked like this:

        
if (strcpy(Substring(WordStart, WordEnd), pText) != NULL)
// blah blah blah

[/source]

It should have looked like this:

[source]
if (strcmp(Substring(WordStart, WordEnd), pText) != NULL)
// blah blah blah



And it worked because Substring() returns a pointer to a global array... I hope you can see the difference. Took me days to find it. Very stupid mistake.

PS - Please PLEASE explain to me why the [ source ] tags don't work right!

--------------------


You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming

Yanroy@usa.com

Visit the ROAD Programming Website for more programming help.

Edited by - Yanroy on September 15, 2000 11:14:01 AM

--------------------

You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming
You are unique. Just like everybody else.
"Mechanical engineers design weapons; civil engineers design targets."
"Sensitivity is adjustable, so you can set it to detect elephants and other small creatures." -- Product Description for a vibration sensor
Gorky
Gorky
Muzzafarath
It worked because the semi-colon tells the compiler to compile all code up to that point. In theory, you could leave out almost all semi-colons, and still end up with the same code.

This is a bad thing to do. My guess, is that all errors reported for all lines of code that had problems, will come after the line with the semi-colon. Kind of hard to tell which line it was.


My weirdest error was like Metron''s. I was using Borland, a long time of go in college. Just learning C for the first time.
I had a variable that was equall to three. I was testing to see if the variable was less than two.
if (it < 2)
{
//code here
}
It always fell in.
Just for the hell of it, I changed the code to this:
if (3 < 2)
{
//code here
}

It still fell in. If I changed the 3 to a 2 or any higher number the code avoided the block of code!
It drove me nuts. A definite compiler problem, but for a long time I thought it was me, cause I was new to programming then.

Promiscuous Robot
Promiscuous Robot
Hmm.. weirdest bug/error.

I''d have to say it was a couple years back when I was in programming class. Final project of mine was a 2D pool game. As it became closer and closer to being finished, and the code grew larger and larger things just started breaking.

You could change a line, recompile and test, the program would crash. Maybe add a line after that, and everything seemed fine. Probably a memory error of some sort. Me and all my friends got quite a kick out of it..

Eventually when the game worked it was in a ''stable'' state. (Well, not very stable, the code is pretty bad, but it worked for the most part).


I guess this is where most people put a famous quote...
"Everything is funnier with monkey''s" - Unknown
--------------------------I guess this is where most people put a famous quote..."Everything is funnier with monkey''s" - Unknown
FReY
FReY
Actually, this problem happened a couple of days ago...

    
void main()
{
int result;
/*
.
.
.
*/
if (result!=255)
{
cout << "Result is: "<<result;
/*
.
.
.
*/

}
}


and guess what it always printed?
"Result is 255"

Needless to say, I was very confused: still am!

Greetings,
FReY
do unto others... and then run like hell.
Promiscuous Robot
Promiscuous Robot
Actually, I thought of a weirder one. I was writing code that was supposed to interface with VB through a .dll. Don''t try this at home it causes many problems.. well, it did for me at least.

When trying to pass strings back and forth with no luck I start debugging and find that the statements:

int x;

x = 100;
if (x == 100)
// stuff

The stuff never executed. Assigning 100 to x does nothing. Neither did any other assignments using global or local variables. Thats when I knew that mixing C and VB was a task left to somebody other than me .



I guess this is where most people put a famous quote...
"Everything is funnier with monkey''s" - Unknown
--------------------------I guess this is where most people put a famous quote..."Everything is funnier with monkey''s" - Unknown

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.