[erlang-patches] Fix port leaking after controlling_process(Port, self())

Henrik Nord henrik@REDACTED
Mon Feb 13 12:01:36 CET 2012


Hello

Your patch is included in 'pu'

Thank you for the contribution!

On 02/04/2012 04:55 PM, Ricardo Catalinas Jiménez wrote:
> I spotted the same issue that Max Lapshin reported in:
>
> http://erlang.org/pipermail/erlang-questions/2011-April/057944.html
>
>
> Add case to handle the situation when someone call
> {gen_tcp,gen_udp}:controlling_process(Port, self()). Also improve spec
> and doc from gen_udp and gen_sctp for controlling_process/2.
>
> To reproduce the issue, open an UDP port:
>
> 4>  {ok,Port} = gen_udp:open(9000, [binary]).
> {ok,#Port<0.587>}
> 5>  gen_udp:controlling_process(Port, self()).
> ok
>
> Simulate error:
>
> 6>  1=2.
> ** exception error: no match of right hand side value 2
>
> Here is the leak:
>
> 7>  inet:i().
> Port Module   Recv Sent Owner    Local Address Foreign Address State
> Type
> 581  inet_udp 0    0<0.31.0>  *:cslistener  *:*             BOUND
> DGRAM
> ok
>
>
> Please fetch:
> git fetch git://github.com/jimenezrick/otp.git fix-gen_udp_tcp-leak
>
> Review here:
> https://github.com/jimenezrick/otp/compare/erlang:maint...jimenezrick:fix-gen_udp_tcp-leak
> https://github.com/jimenezrick/otp/compare/erlang:maint...jimenezrick:fix-gen_udp_tcp-leak.patch
>
>
> Regards

-- 
/Henrik Nord Erlang/OTP




More information about the erlang-patches mailing list