Shouldn't it crash every time then? It only crashs randomly. And the arguments I pass to the function are not local, they are variables from a global struct.