System Reset while using FreeRtos

hi I am using freertos with AVR Mega128. But there seems to some problem, as my system resets after some time. Recently I called a funtion from task (with local functions from task as local variable), the system reseted it after some time. When I made those variable global, the code worked fine. Now I have added some further code ,the problem is recurring again. Reason is different this time, I dont know :( Please tell me the various conditions in which freertos performs system reset.

System Reset while using FreeRtos

Most likely you are running out of stack.  Making the variables global will mean that the function uses less stack.  Try increasing the stack size allocated to the offending task.

System Reset while using FreeRtos

If you are using Watchdog timer then system reset after defined interval for WDT.