-2

Possible Duplicate:
Debugging a program that crashes 10 times in different places

You are given a the source to a application which is crashing when run. After running it 10 times in a debugger, you find it never crashes in the same place. The application is single threaded, and uses only the C standard library. What programming errors could be causing this crash? How would you test each one?

Community
  • 1
  • 1
Flash
  • 2,901
  • 5
  • 38
  • 55
  • 1
    Wow, that's actually a copy-and-paste duplicate. Haven't seen that before. – Benubird Jan 06 '11 at 15:48
  • Well, I have this question. If @ravi would have commented on the original question, **Possibly no one would have followed up, since that question might be old and burried. What does one do in that situation ?** I faced it many times, then there is need to start new post with similar question. But yes, exact copy-paste is not the way. – Munish Goyal Jan 06 '11 at 19:04

1 Answers1

0

Pointer error. You're trying to read/write an undefined pointer - do a find and replace for free(x) -> free(x);x=NULL.

Edit: Should also check for assignment; are you doing anything like this?

int *a;
a++;
Benubird
  • 18,551
  • 27
  • 90
  • 141