Re: Segfault in libthr.so on 9.0-BETA2 (with stunnel FWIW)

From: Jeremie Le Hen <jeremie_at_le-hen.org>
Date: Wed, 14 Sep 2011 23:09:54 +0200
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.

Thanks.
Regards,
-- 
Jeremie Le Hen

Men are born free and equal.  Later on, they're on their own.
				Jean Yanne
Received on Wed Sep 14 2011 - 19:10:06 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:17 UTC