Poking at NetBSD kernel source it looks like the default ulimit -s depends on the architecture and ranges from 512k to 16M. Postgres insists on max_stack_depth being STACK_DEPTH_SLOP -- ie 512kB -- less than the ulimit setting making it impossible to start up on architectures with a default of 512kB without raising the ulimit.
If we could just lower it to 384kB then Postgres would start up but I wonder if we should just use MIN(stack_rlimit/2, STACK _DEPTH_SLOP) so that there's always a setting of max_stack_depth that would allow Postgres to start. ./arch/sun2/include/vmparam.h:73:#define DFLSSIZ (512*1024) /* initial stack size limit */ ./arch/arm/include/arm32/vmparam.h:66:#define DFLSSIZ (2*1024*1024) /* initial stack size limit */ ./arch/sun3/include/vmparam3.h:109:#define DFLSSIZ (512*1024) /* initial stack size limit */ ./arch/sun3/include/vmparam3x.h:58:#define DFLSSIZ (2*1024*1024) /* initial stack size limit */ ./arch/luna68k/include/vmparam.h:70:#define DFLSSIZ (512*1024) /* initial stack size limit */ ./arch/hppa/include/vmparam.h:62:#define DFLSSIZ (2*1024*1024) /* initial stack size limit */ ./arch/hp300/include/vmparam.h:82:#define DFLSSIZ (2*1024*1024) /* initial stack size limit */ ./arch/alpha/include/vmparam.h:79:#define DFLSSIZ (1<<21) /* initial stack size (2M) */ ./arch/acorn26/include/vmparam.h:55:#define DFLSSIZ (512*1024) /* initial stack size limit */ ./arch/amd64/include/vmparam.h:83:#define DFLSSIZ (4*1024*1024) /* initial stack size limit */ ./arch/amd64/include/vmparam.h:101:#define DFLSSIZ32 (2*1024*1024) /* initial stack size limit */ ./arch/ia64/include/vmparam.h:57:#define DFLSSIZ (1<<21) /* initial stack size (2M) */ ./arch/mvme68k/include/vmparam.h:82:#define DFLSSIZ (512*1024) /* initial stack size limit */ ./arch/i386/include/vmparam.h:74:#define DFLSSIZ (2*1024*1024) /* initial stack size limit */ ./arch/amiga/include/vmparam.h:82:#define DFLSSIZ (2*1024*1024) /* initial stack size limit */ ./arch/sparc/include/vmparam.h:94:#define DFLSSIZ (8*1024*1024) /* initial stack size limit */ ./arch/mips/include/vmparam.h:95:#define DFLSSIZ (4*1024*1024) /* initial stack size limit */ ./arch/mips/include/vmparam.h:114:#define DFLSSIZ (16*1024*1024) /* initial stack size limit */ ./arch/mips/include/vmparam.h:134:#define DFLSSIZ32 DFLTSIZ /* initial stack size limit */ ./arch/sh3/include/vmparam.h:69:#define DFLSSIZ (2 * 1024 * 1024) ./arch/mac68k/include/vmparam.h:115:#define DFLSSIZ (2*1024*1024) /* initial stack size limit */ ./arch/next68k/include/vmparam.h:89:#define DFLSSIZ (512*1024) /* initial stack size limit */ ./arch/news68k/include/vmparam.h:82:#define DFLSSIZ (512*1024) /* initial stack size limit */ ./arch/x68k/include/vmparam.h:74:#define DFLSSIZ (512*1024) /* initial stack size limit */ ./arch/cesfic/include/vmparam.h:82:#define DFLSSIZ (512*1024) /* initial stack size limit */ ./arch/usermode/include/vmparam.h:69:#define DFLSSIZ (2 * 1024 * 1024) ./arch/usermode/include/vmparam.h:78:#define DFLSSIZ (4 * 1024 * 1024) ./arch/powerpc/include/oea/vmparam.h:74:#define DFLSSIZ (2*1024*1024) /* default stack size */ ./arch/powerpc/include/ibm4xx/vmparam.h:60:#define DFLSSIZ (2*1024*1024) /* default stack size */ ./arch/powerpc/include/booke/vmparam.h:75:#define DFLSSIZ (2*1024*1024) /* default stack size */ ./arch/vax/include/vmparam.h:74:#define DFLSSIZ (512*1024) /* initial stack size limit */ ./arch/sparc64/include/vmparam.h:100:#define DFLSSIZ (2*1024*1024) /* initial stack size limit */ ./arch/sparc64/include/vmparam.h:125:#define DFLSSIZ (2*1024*1024) /* initial stack size limit */ ./arch/sparc64/include/vmparam.h:145:#define DFLSSIZ32 (2*1024*1024) /* initial stack size limit */ ./arch/atari/include/vmparam.h:81:#define DFLSSIZ (2*1024*1024) /* initial stack size limit */ -- greg -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers