Suspected Stack Overflow - how to detect/confirm?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Suspected Stack Overflow - how to detect/confirm?

Jump to solution
1,191 Views
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 Kudos
1 Solution
521 Views
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.

View solution in original post

0 Kudos
2 Replies
522 Views
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 Kudos
521 Views
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 Kudos