Disabling the reuse timeout (-T 0) results in crashes
ellie timoney
ellie at fastmail.com
Thu Feb 18 19:08:24 EST 2016
Hi Jens,
Thanks for the patch. This has also been reported as T227 by Ian
Batten: https://git.cyrus.foundation/T227
I'll get this fixed in git soon.
ellie
On Thu, Feb 18, 2016, at 11:13 PM, Jens Erat via Cyrus-devel wrote:
> Dear Cyrus developers,
>
> `man imapd` explains `-T 0` should disable the reuse timeout:
>
> > −T timeout
> >
> > The number of seconds that the process will wait for a new connection before shutting down. Note that a value of 0 (zero) will disable the timeout. The default is 60.
>
> But doing so results in crashes immediately after the first connection
> with an arithmetic exception. Digging deeper, the issue is rather
> obvious:
>
> reuse_timeout = reuse_timeout + (rand() % reuse_timeout);
>
> This should not be executed for `reuse_timeout == 0`. I attached a small
> patch resolving the issue. `reuse_timeout = 0` results in disabled
> alarms, probably this border case was overlooked when the random timeout
> skew was added.
>
> The patch is developed against Cyrus IMAP 2.5.7.
>
> Regards from Lake Constance, Germany,
> Jens Erat
>
> --
> Jens Erat
> Universität Konstanz
> Kommunikations-, Infomations-, Medienzentrum (KIM)
> Abteilung Basisdienste
> D-78457 Konstanz
> Mail: jens.erat at uni-konstanz.de
> Email had 2 attachments:
> + cyrus-imapd-2.5.7-master-timeout.patch
> 1k (text/x-patch)
> + signature.asc
> 1k (application/pgp-signature)
More information about the Cyrus-devel
mailing list