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

Re: [Xen-devel] [PATCH] xenstore: set READ_THREAD_STACKSIZE to a sane value

On 12/03/14 11:30, Ian Campbell wrote:
> On Wed, 2014-03-12 at 11:27 +0100, Roger Pau Monnà wrote:
>> On 11/03/14 17:52, Ian Jackson wrote:
>>> Roger Pau Monnà writes ("Re: [PATCH] xenstore: set READ_THREAD_STACKSIZE to 
>>> a sane value"):
>>>> On 11/03/14 17:25, Ian Jackson wrote:
>>>>> Well, actually, a malloc works, doesn't it ?
>>>> No, actually a malloc with PTHREAD_STACK_MIN doesn't work, this sample 
>>>> example program fails in the same way:
>>> Wow.  I'm sure that can't be intentional.
>> According to
>> http://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html (or at
>> least that's how I read it), it shouldn't be assumed that
>> PTHREAD_STACK_MIN will be set to a value that allows using libc calls,
>> the standard even says it's valid to set it to 0.
> That's not a terribly helpful definition!
> I don't remember seeing that when I wrote that older version.
> http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_setstacksize.html
>  doesn't feel the need to talk about such things, which is rather unhelpful 
> of it...
>> So I think the proposed patch (or a variation of it), is the right
>> solution, we shouldn't rely on PTHREAD_STACK_MIN being set to a sane
>> value. IMHO the only thing we should use PTHREAD_STACK_MIN for is to
>> check that the value we are passing to pthread_attr_setstacksize is valid.
> Yeah, it does seem that way.

For reference, here is the original reply that I've received when asking
about PTHREAD_STACK_MIN on freebsd-current:


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.