Using an unsafe language is a design flaw
trevorjim.com
trevorjim.com
I don’t think it is “inevitable” that a C program is going to have memory problems, potentially one can be very simple and use only the stack for memory allocation. It ought to be possible to make proofs that certain C programs are safe. Certain though it gets harder to get it right when your program gets more complex.
Similarly it takes special techniques to detect memory corruption after it happens such as stack canaries but usually these are built into your compiler, OS or runtime, and your program is just crashed when memory is corrupted.