Sources of non-determinism

It could be:

  • Thread timing
  • Any kind of input (user, file, network, etc)

In several ways:

  • using multiple threads in a way that involves a data race,
  • using the current system time as input,
  • using uninitialized variables,
  • ...

We can surely make more guesses, but if you want to get meaningful help, maybe it would be good for you to publish the relevant parts of your code :-)


If your output depends on an address allocated on the heap:

int main(int argc, char* argv[])
{
   printf("%p", malloc(42));
   return 0;
}

For each run, the malloc() may return a different virtual address - not to mention NULL in case the allocation failed.