Project

General

Profile

Bug #431

bip is leaking file descriptors

Added by Pierre-Louis Bonicoli over 4 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
2015-01-15
Due date:
% Done:

0%

Patch Available:
Found in Versions:
Confirmed:
Yes
Branch:
Security:
No
Help Needed:

Description

fran wrote:

bip is leaking file descriptors on my server, and the fix is pretty easy: on connection.c, on read_socket, whenever read returns <1 and errno is different to EAGAIN and EINTR, the socket MUST be closed
because read will not return 0 on the following iterations of select (cause it's not added to the read fd_set after that), plus after read failing with fatal error it keeps returning -1

History

#1 Updated by Pierre-Louis Bonicoli over 4 years ago

  • Confirmed changed from No to Yes
  • Security set to No

Test script wrote by Fran:

!/bin/sh
#\
exec tclsh "$0" "$@" 

set BIPPASSWORD xxx
set NSPASSWORD xxx

set fd [socket localhost 7778]
fconfigure $fd -buffering line -buffersize 1000000
puts $fd "PASS fran:$BIPPASSWORD:freenode" 
puts $fd "NICK fran" 
puts $fd "USER fran 0 fran :Francisco Castro" 
while {[gets $fd line] >= 0} {
  puts $line
  set parts [split $line]
  if {[lindex $parts 1] eq "NICK"} {
    if {[lindex $parts 2] ne "fran"} {
      puts $fd "NICK fran" 
      after 500
      puts $fd "PRIVMSG NickServ :IDENTIFY $NSPASSWORD" 
      after 500
    }
    exit
  }
}
close $fd

Also available in: Atom PDF