Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
94 user(s) are online (80 user(s) are browsing Forums)

Members: 0
Guests: 94

more...

Support us!

Headlines

 
  Register To Post  

Anonymous
Stack usage tracking and stack size setting
I'm debugging an OS4 version of my program. It crashes at one place, but when I add a few kprintf()-s around, the crash place changes (moves to different function). I suspect stack overflow. How can I measure stack usage? How can I set the stack size for a program?

Go to top
Re: Stack usage tracking and stack size setting
Amigans Defender
Amigans Defender


See User information
@krashan
Added a $STACK:<num> cookie to your program to control the minimum amount of stack required. There are guard pages on the stack so if you blow it the Grim Reaper tells you. There is also the Ranger tool which can estimate how much stack your Process is using but it doesn't monitor the stack.

ExecSG Team Lead
Go to top
Re: Stack usage tracking and stack size setting
Just can't stay away
Just can't stay away


See User information
@ssolie

I would be nice if Ranger could display peak usage of a stack !?

Rock lobster bit me - so I'm here forever
X1000 + AmigaOS 4.1 FE
"Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray
Go to top
Re: Stack usage tracking and stack size setting
Just popping in
Just popping in


See User information
@TSK

It does, to a point......

It will show you the amount of stack EVER written that
contains a non-zero default value.

It would not include the full size of a local stack buffer of say 5000 bytes, that only had 1000 bytes written to it,
the numbers would come up as 4000 bytes short in this case.

In other words, it calculates it from the first written non-zero value from the end of the frame, and shows that as the point of "usage" of the stack allocation.

However, for a guide it is close enough to be quite usefull.

Go to top
Re: Stack usage tracking and stack size setting
Amigans Defender
Amigans Defender


See User information
@TSK
Quote:
I would be nice if Ranger could display peak usage of a stack !?

That is not possible with AmigaOS. The stack usage figure is really just a guess/hack. Perhaps some day when the kernel supports such features.

ExecSG Team Lead
Go to top
Re: Stack usage tracking and stack size setting
Just can't stay away
Just can't stay away


See User information
@ssolie

And auto enlarging stacks would be even much better.

Rock lobster bit me - so I'm here forever
X1000 + AmigaOS 4.1 FE
"Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray
Go to top
Re: Stack usage tracking and stack size setting
Amigans Defender
Amigans Defender


See User information
@TSK
Quote:
And auto enlarging stacks would be even much better.

But of course. Not really my dept. though. You'd have to torture Rogue to find out what the status of that feature is.

ExecSG Team Lead
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project