From dmitry.kargapolov@REDACTED Wed Aug 1 21:17:45 2007 From: dmitry.kargapolov@REDACTED (Dmitriy Kargapolov) Date: Wed, 01 Aug 2007 15:17:45 -0400 Subject: [erlang-bugs] bug or feature? Message-ID: <46B0DC59.1090800@corp.idt.net> Is it a bug or some magic feature in erlang shell when using atom query with no quotes? Eshell V5.5.4 (abort with ^G) 1> {query, "lalala"}. ** 1: syntax error before: ',' ** 1> {'query', "lalala"}. {'query',"lalala"} 2> From jan@REDACTED Wed Aug 1 21:26:04 2007 From: jan@REDACTED (Jan Henry Nystrom) Date: Wed, 01 Aug 2007 21:26:04 +0200 Subject: [erlang-bugs] [erlang-questions] bug or feature? In-Reply-To: <46B0DC59.1090800@corp.idt.net> References: <46B0DC59.1090800@corp.idt.net> Message-ID: <46B0DE4C.5080706@erlang-consulting.com> Dmitriy Kargapolov wrote: > Is it a bug or some magic feature in erlang shell when using atom query > with no quotes? > > Eshell V5.5.4 (abort with ^G) > 1> {query, "lalala"}. > ** 1: syntax error before: ',' ** > 1> {'query', "lalala"}. > {'query',"lalala"} > 2> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions Hi Dmitriy, It is a (mis)feature, query is a keyword that is used by the Mnesia query language Mnmosyne. It bit me quite a few times when it had been introduced :-). /Cheers Henry -- Jan Henry Nystrom Training & Research Manager @ Erlang Training and Consulting Ltd http://www.erlang-consulting.com From qrilka@REDACTED Wed Aug 1 21:26:37 2007 From: qrilka@REDACTED (Kirill Zaborski) Date: Wed, 1 Aug 2007 23:26:37 +0400 Subject: [erlang-bugs] bug or feature? In-Reply-To: <46B0DC59.1090800@corp.idt.net> References: <46B0DC59.1090800@corp.idt.net> Message-ID: <337538cb0708011226md91d66ap583f41b6940fcf06@mail.gmail.com> I second that and there is a bit simpler variant: Erlang (BEAM) emulator version 5.5.5 [async-threads:0] Eshell V5.5.5 (abort with ^G) (stupid@REDACTED)1> query. ** 1: syntax error before: '.' ** So I do not see how is it possible to use this atom with no quotes. Regards, Kirill. On 8/1/07, Dmitriy Kargapolov wrote: > > Is it a bug or some magic feature in erlang shell when using atom query > with no quotes? > > Eshell V5.5.4 (abort with ^G) > 1> {query, "lalala"}. > ** 1: syntax error before: ',' ** > 1> {'query', "lalala"}. > {'query',"lalala"} > 2> > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs > -------------- next part -------------- An HTML attachment was scrubbed... URL: From markus.ingvarsson@REDACTED Fri Aug 3 23:22:37 2007 From: markus.ingvarsson@REDACTED (Markus Ingvarsson) Date: Fri, 3 Aug 2007 23:22:37 +0200 Subject: [erlang-bugs] Mac OS X dyld chokes on libei.a Message-ID: I'm not sure if this is a bug in libei or OpenMCL[1]. When I try to dynamically load libei.a in OpenMCL (through CFFI[2]), I get this error: Error opening shared library "/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib/libei.a": dyld: /Users/markus/openmcl/ccl/dppccl malformed library: /usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib/libei.a (not a Mach-O file, bad magic number) According to Google, this error means the library is not properly built. I have Mac OS X 10.3, Erlang/OTP R11B-5 (built from source), and OpenMCL 1.0. [1] http://openmcl.clozure.com/ [2] http://common-lisp.net/project/cffi/ -- Markus Ingvarsson 0DF2 D731 70D8 50BC 7CF7 16E8 4FFB 6486 25A6 6AC9 From dmitry.kargapolov@REDACTED Sat Aug 4 00:55:49 2007 From: dmitry.kargapolov@REDACTED (Dmitriy Kargapolov) Date: Fri, 03 Aug 2007 18:55:49 -0400 Subject: [erlang-bugs] Mac OS X dyld chokes on libei.a In-Reply-To: References: Message-ID: <46B3B275.9040007@corp.idt.net> I'm not sure about Mac OS, but per my generic unix experience libei.a is not shared library, so you can not load it dynamically. It needs to be linked statically to target executable application file or target shared library file. Markus Ingvarsson wrote: > I'm not sure if this is a bug in libei or OpenMCL[1]. > > When I try to dynamically load libei.a in OpenMCL (through CFFI[2]), I > get this error: > Error opening shared library > "/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib/libei.a": dyld: > /Users/markus/openmcl/ccl/dppccl malformed library: > /usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib/libei.a (not a > Mach-O file, bad magic number) > > According to Google, this error means the library is not properly built. > > I have Mac OS X 10.3, Erlang/OTP R11B-5 (built from source), and OpenMCL 1.0. > > [1] http://openmcl.clozure.com/ > [2] http://common-lisp.net/project/cffi/ > From vances@REDACTED Sat Aug 11 00:20:38 2007 From: vances@REDACTED (Vance Shipley) Date: Fri, 10 Aug 2007 18:20:38 -0400 Subject: [erlang-bugs] driver_entry init() return value ignored Message-ID: <20070810222038.GA241@little-black-book.motivity.ca> The driver_entry structure is a C struct that all erlang drivers define. It contains entry points for the erlang driver that are called by the erlang emulator when erlang code accesses the driver. The first of the function pointers is init() which is called at system startup for sdtaically linked drivers and after loading for dynamically loaded drivers. The init() function is documented in erts-5.5.5/doc/html/driver_entry.html as: int init(void) This is called directly after the driver has been loaded by erl_ddll:load_driver/2. (Actually when the driver is added to the driver list.) The driver should return 0, or if the driver can't initialize, -1. In the R11B-5 implementation init() is actually defined as returning void, the return value of the driver's init() callback is ignored. I discovered this during development of a linked in driver which was failing to initialize due to library path problems. Instead of erl_ddll:load_driver/1 failing with an appropriate error it was succeeding and the problem wasn't recognized until much later in the startup process. This violates the principal of least astonishment. The attached patch seems to resolve the problem and I have tested it with my dynamically linked drivers. I have not considered what impact this change would have on a staticaly linked driver failing however. -Vance -------------- next part -------------- --- ./erts/emulator/beam/io.c Mon Jun 11 08:52:02 2007 +++ ./erts/emulator/beam/io.c Sat Aug 4 15:28:08 2007 @@ -4514,8 +4514,9 @@ erts_add_driver_entry(drv,rec_lock != NULL); } -void erts_add_driver_entry(ErlDrvEntry *drv, int driver_list_locked) +int erts_add_driver_entry(ErlDrvEntry *drv, int driver_list_locked) { + int res; DE_List *p = erts_alloc(ERTS_ALC_T_DRV_ENTRY_LIST, sizeof(DE_List)); if (!driver_list_locked) { @@ -4534,12 +4535,13 @@ erts_smp_tsd_set(driver_list_lock_status_key, (void *) 1); } if (drv->init != NULL) { - (*drv->init)(); + res = (*drv->init)(); } if (!driver_list_locked) { erts_smp_tsd_set(driver_list_lock_status_key, NULL); erts_smp_mtx_unlock(&erts_driver_list_lock); } + return(res); } /* Not allowed for dynamic drivers */ --- ./erts/emulator/beam/erl_bif_ddll.c Thu Mar 8 03:37:26 2007 +++ ./erts/emulator/beam/erl_bif_ddll.c Sat Aug 4 15:36:24 2007 @@ -1606,9 +1606,10 @@ dh->status = ERL_DE_OK; dp->handle = dh; - erts_add_driver_entry(dp,1); /* io.c */ - - return ERL_DE_NO_ERROR; + if (erts_add_driver_entry(dp,1) != 0) /* io.c */ + return ERL_DE_LOAD_ERROR_FAILED_INIT; + else + return ERL_DE_NO_ERROR; } static int do_unload_driver_entry(DE_Handle *dh, Eterm *save_name) --- ./erts/emulator/drivers/common/ddll_drv.c Mon Jan 29 07:53:37 2007 +++ ./erts/emulator/drivers/common/ddll_drv.c Sat Aug 4 15:37:54 2007 @@ -252,9 +252,10 @@ dp->handle = dh; /* insert driver */ - add_driver_entry(dp); - - return reply(erlang_port, 'o', ""); + if(add_driver_entry(dp)!= 0) + return reply(erlang_port, 'e', "driver_init_failed"); + else + return reply(erlang_port, 'o', ""); } From opfer@REDACTED Wed Aug 15 10:51:01 2007 From: opfer@REDACTED (Christian Faulhammer) Date: Wed, 15 Aug 2007 10:51:01 +0200 Subject: [erlang-bugs] 64-bit and FreeBSD patches, plus SMP activation Message-ID: <20070815105101.0026ad48@localhost> Hi, The Gentoo amd64 and FreeBSD teams have prepared two patches to make it compile for our users. amd64 is for the AMD version and EMT64 from Intel. Maybe those two could be integrated, they are not invasive. Another problem seems to be that erl does not use SMP capabilities by default when built with --enable-smp-support. The following should fix the problem: --- /usr/bin/erl.orig 2007-08-14 18:34:12.003297978 +0200 +++ /usr/bin/erl 2007-08-13 03:48:31.445665891 +0200 @@ -7,4 +7,4 @@ export ROOTDIR export BINDIR export PROGNAME -exec $BINDIR/erlexec ${1+"$@"} +exec $BINDIR/erlexec -smp ${1+"$@"} V-Li -- http://www.gentoo.org/ http://www.faulhammer.org/ http://www.gnupg.org/ -------------- next part -------------- A non-text attachment was scrubbed... Name: erlang-10.2.6-export-TARGET.patch Type: text/x-patch Size: 242 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: erlang-11.2.5-gethostbyname.patch Type: text/x-patch Size: 755 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From goryachev@REDACTED Thu Aug 16 14:38:14 2007 From: goryachev@REDACTED (Igor Goryachev) Date: Thu, 16 Aug 2007 16:38:14 +0400 Subject: [erlang-bugs] http-client fails when gets response w/o headers Message-ID: <87lkcbhcy1.fsf@yandex-team.ru> Hello. It seems there is yet another bug found in http-client while it gets response from http-server with omitted headers (?): 23> http:request("http://shingler:7070/check?aaa=bbb"). {error,session_remotly_closed} 24> =ERROR REPORT==== 16-Aug-2007::16:15:56 === ** Generic server <0.871.0> terminating ** Last message in was {tcp_closed,#Port<0.696>} ** When Server state == {state,{request, #Ref<0.0.0.16664>, <0.31.0>, 0, http, {"shingler",7070}, "/check", "?aaa=bbb", get, {http_request_h, undefined, "keep-alive", undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, "shingler", undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, [], undefined, undefined, undefined, undefined, "0", undefined, undefined, undefined, undefined, undefined, undefined, []}, {[],[]}, {http_options, infinity, true, [], undefined, false}, "http://shingler:7070/check?aaa=bbb", [], none, []}, {tcp_session, {{"shingler",7070},<0.871.0>}, false, http, #Port<0.696>, 1}, undefined, undefined, undefined, {httpc_response, parse_reason_phrase, [<<>>, "TSET\n\nKO", nolimit, [200,"HTTP/1.1"]]}, {[],[]}, new, [], nolimit, nolimit, {options, {undefined,[]}, 0, 2, 2, disabled, enabled, false}, {timers,[],undefined}} ** Reason for termination == ** session_remotly_closed -- Igor Goryachev Yandex development team. From opfer@REDACTED Sun Aug 26 09:39:53 2007 From: opfer@REDACTED (Christian Faulhammer) Date: Sun, 26 Aug 2007 09:39:53 +0200 Subject: [erlang-bugs] Malformatted man pages Message-ID: <20070826093953.6d124004@localhost> Hi, sections in man pages need to be formatted upper case. "See Also" isn't in the ones shipped with erlang, please change it. V-Li -- Christian Faulhammer, Gentoo Lisp project , #gentoo-lisp on FreeNode -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From opfer@REDACTED Sun Aug 26 10:46:02 2007 From: opfer@REDACTED (Christian Faulhammer) Date: Sun, 26 Aug 2007 10:46:02 +0200 Subject: [erlang-bugs] Make build process die when an error occurs Message-ID: <20070826104602.1b3612de@localhost> Hi, it is a good measure to let the build process stop when a compilation error occurs. That is not the case everywhere with erlang. Appended is a patch to correct a port of it. V-Li -- Christian Faulhammer, Gentoo Lisp project , #gentoo-lisp on FreeNode -------------- next part -------------- A non-text attachment was scrubbed... Name: erlang-11.2.5-build.patch Type: text/x-patch Size: 362 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From dougedmunds@REDACTED Wed Aug 29 23:38:08 2007 From: dougedmunds@REDACTED (Doug Edmunds) Date: Wed, 29 Aug 2007 14:38:08 -0700 Subject: [erlang-bugs] ets:match/1 and ets:select/1 Message-ID: Problem with ets:match(continuation); same problem with ets:select(continuation). match/1, and select/1 only work with variables. -- doug edmunds I posted this yesterday, but it never showed up and is not in the archives. Sorry if you receive this twice. 29 August 2007 Example of bug: %set up an ets table A = ets:new(arf,[bag]), ets:insert(A,[{frog,croak}, {duck,quack}, {cow, moo}, {dog, bark}, {dog,pluto}, {dog,tails}, { dog,woof},{cat, meow}, {pig,oink},{chicken, cluck}, {rooster, cockadoodle}]). %match/3 {D, E } = ets:match (A,{'$1','$2'},3 ). E. %% {15,103,3,<<>>,[[dog,bark],[dog,pluto]],2} E == {15,103,3,<<>>,[[dog,bark],[dog,pluto]],2}. %% true. E =:= {15,103,3,<<>>,[[dog,bark],[dog,pluto]],2}. %% true. %continuation that works: ets:match(E). % {[[cow,moo],[dog,bark],[dog,pluto]],{15,132,3,<<>>,[],0}} %bug: continuation that fails: ets:match({15,103,3,<<>>,[[dog,bark],[dog,pluto]],2}). produces this error report: =ERROR REPORT==== 28-Aug-2007::07:33:08 === Error in process <0.30.0> with exit value: {badarg,[{ets,match,[{15,103,3,<<0 by tes>>,[[dog,bark],[dog,pluto]],2}]},{erl_eval,do_apply,5},{shell,exprs,6},{shell ,eval_loop,3}]} ** exited: {badarg,[{ets,match,[{15,103,3,<<>>,[[dog,bark],[dog,pluto]],2}]}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** -------------- next part -------------- An HTML attachment was scrubbed... URL: From cstawarz@REDACTED Thu Aug 30 21:56:30 2007 From: cstawarz@REDACTED (Christopher Stawarz) Date: Thu, 30 Aug 2007 15:56:30 -0400 Subject: [erlang-bugs] Problems in crypto_drv.c Message-ID: I've noticed some issues with the implementation of crypto:rand_bytes() and the crypto driver in general. Here are lines 357-358 of otp_src_R11B-5/lib/crypto/c_src/crypto_drv.c: *rbuf = (char *)(bin = driver_alloc_binary(rlen)); RAND_pseudo_bytes(bin->orig_bytes,rlen); I see the following problems here: 1) The random bytes are generated with RAND_pseudo_bytes(), which (unlike RAND_bytes()) isn't guaranteed to produce a cryptographically-strong result. Perhaps the crypto module should export both rand_bytes() and rand_pseudo_bytes(), so the user can choose? 2) RAND_pseudo_bytes() can fail (returning -1), but the driver won't detect this because it doesn't check the return value. 3) Most seriously, driver_alloc_binary() can return NULL (presumably if malloc() fails), but the code doesn't check for this and blindly dereferences the returned pointer in the next line. Since this is a linked-in driver, a NULL return will lead immediately to the entire VM crashing. Problem (3) (neglecting to check for allocation failures) appears repeatedly throughout crypto_drv.c. While I admit that equating malloc() failure with certain death isn't too unreasonable in many situations, it seems unacceptable in a system reputedly able to provide "9 nines reliability". I'd be interested in hearing explanations/opinions to the contrary. Thanks, Chris Stawarz From gbulmer@REDACTED Thu Aug 30 23:56:40 2007 From: gbulmer@REDACTED (G Bulmer) Date: Thu, 30 Aug 2007 22:56:40 +0100 Subject: [erlang-bugs] Typographic defects in R11B-0 to R11B-5 HTML docs Message-ID: <0CBD275D-DF0E-430E-B2CA-8F821A752647@gmail.com> There are 5 typographic defects in the R11B-0 to R11B-5 HTML documentation in file: /usr/local/lib/erlang/lib/kernel-2.11.5/doc/html/file.html At: file.html:3288: ok = file:write(FD, &lt;&lt;M:32/ unsigned&gt;&gt;), file.html:3306:create_file(FD, M, N) when M + 1024 =&lt; N -> file.html:3314:create_file(FD, M, N0, R) when M + 8 =&lt; N0 -> file.html:3318: [&lt;&lt;N8:32/unsigned, N7:32/unsigned, file.html:3324: These are in the "Performance" section, near the end of the page. Firefox renders: create_file_slow(FD, M, N) -> ok = file:write(FD, <<M:32/unsigned>>), create_file_slow(FD, M+1, N). I believe this should read: create_file_slow(FD, M, N) -> ok = file:write(FD, <>), create_file_slow(FD, M+1, N). Later on the same page, there is: create_file(FD, M, N) when M + 1024 =< N -> instead of: create_file(FD, M, N) when M + 1024 =< N -> Earlier versions of the documentation do not appear to suffer this defect: lib/kernel-2.8.0/doc/html/file.html, lib/kernel-2.10/doc/html/file.html, and lib/kernel-2.10.13/doc/html/file.html are okay. But lib/kernel-2.11/doc/html/file.html contains errors. The HTML source should read: ok = file:write(FD, <<M:32/unsigned>>), but in ... lib/kernel-2.11.5/doc/html/file.html, it reads: ok = file:write(FD, &lt;&lt;M:32/unsigned&gt;&gt;), The HTML escape for '&' has been used, rather than the escape for '<'. There are several explanations, but it's worth noting < is an escape for '<', and & is an escape for '&'. I've grep'ed through the R11B-5 HTML document files, and these have a single defect: /usr/local/lib/erlang/doc/design_principles/sup_princ.html:121: Shutdown = brutal_kill | integer() &gt;=0 | infinity /usr/local/lib/erlang/erts-5.5.5/doc/html/epmd.html:103: *&ld;TABs&gt;/var/log/epmd.log GB