From ulf.norell@REDACTED Sat Mar 1 07:31:33 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Sat, 1 Mar 2014 07:31:33 +0100 Subject: [erlang-bugs] More compiler errors In-Reply-To: <53110F6C.1010202@cs.ntua.gr> References: <53110F6C.1010202@cs.ntua.gr> Message-ID: Certainly most of those programs make no sense and I'd be fine with the compiler rejecting them, but if it was my compiler I wouldn't want it to crash with an internal error on non-sensical programs. Here's another one for you. Sensical or not? -module(bug5). f(X = true) when X; X; true -> ok. crash reason: {case_clause, {'EXIT', {function_clause, [{gb_trees,get_1,[{x,0},nil],[{file,"gb_trees.erl"},{line,239}]}, {beam_bool,bopt_bool_arg,2,[{file,"beam_bool.erl"},{line,435}]}, {lists,mapfoldl,3,[{file,"lists.erl"},{line,1352}]}, {beam_bool,bopt_tree,3,[{file,"beam_bool.erl"},{line,386}]}, {beam_bool,bopt_tree_cg,3,[{file,"beam_bool.erl"},{line,360}]}, {beam_bool,bopt_block,5,[{file,"beam_bool.erl"},{line,115}]}, {beam_bool,bopt,3,[{file,"beam_bool.erl"},{line,76}]}, {beam_bool,function,2,[{file,"beam_bool.erl"},{line,57}]}]}}} in function io_lib_pretty:cind_tag_tuple/7 (io_lib_pretty.erl, line 638) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) / Ulf On Fri, Feb 28, 2014 at 11:36 PM, Kostis Sagonas wrote: > On 02/28/2014 02:05 PM, Ulf Norell wrote: > >> I ran some more quickcheck tests and found a few more bugs. These are >> all tested on R17-rc1: >> > > I am obviously only speaking for myself here, but I think there is a fine > line on what is "reasonable" to expect from a compiler (and thus what can > be classified as a bug) and what is not. IMO, the Erlang compiler has > every right to refuse to compile code that is arguably weird, to say the > least. > > For example, the first two programs I would not expect any sensible > programmer to write, and IMO these Erlang programs should be burned in > hell. (No sensible programmer would write erlang:'andalso' and I would > definitely do not want to have to read code that looks like that.) If you > simply change the calls from being remote calls to being operators (e.g. > write "true andalso true" for the first one -- similarly for the second, > although this one actually has a type error and should perhaps not be > compiled anyway), the BEAM compiler happily accepts them. > > > -module(bug1). >> f() when erlang:'andalso'(true, true) -> >> ok. >> >> -module(bug2). >> f(X) when erlang:'and'(bad, X) -> >> ok. >> > > > The third program is the only one that I would classify as a bug here. > > > -module(bug3). >> f(Rec, Tag) -> >> erlang:is_record(Rec, Tag, 1) orelse error. >> > > The problem exists even without the erlang: part. This should be fixed. > > > As to this last program, IMO it's non-sensical: > > > -module(bug4). >> f(_) -> >> (fun f/1)(). >> > > The compiler has every right to throw up upon seeing code like this. Why > wouldn't it? ;) > > Kostis > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kostis@REDACTED Sat Mar 1 08:25:39 2014 From: kostis@REDACTED (Kostis Sagonas) Date: Sat, 01 Mar 2014 08:25:39 +0100 Subject: [erlang-bugs] More compiler errors In-Reply-To: References: <53110F6C.1010202@cs.ntua.gr> Message-ID: <53118B73.8020609@cs.ntua.gr> On 03/01/2014 07:31 AM, Ulf Norell wrote: > Certainly most of those programs make no sense and I'd be fine with the > compiler rejecting them, but if it was my compiler I wouldn't want it to > crash with an internal error on non-sensical programs. > > Here's another one for you. Sensical or not? > > -module(bug5). > f(X = true) when X; X; true -> ok. This is a program that I would classify as a bug. The compiler should not crash on this. Kostis From jose.valim@REDACTED Sat Mar 1 10:47:32 2014 From: jose.valim@REDACTED (=?ISO-8859-1?Q?Jos=E9_Valim?=) Date: Sat, 1 Mar 2014 10:47:32 +0100 Subject: [erlang-bugs] Map updates with binaries on the lhs do not compile Message-ID: The following example does not work: -module(foo). -compile(export_all). bar() -> (some:code(<<"hello">>))#{name => <<"world">>}. With the following error: foo.erl: internal error in core_module; crash reason: badarg in function lists:member/2 called as lists:member(big,default) in call from v3_core:verify_suitable_fields/1 (v3_core.erl, line 805) in call from v3_core:constant_bin_1/1 (v3_core.erl, line 788) in call from v3_core:constant_bin/1 (v3_core.erl, line 782) in call from v3_core:expr_bin/3 (v3_core.erl, line 766) in call from v3_core:expr/2 (v3_core.erl, line 508) in call from v3_core:safe/2 (v3_core.erl, line 1407) in call from v3_core:expr/2 (v3_core.erl, line 483) I am assuming the binaries on the left hand side of the update operator are not being normalized, that's why we are attempting lists:member(big, default), where "default" was supposed to be replaced by the normalized binary values. Thank you! *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Lead Developer -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Sat Mar 1 14:11:14 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sat, 1 Mar 2014 14:11:14 +0100 Subject: [erlang-bugs] More compiler errors In-Reply-To: <53110F6C.1010202@cs.ntua.gr> References: <53110F6C.1010202@cs.ntua.gr> Message-ID: On Fri, Feb 28, 2014 at 11:36 PM, Kostis Sagonas wrote: > For example, the first two programs I would not expect any sensible > programmer to write, and IMO these Erlang programs should be burned in hell. I don't think I agree. The purpose of a compiler is to produce correct code. If I can provoke the compiler to generate internal errors, it is often a latent problem with the compiler itself. At least disallowing the programs would be a start because it would encode what invariants (static semantics) I expect of well-formed programs. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Sat Mar 1 14:18:04 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sat, 1 Mar 2014 14:18:04 +0100 Subject: [erlang-bugs] More compiler errors In-Reply-To: References: Message-ID: So many bugs I could find and play with, had I a quickcheck license? -- Anthony Ramine Le 28 f?vr. 2014 ? 14:05, Ulf Norell a ?crit : > I ran some more quickcheck tests and found a few more bugs. These are all tested on R17-rc1: > > -module(bug1). > f() when erlang:'andalso'(true, true) -> > ok. > > -module(bug2). > f(X) when erlang:'and'(bad, X) -> > ok. > > -module(bug3). > f(Rec, Tag) -> > erlang:is_record(Rec, Tag, 1) orelse error. > > -module(bug4). > f(_) -> > (fun f/1)(). > > Output: > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 1] [erts-6.0] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug1). > Function: f/0 > bug1.erl: internal error in v3_codegen; > crash reason: {case_clause,{'EXIT',{{badmatch,{remote,{atom,erlang},{atom,'andalso'}}}, > [{v3_codegen,call_cg,7, > [{file,"v3_codegen.erl"},{line,1105}]}, > {v3_codegen,guard_cg,5, > [{file,"v3_codegen.erl"},{line,1002}]}, > {v3_codegen,'-guard_cg_list/6-anonymous-0-',4, > [{file,"v3_codegen.erl"},{line,1045}]}, > {v3_codegen,flatmapfoldl,3, > [{file,"v3_codegen.erl"},{line,2222}]}, > {v3_codegen,guard_cg_list,6, > [{file,"v3_codegen.erl"},{line,1043}]}, > {v3_codegen,protected_cg,7, > [{file,"v3_codegen.erl"},{line,1015}]}, > {v3_codegen,guard_clause_cg,4, > [{file,"v3_codegen.erl"},{line,982}]}, > {v3_codegen,match_cg,5, > [{file,"v3_codegen.erl"},{line,282}]}]}}} > > in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 494) > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) > in call from compile:fold_comp/3 (compile.erl, line 308) > in call from compile:internal_comp/4 (compile.erl, line 292) > in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) > bug1.erl:2: Warning: function f/0 is unused > error > 2> c(bug2). > Function: f/1 > bug2.erl: internal error in beam_bool; > crash reason: {case_clause, > {'EXIT', > {function_clause, > [{beam_bool,bopt_cg, > [{atom,bad}, > 5, > [{0,{x,0}}], > [], > {st,100000000, > {3, > {2, > [{block, > [{set, > [{x,1}], > [{atom,bad},{x,0}], > {bif,'and',{f,5}}}]}, > {test,is_eq_exact,{f,5},[{x,1},{atom,true}]}, > {block,[{set,[{x,0}],[{atom,ok}],move}]}, > return, > {label,5}, > {jump,{f,1}}, > return], > {1, > [{line,[{location,"bug2.erl",3}]}, > {func_info,{atom,bug2},{atom,f},1}, > {label,2}, > {block, > [{set, > [{x,1}], > [{atom,bad},{x,0}], > {bif,'and',{f,5}}}]}, > {test,is_eq_exact,{f,5},[{x,1},{atom,true}]}, > {block,[{set,[{x,0}],[{atom,ok}],move}]}, > return, > {label,5}, > {jump,{f,1}}, > return], > nil,nil}, > {5,[{jump,{f,1}},return],nil,nil}}}}], > [{file,"beam_bool.erl"},{line,505}]}, > {beam_bool,bopt_cg_and,5,[{file,"beam_bool.erl"},{line,552}]}, > {beam_bool,bopt_block,5,[{file,"beam_bool.erl"},{line,115}]}, > {beam_bool,bopt,3,[{file,"beam_bool.erl"},{line,76}]}, > {beam_bool,function,2,[{file,"beam_bool.erl"},{line,57}]}, > {lists,mapfoldl,3,[{file,"lists.erl"},{line,1339}]}, > {beam_bool,module,2,[{file,"beam_bool.erl"},{line,36}]}, > {compile,'-select_passes/2-anonymous-2-',2, > [{file,"compile.erl"},{line,494}]}]}}} > > in function io_lib_pretty:cind_tag_tuple/7 (io_lib_pretty.erl, line 636) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 725) > in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 695) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 725) > in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 695) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 725) > in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 695) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 725) > bug2.erl:3: Warning: function f/1 is unused > error > 3> c(bug3). > Function: f/2 > bug3.erl: internal error in v3_codegen; > crash reason: {case_clause,{'EXIT',{{badmatch,{remote,{atom,erlang},{atom,is_record}}}, > [{v3_codegen,call_cg,7, > [{file,"v3_codegen.erl"},{line,1105}]}, > {v3_codegen,guard_cg,5, > [{file,"v3_codegen.erl"},{line,1002}]}, > {v3_codegen,'-guard_cg_list/6-anonymous-0-',4, > [{file,"v3_codegen.erl"},{line,1045}]}, > {v3_codegen,flatmapfoldl,3, > [{file,"v3_codegen.erl"},{line,2222}]}, > {v3_codegen,guard_cg_list,6, > [{file,"v3_codegen.erl"},{line,1043}]}, > {v3_codegen,protected_cg,7, > [{file,"v3_codegen.erl"},{line,1015}]}, > {v3_codegen,guard_clause_cg,4, > [{file,"v3_codegen.erl"},{line,982}]}, > {v3_codegen,match_cg,5, > [{file,"v3_codegen.erl"},{line,282}]}]}}} > > in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 494) > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) > in call from compile:fold_comp/3 (compile.erl, line 308) > in call from compile:internal_comp/4 (compile.erl, line 292) > in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) > bug3.erl:2: Warning: function f/2 is unused > error > 4> c(bug4). > Function f/1 refers to undefined label 5 > bug4.erl: internal error in beam_dead; > crash reason: {case_clause,{'EXIT',{undefined_label,5}}} > > in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 494) > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) > in call from compile:fold_comp/3 (compile.erl, line 308) > in call from compile:internal_comp/4 (compile.erl, line 292) > in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) > bug4.erl:2: Warning: function f/1 is unused > error > > / Ulf > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Sat Mar 1 15:49:50 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sat, 1 Mar 2014 15:49:50 +0100 Subject: [erlang-bugs] More compiler errors In-Reply-To: References: Message-ID: Am fixing this. Replied inline. Regards, -- Anthony Ramine Le 28 f?vr. 2014 ? 14:05, Ulf Norell a ?crit : > -module(bug1). > f() when erlang:'andalso'(true, true) -> > ok. ?andalso? is not a real erlang function, bug in erl_lint:is_gexpr_op/2. > -module(bug2). > f(X) when erlang:'and'(bad, X) -> > ok. Pass beam_bool doesn?t handle non-boolean values in beam_bool:bopt_cg/5 and beam_bool:bopt_cg_not/1. > -module(bug3). > f(Rec, Tag) -> > erlang:is_record(Rec, Tag, 1) orelse error. Pass sys_core_fold doesn?t see that erlang:is_record/3 is not a valid guard expression if its second and third arguments aren?t a literal atom and a literal integer. > -module(bug4). > f(_) -> > (fun f/1)(). Pass v3_core doesn?t produce a safe variable in the case a fun reference with a mismatching arity is applied directly. From the Core spec: If e0 does not evaluate to a closure, or if the number n of arguments in the application is not equal to the arity k of f, the behaviour is implementation-dependent. If you run the Core linking pass over that module, you will see the generated Core code is rejected by the compiler itself: $ bin/erlc +clint bug4.erl bug4: argument count mismatch in f/1 Emitting "let Foo = 'f'/1 in apply Foo ()" makes the compiler happy. From n.oxyde@REDACTED Sat Mar 1 16:14:48 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sat, 1 Mar 2014 16:14:48 +0100 Subject: [erlang-bugs] Map updates with binaries on the lhs do not compile In-Reply-To: References: Message-ID: <2DCA722F-37DB-4BE5-9A85-1AE92B12595A@gmail.com> Am fixing this. Map arguments aren?t properly expanded in the sys_pre_expand module. -- Anthony Ramine Le 1 mars 2014 ? 10:47, Jos? Valim a ?crit : > The following example does not work: > > -module(foo). > -compile(export_all). > > bar() -> > (some:code(<<"hello">>))#{name => <<"world">>}. > > With the following error: > > foo.erl: internal error in core_module; > crash reason: badarg > > in function lists:member/2 > called as lists:member(big,default) > in call from v3_core:verify_suitable_fields/1 (v3_core.erl, line 805) > in call from v3_core:constant_bin_1/1 (v3_core.erl, line 788) > in call from v3_core:constant_bin/1 (v3_core.erl, line 782) > in call from v3_core:expr_bin/3 (v3_core.erl, line 766) > in call from v3_core:expr/2 (v3_core.erl, line 508) > in call from v3_core:safe/2 (v3_core.erl, line 1407) > in call from v3_core:expr/2 (v3_core.erl, line 483) > > I am assuming the binaries on the left hand side of the update operator are not being normalized, that's why we are attempting lists:member(big, default), where "default" was supposed to be replaced by the normalized binary values. > > Thank you! > > Jos? Valim > www.plataformatec.com.br > Skype: jv.ptec > Founder and Lead Developer > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Sat Mar 1 16:29:09 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sat, 1 Mar 2014 16:29:09 +0100 Subject: [erlang-bugs] Map updates with binaries on the lhs do not compile In-Reply-To: <2DCA722F-37DB-4BE5-9A85-1AE92B12595A@gmail.com> References: <2DCA722F-37DB-4BE5-9A85-1AE92B12595A@gmail.com> Message-ID: There: https://github.com/erlang/otp/pull/252 -- Anthony Ramine Le 1 mars 2014 ? 16:14, Anthony Ramine a ?crit : > Am fixing this. > > Map arguments aren?t properly expanded in the sys_pre_expand module. > > -- > Anthony Ramine > > Le 1 mars 2014 ? 10:47, Jos? Valim a ?crit : > >> The following example does not work: >> >> -module(foo). >> -compile(export_all). >> >> bar() -> >> (some:code(<<"hello">>))#{name => <<"world">>}. >> >> With the following error: >> >> foo.erl: internal error in core_module; >> crash reason: badarg >> >> in function lists:member/2 >> called as lists:member(big,default) >> in call from v3_core:verify_suitable_fields/1 (v3_core.erl, line 805) >> in call from v3_core:constant_bin_1/1 (v3_core.erl, line 788) >> in call from v3_core:constant_bin/1 (v3_core.erl, line 782) >> in call from v3_core:expr_bin/3 (v3_core.erl, line 766) >> in call from v3_core:expr/2 (v3_core.erl, line 508) >> in call from v3_core:safe/2 (v3_core.erl, line 1407) >> in call from v3_core:expr/2 (v3_core.erl, line 483) >> >> I am assuming the binaries on the left hand side of the update operator are not being normalized, that's why we are attempting lists:member(big, default), where "default" was supposed to be replaced by the normalized binary values. >> >> Thank you! >> >> Jos? Valim >> www.plataformatec.com.br >> Skype: jv.ptec >> Founder and Lead Developer >> _______________________________________________ >> erlang-bugs mailing list >> erlang-bugs@REDACTED >> http://erlang.org/mailman/listinfo/erlang-bugs > From n.oxyde@REDACTED Sat Mar 1 18:17:37 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sat, 1 Mar 2014 18:17:37 +0100 Subject: [erlang-bugs] More compiler errors In-Reply-To: References: Message-ID: <07D96254-34E8-4138-A462-09A2A4A83609@gmail.com> https://github.com/erlang/otp/pull/253 https://github.com/erlang/otp/pull/254 https://github.com/erlang/otp/pull/255 https://github.com/erlang/otp/pull/256 -- Anthony Ramine Le 1 mars 2014 ? 15:49, Anthony Ramine a ?crit : > Am fixing this. > > Replied inline. > > Regards, > > -- > Anthony Ramine > > Le 28 f?vr. 2014 ? 14:05, Ulf Norell a ?crit : > >> -module(bug1). >> f() when erlang:'andalso'(true, true) -> >> ok. > > ?andalso? is not a real erlang function, bug in erl_lint:is_gexpr_op/2. > >> -module(bug2). >> f(X) when erlang:'and'(bad, X) -> >> ok. > > Pass beam_bool doesn?t handle non-boolean values in beam_bool:bopt_cg/5 and beam_bool:bopt_cg_not/1. > >> -module(bug3). >> f(Rec, Tag) -> >> erlang:is_record(Rec, Tag, 1) orelse error. > > Pass sys_core_fold doesn?t see that erlang:is_record/3 is not a valid guard expression if its second and third arguments aren?t a literal atom and a literal integer. > >> -module(bug4). >> f(_) -> >> (fun f/1)(). > > Pass v3_core doesn?t produce a safe variable in the case a fun reference with a mismatching arity is applied directly. > > From the Core spec: > > If e0 does not evaluate to a closure, or if the number n of arguments in the application is not equal to the arity k of f, the behaviour is implementation-dependent. > > If you run the Core linking pass over that module, you will see the generated Core code is rejected by the compiler itself: > > $ bin/erlc +clint bug4.erl > bug4: argument count mismatch in f/1 > > Emitting "let Foo = 'f'/1 in apply Foo ()" makes the compiler happy. > From mjtruog@REDACTED Sat Mar 1 18:53:13 2014 From: mjtruog@REDACTED (Michael Truog) Date: Sat, 01 Mar 2014 09:53:13 -0800 Subject: [erlang-bugs] More compiler errors In-Reply-To: References: Message-ID: <53121E89.3010001@gmail.com> On 03/01/2014 05:18 AM, Anthony Ramine wrote: > So many bugs I could find and play with, had I a quickcheck license? > You could switch to Haskell where quickcheck is free, or just use proper to verify the compiler as part of the Erlang/OTP tests. From n.oxyde@REDACTED Sat Mar 1 19:10:40 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sat, 1 Mar 2014 19:10:40 +0100 Subject: [erlang-bugs] More compiler errors In-Reply-To: <53121E89.3010001@gmail.com> References: <53121E89.3010001@gmail.com> Message-ID: <7D5ED117-ED10-4B54-9533-0780C8A77621@gmail.com> Yes but given that Ulf Norell is from QuviQ, this whole thread means they have a random Erlang code generator, which I would have to rewrite. It would be cool if they could release it under an open source license which would allow rewriting it for PropEr, less compiler bugs is good for them too. -- Anthony Ramine Le 1 mars 2014 ? 18:53, Michael Truog a ?crit : > You could switch to Haskell where quickcheck is free, or just use proper to verify the compiler as part of the Erlang/OTP tests. From n.oxyde@REDACTED Sun Mar 2 18:46:46 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sun, 2 Mar 2014 18:46:46 +0100 Subject: [erlang-bugs] More compiler errors In-Reply-To: References: Message-ID: <6332088D-F0E2-411B-8B96-A8540E589F83@gmail.com> Just realized that this is a symptom of a larger problem: t(X, Y) -> is_function(X, Y) orelse error. The function sys_core_fold:is_safe_bool_expr/3 is too optimistic. -- Anthony Ramine Le 28 f?vr. 2014 ? 14:05, Ulf Norell a ?crit : > -module(bug3). > f(Rec, Tag) -> > erlang:is_record(Rec, Tag, 1) orelse error. From jargon@REDACTED Sun Mar 2 22:42:00 2014 From: jargon@REDACTED (Johannes =?utf-8?B?V2Vpw59s?=) Date: Sun, 2 Mar 2014 22:42:00 +0100 Subject: [erlang-bugs] Type errors in ssl application since OTP 17.0-rc2 Message-ID: <20140302214200.GA30713@molb.org> Hello, we noticed dialyzer warnings in our application with OTP 17.0-rc2. Through "git bisect" I could determine the commit which made the error apparent: 48c3778 Ingela Anderton Andin Fri Feb 14 17:08:14 2014 +0100 ssl: Fix possible mismatch between SSL/TLS version and default ciphers I attached a small example (ssl_bug.erl), it can be compiled and run like this: erlc ssl_bug.erl erl -noshell -s ssl_bug listen no_use_ssl -s init stop erl -noshell -s ssl_bug listen use_ssl -s init stop Although the program seems correct, dialyzer throws a warning: dialyzer --build_plt --apps erts kernel stdlib mnesia compiler asn1 \ syntax_tools hipe crypto public_key ssl dialyzer ssl_bug.erl ssl_bug.erl:30: The call ssl:sockname(Socket::port()) will never return since the success typing is ({'sslsocket',_,pid() | {port(),{'config',_,_,_,_,{_,_,_,_},_}}}) -> any() and the contract is (#sslsocket{}) -> {'ok',{inet:ip_address(),inet:port_number()}} | {'error',reason()} There are multiple type issues in the ssl application, which could be responsible for this, e.g.: dtls_handshake.erl:57: The call dtls_record:highest_protocol_version(Versions::'undefined' | ['dtlsv1' | 'dtlsv1.2' | 'sslv3' | 'tlsv1' | 'tlsv1.1' | 'tlsv1.2']) will never return since the success typing is ([any(),...]) -> any() and the contract is ([tls_version()]) -> tls_version() (tls_version() is {integer(), integer()}) Regards, Johannes Wei?l -------------- next part -------------- -module(ssl_bug). -export([listen/1]). listen(Args) -> UseSsl = proplists:get_bool(use_ssl, Args), io:format("Use SSL: ~p~n", [UseSsl]), case gen_tcp_or_ssl_listen(0, [], UseSsl) of {ok,ListenSocket} -> {ok,{Address,Port}} = inet_or_ssl_sockname(ListenSocket, UseSsl), io:format("Listening on ~p port ~p~n", [Address, Port]), {ok,ListenSocket}; {error,Reason} -> io:format("Error, reason: ~p~n", [Reason]), {error,Reason} end. gen_tcp_or_ssl_listen(Port, Options, false) -> gen_tcp:listen(Port, Options); gen_tcp_or_ssl_listen(Port, Options, true) -> DefaultOptions = [{ciphers,ssl:cipher_suites()}], case ssl:start() of ok -> ssl:listen(Port, Options ++ DefaultOptions); Error={error,_} -> Error end. inet_or_ssl_sockname(Socket, false) -> inet:sockname(Socket); inet_or_ssl_sockname(Socket, true) -> ssl:sockname(Socket). From n.oxyde@REDACTED Mon Mar 3 02:11:32 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Mon, 3 Mar 2014 02:11:32 +0100 Subject: [erlang-bugs] Strange lists:foreach/2 declaration In-Reply-To: <2B070BE7-1053-46CD-8A3E-DA19825232A8@gmail.com> References: <2B070BE7-1053-46CD-8A3E-DA19825232A8@gmail.com> Message-ID: The point is to crash if any of the inputs are not of the right type. If Fun is not an unary function and List isn?t empty, the function will crash when trying to call Fun, so there is no is_function/2 guard in the first clause. -- Anthony Ramine Le 21 f?vr. 2014 ? 08:20, Sergey Yelin a ?crit : > Hello, > > just found confusing behaviour for lists:foreach/2: > > 1> lists:foreach(xxx,[1,2,3]). > ** exception error: bad function xxx > in function lists:foreach/2 (lists.erl, line 1323) > 2> lists:foreach(xxx,[]). > ** exception error: no function clause matching lists:foreach(xxx,[]) (lists.erl, line 1322) > > so it returns two different errors for wrong function and it depends on whether list is empty or not. > Here is the snippet from lists.erl: > > -spec foreach(Fun, List) -> ok when > Fun :: fun((Elem :: T) -> term()), > List :: [T], > T :: term(). > > foreach(F, [Hd|Tail]) -> > F(Hd), > foreach(F, Tail); > foreach(F, []) when is_function(F, 1) -> ok. > > So my question is it known bug (or feature)? Why there is no check for function when list is not empty? > May be following is better: > > foreach(F, [Hd|Tail]) when is_function(F, 1) -> > F(Hd), > foreach(F, Tail); > foreach(F, []) -> ok. > > because actually F will be never call when list is empty? > > --- > Best regards, > Sergey Yelin. > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From ulf.norell@REDACTED Mon Mar 3 08:35:51 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Mon, 3 Mar 2014 08:35:51 +0100 Subject: [erlang-bugs] Internal error in beam_bool Message-ID: I posted this in the other thread, but it might have gotten lost in the other messages. I also found another way to trigger it: -module(bug). f(X = true) when X; X; true -> ok. -module(bug). f(X = true) -> [ok || X, X, X]. Now running on R17-rc2: $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/1 bug.erl: internal error in beam_bool; crash reason: {case_clause, {'EXIT', {function_clause, [{gb_trees,get_1,[{x,0},nil],[{file,"gb_trees.erl"},{line,239}]}, {beam_bool,bopt_bool_arg,2,[{file,"beam_bool.erl"},{line,435}]}, {lists,mapfoldl,3,[{file,"lists.erl"},{line,1352}]}, {beam_bool,bopt_tree,3,[{file,"beam_bool.erl"},{line,386}]}, {beam_bool,bopt_tree_cg,3,[{file,"beam_bool.erl"},{line,360}]}, {beam_bool,bopt_block,5,[{file,"beam_bool.erl"},{line,115}]}, {beam_bool,bopt,3,[{file,"beam_bool.erl"},{line,76}]}, {beam_bool,function,2,[{file,"beam_bool.erl"},{line,57}]}]}}} in function io_lib_pretty:cind_tag_tuple/7 (io_lib_pretty.erl, line 638) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) bug.erl:2: Warning: function f/1 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Mon Mar 3 08:41:56 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Mon, 3 Mar 2014 08:41:56 +0100 Subject: [erlang-bugs] Internal error in beam_dead when using maps in guards Message-ID: Replacing the map #{} makes the error go away. -module(bug). f() when is_map(#{}); false -> ok. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function f/0 refers to undefined label 6 bug.erl: internal error in beam_dead; crash reason: {case_clause,{'EXIT',{undefined_label,6}}} in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) in call from compile:fold_comp/3 (compile.erl, line 308) in call from compile:internal_comp/4 (compile.erl, line 292) in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) bug.erl:2: Warning: function f/0 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Mon Mar 3 08:44:43 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Mon, 3 Mar 2014 08:44:43 +0100 Subject: [erlang-bugs] Internal error in core_fold_module when repeating boolean case branch Message-ID: -module(bug). f(X) -> case X == 0 of false -> no; false -> no; true -> yes end. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/1 bug.erl: internal error in core_fold_module; crash reason: function_clause in function sys_core_fold:opt_bool_case_guard/2 called as sys_core_fold:opt_bool_case_guard({c_call,[3,{file,"bug.erl"}], {c_literal,[3,{file,"bug.erl"}],erlang}, {c_literal,[3,{file,"bug.erl"}],'=='}, [{c_var,[3,{file,"bug.erl"}],'X'}, {c_literal,[3,{file,"bug.erl"}],0}]}, [{c_clause,[4,{file,"bug.erl"}], [{c_literal,[4,{file,"bug.erl"}],false}], {c_literal,[],true}, {c_literal,[4,{file,"bug.erl"}],no}}, {c_clause,[5,{file,"bug.erl"}], [{c_literal,[5,{file,"bug.erl"}],false}], {c_literal,[],true}, {c_literal,[5,{file,"bug.erl"}],no}}, {c_clause,[6,{file,"bug.erl"}], [{c_literal,[6,{file,"bug.erl"}],true}], {c_literal,[],true}, {c_literal,[6,{file,"bug.erl"}],yes}}]) in call from sys_core_fold:opt_bool_case_guard/1 (sys_core_fold.erl, line 1933) in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 347) in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481) in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699) in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) in call from sys_core_fold:function_1/1 (sys_core_fold.erl, line 117) bug.erl:2: Warning: function f/1 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Mon Mar 3 09:01:17 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Mon, 3 Mar 2014 09:01:17 +0100 Subject: [erlang-bugs] Internal error in kernel_module Message-ID: -module(bug). f() -> [X = a || false] ++ [X = a || false]. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/0 bug.erl: internal error in kernel_module; crash reason: function_clause in function v3_kernel:ensure_return_vars/2 called as v3_kernel:ensure_return_vars([{k_var,[],cor2},{k_var,[],'X'}], {kern,{f,0}, undefined,0,0, {set,2,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, {{[],[],[cor2],[],[],[],[],[],['X'],[],[],[],[],[],[],[]}}}, [],[],[],0}) in call from v3_kernel:uexpr/3 (v3_kernel.erl, line 1777) in call from v3_kernel:ubody/3 (v3_kernel.erl, line 1556) in call from v3_kernel:function/2 (v3_kernel.erl, line 153) in call from lists:mapfoldl/3 (lists.erl, line 1352) in call from v3_kernel:module/2 (v3_kernel.erl, line 130) in call from compile:kernel_module/1 (compile.erl, line 1191) in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) bug.erl:2: Warning: function f/0 is unused bug.erl:2: Warning: no clause will ever match bug.erl:2: Warning: the guard for this clause evaluates to 'false' bug.erl:2: Warning: variable 'X' is unused bug.erl:2: Warning: variable 'X' is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Mon Mar 3 09:04:09 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Mon, 3 Mar 2014 09:04:09 +0100 Subject: [erlang-bugs] Internal error in beam_bool when calling obsolete erlang:float/1 in guard Message-ID: -module(bug). f() when erlang:float(self()); true -> ok. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/0 bug.erl: internal error in beam_bool; crash reason: {case_clause, {'EXIT', {{badmatch, {[{set,[{tmp,0}],[],{bif,self,{f,6}}}, {set,[{tmp,1}],[{tmp,0}],{alloc,1,{gc_bif,float,{f,6}}}}], []}}, [{beam_bool,bopt_tree,3,[{file,"beam_bool.erl"},{line,394}]}, {beam_bool,bopt_tree_cg,3,[{file,"beam_bool.erl"},{line,360}]}, {beam_bool,bopt_block,5,[{file,"beam_bool.erl"},{line,115}]}, {beam_bool,bopt,3,[{file,"beam_bool.erl"},{line,76}]}, {beam_bool,function,2,[{file,"beam_bool.erl"},{line,57}]}, {lists,mapfoldl,3,[{file,"lists.erl"},{line,1352}]}, {beam_bool,module,2,[{file,"beam_bool.erl"},{line,36}]}, {compile,'-select_passes/2-anonymous-2-',2, [{file,"compile.erl"},{line,493}]}]}}} in function io_lib_pretty:cind_tag_tuple/7 (io_lib_pretty.erl, line 638) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_tail/8 (io_lib_pretty.erl, line 710) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) bug.erl:2: Warning: function f/0 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Mon Mar 3 09:08:45 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Mon, 3 Mar 2014 09:08:45 +0100 Subject: [erlang-bugs] Internal error in beam_type Message-ID: This is my favourite so far. -module(bug). f(X, [_]) when {{X}}, -X -> ok. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/2 bug.erl: internal error in beam_type; crash reason: {case_clause,{'EXIT',{{badmatch,false}, [{beam_utils,live_opt_block,4, [{file,"beam_utils.erl"},{line,785}]}, {beam_utils,live_opt,4, [{file,"beam_utils.erl"},{line,680}]}, {beam_utils,live_opt,1, [{file,"beam_utils.erl"},{line,207}]}, {beam_type,function,1, [{file,"beam_type.erl"},{line,33}]}, {beam_type,'-module/2-lc$^0/1-0-',1, [{file,"beam_type.erl"},{line,28}]}, {beam_type,module,2,[{file,"beam_type.erl"},{line,28}]}, {compile,'-select_passes/2-anonymous-2-',2, [{file,"compile.erl"},{line,493}]}, {compile,'-internal_comp/4-anonymous-1-',2, [{file,"compile.erl"},{line,290}]}]}}} in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) in call from compile:fold_comp/3 (compile.erl, line 308) in call from compile:internal_comp/4 (compile.erl, line 292) in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) bug.erl:2: Warning: function f/2 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Mon Mar 3 09:12:08 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Mon, 3 Mar 2014 09:12:08 +0100 Subject: [erlang-bugs] Internal error in beam_block when using [] as receive timeout Message-ID: Sorry for the spam, this is the last one :). -module(bug). f() -> receive _ -> ok after [] -> timeout end. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/0 bug.erl: internal error in beam_block; crash reason: {case_clause, {'EXIT', {function_clause, [{beam_utils,live_opt, [[{wait_timeout,{f,5},nil}, {label,6}, return, {block, [{set,[],[],remove_message}, {set,[{x,0}],[{atom,ok}],move}]}, {loop_rec,{f,6},{x,0}}, {label,5}, {line,[{location,"bug.erl",2}]}, {label,2}], 0, {1,{1,0,nil,nil}}, [timeout, {block, [{'%live',0}, {set,[{x,0}],[{atom,timeout}],move}, {'%live',1}]}, return]], [{file,"beam_utils.erl"},{line,645}]}, {beam_utils,live_opt,1,[{file,"beam_utils.erl"},{line,207}]}, {beam_block,function,2,[{file,"beam_block.erl"},{line,38}]}, {lists,mapfoldl,3,[{file,"lists.erl"},{line,1352}]}, {beam_block,module,2,[{file,"beam_block.erl"},{line,29}]}, {compile,'-select_passes/2-anonymous-2-',2, [{file,"compile.erl"},{line,493}]}, {compile,'-internal_comp/4-anonymous-1-',2, [{file,"compile.erl"},{line,290}]}, {compile,fold_comp,3,[{file,"compile.erl"},{line,308}]}]}}} in function io_lib_pretty:cind_tag_tuple/7 (io_lib_pretty.erl, line 638) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) bug.erl:2: Warning: function f/0 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Mon Mar 3 09:18:34 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Mon, 3 Mar 2014 09:18:34 +0100 Subject: [erlang-bugs] Internal error in beam_block when using [] as receive timeout In-Reply-To: References: Message-ID: There would be less reports from you if you released your toys? -- Anthony Ramine Le 3 mars 2014 ? 09:12, Ulf Norell a ?crit : > Sorry for the spam, this is the last one :). > From Ingela.Anderton.Andin@REDACTED Mon Mar 3 09:57:00 2014 From: Ingela.Anderton.Andin@REDACTED (Ingela Anderton Andin) Date: Mon, 3 Mar 2014 09:57:00 +0100 Subject: [erlang-bugs] Type errors in ssl application since OTP 17.0-rc2 In-Reply-To: <20140302214200.GA30713@molb.org> References: <20140302214200.GA30713@molb.org> Message-ID: <531443DC.4010406@ericsson.com> Hi! Thank you for reporting this. The thing is that the DTLS-code is not finished, we had planed to finish it for R17 but other things came up, so that we alas did not have had time to complete it yet. But I am working now with cleaning it up a little to avoid all dialyzer warnings. The reason for it being there (unfinished) is that we are phasing it in and refactoring the TLS code all the time to be able to reuse as much code as possible for DTLS. Regards Ingela Erlang/OTP team - Ericsson AB On 03/02/2014 10:42 PM, Johannes Wei?l wrote: > Hello, > > we noticed dialyzer warnings in our application with OTP 17.0-rc2. > Through "git bisect" I could determine the commit which made the error > apparent: > > 48c3778 Ingela Anderton Andin Fri Feb 14 17:08:14 2014 +0100 > ssl: Fix possible mismatch between SSL/TLS version and default ciphers > > I attached a small example (ssl_bug.erl), it can be compiled and run > like this: > > erlc ssl_bug.erl > erl -noshell -s ssl_bug listen no_use_ssl -s init stop > erl -noshell -s ssl_bug listen use_ssl -s init stop > > Although the program seems correct, dialyzer throws a warning: > > dialyzer --build_plt --apps erts kernel stdlib mnesia compiler asn1 \ > syntax_tools hipe crypto public_key ssl > dialyzer ssl_bug.erl > ssl_bug.erl:30: The call ssl:sockname(Socket::port()) will never return since the success typing is ({'sslsocket',_,pid() | {port(),{'config',_,_,_,_,{_,_,_,_},_}}}) -> any() and the contract is (#sslsocket{}) -> {'ok',{inet:ip_address(),inet:port_number()}} | {'error',reason()} > > There are multiple type issues in the ssl application, which could be > responsible for this, e.g.: > dtls_handshake.erl:57: The call dtls_record:highest_protocol_version(Versions::'undefined' | ['dtlsv1' | 'dtlsv1.2' | 'sslv3' | 'tlsv1' | 'tlsv1.1' | 'tlsv1.2']) will never return since the success typing is ([any(),...]) -> any() and the contract is ([tls_version()]) -> tls_version() > (tls_version() is {integer(), integer()}) > > Regards, > Johannes Wei?l > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > From n.oxyde@REDACTED Mon Mar 3 10:15:48 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Mon, 3 Mar 2014 10:15:48 +0100 Subject: [erlang-bugs] Internal error in beam_dead when using maps in guards In-Reply-To: References: Message-ID: This one is due to beam_bool not seeing that {f,6} is used in a put_map instruction in the block preceding the one it is trying to optimise. I have a fix but IRL work is calling me, will submit it later. -- Anthony Ramine Le 3 mars 2014 ? 08:41, Ulf Norell a ?crit : > Replacing the map #{} makes the error go away. > > -module(bug). > f() when is_map(#{}); false -> ok. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function f/0 refers to undefined label 6 > bug.erl: internal error in beam_dead; > crash reason: {case_clause,{'EXIT',{undefined_label,6}}} > > in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) > in call from compile:fold_comp/3 (compile.erl, line 308) > in call from compile:internal_comp/4 (compile.erl, line 292) > in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) > bug.erl:2: Warning: function f/0 is unused > error > > / Ulf > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From tony@REDACTED Mon Mar 3 11:37:34 2014 From: tony@REDACTED (Tony Rogvall) Date: Mon, 3 Mar 2014 11:37:34 +0100 Subject: [erlang-bugs] Internal error in beam_dead when using maps in guards In-Reply-To: References: Message-ID: <6F6CE5D1-D457-454D-B846-D7AB0AF445F2@rogvall.se> Keep them coming! ;-) I guess Ericsson could buy a copy of quickcheck and get some nice tests to replicate what you are doing ? Pretty cool stuff! /Tony On 3 mar 2014, at 08:41, Ulf Norell wrote: > Replacing the map #{} makes the error go away. > > -module(bug). > f() when is_map(#{}); false -> ok. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function f/0 refers to undefined label 6 > bug.erl: internal error in beam_dead; > crash reason: {case_clause,{'EXIT',{undefined_label,6}}} > > in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) > in call from compile:fold_comp/3 (compile.erl, line 308) > in call from compile:internal_comp/4 (compile.erl, line 292) > in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) > bug.erl:2: Warning: function f/0 is unused > error > > / Ulf > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs "Installing applications can lead to corruption over time. Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix" -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Mon Mar 3 14:13:27 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Mon, 3 Mar 2014 14:13:27 +0100 Subject: [erlang-bugs] Internal error in beam_dead when using maps in guards In-Reply-To: References: Message-ID: https://github.com/erlang/otp/pull/260 -- Anthony Ramine Le 3 mars 2014 ? 10:15, Anthony Ramine a ?crit : > This one is due to beam_bool not seeing that {f,6} is used in a put_map instruction in the block preceding the one it is trying to optimise. > > I have a fix but IRL work is calling me, will submit it later. > > -- > Anthony Ramine > > Le 3 mars 2014 ? 08:41, Ulf Norell a ?crit : > >> Replacing the map #{} makes the error go away. >> >> -module(bug). >> f() when is_map(#{}); false -> ok. >> >> $ erl >> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V6.0 (abort with ^G) >> 1> c(bug). >> Function f/0 refers to undefined label 6 >> bug.erl: internal error in beam_dead; >> crash reason: {case_clause,{'EXIT',{undefined_label,6}}} >> >> in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) >> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) >> in call from compile:fold_comp/3 (compile.erl, line 308) >> in call from compile:internal_comp/4 (compile.erl, line 292) >> in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) >> bug.erl:2: Warning: function f/0 is unused >> error >> >> / Ulf >> _______________________________________________ >> erlang-bugs mailing list >> erlang-bugs@REDACTED >> http://erlang.org/mailman/listinfo/erlang-bugs > From ttom.kelly@REDACTED Mon Mar 3 16:37:31 2014 From: ttom.kelly@REDACTED (tom kelly) Date: Mon, 3 Mar 2014 15:37:31 +0000 Subject: [erlang-bugs] Missing compile warning In-Reply-To: References: Message-ID: Hi List, You've probably seen this on the questions mailing list, just re-posting here to follow the bug reporting guidelines: -module(no_warn). -compile(export_all). -record(my_rec,{field1, field2}). my_function1(#my_rec{field1 = {tag, _}, field2 = f2}) -> 1; my_function1(#my_rec{field1 = {tag, 1}, field2 = f2}) -> 2; % line 7 my_function1(_) -> 3. my_function2(#my_rec{field1 = {tag, _}}) -> 1; my_function2(#my_rec{field1 = {tag, 1}}) -> 2; % line11 my_function2(_) -> 3. When compiled on R16B03-1 this gives the output: no_warn.erl:11: Warning: this clause cannot match because a previous clause at line 10 always matches Ie. we are correctly warned about line 11 but not about line 7. //TTom. -------------- next part -------------- An HTML attachment was scrubbed... URL: From prof3ta@REDACTED Mon Mar 3 21:36:14 2014 From: prof3ta@REDACTED (Roberto Aloi) Date: Mon, 3 Mar 2014 21:36:14 +0100 Subject: [erlang-bugs] Missing compile warning In-Reply-To: References: Message-ID: In case someone decides to have a look to this in more detail, a minimal example follows. A warning is raised for 'baz', but not for 'bar'. -module(foo). -export([bar/1, baz/1]). bar({_,1}) -> ok; bar({1,1}) -> ok. baz({1,_}) -> ok; baz({1,1}) -> ok. KR, Roberto On Mon, Mar 3, 2014 at 4:37 PM, tom kelly wrote: > Hi List, > > You've probably seen this on the questions mailing list, just re-posting > here to follow the bug reporting guidelines: > > > -module(no_warn). > -compile(export_all). > > -record(my_rec,{field1, field2}). > > my_function1(#my_rec{field1 = {tag, _}, field2 = f2}) -> 1; > my_function1(#my_rec{field1 = {tag, 1}, field2 = f2}) -> 2; % line 7 > my_function1(_) -> 3. > > my_function2(#my_rec{field1 = {tag, _}}) -> 1; > my_function2(#my_rec{field1 = {tag, 1}}) -> 2; % line11 > my_function2(_) -> 3. > > When compiled on R16B03-1 this gives the output: > > no_warn.erl:11: Warning: this clause cannot match because a previous > clause at line 10 always matches > > Ie. we are correctly warned about line 11 but not about line 7. > > //TTom. > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > > -- Roberto Aloi --- Website: http://roberto-aloi.com Twitter: @robertoaloi -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Tue Mar 4 02:10:21 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 4 Mar 2014 02:10:21 +0100 Subject: [erlang-bugs] Internal error in beam_bool when calling obsolete erlang:float/1 in guard In-Reply-To: References: Message-ID: <0022C649-5386-49A9-B03C-59DE40A3905C@gmail.com> https://github.com/erlang/otp/pull/261 -- Anthony Ramine Le 3 mars 2014 ? 09:04, Ulf Norell a ?crit : > -module(bug). > f() when erlang:float(self()); true -> ok. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/0 > bug.erl: internal error in beam_bool; > crash reason: {case_clause, > {'EXIT', > {{badmatch, > {[{set,[{tmp,0}],[],{bif,self,{f,6}}}, > {set,[{tmp,1}],[{tmp,0}],{alloc,1,{gc_bif,float,{f,6}}}}], > []}}, > [{beam_bool,bopt_tree,3,[{file,"beam_bool.erl"},{line,394}]}, > {beam_bool,bopt_tree_cg,3,[{file,"beam_bool.erl"},{line,360}]}, > {beam_bool,bopt_block,5,[{file,"beam_bool.erl"},{line,115}]}, > {beam_bool,bopt,3,[{file,"beam_bool.erl"},{line,76}]}, > {beam_bool,function,2,[{file,"beam_bool.erl"},{line,57}]}, > {lists,mapfoldl,3,[{file,"lists.erl"},{line,1352}]}, > {beam_bool,module,2,[{file,"beam_bool.erl"},{line,36}]}, > {compile,'-select_passes/2-anonymous-2-',2, > [{file,"compile.erl"},{line,493}]}]}}} > > in function io_lib_pretty:cind_tag_tuple/7 (io_lib_pretty.erl, line 638) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > in call from io_lib_pretty:cind_tail/8 (io_lib_pretty.erl, line 710) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > bug.erl:2: Warning: function f/0 is unused > error > > / Ulf > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Tue Mar 4 02:20:36 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 4 Mar 2014 02:20:36 +0100 Subject: [erlang-bugs] Internal error in beam_block when using [] as receive timeout In-Reply-To: References: Message-ID: A smaller sample is: f() -> receive after [] -> timeout end. This should probably be forbidden by both erl_lint and core_lint. -- Anthony Ramine Le 3 mars 2014 ? 09:12, Ulf Norell a ?crit : > Sorry for the spam, this is the last one :). > > -module(bug). > f() -> receive _ -> ok after [] -> timeout end. > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/0 > bug.erl: internal error in beam_block; > crash reason: {case_clause, > {'EXIT', > {function_clause, > [{beam_utils,live_opt, > [[{wait_timeout,{f,5},nil}, > {label,6}, > return, > {block, > [{set,[],[],remove_message}, > {set,[{x,0}],[{atom,ok}],move}]}, > {loop_rec,{f,6},{x,0}}, > {label,5}, > {line,[{location,"bug.erl",2}]}, > {label,2}], > 0, > {1,{1,0,nil,nil}}, > [timeout, > {block, > [{'%live',0}, > {set,[{x,0}],[{atom,timeout}],move}, > {'%live',1}]}, > return]], > [{file,"beam_utils.erl"},{line,645}]}, > {beam_utils,live_opt,1,[{file,"beam_utils.erl"},{line,207}]}, > {beam_block,function,2,[{file,"beam_block.erl"},{line,38}]}, > {lists,mapfoldl,3,[{file,"lists.erl"},{line,1352}]}, > {beam_block,module,2,[{file,"beam_block.erl"},{line,29}]}, > {compile,'-select_passes/2-anonymous-2-',2, > [{file,"compile.erl"},{line,493}]}, > {compile,'-internal_comp/4-anonymous-1-',2, > [{file,"compile.erl"},{line,290}]}, > {compile,fold_comp,3,[{file,"compile.erl"},{line,308}]}]}}} > > in function io_lib_pretty:cind_tag_tuple/7 (io_lib_pretty.erl, line 638) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > bug.erl:2: Warning: function f/0 is unused > error > > / Ulf > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Tue Mar 4 02:37:12 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 4 Mar 2014 02:37:12 +0100 Subject: [erlang-bugs] Internal error in beam_block when using [] as receive timeout In-Reply-To: References: Message-ID: https://github.com/erlang/otp/pull/262 -- Anthony Ramine Le 4 mars 2014 ? 02:20, Anthony Ramine a ?crit : > A smaller sample is: > > f() -> receive after [] -> timeout end. > > This should probably be forbidden by both erl_lint and core_lint. > > -- > Anthony Ramine > > Le 3 mars 2014 ? 09:12, Ulf Norell a ?crit : > >> Sorry for the spam, this is the last one :). >> >> -module(bug). >> f() -> receive _ -> ok after [] -> timeout end. >> $ erl >> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V6.0 (abort with ^G) >> 1> c(bug). >> Function: f/0 >> bug.erl: internal error in beam_block; >> crash reason: {case_clause, >> {'EXIT', >> {function_clause, >> [{beam_utils,live_opt, >> [[{wait_timeout,{f,5},nil}, >> {label,6}, >> return, >> {block, >> [{set,[],[],remove_message}, >> {set,[{x,0}],[{atom,ok}],move}]}, >> {loop_rec,{f,6},{x,0}}, >> {label,5}, >> {line,[{location,"bug.erl",2}]}, >> {label,2}], >> 0, >> {1,{1,0,nil,nil}}, >> [timeout, >> {block, >> [{'%live',0}, >> {set,[{x,0}],[{atom,timeout}],move}, >> {'%live',1}]}, >> return]], >> [{file,"beam_utils.erl"},{line,645}]}, >> {beam_utils,live_opt,1,[{file,"beam_utils.erl"},{line,207}]}, >> {beam_block,function,2,[{file,"beam_block.erl"},{line,38}]}, >> {lists,mapfoldl,3,[{file,"lists.erl"},{line,1352}]}, >> {beam_block,module,2,[{file,"beam_block.erl"},{line,29}]}, >> {compile,'-select_passes/2-anonymous-2-',2, >> [{file,"compile.erl"},{line,493}]}, >> {compile,'-internal_comp/4-anonymous-1-',2, >> [{file,"compile.erl"},{line,290}]}, >> {compile,fold_comp,3,[{file,"compile.erl"},{line,308}]}]}}} >> >> in function io_lib_pretty:cind_tag_tuple/7 (io_lib_pretty.erl, line 638) >> in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) >> in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) >> in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) >> in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) >> in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) >> in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) >> in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) >> bug.erl:2: Warning: function f/0 is unused >> error >> >> / Ulf >> _______________________________________________ >> erlang-bugs mailing list >> erlang-bugs@REDACTED >> http://erlang.org/mailman/listinfo/erlang-bugs > From vinoski@REDACTED Tue Mar 4 02:48:32 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Mon, 3 Mar 2014 20:48:32 -0500 Subject: [erlang-bugs] OS X Mavericks prim_inet:recv0 delays Message-ID: My Basho colleague Reid Draper recently encountered a strange problem with RiakCS on OS X Mavericks (at least versions 10.9.1 and 10.9.2) where there are intermittent multi-second delays when receiving data. It does not occur on OS X versions 10.8.x or older. RiakCS uses Mochiweb internally, but I've also reproduced the problem with Yaws. It usually happens with transfers of 10k bytes or more but I've seen it with transfers as small as 1k as well. It occurs with all recent versions of Erlang that build easily on Mavericks, starting with R15B03 up to and including 17-rc2. I've also tried building Erlang with gcc instead of clang, but it happens either way. Reid tried to reproduce the issue with non-Erlang approaches including python and netcat, and did not succeed in reproducing the problem. I haven't been able to create a small Erlang test case that exhibits the problem, so I've included a script below that clones the Yaws repo, builds it, and runs an interactive Yaws instance. To see the problem for yourself, run the script, then when Yaws comes up, you'll be in an Erlang shell where you can turn on dbg tracing and run a Yaws test as shown below: dbg:tracer(), dbg:p(all,[call,timestamp,return_to]). dbg:tpl(prim_inet,recv0,[]). app_test:start([flush_large_post]). The test might pass or it might fail, depending on how many transfer delays occur. But either way, if you look at the dbg trace output, you'll likely see cases where there are delays of multiples of 5 seconds within prim_inet:recv0. For example, in the output below we see two consecutive delays of 5 seconds within two prim_inet:recv0 calls: (<0.83.0>) call prim_inet:recv0(#Port<0.1399>,2048000,10000) (Timestamp: {1393, 896101, 405228}) (<0.83.0>) returning to yaws:cli_recv/3 (Timestamp: {1393,896106,516602}) (<0.83.0>) call prim_inet:recv0(#Port<0.1399>,2048000,10000) (Timestamp: {1393, 896106, 521473}) (<0.83.0>) returning to yaws_server:flush/5 (Timestamp: {1393,896111,827620}) The delays here are roughly 5 seconds each, but I've seen delays of 10, 15, 25, and 30 seconds as well -- always around a multiple of 5. The script for setting up Yaws for the test case is below (note that the script will remove any directory named "yaws" in the current working directory). If you have any questions about the problem, issues with the test script, or if there are more details you'd like me to try to collect, let me know. --steve #!/bin/bash set -e [[ -d yaws ]] && rm -rf yaws git clone https://github.com/klacke/yaws.git cd yaws autoconf ./configure ul=$(ulimit -n) (( $ul < 1024 )) && ulimit -n 1024 make all cd test make all cd t2 set +e make setup test yawspid=$(ps xa | grep yaw'[s]' | awk '{print $1}') [[ -n "$yawspid" ]] && kill $yawspid exec ../../bin/yaws -i --conf yaws.conf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Tue Mar 4 09:17:11 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Tue, 4 Mar 2014 09:17:11 +0100 Subject: [erlang-bugs] Internal error in v3_codegen when using [] as map key Message-ID: I started generating map expressions in the program generator. First of many: -module(bug). f() -> #{[] => 0, a => 1}. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/0 bug.erl: internal error in v3_codegen; crash reason: {case_clause,{'EXIT',{{case_clause,{{{atom,a},{integer,1}},{nil,{integer,0}}}}, [{v3_codegen,'-map_pair_strip_and_termsort/1-anonymous-1-', 2, [{file,"v3_codegen.erl"},{line,1554}]}, {lists,sort,2,[{file,"lists.erl"},{line,967}]}, {v3_codegen,set_cg,6, [{file,"v3_codegen.erl"},{line,1522}]}, {v3_codegen,'-cg_list/5-anonymous-0-',3, [{file,"v3_codegen.erl"},{line,190}]}, {v3_codegen,flatmapfoldl,3, [{file,"v3_codegen.erl"},{line,2161}]}, {v3_codegen,cg_list,5, [{file,"v3_codegen.erl"},{line,189}]}, {v3_codegen,cg_block,5, [{file,"v3_codegen.erl"},{line,437}]}, {v3_codegen,block_cg,4, [{file,"v3_codegen.erl"},{line,422}]}]}}} in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) in call from compile:fold_comp/3 (compile.erl, line 308) in call from compile:internal_comp/4 (compile.erl, line 292) in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) bug.erl:2: Warning: function f/0 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Tue Mar 4 09:22:56 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Tue, 4 Mar 2014 09:22:56 +0100 Subject: [erlang-bugs] Internal error in v3_core when using fun as map value Message-ID: -module(bug). f() -> #{a => fun() -> ok end}#{a := false}. I get a very similar error for this program: -module(also_bug). f() -> fun() -> 0 end#{}. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). bug.erl: internal error in core_module; crash reason: function_clause in function v3_core:expr/2 called as v3_core:expr({'fun',2,{clauses,[{clause,2,[],[],[{atom,2,ok}]}]}}, {core,0,0,false,true,[report_errors,report_warnings],[],[{file,"bug.erl"}]}) in call from v3_core:safe/2 (v3_core.erl, line 1407) in call from v3_core:'-map_pair_list/2-anonymous-0-'/2 (v3_core.erl, line 720) in call from v3_core:expr/2 (v3_core.erl, line 499) in call from v3_core:safe/2 (v3_core.erl, line 1407) in call from v3_core:expr/2 (v3_core.erl, line 503) in call from v3_core:exprs/2 (v3_core.erl, line 467) in call from v3_core:clause/2 (v3_core.erl, line 209) bug.erl:2: Warning: function f/0 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Tue Mar 4 09:26:27 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Tue, 4 Mar 2014 09:26:27 +0100 Subject: [erlang-bugs] Internal error in beam_dead when updating map created by bif Message-ID: It doesn't seem to matter which bif is called. -module(bug). f(X) -> (binary_to_term(X))#{x => 0}. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function f/1 refers to undefined label 5 bug.erl: internal error in beam_dead; crash reason: {case_clause,{'EXIT',{undefined_label,5}}} in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) in call from compile:fold_comp/3 (compile.erl, line 308) in call from compile:internal_comp/4 (compile.erl, line 292) in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) bug.erl:2: Warning: function f/1 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Tue Mar 4 09:29:36 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Tue, 4 Mar 2014 09:29:36 +0100 Subject: [erlang-bugs] Internal error in v3_kernel when doing map update on non-map Message-ID: -module(bug). f(X) -> [a, X]#{a => x}. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/1 bug.erl: internal error in kernel_module; crash reason: {badmatch,{{k_cons,[2,{file,"bug.erl"}], {k_atom,[2,{file,"bug.erl"}],a}, {k_var,[],ker0}}, [{iset,[], [{k_var,[],ker0}], {k_cons,[2,{file,"bug.erl"}], {k_var,[2,{file,"bug.erl"}],cor0}, {k_nil,[2,{file,"bug.erl"}]}}, undefined}], {kern,{f,1}, {f,1}, 1,0, {set,1,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, {{[cor0],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}}, [],[],[],0}}} in function v3_kernel:expr/3 (v3_kernel.erl, line 276) in call from v3_kernel:expr/3 (v3_kernel.erl, line 307) in call from v3_kernel:function/2 (v3_kernel.erl, line 152) in call from lists:mapfoldl/3 (lists.erl, line 1352) in call from v3_kernel:module/2 (v3_kernel.erl, line 130) in call from compile:kernel_module/1 (compile.erl, line 1191) in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) in call from compile:fold_comp/3 (compile.erl, line 308) bug.erl:2: Warning: function f/1 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Tue Mar 4 09:32:46 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Tue, 4 Mar 2014 09:32:46 +0100 Subject: [erlang-bugs] Internal error in v3_life when mixing := and => Message-ID: -module(bug). f(M, X) -> M#{a := ok, b => {X}}. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/2 bug.erl: internal error in v3_life; crash reason: {case_clause, {'EXIT', {function_clause, [{v3_life,vdb_store_new, [ker0,4,4,[{ker0,2,3},{ker1,3,3}]], [{file,"v3_life.erl"},{line,501}]}, {v3_life,vdb_store_new,4,[{file,"v3_life.erl"},{line,502}]}, {v3_life,vdb_store_new,4,[{file,"v3_life.erl"},{line,502}]}, {lists,foldl,3,[{file,"lists.erl"},{line,1261}]}, {v3_life,body,3,[{file,"v3_life.erl"},{line,442}]}, {v3_life,body,3,[{file,"v3_life.erl"},{line,98}]}, {v3_life,match,5,[{file,"v3_life.erl"},{line,280}]}, {v3_life,expr,3,[{file,"v3_life.erl"},{line,133}]}]}}} in function io_lib_pretty:cind_tag_tuple/7 (io_lib_pretty.erl, line 638) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) bug.erl:2: Warning: function f/2 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Tue Mar 4 09:38:56 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Tue, 4 Mar 2014 09:38:56 +0100 Subject: [erlang-bugs] Internal error in v3_kernel when using funny map keys Message-ID: -module(bug). f() -> #{[try a after b end] => 0}. -module(bug). f() -> ok. g() -> #{fun f/0 => 0}. -module(bug). f() -> ok. g() -> #{{f()} => 0}. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/0 bug.erl: internal error in kernel_module; crash reason: function_clause in function v3_kernel:map_key_clean/1 called as v3_kernel:map_key_clean({k_cons,[2,{file,"bug.erl"}],{k_var,[],cor4},{k_nil,[2,{file,"bug.erl"}]}}) in call from v3_kernel:map_group_pairs/2 (v3_kernel.erl, line 553) in call from v3_kernel:map_group_pairs/1 (v3_kernel.erl, line 529) in call from v3_kernel:map_split_pairs/5 (v3_kernel.erl, line 511) in call from v3_kernel:expr/3 (v3_kernel.erl, line 327) in call from v3_kernel:expr/3 (v3_kernel.erl, line 307) in call from v3_kernel:function/2 (v3_kernel.erl, line 152) in call from lists:mapfoldl/3 (lists.erl, line 1352) bug.erl:2: Warning: function f/0 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Tue Mar 4 09:42:08 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Tue, 4 Mar 2014 09:42:08 +0100 Subject: [erlang-bugs] Internal error in sys_core_fold when matching on map is guaranteed to fail Message-ID: -module(bug). f() -> case maybe_map of #{} -> ok; not_map -> error end. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/0 bug.erl: internal error in core_fold_module; crash reason: {case_clause,{none}} in function sys_core_fold:will_match/2 (sys_core_fold.erl, line 1748) in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1701) in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1718) in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481) in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699) in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) bug.erl:2: Warning: function f/0 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Tue Mar 4 09:45:13 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Tue, 4 Mar 2014 09:45:13 +0100 Subject: [erlang-bugs] Internal error in sys_core_fold when matching on map is guaranteed to fail In-Reply-To: References: Message-ID: This one crashes in a different place but likely for the same reason. -module(bug). f() -> case true of #{} -> error; true -> ok end. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/0 bug.erl: internal error in core_fold_module; crash reason: function_clause in function sys_core_fold:opt_bool_clauses/3 called as sys_core_fold:opt_bool_clauses([],true,false) in call from sys_core_fold:opt_bool_clauses/3 (sys_core_fold.erl, line 1815) in call from sys_core_fold:opt_bool_clauses/1 (sys_core_fold.erl, line 1790) in call from sys_core_fold:opt_bool_case/1 (sys_core_fold.erl, line 1779) in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 347) in call from sys_core_fold:opt_simple_let_1/4 (sys_core_fold.erl, line 2562) in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 355) in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) bug.erl:2: Warning: function f/0 is unused error / Ulf On Tue, Mar 4, 2014 at 9:42 AM, Ulf Norell wrote: > -module(bug). > f() -> > case maybe_map of > #{} -> ok; > not_map -> error > end. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] > [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/0 > bug.erl: internal error in core_fold_module; > crash reason: {case_clause,{none}} > > in function sys_core_fold:will_match/2 (sys_core_fold.erl, line 1748) > in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1701) > in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1718) > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481) > in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699) > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > bug.erl:2: Warning: function f/0 is unused > error > > / Ulf > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Tue Mar 4 09:51:17 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Tue, 4 Mar 2014 09:51:17 +0100 Subject: [erlang-bugs] Internal error in beam_jump when using guards after a map pattern Message-ID: -module(bug). f(#{a := 0}) when #{} == #{}; true -> ok. Same error for this: -module(also_bug). f(#{a := 0}) when true; map_size(0) -> ok. There seems to be a general problem with complex guards under map patterns. I ended up disabling all guards after a match on a map in the program generator. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/1 bug.erl: internal error in beam_bool; crash reason: {case_clause,{'EXIT',{{case_clause,{get_map_elements,{f,5}}}, [{beam_jump,is_label_used_in_2,2, [{file,"beam_jump.erl"},{line,446}]}, {lists,any,2,[{file,"lists.erl"},{line,1223}]}, {beam_jump,is_label_used_in_1,3, [{file,"beam_jump.erl"},{line,438}]}, {beam_bool,split_block,5, [{file,"beam_bool.erl"},{line,278}]}, {beam_bool,bopt,3,[{file,"beam_bool.erl"},{line,64}]}, {beam_bool,function,2, [{file,"beam_bool.erl"},{line,57}]}, {lists,mapfoldl,3,[{file,"lists.erl"},{line,1352}]}, {beam_bool,module,2, [{file,"beam_bool.erl"},{line,36}]}]}}} in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) in call from compile:fold_comp/3 (compile.erl, line 308) in call from compile:internal_comp/4 (compile.erl, line 292) in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) bug.erl:2: Warning: function f/1 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Tue Mar 4 09:54:52 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Tue, 4 Mar 2014 09:54:52 +0100 Subject: [erlang-bugs] Internal error in core_lib when using map as map key in pattern Message-ID: This is the last one for now :) -module(bug). f(#{#{} := _}) -> ok. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). bug.erl: internal error in core_module; crash reason: function_clause in function core_lib:literal_value/1 called as core_lib:literal_value({c_map,[2,{file,"bug.erl"}],{c_literal,[],[]},[]}) in call from v3_core:'-pattern_map_pairs/2-anonymous-0-'/3 (v3_core.erl, line 1497) in call from lists:mapfoldl/3 (lists.erl, line 1352) in call from v3_core:pattern_map_pairs/2 (v3_core.erl, line 1494) in call from v3_core:pattern/2 (v3_core.erl, line 1482) in call from v3_core:'-pattern_list/2-lc$^0/1-0-'/2 (v3_core.erl, line 1600) in call from v3_core:clause/2 (v3_core.erl, line 206) in call from v3_core:clauses/2 (v3_core.erl, line 197) bug.erl:2: Warning: function f/1 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Tue Mar 4 14:20:36 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Tue, 4 Mar 2014 14:20:36 +0100 Subject: [erlang-bugs] Internal error in sys_core_fold when using repeated keys in map pattern Message-ID: -module(bug). f(X) -> [[#{a := _, a := _}] = [X]]. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-2fbbc2f] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/1 bug.erl: internal error in core_fold_module; crash reason: function_clause in function sys_core_fold:expr/3 called as sys_core_fold:expr({c_alias,[],{c_var,[],cor4},{c_var,[],cor5}}, value, {sub,[],{4,{cor0,{'X',nil,nil},{cor4,nil,{cor5,nil,nil}}}},[],false}) in call from sys_core_fold:pair/3 (sys_core_fold.erl, line 437) in call from sys_core_fold:pair_list/3 (sys_core_fold.erl, line 431) in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 250) in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 231) in call from sys_core_fold:opt_simple_let/3 (sys_core_fold.erl, line 2549) in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481) in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699) bug.erl:2: Warning: function f/1 is unused error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Tue Mar 4 20:34:41 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 4 Mar 2014 20:34:41 +0100 Subject: [erlang-bugs] Internal error in v3_codegen when using [] as map key In-Reply-To: References: Message-ID: <3FD1173F-72FD-4E08-A3EA-FB053C94A65C@gmail.com> https://github.com/erlang/otp/pull/263 -- Anthony Ramine Le 4 mars 2014 ? 09:17, Ulf Norell a ?crit : > I started generating map expressions in the program generator. First of many: > > -module(bug). > f() -> #{[] => 0, a => 1}. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/0 > bug.erl: internal error in v3_codegen; > crash reason: {case_clause,{'EXIT',{{case_clause,{{{atom,a},{integer,1}},{nil,{integer,0}}}}, > [{v3_codegen,'-map_pair_strip_and_termsort/1-anonymous-1-', > 2, > [{file,"v3_codegen.erl"},{line,1554}]}, > {lists,sort,2,[{file,"lists.erl"},{line,967}]}, > {v3_codegen,set_cg,6, > [{file,"v3_codegen.erl"},{line,1522}]}, > {v3_codegen,'-cg_list/5-anonymous-0-',3, > [{file,"v3_codegen.erl"},{line,190}]}, > {v3_codegen,flatmapfoldl,3, > [{file,"v3_codegen.erl"},{line,2161}]}, > {v3_codegen,cg_list,5, > [{file,"v3_codegen.erl"},{line,189}]}, > {v3_codegen,cg_block,5, > [{file,"v3_codegen.erl"},{line,437}]}, > {v3_codegen,block_cg,4, > [{file,"v3_codegen.erl"},{line,422}]}]}}} > > in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) > in call from compile:fold_comp/3 (compile.erl, line 308) > in call from compile:internal_comp/4 (compile.erl, line 292) > in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) > bug.erl:2: Warning: function f/0 is unused > error > > / Ulf > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Tue Mar 4 20:42:23 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 4 Mar 2014 20:42:23 +0100 Subject: [erlang-bugs] Internal error in v3_core when using fun as map value In-Reply-To: References: Message-ID: <376AB39C-F693-40BF-A970-C7C3B5CEE841@gmail.com> Both fixed in 2e5457c71e7c125b3d603e04575648b7afa1b54a. -- Anthony Ramine Le 4 mars 2014 ? 09:22, Ulf Norell a ?crit : > -module(bug). > f() -> #{a => fun() -> ok end}#{a := false}. > > I get a very similar error for this program: > > -module(also_bug). > f() -> fun() -> 0 end#{}. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > bug.erl: internal error in core_module; > crash reason: function_clause > > in function v3_core:expr/2 > called as v3_core:expr({'fun',2,{clauses,[{clause,2,[],[],[{atom,2,ok}]}]}}, > {core,0,0,false,true,[report_errors,report_warnings],[],[{file,"bug.erl"}]}) > in call from v3_core:safe/2 (v3_core.erl, line 1407) > in call from v3_core:'-map_pair_list/2-anonymous-0-'/2 (v3_core.erl, line 720) > in call from v3_core:expr/2 (v3_core.erl, line 499) > in call from v3_core:safe/2 (v3_core.erl, line 1407) > in call from v3_core:expr/2 (v3_core.erl, line 503) > in call from v3_core:exprs/2 (v3_core.erl, line 467) > in call from v3_core:clause/2 (v3_core.erl, line 209) > bug.erl:2: Warning: function f/0 is unused > error > > / Ulf > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Tue Mar 4 20:43:31 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 4 Mar 2014 20:43:31 +0100 Subject: [erlang-bugs] Internal error in beam_dead when updating map created by bif In-Reply-To: References: Message-ID: Fixed in 2e5457c71e7c125b3d603e04575648b7afa1b54a. -- Anthony Ramine Le 4 mars 2014 ? 09:26, Ulf Norell a ?crit : > It doesn't seem to matter which bif is called. > > -module(bug). > f(X) -> (binary_to_term(X))#{x => 0}. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function f/1 refers to undefined label 5 > bug.erl: internal error in beam_dead; > crash reason: {case_clause,{'EXIT',{undefined_label,5}}} > > in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) > in call from compile:fold_comp/3 (compile.erl, line 308) > in call from compile:internal_comp/4 (compile.erl, line 292) > in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) > bug.erl:2: Warning: function f/1 is unused > error > > / Ulf > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Tue Mar 4 21:42:06 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 4 Mar 2014 21:42:06 +0100 Subject: [erlang-bugs] Internal error in v3_kernel when doing map update on non-map In-Reply-To: References: Message-ID: <0C95360A-53FF-4FF1-BB4B-6BB27CFAC052@gmail.com> https://github.com/erlang/otp/pull/264 -- Anthony Ramine Le 4 mars 2014 ? 09:29, Ulf Norell a ?crit : > -module(bug). > f(X) -> [a, X]#{a => x}. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/1 > bug.erl: internal error in kernel_module; > crash reason: {badmatch,{{k_cons,[2,{file,"bug.erl"}], > {k_atom,[2,{file,"bug.erl"}],a}, > {k_var,[],ker0}}, > [{iset,[], > [{k_var,[],ker0}], > {k_cons,[2,{file,"bug.erl"}], > {k_var,[2,{file,"bug.erl"}],cor0}, > {k_nil,[2,{file,"bug.erl"}]}}, > undefined}], > {kern,{f,1}, > {f,1}, > 1,0, > {set,1,16,16,8,80,48, > {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, > {{[cor0],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}}, > [],[],[],0}}} > > in function v3_kernel:expr/3 (v3_kernel.erl, line 276) > in call from v3_kernel:expr/3 (v3_kernel.erl, line 307) > in call from v3_kernel:function/2 (v3_kernel.erl, line 152) > in call from lists:mapfoldl/3 (lists.erl, line 1352) > in call from v3_kernel:module/2 (v3_kernel.erl, line 130) > in call from compile:kernel_module/1 (compile.erl, line 1191) > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) > in call from compile:fold_comp/3 (compile.erl, line 308) > bug.erl:2: Warning: function f/1 is unused > error > > / Ulf > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Tue Mar 4 22:04:22 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 4 Mar 2014 22:04:22 +0100 Subject: [erlang-bugs] Internal error in v3_life when mixing := and => In-Reply-To: References: Message-ID: <009B0F97-EAE5-4DBA-8FD9-71A35DFE31F1@gmail.com> https://github.com/erlang/otp/pull/266 -- Anthony Ramine Le 4 mars 2014 ? 09:32, Ulf Norell a ?crit : > -module(bug). > f(M, X) -> M#{a := ok, b => {X}}. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/2 > bug.erl: internal error in v3_life; > crash reason: {case_clause, > {'EXIT', > {function_clause, > [{v3_life,vdb_store_new, > [ker0,4,4,[{ker0,2,3},{ker1,3,3}]], > [{file,"v3_life.erl"},{line,501}]}, > {v3_life,vdb_store_new,4,[{file,"v3_life.erl"},{line,502}]}, > {v3_life,vdb_store_new,4,[{file,"v3_life.erl"},{line,502}]}, > {lists,foldl,3,[{file,"lists.erl"},{line,1261}]}, > {v3_life,body,3,[{file,"v3_life.erl"},{line,442}]}, > {v3_life,body,3,[{file,"v3_life.erl"},{line,98}]}, > {v3_life,match,5,[{file,"v3_life.erl"},{line,280}]}, > {v3_life,expr,3,[{file,"v3_life.erl"},{line,133}]}]}}} > > in function io_lib_pretty:cind_tag_tuple/7 (io_lib_pretty.erl, line 638) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > bug.erl:2: Warning: function f/2 is unused > error > > / Ulf > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Tue Mar 4 22:36:22 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 4 Mar 2014 22:36:22 +0100 Subject: [erlang-bugs] Internal error in v3_kernel when using funny map keys In-Reply-To: References: Message-ID: <0414C1F7-6E69-49D7-9191-AC732EE4DD4B@gmail.com> Hello Bj?rn, So if I understand you correctly as you mentioned in one of PRs, there should be a pass sitting between v3_core and v3_kernel that would normalize such keys to variables, for example, right? Meanwhile, v3_core should just emit variables for non-literals keys until that pass exists, do we agree? Regards, -- Anthony Ramine Le 4 mars 2014 ? 09:38, Ulf Norell a ?crit : > -module(bug). > f() -> #{[try a after b end] => 0}. > > -module(bug). > f() -> ok. > g() -> #{fun f/0 => 0}. > > -module(bug). > f() -> ok. > g() -> #{{f()} => 0}. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/0 > bug.erl: internal error in kernel_module; > crash reason: function_clause > > in function v3_kernel:map_key_clean/1 > called as v3_kernel:map_key_clean({k_cons,[2,{file,"bug.erl"}],{k_var,[],cor4},{k_nil,[2,{file,"bug.erl"}]}}) > in call from v3_kernel:map_group_pairs/2 (v3_kernel.erl, line 553) > in call from v3_kernel:map_group_pairs/1 (v3_kernel.erl, line 529) > in call from v3_kernel:map_split_pairs/5 (v3_kernel.erl, line 511) > in call from v3_kernel:expr/3 (v3_kernel.erl, line 327) > in call from v3_kernel:expr/3 (v3_kernel.erl, line 307) > in call from v3_kernel:function/2 (v3_kernel.erl, line 152) > in call from lists:mapfoldl/3 (lists.erl, line 1352) > bug.erl:2: Warning: function f/0 is unused > error > > / Ulf > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Tue Mar 4 22:40:00 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 4 Mar 2014 22:40:00 +0100 Subject: [erlang-bugs] Internal error in v3_kernel when using funny map keys In-Reply-To: <0414C1F7-6E69-49D7-9191-AC732EE4DD4B@gmail.com> References: <0414C1F7-6E69-49D7-9191-AC732EE4DD4B@gmail.com> Message-ID: Oh wait, nevermind, that transformation can already be done in sys_core_fold. Will do that there. -- Anthony Ramine Le 4 mars 2014 ? 22:36, Anthony Ramine a ?crit : > Hello Bj?rn, > > So if I understand you correctly as you mentioned in one of PRs, there should be a pass sitting between v3_core and v3_kernel that would normalize such keys to variables, for example, right? Meanwhile, v3_core should just emit variables for non-literals keys until that pass exists, do we agree? > > Regards, > > -- > Anthony Ramine > > Le 4 mars 2014 ? 09:38, Ulf Norell a ?crit : > >> -module(bug). >> f() -> #{[try a after b end] => 0}. >> >> -module(bug). >> f() -> ok. >> g() -> #{fun f/0 => 0}. >> >> -module(bug). >> f() -> ok. >> g() -> #{{f()} => 0}. >> >> $ erl >> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V6.0 (abort with ^G) >> 1> c(bug). >> Function: f/0 >> bug.erl: internal error in kernel_module; >> crash reason: function_clause >> >> in function v3_kernel:map_key_clean/1 >> called as v3_kernel:map_key_clean({k_cons,[2,{file,"bug.erl"}],{k_var,[],cor4},{k_nil,[2,{file,"bug.erl"}]}}) >> in call from v3_kernel:map_group_pairs/2 (v3_kernel.erl, line 553) >> in call from v3_kernel:map_group_pairs/1 (v3_kernel.erl, line 529) >> in call from v3_kernel:map_split_pairs/5 (v3_kernel.erl, line 511) >> in call from v3_kernel:expr/3 (v3_kernel.erl, line 327) >> in call from v3_kernel:expr/3 (v3_kernel.erl, line 307) >> in call from v3_kernel:function/2 (v3_kernel.erl, line 152) >> in call from lists:mapfoldl/3 (lists.erl, line 1352) >> bug.erl:2: Warning: function f/0 is unused >> error >> >> / Ulf >> >> _______________________________________________ >> erlang-bugs mailing list >> erlang-bugs@REDACTED >> http://erlang.org/mailman/listinfo/erlang-bugs > From wallentin.dahlberg@REDACTED Tue Mar 4 22:52:09 2014 From: wallentin.dahlberg@REDACTED (=?ISO-8859-1?Q?Bj=F6rn=2DEgil_Dahlberg?=) Date: Tue, 4 Mar 2014 22:52:09 +0100 Subject: [erlang-bugs] Internal error in v3_kernel when using funny map keys In-Reply-To: References: <0414C1F7-6E69-49D7-9191-AC732EE4DD4B@gmail.com> Message-ID: This has to work without core optimizations. Non literal keys, or those that can't be converted to literals, has to be rejected as non-valid expressions or patterns. At least in this stage of Maps dev with literals only key. 2014-03-04 22:40 GMT+01:00 Anthony Ramine : > Oh wait, nevermind, that transformation can already be done in > sys_core_fold. Will do that there. > > -- > Anthony Ramine > > Le 4 mars 2014 ? 22:36, Anthony Ramine a ?crit : > > > Hello Bj?rn, > > > > So if I understand you correctly as you mentioned in one of PRs, there > should be a pass sitting between v3_core and v3_kernel that would normalize > such keys to variables, for example, right? Meanwhile, v3_core should just > emit variables for non-literals keys until that pass exists, do we agree? > > > > Regards, > > > > -- > > Anthony Ramine > > > > Le 4 mars 2014 ? 09:38, Ulf Norell a ?crit : > > > >> -module(bug). > >> f() -> #{[try a after b end] => 0}. > >> > >> -module(bug). > >> f() -> ok. > >> g() -> #{fun f/0 => 0}. > >> > >> -module(bug). > >> f() -> ok. > >> g() -> #{{f()} => 0}. > >> > >> $ erl > >> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] > [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > >> > >> Eshell V6.0 (abort with ^G) > >> 1> c(bug). > >> Function: f/0 > >> bug.erl: internal error in kernel_module; > >> crash reason: function_clause > >> > >> in function v3_kernel:map_key_clean/1 > >> called as > v3_kernel:map_key_clean({k_cons,[2,{file,"bug.erl"}],{k_var,[],cor4},{k_nil,[2,{file,"bug.erl"}]}}) > >> in call from v3_kernel:map_group_pairs/2 (v3_kernel.erl, line 553) > >> in call from v3_kernel:map_group_pairs/1 (v3_kernel.erl, line 529) > >> in call from v3_kernel:map_split_pairs/5 (v3_kernel.erl, line 511) > >> in call from v3_kernel:expr/3 (v3_kernel.erl, line 327) > >> in call from v3_kernel:expr/3 (v3_kernel.erl, line 307) > >> in call from v3_kernel:function/2 (v3_kernel.erl, line 152) > >> in call from lists:mapfoldl/3 (lists.erl, line 1352) > >> bug.erl:2: Warning: function f/0 is unused > >> error > >> > >> / Ulf > >> > >> _______________________________________________ > >> erlang-bugs mailing list > >> erlang-bugs@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-bugs > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Tue Mar 4 23:10:26 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 4 Mar 2014 23:10:26 +0100 Subject: [erlang-bugs] Internal error in v3_kernel when using funny map keys In-Reply-To: References: <0414C1F7-6E69-49D7-9191-AC732EE4DD4B@gmail.com> Message-ID: Oh right, sys_core_fold is an optimisation. So just restrict map keys further in erl_lint? -- Anthony Ramine Le 4 mars 2014 ? 22:52, Bj?rn-Egil Dahlberg a ?crit : > This has to work without core optimizations. > > Non literal keys, or those that can't be converted to literals, has to be rejected as non-valid expressions or patterns. At least in this stage of Maps dev with literals only key. > > > > > 2014-03-04 22:40 GMT+01:00 Anthony Ramine : > Oh wait, nevermind, that transformation can already be done in sys_core_fold. Will do that there. > > -- > Anthony Ramine > > Le 4 mars 2014 ? 22:36, Anthony Ramine a ?crit : > > > Hello Bj?rn, > > > > So if I understand you correctly as you mentioned in one of PRs, there should be a pass sitting between v3_core and v3_kernel that would normalize such keys to variables, for example, right? Meanwhile, v3_core should just emit variables for non-literals keys until that pass exists, do we agree? > > > > Regards, > > > > -- > > Anthony Ramine > > > > Le 4 mars 2014 ? 09:38, Ulf Norell a ?crit : > > > >> -module(bug). > >> f() -> #{[try a after b end] => 0}. > >> > >> -module(bug). > >> f() -> ok. > >> g() -> #{fun f/0 => 0}. > >> > >> -module(bug). > >> f() -> ok. > >> g() -> #{{f()} => 0}. > >> > >> $ erl > >> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > >> > >> Eshell V6.0 (abort with ^G) > >> 1> c(bug). > >> Function: f/0 > >> bug.erl: internal error in kernel_module; > >> crash reason: function_clause > >> > >> in function v3_kernel:map_key_clean/1 > >> called as v3_kernel:map_key_clean({k_cons,[2,{file,"bug.erl"}],{k_var,[],cor4},{k_nil,[2,{file,"bug.erl"}]}}) > >> in call from v3_kernel:map_group_pairs/2 (v3_kernel.erl, line 553) > >> in call from v3_kernel:map_group_pairs/1 (v3_kernel.erl, line 529) > >> in call from v3_kernel:map_split_pairs/5 (v3_kernel.erl, line 511) > >> in call from v3_kernel:expr/3 (v3_kernel.erl, line 327) > >> in call from v3_kernel:expr/3 (v3_kernel.erl, line 307) > >> in call from v3_kernel:function/2 (v3_kernel.erl, line 152) > >> in call from lists:mapfoldl/3 (lists.erl, line 1352) > >> bug.erl:2: Warning: function f/0 is unused > >> error > >> > >> / Ulf > >> > >> _______________________________________________ > >> erlang-bugs mailing list > >> erlang-bugs@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-bugs > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > From wallentin.dahlberg@REDACTED Tue Mar 4 23:37:44 2014 From: wallentin.dahlberg@REDACTED (=?ISO-8859-1?Q?Bj=F6rn=2DEgil_Dahlberg?=) Date: Tue, 4 Mar 2014 23:37:44 +0100 Subject: [erlang-bugs] Internal error in v3_kernel when using funny map keys In-Reply-To: References: <0414C1F7-6E69-49D7-9191-AC732EE4DD4B@gmail.com> Message-ID: I need to think a bit about it. Perhaps stronger erl_lint is the best and perhaps not accept all keys that can be converted to literals. This is currently valid under that assumption since simple try catch can be evaluated in compile time: #{ {a, try a catch _:_ -> b end} => 1}. But I think it should be rejected under the "only literals" rule since we clearly mean to evaluate the expression. Otherwise I would say that all that could be literals in v3_core should be valid. All this stems from limiting the keys to be literals only .. we wanted to limit the scope of maps in this phase. But as I said .. I need to ponder a bit about it. 2014-03-04 23:10 GMT+01:00 Anthony Ramine : > Oh right, sys_core_fold is an optimisation. > > So just restrict map keys further in erl_lint? > > -- > Anthony Ramine > > Le 4 mars 2014 ? 22:52, Bj?rn-Egil Dahlberg > a ?crit : > > > This has to work without core optimizations. > > > > Non literal keys, or those that can't be converted to literals, has to > be rejected as non-valid expressions or patterns. At least in this stage of > Maps dev with literals only key. > > > > > > > > > > 2014-03-04 22:40 GMT+01:00 Anthony Ramine : > > Oh wait, nevermind, that transformation can already be done in > sys_core_fold. Will do that there. > > > > -- > > Anthony Ramine > > > > Le 4 mars 2014 ? 22:36, Anthony Ramine a ?crit : > > > > > Hello Bj?rn, > > > > > > So if I understand you correctly as you mentioned in one of PRs, there > should be a pass sitting between v3_core and v3_kernel that would normalize > such keys to variables, for example, right? Meanwhile, v3_core should just > emit variables for non-literals keys until that pass exists, do we agree? > > > > > > Regards, > > > > > > -- > > > Anthony Ramine > > > > > > Le 4 mars 2014 ? 09:38, Ulf Norell a ?crit : > > > > > >> -module(bug). > > >> f() -> #{[try a after b end] => 0}. > > >> > > >> -module(bug). > > >> f() -> ok. > > >> g() -> #{fun f/0 => 0}. > > >> > > >> -module(bug). > > >> f() -> ok. > > >> g() -> #{{f()} => 0}. > > >> > > >> $ erl > > >> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] > [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > >> > > >> Eshell V6.0 (abort with ^G) > > >> 1> c(bug). > > >> Function: f/0 > > >> bug.erl: internal error in kernel_module; > > >> crash reason: function_clause > > >> > > >> in function v3_kernel:map_key_clean/1 > > >> called as > v3_kernel:map_key_clean({k_cons,[2,{file,"bug.erl"}],{k_var,[],cor4},{k_nil,[2,{file,"bug.erl"}]}}) > > >> in call from v3_kernel:map_group_pairs/2 (v3_kernel.erl, line 553) > > >> in call from v3_kernel:map_group_pairs/1 (v3_kernel.erl, line 529) > > >> in call from v3_kernel:map_split_pairs/5 (v3_kernel.erl, line 511) > > >> in call from v3_kernel:expr/3 (v3_kernel.erl, line 327) > > >> in call from v3_kernel:expr/3 (v3_kernel.erl, line 307) > > >> in call from v3_kernel:function/2 (v3_kernel.erl, line 152) > > >> in call from lists:mapfoldl/3 (lists.erl, line 1352) > > >> bug.erl:2: Warning: function f/0 is unused > > >> error > > >> > > >> / Ulf > > >> > > >> _______________________________________________ > > >> erlang-bugs mailing list > > >> erlang-bugs@REDACTED > > >> http://erlang.org/mailman/listinfo/erlang-bugs > > > > > > > _______________________________________________ > > erlang-bugs mailing list > > erlang-bugs@REDACTED > > http://erlang.org/mailman/listinfo/erlang-bugs > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Tue Mar 4 23:38:22 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 4 Mar 2014 23:38:22 +0100 Subject: [erlang-bugs] Internal error in sys_core_fold when matching on map is guaranteed to fail In-Reply-To: References: Message-ID: <949D4DE2-5656-46DA-A07B-F5431D4D6543@gmail.com> https://github.com/erlang/otp/pull/267 -- Anthony Ramine Le 4 mars 2014 ? 09:45, Ulf Norell a ?crit : > This one crashes in a different place but likely for the same reason. > > -module(bug). > f() -> > case true of > #{} -> error; > true -> ok > end. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/0 > bug.erl: internal error in core_fold_module; > crash reason: function_clause > > in function sys_core_fold:opt_bool_clauses/3 > called as sys_core_fold:opt_bool_clauses([],true,false) > in call from sys_core_fold:opt_bool_clauses/3 (sys_core_fold.erl, line 1815) > in call from sys_core_fold:opt_bool_clauses/1 (sys_core_fold.erl, line 1790) > in call from sys_core_fold:opt_bool_case/1 (sys_core_fold.erl, line 1779) > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 347) > in call from sys_core_fold:opt_simple_let_1/4 (sys_core_fold.erl, line 2562) > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 355) > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > bug.erl:2: Warning: function f/0 is unused > error > > / Ulf > > > > On Tue, Mar 4, 2014 at 9:42 AM, Ulf Norell wrote: > -module(bug). > f() -> > case maybe_map of > #{} -> ok; > not_map -> error > end. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/0 > bug.erl: internal error in core_fold_module; > crash reason: {case_clause,{none}} > > in function sys_core_fold:will_match/2 (sys_core_fold.erl, line 1748) > in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1701) > in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1718) > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481) > in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699) > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > bug.erl:2: Warning: function f/0 is unused > error > > / Ulf > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Tue Mar 4 23:39:48 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 4 Mar 2014 23:39:48 +0100 Subject: [erlang-bugs] Internal error in v3_kernel when using funny map keys In-Reply-To: References: <0414C1F7-6E69-49D7-9191-AC732EE4DD4B@gmail.com> Message-ID: <623F609F-4305-4A4B-897D-A335F4E90AC4@gmail.com> I would vote for limiting it to only literals in Erlang then, it makes the limitation clearer and that would make sure we avoid writing stuff we are not supposed to yet, right? -- Anthony Ramine Le 4 mars 2014 ? 23:37, Bj?rn-Egil Dahlberg a ?crit : > I need to think a bit about it. Perhaps stronger erl_lint is the best and perhaps not accept all keys that can be converted to literals. > > This is currently valid under that assumption since simple try catch can be evaluated in compile time: > #{ {a, try a catch _:_ -> b end} => 1}. > > But I think it should be rejected under the "only literals" rule since we clearly mean to evaluate the expression. Otherwise I would say that all that could be literals in v3_core should be valid. > > All this stems from limiting the keys to be literals only .. we wanted to limit the scope of maps in this phase. But as I said .. I need to ponder a bit about it. > > > > 2014-03-04 23:10 GMT+01:00 Anthony Ramine : > Oh right, sys_core_fold is an optimisation. > > So just restrict map keys further in erl_lint? > > -- > Anthony Ramine > > Le 4 mars 2014 ? 22:52, Bj?rn-Egil Dahlberg a ?crit : > > > This has to work without core optimizations. > > > > Non literal keys, or those that can't be converted to literals, has to be rejected as non-valid expressions or patterns. At least in this stage of Maps dev with literals only key. > > > > > > > > > > 2014-03-04 22:40 GMT+01:00 Anthony Ramine : > > Oh wait, nevermind, that transformation can already be done in sys_core_fold. Will do that there. > > > > -- > > Anthony Ramine > > > > Le 4 mars 2014 ? 22:36, Anthony Ramine a ?crit : > > > > > Hello Bj?rn, > > > > > > So if I understand you correctly as you mentioned in one of PRs, there should be a pass sitting between v3_core and v3_kernel that would normalize such keys to variables, for example, right? Meanwhile, v3_core should just emit variables for non-literals keys until that pass exists, do we agree? > > > > > > Regards, > > > > > > -- > > > Anthony Ramine > > > > > > Le 4 mars 2014 ? 09:38, Ulf Norell a ?crit : > > > > > >> -module(bug). > > >> f() -> #{[try a after b end] => 0}. > > >> > > >> -module(bug). > > >> f() -> ok. > > >> g() -> #{fun f/0 => 0}. > > >> > > >> -module(bug). > > >> f() -> ok. > > >> g() -> #{{f()} => 0}. > > >> > > >> $ erl > > >> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > >> > > >> Eshell V6.0 (abort with ^G) > > >> 1> c(bug). > > >> Function: f/0 > > >> bug.erl: internal error in kernel_module; > > >> crash reason: function_clause > > >> > > >> in function v3_kernel:map_key_clean/1 > > >> called as v3_kernel:map_key_clean({k_cons,[2,{file,"bug.erl"}],{k_var,[],cor4},{k_nil,[2,{file,"bug.erl"}]}}) > > >> in call from v3_kernel:map_group_pairs/2 (v3_kernel.erl, line 553) > > >> in call from v3_kernel:map_group_pairs/1 (v3_kernel.erl, line 529) > > >> in call from v3_kernel:map_split_pairs/5 (v3_kernel.erl, line 511) > > >> in call from v3_kernel:expr/3 (v3_kernel.erl, line 327) > > >> in call from v3_kernel:expr/3 (v3_kernel.erl, line 307) > > >> in call from v3_kernel:function/2 (v3_kernel.erl, line 152) > > >> in call from lists:mapfoldl/3 (lists.erl, line 1352) > > >> bug.erl:2: Warning: function f/0 is unused > > >> error > > >> > > >> / Ulf > > >> > > >> _______________________________________________ > > >> erlang-bugs mailing list > > >> erlang-bugs@REDACTED > > >> http://erlang.org/mailman/listinfo/erlang-bugs > > > > > > > _______________________________________________ > > erlang-bugs mailing list > > erlang-bugs@REDACTED > > http://erlang.org/mailman/listinfo/erlang-bugs > > > > From n.oxyde@REDACTED Tue Mar 4 23:41:56 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 4 Mar 2014 23:41:56 +0100 Subject: [erlang-bugs] Internal error in v3_kernel when using funny map keys In-Reply-To: <623F609F-4305-4A4B-897D-A335F4E90AC4@gmail.com> References: <0414C1F7-6E69-49D7-9191-AC732EE4DD4B@gmail.com> <623F609F-4305-4A4B-897D-A335F4E90AC4@gmail.com> Message-ID: <7AD52781-65E9-488B-91DF-AF1ED9D86FB0@gmail.com> For example, that other bug would be avoided with such a limitation: -module(bug). f(#{#{} := _}) -> ok. Wouldn?t it? -- Anthony Ramine Le 4 mars 2014 ? 23:39, Anthony Ramine a ?crit : > I would vote for limiting it to only literals in Erlang then, it makes the limitation clearer and that would make sure we avoid writing stuff we are not supposed to yet, right? > > -- > Anthony Ramine > > Le 4 mars 2014 ? 23:37, Bj?rn-Egil Dahlberg a ?crit : > >> I need to think a bit about it. Perhaps stronger erl_lint is the best and perhaps not accept all keys that can be converted to literals. >> >> This is currently valid under that assumption since simple try catch can be evaluated in compile time: >> #{ {a, try a catch _:_ -> b end} => 1}. >> >> But I think it should be rejected under the "only literals" rule since we clearly mean to evaluate the expression. Otherwise I would say that all that could be literals in v3_core should be valid. >> >> All this stems from limiting the keys to be literals only .. we wanted to limit the scope of maps in this phase. But as I said .. I need to ponder a bit about it. >> >> >> >> 2014-03-04 23:10 GMT+01:00 Anthony Ramine : >> Oh right, sys_core_fold is an optimisation. >> >> So just restrict map keys further in erl_lint? >> >> -- >> Anthony Ramine >> >> Le 4 mars 2014 ? 22:52, Bj?rn-Egil Dahlberg a ?crit : >> >>> This has to work without core optimizations. >>> >>> Non literal keys, or those that can't be converted to literals, has to be rejected as non-valid expressions or patterns. At least in this stage of Maps dev with literals only key. >>> >>> >>> >>> >>> 2014-03-04 22:40 GMT+01:00 Anthony Ramine : >>> Oh wait, nevermind, that transformation can already be done in sys_core_fold. Will do that there. >>> >>> -- >>> Anthony Ramine >>> >>> Le 4 mars 2014 ? 22:36, Anthony Ramine a ?crit : >>> >>>> Hello Bj?rn, >>>> >>>> So if I understand you correctly as you mentioned in one of PRs, there should be a pass sitting between v3_core and v3_kernel that would normalize such keys to variables, for example, right? Meanwhile, v3_core should just emit variables for non-literals keys until that pass exists, do we agree? >>>> >>>> Regards, >>>> >>>> -- >>>> Anthony Ramine >>>> >>>> Le 4 mars 2014 ? 09:38, Ulf Norell a ?crit : >>>> >>>>> -module(bug). >>>>> f() -> #{[try a after b end] => 0}. >>>>> >>>>> -module(bug). >>>>> f() -> ok. >>>>> g() -> #{fun f/0 => 0}. >>>>> >>>>> -module(bug). >>>>> f() -> ok. >>>>> g() -> #{{f()} => 0}. >>>>> >>>>> $ erl >>>>> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] >>>>> >>>>> Eshell V6.0 (abort with ^G) >>>>> 1> c(bug). >>>>> Function: f/0 >>>>> bug.erl: internal error in kernel_module; >>>>> crash reason: function_clause >>>>> >>>>> in function v3_kernel:map_key_clean/1 >>>>> called as v3_kernel:map_key_clean({k_cons,[2,{file,"bug.erl"}],{k_var,[],cor4},{k_nil,[2,{file,"bug.erl"}]}}) >>>>> in call from v3_kernel:map_group_pairs/2 (v3_kernel.erl, line 553) >>>>> in call from v3_kernel:map_group_pairs/1 (v3_kernel.erl, line 529) >>>>> in call from v3_kernel:map_split_pairs/5 (v3_kernel.erl, line 511) >>>>> in call from v3_kernel:expr/3 (v3_kernel.erl, line 327) >>>>> in call from v3_kernel:expr/3 (v3_kernel.erl, line 307) >>>>> in call from v3_kernel:function/2 (v3_kernel.erl, line 152) >>>>> in call from lists:mapfoldl/3 (lists.erl, line 1352) >>>>> bug.erl:2: Warning: function f/0 is unused >>>>> error >>>>> >>>>> / Ulf >>>>> >>>>> _______________________________________________ >>>>> erlang-bugs mailing list >>>>> erlang-bugs@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-bugs >>>> >>> >>> _______________________________________________ >>> erlang-bugs mailing list >>> erlang-bugs@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-bugs >>> >> >> > From n.oxyde@REDACTED Wed Mar 5 00:01:33 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Wed, 5 Mar 2014 00:01:33 +0100 Subject: [erlang-bugs] Internal error in beam_jump when using guards after a map pattern In-Reply-To: References: Message-ID: https://github.com/erlang/otp/pull/268 -- Anthony Ramine Le 4 mars 2014 ? 09:51, Ulf Norell a ?crit : > -module(bug). > f(#{a := 0}) when #{} == #{}; true -> ok. > > Same error for this: > > -module(also_bug). > f(#{a := 0}) when true; map_size(0) -> ok. > > There seems to be a general problem with complex guards under map patterns. I > ended up disabling all guards after a match on a map in the program generator. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/1 > bug.erl: internal error in beam_bool; > crash reason: {case_clause,{'EXIT',{{case_clause,{get_map_elements,{f,5}}}, > [{beam_jump,is_label_used_in_2,2, > [{file,"beam_jump.erl"},{line,446}]}, > {lists,any,2,[{file,"lists.erl"},{line,1223}]}, > {beam_jump,is_label_used_in_1,3, > [{file,"beam_jump.erl"},{line,438}]}, > {beam_bool,split_block,5, > [{file,"beam_bool.erl"},{line,278}]}, > {beam_bool,bopt,3,[{file,"beam_bool.erl"},{line,64}]}, > {beam_bool,function,2, > [{file,"beam_bool.erl"},{line,57}]}, > {lists,mapfoldl,3,[{file,"lists.erl"},{line,1352}]}, > {beam_bool,module,2, > [{file,"beam_bool.erl"},{line,36}]}]}}} > > in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) > in call from compile:fold_comp/3 (compile.erl, line 308) > in call from compile:internal_comp/4 (compile.erl, line 292) > in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) > bug.erl:2: Warning: function f/1 is unused > error > > / Ulf > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Wed Mar 5 00:20:21 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Wed, 5 Mar 2014 00:20:21 +0100 Subject: [erlang-bugs] Internal error in sys_core_fold when using repeated keys in map pattern In-Reply-To: References: Message-ID: Not related to dupe keys: f(X) -> [[#{a := _ = _}] = [X]]. This could theoretically happen with binary patterns, but these are disallowed to contain aliases; your own example shows that it would be weird to forbid them in maps. -- Anthony Ramine Le 4 mars 2014 ? 14:20, Ulf Norell a ?crit : > -module(bug). > f(X) -> [[#{a := _, a := _}] = [X]]. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-2fbbc2f] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/1 > bug.erl: internal error in core_fold_module; > crash reason: function_clause > > in function sys_core_fold:expr/3 > called as sys_core_fold:expr({c_alias,[],{c_var,[],cor4},{c_var,[],cor5}}, > value, > {sub,[],{4,{cor0,{'X',nil,nil},{cor4,nil,{cor5,nil,nil}}}},[],false}) > in call from sys_core_fold:pair/3 (sys_core_fold.erl, line 437) > in call from sys_core_fold:pair_list/3 (sys_core_fold.erl, line 431) > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 250) > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 231) > in call from sys_core_fold:opt_simple_let/3 (sys_core_fold.erl, line 2549) > in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481) > in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699) > bug.erl:2: Warning: function f/1 is unused > error > > / Ulf > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Wed Mar 5 02:48:18 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Wed, 5 Mar 2014 02:48:18 +0100 Subject: [erlang-bugs] Internal error in kernel_module In-Reply-To: References: Message-ID: <417A8401-10BF-4E5D-A770-65B3BF500ABA@gmail.com> https://github.com/erlang/otp/pull/269 -- Anthony Ramine Le 3 mars 2014 ? 09:01, Ulf Norell a ?crit : > -module(bug). > f() -> [X = a || false] ++ [X = a || false]. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/0 > bug.erl: internal error in kernel_module; > crash reason: function_clause > > in function v3_kernel:ensure_return_vars/2 > called as v3_kernel:ensure_return_vars([{k_var,[],cor2},{k_var,[],'X'}], > {kern,{f,0}, > undefined,0,0, > {set,2,16,16,8,80,48, > {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, > {{[],[],[cor2],[],[],[],[],[],['X'],[],[],[],[],[],[],[]}}}, > [],[],[],0}) > in call from v3_kernel:uexpr/3 (v3_kernel.erl, line 1777) > in call from v3_kernel:ubody/3 (v3_kernel.erl, line 1556) > in call from v3_kernel:function/2 (v3_kernel.erl, line 153) > in call from lists:mapfoldl/3 (lists.erl, line 1352) > in call from v3_kernel:module/2 (v3_kernel.erl, line 130) > in call from compile:kernel_module/1 (compile.erl, line 1191) > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) > bug.erl:2: Warning: function f/0 is unused > bug.erl:2: Warning: no clause will ever match > bug.erl:2: Warning: the guard for this clause evaluates to 'false' > bug.erl:2: Warning: variable 'X' is unused > bug.erl:2: Warning: variable 'X' is unused > error > > / Ulf > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From stefan.zegenhagen@REDACTED Wed Mar 5 16:53:14 2014 From: stefan.zegenhagen@REDACTED (Stefan Zegenhagen) Date: Wed, 05 Mar 2014 16:53:14 +0100 Subject: [erlang-bugs] Bug in TFTP client implementation? Message-ID: <1394034794.4361.57.camel@ax-sze> Dear all, There might be a bug in erlang's TFTP client implementation that prevents erlang to successfully transfer files over IPv6 with many Microsoft(R) Windows TFTP servers. Those TFTP servers (most of them are available free of charge) are capable to bind to a single IP address only, not to an interface. The problem arises when the server has statically configured IPv6 addresses as well as automatically configured ones. Here's the step-by-step error description: 1. start the Windows TFTP server and bind to the static IPv6 server address 2. call tftp:read_file(...) to download a file from the TFTP server using the static IPv6 server address 3. transmission of packets is as follows: => : Write Request => : Ack, Port #xxxx => :xxxx : Data block=0 It appears that the TFTP servers are unwilling (or unable) to respond from the IPv6 address they have been contacted at. Furthermore it seems that the erlang TFTP client uses the source IPv6 of the received Ack packet in all further communication. Since the TFTP server is not listening to its dynamic IPv6 address (from which it always responds, though), the data blocks transmitted after the initial successful "connection establishment" are never received by the TFTP server. I agree that the TFTP server should respond from the IPv6 address it was contacted at. However, I also think it to be a questionable behaviour to change to a different IP address for the actual data transfer. Kind regards, -- Dr. Stefan Zegenhagen arcutronix GmbH Garbsener Landstr. 10 30419 Hannover Germany Tel: +49 511 277-2734 Fax: +49 511 277-2709 Email: stefan.zegenhagen@REDACTED Web: www.arcutronix.com *Synchronize the Ethernet* General Managers: Dipl. Ing. Juergen Schroeder, Dr. Josef Gfrerer - Legal Form: GmbH, Registered office: Hannover, HRB 202442, Amtsgericht Hannover; Ust-Id: DE257551767. Please consider the environment before printing this message. From egil@REDACTED Wed Mar 5 18:41:18 2014 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Wed, 5 Mar 2014 18:41:18 +0100 Subject: [erlang-bugs] Internal error in v3_kernel when using funny map keys In-Reply-To: <623F609F-4305-4A4B-897D-A335F4E90AC4@gmail.com> References: <0414C1F7-6E69-49D7-9191-AC732EE4DD4B@gmail.com> <623F609F-4305-4A4B-897D-A335F4E90AC4@gmail.com> Message-ID: <531761BE.90003@erlang.org> On 2014-03-04 23:39, Anthony Ramine wrote: > I would vote for limiting it to only literals in Erlang then, it makes the limitation clearer and that would make sure we avoid writing stuff we are not supposed to yet, right? > I think this has to be both in erl_lint and in v3_kernel. Informally .. erl_lint should take care of the following: * only values, i.e. atomics + maps + cons + tuples + binaries * deny all variables in those values * deny all other expressions. i.e expressions that needs evaluation to become values Now, binaries are a bit trickier. Even though you may write some binaries as literals the compiler could deny this if it becomes to big. For instance: t1() -> <<0:256>>. becomes: {move,{literal,<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>},{x,0}}. and t2() -> <<0:257>>. becomes: {bs_init_bits,{f,0},257,0,0,{field_flags,[]},{x,0}}. {bs_put_integer,{f,0},{integer,257},1,{field_flags,[unsigned,big]},{integer,0}}. So we have to deny those as well because kernel *has* to have literals. I believe it is easiest to deny these kinds in v3_kernel. Maps does not have literals yet (I have a branch for it but will wait a bit before introducing it .. because pull-requests) so those must be denied as well. These are two different kinds of problems: 1) For 17.0 only literal keys (values) should be valid in the language -> checked in erl_lint 2) Limitations where the compiler refuses or don't know how to produce literals -> v3_kernel (or earlier if suitable place is found). What do you think? // Bj?rn-Egil From ulf.norell@REDACTED Wed Mar 5 19:50:42 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Wed, 5 Mar 2014 19:50:42 +0100 Subject: [erlang-bugs] Internal error in beam_dead when using maps in guards In-Reply-To: References: Message-ID: That doesn't seem to have fixed it completely. The following gives exactly the same error: -module(bug). f() when true; #{} andalso false -> ok. / Ulf On Mon, Mar 3, 2014 at 2:13 PM, Anthony Ramine wrote: > https://github.com/erlang/otp/pull/260 > > -- > Anthony Ramine > > Le 3 mars 2014 ? 10:15, Anthony Ramine a ?crit : > > > This one is due to beam_bool not seeing that {f,6} is used in a put_map > instruction in the block preceding the one it is trying to optimise. > > > > I have a fix but IRL work is calling me, will submit it later. > > > > -- > > Anthony Ramine > > > > Le 3 mars 2014 ? 08:41, Ulf Norell a ?crit : > > > >> Replacing the map #{} makes the error go away. > >> > >> -module(bug). > >> f() when is_map(#{}); false -> ok. > >> > >> $ erl > >> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] > [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > >> > >> Eshell V6.0 (abort with ^G) > >> 1> c(bug). > >> Function f/0 refers to undefined label 6 > >> bug.erl: internal error in beam_dead; > >> crash reason: {case_clause,{'EXIT',{undefined_label,6}}} > >> > >> in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, > line 493) > >> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, > line 290) > >> in call from compile:fold_comp/3 (compile.erl, line 308) > >> in call from compile:internal_comp/4 (compile.erl, line 292) > >> in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line > 153) > >> bug.erl:2: Warning: function f/0 is unused > >> error > >> > >> / Ulf > >> _______________________________________________ > >> erlang-bugs mailing list > >> erlang-bugs@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-bugs > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Thu Mar 6 10:45:06 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Thu, 6 Mar 2014 10:45:06 +0100 Subject: [erlang-bugs] Internal error in beam_dead when using maps in guards In-Reply-To: References: Message-ID: <402A3C96-1565-40D9-9D58-E679E134CB41@gmail.com> https://github.com/erlang/otp/pull/273 -- Anthony Ramine Le 5 mars 2014 ? 19:50, Ulf Norell a ?crit : > That doesn't seem to have fixed it completely. The following gives exactly the same error: > > -module(bug). > f() when true; #{} andalso false -> ok. > > / Ulf > > > On Mon, Mar 3, 2014 at 2:13 PM, Anthony Ramine wrote: > https://github.com/erlang/otp/pull/260 > > -- > Anthony Ramine > > Le 3 mars 2014 ? 10:15, Anthony Ramine a ?crit : > > > This one is due to beam_bool not seeing that {f,6} is used in a put_map instruction in the block preceding the one it is trying to optimise. > > > > I have a fix but IRL work is calling me, will submit it later. > > > > -- > > Anthony Ramine > > > > Le 3 mars 2014 ? 08:41, Ulf Norell a ?crit : > > > >> Replacing the map #{} makes the error go away. > >> > >> -module(bug). > >> f() when is_map(#{}); false -> ok. > >> > >> $ erl > >> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > >> > >> Eshell V6.0 (abort with ^G) > >> 1> c(bug). > >> Function f/0 refers to undefined label 6 > >> bug.erl: internal error in beam_dead; > >> crash reason: {case_clause,{'EXIT',{undefined_label,6}}} > >> > >> in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) > >> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) > >> in call from compile:fold_comp/3 (compile.erl, line 308) > >> in call from compile:internal_comp/4 (compile.erl, line 292) > >> in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) > >> bug.erl:2: Warning: function f/0 is unused > >> error > >> > >> / Ulf > >> _______________________________________________ > >> erlang-bugs mailing list > >> erlang-bugs@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-bugs > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > From prof3ta@REDACTED Thu Mar 6 09:55:46 2014 From: prof3ta@REDACTED (Roberto Aloi) Date: Thu, 6 Mar 2014 09:55:46 +0100 Subject: [erlang-bugs] mfa() built-in type Message-ID: Hi, Whilst R15B03 prevents you from redefine the mfa() built-in type: R15$ erlc recon_trace.erl recon_trace.erl:182: type mfa() is a builtin type; it cannot be redefined R16 doesn't complain at all. Is this intentional? -- Roberto Aloi --- Website: http://roberto-aloi.com Twitter: @robertoaloi -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans.bolinder@REDACTED Thu Mar 6 11:44:08 2014 From: hans.bolinder@REDACTED (Hans Bolinder) Date: Thu, 6 Mar 2014 10:44:08 +0000 Subject: [erlang-bugs] mfa() built-in type In-Reply-To: References: Message-ID: <56466BD70414EA48969B4064696CF28C037B2C22@ESESSMB207.ericsson.se> ________________________________ Hi, > Whilst R15B03 prevents you from redefine the mfa() built-in type: > > R15$ erlc recon_trace.erl > recon_trace.erl:182: type mfa() is a builtin type; it cannot be redefined > > R16 doesn't complain at all. > > Is this intentional? No, it is not. Thanks for pointing it out. Best regards, Hans Bolinder, Erlang/OTP team, Ericsson -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan_kowalski6669@REDACTED Thu Mar 6 14:49:17 2014 From: jan_kowalski6669@REDACTED (jan_kowalski6669) Date: Thu, 06 Mar 2014 14:49:17 +0100 Subject: [erlang-bugs] file:sendfile and inet:getstat Message-ID: <68036803-cdad2280574767a85af63697dae59cee@pmq5.m5r2.onet> Hello, ? when i send file by file:sendfile(FileName, Socket) traffic is not included in inet:getstat(Socket) ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas@REDACTED Thu Mar 6 16:40:57 2014 From: andreas@REDACTED (Andreas Schumacher) Date: Thu, 6 Mar 2014 16:40:57 +0100 Subject: [erlang-bugs] Fwd: FW: Bug in TFTP client implementation? In-Reply-To: <58912684E2630B45963406CF7D8C52581C36A3C4@ESESSMB103.ericsson.se> References: <1394034794.4361.57.camel@ax-sze> <58912684E2630B45963406CF7D8C52581C36A3C4@ESESSMB103.ericsson.se> Message-ID: Unfortunately, RFC 1350 - The TFTP Protocol (Revision 2) - does not address this issue. Nevertheless, based on TFTP's initial connection protocol and its relation to the underlying protocols, the Erlang/OTP TFTP client behaviour seems to be sensible in this case. According to the initial connection protocol, which is used to establish a "pseudo" connection between the client and the server, the client sends its first datagram to the server's well-known port (69). The server sends its packet (here: ACK) from a freshly allocated ephemeral port, and all future packets to the server should be sent to this port. Consequently, if the server decides to allocate that port on a different host, then it seems sensible that the client uses the server's unique socket 3-tuple (protocol, ip-address, port) for all future packets to that server. In short, there are no plans to change the current TFTP client behaviour, unless further information is provided, which indicates that a different behaviour would be more appropriate. Andreas Schumacher, Erlang/OTP, Ericsson AB -----Original Message----- From: erlang-bugs-bounces@REDACTED [mailto:erlang-bugs-bounces@REDACTED] On Behalf Of Stefan Zegenhagen Sent: den 5 mars 2014 16:53 To: erlang-bugs@REDACTED Subject: [erlang-bugs] Bug in TFTP client implementation? Dear all, There might be a bug in erlang's TFTP client implementation that prevents erlang to successfully transfer files over IPv6 with many Microsoft(R) Windows TFTP servers. Those TFTP servers (most of them are available free of charge) are capable to bind to a single IP address only, not to an interface. The problem arises when the server has statically configured IPv6 addresses as well as automatically configured ones. Here's the step-by-step error description: 1. start the Windows TFTP server and bind to the static IPv6 server address 2. call tftp:read_file(...) to download a file from the TFTP server using the static IPv6 server address 3. transmission of packets is as follows: => : Write Request => : Ack, Port #xxxx => :xxxx : Data block=0 It appears that the TFTP servers are unwilling (or unable) to respond from the IPv6 address they have been contacted at. Furthermore it seems that the erlang TFTP client uses the source IPv6 of the received Ack packet in all further communication. Since the TFTP server is not listening to its dynamic IPv6 address (from which it always responds, though), the data blocks transmitted after the initial successful "connection establishment" are never received by the TFTP server. I agree that the TFTP server should respond from the IPv6 address it was contacted at. However, I also think it to be a questionable behaviour to change to a different IP address for the actual data transfer. Kind regards, -- Dr. Stefan Zegenhagen arcutronix GmbH Garbsener Landstr. 10 30419 Hannover Germany Tel: +49 511 277-2734 Fax: +49 511 277-2709 Email: stefan.zegenhagen@REDACTED Web: www.arcutronix.com *Synchronize the Ethernet* General Managers: Dipl. Ing. Juergen Schroeder, Dr. Josef Gfrerer - Legal Form: GmbH, Registered office: Hannover, HRB 202442, Amtsgericht Hannover; Ust-Id: DE257551767. Please consider the environment before printing this message. _______________________________________________ erlang-bugs mailing list erlang-bugs@REDACTED http://erlang.org/mailman/listinfo/erlang-bugs -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas@REDACTED Thu Mar 6 22:27:30 2014 From: andreas@REDACTED (Andreas Schumacher) Date: Thu, 6 Mar 2014 22:27:30 +0100 Subject: [erlang-bugs] Fwd: Bug in TFTP client implementation? In-Reply-To: References: <1394122870.4361.103.camel@ax-sze> Message-ID: Hi Stefan, I have spent some further thoughts on the issue, and have come to a different conclusion; although, it may change again if I continue to think about it. After browsing some pages on TFTP and load balancing, NAT, VIP, etc., the following TFTP client behaviour seems to be most appropriate: If the response is not coming from the IP address to which the client sent the request, the client should ignore the response. The second best response may be that the client continues to use the original server IP address. However, the implementation of that behaviour would be considered a low priority change request; and thus, it may only be implemented in the foreseeable future if you or someone else provides a patch. The solution that you proposed adds too much unnecessary complexity to a supposedly simple protocol; and thus, it is not considered to be a suitable solution alternative. Nevertheless, since you seem to have problems with different Windows TFTP servers, I wonder whether your Windows IP configuration and/or server configuration are correct. Unfortunately, I am not able to help you with that part. Andreas *From: *Stefan Zegenhagen *Subject: * *Re: Fwd: FW: [erlang-bugs] Bug in TFTP client implementation?* *Date: *6 Mar 2014 17:21:10 GMT+1 *To: *Andreas Schumacher *Cc: * Dear all, According to the initial connection protocol, which is used to establish a "pseudo" connection between the client and the server, the client sends its first datagram to the server's well-known port (69). The server sends its packet (here: ACK) from a freshly allocated ephemeral port, and all future packets to the server should be sent to this port. Consequently, if the server decides to allocate that port on a different host, then it seems sensible that the client uses the server's unique socket 3-tuple (protocol, ip-address, port) for all future packets to that server. In short, there are no plans to change the current TFTP client behaviour, unless further information is provided, which indicates that a different behaviour would be more appropriate. I fully agree with your reasoning. On the other hand, I have a real problem that, unfortunately, I need to solve. I found no way to amend the sitation: neither could I tell the TFTP servers to listen for *ALL* IPv6 communication (bind to "::"), nor could I tell the Windows OS to ignore IPv6 router advertisements and automatic address configuration. Using the automatically configured IPv6 address is not an option as well because IPv6 Privacy Extensions are enabled and cannot be disabled, so that the IPv6 address changes in regular intervals. (I have to admit that I am not familiar with the Windows OS and that there may be ways to disable IPv6 autoconfiguration that escaped my attention and internet searching capabilities so far.) I could imagine a solution like this: We *KNOW* that we can contact the TFTP server under the user's selected IP address because we get a valid response to the initial request. If we try to use the user-supplied IP address for the next packet we send and get a timeout, we can still assume that further communication was reallocated to a different host and use the IP address that we got the reply from. Or vice versa. In order to keep the current level of security, I would still record the remote hosts source address and check that further packets are received from the same source address, even if we send packets only to the user-supplied IP address. Kind regards, -- Dr. Stefan Zegenhagen arcutronix GmbH Garbsener Landstr. 10 30419 Hannover Germany Tel: +49 511 277-2734 Fax: +49 511 277-2709 Email: stefan.zegenhagen@REDACTED Web: www.arcutronix.com *Synchronize the Ethernet* General Managers: Dipl. Ing. Juergen Schroeder, Dr. Josef Gfrerer - Legal Form: GmbH, Registered office: Hannover, HRB 202442, Amtsgericht Hannover; Ust-Id: DE257551767. Please consider the environment before printing this message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ufm@REDACTED Fri Mar 7 03:46:34 2014 From: ufm@REDACTED (Fyodor Ustinov) Date: Fri, 7 Mar 2014 04:46:34 +0200 (EET) Subject: [erlang-bugs] Map comprehension syntax In-Reply-To: <1016373933.374979.1394159925748.JavaMail.zimbra@ufm.su> Message-ID: <105424726.375034.1394160394135.JavaMail.zimbra@ufm.su> Hi! In https://github.com/erlang/eep/blob/master/eeps/eep-0043.md set the next syntax in example: M1 = #{ I => f(I) || I <- list() } But I was not able to execute such an instruction: Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> #{ I => I || I <- [1,2,3]}. * 1: syntax error before: '||' Maybe maps is not fully implemented? WBR, Fyodor. From prof3ta@REDACTED Fri Mar 7 08:17:40 2014 From: prof3ta@REDACTED (Roberto Aloi) Date: Fri, 7 Mar 2014 08:17:40 +0100 Subject: [erlang-bugs] mfa() built-in type In-Reply-To: <56466BD70414EA48969B4064696CF28C037B2C22@ESESSMB207.ericsson.se> References: <56466BD70414EA48969B4064696CF28C037B2C22@ESESSMB207.ericsson.se> Message-ID: Great. More info here: http://erlang.org/pipermail/erlang-questions/2014-March/078080.html On Thu, Mar 6, 2014 at 11:44 AM, Hans Bolinder wrote: > > ------------------------------ > Hi, > > > Whilst R15B03 prevents you from redefine the mfa() built-in type: > > > > R15$ erlc recon_trace.erl > > recon_trace.erl:182: type mfa() is a builtin type; it cannot be redefined > > > > R16 doesn't complain at all. > > > > Is this intentional? > > No, it is not. > > Thanks for pointing it out. > > Best regards, > Hans Bolinder, Erlang/OTP team, Ericsson > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > > -- Roberto Aloi --- Website: http://roberto-aloi.com Twitter: @robertoaloi -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Fri Mar 7 12:13:27 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Fri, 7 Mar 2014 12:13:27 +0100 Subject: [erlang-bugs] Map comprehension syntax In-Reply-To: <105424726.375034.1394160394135.JavaMail.zimbra@ufm.su> References: <105424726.375034.1394160394135.JavaMail.zimbra@ufm.su> Message-ID: <25CC246A-464D-4CA1-BE8A-1EB6275C25E0@gmail.com> Yes, they are not implemented in the RCs yet. -- Anthony Ramine Le 7 mars 2014 ? 03:46, Fyodor Ustinov a ?crit : > Hi! > > In https://github.com/erlang/eep/blob/master/eeps/eep-0043.md set the next syntax in example: > > M1 = #{ I => f(I) || I <- list() } > > But I was not able to execute such an instruction: > > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> #{ I => I || I <- [1,2,3]}. > * 1: syntax error before: '||' > > Maybe maps is not fully implemented? > > WBR, > Fyodor. > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From ulf.norell@REDACTED Fri Mar 7 19:08:35 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Fri, 7 Mar 2014 19:08:35 +0100 Subject: [erlang-bugs] Internal error in beam_type In-Reply-To: References: Message-ID: This one produces the same error -module(bug). f(M, [_]) when M#{a := 0, b => 0}, map_size(M) -> ok. / Ulf On Mon, Mar 3, 2014 at 9:08 AM, Ulf Norell wrote: > This is my favourite so far. > > -module(bug). > f(X, [_]) when {{X}}, -X -> ok. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] > [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/2 > bug.erl: internal error in beam_type; > crash reason: {case_clause,{'EXIT',{{badmatch,false}, > [{beam_utils,live_opt_block,4, > [{file,"beam_utils.erl"},{line,785}]}, > {beam_utils,live_opt,4, > [{file,"beam_utils.erl"},{line,680}]}, > {beam_utils,live_opt,1, > [{file,"beam_utils.erl"},{line,207}]}, > {beam_type,function,1, > [{file,"beam_type.erl"},{line,33}]}, > {beam_type,'-module/2-lc$^0/1-0-',1, > [{file,"beam_type.erl"},{line,28}]}, > > {beam_type,module,2,[{file,"beam_type.erl"},{line,28}]}, > {compile,'-select_passes/2-anonymous-2-',2, > [{file,"compile.erl"},{line,493}]}, > {compile,'-internal_comp/4-anonymous-1-',2, > [{file,"compile.erl"},{line,290}]}]}}} > > in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, > line 493) > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, > line 290) > in call from compile:fold_comp/3 (compile.erl, line 308) > in call from compile:internal_comp/4 (compile.erl, line 292) > in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line > 153) > bug.erl:2: Warning: function f/2 is unused > error > > / Ulf > -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Sat Mar 8 02:01:23 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sat, 8 Mar 2014 02:01:23 +0100 Subject: [erlang-bugs] Internal error in beam_bool In-Reply-To: References: Message-ID: <808755DB-4333-4666-B917-8D78E964972D@gmail.com> https://github.com/erlang/otp/pull/279 -- Anthony Ramine Le 3 mars 2014 ? 08:35, Ulf Norell a ?crit : > I posted this in the other thread, but it might have gotten lost in the other messages. I also found another way to trigger it: > > -module(bug). > f(X = true) when X; X; true -> ok. > > -module(bug). > f(X = true) -> [ok || X, X, X]. > > Now running on R17-rc2: > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/1 > bug.erl: internal error in beam_bool; > crash reason: {case_clause, > {'EXIT', > {function_clause, > [{gb_trees,get_1,[{x,0},nil],[{file,"gb_trees.erl"},{line,239}]}, > {beam_bool,bopt_bool_arg,2,[{file,"beam_bool.erl"},{line,435}]}, > {lists,mapfoldl,3,[{file,"lists.erl"},{line,1352}]}, > {beam_bool,bopt_tree,3,[{file,"beam_bool.erl"},{line,386}]}, > {beam_bool,bopt_tree_cg,3,[{file,"beam_bool.erl"},{line,360}]}, > {beam_bool,bopt_block,5,[{file,"beam_bool.erl"},{line,115}]}, > {beam_bool,bopt,3,[{file,"beam_bool.erl"},{line,76}]}, > {beam_bool,function,2,[{file,"beam_bool.erl"},{line,57}]}]}}} > > in function io_lib_pretty:cind_tag_tuple/7 (io_lib_pretty.erl, line 638) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 697) > in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 727) > bug.erl:2: Warning: function f/1 is unused > error > > / Ulf > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Sat Mar 8 02:36:18 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sat, 8 Mar 2014 02:36:18 +0100 Subject: [erlang-bugs] Internal error in core_fold_module when repeating boolean case branch In-Reply-To: References: Message-ID: <96DCD152-3742-44D3-9D04-736C1D42180D@gmail.com> https://github.com/erlang/otp/pull/280 -- Anthony Ramine Le 3 mars 2014 ? 08:44, Ulf Norell a ?crit : > -module(bug). > f(X) -> > case X == 0 of > false -> no; > false -> no; > true -> yes > end. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > > 1> c(bug). > Function: f/1 > bug.erl: internal error in core_fold_module; > crash reason: function_clause > > in function sys_core_fold:opt_bool_case_guard/2 > called as sys_core_fold:opt_bool_case_guard({c_call,[3,{file,"bug.erl"}], > {c_literal,[3,{file,"bug.erl"}],erlang}, > {c_literal,[3,{file,"bug.erl"}],'=='}, > [{c_var,[3,{file,"bug.erl"}],'X'}, > {c_literal,[3,{file,"bug.erl"}],0}]}, > [{c_clause,[4,{file,"bug.erl"}], > [{c_literal,[4,{file,"bug.erl"}],false}], > {c_literal,[],true}, > {c_literal,[4,{file,"bug.erl"}],no}}, > {c_clause,[5,{file,"bug.erl"}], > [{c_literal,[5,{file,"bug.erl"}],false}], > {c_literal,[],true}, > {c_literal,[5,{file,"bug.erl"}],no}}, > {c_clause,[6,{file,"bug.erl"}], > [{c_literal,[6,{file,"bug.erl"}],true}], > {c_literal,[],true}, > {c_literal,[6,{file,"bug.erl"}],yes}}]) > in call from sys_core_fold:opt_bool_case_guard/1 (sys_core_fold.erl, line 1933) > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 347) > in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481) > in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699) > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > in call from sys_core_fold:function_1/1 (sys_core_fold.erl, line 117) > bug.erl:2: Warning: function f/1 is unused > error > > / Ulf > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Sat Mar 8 02:57:00 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sat, 8 Mar 2014 02:57:00 +0100 Subject: [erlang-bugs] Internal error in beam_type In-Reply-To: References: Message-ID: <569D6D43-4863-4D2C-B35E-1D69FF5A1DC3@gmail.com> This doesn?t crash when disabling beam_bool: bin/erlc +export_all +no_bopt bug.erl That is the kind of reduction improvement that I could implement in your bug finding tool, if it was open source :) -- Anthony Ramine Le 7 mars 2014 ? 19:08, Ulf Norell a ?crit : > This one produces the same error > > -module(bug). > f(M, [_]) when M#{a := 0, b => 0}, map_size(M) -> ok. > > / Ulf > > > On Mon, Mar 3, 2014 at 9:08 AM, Ulf Norell wrote: > This is my favourite so far. > > -module(bug). > f(X, [_]) when {{X}}, -X -> ok. > > $ erl > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> c(bug). > Function: f/2 > bug.erl: internal error in beam_type; > crash reason: {case_clause,{'EXIT',{{badmatch,false}, > [{beam_utils,live_opt_block,4, > [{file,"beam_utils.erl"},{line,785}]}, > {beam_utils,live_opt,4, > [{file,"beam_utils.erl"},{line,680}]}, > {beam_utils,live_opt,1, > [{file,"beam_utils.erl"},{line,207}]}, > {beam_type,function,1, > [{file,"beam_type.erl"},{line,33}]}, > {beam_type,'-module/2-lc$^0/1-0-',1, > [{file,"beam_type.erl"},{line,28}]}, > {beam_type,module,2,[{file,"beam_type.erl"},{line,28}]}, > {compile,'-select_passes/2-anonymous-2-',2, > [{file,"compile.erl"},{line,493}]}, > {compile,'-internal_comp/4-anonymous-1-',2, > [{file,"compile.erl"},{line,290}]}]}}} > > in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) > in call from compile:fold_comp/3 (compile.erl, line 308) > in call from compile:internal_comp/4 (compile.erl, line 292) > in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) > bug.erl:2: Warning: function f/2 is unused > error > > / Ulf > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From n.oxyde@REDACTED Sat Mar 8 03:56:23 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sat, 8 Mar 2014 03:56:23 +0100 Subject: [erlang-bugs] Internal error in beam_type In-Reply-To: <569D6D43-4863-4D2C-B35E-1D69FF5A1DC3@gmail.com> References: <569D6D43-4863-4D2C-B35E-1D69FF5A1DC3@gmail.com> Message-ID: <91EACF52-3A19-41E5-B3C1-B0F72391E2FD@gmail.com> $ bin/erlc +no_topt +export_all bug.erl bug: function f/2+13: Internal consistency check failed - please report this bug. Instruction: {test,is_eq_exact,{f,1},[{x,5},{atom,true}]} Error: {uninitialized_reg,{x,5}}: -- Anthony Ramine Le 8 mars 2014 ? 02:57, Anthony Ramine a ?crit : > This doesn?t crash when disabling beam_bool: > > bin/erlc +export_all +no_bopt bug.erl > > That is the kind of reduction improvement that I could implement in your bug finding tool, if it was open source :) > > -- > Anthony Ramine > > Le 7 mars 2014 ? 19:08, Ulf Norell a ?crit : > >> This one produces the same error >> >> -module(bug). >> f(M, [_]) when M#{a := 0, b => 0}, map_size(M) -> ok. >> >> / Ulf >> >> >> On Mon, Mar 3, 2014 at 9:08 AM, Ulf Norell wrote: >> This is my favourite so far. >> >> -module(bug). >> f(X, [_]) when {{X}}, -X -> ok. >> >> $ erl >> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V6.0 (abort with ^G) >> 1> c(bug). >> Function: f/2 >> bug.erl: internal error in beam_type; >> crash reason: {case_clause,{'EXIT',{{badmatch,false}, >> [{beam_utils,live_opt_block,4, >> [{file,"beam_utils.erl"},{line,785}]}, >> {beam_utils,live_opt,4, >> [{file,"beam_utils.erl"},{line,680}]}, >> {beam_utils,live_opt,1, >> [{file,"beam_utils.erl"},{line,207}]}, >> {beam_type,function,1, >> [{file,"beam_type.erl"},{line,33}]}, >> {beam_type,'-module/2-lc$^0/1-0-',1, >> [{file,"beam_type.erl"},{line,28}]}, >> {beam_type,module,2,[{file,"beam_type.erl"},{line,28}]}, >> {compile,'-select_passes/2-anonymous-2-',2, >> [{file,"compile.erl"},{line,493}]}, >> {compile,'-internal_comp/4-anonymous-1-',2, >> [{file,"compile.erl"},{line,290}]}]}}} >> >> in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) >> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) >> in call from compile:fold_comp/3 (compile.erl, line 308) >> in call from compile:internal_comp/4 (compile.erl, line 292) >> in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) >> bug.erl:2: Warning: function f/2 is unused >> error >> >> / Ulf >> >> _______________________________________________ >> erlang-bugs mailing list >> erlang-bugs@REDACTED >> http://erlang.org/mailman/listinfo/erlang-bugs > From n.oxyde@REDACTED Sat Mar 8 04:16:55 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sat, 8 Mar 2014 04:16:55 +0100 Subject: [erlang-bugs] Internal error in beam_type In-Reply-To: <91EACF52-3A19-41E5-B3C1-B0F72391E2FD@gmail.com> References: <569D6D43-4863-4D2C-B35E-1D69FF5A1DC3@gmail.com> <91EACF52-3A19-41E5-B3C1-B0F72391E2FD@gmail.com> Message-ID: <57582FB0-8FB8-4D3C-BF76-48562149C6B7@gmail.com> Err sorry, wrong error: bug: function f/2+12: Internal consistency check failed - please report this bug. Instruction: {gc_bif,'-',{f,1},5,[{x,0}],{x,5}} Error: {{x,3},not_live}: -- Anthony Ramine Le 8 mars 2014 ? 03:56, Anthony Ramine a ?crit : > $ bin/erlc +no_topt +export_all bug.erl > bug: function f/2+13: > Internal consistency check failed - please report this bug. > Instruction: {test,is_eq_exact,{f,1},[{x,5},{atom,true}]} > Error: {uninitialized_reg,{x,5}}: > > -- > Anthony Ramine > > Le 8 mars 2014 ? 02:57, Anthony Ramine a ?crit : > >> This doesn?t crash when disabling beam_bool: >> >> bin/erlc +export_all +no_bopt bug.erl >> >> That is the kind of reduction improvement that I could implement in your bug finding tool, if it was open source :) >> >> -- >> Anthony Ramine >> >> Le 7 mars 2014 ? 19:08, Ulf Norell a ?crit : >> >>> This one produces the same error >>> >>> -module(bug). >>> f(M, [_]) when M#{a := 0, b => 0}, map_size(M) -> ok. >>> >>> / Ulf >>> >>> >>> On Mon, Mar 3, 2014 at 9:08 AM, Ulf Norell wrote: >>> This is my favourite so far. >>> >>> -module(bug). >>> f(X, [_]) when {{X}}, -X -> ok. >>> >>> $ erl >>> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] >>> >>> Eshell V6.0 (abort with ^G) >>> 1> c(bug). >>> Function: f/2 >>> bug.erl: internal error in beam_type; >>> crash reason: {case_clause,{'EXIT',{{badmatch,false}, >>> [{beam_utils,live_opt_block,4, >>> [{file,"beam_utils.erl"},{line,785}]}, >>> {beam_utils,live_opt,4, >>> [{file,"beam_utils.erl"},{line,680}]}, >>> {beam_utils,live_opt,1, >>> [{file,"beam_utils.erl"},{line,207}]}, >>> {beam_type,function,1, >>> [{file,"beam_type.erl"},{line,33}]}, >>> {beam_type,'-module/2-lc$^0/1-0-',1, >>> [{file,"beam_type.erl"},{line,28}]}, >>> {beam_type,module,2,[{file,"beam_type.erl"},{line,28}]}, >>> {compile,'-select_passes/2-anonymous-2-',2, >>> [{file,"compile.erl"},{line,493}]}, >>> {compile,'-internal_comp/4-anonymous-1-',2, >>> [{file,"compile.erl"},{line,290}]}]}}} >>> >>> in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493) >>> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290) >>> in call from compile:fold_comp/3 (compile.erl, line 308) >>> in call from compile:internal_comp/4 (compile.erl, line 292) >>> in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) >>> bug.erl:2: Warning: function f/2 is unused >>> error >>> >>> / Ulf >>> >>> _______________________________________________ >>> erlang-bugs mailing list >>> erlang-bugs@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-bugs >> > From jose.valim@REDACTED Mon Mar 10 06:46:15 2014 From: jose.valim@REDACTED (=?ISO-8859-1?Q?Jos=E9_Valim?=) Date: Mon, 10 Mar 2014 06:46:15 +0100 Subject: [erlang-bugs] Internal v3 codegen bugs when updating maps Message-ID: I found two bugs related to maps. They are linked in the gist below: https://gist.github.com/josevalim/f3d28e2cea4ec1c1d0fb I have searched this mailing list and I haven't seen those reports before. *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Lead Developer -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Mon Mar 10 09:29:25 2014 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Mon, 10 Mar 2014 09:29:25 +0100 Subject: [erlang-bugs] Minor fix: remove references to dbg_wx_edit* modules Message-ID: Debugger.erl references thes in comments, but these modules don't exist in the wx implementation. > git fetch git://github.com/vladdu/otp.git debugger_wx_edit > > https://github.com/vladdu/otp/compare/erlang:master...debugger_wx_edit > > https://github.com/vladdu/otp/compare/erlang:master...debugger_wx_edit.patch regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Mon Mar 10 10:45:12 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Mon, 10 Mar 2014 10:45:12 +0100 Subject: [erlang-bugs] Internal v3 codegen bugs when updating maps In-Reply-To: References: Message-ID: <978609A0-8A10-48EC-B320-A8CB1D0DBAAE@gmail.com> Thanks, my bug stock was getting low =) -- Anthony Ramine > Le 10 mars 2014 ? 06:46, Jos? Valim a ?crit : > > I found two bugs related to maps. They are linked in the gist below: > > https://gist.github.com/josevalim/f3d28e2cea4ec1c1d0fb > > I have searched this mailing list and I haven't seen those reports before. > > Jos? Valim > www.plataformatec.com.br > Skype: jv.ptec > Founder and Lead Developer > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs -------------- next part -------------- An HTML attachment was scrubbed... URL: From aronisstav@REDACTED Mon Mar 10 23:02:20 2014 From: aronisstav@REDACTED (Stavros Aronis) Date: Mon, 10 Mar 2014 23:02:20 +0100 Subject: [erlang-bugs] Allow code upgrade for the code_server itself Message-ID: Hello! I am playing around with code instrumentation and trying to hack the code server so that it applies some transformation whenever it loads *any* module. The hack itself is relatively simple: 1) Instrument and reload any already loaded modules (come to think about it, during this process more modules may be loaded, but let's assume a fixpoint). This is to avoid the case where in order to load A, you have to instrument A, and the instrumenter itself needs a call to X, which is not yet loaded so you have to load X, so you have to instrument X, etc... 2) Get the Core Erlang code of the codeserver and wrap the second argument of erlang:load_module (Line 1264) with a call to my instrumenter (which is a function from binary() -> binary()) 3) Load the patched code_server code 4) Move the code_server process from the old code to the new one. I am having trouble with the last step. As far as I understand it, the reason is that the call to system_continue (Line 184) is not qualified, as is the similar call in sys.erl (Line 324). Is there a reason why this is so? Is there any possibility for this to be patched? Cheers, Stavros -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Tue Mar 11 00:43:00 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 11 Mar 2014 00:43:00 +0100 Subject: [erlang-bugs] Internal v3 codegen bugs when updating maps In-Reply-To: References: Message-ID: https://github.com/erlang/otp/pull/291 -- Anthony Ramine Le 10 mars 2014 ? 06:46, Jos? Valim a ?crit : > I found two bugs related to maps. They are linked in the gist below: > > https://gist.github.com/josevalim/f3d28e2cea4ec1c1d0fb > > I have searched this mailing list and I haven't seen those reports before. > > Jos? Valim > www.plataformatec.com.br > Skype: jv.ptec > Founder and Lead Developer > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From erlang@REDACTED Tue Mar 11 11:11:30 2014 From: erlang@REDACTED (=?UTF-8?Q?Micha=C5=82_Ptaszek?=) Date: Tue, 11 Mar 2014 11:11:30 +0100 Subject: [erlang-bugs] SystemTap user_string trimmed output Message-ID: Hey all, I've been trying (with relatively good results so far) to make CentOS 6.2, SystemTap 2.4 and the Erlang VM compatible with each other, and noticed some problems with current implementation when we try to retrieve the string from user space address within our stap script. Long story short: all strings are trimmed to the first 8 bytes, for instance: dist outputv: node, port #Port<0,len 7, remote_node 'chatse, bytes 62 It turns out that the code responsible for formatting the probe arguments (let's start with port string name as an example) looks like ( https://github.com/erlang/otp/blob/maint/erts/emulator/beam/dist.c#L1947): erts_snprintf(port_str, sizeof(port_str), "%T", prt->common.id); Where port_str is defined as ( https://github.com/erlang/otp/blob/maint/erts/emulator/beam/dist.c#L1944): DTRACE_CHARBUF(port_str, 64); Which in turn is expanded to ( https://github.com/erlang/otp/blob/maint/erts/emulator/beam/dtrace-wrapper.h#L42 ): char port_str_BUFFER[size], *port_str = port_str_BUFFER Now, whenever we call sizeof(port_str_BUFFER) we get an expected response (that is: 64). However, when we call sizeof(port_str) we ask for the size of the char pointer, not the size of the structure it's pointing at (it's going to vary depending on the architecture). Shouldn't we use sizeof(DTRACE_CHARBUF_NAME(port_str)) instead when fetching sizes of the argument strings (that macro should be expanded to port_str_BUFFER in the example above)? If you guys agree, I'll prepare appropriate patches and submit a PR for it. Thanks, Michal -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Thu Mar 13 14:04:41 2014 From: erlang@REDACTED (Joe Armstrong) Date: Thu, 13 Mar 2014 14:04:41 +0100 Subject: [erlang-bugs] bug in terminal io Message-ID: %% There is a strange bug in the interaction of the shell with %% terminal io. %% If I run %% 1> bug:test1(). %% <0.46.0> %% Then the prompt is not written out %% If I add a timeout after the function it works %% But only if I type a value in before ten seconds %% 2> bug:test2(). %% enter a term >abc. %% N={ok,abc} %% true %% But AFTER Typing a line the prompt is repeated and the prompt %% vanishes after ten seconds %% If I wait 10 seconds and don't type anything %% the ' enter a term' prompt is written %% and then *removed* after 10 seconds %% If the command started in the shell terminates immediately -module(bug). -export([test1/0, test2/0]). test1() -> spawn(fun() -> N = io:read(' enter a term >'), io:format("N=~p~n",[N]) end). test2() -> spawn(fun() -> N = io:read(' enter a term >'), io:format("N=~p~n",[N]) end), receive after 10000 -> true end. /Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From daimon@REDACTED Mon Mar 17 04:08:53 2014 From: daimon@REDACTED (Masatake Daimon) Date: Mon, 17 Mar 2014 12:08:53 +0900 Subject: [erlang-bugs] R16B03-1: ssl application crashes when a server emits an unrecognized_name(112) alert Message-ID: <53266745.8010605@ymir.co.jp> Hello, I found the ssl application in R16B03-1 crashes when a server emits an unrecognized_name(112) alert. If the alert is fatal, ssl_alert:description_txt/1 crashes. And if it's a warning, tls_connection:handle_alert/3 crashes: > % erl > Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V5.10.4 (abort with ^G) > 1> inets:start(). ssl:start(). inets:start(httpc, [{profile, test}]). > ok > 2> ssl:start(). inets:start(httpc, [{profile, test}]). > ok > 3> inets:start(httpc, [{profile, test}]). > {ok,<0.61.0>} > 4> httpc:request("https://localhost/", test). > > =ERROR REPORT==== 14-Mar-2014::18:23:56 === > ** State machine <0.67.0> terminating > ** Last message in was {tcp,#Port<0.2726>, > <<21,3,3,0,2,1,112,22,3,3,0,53,2,0,0,49,3,3,83,34, > ... > ** Reason for termination = > ** {function_clause, > [{tls_connection,handle_alert, > [{alert,1,112,{"tls_connection.erl",375}}, > hello, > {state,client, > {#Ref<0.0.0.69>,<0.63.0>}, > gen_tcp,tls_connection,tcp,tcp_closed,tcp_error,"localhost", > 443,#Port<0.2726>, > {ssl_options,undefined, > ... The alert in question is unrecognized_name(112) at warning(1) level. RFC 6066 [*1] is indeed saying that a server is NOT RECOMMENDED to send a warning-level unrecognized_name(112) alert, because the client's behavior in response to warning-level alerts is unpredictable. But tls_connection:handle_alert/3 should not crash nonetheless. Should SNI be enabled by default? Maybe. Then what should happen if a server emits unrecognized_name? I think the following scheme is the most appropriate: 1. If the alert is fatal, the connection must be immediately closed according to RFC 5246 [*2]. And this is the current behavior of tls_connection:handle_alert/3 (while ssl_alert:description_txt/1 crashes with function_clause due to an unmatched pattern). 2. If it is a warning, we should only log it (tls_connection:log_alert/3) and proceed the handshake. In this case the requested host name and the server certification will be likely to disagree so the connection will be aborted if {verify, verify_peer} is given. *1: http://tools.ietf.org/html/rfc6066#section-3 *2: http://tools.ietf.org/html/rfc5246#section-7.2.2 Thanks, -- ?? ?? From ulf.norell@REDACTED Tue Mar 18 17:50:13 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Tue, 18 Mar 2014 17:50:13 +0100 Subject: [erlang-bugs] Internal error in sys_core_fold when matching on map is guaranteed to fail In-Reply-To: <949D4DE2-5656-46DA-A07B-F5431D4D6543@gmail.com> References: <949D4DE2-5656-46DA-A07B-F5431D4D6543@gmail.com> Message-ID: That fixed the case when the map doesn't match but I get the same error when it's the map that matches and other patterns that don't: -module(bug). f() -> case #{} of #{} -> 0; a -> 1 end. This is on master from today (aab1afa8a63081f2c30f83ebe8b6caaac979795c). / Ulf On Tue, Mar 4, 2014 at 11:38 PM, Anthony Ramine wrote: > https://github.com/erlang/otp/pull/267 > > -- > Anthony Ramine > > Le 4 mars 2014 ? 09:45, Ulf Norell a ?crit : > > > This one crashes in a different place but likely for the same reason. > > > > -module(bug). > > f() -> > > case true of > > #{} -> error; > > true -> ok > > end. > > > > $ erl > > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] > [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > > > Eshell V6.0 (abort with ^G) > > 1> c(bug). > > Function: f/0 > > bug.erl: internal error in core_fold_module; > > crash reason: function_clause > > > > in function sys_core_fold:opt_bool_clauses/3 > > called as sys_core_fold:opt_bool_clauses([],true,false) > > in call from sys_core_fold:opt_bool_clauses/3 (sys_core_fold.erl, line > 1815) > > in call from sys_core_fold:opt_bool_clauses/1 (sys_core_fold.erl, line > 1790) > > in call from sys_core_fold:opt_bool_case/1 (sys_core_fold.erl, line > 1779) > > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 347) > > in call from sys_core_fold:opt_simple_let_1/4 (sys_core_fold.erl, line > 2562) > > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 355) > > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > > bug.erl:2: Warning: function f/0 is unused > > error > > > > / Ulf > > > > > > > > On Tue, Mar 4, 2014 at 9:42 AM, Ulf Norell wrote: > > -module(bug). > > f() -> > > case maybe_map of > > #{} -> ok; > > not_map -> error > > end. > > > > $ erl > > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] > [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > > > Eshell V6.0 (abort with ^G) > > 1> c(bug). > > Function: f/0 > > bug.erl: internal error in core_fold_module; > > crash reason: {case_clause,{none}} > > > > in function sys_core_fold:will_match/2 (sys_core_fold.erl, line 1748) > > in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1701) > > in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1718) > > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > > in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481) > > in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699) > > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > > bug.erl:2: Warning: function f/0 is unused > > error > > > > / Ulf > > > > > > _______________________________________________ > > erlang-bugs mailing list > > erlang-bugs@REDACTED > > http://erlang.org/mailman/listinfo/erlang-bugs > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Tue Mar 18 18:53:41 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 18 Mar 2014 18:53:41 +0100 Subject: [erlang-bugs] Internal error in sys_core_fold when matching on map is guaranteed to fail In-Reply-To: References: <949D4DE2-5656-46DA-A07B-F5431D4D6543@gmail.com> Message-ID: <0B476549-3C09-4094-B37C-BC20AF8FFB38@gmail.com> Cool, will look at it. -- Anthony Ramine Le 18 mars 2014 ? 17:50, Ulf Norell a ?crit : > That fixed the case when the map doesn't match but I get the same error when it's the map that matches and other patterns that don't: > > -module(bug). > f() -> > case #{} of > #{} -> 0; > a -> 1 > end. > > This is on master from today (aab1afa8a63081f2c30f83ebe8b6caaac979795c). > > / Ulf > > > On Tue, Mar 4, 2014 at 11:38 PM, Anthony Ramine wrote: > https://github.com/erlang/otp/pull/267 > > -- > Anthony Ramine > > Le 4 mars 2014 ? 09:45, Ulf Norell a ?crit : > > > This one crashes in a different place but likely for the same reason. > > > > -module(bug). > > f() -> > > case true of > > #{} -> error; > > true -> ok > > end. > > > > $ erl > > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > > > Eshell V6.0 (abort with ^G) > > 1> c(bug). > > Function: f/0 > > bug.erl: internal error in core_fold_module; > > crash reason: function_clause > > > > in function sys_core_fold:opt_bool_clauses/3 > > called as sys_core_fold:opt_bool_clauses([],true,false) > > in call from sys_core_fold:opt_bool_clauses/3 (sys_core_fold.erl, line 1815) > > in call from sys_core_fold:opt_bool_clauses/1 (sys_core_fold.erl, line 1790) > > in call from sys_core_fold:opt_bool_case/1 (sys_core_fold.erl, line 1779) > > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 347) > > in call from sys_core_fold:opt_simple_let_1/4 (sys_core_fold.erl, line 2562) > > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 355) > > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > > bug.erl:2: Warning: function f/0 is unused > > error > > > > / Ulf > > > > > > > > On Tue, Mar 4, 2014 at 9:42 AM, Ulf Norell wrote: > > -module(bug). > > f() -> > > case maybe_map of > > #{} -> ok; > > not_map -> error > > end. > > > > $ erl > > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > > > Eshell V6.0 (abort with ^G) > > 1> c(bug). > > Function: f/0 > > bug.erl: internal error in core_fold_module; > > crash reason: {case_clause,{none}} > > > > in function sys_core_fold:will_match/2 (sys_core_fold.erl, line 1748) > > in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1701) > > in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1718) > > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > > in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481) > > in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699) > > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > > in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > > bug.erl:2: Warning: function f/0 is unused > > error > > > > / Ulf > > > > > > _______________________________________________ > > erlang-bugs mailing list > > erlang-bugs@REDACTED > > http://erlang.org/mailman/listinfo/erlang-bugs > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > From n.oxyde@REDACTED Tue Mar 18 19:58:20 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 18 Mar 2014 19:58:20 +0100 Subject: [erlang-bugs] Internal error in sys_core_fold when matching on map is guaranteed to fail In-Reply-To: <0B476549-3C09-4094-B37C-BC20AF8FFB38@gmail.com> References: <949D4DE2-5656-46DA-A07B-F5431D4D6543@gmail.com> <0B476549-3C09-4094-B37C-BC20AF8FFB38@gmail.com> Message-ID: <8ED6E738-2B89-4699-ACF5-AE45B835FD7F@gmail.com> Hello, Are map literals supposed to be considered data, as per cerl:is_data/1? can I currently fix this by changing is_data(#c_literal{}) -> true; to is_data(#c_literal{val=V}) when not is_map(V) -> true; or not? Regards, -- Anthony Ramine Le 18 mars 2014 ? 18:53, Anthony Ramine a ?crit : > Cool, will look at it. > > -- > Anthony Ramine > > Le 18 mars 2014 ? 17:50, Ulf Norell a ?crit : > >> That fixed the case when the map doesn't match but I get the same error when it's the map that matches and other patterns that don't: >> >> -module(bug). >> f() -> >> case #{} of >> #{} -> 0; >> a -> 1 >> end. >> >> This is on master from today (aab1afa8a63081f2c30f83ebe8b6caaac979795c). >> >> / Ulf >> >> >> On Tue, Mar 4, 2014 at 11:38 PM, Anthony Ramine wrote: >> https://github.com/erlang/otp/pull/267 >> >> -- >> Anthony Ramine >> >> Le 4 mars 2014 ? 09:45, Ulf Norell a ?crit : >> >>> This one crashes in a different place but likely for the same reason. >>> >>> -module(bug). >>> f() -> >>> case true of >>> #{} -> error; >>> true -> ok >>> end. >>> >>> $ erl >>> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] >>> >>> Eshell V6.0 (abort with ^G) >>> 1> c(bug). >>> Function: f/0 >>> bug.erl: internal error in core_fold_module; >>> crash reason: function_clause >>> >>> in function sys_core_fold:opt_bool_clauses/3 >>> called as sys_core_fold:opt_bool_clauses([],true,false) >>> in call from sys_core_fold:opt_bool_clauses/3 (sys_core_fold.erl, line 1815) >>> in call from sys_core_fold:opt_bool_clauses/1 (sys_core_fold.erl, line 1790) >>> in call from sys_core_fold:opt_bool_case/1 (sys_core_fold.erl, line 1779) >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 347) >>> in call from sys_core_fold:opt_simple_let_1/4 (sys_core_fold.erl, line 2562) >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 355) >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) >>> bug.erl:2: Warning: function f/0 is unused >>> error >>> >>> / Ulf >>> >>> >>> >>> On Tue, Mar 4, 2014 at 9:42 AM, Ulf Norell wrote: >>> -module(bug). >>> f() -> >>> case maybe_map of >>> #{} -> ok; >>> not_map -> error >>> end. >>> >>> $ erl >>> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] >>> >>> Eshell V6.0 (abort with ^G) >>> 1> c(bug). >>> Function: f/0 >>> bug.erl: internal error in core_fold_module; >>> crash reason: {case_clause,{none}} >>> >>> in function sys_core_fold:will_match/2 (sys_core_fold.erl, line 1748) >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1701) >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1718) >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) >>> in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481) >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699) >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) >>> bug.erl:2: Warning: function f/0 is unused >>> error >>> >>> / Ulf >>> >>> >>> _______________________________________________ >>> erlang-bugs mailing list >>> erlang-bugs@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-bugs >> >> _______________________________________________ >> erlang-bugs mailing list >> erlang-bugs@REDACTED >> http://erlang.org/mailman/listinfo/erlang-bugs >> > From wallentin.dahlberg@REDACTED Tue Mar 18 21:45:02 2014 From: wallentin.dahlberg@REDACTED (=?ISO-8859-1?Q?Bj=F6rn=2DEgil_Dahlberg?=) Date: Tue, 18 Mar 2014 21:45:02 +0100 Subject: [erlang-bugs] Internal error in sys_core_fold when matching on map is guaranteed to fail In-Reply-To: <8ED6E738-2B89-4699-ACF5-AE45B835FD7F@gmail.com> References: <949D4DE2-5656-46DA-A07B-F5431D4D6543@gmail.com> <0B476549-3C09-4094-B37C-BC20AF8FFB38@gmail.com> <8ED6E738-2B89-4699-ACF5-AE45B835FD7F@gmail.com> Message-ID: In the future Maps should be considered as data but since it seemed like I needed a crowbar and some soap to whack it into the cerl opt structure "nicely" I decided against it for now, fearing more destruction than gains .. also I wanted literals in the master branch. =) The omission of maps as data will currently omit some core optimizations .. which is also totally ok .. for now. is_data(#c_literal{val=V}) when not is_map(V) -> true; Looks reasonable to me at this point. Give me a shout if you see/find any flaws with this plan. // Bj?rn-Egil 2014-03-18 19:58 GMT+01:00 Anthony Ramine : > Hello, > > Are map literals supposed to be considered data, as per cerl:is_data/1? > can I currently fix this by changing > > is_data(#c_literal{}) -> > true; > > to > > is_data(#c_literal{val=V}) when not is_map(V) -> > true; > > or not? > > Regards, > > -- > Anthony Ramine > > Le 18 mars 2014 ? 18:53, Anthony Ramine a ?crit : > > > Cool, will look at it. > > > > -- > > Anthony Ramine > > > > Le 18 mars 2014 ? 17:50, Ulf Norell a ?crit : > > > >> That fixed the case when the map doesn't match but I get the same error > when it's the map that matches and other patterns that don't: > >> > >> -module(bug). > >> f() -> > >> case #{} of > >> #{} -> 0; > >> a -> 1 > >> end. > >> > >> This is on master from today (aab1afa8a63081f2c30f83ebe8b6caaac979795c). > >> > >> / Ulf > >> > >> > >> On Tue, Mar 4, 2014 at 11:38 PM, Anthony Ramine > wrote: > >> https://github.com/erlang/otp/pull/267 > >> > >> -- > >> Anthony Ramine > >> > >> Le 4 mars 2014 ? 09:45, Ulf Norell a ?crit : > >> > >>> This one crashes in a different place but likely for the same reason. > >>> > >>> -module(bug). > >>> f() -> > >>> case true of > >>> #{} -> error; > >>> true -> ok > >>> end. > >>> > >>> $ erl > >>> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] > [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > >>> > >>> Eshell V6.0 (abort with ^G) > >>> 1> c(bug). > >>> Function: f/0 > >>> bug.erl: internal error in core_fold_module; > >>> crash reason: function_clause > >>> > >>> in function sys_core_fold:opt_bool_clauses/3 > >>> called as sys_core_fold:opt_bool_clauses([],true,false) > >>> in call from sys_core_fold:opt_bool_clauses/3 (sys_core_fold.erl, > line 1815) > >>> in call from sys_core_fold:opt_bool_clauses/1 (sys_core_fold.erl, > line 1790) > >>> in call from sys_core_fold:opt_bool_case/1 (sys_core_fold.erl, line > 1779) > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 347) > >>> in call from sys_core_fold:opt_simple_let_1/4 (sys_core_fold.erl, > line 2562) > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 355) > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > >>> bug.erl:2: Warning: function f/0 is unused > >>> error > >>> > >>> / Ulf > >>> > >>> > >>> > >>> On Tue, Mar 4, 2014 at 9:42 AM, Ulf Norell > wrote: > >>> -module(bug). > >>> f() -> > >>> case maybe_map of > >>> #{} -> ok; > >>> not_map -> error > >>> end. > >>> > >>> $ erl > >>> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] > [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > >>> > >>> Eshell V6.0 (abort with ^G) > >>> 1> c(bug). > >>> Function: f/0 > >>> bug.erl: internal error in core_fold_module; > >>> crash reason: {case_clause,{none}} > >>> > >>> in function sys_core_fold:will_match/2 (sys_core_fold.erl, line 1748) > >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1701) > >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1718) > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > >>> in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481) > >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699) > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > >>> bug.erl:2: Warning: function f/0 is unused > >>> error > >>> > >>> / Ulf > >>> > >>> > >>> _______________________________________________ > >>> erlang-bugs mailing list > >>> erlang-bugs@REDACTED > >>> http://erlang.org/mailman/listinfo/erlang-bugs > >> > >> _______________________________________________ > >> erlang-bugs mailing list > >> erlang-bugs@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-bugs > >> > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Fri Mar 21 15:45:07 2014 From: rvirding@REDACTED (Robert Virding) Date: Fri, 21 Mar 2014 15:45:07 +0100 Subject: [erlang-bugs] bug in terminal io In-Reply-To: References: Message-ID: In the test1 case do you get the shell prompt? Or nothing? If you get the shell prompt what happens when you enter a new shell command? Do you then see the 'enter a term> ' prompt? Or just see a new shell prompt? Robert On 13 March 2014 14:04, Joe Armstrong wrote: > %% There is a strange bug in the interaction of the shell with > %% terminal io. > > %% If I run > > %% 1> bug:test1(). > %% <0.46.0> > > %% Then the prompt is not written out > > %% If I add a timeout after the function it works > %% But only if I type a value in before ten seconds > > %% 2> bug:test2(). > %% enter a term >abc. > %% N={ok,abc} > %% true > > %% But AFTER Typing a line the prompt is repeated and the prompt > %% vanishes after ten seconds > > %% If I wait 10 seconds and don't type anything > %% the ' enter a term' prompt is written > %% and then *removed* after 10 seconds > > %% If the command started in the shell terminates immediately > > -module(bug). > -export([test1/0, test2/0]). > > test1() -> > spawn(fun() -> > N = io:read(' enter a term >'), > io:format("N=~p~n",[N]) > end). > > test2() -> > spawn(fun() -> > N = io:read(' enter a term >'), > io:format("N=~p~n",[N]) > end), > receive > after 10000 -> > true > end. > > /Joe > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lserranov@REDACTED Sat Mar 22 07:13:45 2014 From: lserranov@REDACTED (Luis A. Serrano) Date: Fri, 21 Mar 2014 23:13:45 -0700 (PDT) Subject: [erlang-bugs] systools:make_script returns "Undefined applications: [asn1]" when generating boot script that enables ssl In-Reply-To: <1395468276.15152.YahooMailNeo@web120205.mail.ne1.yahoo.com> References: <1395468276.15152.YahooMailNeo@web120205.mail.ne1.yahoo.com> Message-ID: <1395468825.56838.YahooMailNeo@web120201.mail.ne1.yahoo.com> Hello, I have a setup with CentOS release 6.5 (Final) 64 bits. I Installed Erlang?R16B03-1, nothing fancy, just something like: ./configure --with-ssl=/usr/lib64 && make && make install My intention is to enable ssl in Erlang so that I can do https tests with tsung. http by itself goes well. I was following notes at?http://www.erlang.org/doc/apps/ssl/ssl_distribution.html about using ssl in Erlang section 3.2. So I generated the file?start_ssl.rel like this: {release, {"OTP? APN 181 01","R16B03-1"}, {erts, "5.10.4"}, ?[{kernel,"2.16.4"}, ? {stdlib,"1.19.4"}, ? {crypto, "3.2"}, ? {public_key, "0.21"}, ? {ssl, "5.3.3"} ? ?]}. Then ran: # erl Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V5.10.4? (abort with ^G) 1> systools:make_script("start_ssl",[]). Undefined applications: [asn1] error 2> ? Somehow systools is failing. I did bunch of google searches and I was not able to find somebody with same problem. I'm sorry for the ignorance but is there a way to enable/define application asn1? Many thanks Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From dch@REDACTED Sat Mar 22 08:58:45 2014 From: dch@REDACTED (Dave Cottlehuber) Date: Sat, 22 Mar 2014 08:58:45 +0100 Subject: [erlang-bugs] systools:make_script returns "Undefined applications: [asn1]" when generating boot script that enables ssl In-Reply-To: <1395468825.56838.YahooMailNeo@web120201.mail.ne1.yahoo.com> References: <1395468276.15152.YahooMailNeo@web120205.mail.ne1.yahoo.com> <1395468825.56838.YahooMailNeo@web120201.mail.ne1.yahoo.com> Message-ID: Luis, Add {asn1, "2.0.4"}, to your .rel file. If that works, consider sending a patch for the relevant doc http://github.com/erlang/otp/tree/master/lib/ssl/doc/src/ssl_distribution.xml On 22 March 2014 07:13, Luis A. Serrano wrote: > > Hello, I have a setup with CentOS release 6.5 (Final) 64 bits. > > I Installed Erlang R16B03-1, nothing fancy, just something like: > > ./configure --with-ssl=/usr/lib64 && make && make install > > My intention is to enable ssl in Erlang so that I can do https tests with > tsung. http by itself goes well. > > I was following notes at > http://www.erlang.org/doc/apps/ssl/ssl_distribution.html about using ssl in > Erlang section 3.2. So I generated the file start_ssl.rel like this: > > {release, {"OTP APN 181 01","R16B03-1"}, {erts, "5.10.4"}, > [{kernel,"2.16.4"}, > {stdlib,"1.19.4"}, > {crypto, "3.2"}, > {public_key, "0.21"}, > {ssl, "5.3.3"} > ]}. > > > Then ran: > # erl > Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:4:4] [async-threads:10] > [hipe] [kernel-poll:false] > > Eshell V5.10.4 (abort with ^G) > 1> systools:make_script("start_ssl",[]). > Undefined applications: [asn1] > error > 2> > > Somehow systools is failing. I did bunch of google searches and I was not > able to find somebody with same problem. > > I'm sorry for the ignorance but is there a way to enable/define application > asn1? > > Many thanks > Luis > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > From lserranov@REDACTED Sat Mar 22 18:16:32 2014 From: lserranov@REDACTED (Luis A. Serrano) Date: Sat, 22 Mar 2014 10:16:32 -0700 (PDT) Subject: [erlang-bugs] systools:make_script returns "Undefined applications: [asn1]" when generating boot script that enables ssl In-Reply-To: References: <1395468276.15152.YahooMailNeo@web120205.mail.ne1.yahoo.com> <1395468825.56838.YahooMailNeo@web120201.mail.ne1.yahoo.com> Message-ID: <1395508592.42347.YahooMailNeo@web120205.mail.ne1.yahoo.com> Hi Dave,? Many thanks. That worked. I got the "expected" ok now. Regarding the patch for relevant doc, I'm pretty new here and instead of fixing I would be causing more damage. For now I will let somebody else to do that. Thanks again! Regards Luis? ________________________________ From: Dave Cottlehuber To: Luis A. Serrano Cc: "erlang-bugs@REDACTED" Sent: Saturday, March 22, 2014 12:58 AM Subject: Re: [erlang-bugs] systools:make_script returns "Undefined applications: [asn1]" when generating boot script that enables ssl Luis, Add {asn1, "2.0.4"}, to your .rel file. If that works, consider sending a patch for the relevant doc http://github.com/erlang/otp/tree/master/lib/ssl/doc/src/ssl_distribution.xml On 22 March 2014 07:13, Luis A. Serrano wrote: > > Hello, I have a setup with CentOS release 6.5 (Final) 64 bits. > > I Installed Erlang R16B03-1, nothing fancy, just something like: > > ./configure --with-ssl=/usr/lib64 && make && make install > > My intention is to enable ssl in Erlang so that I can do https tests with > tsung. http by itself goes well. > > I was following notes at > http://www.erlang.org/doc/apps/ssl/ssl_distribution.html about using ssl in > Erlang section 3.2. So I generated the file start_ssl.rel like this: > > {release, {"OTP? APN 181 01","R16B03-1"}, {erts, "5.10.4"}, >? [{kernel,"2.16.4"}, >? {stdlib,"1.19.4"}, >? {crypto, "3.2"}, >? {public_key, "0.21"}, >? {ssl, "5.3.3"} >? ? ]}. > > > Then ran: > # erl > Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:4:4] [async-threads:10] > [hipe] [kernel-poll:false] > > Eshell V5.10.4? (abort with ^G) > 1> systools:make_script("start_ssl",[]). > Undefined applications: [asn1] > error > 2> > > Somehow systools is failing. I did bunch of google searches and I was not > able to find somebody with same problem. > > I'm sorry for the ignorance but is there a way to enable/define application > asn1? > > Many thanks > Luis > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lserranov@REDACTED Sun Mar 23 06:32:59 2014 From: lserranov@REDACTED (Luis A. Serrano) Date: Sat, 22 Mar 2014 22:32:59 -0700 (PDT) Subject: [erlang-bugs] systools:make_script returns "Undefined applications: [asn1]" when generating boot script that enables ssl In-Reply-To: <1395508592.42347.YahooMailNeo@web120205.mail.ne1.yahoo.com> References: <1395468276.15152.YahooMailNeo@web120205.mail.ne1.yahoo.com> <1395468825.56838.YahooMailNeo@web120201.mail.ne1.yahoo.com> <1395508592.42347.YahooMailNeo@web120205.mail.ne1.yahoo.com> Message-ID: <1395552779.18546.YahooMailNeo@web120206.mail.ne1.yahoo.com> Hi,? It looks like I hit a new problem. When following bellow guide and just for the sake of making sure I get what I'm supposed to get I see trouble: http://www.erlang.org/doc/apps/ssl/using_ssl.html section 2.2. step 2: # erl -sname server Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V5.10.4? (abort with ^G) (server@REDACTED)1> ssl:start(). ok (server@REDACTED)2> {ok, ListenSocket} =ssl:listen(9999, [{certfile, "/TOOLS/cert.pem"}, {keyfile, "/TOOLS/key.pem"} ,{reuseaddr, true}]). {ok,{sslsocket,nil, ?? ? ? ? ? ? ? {#Port<0.1152>, ? ? ? ? ? ? ? ? {config,{ssl_options,undefined, ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{3,3},{3,2},{3,1},{3,0}], ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? verify_none, ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {#Fun,[]}, ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? false,false,undefined,1,<<"/TOOLS/cert.pem">>,undefined, ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? <<"/TOOLS/key.pem">>,undefined,[],undefined,<<>>,undefined, ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? undefined,undefined,undefined,...}, ? ? ? ? ? ? ? ? ? ? ? ? [{reuseaddr,true}], ? ? ? ? ? ? ? ? ? ? ? ? {socket_options,list,0,0,0,true}, ? ? ? ? ? ? ? ? ? ? ? ? [{reuseaddr,true}, ?? ? ? ? ? ? ? ? ? ? ? ? {packet_size,0}, ?? ? ? ? ? ? ? ? ? ? ? ? {packet,0}, ?? ? ? ? ? ? ? ? ? ? ? ? {header,0}, ?? ? ? ? ? ? ? ? ? ? ? ? {active,false}, ?? ? ? ? ? ? ? ? ? ? ? ? {mode,binary}], ? ? ? ? ? ? ? ? ? ? ? ? {gen_tcp,tcp,tcp_closed,tcp_error}, ? ? ? ? ? ? ? ? ? ? ? ? tls_connection}}}} (server@REDACTED)3>? That very long message is not expected (I guess), the doc says I would be getting: {ok,{sslsocket, [...]}} So there is still something which is not right here. Please notice I'm using the ssl pkgs shiped with centos itself. Saying this just in case. Please advise. Many thanks Luis ________________________________ From: Luis A. Serrano To: Dave Cottlehuber Cc: "erlang-bugs@REDACTED" Sent: Saturday, March 22, 2014 10:16 AM Subject: Re: [erlang-bugs] systools:make_script returns "Undefined applications: [asn1]" when generating boot script that enables ssl Hi Dave,? Many thanks. That worked. I got the "expected" ok now. Regarding the patch for relevant doc, I'm pretty new here and instead of fixing I would be causing more damage. For now I will let somebody else to do that. Thanks again! Regards Luis? ________________________________ From: Dave Cottlehuber To: Luis A. Serrano Cc: "erlang-bugs@REDACTED" Sent: Saturday, March 22, 2014 12:58 AM Subject: Re: [erlang-bugs] systools:make_script returns "Undefined applications: [asn1]" when generating boot script that enables ssl Luis, Add {asn1, "2.0.4"}, to your .rel file. If that works, consider sending a patch for the relevant doc http://github.com/erlang/otp/tree/master/lib/ssl/doc/src/ssl_distribution.xml -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Sun Mar 23 12:29:58 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sun, 23 Mar 2014 12:29:58 +0100 Subject: [erlang-bugs] Internal error in sys_core_fold when matching on map is guaranteed to fail In-Reply-To: References: <949D4DE2-5656-46DA-A07B-F5431D4D6543@gmail.com> <0B476549-3C09-4094-B37C-BC20AF8FFB38@gmail.com> <8ED6E738-2B89-4699-ACF5-AE45B835FD7F@gmail.com> Message-ID: <00BCA30C-A3FE-4DF3-B5E2-8AEF059DEEEF@gmail.com> https://github.com/erlang/otp/pull/306 -- Anthony Ramine Le 18 mars 2014 ? 21:45, Bj?rn-Egil Dahlberg a ?crit : > In the future Maps should be considered as data but since it seemed like I needed a crowbar and some soap to whack it into the cerl opt structure "nicely" I decided against it for now, fearing more destruction than gains .. also I wanted literals in the master branch. =) The omission of maps as data will currently omit some core optimizations .. which is also totally ok .. for now. > > is_data(#c_literal{val=V}) when not is_map(V) -> > true; > > Looks reasonable to me at this point. Give me a shout if you see/find any flaws with this plan. > > // Bj?rn-Egil > > > 2014-03-18 19:58 GMT+01:00 Anthony Ramine : > Hello, > > Are map literals supposed to be considered data, as per cerl:is_data/1? can I currently fix this by changing > > is_data(#c_literal{}) -> > true; > > to > > is_data(#c_literal{val=V}) when not is_map(V) -> > true; > > or not? > > Regards, > > -- > Anthony Ramine > > Le 18 mars 2014 ? 18:53, Anthony Ramine a ?crit : > > > Cool, will look at it. > > > > -- > > Anthony Ramine > > > > Le 18 mars 2014 ? 17:50, Ulf Norell a ?crit : > > > >> That fixed the case when the map doesn't match but I get the same error when it's the map that matches and other patterns that don't: > >> > >> -module(bug). > >> f() -> > >> case #{} of > >> #{} -> 0; > >> a -> 1 > >> end. > >> > >> This is on master from today (aab1afa8a63081f2c30f83ebe8b6caaac979795c). > >> > >> / Ulf > >> > >> > >> On Tue, Mar 4, 2014 at 11:38 PM, Anthony Ramine wrote: > >> https://github.com/erlang/otp/pull/267 > >> > >> -- > >> Anthony Ramine > >> > >> Le 4 mars 2014 ? 09:45, Ulf Norell a ?crit : > >> > >>> This one crashes in a different place but likely for the same reason. > >>> > >>> -module(bug). > >>> f() -> > >>> case true of > >>> #{} -> error; > >>> true -> ok > >>> end. > >>> > >>> $ erl > >>> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > >>> > >>> Eshell V6.0 (abort with ^G) > >>> 1> c(bug). > >>> Function: f/0 > >>> bug.erl: internal error in core_fold_module; > >>> crash reason: function_clause > >>> > >>> in function sys_core_fold:opt_bool_clauses/3 > >>> called as sys_core_fold:opt_bool_clauses([],true,false) > >>> in call from sys_core_fold:opt_bool_clauses/3 (sys_core_fold.erl, line 1815) > >>> in call from sys_core_fold:opt_bool_clauses/1 (sys_core_fold.erl, line 1790) > >>> in call from sys_core_fold:opt_bool_case/1 (sys_core_fold.erl, line 1779) > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 347) > >>> in call from sys_core_fold:opt_simple_let_1/4 (sys_core_fold.erl, line 2562) > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 355) > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > >>> bug.erl:2: Warning: function f/0 is unused > >>> error > >>> > >>> / Ulf > >>> > >>> > >>> > >>> On Tue, Mar 4, 2014 at 9:42 AM, Ulf Norell wrote: > >>> -module(bug). > >>> f() -> > >>> case maybe_map of > >>> #{} -> ok; > >>> not_map -> error > >>> end. > >>> > >>> $ erl > >>> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > >>> > >>> Eshell V6.0 (abort with ^G) > >>> 1> c(bug). > >>> Function: f/0 > >>> bug.erl: internal error in core_fold_module; > >>> crash reason: {case_clause,{none}} > >>> > >>> in function sys_core_fold:will_match/2 (sys_core_fold.erl, line 1748) > >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1701) > >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1718) > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > >>> in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481) > >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699) > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > >>> bug.erl:2: Warning: function f/0 is unused > >>> error > >>> > >>> / Ulf > >>> > >>> > >>> _______________________________________________ > >>> erlang-bugs mailing list > >>> erlang-bugs@REDACTED > >>> http://erlang.org/mailman/listinfo/erlang-bugs > >> > >> _______________________________________________ > >> erlang-bugs mailing list > >> erlang-bugs@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-bugs > >> > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > From tuncer.ayaz@REDACTED Sun Mar 23 21:16:34 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sun, 23 Mar 2014 21:16:34 +0100 Subject: [erlang-bugs] utils/make_compiler_flags error In-Reply-To: <531070B7.70300@erlang.org> References: <2FE8322F-CADD-4589-B6F2-826D50279048@gmail.com> <5310700F.4000306@erlang.org> <531070B7.70300@erlang.org> Message-ID: On Fri, Feb 28, 2014 at 12:19 PM, Bj?rn-Egil Dahlberg wrote: > On 2014-02-28 12:16, Lukas Larsson wrote: >> >> On 26/02/14 13:26, Anthony Ramine wrote: >>> >>> That bug was already reported and Lukas Larsson had written a fix: >>> >>> https://github.com/garazdawi/otp/tree/lukas/erts/make_deps_fixes >>> >>> Regards, >>> >> >> Hmm, seems like I forgot to merge that... will fix for 17.0 release. > > ^^ > > I see my point from our retrospective is shining brightly. =) Status? From ulf.norell@REDACTED Mon Mar 24 08:53:51 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Mon, 24 Mar 2014 08:53:51 +0100 Subject: [erlang-bugs] Internal error in sys_core_dsetel when binding variables in map expressions Message-ID: I have a couple more map-related issues. Same error for both of these: -module(bug). f() -> a = b#{c => X = 0}, #{c => X}. -module(bug). f() -> a = {X = 0}#{}, #{a => X}. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-c2b4eab] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/0 bug.erl: internal error in core_dsetel_module; crash reason: {badmatch,error} in function sys_core_dsetel:visit/2 (sys_core_dsetel.erl, line 98) in call from sys_core_dsetel:visit/2 (sys_core_dsetel.erl, line 110) in call from lists:mapfoldl/3 (lists.erl, line 1352) in call from sys_core_dsetel:visit/2 (sys_core_dsetel.erl, line 186) in call from sys_core_dsetel:visit/2 (sys_core_dsetel.erl, line 142) in call from lists:mapfoldl/3 (lists.erl, line 1352) in call from sys_core_dsetel:visit/2 (sys_core_dsetel.erl, line 186) in call from sys_core_dsetel:visit/2 (sys_core_dsetel.erl, line 124) bug.erl:2: Warning: function f/0 is unused bug.erl:3: Warning: map construction will fail because of a type mismatch bug.erl:3: Warning: this clause cannot match because of different types/sizes error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell@REDACTED Mon Mar 24 08:55:42 2014 From: ulf.norell@REDACTED (Ulf Norell) Date: Mon, 24 Mar 2014 08:55:42 +0100 Subject: [erlang-bugs] Internal error in v3_codegen Message-ID: -module(bug). f() when false, is_map((true andalso b)#{a => 0}) -> ok. $ erl Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-c2b4eab] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> c(bug). Function: f/0 bug.erl: internal error in v3_codegen; crash reason: {case_clause,{'EXIT',{{badmatch,[]}, [{v3_codegen,call_cg,7, [{file,"v3_codegen.erl"},{line,1123}]}, {v3_codegen,guard_cg,5, [{file,"v3_codegen.erl"},{line,1019}]}, {v3_codegen,'-guard_cg_list/6-anonymous-0-',4, [{file,"v3_codegen.erl"},{line,1062}]}, {v3_codegen,flatmapfoldl,3, [{file,"v3_codegen.erl"},{line,2165}]}, {v3_codegen,guard_cg_list,6, [{file,"v3_codegen.erl"},{line,1060}]}, {v3_codegen,protected_cg,7, [{file,"v3_codegen.erl"},{line,1032}]}, {v3_codegen,guard_clause_cg,4, [{file,"v3_codegen.erl"},{line,999}]}, {v3_codegen,match_cg,5, [{file,"v3_codegen.erl"},{line,282}]}]}}} in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 495) in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 292) in call from compile:fold_comp/3 (compile.erl, line 310) in call from compile:internal_comp/4 (compile.erl, line 294) in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153) bug.erl:2: Warning: function f/0 is unused bug.erl:2: Warning: map construction will fail because of a type mismatch bug.erl:2: Warning: the result of the expression is ignored (suppress the warning by assigning the expression to the _ variable) error / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Mon Mar 24 09:40:58 2014 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 24 Mar 2014 09:40:58 +0100 Subject: [erlang-bugs] utils/make_compiler_flags error In-Reply-To: References: <2FE8322F-CADD-4589-B6F2-826D50279048@gmail.com> <5310700F.4000306@erlang.org> <531070B7.70300@erlang.org> Message-ID: <532FEF9A.1090907@erlang.org> Fix has been merged but not pushed to github yet. Lukas On 23/03/14 21:16, Tuncer Ayaz wrote: > On Fri, Feb 28, 2014 at 12:19 PM, Bj?rn-Egil Dahlberg wrote: >> On 2014-02-28 12:16, Lukas Larsson wrote: >>> On 26/02/14 13:26, Anthony Ramine wrote: >>>> That bug was already reported and Lukas Larsson had written a fix: >>>> >>>> https://github.com/garazdawi/otp/tree/lukas/erts/make_deps_fixes >>>> >>>> Regards, >>>> >>> Hmm, seems like I forgot to merge that... will fix for 17.0 release. >> ^^ >> >> I see my point from our retrospective is shining brightly. =) > Status? > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > From wallentin.dahlberg@REDACTED Mon Mar 24 10:44:29 2014 From: wallentin.dahlberg@REDACTED (=?ISO-8859-1?Q?Bj=F6rn=2DEgil_Dahlberg?=) Date: Mon, 24 Mar 2014 10:44:29 +0100 Subject: [erlang-bugs] Internal error in sys_core_fold when matching on map is guaranteed to fail In-Reply-To: <00BCA30C-A3FE-4DF3-B5E2-8AEF059DEEEF@gmail.com> References: <949D4DE2-5656-46DA-A07B-F5431D4D6543@gmail.com> <0B476549-3C09-4094-B37C-BC20AF8FFB38@gmail.com> <8ED6E738-2B89-4699-ACF5-AE45B835FD7F@gmail.com> <00BCA30C-A3FE-4DF3-B5E2-8AEF059DEEEF@gmail.com> Message-ID: Logging. I had a private discussion with Anthony. The suggested solution is not the way to solve it. In fact, the same problem occurs with binaries as well. 2014-03-23 12:29 GMT+01:00 Anthony Ramine : > https://github.com/erlang/otp/pull/306 > > -- > Anthony Ramine > > Le 18 mars 2014 ? 21:45, Bj?rn-Egil Dahlberg > a ?crit : > > > In the future Maps should be considered as data but since it seemed like > I needed a crowbar and some soap to whack it into the cerl opt structure > "nicely" I decided against it for now, fearing more destruction than gains > .. also I wanted literals in the master branch. =) The omission of maps as > data will currently omit some core optimizations .. which is also totally > ok .. for now. > > > > is_data(#c_literal{val=V}) when not is_map(V) -> > > true; > > > > Looks reasonable to me at this point. Give me a shout if you see/find > any flaws with this plan. > > > > // Bj?rn-Egil > > > > > > 2014-03-18 19:58 GMT+01:00 Anthony Ramine : > > Hello, > > > > Are map literals supposed to be considered data, as per cerl:is_data/1? > can I currently fix this by changing > > > > is_data(#c_literal{}) -> > > true; > > > > to > > > > is_data(#c_literal{val=V}) when not is_map(V) -> > > true; > > > > or not? > > > > Regards, > > > > -- > > Anthony Ramine > > > > Le 18 mars 2014 ? 18:53, Anthony Ramine a ?crit : > > > > > Cool, will look at it. > > > > > > -- > > > Anthony Ramine > > > > > > Le 18 mars 2014 ? 17:50, Ulf Norell a ?crit : > > > > > >> That fixed the case when the map doesn't match but I get the same > error when it's the map that matches and other patterns that don't: > > >> > > >> -module(bug). > > >> f() -> > > >> case #{} of > > >> #{} -> 0; > > >> a -> 1 > > >> end. > > >> > > >> This is on master from today > (aab1afa8a63081f2c30f83ebe8b6caaac979795c). > > >> > > >> / Ulf > > >> > > >> > > >> On Tue, Mar 4, 2014 at 11:38 PM, Anthony Ramine > wrote: > > >> https://github.com/erlang/otp/pull/267 > > >> > > >> -- > > >> Anthony Ramine > > >> > > >> Le 4 mars 2014 ? 09:45, Ulf Norell a ?crit : > > >> > > >>> This one crashes in a different place but likely for the same reason. > > >>> > > >>> -module(bug). > > >>> f() -> > > >>> case true of > > >>> #{} -> error; > > >>> true -> ok > > >>> end. > > >>> > > >>> $ erl > > >>> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] > [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > >>> > > >>> Eshell V6.0 (abort with ^G) > > >>> 1> c(bug). > > >>> Function: f/0 > > >>> bug.erl: internal error in core_fold_module; > > >>> crash reason: function_clause > > >>> > > >>> in function sys_core_fold:opt_bool_clauses/3 > > >>> called as sys_core_fold:opt_bool_clauses([],true,false) > > >>> in call from sys_core_fold:opt_bool_clauses/3 (sys_core_fold.erl, > line 1815) > > >>> in call from sys_core_fold:opt_bool_clauses/1 (sys_core_fold.erl, > line 1790) > > >>> in call from sys_core_fold:opt_bool_case/1 (sys_core_fold.erl, line > 1779) > > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 347) > > >>> in call from sys_core_fold:opt_simple_let_1/4 (sys_core_fold.erl, > line 2562) > > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 355) > > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > > >>> bug.erl:2: Warning: function f/0 is unused > > >>> error > > >>> > > >>> / Ulf > > >>> > > >>> > > >>> > > >>> On Tue, Mar 4, 2014 at 9:42 AM, Ulf Norell > wrote: > > >>> -module(bug). > > >>> f() -> > > >>> case maybe_map of > > >>> #{} -> ok; > > >>> not_map -> error > > >>> end. > > >>> > > >>> $ erl > > >>> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] > [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > >>> > > >>> Eshell V6.0 (abort with ^G) > > >>> 1> c(bug). > > >>> Function: f/0 > > >>> bug.erl: internal error in core_fold_module; > > >>> crash reason: {case_clause,{none}} > > >>> > > >>> in function sys_core_fold:will_match/2 (sys_core_fold.erl, line > 1748) > > >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1701) > > >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1718) > > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > > >>> in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481) > > >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699) > > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > > >>> bug.erl:2: Warning: function f/0 is unused > > >>> error > > >>> > > >>> / Ulf > > >>> > > >>> > > >>> _______________________________________________ > > >>> erlang-bugs mailing list > > >>> erlang-bugs@REDACTED > > >>> http://erlang.org/mailman/listinfo/erlang-bugs > > >> > > >> _______________________________________________ > > >> erlang-bugs mailing list > > >> erlang-bugs@REDACTED > > >> http://erlang.org/mailman/listinfo/erlang-bugs > > >> > > > > > > > _______________________________________________ > > erlang-bugs mailing list > > erlang-bugs@REDACTED > > http://erlang.org/mailman/listinfo/erlang-bugs > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruan.jonker@REDACTED Mon Mar 24 15:04:51 2014 From: ruan.jonker@REDACTED (Ruan Jonker) Date: Mon, 24 Mar 2014 16:04:51 +0200 Subject: [erlang-bugs] httpc memory leak with stand_alone profile and persistent HTTP connections. Message-ID: Hi, I've discovered a memory leak in httpc, which occurs when you are using httpc with a stand_alone profile and using persistent http connections in R16B03-1. After some investigation, it turns out that the issue has been around since R14B04 (maybe even before), but it has been hidden by another bug which was fixed somewhere in R15. Synopsis: -------------- 1. Start a stand_alone profile. 2. Establish a persistent http connection to a server that is never recycled. 3. In a continuous loop, keep on submitting requests on the same persistent connection at an interval less than keep_alive_timeout (default is 2 minutes), i.e. the tcp connection is kept alive (assuming the server does not kill the tcp connection). 4. The ETS table used by the httpc_manager to keep track of requests per httpc_handler process (PROFILENAME__handler_db) grows without ever being cleaned up, even though the httpc_handler sends "request_done" notifications (gen_server:cast) for each completed request, back to the httpc_manager. 5. Either kill the server endpoint or stop submitting requests for longer than keep_alive_timeout, so that the tcp connection in 2. can be recycled, either way, the httpc_manager process will get an 'EXIT' / 'DOWN' notification, and THEN ONLY it will clean the PROFILENAME__handler_db ETStable. Code to reproduce (incl. workaround) in R16B03-1: ------------------------------------------------------------------------- -module(reproduce_httpc_stand_alone_memory_leak_r16b03_1). -export([go/0]). go() -> application:start(inets), TcpPort = 20031, NumClientRequests = 5, %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Start a httpc server %%%%%%%%%%%%%%%%%%%%%%%%%%%%% NotifyReadyPid = self(), ServerPid = spawn(fun() -> server_listen(NotifyReadyPid, TcpPort) end), receive listening -> ok end, %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Start the httpc stand_alone profile {ok, ProfilePid} = inets:start(httpc, [{profile, my_profile}], stand_alone), %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %First run without workaround io:format("whereis(stand_alone_my_profile) => ~p~n", [whereis (stand_alone_my_profile)]), ClientPid = start_the_client(ProfilePid, TcpPort, NumClientRequests), monitor(process, ClientPid), receive {'DOWN', _, _, ClientPid, _} -> ok end, %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %HttpClient connection will recycle %after 1000ms of inactivity, which will trigger the %cleanup of the ETS table timer:sleep(1100), 0 = ets:info(stand_alone_my_profile__handler_db, size), %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Implement workaround io:format("now for the workaround... register(~p,~p) ~n",[stand_alone_my_profile, ProfilePid]), register(stand_alone_my_profile, ProfilePid), %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Second run with workaround io:format("whereis(stand_alone_my_profile) => ~p~n", [whereis (stand_alone_my_profile)]), ClientPid2 = start_the_client(ProfilePid, TcpPort, NumClientRequests), monitor(process, ClientPid2), receive {'DOWN', _, _, ClientPid2, _} -> ok end, %%%%%%%%%%%%%%%%%%%%%%%%%%%%% init:stop(). %HttpServer server_listen(NotifyReadyPid, Port) -> {ok, LS} = gen_tcp:listen(Port, [{ip, {127,0,0,1}}, binary]), NotifyReadyPid ! listening, server_accept(LS). server_accept(LS) -> {ok, AS} = gen_tcp:accept(LS), ok = inet:setopts(AS, [{packet, http}, {active, false}]), WPid = spawn(fun() -> receive gogogo -> ok end, server_worker(AS) end), ok = gen_tcp:controlling_process(AS, WPid), WPid ! gogogo, server_accept(LS). server_worker(AS) -> case recv_to_http_eoh(AS) of ok -> Rsp = <<"HTTP/1.1 200 OK\r\nContent-Length: 2\r\nContent-Type: text/html\r\n\r\nOK">>, ok = gen_tcp:send(AS, Rsp), server_worker(AS); closed -> ok end. recv_to_http_eoh(AS) -> case gen_tcp:recv(AS, 0) of {ok, http_eoh} -> ok; {error, closed} -> closed; {ok, _Packet} -> recv_to_http_eoh(AS) end. %HttpClient start_the_client(ProfilePid, TcpPort, NumRequests) -> ok = httpc:set_options([{max_sessions, 1}, {max_pipeline_length, 0}, {pipeline_timeout, 0}, {max_keep_alive_length, 1}, {keep_alive_timeout, 1000}], ProfilePid), Url = "http://localhost:"++integer_to_list(TcpPort)++"/temp", spawn(fun() -> worker_thread(Url, ProfilePid, NumRequests) end). worker_thread(Url, ProfilePid, 0) -> io:format("ets:info(stand_alone_my_profile__handler_db, info) => ~p~n", [ets:info(stand_alone_my_profile__handler_db, size)]); worker_thread(Url, ProfilePid, NumRequests) when NumRequests > 0 -> {ok, {200, <<"OK">>}} = httpc:request(get, {Url, []}, [], [{body_format, binary}, {full_result, false}], ProfilePid), io:format("client ~p request completed.~n", [self()]), io:format("ets:info(stand_alone_my_profile__handler_db, info) => ~p~n", [ets:info(stand_alone_my_profile__handler_db, size)]), worker_thread(Url, ProfilePid, NumRequests - 1). %EOF >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Proposed patch: ------------------------ On file : otp_src_R16B03-1/lib/inets/src/http_client/httpc_manager.erl(didn't have the R17 src) 82a83 > Server = {local, ProfileName}, 86c87 < gen_server:start_link(?MODULE, Args, Opts); --- > gen_server:start_link(Server, ?MODULE, Args, Opts); Other notes: ------------------ The reason why this issue never surfaced in R14B04, is because of the kepos specified when creating the __handler_db ETS table : In file otp_src_R14B04/lib/inets/src/http_client/httpc_manager.erl: You have : -record(handler_info, { id, % Id of the request: request_id() starter, % Pid of the handler starter process (temp): pid() handler, % Pid of the handler process: pid() from, % From for the request: from() state % State of the handler: initiating | started | operational | canceled }). and in do_init/2 : ets:new(HandlerDbName, [protected, set, named_table, {keypos, #handler_info.id}]), #handler_info.id maps to element at position 2 in the tuple (element 1 is the record name), which means the httpc_handler Pid is used as key for adding new entries to __handler_db, instead of the reference generated for each new request (see lines 656 and 716 in same file). The net effect being that the __handler_db table being "cleaned" by overriding any existing request entry to a given httpc_handler pid. In later versions (R15 and up), the ETS table is created with : ets:new(HandlerDbName, [protected, set, named_table, {keypos, 1}]) which results in the reference associated with each request being used for creating new entries in the relevant __handler_db table, causing the memory leak. --END-- -- Ruan Jonker South Africa +27824619036 -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Tue Mar 25 02:40:55 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Mon, 24 Mar 2014 21:40:55 -0400 Subject: [erlang-bugs] io device() type incomplete Message-ID: The io man page defines the device() type as follows: device() = atom() | pid() An IO device. Either standard_io, standard_error, a registered name, or a pid handling IO protocols (returned from file:open/2). But this is incomplete, since file:open/2 can also return an instance of a file_descriptor record. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Tue Mar 25 02:45:31 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Mon, 24 Mar 2014 21:45:31 -0400 Subject: [erlang-bugs] io device() type incomplete In-Reply-To: References: Message-ID: On Mon, Mar 24, 2014 at 9:40 PM, Steve Vinoski wrote: > The io man page defines the device() type as follows: > > device() = atom() | pid() > > An IO device. Either standard_io, standard_error, a registered > name, or a pid handling IO protocols (returned from file:open/2). > > But this is incomplete, since file:open/2 can also return an instance of a > file_descriptor record. > Also meant to add that there are functions in the io module that take device() type parameters but do not handle file_descriptor records. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From pieterb@REDACTED Tue Mar 25 13:47:19 2014 From: pieterb@REDACTED (Pieter Bouwer) Date: Tue, 25 Mar 2014 14:47:19 +0200 Subject: [erlang-bugs] R17 RC 2: Accessing Map Message-ID: <53317AD7.9080307@pharos-avantgard.com> Hi, Sorry if this is a duplicate, but I couldn't find a bug report dealing with this. In the EEP (43 - http://www.erlang.org/eeps/eep-0043.html) for the map data type, syntax for accessing the value associated with a key is suggested as, e.g. key 'a_key' in map M: |V = M#{ 'a_key' }.| However, if I try to do this (from the shell), I get a syntax error: > M#{'a_key'}. * 1: syntax error before: '}' I don't know if this is still planned as part of the syntax - the EEP was released in April last year. -- Regards, Pieter Bouwer -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Tue Mar 25 14:25:52 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Tue, 25 Mar 2014 14:25:52 +0100 Subject: [erlang-bugs] R17 RC 2: Accessing Map In-Reply-To: <53317AD7.9080307@pharos-avantgard.com> References: <53317AD7.9080307@pharos-avantgard.com> Message-ID: On Tue, Mar 25, 2014 at 1:47 PM, Pieter Bouwer wrote: > Sorry if this is a duplicate, but I couldn't find a bug report dealing > with this. It is not implemented. Nor will it be for Release 17.0. It is still planned though as something to address later. You can currently get the same behaviour by pattern matching on the map, rather than using a projection out of the map. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From egil@REDACTED Tue Mar 25 14:28:34 2014 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Tue, 25 Mar 2014 14:28:34 +0100 Subject: [erlang-bugs] R17 RC 2: Accessing Map In-Reply-To: <53317AD7.9080307@pharos-avantgard.com> References: <53317AD7.9080307@pharos-avantgard.com> Message-ID: <53318482.2030005@erlang.org> Single value access syntax i.e., V = M#{ 'a_key }, will not be a part of Maps. At least not in OTP 17.0. Implemented Maps functionality in OTP 17.0 will be described in the reference manual and vill be a subset of what's described in the EEP. Note "will be" .. currently not in master. =) Perhaps you are wondering, "why not?" Two issues, 1) We don't really like the current syntax proposal, 2) It is unclear if it is really needed, and if it is needed .. if this is the way forward. I would prefer some sort of generic lensing instead .. but we are getting way ahead of ourselves here. // Bj?rn-Egil, Erlang/OTP On 2014-03-25 13:47, Pieter Bouwer wrote: > Hi, > > Sorry if this is a duplicate, but I couldn't find a bug report dealing > with this. > > In the EEP (43 - http://www.erlang.org/eeps/eep-0043.html) for the map > data type, syntax for accessing the value associated with a key is > suggested as, e.g. key 'a_key' in map M: > > |V = M#{ 'a_key' }.| > > However, if I try to do this (from the shell), I get a syntax error: > > > M#{'a_key'}. > * 1: syntax error before: '}' > > I don't know if this is still planned as part of the syntax - the EEP > was released in April last year. > > -- > Regards, > Pieter Bouwer > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Tue Mar 25 14:38:05 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 25 Mar 2014 14:38:05 +0100 Subject: [erlang-bugs] R17 RC 2: Accessing Map In-Reply-To: <53318482.2030005@erlang.org> References: <53317AD7.9080307@pharos-avantgard.com> <53318482.2030005@erlang.org> Message-ID: <533186BD.4010605@ninenines.eu> Hopefully that specific part of the EEP will be dropped. You can already pattern match in function heads and return values easily, and doing it by pattern matching makes the code clearer. On 03/25/2014 02:28 PM, Bj?rn-Egil Dahlberg wrote: > Single value access syntax i.e., V = M#{ 'a_key }, will not be a part of > Maps. At least not in OTP 17.0. > > Implemented Maps functionality in OTP 17.0 will be described in the > reference manual and vill be a subset of what's described in the EEP. > Note "will be" .. currently not in master. =) > > Perhaps you are wondering, "why not?" > > Two issues, > > 1) We don't really like the current syntax proposal, > 2) It is unclear if it is really needed, and if it is needed .. if this > is the way forward. I would prefer some sort of generic lensing instead > .. but we are getting way ahead of ourselves here. > > // Bj?rn-Egil, Erlang/OTP > > On 2014-03-25 13:47, Pieter Bouwer wrote: >> Hi, >> >> Sorry if this is a duplicate, but I couldn't find a bug report dealing >> with this. >> >> In the EEP (43 - http://www.erlang.org/eeps/eep-0043.html) for the map >> data type, syntax for accessing the value associated with a key is >> suggested as, e.g. key 'a_key' in map M: >> >> |V = M#{ 'a_key' }.| >> >> However, if I try to do this (from the shell), I get a syntax error: >> >> > M#{'a_key'}. >> * 1: syntax error before: '}' >> >> I don't know if this is still planned as part of the syntax - the EEP >> was released in April last year. >> >> -- >> Regards, >> Pieter Bouwer >> >> >> _______________________________________________ >> erlang-bugs mailing list >> erlang-bugs@REDACTED >> http://erlang.org/mailman/listinfo/erlang-bugs > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > -- Lo?c Hoguin http://ninenines.eu From n.oxyde@REDACTED Tue Mar 25 21:40:17 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 25 Mar 2014 21:40:17 +0100 Subject: [erlang-bugs] Internal error in sys_core_fold when matching on map is guaranteed to fail In-Reply-To: References: <949D4DE2-5656-46DA-A07B-F5431D4D6543@gmail.com> <0B476549-3C09-4094-B37C-BC20AF8FFB38@gmail.com> <8ED6E738-2B89-4699-ACF5-AE45B835FD7F@gmail.com> <00BCA30C-A3FE-4DF3-B5E2-8AEF059DEEEF@gmail.com> Message-ID: Logging too. https://github.com/erlang/otp/pull/308 -- Anthony Ramine Le 24 mars 2014 ? 10:44, Bj?rn-Egil Dahlberg a ?crit : > Logging. > > I had a private discussion with Anthony. The suggested solution is not the way to solve it. > In fact, the same problem occurs with binaries as well. > > > 2014-03-23 12:29 GMT+01:00 Anthony Ramine : > https://github.com/erlang/otp/pull/306 > > -- > Anthony Ramine > > Le 18 mars 2014 ? 21:45, Bj?rn-Egil Dahlberg a ?crit : > > > In the future Maps should be considered as data but since it seemed like I needed a crowbar and some soap to whack it into the cerl opt structure "nicely" I decided against it for now, fearing more destruction than gains .. also I wanted literals in the master branch. =) The omission of maps as data will currently omit some core optimizations .. which is also totally ok .. for now. > > > > is_data(#c_literal{val=V}) when not is_map(V) -> > > true; > > > > Looks reasonable to me at this point. Give me a shout if you see/find any flaws with this plan. > > > > // Bj?rn-Egil > > > > > > 2014-03-18 19:58 GMT+01:00 Anthony Ramine : > > Hello, > > > > Are map literals supposed to be considered data, as per cerl:is_data/1? can I currently fix this by changing > > > > is_data(#c_literal{}) -> > > true; > > > > to > > > > is_data(#c_literal{val=V}) when not is_map(V) -> > > true; > > > > or not? > > > > Regards, > > > > -- > > Anthony Ramine > > > > Le 18 mars 2014 ? 18:53, Anthony Ramine a ?crit : > > > > > Cool, will look at it. > > > > > > -- > > > Anthony Ramine > > > > > > Le 18 mars 2014 ? 17:50, Ulf Norell a ?crit : > > > > > >> That fixed the case when the map doesn't match but I get the same error when it's the map that matches and other patterns that don't: > > >> > > >> -module(bug). > > >> f() -> > > >> case #{} of > > >> #{} -> 0; > > >> a -> 1 > > >> end. > > >> > > >> This is on master from today (aab1afa8a63081f2c30f83ebe8b6caaac979795c). > > >> > > >> / Ulf > > >> > > >> > > >> On Tue, Mar 4, 2014 at 11:38 PM, Anthony Ramine wrote: > > >> https://github.com/erlang/otp/pull/267 > > >> > > >> -- > > >> Anthony Ramine > > >> > > >> Le 4 mars 2014 ? 09:45, Ulf Norell a ?crit : > > >> > > >>> This one crashes in a different place but likely for the same reason. > > >>> > > >>> -module(bug). > > >>> f() -> > > >>> case true of > > >>> #{} -> error; > > >>> true -> ok > > >>> end. > > >>> > > >>> $ erl > > >>> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > >>> > > >>> Eshell V6.0 (abort with ^G) > > >>> 1> c(bug). > > >>> Function: f/0 > > >>> bug.erl: internal error in core_fold_module; > > >>> crash reason: function_clause > > >>> > > >>> in function sys_core_fold:opt_bool_clauses/3 > > >>> called as sys_core_fold:opt_bool_clauses([],true,false) > > >>> in call from sys_core_fold:opt_bool_clauses/3 (sys_core_fold.erl, line 1815) > > >>> in call from sys_core_fold:opt_bool_clauses/1 (sys_core_fold.erl, line 1790) > > >>> in call from sys_core_fold:opt_bool_case/1 (sys_core_fold.erl, line 1779) > > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 347) > > >>> in call from sys_core_fold:opt_simple_let_1/4 (sys_core_fold.erl, line 2562) > > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 355) > > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > > >>> bug.erl:2: Warning: function f/0 is unused > > >>> error > > >>> > > >>> / Ulf > > >>> > > >>> > > >>> > > >>> On Tue, Mar 4, 2014 at 9:42 AM, Ulf Norell wrote: > > >>> -module(bug). > > >>> f() -> > > >>> case maybe_map of > > >>> #{} -> ok; > > >>> not_map -> error > > >>> end. > > >>> > > >>> $ erl > > >>> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > >>> > > >>> Eshell V6.0 (abort with ^G) > > >>> 1> c(bug). > > >>> Function: f/0 > > >>> bug.erl: internal error in core_fold_module; > > >>> crash reason: {case_clause,{none}} > > >>> > > >>> in function sys_core_fold:will_match/2 (sys_core_fold.erl, line 1748) > > >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1701) > > >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1718) > > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > > >>> in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481) > > >>> in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699) > > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352) > > >>> in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279) > > >>> bug.erl:2: Warning: function f/0 is unused > > >>> error > > >>> > > >>> / Ulf > > >>> > > >>> > > >>> _______________________________________________ > > >>> erlang-bugs mailing list > > >>> erlang-bugs@REDACTED > > >>> http://erlang.org/mailman/listinfo/erlang-bugs > > >> > > >> _______________________________________________ > > >> erlang-bugs mailing list > > >> erlang-bugs@REDACTED > > >> http://erlang.org/mailman/listinfo/erlang-bugs > > >> > > > > > > > _______________________________________________ > > erlang-bugs mailing list > > erlang-bugs@REDACTED > > http://erlang.org/mailman/listinfo/erlang-bugs > > > > From n.oxyde@REDACTED Tue Mar 25 22:05:34 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 25 Mar 2014 22:05:34 +0100 Subject: [erlang-bugs] httpc memory leak with stand_alone profile and persistent HTTP connections. In-Reply-To: References: Message-ID: From what I gather from the documentation, stand alone clients aren?t supposed to be registered. Shouldn?t instead httpc_handler's #state.profile_name be renamed to #state.manager and store either the process name or the pid? Or even maybe just the pid? What is supposed to happen if the manager dies? Are the handlers supposed to live on? -- Anthony Ramine Le 24 mars 2014 ? 15:04, Ruan Jonker a ?crit : > Proposed patch: > ------------------------ > > On file : otp_src_R16B03-1/lib/inets/src/http_client/httpc_manager.erl (didn't have the R17 src) > > 82a83 > > Server = {local, ProfileName}, > 86c87 > < gen_server:start_link(?MODULE, Args, Opts); > --- > > gen_server:start_link(Server, ?MODULE, Args, Opts); From hans.bolinder@REDACTED Wed Mar 26 12:37:02 2014 From: hans.bolinder@REDACTED (Hans Bolinder) Date: Wed, 26 Mar 2014 11:37:02 +0000 Subject: [erlang-bugs] io device() type incomplete In-Reply-To: References: , Message-ID: <56466BD70414EA48969B4064696CF28C037C38C6@ESESSMB207.ericsson.se> Hi, [Steve Vinoski]: > The io man page defines the device() type as follows: > device() = atom() | pid() > > An IO device. Either standard_io, standard_error, a registered > name, or a pid handling IO protocols (returned from file:open/2). > > But this is incomplete, since file:open/2 can also return an > instance of a file_descriptor record. > > Also meant to add that there are functions in the io module that take > device() type parameters but do not handle file_descriptor records. If file:open() is called with the 'raw' option a file_descriptor record is returned. It cannot be used with the io module. I'm not sure, but perhaps you've confused the types io:device() and file:io_device() with each other? Best regards, Hans Bolinder, Erlang/OTP team, Ericsson -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Wed Mar 26 13:45:31 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Wed, 26 Mar 2014 08:45:31 -0400 Subject: [erlang-bugs] io device() type incomplete In-Reply-To: <56466BD70414EA48969B4064696CF28C037C38C6@ESESSMB207.ericsson.se> References: <56466BD70414EA48969B4064696CF28C037C38C6@ESESSMB207.ericsson.se> Message-ID: On Wed, Mar 26, 2014 at 7:37 AM, Hans Bolinder wrote: > Hi, > > [Steve Vinoski]: > > > The io man page defines the device() type as follows: > > device() = atom() | pid() > > > > An IO device. Either standard_io, standard_error, a registered > > name, or a pid handling IO protocols (returned from file:open/2). > > > > But this is incomplete, since file:open/2 can also return an > > instance of a file_descriptor record. > > > > Also meant to add that there are functions in the io module that take > > device() type parameters but do not handle file_descriptor records. > > If file:open() is called with the 'raw' option a file_descriptor > record is returned. It cannot be used with the io module. > > I'm not sure, but perhaps you've confused the types io:device() and > file:io_device() with each other? > Yes, I did. My mistake, apologies for the noise. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.minten@REDACTED Fri Mar 28 14:51:34 2014 From: peter.minten@REDACTED (Peter Minten) Date: Fri, 28 Mar 2014 14:51:34 +0100 Subject: [erlang-bugs] Incorrect matching of non-ASCII characters using \w regex in unicode mode Message-ID: <53357E66.7040006@online.nl> re:run doesn't properly handle non-ASCII characters using unicode mode. On R17-rc2: 1> re:run("G?tterfunken", "\\w+", [{capture, all, list}, unicode]). {match,["G?tterfunken"]} 2> re:run("G?tterfunken", "\\W+", [{capture, all, list}, unicode]). {match,["?"]} Apparently ? is both a word and a non-word character. http://www.erlang.org/doc/man/re.html#regexp_syntax says: """In UTF-8 mode, characters with values greater than 128 never match \d, \s, or \w, and always match \D, \S, and \W. This is true even when Unicode character property support is available. These sequences retain their original meanings from before UTF-8 support was available, mainly for efficiency reasons.""" As I understand this a \w regex should never match ?. Greetings, Peter From n.oxyde@REDACTED Sun Mar 30 13:29:50 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sun, 30 Mar 2014 13:29:50 +0200 Subject: [erlang-bugs] qlc incorrect results from simple query In-Reply-To: <56466BD70414EA48969B4064696CF28C037B21A0@ESESSMB207.ericsson.se> References: <3D949925692E3A429DEFDEECDA1DDB91A10BB58F@SVLITMX02.shoretel.com> <56466BD70414EA48969B4064696CF28C037B21A0@ESESSMB207.ericsson.se> Message-ID: <331E4D41-3316-49E3-B0A2-FB5A8F3D6C05@gmail.com> Hello, It would be cool if bug reporters could be told when a bug was fixed. Regards, -- Anthony Ramine Le 28 f?vr. 2014 ? 12:31, Hans Bolinder a ?crit : > Hi, > > [Sam Bobroff:] >> It appears that QLC is returning incorrect results for a fairly simple usage of ?and? and ?or?, >> as shown below: > > Thanks for the bug report. There will be a fix in Erlang/OTP 17.0. > > Best regards, > > Hans Bolinder, Erlang/OTP team, Ericsson > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From adodon@REDACTED Mon Mar 31 22:08:03 2014 From: adodon@REDACTED (Alexei Dodon) Date: Mon, 31 Mar 2014 23:08:03 +0300 Subject: [erlang-bugs] Minor issue: Bad arity display for crypto:hash_update in R16-B03-1 Message-ID: <007301cf4d1c$ec4b13c0$c4e13b40$@luxoft.com> When using deprecated crypto functions, warnings are displayed suggesting use of recommended functions. Use of crypto:hash_update/3 is recommended in a warning message , but arity of crypto:hash_update is 2 (not 3). Example: Erlang R16B03-1 (erts-5.10.4) [source] [async-threads:10] [kernel-poll:false] Eshell V5.10.4 (abort with ^G) 1> c(to_reproduce). to_reproduce.erl:5: Warning: crypto:md5_init/0 is deprecated and will be removed in in a future release; use crypto:hash_init/1 to_reproduce.erl:6: Warning: crypto:md5_update/2 is deprecated and will be removed in in a future release; use crypto:hash_update/3 {ok,to_reproduce} 2> to_reproduce:start(). <<1,35,69,103,137,171,205,239,254,220,186,152,118,84,50, 16,64,0,0,0,0,0,0,0,83,111,109,101,68,...>> 3> crypto:hash hash/2 hash_final/1 hash_init/1 hash_update/2 3> crypto:hash -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: to_reproduce.erl Type: application/octet-stream Size: 123 bytes Desc: not available URL: