堆栈溢出如何处理
报警如下:Sat Jun 25 13:14:11 2016: The stack 'IdataStack' is filled to 100% (192 bytes used out of 192). The warning threshold is set to 90.%
Sat Jun 25 13:14:11 2016: The stack 'XdataStack' is filled to 100% (768 bytes used out of 768). The warning threshold is set to 90.%
Sat Jun 25 13:14:11 2016: The stack pointer for stack 'XdataStack' (currently XData:0xFFFF) is outside the stack range (XData:0x0001 to XData:0x0301)
堆栈溢出的产生是由于过多的函数调用,导致调用堆栈无法容纳这些调用的返回地址,一般在递归中产生。堆栈溢出很可能由无限递归(Infinite recursion)产生,但也可能仅仅是过多的堆栈层级。
用的是哪个版本的IAR和哪个版本的SDK?建议使用最新版本
osal_memset((uint8 *)&leaveReq,0,sizeof(NLME_LeaveReq_t));
// osal_memcpy(leaveReq.extAddr,NLME_GetExtAddr(),Z_EXTADDR_LEN);
leaveReq.removeChildren = 1;
leaveReq.rejoin = 0;
leaveReq.silent = 0;
NLME_LeaveReq( &leaveReq );
终端自己退网程序,如果注销了osal_memcpy(leaveReq.extAddr,NLME_GetExtAddr(),Z_EXTADDR_LEN);就不会溢出。
目前的最新版本是多少?我用的2.50协议栈和8.1的IAR
最近遇到了这个问题 试了网上说的几种都没有解决 请问有没有解决办法