From sgolovan@REDACTED Thu Oct 5 16:35:34 2006 From: sgolovan@REDACTED (Sergei Golovan) Date: Thu, 5 Oct 2006 18:35:34 +0400 Subject: [erlang-bugs] A small bug in Erlang mode for Emacs Message-ID: Hi! Looks like Erlang mode for Emacs has a bug: When it's used with XEmacs, it binds 'backward-delete-char-untabify to Delete key. The bug is found in Debian Linux, so it's possible that it's Debian-specific. But if not then the following patch fixes it. --------------------------------------------------------------------------- --- erlang.orig/lib/tools/emacs/erlang.el +++ erlang/lib/tools/emacs/erlang.el @@ -1934,7 +1934,9 @@ (define-key map "<" 'erlang-electric-lt) (define-key map ">" 'erlang-electric-gt) (define-key map "\C-m" 'erlang-electric-newline) - (define-key map "\177" 'backward-delete-char-untabify) + (if erlang-xemacs-p + (define-key map [(backspace)] 'backward-delete-char-untabify) + (define-key map "\177" 'backward-delete-char-untabify)) ;;(unless (boundp 'fill-paragraph-function) (define-key map "\M-q" 'erlang-fill-paragraph) (unless (boundp 'beginning-of-defun-function) --------------------------------------------------------------------------- Best wishes! -- Sergei Golovan From datacompboy@REDACTED Sat Oct 7 00:14:32 2006 From: datacompboy@REDACTED (datacompboy) Date: Fri, 06 Oct 2006 23:14:32 +0100 Subject: [erlang-bugs] erl crash on call to http_base_64 References: Message-ID: <20061006221432.E73755A1F8@mail.erlangsystems.com> On http_base_64:decode("dGVzda==a"). erl dies with "Instruction at ... referenced memory at .... The memory could not be written" -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From datacompboy@REDACTED Sun Oct 8 09:36:18 2006 From: datacompboy@REDACTED (datacompboy) Date: Sun, 08 Oct 2006 08:36:18 +0100 Subject: [erlang-bugs] erl crash on call to http_base_64 References: Message-ID: <20061008073618.A00805A1FD@mail.erlangsystems.com> datacompboy wrote: http_base_64:decode("dGVzda==a"). (end of quote) Intresting info: if start debugger and parse module http_base_64 from inets, we got =ERROR REPORT==== 8-Oct-2006::14:15:27 === Error in process <0.129.0> with exit value: {badarith,[{http_base_64,decode_base64_list,[{[29,26,pad,pad],"n"},"set"]}]} ** exited: {badarith,[{http_base_64,decode_base64_list,[{[29,26,pad,pad],"n"},"set"]}]} ** so, looks like that are core bug in runtime system! ... but for http_base_64 fix are simple: change decode_base64_list({[Sixtet1,Sixtet2,pad,pad], []}, Acc) -> to decode_base64_list({[Sixtet1,Sixtet2,pad,pad], _}, Acc) -> and decode_base64_list({[Sixtet1,Sixtet2,Sixtet3,pad], []}, Acc) -> to decode_base64_list({[Sixtet1,Sixtet2,Sixtet3,pad], _}, Acc) -> -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From dmitry.kargapolov@REDACTED Thu Oct 12 17:41:02 2006 From: dmitry.kargapolov@REDACTED (Dmitriy Kargapolov) Date: Thu, 12 Oct 2006 11:41:02 -0400 Subject: [erlang-bugs] erl crash on call to http_base_64 In-Reply-To: <20061008073618.A00805A1FD@mail.erlangsystems.com> References: <20061008073618.A00805A1FD@mail.erlangsystems.com> Message-ID: <452E620E.5070801@corp.idt.net> Small example of segmentation-failing code: test() -> [A,B,C] = [1,a,b], (A bsl 2) bor (B bsl 3) bor C. datacompboy wrote: > > datacompboy wrote: > http_base_64:decode("dGVzda==a"). > (end of quote) > > > Intresting info: if start debugger and parse module http_base_64 from inets, we got > =ERROR REPORT==== 8-Oct-2006::14:15:27 === > Error in process <0.129.0> with exit value: {badarith,[{http_base_64,decode_base64_list,[{[29,26,pad,pad],"n"},"set"]}]} > > ** exited: {badarith,[{http_base_64,decode_base64_list,[{[29,26,pad,pad],"n"},"set"]}]} ** > > so, looks like that are core bug in runtime system! > > ... but for http_base_64 fix are simple: > change > decode_base64_list({[Sixtet1,Sixtet2,pad,pad], []}, Acc) -> > to > decode_base64_list({[Sixtet1,Sixtet2,pad,pad], _}, Acc) -> > > and > decode_base64_list({[Sixtet1,Sixtet2,Sixtet3,pad], []}, Acc) -> > to > decode_base64_list({[Sixtet1,Sixtet2,Sixtet3,pad], _}, Acc) -> > -- > --- suicide proc near\n call death\n suicide endp > _________________________________________________________ > Post sent from http://www.trapexit.org > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs > From balint.reczey@REDACTED Fri Oct 13 22:46:02 2006 From: balint.reczey@REDACTED (=?iso-8859-1?Q?B=E1lint_R=E9czey_=28IJ/ETH=29?=) Date: Fri, 13 Oct 2006 22:46:02 +0200 Subject: [erlang-bugs] http:request/1 bug Message-ID: <120FDEAC96A65F47933985A3AB00DC1A0A6FC2@esealmw116.eemea.ericsson.se> Hi, The URL which i try to retrieve is sent url decoded. Example: http:request("http://erlang.org/bar?asd=M%26M"). The HTTP GET is sent as "http://erlang.org/bar?asd=M&M". Version info: inets-4.7.4 Regards, Balint Reczey From kaol@REDACTED Sun Oct 15 02:22:58 2006 From: kaol@REDACTED (Kari Pahula) Date: Sun, 15 Oct 2006 03:22:58 +0300 Subject: [erlang-bugs] Missing definitions in OTP Design Principles manual Message-ID: <20061015002258.GB24788@sammakko.yok.utu.fi> I didn't find the definitions for alloc/1 and free/2 in OTP Design Principles manual version 5.5.1 (at http://www.erlang.org/doc/doc-5.5.1/doc/design_principles/part_frame.html) sections 1 and 2. For example, in section 1.2 there was this example: -module(ch1). -export([start/0]). -export([alloc/0, free/1]). -export([init/0]). start() -> spawn(ch1, init, []). alloc() -> ch1 ! {self(), alloc}, receive {ch1, Res} -> Res end. free(Ch) -> ch1 ! {free, Ch}, ok. init() -> register(ch1, self()), Chs = channels(), loop(Chs). loop(Chs) -> receive {From, alloc} -> {Ch, Chs2} = alloc(Chs), From ! {ch1, Ch}, loop(Chs2); {free, Ch} -> Chs2 = free(Ch, Chs), loop(Chs2) end. It's not clear from this what alloc(Chs) and free(Ch, Chs) are supposed to do. From ulf@REDACTED Sun Oct 15 10:15:03 2006 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 15 Oct 2006 10:15:03 +0200 Subject: [erlang-bugs] Missing definitions in OTP Design Principles manual In-Reply-To: <20061015002258.GB24788@sammakko.yok.utu.fi> References: <20061015002258.GB24788@sammakko.yok.utu.fi> Message-ID: Den 2006-10-15 02:22:58 skrev Kari Pahula : > I didn't find the definitions for alloc/1 and free/2 in OTP Design > Principles manual version 5.5.1 (at > http://www.erlang.org/doc/doc-5.5.1/doc/design_principles/part_frame.html) > sections 1 and 2. > > For example, in section 1.2 there was this example: > > -module(ch1). > -export([start/0]). [...] > > It's not clear from this what alloc(Chs) and free(Ch, Chs) are > supposed to do. Well, the implementation of those functions isn't really relevant to the example, and a realistic implementation would probably also do something "interesting" when allocating and freeing a channel. Nonetheless, one way to write these functions, for completeness, would be: channels() -> {_Allocated = [], _Free = lists:seq(1,100)}. alloc({Allocated, [H|T] = _Free}) -> {H, {[H|Allocated], T]}}. free(Ch, {Alloc, Free} = Channels) -> case lists:member(Ch, Alloc) of true -> {lists:delete(Ch, Alloc), [Ch|Free]}; false -> Channels end. The alloc/1 function doesn't care to check for the case that the server runs out of free resources, but neither does the calling function. The most common situation would be to make the server return an error code rather than crashing, of course, but all this would most likely distract the reader from the actual point of the example. BR, /Ulf W -- Ulf Wiger From gunilla@REDACTED Tue Oct 17 09:39:54 2006 From: gunilla@REDACTED (Gunilla Arendt) Date: Tue, 17 Oct 2006 09:39:54 +0200 Subject: [erlang-bugs] Missing definitions in OTP Design Principles manual In-Reply-To: <20061015002258.GB24788@sammakko.yok.utu.fi> References: <20061015002258.GB24788@sammakko.yok.utu.fi> Message-ID: <453488CA.3030408@erix.ericsson.se> Thank you for your comments. As Ulf pointed out, the implementation of those functions are not really relevant. In fact, they have intentionally been left out to avoid cluttering the code unnecessarily. This is not made clear in the text, however. I will add a clarification and maybe an example implementation to be used when trying out the example. Regards, Gunilla, Erlang/OTP team Kari Pahula wrote: > I didn't find the definitions for alloc/1 and free/2 in OTP Design > Principles manual version 5.5.1 (at > http://www.erlang.org/doc/doc-5.5.1/doc/design_principles/part_frame.html) > sections 1 and 2. > > For example, in section 1.2 there was this example: > > -module(ch1). > -export([start/0]). > -export([alloc/0, free/1]). > -export([init/0]). > > start() -> > spawn(ch1, init, []). > > alloc() -> > ch1 ! {self(), alloc}, > receive > {ch1, Res} -> > Res > end. > > free(Ch) -> > ch1 ! {free, Ch}, > ok. > > init() -> > register(ch1, self()), > Chs = channels(), > loop(Chs). > > loop(Chs) -> > receive > {From, alloc} -> > {Ch, Chs2} = alloc(Chs), > From ! {ch1, Ch}, > loop(Chs2); > {free, Ch} -> > Chs2 = free(Ch, Chs), > loop(Chs2) > end. > > It's not clear from this what alloc(Chs) and free(Ch, Chs) are > supposed to do. > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs > > From gunilla@REDACTED Tue Oct 17 10:26:22 2006 From: gunilla@REDACTED (Gunilla Arendt) Date: Tue, 17 Oct 2006 10:26:22 +0200 Subject: [erlang-bugs] Missing definitions in OTP Design Principles manual In-Reply-To: <453488CA.3030408@erix.ericsson.se> References: <20061015002258.GB24788@sammakko.yok.utu.fi> <453488CA.3030408@erix.ericsson.se> Message-ID: <453493AE.1060104@erix.ericsson.se> Ok, I used Ulf's example implementation. Thanks, Ulf! / Gunilla Gunilla Arendt wrote: > Thank you for your comments. > > As Ulf pointed out, the implementation of those functions are not > really relevant. In fact, they have intentionally been left out to > avoid cluttering the code unnecessarily. This is not made clear in > the text, however. I will add a clarification and maybe an example > implementation to be used when trying out the example. > > Regards, > Gunilla, Erlang/OTP team > From mbj@REDACTED Fri Oct 20 12:43:08 2006 From: mbj@REDACTED (Martin Bjorklund) Date: Fri, 20 Oct 2006 12:43:08 +0200 (CEST) Subject: [erlang-bugs] prim_file bug Message-ID: <20061020.124308.04698696.mbj@tail-f.com> Reading 0 bytes from a raw file returns eof, instead of {ok, []} or {ok, <<>>}. (non-raw file works, and the man page says that it should return {ok, ...}.) Eshell V5.5.1 (abort with ^G) 1> {ok, F} = file:open("README", [read,raw]). {ok,{file_descriptor,prim_file,{#Port<0.101>,5}}} 2> file:read(F, 0). eof 3> {ok, G} = file:open("README", [read]). {ok,<0.38.0>} 4> file:read(G, 0). {ok,[]} Tested in R10B-10 and R11B-1. Here's a patch, but I'm not 100% sure it's correct. Index: prim_file.erl =================================================================== --- prim_file.erl (revision 6046) +++ prim_file.erl (working copy) @@ -296,7 +296,7 @@ read(#file_descriptor{module = ?MODULE, data = {Port, _}}, Size) when is_integer(Size), 0 =< Size, Size < ?LARGEFILESIZE -> case drv_command(Port, <>) of - {ok, {0, _Data}} -> + {ok, {0, _Data}} when Size =/= 0 -> eof; {ok, 0} -> eof; Index: efile_drv.c =================================================================== --- efile_drv.c (revision 6046) +++ efile_drv.c (working copy) @@ -2170,11 +2170,13 @@ reply_posix_error(desc, EBADF); goto done; } +/* if (size == 0) { reply_Uint(desc, size); goto done; } - if (desc->read_size >= size) { +*/ + if (desc->read_size > 0 && desc->read_size >= size) { /* We already have all data */ TRACE_C('D'); reply_data(desc, desc->read_binp, desc->read_offset, size); /martin From xpdoka@REDACTED Wed Oct 25 10:21:07 2006 From: xpdoka@REDACTED (Dominic Williams) Date: Wed, 25 Oct 2006 10:21:07 +0200 (CEST) Subject: [erlang-bugs] Debugging strips compile module_info Message-ID: <46615.81.249.6.187.1161764467.squirrel@www.geekisp.com> Hello, It appears that any kind of debugging activity strips compile information from the module_info. This is very inconvenient when debugging 24/7 systems which use this information, e.g. for automatic code upgrades... The problem exists from at least R8, through to R11, and at least on Linux and MacOSX. MacOSX 10.4.7, R11B1: Eshell V5.5.1 (abort with ^G) 1> compile:file(foo, [debug_info]). {ok,foo} 2> foo:module_info(compile). [{options,[debug_info]}, {version,"4.4.1"}, {time,{2006,10,19,20,41,43}}, {source,"/Users/xpdoka/tmp/foo.erl"}] 3> int:i(foo). {module,foo} 4> foo:module_info(compile). [] Linux FC4, R10B10: Eshell V5.4.13 (abort with ^G) 1> compile:file(foo, [debug_info]). compile:file(foo, [debug_info]). {ok,foo} 2> foo:module_info(compile). foo:module_info(compile). [{options,[debug_info]}, {version,"4.3.12"}, {time,{2006,10,19,14,52,41}}, {source,"/home/dw/tmp/foo.erl"}] 3> int:i(foo). int:i(foo). {module,foo} 4> foo:module_info(compile). foo:module_info(compile). [] Linux FC4, R8: Eshell V5.1.2 (abort with ^G) 1> compile:file(foo, [debug_info]). compile:file(foo, [debug_info]). {ok,foo} 2> foo:module_info(compile). foo:module_info(compile). [{options,[v3,debug_info]},{version,"4.0.1"},{time,{2006,10,19,14,58,54}}] 3> int:i(foo). int:i(foo). {module,foo} 4> foo:module_info(compile). foo:module_info(compile). [] Regards, Dominic Williams http://www.dominicwilliams.net ---- From gunilla@REDACTED Fri Oct 27 09:30:20 2006 From: gunilla@REDACTED (Gunilla Arendt) Date: Fri, 27 Oct 2006 09:30:20 +0200 Subject: [erlang-bugs] prim_file bug In-Reply-To: <20061020.124308.04698696.mbj@tail-f.com> References: <20061020.124308.04698696.mbj@tail-f.com> Message-ID: <4541B58C.9070006@erix.ericsson.se> Thanks, Martin. / Gunilla Martin Bjorklund wrote: > Reading 0 bytes from a raw file returns eof, instead of {ok, []} or > {ok, <<>>}. > > (non-raw file works, and the man page says that it should return {ok, > ...}.) > > > Eshell V5.5.1 (abort with ^G) > 1> {ok, F} = file:open("README", [read,raw]). > {ok,{file_descriptor,prim_file,{#Port<0.101>,5}}} > 2> file:read(F, 0). > eof > 3> {ok, G} = file:open("README", [read]). > {ok,<0.38.0>} > 4> file:read(G, 0). > {ok,[]} > > > > Tested in R10B-10 and R11B-1. > > > Here's a patch, but I'm not 100% sure it's correct. > > > > Index: prim_file.erl > =================================================================== > --- prim_file.erl (revision 6046) > +++ prim_file.erl (working copy) > @@ -296,7 +296,7 @@ > read(#file_descriptor{module = ?MODULE, data = {Port, _}}, Size) > when is_integer(Size), 0 =< Size, Size < ?LARGEFILESIZE -> > case drv_command(Port, <>) of > - {ok, {0, _Data}} -> > + {ok, {0, _Data}} when Size =/= 0 -> > eof; > {ok, 0} -> > eof; > > > > Index: efile_drv.c > =================================================================== > --- efile_drv.c (revision 6046) > +++ efile_drv.c (working copy) > @@ -2170,11 +2170,13 @@ > reply_posix_error(desc, EBADF); > goto done; > } > +/* > if (size == 0) { > reply_Uint(desc, size); > goto done; > } > - if (desc->read_size >= size) { > +*/ > + if (desc->read_size > 0 && desc->read_size >= size) { > /* We already have all data */ > TRACE_C('D'); > reply_data(desc, desc->read_binp, desc->read_offset, size); > > > > /martin From gunilla@REDACTED Fri Oct 27 10:10:38 2006 From: gunilla@REDACTED (Gunilla Arendt) Date: Fri, 27 Oct 2006 10:10:38 +0200 Subject: [erlang-bugs] filelib bug In-Reply-To: <20060904.124618.29792694.mbj@tail-f.com> References: <20060904.124618.29792694.mbj@tail-f.com> Message-ID: <4541BEFE.7080904@erix.ericsson.se> Hi Martin, Thanks for the bug report. The error has been fixed in R11B-2. Regards, Gunilla Martin Bjorklund wrote: > There's a bug in filelib:wildcard/2, as illustrated by this example: > > Eshell V5.5.1 (abort with ^G) > 1> filelib:wildcard("foo*", "/tmp"). > ["foo.1","foo.2","foo.3","fooa","foobaz.log","foobaz.sh"] > > this is correct. > > but then i try: > > > 2> filelib:wildcard("foo*", "//tmp"). > ["oo.1","oo.2","oo.3","ooa","oobaz.log","oobaz.sh"] > 3> filelib:wildcard("foo*", "/tmp/"). > ["oo.1","oo.2","oo.3","ooa","oobaz.log","oobaz.sh"] > > > which obviously is wrong. > > > a simple fix is to do a filename:join() on the Cwd in filelib. > > > /martin From gunilla@REDACTED Fri Oct 27 10:14:23 2006 From: gunilla@REDACTED (Gunilla Arendt) Date: Fri, 27 Oct 2006 10:14:23 +0200 Subject: [erlang-bugs] Strange compiler crash with defines In-Reply-To: References: Message-ID: <4541BFDF.9050803@erix.ericsson.se> Hi, Thanks for the bug report. The error has been fixed in R11B-2. Regards, Gunilla, Erlang/OTP team Daniel Luna wrote: > I found this error a couple of years ago, but forgot to send it in. > >> cat error.erl > -undef(ASSERT). > -define(ASSERT, ?MODULE). > > ?ASSERT(). > >> erlc error.erl > > =ERROR REPORT==== 14-Sep-2006::09:49:13 === > Error in process <0.21.0> with exit value: > {{case_clause,{'EXIT',{function_clause,[{epp,check_uses,[undefined,[{atom,'MODULE'},{atom,'ASSERT'}],{dict,7,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[],[],[],[],[],[],[[{atom,'MACHINE'}],[{atom,'MODULE'}|undefined],[{atom,'LINE'}],[{atom,'FILE'}]],[],[],[],[],[[{... > > ./error.erl:none: internal error in parse_module; > [snip] > > /Luna From gunilla@REDACTED Fri Oct 27 10:21:35 2006 From: gunilla@REDACTED (Gunilla Arendt) Date: Fri, 27 Oct 2006 10:21:35 +0200 Subject: [erlang-bugs] http:request/1 bug In-Reply-To: <120FDEAC96A65F47933985A3AB00DC1A0A6FC2@esealmw116.eemea.ericsson.se> References: <120FDEAC96A65F47933985A3AB00DC1A0A6FC2@esealmw116.eemea.ericsson.se> Message-ID: <4541C18F.8070504@erix.ericsson.se> Hi, Thanks for the bug report. This error has already been fixed in inets-4.7.6, which will be included in R11B-2. Regards, Gunilla, Erlang/OTP team B?lint R?czey (IJ/ETH) wrote: > Hi, > > The URL which i try to retrieve is sent url decoded. > Example: > > http:request("http://erlang.org/bar?asd=M%26M"). > > The HTTP GET is sent as "http://erlang.org/bar?asd=M&M". > > Version info: inets-4.7.4 > > Regards, > Balint Reczey