Segfault in on 9.0-BETA2 (with stunnel FWIW)

Jeremie Le Hen jeremie at
Wed Sep 14 21:10:06 UTC 2011

On Wed, Sep 14, 2011 at 11:04:56PM +0300, Kostik Belousov wrote:
> tzload() allocates ~80KB for the local variables. The backtrace you provided
> shows the nested call to tzload(), so there is total 160KB of the stack
> space consumed.

Isn't it a little bit hungry?  To do this on stack?  Softwares with a
large amount of threads might want to reduce their stack size
dramatically, and so much space might not be available.

> By default, stack for the amd64 thread is 4MB, that should be plenty. This
> is not the case for ezm3. Possibly, stunnel also reduces the size of the
> thread stack.

Correct, I checked stunnel source, it reduces it to 64KB by default.
However it is possible to override it from the config file.  Raising
solves the problem indeed.

> Please, try the patch below. I did not tested it, only compiled. I see
> that now tzload allocates only ~300 bytes on the stack.

I've also tried it, leaving the default stack size chosen by stunnel.
It works.  Please go ahead and commit it if it's still possible.

Jeremie Le Hen

Men are born free and equal.  Later on, they're on their own.
				Jean Yanne

More information about the freebsd-current mailing list