I ran into a GCC bug years ago. (1999-2000). It would put "static" variables into the "text" section of ELF binaries.
i.e. into the read-only portion of the binary.
The result, of course, was that writing to the variables caused a core dump.
So yes, 99% of the time, stupid programmer errors are stupid programmer errors. But compilers do have bugs.
e.g.