Could it be that the queue you try to access is a NULL pointer? What is the exact call stack at corruption time?