Wiesław Bieniek | 17 Nov 11:22 2014
Picon

Problem with timeout on ldaps connection.

Hello,

I'm using ldaps protocol to communicate with LDAP Server

Handle = case eldap:open([LDAPHost], [{port, LDAPPort}, {timeout, Timeout}, {log, LogFun}, {ssl, true}, {sslopts, [{verify, verify_peer}, {reuse_sessions, false}, {cacertfile, CertFile}]}]) of
                 {ok, H} -> H;
                 Error -> ?DEBUG("Open Error: [~p]~n", [Error]),
                          error(Error)
             end,

When LDAP on LDAPHost:LDAPPort is not working and cannot respond for request this function hangs for about 3 minutes (although the Timeout is set to 1000 (1 sec.)) and then returns with {error, etimedout}.

I made some investigations and the root cause of this seems to be function from eldap:

do_connect(Host, Data, Opts) when Data#eldap.ldaps == false ->
    gen_tcp:connect(Host, Data#eldap.port, Opts, Data#eldap.timeout);
do_connect(Host, Data, Opts) when Data#eldap.ldaps == true ->
    ssl:connect(Host, Data#eldap.port, Opts++Data#eldap.tls_opts).

It does not use timeout when connecting using SSL.

I guess It need fixing is next release.

But there is an additional question:

Due to agreement with user we cannot change any part of OTP Distributions. Only official releases of OTP can be used.
Is it possible to workaround the problem without updating eldap.erl and recompiling OTP ?

--
Wiesław Bieniek
Projektant Telco BSS R&D

tel. +48 12 646 12 66
website: www.comarch.pl
Attachment (smime.p7s): application/pkcs7-signature, 2972 bytes
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Dariusz Gadomski | 14 Nov 11:01 2014

Cannot bind epmd to an IPv4 address after building with -DEPMD6

Hello everyone,

There are users observing problems with binding to an IPv4 address with
erlang 16b3 version built with -DEPMD6 flag [1]. This flag has been added
as a response to another bug [2].

By looking at erts/epmd/src/epmd_int.h I see that the address definitions are
mutually exclusive - enabling IPv6 makes all addresses IPv6-only which may
result in problems with binding to a specific IPv4 address:
$ ERL_EPMD_ADDRESS="127.0.0.1" epmd
epmd: Fri Nov 14 11:00:47 2014: cannot parse IP address "127.0.0.1"

Can you please confirm this? Is it a known issue? Maybe there is a workaround?

[1] https://bugs.launchpad.net/ubuntu/+source/erlang/+bug/1374109
[2] https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/1312507

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

Davery | 11 Nov 23:59 2014
Picon

bug ?

hi there:

Winxp sp3
Erlang 17.3

-- 
have a good day.

Regards,
Davery
Erlang/OTP 17 [erts-6.2] [async-threads:10]

原工作目录:"d:/erl6.2/usr"
当前工作目录:"d:/work"
Eshell V6.2  (abort with ^G)
1> hello : start().
Hello world
ok
2> my_module : pie().
3.14
3> my_module : print(). 
** exception error: undefined function my_module:print/0
4> my_module : print(223444).
The value of Term is: 223444.
ok
5> my_module : print(22344hello).
* 1: syntax error before: hello
5> my_module : print(hello).     
The value of Term is: hello.
ok
6> my_module : print(22344hello).
* 1: syntax error before: hello
6> my_module : print(32#hello).  
The value of Term is: 18306744.
ok
7> my_module : print(22344+hello).
** exception error: an error occurred when evaluating an arithmetic expression
     in operator  +/2
        called as 22344 + hello
8> my_module : print("22344"+hello).
** exception error: an error occurred when evaluating an arithmetic expression
     in operator  +/2
        called as "22344" + hello
9> my_module : print("22344"hello). 
* 1: syntax error before: hello
9> my_module : print(hello 122421 23412  412).
* 1: syntax error before: 122421
9> my_module : print("hello 122421 23412  412").
The value of Term is: [104,101,108,108,111,32,49,50,50,52,50,49,32,50,51,52,49,50,32,32,52,49,50].
ok
10> my_module : print($"hello 122421 23412  412").
10> my_module : print($hello 122421 23412  412).  
10> .
10> my_module : print(32#hello).                  
10> 
10> 
10> 
User switch command
 --> j
   1* {shell,start,[init]}
 --> 1
Unknown command
 --> c
1
10> my_module : print(hello).                     
10> q().
10> 
User switch command
 --> j
   1* {shell,start,[init]}
 --> k 1
 --> j
 --> s
 --> j
   2* {shell,start,[]}
Erlang/OTP 17 [erts-6.2] [async-threads:10]

原工作目录:"d:/erl6.2/usr"
当前工作目录:"d:/work"
Eshell V6.2  (abort with ^G)
1> hello : start().
Hello world
ok
2> my_module : pie().
3.14
3> my_module : print(). 
** exception error: undefined function my_module:print/0
4> my_module : print(223444).
The value of Term is: 223444.
ok
5> my_module : print(22344hello).
* 1: syntax error before: hello
5> my_module : print(hello).     
The value of Term is: hello.
ok
6> my_module : print(22344hello).
* 1: syntax error before: hello
6> my_module : print(32#hello).  
The value of Term is: 18306744.
ok
7> my_module : print(22344+hello).
** exception error: an error occurred when evaluating an arithmetic expression
     in operator  +/2
        called as 22344 + hello
8> my_module : print("22344"+hello).
** exception error: an error occurred when evaluating an arithmetic expression
     in operator  +/2
        called as "22344" + hello
9> my_module : print("22344"hello). 
* 1: syntax error before: hello
9> my_module : print(hello 122421 23412  412).
* 1: syntax error before: 122421
9> my_module : print("hello 122421 23412  412").
The value of Term is: [104,101,108,108,111,32,49,50,50,52,50,49,32,50,51,52,49,50,32,32,52,49,50].
ok
10> my_module : print($"hello 122421 23412  412").
10> my_module : print($hello 122421 23412  412).  
10> .
10> my_module : print(32#hello).                  
10> 
10> 
10> 
User switch command
 --> j
   1* {shell,start,[init]}
 --> 1
Unknown command
 --> c
1
10> my_module : print(hello).                     
10> 
10> 
10> 
10> 
10> 
10> 
10> 
10> 
10> 
10> 
10> 
10> q().
10> 
10> 
10> 
10> 
10> 
10> 
10> 
User switch command
 --> j
   1* {shell,start,[init]}
 --> k 1
 --> j
 --> s
 --> j
   2* {shell,start,[]}
 --> c
Eshell V6.2  (abort with ^G)
1> my_module : print("sdfasf1243213412").
The value of Term is: [115,100,102,97,115,102,49,50,52,51,50,49,51,52,49,50].
ok
2> my_module : print($sdfasf1243213412). 
* 1: syntax error before: dfasf1243213412
2> my_module : print("sdfasf1243213412").
The value of Term is: [115,100,102,97,115,102,49,50,52,51,50,49,51,52,49,50].
ok
3> my_module : print(sdfasf1243213412).  
The value of Term is: sdfasf1243213412.
ok
4> my_module : print(11sdfasf1243213412).
* 1: syntax error before: sdfasf1243213412
4> my_module : print([11sd,fasf1243213412]).
* 1: syntax error before: sd
4> my_module : print(["11sd",fasf1243213412]).
The value of Term is: [[49,49,115,100],fasf1243213412].
ok
5> my_module : print($"["11sd",fasf1243213412]").
5> 
5> 
5> 
5> 
User switch command
 --> s
 --> j
   2  {shell,start,[]}
   3* {shell,start,[]}
 --> k 2
 --> j
   3* {shell,start,[]}
 --> c 3
Eshell V6.2  (abort with ^G)
1> c = '$"srdgegr134'
1> .
** exception error: no match of right hand side value '$"srdgegr134'
2> c = ['$"srdgegr134].
2> 
2> 
2> 
2> 
2> c.
2> 
2> 
2> j
2> 
User switch command
 --> j
   3* {shell,start,[]}
 --> 
 --> 
 --> 
 --> 
 --> 
 --> 
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Eric Meadows-Jönsson | 12 Nov 01:02 2014
Picon

httpc: Duplicate requests sent on long-running request sending

Duplicate requests will be sent when you have already run a request against the same host and therefor have an existing keep-alive connection open. If you then perform a request where the request body takes more than five seconds to send a second identical request will be sent concurrently.

I think I have figured what is happening after tracing httpc.

The code reaches https://github.com/erlang/otp/blob/ec8e9a96bd0d0148df5008b0665da0725e5b3f92/lib/inets/src/http_client/httpc_manager.erl#L851 and calls `httpc_handler:send` which blocks while sending the request. If the request body takes longer than five seconds to send the `gen_server:call` will timeout and reach this code https://github.com/erlang/otp/blob/ec8e9a96bd0d0148df5008b0665da0725e5b3f92/lib/inets/src/http_client/httpc_manager.erl#L856. `start_handler` will create a new connection sending another identical request even though a request is already in progress.

I would be happy to provide a patch after some guidance on what the fix should be. Maybe the `handle_call` in `httpc_handler` should return immediately and the request be sent without blocking the caller?

--
Eric Meadows-Jönsson
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
PAILLEAU Eric | 11 Nov 23:40 2014
Picon

Missing return values for mnesia:subscribe/1 in documentation

Hi,
I found that in online documentation is missing possible returned values 
of mnesia:subscribe/1 .

By trying, looks like {ok, nodes()} when OK, but what on error ?

I cannot see more info in User's Guide either ...

---8<------------------------------------------------------------------------------
subscribe(EventCategory)

Ensures that a copy of all events of type EventCategory are sent to the 
caller. The event types available are described in the Mnesia User's Guide.
---8<------------------------------------------------------------------------------

Regards.

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

Mattias Waldau | 9 Nov 16:48 2014

Re: Parser bug: if missing ", " in list between records, the first is ignored, and no parser warnings are given.

Forget the comment below. After talking to a friend, I at last understood why this is ok.

In the expression #{}#{}, the first #{} is the record creation, and the 2nd #{} is record copying, so in Erlang, the same syntax is used for 2 separate things.

For example in Ocaml, you use {X with ..}

Thanks for the help. Yes, this is not a bug.

/mattias


On 09/11/2014 14:27, Mattias Waldau wrote:
Thank you Loic and Roland for the explanations, I really appreciate it.

The trick to understand why this is and should be ok is that #{} is n operator and then it makes sense. Then, there is another question why #{} is an operator.

This is what the Erlang reference manual says about record creation, it doesn't mention #rec{}#rec{}

So, until you explained, I just thought is was a parser bug.

/mattias

10.2  Creating Records

The following expression creates a new Name record where the value of each field FieldI is the value of evaluating the corresponding expression ExprI:

#Name{Field1=Expr1,...,FieldK=ExprK}

The fields may be in any order, not necessarily the same order as in the record definition, and fields can be omitted. Omitted fields will get their respective default value instead.

If several fields should be assigned the same value, the following construction can be used:

#Name{Field1=Expr1,...,FieldK=ExprK, _=ExprL}

Omitted fields will then get the value of evaluating ExprL instead of their default values. This feature was added in Erlang 5.1/OTP R8 and is primarily intended to be used to create patterns for ETS and Mnesia match functions. Example:

-record(person, {name, phone, address}). ... lookup(Name, Tab) -> ets:match_object(Tab, #person{name=Name, _='_'}).


/mattias


On 09/11/2014 14:09, Loïc Hoguin wrote:at
There are already warnings on otherwise correct syntax. Syntax being correct is why they are warnings and not errors. +warn_export_vars and +warn_shadow_vars are the most obvious examples. I also want to note in addition to everything I mentioned that if such a warning is introduced, it needs to apply to both records and maps, as they both suffer from the same syntactic fragility. On 11/09/2014 03:02 PM, Roland Karlsson wrote:
Hi Mattias and Loïc. That #rec{}#rec{} is correct syntax is a result of how operators work. Making it not correct syntax needs a special treatment of this case. Which should be weird. Even more weird if it would be correct syntax in "advanced macros" only. Having a warning is another issue, warnings are based on heuristics and opinions. Loïc - have you seen a warning if you e.g. write A*B+C ? This expression (in principle) takes A*B, creating an unnamed variable. This unnamed variable is then added with C. Have you seen any warnings that this unnamed variable is unused? The same goes for #rec{}#rec{}. The first #rec{} creates an unnamed record of type rec. The second #rec{} modifies the unnamed record. You might not like the record syntax, and find the #rec{}#rec{} unreadable - but it is very clear what it does. BTW - the bit syntax and list comprehensions are even more hairy. Now, I am not a part of the OTP group or developing Erlang syntax, so it feels a bit awkward to defend it and be forced to come with motivations and proofs for being right. So - this is my last post on this subject. /Roland On Sun, 9 Nov 2014 13:23:59 +0100 Mattias Waldau <mattias.waldau <at> outlook.com> wrote:
Hi All, I think the discussion went overboard. I made a small typo, forgetting a single comma in a static list. I know realize that #rec{}#rec{} is correct syntax, and I do not understand why it should be. Why not just say that it isn't ok? Who needs this syntax, except a advanced macro? /mattias


_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Mattias Waldau | 8 Nov 09:02 2014

Re: Parser bug: if missing ", " in list between records, the first is ignored, and no parser warnings are given.

Yes, I can agree that

#rec{a=2}#rec{b=3}

is a matter of opinion. However, I completely fail to understand how

#rec{a=2}#rec{a=3}

can be a matter of opinion, since data in the code is LOST.

There should be a warning. My sample below shows how catastropic the missing "," can be.

/mattias

On 07/11/2014 13:22, Roland Karlsson wrote:
> Maybe we shall not discuss this for ever :)
> It is a matter of opinion after all.
>
> But - it is the same IMHO. It is a matter of operators and the need
> to set paranthesis when the precedents and right/left association is
> not obvious.
>
> The rec example can be written thus
>
> (#rec{a=2})#rec{b=3}
>
> Then everything is clear.
>
>
> /Roland
>
>
>
>> I'm not sure how that relates. This expression can be reasonably written
>> on purpose. The same cannot be said for #rec{a=2}#rec{b=3}.
>>
>> On 11/07/2014 02:01 PM, Roland Karlsson wrote:
>>> If there is a warning there, then all expressions including operators,
>>> e.g. arithmetic, should have warnings. How about 10 + 1 rem 3 + 7. ?
>>> Do you know the precedence of + and rem ? What is the result?
>>>
>>> /Roland
>>>
>>>
>>>
>>>> Warnings are ordinary Erlang code which is prone to errors.
>>>>
>>>> On 11/07/2014 01:46 PM, Roland Karlsson wrote:
>>>>> No warning is needed methinks. It is just ordinary Erlang code.
>>>>> It is equal to.
>>>>>
>>>>>> REC1 = #rec{b=3}.
>>>>>> REC2 = REC1#rec{a=2}.
>>>>> Nothing strange at all.
>>>>>
>>>>>
>>>>> /Roland
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> It is legal but there probably should be a warning for this
>>>>>> particular
>>>>>> case. I cannot think of a valid reason to do #rec{a=2}#rec{b=3} when
>>>>>> you
>>>>>> can just do #rec{a=2, b=3}.
>>>>>>
>>>>>> On 11/07/2014 10:09 AM, Vlad Dumitrescu wrote:
>>>>>>> Hi Mattias,
>>>>>>>
>>>>>>> This isn't a bug. The expression #rec{a=2}#rec{b=3} is legal, and is
>>>>>>> the
>>>>>>> same thing as (#rec{a=2})#rec{b=3} or #rec{a=2,b=3}. If the keys
>>>>>>> overlap, then the last one "wins".
>>>>>>>
>>>>>>> best regards,
>>>>>>> Vlad
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Nov 6, 2014 at 9:21 AM, Mattias Waldau
>>>>>>> <mattias.waldau <at> outlook.com <mailto:mattias.waldau <at> outlook.com>>
>>>>>>> wrote:
>>>>>>>
>>>>>>>        This is the program
>>>>>>>
>>>>>>>        -module('missing-comma-not-detected').
>>>>>>>
>>>>>>>        -export([data/1]).
>>>>>>>
>>>>>>>        -compile(export_all).
>>>>>>>
>>>>>>>        -record(shcnode, {
>>>>>>>               nodename :: any(),
>>>>>>>               y_axis :: number(),
>>>>>>>               children :: [any()],
>>>>>>>               article_number :: number(),
>>>>>>>               attribute_condition :: string()}).
>>>>>>>
>>>>>>>
>>>>>>>        data(1) ->
>>>>>>>             [
>>>>>>>              #shcnode{nodename = start, y_axis = 0, children =
>>>>>>> [d1285]},
>>>>>>>              #shcnode{nodename = d1285, y_axis = 295, children =
>>>>>>> [1939,
>>>>>>> 1940]}
>>>>>>>              #shcnode{nodename = 1940, y_axis = 525, children =
>>>>>>> [bm3203],
>>>>>>>        article_number = 14432861},
>>>>>>>              #shcnode{nodename = 1939, y_axis = 530, children =
>>>>>>> [bm3203],
>>>>>>>        article_number = 14432860},
>>>>>>>              #shcnode{nodename = bm3203, y_axis = 915, children = []}
>>>>>>>             ].
>>>>>>>
>>>>>>>
>>>>>>>        Note the missing "," after  [1939, 1940]}
>>>>>>>
>>>>>>>        Only 4 rows are detected
>>>>>>>
>>>>>>>        length('missing-comma-not-detected':data(1)).
>>>>>>>        4
>>>>>>>
>>>>>>>        ---
>>>>>>>
>>>>>>>        If I add the comma, I get
>>>>>>>
>>>>>>>        length('missing-comma-not-detected':data(1)).
>>>>>>>        5
>>>>>>>
>>>>>>>        ----
>>>>>>>
>>>>>>>        I am using Erlang 17.3 on ubuntu.
>>>>>>>
>>>>>>>        erlang:system_info(otp_release).
>>>>>>>        "17"
>>>>>>>
>>>>>>>        36> |erl -V
>>>>>>>        Eshell V6.2  (abort with ^G)
>>>>>>>        1> |
>>>>>>>
>>>>>>>        ---
>>>>>>>
>>>>>>>        Thanks,
>>>>>>>
>>>>>>>        Mattias
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>        _______________________________________________
>>>>>>>        erlang-bugs mailing list
>>>>>>>        erlang-bugs <at> erlang.org <mailto: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
>>>>>>>
>>>>>> --
>>>>>> Loïc Hoguin
>>>>>> http://ninenines.eu
>>>>>> _______________________________________________
>>>>>> erlang-bugs mailing list
>>>>>> erlang-bugs <at> erlang.org
>>>>>> http://erlang.org/mailman/listinfo/erlang-bugs
>>>>>>
>>>>>
>>>> --
>>>> Loïc Hoguin
>>>> http://ninenines.eu
>>>>
>>>
>> --
>> Loïc Hoguin
>> http://ninenines.eu
>> _______________________________________________
>> 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

Loïc Hoguin | 7 Nov 13:01 2014
Picon

Re: Parser bug: if missing ", " in list between records, the first is ignored, and no parser warnings are given.

I'm not sure how that relates. This expression can be reasonably written 
on purpose. The same cannot be said for #rec{a=2}#rec{b=3}.

On 11/07/2014 02:01 PM, Roland Karlsson wrote:
> If there is a warning there, then all expressions including operators,
> e.g. arithmetic, should have warnings. How about 10 + 1 rem 3 + 7. ?
> Do you know the precedence of + and rem ? What is the result?
>
> /Roland
>
>
>
>> Warnings are ordinary Erlang code which is prone to errors.
>>
>> On 11/07/2014 01:46 PM, Roland Karlsson wrote:
>>> No warning is needed methinks. It is just ordinary Erlang code.
>>> It is equal to.
>>>
>>>> REC1 = #rec{b=3}.
>>>> REC2 = REC1#rec{a=2}.
>>>
>>> Nothing strange at all.
>>>
>>>
>>> /Roland
>>>
>>>
>>>
>>>
>>>> It is legal but there probably should be a warning for this particular
>>>> case. I cannot think of a valid reason to do #rec{a=2}#rec{b=3} when
>>>> you
>>>> can just do #rec{a=2, b=3}.
>>>>
>>>> On 11/07/2014 10:09 AM, Vlad Dumitrescu wrote:
>>>>> Hi Mattias,
>>>>>
>>>>> This isn't a bug. The expression #rec{a=2}#rec{b=3} is legal, and is
>>>>> the
>>>>> same thing as (#rec{a=2})#rec{b=3} or #rec{a=2,b=3}. If the keys
>>>>> overlap, then the last one "wins".
>>>>>
>>>>> best regards,
>>>>> Vlad
>>>>>
>>>>>
>>>>> On Thu, Nov 6, 2014 at 9:21 AM, Mattias Waldau
>>>>> <mattias.waldau <at> outlook.com <mailto:mattias.waldau <at> outlook.com>>
>>>>> wrote:
>>>>>
>>>>>       This is the program
>>>>>
>>>>>       -module('missing-comma-not-detected').
>>>>>
>>>>>       -export([data/1]).
>>>>>
>>>>>       -compile(export_all).
>>>>>
>>>>>       -record(shcnode, {
>>>>>              nodename :: any(),
>>>>>              y_axis :: number(),
>>>>>              children :: [any()],
>>>>>              article_number :: number(),
>>>>>              attribute_condition :: string()}).
>>>>>
>>>>>
>>>>>       data(1) ->
>>>>>            [
>>>>>             #shcnode{nodename = start, y_axis = 0, children = [d1285]},
>>>>>             #shcnode{nodename = d1285, y_axis = 295, children = [1939,
>>>>> 1940]}
>>>>>             #shcnode{nodename = 1940, y_axis = 525, children =
>>>>> [bm3203],
>>>>>       article_number = 14432861},
>>>>>             #shcnode{nodename = 1939, y_axis = 530, children =
>>>>> [bm3203],
>>>>>       article_number = 14432860},
>>>>>             #shcnode{nodename = bm3203, y_axis = 915, children = []}
>>>>>            ].
>>>>>
>>>>>
>>>>>       Note the missing "," after  [1939, 1940]}
>>>>>
>>>>>       Only 4 rows are detected
>>>>>
>>>>>       length('missing-comma-not-detected':data(1)).
>>>>>       4
>>>>>
>>>>>       ---
>>>>>
>>>>>       If I add the comma, I get
>>>>>
>>>>>       length('missing-comma-not-detected':data(1)).
>>>>>       5
>>>>>
>>>>>       ----
>>>>>
>>>>>       I am using Erlang 17.3 on ubuntu.
>>>>>
>>>>>       erlang:system_info(otp_release).
>>>>>       "17"
>>>>>
>>>>>       36> |erl -V
>>>>>       Eshell V6.2  (abort with ^G)
>>>>>       1> |
>>>>>
>>>>>       ---
>>>>>
>>>>>       Thanks,
>>>>>
>>>>>       Mattias
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>       _______________________________________________
>>>>>       erlang-bugs mailing list
>>>>>       erlang-bugs <at> erlang.org <mailto: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
>>>>>
>>>>
>>>> --
>>>> Loïc Hoguin
>>>> http://ninenines.eu
>>>> _______________________________________________
>>>> erlang-bugs mailing list
>>>> erlang-bugs <at> erlang.org
>>>> http://erlang.org/mailman/listinfo/erlang-bugs
>>>>
>>>
>>>
>>
>> --
>> Loïc Hoguin
>> http://ninenines.eu
>>
>
>

--

-- 
Loïc Hoguin
http://ninenines.eu
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Loïc Hoguin | 7 Nov 12:41 2014
Picon

Re: Parser bug: if missing ", " in list between records, the first is ignored, and no parser warnings are given.

Warnings are ordinary Erlang code which is prone to errors.

On 11/07/2014 01:46 PM, Roland Karlsson wrote:
> No warning is needed methinks. It is just ordinary Erlang code.
> It is equal to.
>
>> REC1 = #rec{b=3}.
>> REC2 = REC1#rec{a=2}.
>
> Nothing strange at all.
>
>
> /Roland
>
>
>
>
>> It is legal but there probably should be a warning for this particular
>> case. I cannot think of a valid reason to do #rec{a=2}#rec{b=3} when you
>> can just do #rec{a=2, b=3}.
>>
>> On 11/07/2014 10:09 AM, Vlad Dumitrescu wrote:
>>> Hi Mattias,
>>>
>>> This isn't a bug. The expression #rec{a=2}#rec{b=3} is legal, and is the
>>> same thing as (#rec{a=2})#rec{b=3} or #rec{a=2,b=3}. If the keys
>>> overlap, then the last one "wins".
>>>
>>> best regards,
>>> Vlad
>>>
>>>
>>> On Thu, Nov 6, 2014 at 9:21 AM, Mattias Waldau
>>> <mattias.waldau <at> outlook.com <mailto:mattias.waldau <at> outlook.com>> wrote:
>>>
>>>      This is the program
>>>
>>>      -module('missing-comma-not-detected').
>>>
>>>      -export([data/1]).
>>>
>>>      -compile(export_all).
>>>
>>>      -record(shcnode, {
>>>             nodename :: any(),
>>>             y_axis :: number(),
>>>             children :: [any()],
>>>             article_number :: number(),
>>>             attribute_condition :: string()}).
>>>
>>>
>>>      data(1) ->
>>>           [
>>>            #shcnode{nodename = start, y_axis = 0, children = [d1285]},
>>>            #shcnode{nodename = d1285, y_axis = 295, children = [1939,
>>> 1940]}
>>>            #shcnode{nodename = 1940, y_axis = 525, children = [bm3203],
>>>      article_number = 14432861},
>>>            #shcnode{nodename = 1939, y_axis = 530, children = [bm3203],
>>>      article_number = 14432860},
>>>            #shcnode{nodename = bm3203, y_axis = 915, children = []}
>>>           ].
>>>
>>>
>>>      Note the missing "," after  [1939, 1940]}
>>>
>>>      Only 4 rows are detected
>>>
>>>      length('missing-comma-not-detected':data(1)).
>>>      4
>>>
>>>      ---
>>>
>>>      If I add the comma, I get
>>>
>>>      length('missing-comma-not-detected':data(1)).
>>>      5
>>>
>>>      ----
>>>
>>>      I am using Erlang 17.3 on ubuntu.
>>>
>>>      erlang:system_info(otp_release).
>>>      "17"
>>>
>>>      36> |erl -V
>>>      Eshell V6.2  (abort with ^G)
>>>      1> |
>>>
>>>      ---
>>>
>>>      Thanks,
>>>
>>>      Mattias
>>>
>>>
>>>
>>>
>>>      _______________________________________________
>>>      erlang-bugs mailing list
>>>      erlang-bugs <at> erlang.org <mailto: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
>>>
>>
>> --
>> Loïc Hoguin
>> http://ninenines.eu
>> _______________________________________________
>> erlang-bugs mailing list
>> erlang-bugs <at> erlang.org
>> http://erlang.org/mailman/listinfo/erlang-bugs
>>
>
>

--

-- 
Loïc Hoguin
http://ninenines.eu
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Cons T Åhs | 6 Nov 12:46 2014

Dialyzer performance problem

Hi,
the attached archive exposes a problem in dialyzer where analysis time increases severely (up to non
termination) when defined types are referenced with a module name prefix, probably in combination with
recursively defined types.  See the README file for further details.

Cons

Attachment (ditrap.tgz): application/octet-stream, 2955 bytes

_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Mattias Waldau | 6 Nov 09:21 2014

Parser bug: if missing ", " in list between records, the first is ignored, and no parser warnings are given.

This is the program

-module('missing-comma-not-detected').

-export([data/1]).

-compile(export_all).

-record(shcnode, {
      nodename :: any(),
      y_axis :: number(),
      children :: [any()],
      article_number :: number(),
      attribute_condition :: string()}).


data(1) ->
    [
     #shcnode{nodename = start, y_axis = 0, children = [d1285]},
     #shcnode{nodename = d1285, y_axis = 295, children = [1939, 1940]}
     #shcnode{nodename = 1940, y_axis = 525, children = [bm3203], article_number = 14432861},
     #shcnode{nodename = 1939, y_axis = 530, children = [bm3203], article_number = 14432860},
     #shcnode{nodename = bm3203, y_axis = 915, children = []}
    ].


Note the missing "," after  [1939, 1940]}

Only 4 rows are detected

length('missing-comma-not-detected':data(1)).
4

---

If I add the comma, I get

length('missing-comma-not-detected':data(1)).
5

----

I am using Erlang 17.3 on ubuntu.

erlang:system_info(otp_release).
"17"

36>  erl -V
Eshell V6.2  (abort with ^G)
1>

---

Thanks,

Mattias



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

Gmane