From raimo@REDACTED Sun Jan 2 19:37:19 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 02 Jan 2005 19:37:19 +0100 Subject: R10B-2 Debugger bug? References: <41D3322F.7030508@cisco.com> Message-ID: Yes, we know. I am workin on that. Unfortunately it leads to vast rewrites of the interpreter in the debugger, since all of the code has to be aware of the different kinds of exceptions that do exist now. Some code in the stdlib evaluator has to be rewritten too. And it was a BIF that turned out to be missing - to rethrow an exception with faked stackbacktrace. So, I am on it, and will continue working after my christmas holidays. mscandar@REDACTED (Mark Scandariato) writes: > It looks like the debugger doesn't like try. > > Loading the following module causes the debugger to crash. > > %%%-------------------------------- > -module(dbg_bug). > -compile(export_all). > > oops() -> > try something() > catch > exception -> [] > end. > > something() -> 1. > %%%-------------------------------- > > It doesn't work in R10B-1, either. > > Mark. > > > =ERROR REPORT==== 29-Dec-2004::12:49:10 === > ** Generic server dbg_iserver terminating > ** Last message in was {load,dbg_bug, > "c:/project/dbg_bug.erl", > <<131,104,5,100,0,18,105,110,116,101,114,112,114,10 > 1,116,101,114,95,109,111,100,117,108,101,108,0,0,0,4,104,2,100,0,11,109,111,100, > 117,108,101,95,105,110,102,111,97,0,104,2,100,0,11,109,111,100,117,108,101,95,10 > 5,110,102,111,97,1,104,2,100,0,4,111,111,112,115,97,0,104,2,100,0,9,115,111,109, > 101,116,104,105,110,103,97,0,106,109,0,0,1,2,131,80,0,0,1,198,120,156,109,143,20 > 3,114,195,32,12,69,113,252,160,118,23,221,245,51,154,201,182,63,227,145,65,54,80 > ,108,24,44,242,248,251,192,56,105,147,182,172,196,149,238,209,149,218,73,246,22, > 224,212,195,176,82,0,65,253,241,96,25,99,141,170,36,107,129,40,232,33,18,66,33,8 > 9,53,106,139,106,247,197,222,197,231,222,7,103,80,208,94,14,83,63,196,233,3,131, > 133,226,175,167,153,157,140,22,37,227,183,193,95,35,105,59,23,110,246,58,207,116 > ,120,246,46,80,15,214,170,90,178,151,49,46,130,180,91,32,121,42,231,252,10,44,71 > ,43,114,179,17,22,226,138,80,25,179,105,141,100,37,133,11,212,219,55,91,68,2,65, > 173,202,84,2,185,25,146,173,93,221,140,164,244,50,153,187,241,1,198,55,37,25,106 > ,138,222,222,132,242,135,192,115,71,5,119,122,146,90,60,11,244,57,105,150,203,35 > ,132,172,22,253,247,138,116,101,185,104,11,220,228,247,124,91,247,24,234,159,3,1 > 87,59,36,161,185,94,8,39,12,208,65,145,56,25,139,110,132,87,115,5,184,220,128,14 > 2,109,0,0,0,133,45,109,111,100,117,108,101,40,100,98,103,95,98,117,103,41,46,10, > 45,99,111,109,112,105,108,101,40,101,120,112,111,114,116,95,97,108,108,41,46,10, > 10,111,111,112,115,40,41,32,45,62,10,32,32,32,32,116,114,121,32,115,111,109,101, > 116,104,105,110,103,40,41,10,32,32,32,32,99,97,116,99,104,10,32,32,32,32,32,32,3 > 2,32,101,120,99,101,112,116,105,111,110,32,45,62,32,91,93,10,32,32,32,32,101,110 > ,100,46,10,10,115,111,109,101,116,104,105,110,103,40,41,32,45,62,32,49,46,10,109 > ,0,0,0,16,36,204,253,26,221,194,76,79,20,81,51,41,45,212,55,157>>} > ** When Server state == {state,20,[],[],false,all,[<0.31.0>]} > ** Reason for termination == > ** {{badmatch,{dbg_iload,{unknown_expr, > {'try',5, > [{call,5,{atom,5,something},[]}], > [], > [{clause, > 7, > [{tuple, > 7, > [{atom,7,throw}, > {atom,7,exception}, > {var,7,'_'}]}], > [], > [{nil,7}]}], > []}}}}, > [{dbg_iserver,handle_call,3}, > {gen_server,handle_msg,6}, > {proc_lib,init_p,5}]} > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From ft@REDACTED Sun Jan 2 11:06:19 2005 From: ft@REDACTED (Fredrik Thulin) Date: Sun, 2 Jan 2005 11:06:19 +0100 Subject: two R10B-2 compiler bugs Message-ID: <200501021106.19593.ft@it.su.se> Hi While writing test cases I've come across two bugs in the R10B-2 compiler. I've isolated them in two different directories for you - see the attached file. 1) one <<>> too much : $ /pkg/erlang/R10B-2/bin/erlc -W +debug_info sipserver.erl sipserver: function test/0+190: Internal consistency check failed - please report this bug. Instruction: {put,{x,2}} Error: {heap_overflow,{left,0},{wanted,1}}: $ I was turning the bodys of my request records in the test() function from "" into <<>> and apparently can't have more than a finite number of <<>> before getting this error. 2) don't know what, but it doesn't like my catches ;) $ /pkg/erlang/R10B-2/bin/erlc -W +debug_info sipserver.erl sipserver: function test/0+4973: Internal consistency check failed - please report this bug. Instruction: {'%live',1} Error: unknown_catch_try_state: $ Both cases work when I compile using R10B-1. I compile my Erlangs like this (only difference between R10B-1 and R10B-2 is the --preix) : # ./configure --prefix=/pkg-2004-08-02/erlang/R10B-2 --with-ssl=/pkg-2004-08-02/openssl/0.9.7d --with-hipe # make # make install /Fredrik PS. I found the bugs on the train, and see now that the second one has been reported already (on erlang-questions@) but I'm sending it anyways since I had already written the bug report and you might be helped by more examples of how to trigger the bug... -------------- next part -------------- A non-text attachment was scrubbed... Name: erlc-bugs.tar.gz Type: application/x-tgz Size: 67544 bytes Desc: not available URL: From mscandar@REDACTED Fri Jan 7 21:35:09 2005 From: mscandar@REDACTED (Mark Scandariato) Date: Fri, 07 Jan 2005 15:35:09 -0500 Subject: Compiler crash with abstract modules... Message-ID: <41DEF27D.30203@cisco.com> Hi, Interesting crash when compiling the following snippet: %%%---------------------- -module(foo, [N]). -compile(export_all). bug(<>) -> V. %%%---------------------- This is equivalent to: %%%---------------------- -module(foo). -compile(export_all). bug(<>, {foo, N}) -> V. %%%---------------------- Which would normally just complain that "variable 'N' is unbound". Here's the crash: foo.erl:none: internal error in v3_codegen; crash reason: {{case_clause,{'EXIT',{function_clause, [{v3_codegen,fetch_stack,['N',[],0]}, {v3_codegen,select_extract_bin,10}, {v3_codegen,select_bin_seg,5}, {v3_codegen,select_binary,6}, {v3_codegen,match_cg,5}, {v3_codegen,match_cg,6}, {v3_codegen, '-cg_list/5-anonymous-0-', 3}, {v3_codegen,flatmapfoldl,3}, {v3_codegen,cg_list,5}, {v3_codegen,cg_fun,4}]}}}, [{compile,'-select_passes/2-anonymous-2-',2}, {compile,'-internal_comp/4-anonymous-1-',2}, {compile,fold_comp,3}, {compile,internal_comp,4}, {compile,internal,3}]} From ulf.wiger@REDACTED Tue Jan 11 17:21:13 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Tue, 11 Jan 2005 17:21:13 +0100 Subject: Internal consistency check failed Message-ID: <37FB7AA6F5F9814FB634A7BF4C35A6F5402A10@ESEALNT442.al.sw.ericsson.se> When trying to build the code in jungerl, I stumbled upon this error message: erlc -W -I ../inc +warn_unused_vars +nowarn_shadow_vars +warn_unused_import -pz ../ebin -o ../ebin gen_leader.erl gen_leader: function handle_msg/4+545: Internal consistency check failed - please report this bug. Instruction: {'%live',1} Error: unknown_catch_try_state: gmake[3]: *** [../ebin/gen_leader.beam] Error 1 This happened using Open Source Erlang r10b-2 and the latest version (1.1) of gen_leader.erl. I can mail the actual file if this error can't be reproduced. Regards, Uffe From ulf.wiger@REDACTED Wed Jan 12 14:21:35 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 12 Jan 2005 14:21:35 +0100 Subject: typo in erl_scan.erl? Message-ID: <37FB7AA6F5F9814FB634A7BF4C35A6F5402A1C@ESEALNT442.al.sw.ericsson.se> The function erl_scan:scan/6 (OTP R10B-2) seems to contain a typo. Consider the first argument of the fourth clause below (line 221 in the source). Surely it should be "<" ++ Cs ?!!! /Uffe %% Punctuation characters and operators, first recognise multiples. %% Clauses are rouped by first character (a short with the same head has %% to come after a longer). %% %% << <- <= scan("<<"++Cs, Stack, Toks, Pos, State, Errors) -> scan(Cs, Stack, [{'<<',Pos}|Toks], Pos, State, Errors); scan("<-"++Cs, Stack, Toks, Pos, State, Errors) -> scan(Cs, Stack, [{'<-',Pos}|Toks], Pos, State, Errors); scan("<="++Cs, Stack, Toks, Pos, State, Errors) -> scan(Cs, Stack, [{'<=',Pos}|Toks], Pos, State, Errors); scan("<"=Cs, Stack, Toks, Pos, State, Errors) -> more(Cs, Stack, Toks, Pos, State, Errors, fun scan/6); From ulf.wiger@REDACTED Wed Jan 12 14:25:59 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 12 Jan 2005 14:25:59 +0100 Subject: typo in erl_scan.erl? Message-ID: <37FB7AA6F5F9814FB634A7BF4C35A6F5402A1D@ESEALNT442.al.sw.ericsson.se> Sorry, my bad. Not a bug Too much in a hurry. /Uffe > -----Original Message----- > From: owner-erlang-bugs@REDACTED > [mailto:owner-erlang-bugs@REDACTED]On Behalf Of Ulf Wiger (AL/EAB) > Sent: den 12 januari 2005 14:22 > To: 'erlang-bugs@REDACTED' > Subject: typo in erl_scan.erl? > > > > The function erl_scan:scan/6 (OTP R10B-2) seems to contain a typo. > Consider the first argument of the fourth clause below (line > 221 in the source). > > Surely it should be "<" ++ Cs ?!!! > > /Uffe > > %% Punctuation characters and operators, first recognise multiples. > %% Clauses are rouped by first character (a short with the > same head has > %% to come after a longer). > %% > %% << <- <= > scan("<<"++Cs, Stack, Toks, Pos, State, Errors) -> > scan(Cs, Stack, [{'<<',Pos}|Toks], Pos, State, Errors); > scan("<-"++Cs, Stack, Toks, Pos, State, Errors) -> > scan(Cs, Stack, [{'<-',Pos}|Toks], Pos, State, Errors); > scan("<="++Cs, Stack, Toks, Pos, State, Errors) -> > scan(Cs, Stack, [{'<=',Pos}|Toks], Pos, State, Errors); > scan("<"=Cs, Stack, Toks, Pos, State, Errors) -> > more(Cs, Stack, Toks, Pos, State, Errors, fun scan/6); > From raimo@REDACTED Wed Jan 12 14:41:20 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 12 Jan 2005 14:41:20 +0100 Subject: typo in erl_scan.erl? References: <37FB7AA6F5F9814FB634A7BF4C35A6F5402A1C@ESEALNT442.al.sw.ericsson.se> Message-ID: No, it is not a typo. The first three clauses takes care of 2-char operators with a leading "<", the fourth clause takes care of the case when the currently buffered data ends with "<". Then there might come other interesting characters after, e.g "=". The function more/7 is called which reads more characters into the buffer and tail recursively eventually gets back to scan/6 to match the third clause for "<=". The leading comment tried to make a hint in this direction. The "<" operator is taken care of with all other one-character operators on line 275..277: 275 %% All single-char punctuation characters and operators (except '.') 276 scan([C|Cs], Stack, Toks, Pos, State, Errors) -> 277 scan(Cs, Stack, [{list_to_atom([C]),Pos}|Toks], Pos, State, Errors); This means that all otherwise unrecognized single characters is interpreted as one-character operators. ulf.wiger@REDACTED (Ulf Wiger AL/EAB) writes: > The function erl_scan:scan/6 (OTP R10B-2) seems to contain a typo. > Consider the first argument of the fourth clause below (line 221 in the source). > > Surely it should be "<" ++ Cs ?!!! > > /Uffe > > %% Punctuation characters and operators, first recognise multiples. > %% Clauses are rouped by first character (a short with the same head has > %% to come after a longer). > %% > %% << <- <= > scan("<<"++Cs, Stack, Toks, Pos, State, Errors) -> > scan(Cs, Stack, [{'<<',Pos}|Toks], Pos, State, Errors); > scan("<-"++Cs, Stack, Toks, Pos, State, Errors) -> > scan(Cs, Stack, [{'<-',Pos}|Toks], Pos, State, Errors); > scan("<="++Cs, Stack, Toks, Pos, State, Errors) -> > scan(Cs, Stack, [{'<=',Pos}|Toks], Pos, State, Errors); > scan("<"=Cs, Stack, Toks, Pos, State, Errors) -> > more(Cs, Stack, Toks, Pos, State, Errors, fun scan/6); -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo@REDACTED Wed Jan 12 14:42:23 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 12 Jan 2005 14:42:23 +0100 Subject: typo in erl_scan.erl? References: <37FB7AA6F5F9814FB634A7BF4C35A6F5402A1D@ESEALNT442.al.sw.ericsson.se> Message-ID: Rats! I have already taken the time to elaborate an answer. ulf.wiger@REDACTED (Ulf Wiger AL/EAB) writes: > Sorry, my bad. Not a bug Too much in a hurry. > > /Uffe > > > -----Original Message----- > > From: owner-erlang-bugs@REDACTED > > [mailto:owner-erlang-bugs@REDACTED]On Behalf Of Ulf Wiger (AL/EAB) > > Sent: den 12 januari 2005 14:22 > > To: 'erlang-bugs@REDACTED' > > Subject: typo in erl_scan.erl? > > > > > > > > The function erl_scan:scan/6 (OTP R10B-2) seems to contain a typo. > > Consider the first argument of the fourth clause below (line > > 221 in the source). > > > > Surely it should be "<" ++ Cs ?!!! > > > > /Uffe > > > > %% Punctuation characters and operators, first recognise multiples. > > %% Clauses are rouped by first character (a short with the > > same head has > > %% to come after a longer). > > %% > > %% << <- <= > > scan("<<"++Cs, Stack, Toks, Pos, State, Errors) -> > > scan(Cs, Stack, [{'<<',Pos}|Toks], Pos, State, Errors); > > scan("<-"++Cs, Stack, Toks, Pos, State, Errors) -> > > scan(Cs, Stack, [{'<-',Pos}|Toks], Pos, State, Errors); > > scan("<="++Cs, Stack, Toks, Pos, State, Errors) -> > > scan(Cs, Stack, [{'<=',Pos}|Toks], Pos, State, Errors); > > scan("<"=Cs, Stack, Toks, Pos, State, Errors) -> > > more(Cs, Stack, Toks, Pos, State, Errors, fun scan/6); > > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB