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: Tue, 11 Mar 2014 17:42:38 +0100 Message-ID: <531F3CFE.7050609@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> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <21279.14589.377018.521819@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 , Ian Campbell Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 11/03/14 17:25, Ian Jackson wrote: > Ian Campbell writes ("Re: [PATCH] xenstore: set READ_THREAD_STACKSIZE to = a sane value"): >> On Tue, 2014-03-11 at 17:18 +0100, Roger Pau Monn=E9 wrote: >>> Another question to ask would be why FreeBSD sets PTHREAD_STACK_MIN to >>> 2048 when even a simple malloc call is going to blow that up, >> >> It does seem rather aggressive, but I suppose it is "min" not >> "sensible_min". > = > 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: --- #include #include #include #include #define MALLOC_SIZE 1024 void * foo(void *arg) { void *bar; bar =3D malloc(MALLOC_SIZE); assert(bar !=3D NULL); return (NULL); } int main(void) { pthread_t thread; pthread_attr_t attr; int rc, i; rc =3D pthread_attr_init(&attr); assert(rc =3D=3D 0); rc =3D pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN); assert(rc =3D=3D 0); rc =3D pthread_create(&thread, &attr, foo, NULL); assert(0 =3D=3D rc); rc =3D pthread_join(thread, NULL); assert(0 =3D=3D rc); exit(EXIT_SUCCESS); }