Woodstock Blog

a tech blog for general algorithmic interview questions

[Testing] Random Error Debugging 1

Question

link

You are given the source to an application which is crashing during run time. After running it 10 times in a debugger, you find it never crashes in the same place.

What programming errors could be causing this crash? How would you test each one?

Analysis

  1. code depends on system time or RNG

  2. disk full, i.e. other processes may delete a different file causing more space to be available

  3. memory issue, i.e. other processes allocate and/or free memory

  4. a pointer points to a random location in memory that is changed by another process causing some values be “valid” (very rare though)

In general a situation with other process is likely.