Why would a program crash like this?

Jan 30, 2011 at 7:26pm
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?
Jan 30, 2011 at 7:47pm
You'll need to be more specific about what's happening.

What do you mean by "access the function"? What function?

Can you elaborate more on the crash? Do you get any kind of popup box with an error message?
Jan 30, 2011 at 10:07pm
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.
Jan 30, 2011 at 10:31pm
I get that sort of error every time I forget to break from an infinite while loop after all the other routines within it have been completed.

EDIT: My English is suffering...

Sorry, but... we really don't know anything about your issue, so we can't help much. :(

-Albatross
Last edited on Jan 30, 2011 at 11:44pm
Jan 30, 2011 at 11:26pm
Chuck in a bunch of logging printlines and see what comes out.
Jan 30, 2011 at 11:26pm
closed account (zb0S216C)
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.
Jan 31, 2011 at 1:38am
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
Last edited on Jan 31, 2011 at 1:41am
Jan 31, 2011 at 2:01am
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.
Jan 31, 2011 at 2:04am
Well then you should show us the code that's calling the function in question. We're not going to be able to find it without seeing any code. =P
Topic archived. No new replies allowed.