how about this one?
int main() {
fork();
printf("choo");
} int main() {
fork();
printf("choo");
}int main() { printf("choo"); fork(); }
Here, "choo" can be printed twice, even though we fork after printing. This is a result from line buffering when the flush happens after the process is forked. Essentially, the output buffer is copied when forking and therefore duplicated.