From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <Ian.Campbell@citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH] xenstore: set READ_THREAD_STACKSIZE to a sane value
Date: Tue, 11 Mar 2014 17:42:38 +0100 [thread overview]
Message-ID: <531F3CFE.7050609@citrix.com> (raw)
In-Reply-To: <21279.14589.377018.521819@mariner.uk.xensource.com>
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é 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 <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#define MALLOC_SIZE 1024
void *
foo(void *arg)
{
void *bar;
bar = malloc(MALLOC_SIZE);
assert(bar != NULL);
return (NULL);
}
int main(void)
{
pthread_t thread;
pthread_attr_t attr;
int rc, i;
rc = pthread_attr_init(&attr);
assert(rc == 0);
rc = pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN);
assert(rc == 0);
rc = pthread_create(&thread, &attr, foo, NULL);
assert(0 == rc);
rc = pthread_join(thread, NULL);
assert(0 == rc);
exit(EXIT_SUCCESS);
}
next prev parent reply other threads:[~2014-03-11 16:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-07 12:22 [PATCH] xenstore: set READ_THREAD_STACKSIZE to a sane value Roger Pau Monne
2014-03-10 17:12 ` Ian Jackson
2014-03-11 13:24 ` Ian Campbell
2014-03-11 13:52 ` Roger Pau Monné
2014-03-11 14:12 ` Ian Campbell
2014-03-11 15:55 ` Roger Pau Monné
2014-03-11 16:03 ` Ian Campbell
2014-03-11 16:10 ` Ian Campbell
2014-03-11 16:18 ` Roger Pau Monné
2014-03-11 16:22 ` Ian Campbell
2014-03-11 16:25 ` Ian Jackson
2014-03-11 16:32 ` Ian Campbell
2014-03-11 16:42 ` Roger Pau Monné [this message]
2014-03-11 16:52 ` Ian Jackson
2014-03-12 10:27 ` Roger Pau Monné
2014-03-12 10:30 ` Ian Campbell
2014-03-12 10:34 ` Roger Pau Monné
2014-03-18 17:16 ` Ian Campbell
2014-03-18 17:20 ` Ian Jackson
2014-03-21 12:18 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=531F3CFE.7050609@citrix.com \
--to=roger.pau@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).