Checking stack limit - Linux

This is a discussion on Checking stack limit - Linux ; I wonder if there is a way in linux to check the current stack size. On solaris you could call getcontext and look at ucp.uc_stack.ss_size. This doesn't seem to do anything on linux. Any suggestions? Paul...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Checking stack limit

  1. Checking stack limit

    I wonder if there is a way in linux to check the current stack size.
    On solaris you could call getcontext and look at ucp.uc_stack.ss_size.
    This doesn't seem to do anything on linux. Any suggestions?

    Paul


  2. Re: Checking stack limit

    Try ulimit or getrlimit.


  3. Re: Checking stack limit

    Well, I know how to get the stack limit. What I'm
    interested in the is current stack size. For instance,
    if the limit is 8MB, then I'd like to see how close to the
    limit the stack currently is. If I get a segv and the
    stack size is right at the limit, then I am probably safe
    in assuming that the segv is caused by a stack
    overflow (and can be fixed by increasing the stack
    limit).

    Paul


+ Reply to Thread