Re: Stack Overflow Detection



On Fri, 30 May 2008 11:32:43 -0700 (PDT), Tomás Ó hÉilidhe
<toe@xxxxxxxxxxx> wrote:

On May 30, 4:37 pm, Vladimir Vassilevsky <antispam_bo...@xxxxxxxxxxx>
wrote:

The main problem with it is that you
never know for sure what is the maximum stack usage.


Are you sure about that? Would it not just be a case of determining
how much stack space each of the function's use, and then looking at
the logic of the program to see what could possibly be the deepest
level?

Vendor-supplied library functions could be an issue, and library
functions that call other library functions, etc. How many auto
variables do the deeper internal functions use? Are the call stack and
the "software" stack combined? Sometimes yes, sometimes not.

One hopes that the vendor recommends a minimum stack depth, but ...

--
Rich Webb Norfolk, VA
.



Relevant Pages

  • Re: stack
    ... The reason it is not always possible is that the processor has an 8 deep HW stack for return addresses which is *not* mapped in to any of the address spaces (it can only be accessed by call, return, push and pop type assembler instructions). ... So if a function calls only library functions you would have to either examine the generated code or determine what the compiler knows about the library functions which are called to determine whether the return address is on the HW stack or has been popped of the HW stack on to the SW stack. ... Oh, and this is ignoring the possibility someone else raised that the function might have been inlined, something that can cause problems with the non-portable extension provided by at least one implementation for this purpose :-) ...
    (comp.lang.c)
  • Re: How standard is the standard library?
    ... Looking through my stack of books and various on-line ... >references, I have seen several libraries and library functions listed ...
    (comp.lang.python)
  • Re: How implement pthread_measure_stack_usage on Linux
    ... that may be adequate to the API caller. ... If I recall how the eCos stack measuring code works, ... untouched pattern. ... Other OSes may be able to tell you what your maximum stack usage roughly ...
    (comp.programming.threads)
  • Re: How implement pthread_measure_stack_usage on Linux
    ... If I recall how the eCos stack measuring code works, ... untouched pattern. ... Other OSes may be able to tell you what your maximum stack usage roughly ...
    (comp.programming.threads)
  • Re: Stack Overflow Detection
    ... never know for sure what is the maximum stack usage. ... compilers/linkers do it and there are stand-alone tools like GnatStack, StackAnalyzer from AbsInt, and Bound-T from my company. ... Niklas Holsti ...
    (comp.arch.embedded)