When cpu returns to current task, and starts second for loop, the pointer value becomes 0x0, as the picture shows, and it will cause a hardfauld error.
It is very hard to comment on what might be going wrong from just these three images. Are you suggesting there is a bug in the queue code? Or noting there is a bug in your code you would like help debugging?