Suspected Stack Overflow - how to detect/confirm?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Suspected Stack Overflow - how to detect/confirm?

跳至解决方案
1,200 次查看
mykepredko
Contributor IV

Hi Folks,

 

In the main process of my application, inside one function, I call another function which uses the tty(b) driver to send out an ASCIIZ string.  When this function is called, the app crashes (and causes a segmentation fault on my PC which is running CW when I'm debugging - which is strange). 

 

However, if the error condition which causes the upchuck during the tty write does not occur, execution continues normally - in fact, the tty ASCIIZ function is called later in the program to give a status and there are no issues. 

 

I suspect that I have a stack issue in the main process - is there any way to confirm that this is what's happening? 

 

Does anybody have any ideas why CW has the crash as well? 

 

Thanx,

 

myke

0 项奖励
1 解答
530 次查看
LordMark
Contributor IV

You may try to use the task aware debugging (TAD) in codewarrior. It shows you the stack memory and stack overflow situations.

在原帖中查看解决方案

0 项奖励
2 回复数
531 次查看
LordMark
Contributor IV

You may try to use the task aware debugging (TAD) in codewarrior. It shows you the stack memory and stack overflow situations.

0 项奖励
530 次查看
mykepredko
Contributor IV

Hi Mark,

 

Thank you - that sounds like a good suggestion.

 

I increased the task's stack by 256 bytes and the problem has gone away.

 

I'm still curious as to why I had the problem with CW and the PC it is running on - anybody have any ideas? 

 

myke

0 项奖励