Actions
Bug #431
openbip is leaking file descriptors
Start date:
2015-01-15
Due date:
% Done:
0%
Estimated time:
Patch Available:
Yes
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
      
      Updated by Pierre-Louis Bonicoli almost 11 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
      
      Updated by Loïc Gomez almost 4 years ago
      
      
    
    - Assignee set to Loïc Gomez
 - Priority changed from Normal to High
 
      
      Updated by Loïc Gomez almost 2 years ago
      
      
    
    - Patch Available set to Yes
 
At last I found the bug behind this, having noticed it myself with improperly disconnecting clients (network issues, etc)
Will send a patch in a new issue.
Actions