[erlang-bugs] [erlang-questions] Process/FD leak in SSL R15B01

Loïc Hoguin essen@REDACTED
Mon Oct 22 18:07:29 CEST 2012


The processes that work have this in the logs:

(Reason, StateName, Stacktrace)
2012-10-22 18:01:09.394 [error] <0.550.3862> normal connection []

(erlang:port_info)
2012-10-22 18:01:09.395 [error] <0.550.3862> 
[{name,"tcp_inet"},{links,[<0.550.3862>]},{id,56382467},{connected,<0.550.3862>},{input,0},{output,6709}]

(log from right after it worked)
2012-10-22 18:01:11.143 [error] <0.550.3862> ok



The ones that didn't come from the 2nd terminate clause and have this:

2012-10-22 18:01:02.484 [error] <0.11277.3891> normal connection 
[{ssl_certificate,'-find_issuer/2-fun-0-',3,[{file,"ssl_certificate.erl"},{line,234}]},{lists,foldl,3,[{file,"lists.erl"},{line,1197}]},{ets,do_foldl,4,[{file,"ets.erl"},{line,198}]},{ets,foldl,3,[{file,"ets.erl"},{line,187}]},{ssl_certificate,find_issuer,2,[{file,"ssl_certificate.erl"},{line,242}]},{ssl_certificate,certificate_chain,5,[{file,"ssl_certificate.erl"},{line,196}]},{ssl_handshake,certificate,4,[{file,"ssl_handshake.erl"},{line,248}]},{ssl_connection,certify_server,1,[{file,"ssl_connection.erl"},{line,1412}]}]

2012-10-22 18:01:02.485 [error] <0.11277.3891> 
[{name,"tcp_inet"},{links,[<0.11277.3891>]},{id,57414295},{connected,<0.11277.3891>},{input,0},{output,3885}]



Or this:

2012-10-22 18:01:04.554 [error] <0.3464.3901> normal connection []

2012-10-22 18:01:04.609 [error] <0.3464.3901> 
[{name,"tcp_inet"},{links,[<0.3464.3901>]},{id,57763881},{connected,<0.3464.3901>},{input,0},{output,1794}]



I also observe all processes on the third terminate clause to return the 
same values in the workaround function: {error, einval} from 
inet:setopts and {error, closed} from Transport:shutdown. Didn't check 
the recv return value but this clause always work anyway.



Thoughts? What next?

On 10/22/2012 05:11 PM, Loïc Hoguin wrote:
> Waaaaiiiiit.
>
> On 10/16/2012 06:39 PM, Ingela Anderton Andin wrote:
>> Loïc Hoguin wrote:
>>> 103> erlang:port_info(Port).
>>> [{name,"tcp_inet"},
>>>  {links,[<0.18199.1670>]},
>>>  {id,51824890},
>>>  {connected,<0.18199.1670>},
>>>  {input,0},
>
> I don't understand this here. Isn't this the total number of bytes read
> on the port?
>
> Does that mean it didn't read anything? Perhaps the port never sent
> anything?
>
>>>  {output,3583}]
>>> 104> Pid.
>>> <0.18199.1670>
>


-- 
Loïc Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu



More information about the erlang-bugs mailing list