Why "A stack overflow in task iot_thread has been detected" is coming continuously?

I’m working on an aws/amazon-freertos project. In there I found some unusual error “A stack overflow in task iot_thread has been detected”.

Many time I got this error and somehow I managed to remove it by changing the code.

I just want to know what this error means actually?

As per what I know, it simply means that the iot_thread ask stack size is not sufficient. So it’s getting overflow.

Is this the only reason why this error comes or can there be another reason for this?

If yes then where should I increase the stack size of the iot_thread task?

Full Log:

***ERROR*** A stack overflow in task iot_thread has been detected.
abort() was called at PC 0x4008cf94 on core 0
0x4008cf94: vApplicationStackOverflowHook at /home/horsemann/Desktop/WorkSpace/TestingRepo/vendors/espressif/esp-idf/components/esp32/panic.c:122

ELF file SHA256: 5252c38b96a3325472de5cf0f1bbc2cae90ffda1a169e71823c5aebbaa4fce2d

Backtrace: 0x4008cdac:0x3ffd74c0 0x4008cf7d:0x3ffd74e0 0x4008cf94:0x3ffd7500 0x40093e35:0x3ffd7520 0x400953d4:0x3ffd7540 0x4009538a:0x3ffd7560 0x401390e5:0x3ffc81bc
0x4008cdac: invoke_abort at /home/horsemann/Desktop/WorkSpace/TestingRepo/vendors/espressif/esp-idf/components/esp32/panic.c:136

0x4008cf7d: abort at /home/horsemann/Desktop/WorkSpace/TestingRepo/vendors/espressif/esp-idf/components/esp32/panic.c:171

0x4008cf94: vApplicationStackOverflowHook at /home/horsemann/Desktop/WorkSpace/TestingRepo/vendors/espressif/esp-idf/components/esp32/panic.c:122

0x40093e35: vTaskSwitchContext at /home/horsemann/Desktop/WorkSpace/TestingRepo/freertos_kernel/tasks.c:5068

0x400953d4: _frxt_dispatch at /home/horsemann/Desktop/WorkSpace/TestingRepo/freertos_kernel/portable/ThirdParty/GCC/Xtensa_ESP32/portasm.S:406

0x4009538a: _frxt_int_exit at /home/horsemann/Desktop/WorkSpace/TestingRepo/freertos_kernel/portable/ThirdParty/GCC/Xtensa_ESP32/portasm.S:206

See this page for information on stack overflow detection: FreeRTOS - stacks and stack overflow checking

A task’s stack size is passed as a parameter to the function used to create the task. See the the xTaskCreate() and xTaskCreateStatic() functions.