Re: [exim] O_NONBLOCK / ``421 lost input connection'' in exi…

Top Page
Delete this message
Reply to this message
Author: Chris Lightfoot
Date:  
To: exim-users
Subject: Re: [exim] O_NONBLOCK / ``421 lost input connection'' in exim 4.60
On Wed, Mar 22, 2006 at 12:29:22PM +0000, Philip Hazel wrote:
> On Wed, 22 Mar 2006, Chris Lightfoot wrote:
>
> > I believe it's because exim links against libc_r (because
> > it is linked against libcrypto, which itself is linked
> > against libc_r).
>
> This does not seem to be a problem on FreeBSD 4.10, which is where I ran
> my tests, which do include Exim operating as a server, both with and
> without TLS (linked with -lcrypto).
>
> > In this version of FreeBSD (5.2.1-RELEASE) the threads library is a
> > userspace one, and I think it must be setting O_NONBLOCK on stdin for
> > some reason of its own.
>
> OK, it sounds like a FreeBSD 5 thing, but how is it related to stdin? Or
> are you running Exim from inetd?


No, running exim as a daemon. As I say, I haven't figured
out exactly where the problematic call to fcntl occurs,
but certainly it does occur for both exim -bh and incoming
SMTP connections, so it affects both stdin (in the -bh
case) and the SMTP stream in the normal case. (I think it
might be because libc_r overrides fcntl and forces
O_NONBLOCK on -- see lib/libc_r/uthread/uthread_fcntl.c --
but I'm not certain.)

I'm not really in a position to investigate further at the
moment, but the next person to see this problem should
have something to start from, anyway....

> > My patch isn't harmless, sadly -- it results in a file
> > descriptor leak which I also haven't been able to
> > localise. However, rebuilding the port with
> > WITHOUT_TLS=yes fixes the problem, which is enough for me.
>
> My reaction to that is to do nothing until I hear more, either from you
> or somebody else... I hope this is reasonable.


sure.

--
Chris Lightfoot
mySociety