Question: I've always followed the logic: if assert fails, then there is a bug. Root cause could either be:

* Assert itself is invalid (bug)
* There is a programming error (bug)
* (no other options)

I.E. Are there any other conclusions one could come to? Are there cases where an assert would fail and there is no bug?

Answer: 
Yes, there is a bug in the code. 

*[Code Complete](https://rads.stackoverflow.com/amzn/click/com/0735619670)*

> 
> Assertions check for conditions that
>  should never occur. [...] 
> 
> 
> If an
>  assertion is fired for an anomalous
>  condition, the corrective action is
>  not merely to handle an error
>  gracefully- the corrective action is
>  to change the program's source code,
>  recompile, and release a new version
>  of the software. 
> 
> 
> A good way to
>  think of assertions is as executable
>  documentation - you can't rely on them
>  to make the code work, but they can
>  document assumptions more actively
>  than program-language comments can.
> 
> 
>
I can think of one case that wouldn't really class as a bug:

An assert placed to check for something external that normally should be there. You're hunting something nutty that occurs on one machine and you want to know if a certain factor is responsible.

A real world example (although from before the era of asserts): If a certain directory was hidden on a certain machine the program would barf. I never found any piece of code that should have cared if the directory was hidden. I had only very limited access to the offending machine (it had a bunch of accounting stuff on it) so I couldn't hunt it properly on the machine and I couldn't reproduce it elsewhere. Something that was done with that machine (the culprit was never identified) occasionally turned that directory hidden.

I finally resorted to putting a test in the startup to see if the directory was hidden and stopping with an error if it was.