It sounds very weird, but I noticed that my program crashes because a variable is literally forgotten (turning to 0).
This is the output of gdb
... 709