[erlang-questions] The node (with release using ssl) does not shut down after calling init:stop/0 in Erlang 17.3
buddy
tauceti100@REDACTED
Wed Oct 1 15:13:17 CEST 2014
Hello,
It seems the patch is not related to the issue. But I have tried your
patch and it does not help.
Moreover, I have tried the ssl_hello_world example (as mentioned
below) in Erlang 17.0 and it works correctly.
$ ./_rel/ssl_hello_world_example/bin/ssl_hello_world_example console
Erlang/OTP 17 [erts-6.0] [source-07b8f44] [64-bit] [smp:4:4]
[async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Eshell V6.0 (abort with ^G)
(ssl_hello_world_example@REDACTED)1> application:which_applications().
[{ssl_hello_world,"Cowboy Hello World example with SSL.",
"1"},
{ssl,"Erlang/OTP SSL application","5.3.4"},
{cowboy,"Small, fast, modular HTTP server.","1.0.0"},
{cowlib,"Support library for manipulating Web protocols.",
"1.0.0"},
{public_key,"Public key infrastructure","0.22"},
{crypto,"CRYPTO","3.3"},
{ranch,"Socket acceptor pool for TCP protocols.","1.0.0"},
{asn1,"The Erlang ASN1 compiler version 3.0","3.0"},
{stdlib,"ERTS CXC 138 10","2.0"},
{kernel,"ERTS CXC 138 10","3.0"}]
(ssl_hello_world_example@REDACTED)2> init:stop().
ok
(ssl_hello_world_example@REDACTED)3> %
$
In 17.1 it failed on init:stop/0. The similar behaviour was in 17.3.
Thus, the problem has occurred somewhere after 17.0. What else can I
do to resolve this issue?
2014-09-30 18:35 GMT+04:00, Ingela Andin <ingela.andin@REDACTED>:
> Hi!
>
> If you apply the following patch to 17.3 it might help. The
> SNI-contribution that we included in this release had missed the detail,
> that the server may optionally send a
> SNI-extension that must be empty.
>
> diff --git a/lib/ssl/src/ssl_handshake.
> erl b/lib/ssl/src/ssl_handshake.erl
> index 22673e4..eee33ef 100644
> --- a/lib/ssl/src/ssl_handshake.erl
> +++ b/lib/ssl/src/ssl_handshake.erl
> @@ -1732,6 +1732,9 @@
> dec_hello_extensions(<<?UINT16(?EC_POINT_FORMATS_EXT), ?UINT16(Len),
> #ec_point_formats{ec_point_format_list =
> ECPointFormats}});
>
> +dec_hello_extensions(<<?UINT16(?SNI_EXT), ?UINT16(Len), Rest/binary>>,
> Acc) when Len == 0 ->
> + dec_hello_extensions(Rest, Acc#hello_extensions{sni = ""}); %% Server
> may send an empy SNI
> +
> dec_hello_extensions(<<?UINT16(?SNI_EXT), ?UINT16(Len),
> ExtData:Len/binary, Rest/binary>>, Acc) ->
> <<?UINT16(_), NameList/binary>> = ExtData,
>
>
> 2014-09-30 16:10 GMT+02:00 a a <tauceti100@REDACTED>:
>
>> Hello,
>>
>> I use Erlang 17.3 downloaded from
>> https://www.erlang-solutions.com/downloads/download-erlang-otp
>>
>> When I am trying to stop the ssl_hello_world example from cowboy I have
>> encountered a strange behaviour.
>>
>> $ git clone https://github.com/ninenines/cowboy
>> $ cd cowboy
>> $ git checkout 1.0.0
>> $ cd examples/ssl_hello_world
>> $ make
>> $ ./_rel/ssl_hello_world_example/bin/ssl_hello_world_example console
>>
>> Erlang/OTP 17 [erts-6.2] [source-5c974be] [64-bit] [smp:4:4]
>> [async-threads:10] [hipe] [kernel-poll:false]
>>
>> Eshell V6.2 (abort with ^G)
>> (ssl_hello_world_example@REDACTED)1> application:which_applications().
>> [{ssl_hello_world,"Cowboy Hello World example with SSL.",
>> "1"},
>> {ssl,"Erlang/OTP SSL application","5.3.6"},
>> {cowboy,"Small, fast, modular HTTP server.","1.0.0"},
>> {cowlib,"Support library for manipulating Web protocols.",
>> "1.0.0"},
>> {public_key,"Public key infrastructure","0.22.1"},
>> {crypto,"CRYPTO","3.4.1"},
>> {ranch,"Socket acceptor pool for TCP protocols.","1.0.0"},
>> {asn1,"The Erlang ASN1 compiler version 3.0.2","3.0.2"},
>> {stdlib,"ERTS CXC 138 10","2.2"},
>> {kernel,"ERTS CXC 138 10","3.0.3"}]
>> (ssl_hello_world_example@REDACTED)2> init:stop().
>> ok
>> (ssl_hello_world_example@REDACTED)3>
>> =ERROR REPORT==== 29-Sep-2014::16:49:15 ===
>> Error in process <0.69.0> on node 'ssl_hello_world_example@REDACTED'
>> with exit value:
>> {{case_clause,{error,closed}},[{ranch_acceptor,loop,3,[{file,"src/ranch_acceptor.erl"},{line,28}]}]}
>> ...
>> =ERROR REPORT==== 29-Sep-2014::16:49:15 ===
>> Error in process <0.164.0> on node 'ssl_hello_world_example@REDACTED'
>> with exit value:
>> {{case_clause,{error,closed}},[{ranch_acceptor,loop,3,[{file,"src/ranch_acceptor.erl"},{line,28}]}]}
>>
>> The listener socket has been closed.
>> It seems the node is still running, but:
>>
>> (ssl_hello_world_example@REDACTED)3> application:which_applications().
>> ** exception exit: {timeout,{gen_server,call,
>>
>> [application_controller,which_applications]}}
>> in function gen_server:call/2 (gen_server.erl, line 182)
>>
>> If I change this line
>> https://github.com/ninenines/ranch/blob/1.0.0/src/ranch_acceptor.erl#L40
>> to
>> {error, _Reason} -> ok
>> the acceptor processes do not crash after calling init:stop/0, and the
>> node shuts down correctly.
>>
>> This behavour appears only in Erlang 17.3 (I have tried it in Debian 7.6,
>> Ubuntu 12.04.5, OS X 10.9.5). In Erlang R16B03 everything seems to work
>> correctly.
>>
>> What else can I do to reveal the cause of this issue?
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>
More information about the erlang-questions
mailing list