From trapexit.erlang-bugs@REDACTED Mon Jul 3 17:29:42 2006 From: trapexit.erlang-bugs@REDACTED (Trap Exit) Date: Mon, 03 Jul 2006 16:29:42 +0100 Subject: This is an test message to erlang-bugs@erlang.org References: Message-ID: <20060703152942.3A6105A1C8@mail.erlangsystems.com> This is an test message to erlang-bugs@REDACTED from Trap Exit _________________________________________________________ Sent using Mail2Forum (http://www.mail2forum.com) Read this topic online here: http://trapexit.erlang-consulting.com/forum/viewtopic.php?p=73#73 From trapexit.erlang-bugs@REDACTED Tue Jul 11 18:15:06 2006 From: trapexit.erlang-bugs@REDACTED (Trap Exit) Date: Tue, 11 Jul 2006 17:15:06 +0100 Subject: Small typo in erlc help text: erlc -? References: Message-ID: <20060711161506.D48335A1E5@mail.erlangsystems.com> Just a small note on the help text for erlc in R11B-0: Where I think: -pa path add path to then of Erlang's code path Should be: -pz path add path to the end of Erlang's code path Did not find any hits on google so I posted tho this mailinglist. User@REDACTED:~>erlc -? Usage:  erlc [options] file.ext ... Options: -b type        type of output file (e.g. jam or beam) -d             turn on debugging of erlc itself -Dname         define name -Dname=value   define name to have value -help          shows this help text -I path        where to search for include files -o name        name output directory or file -pa path       add path to the front of Erlang's code path -pa path       add path to then of Erlang's code path -v             verbose compiler output -W0            disable warnings -Wnumber       set warning level to number -Wall          enable all warnings -W             enable warnings (default; same as -W1) -E             generate listing of expanded code (Erlang compiler) -S             generate assembly listing (Erlang compiler) -P             generate listing of preprocessed code (Erlang compiler) +term          pass the Erlang term unchanged to the compiler Regards, Andreas Hillqvist _________________________________________________________ Post sent from www.trapexit.org Read this topic online here: http://forum.trapexit.org/viewtopic.php?p=19355#19355 From tamas.szilagyi@REDACTED Wed Jul 12 15:28:50 2006 From: tamas.szilagyi@REDACTED (Tamas Szilagyi) Date: Wed, 12 Jul 2006 15:28:50 +0200 Subject: small documentation buglets Message-ID: <44B4F912.8050104@ericsson.com> Hi, After reading through the Programming Examples page of the Erlang/OTP R11B docs I found the following issues. These are really small indeed, however I thought I'd report them. Please forgive me if any of these counts as nitpicking (I'm relatively new to the Erlang world). 2. Funs / 2.3. The Syntax of Funs In the code after "To check whether a term is a fun..." : * "when function(F)" should be "when is_function(F)" * "when integer(N)" should be "when is_integer(N)" 2. Funs / 2.5.4 foreach In reality the shown code example outputs 1 2 3 4 ok instead of the output shown in the document which is: 1 2 3 4 true In conjunction with this, I'm not sure if it's OK to have void() specified as the return value of lists:foreach/2 in the STDLIB/lists reference. Shouldn't it be ok instead of void()? 4. Bit syntax / 4.2 A Lexical Note Note that "B=<<1>>" will be interpreted as "B =< ;<1>>" should be Note that "B=<<1>>" will be interpreted as "B =< <1>>" 4. Bit syntax / 4.6 Matching Binaries In the 2nd paragraph one instance of the word "binary" should be removed from: "There can be zero or more segments in a binary binary pattern." Regards, /Tom From trapexit.erlang-bugs@REDACTED Fri Jul 21 10:09:03 2006 From: trapexit.erlang-bugs@REDACTED (Trap Exit) Date: Fri, 21 Jul 2006 09:09:03 +0100 Subject: HiPE bug with nested try/catch References: Message-ID: <20060721080903.1B99F5A1EF@mail.erlangsystems.com> According to the Erlang ref. manual: Quote: If an exception occurs during evaluation of Expr but there is no matching ExceptionPattern of the right Class with a true guard sequence, the exception is passed on as if Expr had not been enclosed in a try expression. (end of quote) So I constructed the following example and noticed that it behaved differently when HiPE compiled. -module(trycatch). -export([main/0]). main() ->     try         f()     catch         throw:Throw ->             io:format("gotcha: ~p~n", [Throw])     end. f() ->     try         throw('i.wonder.who.will.catch.me')     catch         error:Error ->             io:format("function f caused an error: ~p~n", [Error])     end. Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] Eshell V5.5  (abort with ^G) 1> c(trycatch). {ok,trycatch} 2> trycatch:main(). gotcha: 'i.wonder.who.will.catch.me' ok 3> c(trycatch,native). {ok,trycatch} 4> trycatch:main(). =ERROR REPORT==== 21-Jul-2006::09:56:33 === Error in process <0.32.0> with exit value: {undef,[{erlang,raise,[[[{erlang,raise,[[true|16#4044646A0000000000000000000000000000006A],'i.wonder.who.will.catch.me']},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]|-16#0000000000000000000000000010],undef]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} ** exited: {undef,[{erlang,raise,                            [[[{erlang,raise,                                       [[true|                                         366900607304749881568687426529269484530033492074],                                        'i.wonder.who.will.catch.me']},                               {erl_eval,do_apply,5},                               {shell,exprs,6},                               {shell,eval_loop,3}]|                              -00000000000000000016],                             undef]},                    {erl_eval,do_apply,5},                    {shell,exprs,6},                    {shell,eval_loop,3}]} ** _________________________________________________________ Post sent from http://www.trapexit.org From ulf.wiger@REDACTED Mon Jul 24 13:51:51 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Mon, 24 Jul 2006 13:51:51 +0200 Subject: ms_transform.erl doesn't handle packages Message-ID: I'm sure this isn't something lots of people have run into, but when using packages, a call to ets:fun2ms(Fun) must be written as .ets:fun2ms(Fun). The parse_transform code needs to recognize this form and transform it. (I know that the package support is undocumented and unsupported...) A diff that fixes the problem is given below. BR, Ulf W *** OTP_R11B/lib/stdlib-1.14/src/ms_transform.erl Tue May 23 16:03:38 2006 --- ms_transform.erl Mon Jul 24 13:42:47 2006 *************** *** 297,302 **** --- 297,306 ---- copy({call,Line,{remote,_Line2,{atom,_Line3,ets},{atom,_Line4,fun2ms}}, As0}) -> transform_call(ets,Line,As0); + copy({call,Line,{remote,_Line2,{record_field,_Line3, + {atom,_Line4,''},{atom,_Line5,ets}}, + {atom,_Line6,fun2ms}}, As0}) -> + transform_call(ets,Line,As0); copy({call,Line,{remote,_Line2,{atom,_Line3,dbg},{atom,_Line4,fun2ms}}, As0}) -> transform_call(dbg,Line,As0); From ulf.wiger@REDACTED Mon Jul 24 16:39:30 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Mon, 24 Jul 2006 16:39:30 +0200 Subject: ms_transform.erl doesn't handle packages In-Reply-To: Message-ID: The same goes for QLC. Here's a patch for qlc_pt.erl *** /vobs/otp/otp_delivery/solaris8_sparc/lib/stdlib-1.14/src/qlc_pt.erl Tue May 23 16:03:41 2006 --- qlc_pt.erl Mon Jul 24 16:28:29 2006 *************** *** 35,40 **** --- 35,43 ---- %% Also in qlc.erl. -define(QLC_Q(L1, L2, L3, L4, LC, Os), {call,L1,{remote,L2,{atom,L3,?APIMOD},{atom,L4,?Q}},[LC | Os]}). + -define(QLC_QQ(L1, L2, L3, L4, L5, L6, LC, Os), + {call,L1,{remote,L2,{record_field,L3,{atom,L4,''}, + {atom,L5,?APIMOD}},{atom,L6,?Q}},[LC | Os]}). -define(IMP_Q(L1, L2, LC, Os), {call,L,{atom,L2,?Q},[LC | Os]}). %% Also in qlc.erl. *************** *** 1208,1213 **** --- 1211,1223 ---- NL = make_lcid(L1, No), {T, A} = F(NL, LC, A2), {?QLC_Q(L1, L2, L3, L4, T, Os), A, No + 1}; + qlcmf(?QLC_QQ(L1, L2, L3, L4, L5, L6, LC0, Os0), + F, Imp, A0, No0) when length(Os0) < 2 -> + {Os, A1, No1} = qlcmf(Os0, F, Imp, A0, No0), + {LC, A2, No} = qlcmf(LC0, F, Imp, A1, No1), % nested... + NL = make_lcid(L1, No), + {T, A} = F(NL, LC, A2), + {?QLC_QQ(L1, L2, L3, L4, L5, L6, T, Os), A, No + 1}; qlcmf(?IMP_Q(L1, L2, LC0, Os0), F, Imp=true, A0, No0) when length(Os0) < 2 -> {Os, A1, No1} = qlcmf(Os0, F, Imp, A0, No0), {LC, A2, No} = qlcmf(LC0, F, Imp, A1, No1), % nested... BR, Ulf W > -----Original Message----- > From: owner-erlang-bugs@REDACTED > [mailto:owner-erlang-bugs@REDACTED] On Behalf Of Ulf Wiger (TN/EAB) > Sent: den 24 juli 2006 13:52 > To: erlang-bugs@REDACTED > Subject: ms_transform.erl doesn't handle packages > > > I'm sure this isn't something lots of people have run into, > but when using packages, a call to ets:fun2ms(Fun) must be > written as .ets:fun2ms(Fun). The parse_transform code needs > to recognize this form and transform it. > > (I know that the package support is undocumented and > unsupported...) > > A diff that fixes the problem is given below. > > BR, > Ulf W > > > *** OTP_R11B/lib/stdlib-1.14/src/ms_transform.erl Tue May 23 16:03:38 > 2006 > --- ms_transform.erl Mon Jul 24 13:42:47 2006 > *************** > *** 297,302 **** > --- 297,306 ---- > > copy({call,Line,{remote,_Line2,{atom,_Line3,ets},{atom,_Line4, > fun2ms}}, > As0}) -> > transform_call(ets,Line,As0); > + copy({call,Line,{remote,_Line2,{record_field,_Line3, > + {atom,_Line4,''},{atom,_Line5,ets}}, > + {atom,_Line6,fun2ms}}, As0}) -> > + transform_call(ets,Line,As0); > > copy({call,Line,{remote,_Line2,{atom,_Line3,dbg},{atom,_Line4, > fun2ms}}, > As0}) -> > transform_call(dbg,Line,As0); > From camster@REDACTED Sun Jul 30 12:26:26 2006 From: camster@REDACTED (Richard Cameron) Date: Sun, 30 Jul 2006 11:26:26 +0100 Subject: R11B-0 SMP segfaults in unlink_free_block Message-ID: Hi, I'm seeing fairly regular segmentation faults on R11B-0 on a 2-CPU 64- bit Linux box. It's compiled from source with no special options (other than ./configure --prefix=/opt/erlang). I got beam.smp to dump core, and I've attached a strack trace from gdb below. erts would have been compiled with gcc -O3, so there's a vague possibility that the stack trace is slightly bogus. However, it seems to go wrong only in SMP mode, and the the offending section is called from somewhere in time.c with the rather frightening looking comment: /* Here comes hairy use of the timer fields! * They are reset without having the lock. * It is assumed that no code but this will * accesses any field until the ->timeout * callback is called. */ p->next = NULL; p->slot = 0; (*p->timeout)(p->arg); The application probably has several thousand erlang processes spawned, most of which are performing this sort of hybrid poll/ receive pattern: loop() -> receive event -> handle_event(), after Timeout -> poll_external_system() end, loop(). Is it possible my code's picking out an obscure race condition in the new SMP code? --- (smithers)lisa:~% gdb /opt/erlang/lib/erlang/erts-5.5/bin/beam.smp core.12735 GNU gdb Red Hat Linux (6.3.0.0-1.96rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/tls/libthread_db.so.1". Core was generated by `/opt/erlang/lib/erlang/erts-5.5/bin/beam.smp -- -root /opt/erlang/lib/erlang -p'. Program terminated with signal 11, Segmentation fault. Reading symbols from /lib64/libdl.so.2...done. [...] Loaded symbols for /usr/lib64/libz.so.1 #0 0x000000000043729e in unlink_free_block (allctr=0x677a00, block=0x6e4a38) at beam/erl_goodfit_alloc.c:452 452 blk->prev->next = blk->next; (gdb) bt #0 0x000000000043729e in unlink_free_block (allctr=0x677a00, block=0x6e4a38) at beam/erl_goodfit_alloc.c:452 #1 0x000000000043305b in mbc_free (allctr=0x677a00, p=Variable "p" is not available. ) at beam/erl_alloc_util.c:731 #2 0x0000000000436555 in erts_alcu_free_ts (type=Variable "type" is not available. ) at beam/erl_alloc_util.c:2221 #3 0x000000000047cafe in timer_thread_start (ignore=Variable "ignore" is not available. ) at beam/time.c:292 #4 0x000000000050bea8 in thr_wrapper (vtwd=Variable "vtwd" is not available. ) at common/ethread.c:440 #5 0x00000039a100610a in start_thread () from /lib64/tls/ libpthread.so.0 #6 0x000000399fdc5ee3 in clone () from /lib64/tls/libc.so.6 #7 0x0000000000000000 in ?? ()