If you’re an experienced developer, you may have encountered a strange phenomenon: a program can run perfectly fine under a debugger, yet still crash when executed standalone, i.e. outside a debugger session. The mere act of observing the program under a debugger yields to different results than running the program as-is.
This post is a little follow-up of the Hello World in FreeBSD Assembly tutorial.
At the end of the previous episode, I’ve suggested that you write an assembly program that writes “hello, world!\n” into a file. This is exactly what we’ll do here.