You are given the source to an application which crashes when it is run After running it ten 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?
The solution is from both CC150v4 and CC150v5. My previous post [Testing] Random error debugging 1 already covered this question.
Again, the answer is very similar:
- Depends on random variable
- depends on user input
- depends on system date/time
- Uninitialized variable
- can take on arbitrary value
- can execute in different path
- Memory Leak
- out of RAM
- heap overflow
- stack data corruption
- System Dependency
- depends on external module
- depends on some system attributed that’s being modified by another application (this is especially for hardware-facing applications)
In general, Web server is more prone to Memory Leak, and program that runs close to system level is more prone to system dependency errors.
Additionally, we may be able to use tools to check for specific situations. For example, to investigate issue #2, we can utilize runtime tools which check for uninitialized variables.