hmm, i think i'm having this problem now.
If I overwrite the stack (in the manner you meant), does this mean, the stack is overwritten and then read?

I've hacked some of the code above, in a c program (inline assembly), without any checks for errors. It works with bugs. I have to execute the program a number of times, and then the file is read, otherwise nothing is outputted. May this be the reason, i'm overwriting the stack?