[Zope] Unexplained restart on add
Matthew T. Kromer
matt@zope.com
Fri, 12 Jul 2002 13:39:23 -0400
This is a multi-part message in MIME format.
--------------020403050108030804070804
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Jens Vagelpohl wrote:
> there is a known bug in python for (at least) FreeBSD that leads to
> sudden restarts. it has to do with the stack size for threads being
> too small. see this message::
>
> http://groups.yahoo.com/group/zope/message/91934
>
> jens
Apologies for the attachment, but this is a tiny patch you can apply to
Python 2.1.3 to double the stack size for threads up to 128K.
--
Matt Kromer
Zope Corporation http://www.zope.com/
--------------020403050108030804070804
Content-Type: text/plain;
name="pthread.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="pthread.patch"
--- ../Python-2.1.3/Python/thread_pthread.h Thu Jan 10 06:12:20 2002
+++ Python/thread_pthread.h Thu Jan 17 11:54:21 2002
@@ -128,6 +128,10 @@
{
pthread_t th;
int success;
+ pthread_attr_t pta;
+ pthread_attr_init(&pta);
+ pthread_attr_setstacksize(&pta, (1<<17));
+
#ifdef PTHREAD_SYSTEM_SCHED_SUPPORTED
pthread_attr_t attrs;
#endif
@@ -156,7 +160,7 @@
#ifdef PTHREAD_SYSTEM_SCHED_SUPPORTED
&attrs,
#else
- (pthread_attr_t*)NULL,
+ (pthread_attr_t*)&pta,
#endif
(void* (*)(void *))func,
(void *)arg
--------------020403050108030804070804--