How thrust sorting works ?

Hi, I works on a stereovision app and I have a problem with the sorting in a global function.
Without sorting the program runs without error. But with sorting I have a problem of memory stack and I don’t understand why.
This is my line, with dif a float * and window an integer

thrust::sort(thrust::seq, dif, dif + window);

In my main function I call with 70 blocks and 50 threads but I don’t think number have a link.

Thanks