fetchmail-friends
[Top] [All Lists]

[fetchmail]File descriptor leak in 5.9.0 on connect timeout

2001-10-22 16:26:41
 Hello everybody,
  We are not sure whether this is reported or not. If its already known then
 our apologies.
 
 We are running fetchmail 5.9.0 on a HP machine in daemon mode.

 We got the following TRACE for a particular mailbox:
 
 TEMAIL_fetchmail: 5.9.0 querying wsa02nt.webservasia.com.ph (protocol POP3)
 at Fri, 28 Sep 2001 16:11:05 -0700 (PDT)
 TEMAIL_fetchmail: timeout after 60 seconds waiting to connect to server
 wsa02nt.webservasia.com.ph.
 TEMAIL_fetchmail: client/server synchronization error while fetching from
 wsa02nt.webservasia.com.ph
 TEMAIL_fetchmail: Query status=7 (ERROR)
 
 Explanation of what will happend after some time.
 the process still show the file descriptor (socket) connected to the remote
 host
 after an important number of loop, the system runs out of FD and no other
 mail box can be read.
 
 
 We found that there is an file descriptor leak after each iteration.
 
 Here is the sequence of events which we believe results in descriptor leak
 a) do_protocol calls do_session.
 b) do_session sets a timer and then call setjmp().
 c) SockOpen is called to open a connection to the desired mailbox.
 d) SockOpen allocates a socket and calls connect().
 e) While the call is in the connect, timer goes on.
 f) The timer handler function timeout_handler() is called. (This is before
 fm_close is called. SO socket is not closed)
 g) The timeout_handler() calls longjmp() which clears the current context
 and thus the socket remains open.
 
 If we are wrong please correct us.
 
 Thanks and Regards
 Rohit
 
 
 
 
 



<Prev in Thread] Current Thread [Next in Thread>
  • [fetchmail]File descriptor leak in 5.9.0 on connect timeout, Rohit Kumar <=