|
-
November 16th, 2008, 11:24 AM
#7
Re: programm only working in debug?!
 Originally Posted by Moghammed
However, i still don't get how it could run fine in debug mode, and fail outside debug.
Again, undefined behavior. This concept is something you must understand.
I'll repeat again --
when your program overwrites memory, does an illegal array access, does an illegal pointer access, etc. the behaviour of that program is undefined. You see it there yourself -- so there is no need now to be surprised.
Have you ever heard of programs working perfectly at the company, and then when you bring that program to a client, it bombs out? Or a program that works perfectly at the shop, and then when a customer buys it, they are having problems?
If the original program is written in C++, all of these scenarios can be due to bugs in the program that were "hidden" when run on one machine or environment or set of compiler settings, but is exposed when running on a different machine, environment, different compiler settings, etc.
I can't imagine this being coincidental, as i ran it about twenty times in debug and 20 times outside.
You could run it 1,000 times in the debugger, and have it work 999 times outside the debugger. It's that 1 time it doesn't work that proves that your program has a bug.
Regards,
Paul McKenzie
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|