[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 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.

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.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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