Re: Thread stack allocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/9/2012 6:24 PM, John David Anglin wrote:
> On 9-Sep-12, at 4:23 PM, John David Anglin wrote:
> 
>> It seems to me this must be a kernel bug:
> 
> Nope, it's a problem with guard page allocation in openjdk.
> It assumes stack grows down.

Yes, that's wrong :-)

If you allocate your own stacks then glibc can't setup guard
pages for you since it violates some POSIX constraints.

For avoidance of doubt you *can* get a thread with PTHREAD_STACK_MIN
as the stack size if:

(a) RLIMIT_STACK is a useful value e.g. != infinity

... but ....

(b) RLIMIT_STACK < PTHREAD_STACK_MIN

.... then ....

We allocate PTHREAD_STACK_MIN by default which might not be enough
space for what you need.

I'm actually working heavily on a BZ for glibc that would split up
the accounting of stack space and other incidentals to avoid grouping
them. For example if you had a lot of TLS variables they could actually
consume your stack and that's wrong.

http://sourceware.org/bugzilla/show_bug.cgi?id=11787

Cheers,
Carlos.

--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux