Project

General

Profile

Actions

Bug #431

open

bip is leaking file descriptors

Added by Pierre-Louis Bonicoli almost 10 years ago. Updated 10 months ago.

Status:
New
Priority:
High
Assignee:
Target version:
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

Actions #1

Updated by Pierre-Louis Bonicoli almost 10 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

Actions #2

Updated by Loïc Gomez almost 3 years ago

  • Assignee set to Loïc Gomez
  • Priority changed from Normal to High
Actions #3

Updated by Loïc Gomez 11 months 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 #5

Updated by Loïc Gomez 11 months ago

  • Target version set to 21
Actions #6

Updated by Loïc Gomez 10 months ago

  • Target version changed from 21 to 0.10.0
Actions

Also available in: Atom PDF