This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] attr.c in _STACK_GROWS_UP case.


> No, because the VMA is growing.

Okay.

> But IMHO it makes sense to cap it by the end of the previous vma
> (resp. for S_G_U beginning of next vma).

Not possible, the stack is the last vma. It grows until all of memory is
exhausted. Your previous recommendation was the best solution for S_G_D.

> For S_G_D this means remembering to from previous VMA in last_to
> (initialized to 0 at the beginning) and:
> attr->__stacksize = rl.rlim_cur;
> attr->__stackaddr = (void *) to;
> if ((size_t) attr->__stacksize > (size_t) attr->__stackaddr - last_to)
>   attr->__stacksize = (size_t) attr->__stackaddr - last_to;

That looks good for the S_G_D case.

c.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]