Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jan 2004 09:25:59 +0800
From:      David Xu <davidxu@freebsd.org>
To:        freebsd-threads@freebsd.org
Subject:   MINSIGSTKSZ and PTHREAD_STACK_MIN 
Message-ID:  <40088F27.90609@freebsd.org>

next in thread | raw e-mail | index | archive | help
There is a conflict between MINSIGSTKSZ and PTHREAD_STACK_MIN,
PTHREAD_STACK_MIN defined in pthread.h has a fixed value 1024,
MINSIGSTKSZ is variable on per-architecture, on i386,  it is defined in
sys/i386/include/signal.h:
#define      MINSIGSTKSZ     (512 * 4)
so on i386, makecontext is failed when user specifies PTHREAD_STACK_MIN
for new thread,  result is we get following message in libkse:

Fatal error 'Thread has returned from _thread_switch' at line 1099 in file
 /usr/home/davidxu/src/lib/libpthread/thread/thr_kern.c (errno = 0)

This becauses context is not fully initialized in pthread_create.

Either makecontext shouldn't check stacksize or we should synchoronize
MINSIGSTKSZ and PTHREAD_STACK_MIN.

David Xu




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40088F27.90609>