I've got a program that worked fine one day, then the next day it crashed when trying to access a function. I made a new function that was exactly the same and it worked. I then switched the names so pretty much the program is back to normal working. But why would my program crash when trying to access the function?
By access the function I mean calling the function (just a random function in my game). Also when it crashes I get no error message, the program just completely freezes. I'm not all too worried about it, I was just wondering if anyone had heard of a bug like that.
There are a couple of errors that made my applications crash: An access violation( Accessing a cell that is not yours ), Setting a string type to NULL when it's not a pointer, Array overflow( going out-of-range ) or accessing a memory address that is no longer valid. There is probably more sources out there, you just need to be more specific.
Chuck in a bunch of logging printlines and see what comes out.
... or use a debugger =P
logging printlines are like a poor man's debugger
@AdventWolf:
Sounds like an infinite loop. Post the function in question.
EDIT: Also, "freeze" and "crash" are two different things. For future reference, when you say "crash" it means the program closes, usually with an error message. If the program just stops and doesn't accept user input, better words to describe it are "freeze" or "deadlock". Using these terms makes it easier for us to diagnose. Just FYI
I would describe it as a freeze. I know it wasn't a loop problem though, also it didn't matter what was in the function, I could delete all of the code and replace it with a cout statement and it still wouldn't work. I just made a new function and switched the code over and it worked perfectly. I used the debugger in Visual Studio C++ and no error messages popped up, only an arrow pointing to the opening brace of the function I was calling.