Well, lets say: yes and no. All illegal memory accesses can lead to segmentation faults. So not only writes, but also reads and jumps.
You have to consider, that code is only one part of the product: you compile your code into an intermediate representation, which is then linked against other libraries. When starting, the binary is loaded by the interaction of an operating system and a dynamic loader and then (after a lot of steps!) executed.
All of these things have to work with each other, so if e.g. your compiler assumes something about the target architecture which is not true, this can result in different errors. The best thing which could happen is, that this is checked and you just get an error message. If it goes unchecked, this might result in illegal instructions, bus errors, ... or segmentation faults, depending on what the wrong assumption lead to.
In our case, I compiled the feeder under debian, assuming that raspbian would be compatible with the result. It actually did work for newer Raspberry Pies, but not for older ones or the Raspberry Pi Zero.
If you compile for debian armhf (which assumes newer processors), the generated binary will not load for older ones, i.e. you will not even get into your main function. Thus, if you say "code" and you mean "the feeder", your proposition is wrong -- if you mean the whole binary, yes, you could say it is somewhat "incorrect".
I don't know what you refer to when you say "the first time it works and the second it doesn't". It did NEVER work on older raspberries.
We fixed the problem by compiling the code for these older processors, so we can now run it on any (newer or older) Raspberry Pies.
Best Regards