From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= Subject: Re: [PATCH] xenstore: set READ_THREAD_STACKSIZE to a sane value Date: Wed, 12 Mar 2014 11:27:30 +0100 Message-ID: <53203692.9000607@citrix.com> References: <1394194978-20200-1-git-send-email-roger.pau@citrix.com> <21277.62094.517108.207924@mariner.uk.xensource.com> <1394544254.18366.68.camel@kazak.uk.xensource.com> <531F1505.6010108@citrix.com> <1394547146.30915.21.camel@kazak.uk.xensource.com> <531F31F7.4060504@citrix.com> <1394553824.30915.78.camel@kazak.uk.xensource.com> <531F3743.3010206@citrix.com> <1394554957.30915.83.camel@kazak.uk.xensource.com> <21279.14589.377018.521819@mariner.uk.xensource.com> <531F3CFE.7050609@citrix.com> <21279.16185.53308.538144@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <21279.16185.53308.538144@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 11/03/14 17:52, Ian Jackson wrote: > Roger Pau Monn=E9 writes ("Re: [PATCH] xenstore: set READ_THREAD_STACKSIZ= E 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.