[quagga-dev 16681] Re: bgpd: fix file descriptor leaks in vty_close
balajig81 at gmail.com
Sat Dec 2 14:45:21 GMT 2017
Thanks Evgeny for the patch. Applied !
On Tue, Nov 28, 2017 at 4:24 AM, Paul Jakma <paul at jakma.org> wrote:
> On Fri, 24 Nov 2017, Evgeny Uskov wrote:
> Dear Quagga Developers,
>> We found a bug in bgpd which causes file descriptor leaks each time
>> when configuration is updated and then saved on disk. The reason is
>> that output file descriptor vty->wfd is not closed in vty_close
>> This bug is very easy to reproduce. You need to
>> 1) check a number of opened FDs (using lsof or /proc/<pid>/fd)
>> 2) perform any update to the configuration
>> 3) execute "write" command in "configure terminal"
>> 4) check a number of opened FDs again
>> You can find a sample script (check.sh) in attachment that automates
>> the steps above. An example of its output:
>> % sudo sh check.sh $(pgrep -f ./bgpd/.libs/bgpd) localhost 2605
>> <telnet password>
>> Open FDs: 10
>> altering config...
>> Open FDs: 11
>> altering config 10 times...
>> Open FDs: 21
>> A simple patch that fixes the problem above is also attached.
> +1 from me.
> Could the script be made a unit test?
> Paul Jakma | paul at jakma.org | @pjakma | Key ID: 0xD86BF79464A2FF6A
> You will be surprised by a loud noise.
> Quagga-dev mailing list
> Quagga-dev at lists.quagga.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Quagga-dev