Shayan Pooya | 17 Apr 19:56 2014

Erlang 17 dialyzer issue with queue:queue(T).

We currently use the nowarn_deprecated_type option to compile Disco with Erlang 17.  I wanted to update the code to avoid using this option but I get an error message from dialyzer after updating one of the types from dict() to dict:dict(non_neg_integer) or dict:dict().
(error message at the end of this message, the change the results in this error is https://github.com/pooya/disco/commit/f857bde).

Which basically says worker_throttle:state() does not match itself.


disco_worker.erl:76: Invalid type specification for function disco_worker:init/1. The success typing is ({atom(),{#task_spec{jobname::'undefined' | [any(),...],stage::'undefined' | binary(),taskid::'undefined' | non_neg_integer(),tasknum::'undefined' | integer(),grouping::'group_all' | 'group_label' | 'group_node' | 'group_node_label' | 'split',group::{_,_},job_coord::'undefined' | pid(),jobenvs::'undefined' | [any()],worker::'undefined' | binary(),schedule::'local' | 'none' | 'remote' | 'undefined',input::'undefined' | [any()],save_outputs::'false' | 'true' | 'undefined',save_info::'undefined' | [any()]},#task_run{runid::'undefined' | non_neg_integer(),host::'none' | 'undefined' | [any(),...],failed_hosts::'undefined' | gb_sets:set(_),input::[any()]}}}) -> {'ok',#state{master::atom(),task::{{_,_,_,_,_,_,_,_,_,_,_,_,_,_},{_,_,_,_,_}},port::'none',worker_send::'none',error_output::'false',buffer::<<>>,parser::worker_protocol:state(),runtime::{'state','undefined' | [any(),...],{_,_},atom(),[any(),...],{_,_,_,_},{_,_,_},'false' | 'true' | 'undefined','undefined' | [any()],'none',gb_sets:set(_),[],gb_trees:tree(_,_),'none','none'},throttle::worker_throttle:state()}}
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Ingela Anderton Andin | 16 Apr 10:22 2014
Picon

Re: ssl


-------- Original Message --------
Subject: Re: [erlang-bugs] ssl
Date: Wed, 16 Apr 2014 09:46:44 +0200
From: Ingela Anderton Andin <Ingela.Anderton.Andin <at> ericsson.com>
To: Samir Sow <samset <at> wanadoo.fr>

Hi!

This works, and is equivalent of what you did in the first place!

Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-fa45816] [64-bit]
[smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.0  (abort with ^G)
1>  ssl:start().
ok
2> {ok, ListenSocket} = gen_tcp:listen(9999, [{reuseaddr, true},
{active, false}]).
{ok,#Port<0.776>}
3>  {ok, Socket} = gen_tcp:accept(ListenSocket).
{ok,#Port<0.777>}  %%% Will return when you started the openssl client

%% Do the upgrade
4>  ssl:ssl_accept(Socket, [{cacertfile, "cacerts.pem"}, {certfile,
"cert.pem"}, {keyfile, "key.pem"}]).
{ok,{sslsocket,{gen_tcp,#Port<0.777>,tls_connection},
                <0.48.0>}}

In an another shell:

bash> openssl s_client -host localhost -port 9999

Regards Ingela Erlang/OTP team - Ericsson AB

On 04/15/2014 10:06 PM, Samir Sow wrote:
> Hi,
>
> I’ve tried ok, ListenSocket} = gen_tcp:listen(9999, [{reuseaddr, true}, {active, false}]).
>
> But in this case,
> {ok, SSLSocket} = ssl:ssl_accept(ListenSocket, [{cacertfile, "priv/cert/cacert.crt"},
{certfile, "priv/cert/server.crt"}, {keyfile, "priv/cert/server.key"}]).
> does not return.
>
> Could you please, send me a working scenario ?
>
> Thank you.
>
> Sincerely
>
> On 15 avr. 2014, at 14:29, Ingela Anderton Andin <Ingela.Anderton.Andin <at> ericsson.com> wrote:
>
>> Hi!
>>
>> On 04/14/2014 10:05 PM, Samir Sow wrote:
>>> Hi,
>>>
>>> I’m using ssl-5.3.4
>>>
>>> I’ve executed the step presented in the «upgrade example» of the document :
>>> http://www.erlang.org/doc/apps/ssl/using_ssl.html
>>>
>>> except that i used openssl s_client to perform the client connect operation
>>
>> Well that explains it, as the s_client is not performing an upgrade of the connection it is connecting
with ssl from the start, and when the clientstart to send its handshake the server must be ready to receive
it. You can still make your example work by setting {active, false} already on the listen socket so that the
data will be left on the socket until the server process is is ready to receive it. (Accept socket inherits
listen options anddefault is among others {active, true} and {mode, list}. In the upgrade scenario the
server would do inet:setopts(Socket, [{active, false}]) before signaling to the client that it can now
start the ssl handshake and then call ssl:ssl_accept.
>> The ssl server process will emulate some inet options and internally set
>> its own values, example socket mode will be set to binary.
>>
>> Regards Ingela Erlang/OTP Team - Ericsson AB
>>
>>
>>> Thank you.
>>>
>>> Samir
>>>
>>> On 14 avr. 2014, at 09:53, Ingela Anderton Andin <Ingela.Anderton.Andin <at> ericsson.com> wrote:
>>>
>>>> Hi!
>>>>
>>>> Which version of the ssl application are you using? Can you make a more complete example that fails so
that I can run it too? We use openssl s_client in our test cases so it seems there is some special
circumstances thatmakes this happen. The problem seems to be that
>>>> the data from the peer is on list format  instead of binary format.
>>>> The packet option on the socket shall be emulated by ssl so the socket
>>>> should always be in binary mode, but it seems it is not.
>>>>
>>>> Regards Ingela Erlang/OTP team - Ericssson AB
>>>>
>>>> On 04/12/2014 09:37 AM, Samir Sow wrote:
>>>>> Hi,
>>>>>
>>>>> Still struggling with ssl.
>>>>> I decided to check what’s going on at the ssl module level. Did a step by step ssl connection using the
erlang ssl doc.
>>>>> Found an error erlang:size badarg, but could not understand if it’sa problem with the key/cert
files or with the data sent by the client.
>>>>>
>>>>> The client was openssl s_client.
>>>>>
>>>>> Any help welcomed. Thx
>>>>>
>>>>> Samir
>>>>>
>>>>> {ok, SSLSocket} = ssl:ssl_accept(Socket, [{cacertfile, "priv/cert/cacert.crt"}, {certfile,
"priv/cert/server.crt"}, {keyfile, "priv/cert/server.key"}]).
>>>>> ** exception exit: {{badarg,
>>>>>                         [{erlang,size,
>>>>>                              [[22,3,1,0,176,1,0,0,172,3,3,83,72,89,48,183,175,
>>>>>                                58,145,197,219|...]],
>>>>>                              []},
>>>>>                          {tls_record,get_tls_records_aux,2,
>>>>>                              [{file,"tls_record.erl"},{line,122}]},
>>>>>                          {tls_connection,next_tls_record,2,
>>>>>                              [{file,"tls_connection.erl"},{line,484}]},
>>>>>                          {tls_connection,handle_info,3,
>>>>>                              [{file,"tls_connection.erl"},{line,307}]},
>>>>>                          {gen_fsm,handle_msg,7,
>>>>>                              [{file,"gen_fsm.erl"},{line,503}]},
>>>>>                          {proc_lib,init_p_do_apply,3,
>>>>>                              [{file,"proc_lib.erl"},{line,239}]}]},
>>>>>                     {gen_fsm,sync_send_all_state_event,
>>>>>                         [<0.105.0>,{start,infinity},infinity]}}
>>>>>      in function  gen_fsm:sync_send_all_state_event/3 (gen_fsm.erl, line 242)
>>>>>      in call from ssl_connection:sync_send_all_state_event/2 (ssl_connection.erl, line 1649)
>>>>>      in call from ssl_connection:handshake/2 (ssl_connection.erl, line 97)
>>>>>      in call from tls_connection:start_fsm/8 (tls_connection.erl, line 81)
>>>>>      in call from ssl_connection:ssl_accept/7 (ssl_connection.erl, line 84)
>>>>> _______________________________________________
>>>>> erlang-bugs mailing list
>>>>> erlang-bugs <at> erlang.org
>>>>> http://erlang.org/mailman/listinfo/erlang-bugs
>>>>>
>>>>
>>>> _______________________________________________
>>>> erlang-bugs mailing list
>>>> erlang-bugs <at> erlang.org
>>>> http://erlang.org/mailman/listinfo/erlang-bugs
>>>
>>
>

_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs

Samir Sow | 12 Apr 09:37 2014
Picon

ssl

Hi,

Still struggling with ssl.
I decided to check what’s going on at the ssl module level. Did a step by step ssl connection using the
erlang ssl doc.
Found an error erlang:size badarg, but could not understand if it’s a problem with the key/cert files or
with the data sent by the client.

The client was openssl s_client.

Any help welcomed. Thx

Samir

{ok, SSLSocket} = ssl:ssl_accept(Socket, [{cacertfile, "priv/cert/cacert.crt"}, {certfile,
"priv/cert/server.crt"}, {keyfile, "priv/cert/server.key"}]).
** exception exit: {{badarg,
                       [{erlang,size,
                            [[22,3,1,0,176,1,0,0,172,3,3,83,72,89,48,183,175,
                              58,145,197,219|...]],
                            []},
                        {tls_record,get_tls_records_aux,2,
                            [{file,"tls_record.erl"},{line,122}]},
                        {tls_connection,next_tls_record,2,
                            [{file,"tls_connection.erl"},{line,484}]},
                        {tls_connection,handle_info,3,
                            [{file,"tls_connection.erl"},{line,307}]},
                        {gen_fsm,handle_msg,7,
                            [{file,"gen_fsm.erl"},{line,503}]},
                        {proc_lib,init_p_do_apply,3,
                            [{file,"proc_lib.erl"},{line,239}]}]},
                   {gen_fsm,sync_send_all_state_event,
                       [<0.105.0>,{start,infinity},infinity]}}
    in function  gen_fsm:sync_send_all_state_event/3 (gen_fsm.erl, line 242)
    in call from ssl_connection:sync_send_all_state_event/2 (ssl_connection.erl, line 1649)
    in call from ssl_connection:handshake/2 (ssl_connection.erl, line 97)
    in call from tls_connection:start_fsm/8 (tls_connection.erl, line 81)
    in call from ssl_connection:ssl_accept/7 (ssl_connection.erl, line 84)
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs

PAILLEAU Eric | 10 Apr 21:43 2014
Picon

[R17.0] Can't compile : "RELEASES" missing

Hi,
I tried to compile 17.0 on Ubuntu 13.04, doing './otp_build all' .

---8<--------------------------------------------
[...]
make[2]: entrant dans le répertoire « 
/home/eric/Téléchargements/otp_src_17.0/erts/start_scripts »
  GEN 
/home/eric/Téléchargements/otp_src_17.0/erts/start_scripts/start_clean.rel
  GEN 
/home/eric/Téléchargements/otp_src_17.0/erts/start_scripts/start_sasl.rel
  GEN 
/home/eric/Téléchargements/otp_src_17.0/erts/start_scripts/start_all_example.rel
  GEN 
/home/eric/Téléchargements/otp_src_17.0/erts/start_scripts/no_dot_erlang.rel
  GEN 
/home/eric/Téléchargements/otp_src_17.0/erts/start_scripts/start_clean.script
  GEN 
/home/eric/Téléchargements/otp_src_17.0/erts/start_scripts/start_sasl.boot
  GEN 
/home/eric/Téléchargements/otp_src_17.0/erts/start_scripts/no_dot_erlang.boot
  GEN    RELEASES.src
mv: impossible d'évaluer «RELEASES»: Aucun fichier ou dossier de ce type
---8<--------------------------------------------

in erts/start_scripts/Makefile, fails in target RELEASES.src,
file 'RELEASES' is not created and then 'mv' fails.

---8<--------------------------------------------
RELEASES.src:
         $(gen_verbose)$(INSTALL_DIR) $(SS_TMP)
         $(V_at)( cd $(SS_TMP) && \
         $(ERL) -noinput +B -eval 
'release_handler:create_RELEASES("%ERL_ROOT%", "$(SS_ROOT)", 
"$(SS_ROOT)/start_sasl.rel", []), halt()')
         $(V_at)mv RELEASES RELEASES.src
---8<--------------------------------------------

Any idea ?
regards
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs

José Valim | 10 Apr 19:54 2014
Picon

standard_error IO device is not being set to unicode

Hello OTP Team,

I am using Erlang 17.0 and it seems the standard_error device is not being set to unicode. On a Mac OS X:

1> io:format("~p~n", ["josé"]).
"josé"
ok
2> io:format(standard_error, "~p~n", ["josé"]).
"jos�"
ok

If we inspect the standard_error process, we can see in the process dictionary that unicode is set to false:

3> process_info(whereis(standard_error), dictionary).
{dictionary,[{unicode,false}]}

Once I explicitly enable unicode, it works:

4> io:setopts(standard_error, [{unicode, true}]).
ok
5> io:format(standard_error, "~p~n", ["josé"]).
"josé"
ok

Thank you!

PS: I found it interesting that the standard_error process does not accept the same options as the standard_io one:

6> io:setopts(standard_error, [{encoding, utf8}]).
{error,enotsup}
7> io:setopts(standard_error, [{unicode, true}]).
ok
8> io:setopts(standard_io, [{unicode, true}]).
{error,enotsup}
9> io:setopts(standard_io, [{encoding, utf8}]).
ok

However this seems to be an "old" behaviour (it exists at least in R16 too).

José Valim
Skype: jv.ptec
Founder and Lead Developer
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
José Valim | 10 Apr 19:18 2014
Picon

Encoding of IO devices when there is -noshell

Hello OTP team,

I am using Erlang 17.0 and I have noticed that, if -noshell is given, the encoding for IO devices are kept as latin:

    $ erl -eval 'io:format("~p", [io:getopts()]).'
    [{expand_fun,#Fun<group.0.100149429>},
     {echo,true},
     {binary,false},
     {encoding,latin1}]

Setting the +fnu flag doesn't change the behaviour:

    $ erl +fnu -eval 'io:format("~p", [io:getopts()]).'
    [{expand_fun,#Fun<group.0.100149429>},
     {echo,true},
     {binary,false},
     {encoding,latin1}]

I am pretty sure this behaviour is present in R16, but given the new direction taken in 17.0, I am not sure this is an actual bug or not.

I am using Mac OS X Mountain Lion but this bug was also peer verified on Linux.

Thank you!

José Valim
Skype: jv.ptec
Founder and Lead Developer
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Boris Mühmer | 10 Apr 05:42 2014
Picon

otp_src_17.0.tar.gz: "make docs" fails in "system/doc/top"

Yesterday I did a build with the new otp_src_17.0.tar.gz tarball using my script which served me quite well from R13Bxx to R17RC2, but this time it failed at "make docs":


make[2]: Entering directory `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/reference_manual'
make[2]: Nothing to be done for `docs'.
make[2]: Leaving directory `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/reference_manual'
make[2]: Entering directory `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/programming_examples'
make[2]: Nothing to be done for `docs'.
make[2]: Leaving directory `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/programming_examples'
make[2]: Entering directory `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/top'
make[2]: *** No rule to make target `../../README', needed by `docs'.  Stop.
make[2]: Leaving directory `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/top'
make[1]: *** [docs] Error 2
make[1]: Leaving directory `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc'
make: *** [docs] Error 2


I compared the 17.0 to the 17RC2 structure: it looks like the file "system/README" is missing. I could "fix" the build process with a "touch system/README"... not a real fix of course.
Regards, Boris
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
rohit12sh . | 10 Apr 03:04 2014
Picon

Memory Leak in beam.smp

I am using CouchDB which is based on Erlang. 

Recently I came across a bug in CouchDB which in-turn seems like a memory leak issue in NIF.

I already have posted the issue to CouchDB community and thought of posting to Erlang community as well to see if this issue can be resolved in early next releases.

Here is the link describing the complete use case:

I have seen this issue from erlang version 5.8-5.10 so far.

Please let me know if you have more questions. 

--
Regards,
Rohit Sharma
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Stavros Aronis | 9 Apr 19:06 2014
Picon

erlang:is_builtin(erlang,apply,3) = false

Hello!

Title says everything. Is this intentional?

1> erlang:is_builtin(erlang,apply,3).
false

Regards,

Stavros

PS: Apologies for just reporting this and not attempting a fix, but this seems to go deeper into C code than I am comfortable patching.
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Rabbe Fogelholm | 8 Apr 16:00 2014
Picon

A dialyzer option not described in the OTP documentation

With R16B02 `dialyzer -h' tells me that there is an option -Wno_undefined_callbacks.
However, the online OTP documentation does not describe that particular option:

http://www.erlang.org/doc/man/dialyzer.html

BR / Rabbe Fogelholm, Ericsson, Stockholm
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs

Aliaksey Artamonau | 7 Apr 23:28 2014
Picon

lost quotes in port arguments on Windows

Hi all,

We've recently encountered a problem with application arguments being 
interpreted differently on Windows and on GNU/Linux. Basically if we 
pass something like "\"path\"" to our application, it's then correctly 
returned as string by application:get_env/2 function on GNU/Linux. On 
Windows though, it's being interpreted as an atom. Which causes problems 
if path happens to contain something that can't be part of unquoted atom 
(like colon character). After some investigation, I've come up with the 
following code snippet to demonstrate the root cause of our problem:

(fun () ->
          P = open_port({spawn_executable, os:find_executable("erl")},
                        [exit_status,
                         {line, 2000},
                         {args, ["-noshell", "-noinput",
                                 "-app", "test", "arg with\"\"double 
quotes in it",
                                 "-eval", "io:format([126,112,126,110], 
[init:get_argument(app)]), erlang:halt(0)."]}]),

          F = fun (R) ->
                      receive
                          {P, {data, {_, L}}} -> io:format("~s~n", [L]), 
R(R);
                          {P, {exit_status, _}} -> ok
                      end
              end,
          F(F)
  end)().

I just paste it into erl shell. If I run this on GNU/Linux with 
R16B03-1, I get this:

{ok,[["test","arg with\"\"double quotes in it"]]}
ok

On Windows with the same Erlang version I get this:

{ok,[["test","arg with\"double quotes in it"]]}
ok

Note that one of the quotes disappeared from the argument.

Best regards,
Aliaksey.
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs


Gmane