I was updating my set of Gentoo ebuilds for radsecproxy to 1.6.8, and
wanted to use one of my PowerPC G4 Mini Mac systems with radsecproxy,
but...
minismurf # /usr/sbin/radsecproxy -v
pthread_attr_setstacksize failed
This led me to radsecproxy.c:
3406 if (pthread_attr_setstacksize(&pthread_attr, PTHREAD_STACK_SIZE))
3407 debugx(1, DBG_ERR, "pthread_attr_setstacksize failed");
and found PTHREAD_STACK_SIZE defines in radsecproxy.h:
31 #define PTHREAD_STACK_SIZE 32768
With a bit of help, I found that my platform has
minismurf # find /usr/include -type f | xargs egrep PTHREAD_STACK_MIN
/usr/include/bits/local_lim.h:#define PTHREAD_STACK_MIN 131072
/usr/include/pthread.h: minimal size of the block must be PTHREAD_STACK_MIN. */
/usr/include/pthread.h: to be started. This size must never be less than
PTHREAD_STACK_MIN
minismurf #
So, instead of simply defining PTHREAD_STACK_SIZE to a given size, the wanted
value should probably be compared to PTHREAD_STACK_MIN first, and whichever
value is largest is what PTHREAD_STACK_SIZE should be defined as.
I attached a patch to radsecproxy.h that does this, "works for me [tm]" :)
minismurf # /usr/sbin/radsecproxy -v
radsecproxy revision 1.6.8
This binary was built with support for the following transports:
UDP
TCP
TLS
DTLS
The patch seems to work fine from 1.6.3 (where this issue was introduced) up to 1.6.8,
it also applies to 1.7-dev in git repo, but I stumbled on other issues there, so I have
not tried building from git yet.
--
Kolbjørn Barmen
UNINETT, System og mellomvare