From andrew@REDACTED Fri Apr 1 06:40:13 2011 From: andrew@REDACTED (Andrew Thompson) Date: Fri, 1 Apr 2011 00:40:13 -0400 Subject: [erlang-patches] Add DragonFlyBSD support to memsup Message-ID: <20110401044013.GA26392@hijacked.us> git fetch git://github.com/Vagabond/otp.git os_mon_dragonfly_support More information in the commit message: https://github.com/Vagabond/otp/commit/6d1cfbcd7a782cc96f58b86372d108b50c14cc05 Andrew From henrik@REDACTED Fri Apr 1 09:24:13 2011 From: henrik@REDACTED (Henrik Nord) Date: Fri, 1 Apr 2011 09:24:13 +0200 Subject: [erlang-patches] Re: Add DragonFlyBSD support to memsup In-Reply-To: <20110401044013.GA26392@hijacked.us> References: <20110401044013.GA26392@hijacked.us> Message-ID: <4D957D9D.8060007@erlang.org> On 04/01/2011 06:40 AM, Andrew Thompson wrote: > git fetch git://github.com/Vagabond/otp.git os_mon_dragonfly_support > > More information in the commit message: > > https://github.com/Vagabond/otp/commit/6d1cfbcd7a782cc96f58b86372d108b50c14cc05 > > Andrew > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > Hello Thank you for the patch, I will include it in 'pu' and let it cook. -- /Henrik Nord Erlang/OTP From vances@REDACTED Fri Apr 1 21:14:53 2011 From: vances@REDACTED (Vance Shipley) Date: Fri, 1 Apr 2011 15:14:53 -0400 Subject: [erlang-patches] Supervisor Shutdown Message-ID: <20110401191452.GN6861@h216-235-12-173.host.egate.net> In a recent project(*) I found it necessary to forge an EXIT message in order to shutdown a supervisor which I had earlier dynamically added as a child to a simple_one_for_one supervisor. Finding this rather distasteful I created the attached patch to add a terminate/1 function to the supervisor module. git fetch git@REDACTED:vances/otp.git supervisor_terminate -- -Vance (*) http://github.com/vances/radierl -------------- next part -------------- >From c3b1cd9a4c8d1a426dde5f482047807323e6da09 Mon Sep 17 00:00:00 2001 From: Vance Shipley Date: Fri, 1 Apr 2011 14:11:33 -0400 Subject: [PATCH] Implement new API function to shutdown a supervisor. When a supervisor is a dynamically started child of a simple_one_for_one supervisor there is currently no method to cleanly terminate it later. The work around is to send it an EXIT message forged with the pid of the parent supervisor. The new terminate/1 API function will cleanly shutdown the supervisor and all children. --- lib/stdlib/doc/src/supervisor.xml | 12 ++++++++++++ lib/stdlib/src/supervisor.erl | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletions(-) diff --git a/lib/stdlib/doc/src/supervisor.xml b/lib/stdlib/doc/src/supervisor.xml index 45fa084..e49a603 100644 --- a/lib/stdlib/doc/src/supervisor.xml +++ b/lib/stdlib/doc/src/supervisor.xml @@ -306,6 +306,18 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules} + terminate(SupRef) -> ok + Terminate a supervisor. + + SupRef = Name | {Name,Node} | {global,Name} | pid() +  Name = Node = atom() + + +

Tells the supervisor SupRef to terminate all children + and shutdown.

+
+
+ terminate_child(SupRef, Id) -> Result Terminate a child process belonging to a supervisor. diff --git a/lib/stdlib/src/supervisor.erl b/lib/stdlib/src/supervisor.erl index 3c5800e..511db36 100644 --- a/lib/stdlib/src/supervisor.erl +++ b/lib/stdlib/src/supervisor.erl @@ -23,7 +23,7 @@ %% External exports -export([start_link/2, start_link/3, start_child/2, restart_child/2, - delete_child/2, terminate_child/2, + delete_child/2, terminate/1, terminate_child/2, which_children/1, count_children/1, check_childspecs/1]). @@ -130,6 +130,10 @@ restart_child(Supervisor, Name) -> delete_child(Supervisor, Name) -> call(Supervisor, {delete_child, Name}). +-spec terminate(sup_ref()) -> 'ok'. +terminate(Supervisor) -> + call(Supervisor, terminate). + %%----------------------------------------------------------------- %% Func: terminate_child/2 %% Returns: ok | {error, Reason} @@ -341,6 +345,9 @@ handle_call({delete_child, Name}, _From, State) -> {reply, {error, not_found}, State} end; +handle_call(terminate, From, State) -> + {stop, shutdown, ok, State}; + handle_call({terminate_child, Name}, _From, State) -> case get_child(Name, State) of {value, Child} -> -- 1.7.3.2 From andrew@REDACTED Sat Apr 2 07:34:32 2011 From: andrew@REDACTED (Andrew Thompson) Date: Sat, 2 Apr 2011 01:34:32 -0400 Subject: [erlang-patches] Add NetBSD support to memsup and disksup Message-ID: <20110402053431.GB15773@hijacked.us> git fetch git://github.com/Vagabond/otp.git os_mon_netbsd_support Pretty simple changes, just mirrored OpenBSD support and it worked fine. Andrew From marcus@REDACTED Sun Apr 3 03:05:13 2011 From: marcus@REDACTED (Marcus Marinelli) Date: Sat, 2 Apr 2011 18:05:13 -0700 Subject: [erlang-patches] Fix minor typos and improve punctuation in the xmerl_xpath @doc comment Message-ID: git fetch git://github.com/msm/otp.git xmerl_doc_fixes https://github.com/msm/otp/commit/8a8e05929bb12ee96a0bb92505c3c410be9a5052 Single two-line-diff commit to fix some cosmetic typos and punctuation in an @doc comment. Current typos/problems are visible here: http://www.erlang.org/doc/man/xmerl_xpath.html in the "Module Description" paragraph. Cheers, Marcus From kostis@REDACTED Sun Apr 3 18:11:55 2011 From: kostis@REDACTED (Kostis Sagonas) Date: Sun, 03 Apr 2011 19:11:55 +0300 Subject: [erlang-patches] snmp: Add specs for functions that do not return Message-ID: <4D989C4B.9060901@cs.ntua.gr> git fetch git://github.com/kostis/otp.git snmp-specs Kostis From henrik@REDACTED Mon Apr 4 09:27:13 2011 From: henrik@REDACTED (Henrik Nord) Date: Mon, 4 Apr 2011 09:27:13 +0200 Subject: [erlang-patches] Re: Fix minor typos and improve punctuation in the xmerl_xpath @doc comment In-Reply-To: References: Message-ID: <4D9972D1.4080704@erlang.org> On 04/03/2011 03:05 AM, Marcus Marinelli wrote: > git fetch git://github.com/msm/otp.git xmerl_doc_fixes > > https://github.com/msm/otp/commit/8a8e05929bb12ee96a0bb92505c3c410be9a5052 > > Single two-line-diff commit to fix some cosmetic typos and punctuation > in an @doc comment. > > Current typos/problems are visible here: > http://www.erlang.org/doc/man/xmerl_xpath.html in the "Module > Description" paragraph. > > Cheers, > Marcus > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > Thank you Ill include this -- /Henrik Nord Erlang/OTP From henrik@REDACTED Mon Apr 4 09:32:05 2011 From: henrik@REDACTED (Henrik Nord) Date: Mon, 4 Apr 2011 09:32:05 +0200 Subject: [erlang-patches] Re: Add NetBSD support to memsup and disksup In-Reply-To: <20110402053431.GB15773@hijacked.us> References: <20110402053431.GB15773@hijacked.us> Message-ID: <4D9973F5.5070309@erlang.org> On 04/02/2011 07:34 AM, Andrew Thompson wrote: > git fetch git://github.com/Vagabond/otp.git os_mon_netbsd_support > > Pretty simple changes, just mirrored OpenBSD support and it worked fine. > > Andrew > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > Thank you for you patch Included in 'pu' -- /Henrik Nord Erlang/OTP From piotr.dorobisz@REDACTED Mon Apr 4 14:50:49 2011 From: piotr.dorobisz@REDACTED (Piotr Dorobisz) Date: Mon, 4 Apr 2011 12:50:49 +0000 (GMT) Subject: [erlang-patches] ttb improvements In-Reply-To: <4D957B65.60501@erlang-solutions.com> Message-ID: <1064447689.56171301921449406.JavaMail.root@zimbra> Some improvements and fixes for ttb. git fetch git://github.com/pdorobisz/otp.git ttb_upgrade From henrik@REDACTED Mon Apr 4 15:32:37 2011 From: henrik@REDACTED (Henrik Nord) Date: Mon, 4 Apr 2011 15:32:37 +0200 Subject: [erlang-patches] Re: Supervisor Shutdown In-Reply-To: <20110401191452.GN6861@h216-235-12-173.host.egate.net> References: <20110401191452.GN6861@h216-235-12-173.host.egate.net> Message-ID: <4D99C875.1090102@erlang.org> On 04/01/2011 09:14 PM, Vance Shipley wrote: > In a recent project(*) I found it necessary to forge an EXIT > message in order to shutdown a supervisor which I had earlier > dynamically added as a child to a simple_one_for_one supervisor. > Finding this rather distasteful I created the attached patch to > add a terminate/1 function to the supervisor module. > > git fetch git@REDACTED:vances/otp.git supervisor_terminate > > > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > Thank you for your patch. We will investigate this further the coming days. Until then would you be so kind as to complete the patch with tests? https://github.com/erlang/otp/wiki/Submitting-patches Thank you -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From piotr.dorobisz@REDACTED Tue Apr 5 16:26:36 2011 From: piotr.dorobisz@REDACTED (Piotr Dorobisz) Date: Tue, 5 Apr 2011 14:26:36 +0000 (GMT) Subject: [erlang-patches] ttb improvements In-Reply-To: <1064447689.56171301921449406.JavaMail.root@zimbra> Message-ID: <449739127.62031302013596734.JavaMail.root@zimbra> I have added some additional tests for ttb module. git fetch git://github.com/pdorobisz/otp.git ttb_upgrade From henrik@REDACTED Tue Apr 5 17:21:39 2011 From: henrik@REDACTED (Henrik Nord) Date: Tue, 5 Apr 2011 17:21:39 +0200 Subject: [erlang-patches] Re: ttb improvements In-Reply-To: <449739127.62031302013596734.JavaMail.root@zimbra> References: <449739127.62031302013596734.JavaMail.root@zimbra> Message-ID: <4D9B3383.2030809@erlang.org> On 04/05/2011 04:26 PM, Piotr Dorobisz wrote: > I have added some additional tests for ttb module. > > git fetch git://github.com/pdorobisz/otp.git ttb_upgrade > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > Hello Thank you for your patch, I will include it in 'pu' the coming days. -- /Henrik Nord Erlang/OTP From tuncer.ayaz@REDACTED Tue Apr 5 19:10:11 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Tue, 5 Apr 2011 19:10:11 +0200 Subject: [erlang-patches] unicode: document 16#FFFE and 16#FFFF (non chars) Message-ID: git fetch git://github.com/tuncer/otp.git unicode-non-chars From vances@REDACTED Wed Apr 6 02:33:27 2011 From: vances@REDACTED (Vance Shipley) Date: Tue, 5 Apr 2011 20:33:27 -0400 Subject: [erlang-patches] Re: Supervisor Shutdown In-Reply-To: <4D99C875.1090102@erlang.org> References: <20110401191452.GN6861@h216-235-12-173.host.egate.net> <4D99C875.1090102@erlang.org> Message-ID: <20110406003326.GB4859@h216-235-12-174.host.egate.net> I have implemented a new test case in supervisor_SUITE:sup_terminate/1: git fetch git@REDACTED:vances/otp.git supervisor_terminate On Mon, Apr 04, 2011 at 03:32:37PM +0200, Henrik Nord wrote: } Until then would you be so kind as to complete the patch with tests? -- -Vance -------------- next part -------------- >From b317a1512fefbfd9bd1c7f32affd59e61f757ebb Mon Sep 17 00:00:00 2001 From: Vance Shipley Date: Tue, 5 Apr 2011 20:30:07 -0400 Subject: [PATCH 21/21] Implemented a test case for new API function terminate/1. --- lib/stdlib/test/supervisor_SUITE.erl | 35 +++++++++++++++++++++++++++++++-- 1 files changed, 32 insertions(+), 3 deletions(-) diff --git a/lib/stdlib/test/supervisor_SUITE.erl b/lib/stdlib/test/supervisor_SUITE.erl index 6e927da..5b4d2e1 100644 --- a/lib/stdlib/test/supervisor_SUITE.erl +++ b/lib/stdlib/test/supervisor_SUITE.erl @@ -34,8 +34,8 @@ -export([ sup_start_normal/1, sup_start_ignore_init/1, sup_start_ignore_child/1, sup_start_error_return/1, sup_start_fail/1, sup_stop_infinity/1, - sup_stop_timeout/1, sup_stop_brutal_kill/1, child_adm/1, - child_adm_simple/1, child_specs/1, extra_return/1]). + sup_stop_timeout/1, sup_stop_brutal_kill/1, sup_terminate/1, + child_adm/1, child_adm_simple/1, child_specs/1, extra_return/1]). %% Tests concept permanent, transient and temporary -export([ permanent_normal/1, transient_normal/1, @@ -78,7 +78,7 @@ groups() -> sup_start_fail]}, {sup_stop, [], [sup_stop_infinity, sup_stop_timeout, - sup_stop_brutal_kill]}, + sup_stop_brutal_kill, sup_terminate]}, {normal_termination, [], [permanent_normal, transient_normal, temporary_normal]}, {abnormal_termination, [], @@ -369,6 +369,35 @@ sup_stop_brutal_kill(Config) when is_list(Config) -> ok. %------------------------------------------------------------------------- +sup_terminate(doc) -> + ["Tests that the dynamically added supervisor process, and it's " + "children, are terminated gracefully"]; +sup_terminate(suite) -> []; + +sup_terminate(Config) when is_list(Config) -> + process_flag(trap_exit, true), + GChild = {child, {supervisor_1, start_child, []}, + permanent, 1000, worker, []}, + StartSpec = {{one_for_one, 2, 3600}, [GChild]}, + Child = {child, {supervisor, start_link, [?MODULE, {ok, StartSpec}]}, + transient, infinity, supervisor, []}, + ?line {ok, Pid} = start({ok, {{simple_one_for_one, 2, 3600}, [Child]}}), + ?line {ok, CPid1} = supervisor:start_child(sup_test, []), + link(CPid1), + ?line [1,1,1,0] = get_child_counts(sup_test), + ?line [1,1,0,1] = get_child_counts(CPid1), + ?line ok = supervisor:terminate(CPid1), + receive + {'EXIT', CPid1, shutdown} -> ok; + {'EXIT', CPid1, Reason} -> + ?line test_server:fail({bad_exit_reason, Reason}) + after + 2000 -> ?line test_server:fail(no_exit_reason) + end, + ?line [1,0,0,0] = get_child_counts(sup_test), + ok. + +%------------------------------------------------------------------------- extra_return(doc) -> ["The start function provided to start a child may " "return {ok, Pid} or {ok, Pid, Info}, if it returns " -- 1.7.3.2 From michael.santos@REDACTED Wed Apr 6 02:45:17 2011 From: michael.santos@REDACTED (Michael Santos) Date: Tue, 5 Apr 2011 20:45:17 -0400 Subject: [erlang-patches] [PATCH] heart: remove garbage appended to heart command Message-ID: <20110406004517.GA25161@ecn.lan> heart:get_cmd/0 is documented to return an empty string if the command is cleared. get_cmd/0 returns 2 extra bytes: 1 byte for the trailing null, 1 byte from the op (the op is an unsigned char and 2 bytes are allocated for it in the returned buffer). 1> heart:get_cmd(). {ok,[0,0]} 2> heart:set_cmd("echo hello"). ok 3> heart:get_cmd(). {ok,[101,99,104,111,32,104,101,108,108,111,0,0]} 4> heart:clear_cmd(). ok 5> heart:get_cmd(). {ok,[0,99]} --- erts/etc/common/heart.c | 6 +++--- lib/kernel/test/heart_SUITE.erl | 13 +++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/erts/etc/common/heart.c b/erts/etc/common/heart.c index 778b356..7a5746e 100644 --- a/erts/etc/common/heart.c +++ b/erts/etc/common/heart.c @@ -727,16 +727,16 @@ static int heart_cmd_reply(int fd, char *s) { struct msg m; - int len = strlen(s) + 1; /* Include \0 */ + int len = strlen(s); /* if s >= MSG_BODY_SIZE, return a write * failure immediately. */ - if (len > sizeof(m.fill)) + if (len >= sizeof(m.fill)) return -1; m.op = HEART_CMD; - m.len = htons(len + 2); /* Include Op */ + m.len = htons(len + 1); /* Include Op */ strcpy((char*)m.fill, s); return write_message(fd, &m); diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl index 043c753..233e438 100644 --- a/lib/kernel/test/heart_SUITE.erl +++ b/lib/kernel/test/heart_SUITE.erl @@ -22,7 +22,7 @@ -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, start/1, restart/1, - reboot/1, set_cmd/1, clear_cmd/1, + reboot/1, set_cmd/1, clear_cmd/1, get_cmd/1, dont_drop/1, kill_pid/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -58,7 +58,7 @@ end_per_testcase(_Func, Config) -> suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> - [start, restart, reboot, set_cmd, clear_cmd, kill_pid]. + [start, restart, reboot, set_cmd, clear_cmd, get_cmd, kill_pid]. groups() -> []. @@ -246,6 +246,15 @@ clear_cmd(Config) when is_list(Config) -> end, ok. +get_cmd(suite) -> []; +get_cmd(Config) when is_list(Config) -> + ?line {ok, Node} = start_check(slave, heart_test), + Cmd = "test", + ?line ok = rpc:call(Node, heart, set_cmd, [Cmd]), + ?line {ok, Cmd} = rpc:call(Node, heart, get_cmd, []), + stop_node(Node), + ok. + dont_drop(suite) -> %%% Removed as it may crash epmd/distribution in colourful %%% ways. While we ARE finding out WHY, it would -- 1.7.0.4 From michael.santos@REDACTED Wed Apr 6 02:46:28 2011 From: michael.santos@REDACTED (Michael Santos) Date: Tue, 5 Apr 2011 20:46:28 -0400 Subject: [erlang-patches] [PATCH] efile_drv: unsigned integer may overflow in error message Message-ID: <20110406004628.GA25182@ecn.lan> --- erts/emulator/drivers/common/efile_drv.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c index 4e9b500..6e62342 100644 --- a/erts/emulator/drivers/common/efile_drv.c +++ b/erts/emulator/drivers/common/efile_drv.c @@ -410,7 +410,7 @@ struct t_data static void *ef_safe_alloc(Uint s) { void *p = EF_ALLOC(s); - if (!p) erl_exit(1, "efile drv: Can't allocate %d bytes of memory\n", s); + if (!p) erl_exit(1, "efile drv: Can't allocate %u bytes of memory\n", s); return p; } -- 1.7.0.4 From erlangsiri@REDACTED Wed Apr 6 10:40:56 2011 From: erlangsiri@REDACTED (Siri Hansen) Date: Wed, 6 Apr 2011 10:40:56 +0200 Subject: [erlang-patches] Re: Supervisor Shutdown In-Reply-To: <20110406003326.GB4859@h216-235-12-174.host.egate.net> References: <20110401191452.GN6861@h216-235-12-173.host.egate.net> <4D99C875.1090102@erlang.org> <20110406003326.GB4859@h216-235-12-174.host.egate.net> Message-ID: Hi Vance! We have now discussed this matter and decided that instead of adding a new terminate/1 function we will add a clause to terminate_child/2 and allow the child to be pointed out by Pid instead of Id. The correction will be included in R14B03. Thank you for the contribution! Best regards /siri 2011/4/6 Vance Shipley > I have implemented a new test case in supervisor_SUITE:sup_terminate/1: > > git fetch git@REDACTED:vances/otp.git supervisor_terminate > > On Mon, Apr 04, 2011 at 03:32:37PM +0200, Henrik Nord wrote: > } Until then would you be so kind as to complete the patch with tests? > > -- > -Vance > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Wed Apr 6 10:39:36 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 6 Apr 2011 10:39:36 +0200 Subject: [erlang-patches] Re: gen:call({global, Name}, ...) In-Reply-To: References: <4D945745.6020600@erlang.org> <4D947A2B.5060905@erlang.org> Message-ID: <4D9C26C8.3020504@erlang.org> On 03/31/2011 08:16 PM, Geoff Cant wrote: > Henrik Nord writes: > > >> On 03/31/2011 12:28 PM, Henrik Nord wrote: >> >>> On 03/30/2011 03:19 AM, Geoff Cant wrote: >>> >>>> Hi all, I discovered today that gen:call({global, Name}, Label, Request, >>>> Timeout) calls global:safe_whereis_name(Name) to determine the Pid to >>>> look up globally registered names. >>>> >>>> global:safe_whereis_name/1 doesn't seem to offer any particular safety >>>> and more importantly, serializes all global name lookups on a >>>> node. (Using >>>> global:whereis_name/1 instead is just an ets lookup). >>>> >>>> Can we safely make a change like >>>> https://github.com/archaelus/otp/commit/4f6e8a147b3c600eef2dd05f8ce0d51cf9c35383 >>>> >>>> in gen.erl and improve call time and reduce the load on >>>> global_name_server at a stroke? >>>> >>>> This git repo contains the patch I'm thinking of: >>>> git fetch git://github.com/archaelus/otp.git gen_where >>>> >>>> Cheers, >>>> >>> Hello >>> >>> Thank you! >>> This branch is now cooking in 'pu' >>> >>> >> Hello >> This has apparently been tested before, and found to be unsafe. >> So im pulling it out. >> > Hi Henrik, thanks for looking at this patch. > > It would be great if the OTP team could explain this a little further. > > gen.erl is using the undocumented function > global:safe_whereis_name/1. This function seems to retry (an unbounded > number of times) to do the same thing as global:whereis_name/1, but > ensuring that the global lock is not set. This will make sure that name > registrations are not being created, deleted or changed while the > safe_whereis_name lookup occurs. > > To my mind, this doesn't seem to add much safety. The whereis_name/1 > operation is a single ets:lookup, and ets guarantees us that this read > is atomic, so the result of the lookup can't be affected by operations > that require the global lock anyway. > > We could easily get stale results from global - a Pid for a name that is > immediately changed after the call, a Pid that was just unregistered on > another node, and probably a host of other things, but safe_whereis_name > doesn't appear to protect us from these situations either. > > Is there an important edge case I'm missing here? I'd love to know > because I'm trying a patch similar in effect to this one at work as we > can't afford to serialize all process name lookups through global > (gen:call({global, Name}, ...) is the dominant part of the call time > here and it's getting up to 100+ms). > > Cheers, > Hi Geoff After some initial investigation it has been decided that we will look into this, but not right now. It will probably be fitted in after the next release. The problem is that this "fix" exposes other different problems, that may or may not be fully related. That is why it will more than likely take a while to investigate the issue fully, and thus it can not be fitted into the next release. -- /Henrik Nord Erlang/OTP From henrik@REDACTED Wed Apr 6 10:57:28 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 6 Apr 2011 10:57:28 +0200 Subject: [erlang-patches] Re: snmp: Add specs for functions that do not return In-Reply-To: <4D989C4B.9060901@cs.ntua.gr> References: <4D989C4B.9060901@cs.ntua.gr> Message-ID: <4D9C2AF8.3020209@erlang.org> On 04/03/2011 06:11 PM, Kostis Sagonas wrote: > > git fetch git://github.com/kostis/otp.git snmp-specs > > Kostis > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hi Thanks Kostis, included in 'pu' -- /Henrik Nord Erlang/OTP From sverker@REDACTED Wed Apr 6 11:05:09 2011 From: sverker@REDACTED (Sverker Eriksson) Date: Wed, 6 Apr 2011 11:05:09 +0200 Subject: [erlang-patches] Re: [PATCH] efile_drv: unsigned integer may overflow in error message In-Reply-To: <20110406004628.GA25182@ecn.lan> References: <20110406004628.GA25182@ecn.lan> Message-ID: <4D9C2CC5.1060008@erix.ericsson.se> Michael Santos wrote: > --- > erts/emulator/drivers/common/efile_drv.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c > index 4e9b500..6e62342 100644 > --- a/erts/emulator/drivers/common/efile_drv.c > +++ b/erts/emulator/drivers/common/efile_drv.c > @@ -410,7 +410,7 @@ struct t_data > static void *ef_safe_alloc(Uint s) > { > void *p = EF_ALLOC(s); > - if (!p) erl_exit(1, "efile drv: Can't allocate %d bytes of memory\n", s); > + if (!p) erl_exit(1, "efile drv: Can't allocate %u bytes of memory\n", s); > return p; > } > > May still overflow on 64-bit. %lu bytes of memory\n", (unsigned long)s); won't. /Sverker From henrik@REDACTED Wed Apr 6 15:16:41 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 6 Apr 2011 15:16:41 +0200 Subject: [erlang-patches] Re: unicode: document 16#FFFE and 16#FFFF (non chars) In-Reply-To: References: Message-ID: <4D9C67B9.90308@erlang.org> On 04/05/2011 07:10 PM, Tuncer Ayaz wrote: > git fetch git://github.com/tuncer/otp.git unicode-non-chars > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > Thanks Tuncer your branch is cooking in 'pu' -- /Henrik Nord Erlang/OTP From henrik@REDACTED Wed Apr 6 15:31:52 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 6 Apr 2011 15:31:52 +0200 Subject: [erlang-patches] Re: [PATCH] heart: remove garbage appended to heart command In-Reply-To: <20110406004517.GA25161@ecn.lan> References: <20110406004517.GA25161@ecn.lan> Message-ID: <4D9C6B48.8050501@erlang.org> On 04/06/2011 02:45 AM, Michael Santos wrote: > heart:get_cmd/0 is documented to return an empty string if the command is > cleared. get_cmd/0 returns 2 extra bytes: 1 byte for the trailing null, > 1 byte from the op (the op is an unsigned char and 2 bytes are allocated > for it in the returned buffer). > > 1> heart:get_cmd(). > {ok,[0,0]} > 2> heart:set_cmd("echo hello"). > ok > 3> heart:get_cmd(). > {ok,[101,99,104,111,32,104,101,108,108,111,0,0]} > 4> heart:clear_cmd(). > ok > 5> heart:get_cmd(). > {ok,[0,99]} > --- > erts/etc/common/heart.c | 6 +++--- > lib/kernel/test/heart_SUITE.erl | 13 +++++++++++-- > 2 files changed, 14 insertions(+), 5 deletions(-) > > diff --git a/erts/etc/common/heart.c b/erts/etc/common/heart.c > index 778b356..7a5746e 100644 > --- a/erts/etc/common/heart.c > +++ b/erts/etc/common/heart.c > @@ -727,16 +727,16 @@ static int > heart_cmd_reply(int fd, char *s) > { > struct msg m; > - int len = strlen(s) + 1; /* Include \0 */ > + int len = strlen(s); > > /* if s>= MSG_BODY_SIZE, return a write > * failure immediately. > */ > - if (len> sizeof(m.fill)) > + if (len>= sizeof(m.fill)) > return -1; > > m.op = HEART_CMD; > - m.len = htons(len + 2); /* Include Op */ > + m.len = htons(len + 1); /* Include Op */ > strcpy((char*)m.fill, s); > > return write_message(fd,&m); > diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl > index 043c753..233e438 100644 > --- a/lib/kernel/test/heart_SUITE.erl > +++ b/lib/kernel/test/heart_SUITE.erl > @@ -22,7 +22,7 @@ > > -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, > init_per_group/2,end_per_group/2, start/1, restart/1, > - reboot/1, set_cmd/1, clear_cmd/1, > + reboot/1, set_cmd/1, clear_cmd/1, get_cmd/1, > dont_drop/1, kill_pid/1]). > > -export([init_per_testcase/2, end_per_testcase/2]). > @@ -58,7 +58,7 @@ end_per_testcase(_Func, Config) -> > suite() -> [{ct_hooks,[ts_install_cth]}]. > > all() -> > - [start, restart, reboot, set_cmd, clear_cmd, kill_pid]. > + [start, restart, reboot, set_cmd, clear_cmd, get_cmd, kill_pid]. > > groups() -> > []. > @@ -246,6 +246,15 @@ clear_cmd(Config) when is_list(Config) -> > end, > ok. > > +get_cmd(suite) -> []; > +get_cmd(Config) when is_list(Config) -> > + ?line {ok, Node} = start_check(slave, heart_test), > + Cmd = "test", > + ?line ok = rpc:call(Node, heart, set_cmd, [Cmd]), > + ?line {ok, Cmd} = rpc:call(Node, heart, get_cmd, []), > + stop_node(Node), > + ok. > + > dont_drop(suite) -> > %%% Removed as it may crash epmd/distribution in colourful > %%% ways. While we ARE finding out WHY, it would > Thank you Michael This is now cooking in 'pu' -- /Henrik Nord Erlang/OTP From henrik@REDACTED Wed Apr 6 16:46:36 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 6 Apr 2011 16:46:36 +0200 Subject: [erlang-patches] What's cooking in erlang/otp (2011-04-06) Message-ID: <201104061446.p36EkYvD015964@smaug.otp.ericsson.se> ------------------------------------------------------------ [Graduated] * bd/doc_fixes2 (crypto, inets, stdlib, webtool) (2011-04-01) 3 commits + Fix mistake in blowfish_ebc_en/decrypt docs (6597f81) + Compile fixes for earlier documentation fixes (30f3f25) + Various small documentation fixes (aa69482) * cg/fix-pointer-dereference (erts) (2011-02-23) 1 commit + Fix some wrong pointer dereferences (47f9ef2) * gl/erts-doterlang-docs (erts) (2010-12-19) 1 commit + Add back documentation on .erlang processing (6f9d175) * hw/call-chmod-without-f (asn1, common_test, compiler, cosFileTransfer, crypto, debugger, docbuilder, edoc, erl_interface, erts, et, inets, inviso, kernel, megaco, mnesia, orber, parsetools, percept, public_key, reltool, runtime_tools, snmp, ssl, stdlib, syntax_tools, test_server, tools) (2010-11-15) 1 commit + Call chmod without the "-f" flag (7ed11a8) * ks/hipe-ppc64 (erts, hipe, kernel) (2011-02-10) 8 commits + Enable HiPE by default when compiling for PPC64 (577a628) + Translate RTL to PPC code on PPC64 too (6f40a86) + Changes in ppc files for PPC64 (ea5edef) + Additions for the PPC64 backend (861cfc9) + Changes for the PPC64 backend (dbba32b) + Added loader for ppc64 (60826a5) + New files for the 64-bit backends (7c53e28) + Cleanup tags (e34f3a0) * mc/disjoint-plt-msg (dialyzer) (2011-03-29) 1 commit + Fix the name of an error function (deaaaa2) * mm/xmerl_doc_fixes (xmerl) (2011-04-02) 1 commit + Fix minor typos and improve punctuation in the xmerl_xpath @doc comment (8a8e059) * pr/mnesia-frag-hash-key () (2011-04-05) 0 commits * rc/rpc_pmap-typo (kernel) (2011-02-22) 1 commit + Fix typo in doc of rpc:pmap/3 (ee1ea4c) * sb/make-files-like-erlc (tools) (2010-05-18) 1 commit + Change make:files to behave more like erlc (5e9d051) * ta/driver_entry-typos-re (erts) (2011-02-27) 1 commit + Remove gratuitous paren in driver_entry (75a01b2) * ta/typer-add-pa-pz (typer) (2011-03-22) 1 commit + Add options -pa Dir and -pz Dir to TypEr (4240cf0) * tv/edoc-loop-fix (edoc) (2011-02-01) 1 commit + Fix infinite loop for malformed edoc input (6ac05e5) * dc/improved_find_redist (erts) (2011-03-18) 1 commit . support new SDKs in find_redist.sh and fallback to $ERL_TOP as last resort (f4f35aa) * ts/cover-with-export_all (tools) (2010-09-23) 1 commit . add user specified compiler options on form reloading (eb02beb) ------------------------------------------------------------ [New topics] * at/os_mon_dragonfly_support (os_mon) (2011-04-01) 1 commit - Add support for DragonFlyBSD to memsup (6d1cfbc) * at/os_mon_netbsd_support (os_mon) (2011-04-03) 1 commit - Add NetBSD support to memsup and disksup (ca1223e) * ks/any-arity-fun (erts, stdlib) (2011-03-30) 4 commits - Fix translation of fun((...) -> T) type (6121ade) - Remove CVS Id tags from the files (22a8272) - Remove CVS Id tags from the files (d39fbf6) - Remove CVS Id tags from the files (68f7040) * ks/snmp-specs (snmp) (2011-04-03) 1 commit - Add specs for functions that do not return (7354ffb) * lt/et-fix (et) (2011-03-30) 1 commit - Force contents window size to display correctly on Windows. (9836fb2) * ms/heart-rem-garbage-append (erts, kernel) (2011-04-05) 1 commit - heart: remove garbage appended to heart command (fa8456a) * pd/ttb_upgrade (observer) (2011-04-05) 30 commits - additional tests for ttb module (d46b48e) - new tests for ttb module (6b09d2e) - updated documentation (95dcdc2) - updated OTP tests (74d409d) - (BUGFIX) Error with ip tracing to wrap sets (57803c6) - Add onviso_server and cli as an exemplary ttb usage (560fbb2) - Include logfile name in fetch directory name (a30e48e) - missing files addes (3dd6a07) - dbg-type tracing (cfbb99a) - Optional handler specification allowed in stop/1 - Allowed optional handler specification in trace/2 (e0122cf) - Flush file trace port buffers with given frequency (faa868b) - Autoresume tracing (f963f9f) . . . * sa/dialyzer-invalid-spec-fix (dialyzer) (2011-03-29) 1 commit - Fix crash related with the contract blame assignment patch (beec181) * ta/unicode-non-chars (stdlib) (2011-04-05) 1 commit - unicode: document 16#FFFE and 16#FFFF (non chars) (4207846) ------------------------------------------------------------ [Stalled] * cg/fix-prng (stdlib) (2010-10-06) 1 commit . Fix a bug in the implementation of the pseudo-random number generator (863ec4d) Planned for R15 * pg/des-cfb-functions (crypto) (2010-10-16) 1 commit . Add DES and Triple DES cipher feedback (CFB) mode functions (2c79ae7) Planned for R15 * mh/eunit-surefire-reports (eunit) (2011-02-25) 1 commit - Don't shorten error messages in Eunit Surefire reports (d0cc2ae) Action expected from: Topic author. * jn/gen_stream (stdlib) (2011-01-31) 1 commit - Add gen_stream behaviour (730c7fd) Action expected from: OTP-Team * sa/callback-attr (compiler, inets, kernel, otp, stdlib) (2010-06-08) 6 commits - Add callback specs into 'application' module in kernel (a180fb1) - Add callback specs to tftp module following internet documentation (d0e32d8) - Add callback specs to inets_service module following possibly deprecated comments (d90e984) - Add '-callback' attributes in stdlib's behaviours (acf3d67) - Update primary bootstrap (30c1e91) - Add '-callback' attribute to language syntax (6ee955e) Action expected from: OTP-Team * ta/typer-quote-atoms (hipe, typer) (2011-03-20) 1 commit - Quote atoms if necessary in types (254e21e) Action expected from: Kostis ------------------------------------------------------------ [Cooking] * bd/mod_esi_timeout_fix (inets) (2011-03-17) 1 commit - Fix timeout message generated by mod_esi (eea0a7b) * bg/temp-hipe-fixes (compiler, hipe, kernel) (2010-03-15) 6 commits - Avoid crash by skipping compilation_SUITE:on_load/1 (8592a02) - Inline less aggressively for native-code compilation (e699ad4) - Crudely fix return type for the lists:key{search,find,member}/3 (2b72202) - seq_trace_SUITE: Don't native-compile (2712344) - Disable native code if on_load is used (e8d0ea4) - andor_SUITE: Don't native-compile (e25ef8c) This branch contains temporary workarounds to avoid failing test cases and is never intended to graduate. * bsmr/fix-makefile-in-for-xref-mod-app-escript (otp) (2010-12-10) 1 commit - Fix for Makefile.in invoking xref_mod_app.escript (10d4235) * bw/efile_exists (erts) (2010-10-07) 1 commit - prim_file:exists/{1,2} which is lightweight file existence check (7203932) * fd/unix-efile-readdir-fix (erts) (2010-12-15) 1 commit - Fix call to strncat, 3rd arg should be of type size_t and not a pointer (78cfdaf) * fm/posix-fallocate (erts, kernel) (2011-01-10) 2 commits - Fix build on Solaris (38a922d) - Added file:allocate/2 (9870d9b) * gc/gen-format-status-improvements (stdlib) (2010-06-12) 1 commit - Fix format_status bug for unregistered gen_event processes (95ed86f) * hw/epmd-bind-to-address (erts) (2010-11-10) 1 commit - Allow user to specify the IP address epmd binds to (bcf3b3d) * hw/fix-epmd-perror (erts) (2010-11-13) 1 commit - Fix epmd's dbg_perror() output (b363d7d) * jf/run_erl-disable-flow-control (erts) (2010-03-05) 1 commit - Teach run_erl RUN_ERL_DISABLE_FLOWCNTRL for disabling flow control (d0775cd) * km/pool_connect-to-running-nodes (stdlib) (2010-09-02) 1 commit - Change pool module to attempt to attach to nodes that are already running (a9f4cbc) * ks/prim_file-fixes (erts) (2011-02-05) 3 commits - New version of the file (ca86ed3) - Driver names should be strings, not atoms (b8ea40c) - Cleanup and cosmetic changes (6adc116) * mk/net-kernel-epmd-return-list (kernel) (2010-12-10) 1 commit - Fix list returned by net_kernel:epmd_module (169d7e4) * ms/beam-fix-format-specifiers-in-erl_exit-msg (erts) (2011-02-25) 1 commit - Fix format specifiers in erl_exit messages (13f5d59) * ms/epmd-local-access-check (erts) (2010-11-24) 1 commit - epmd: include host address in local access check (5b68030) * ms/file-fix-hang-reading-compressed-files (erts, kernel) (2011-01-30) 1 commit - file: fix hang reading compressed files (292ecd0) * nox/xmerl-namespace-axis (xmerl) (2010-12-07) 12 commits - Implement namespace axis (27d791f) - Add `#xmlPI` support to xmerl_xpath:write_node/1 (75e67f5) - Fix processing-instruction(name?) (f05e78b) - Fix path filters (610df56) - Support more top-level primary expressions (770d6d9) - Accumulate comments in element nodes (e5b6b3a) - Add `default_attrs` option (18584c5) - Allow whole documents to be returned (aef3dea) - Track parents and namespace in `#xmlAttribute` nodes (dc9b220) - Track parents in `#xmlPI` nodes (5095331) - Set `vsn` field in `#xmlDecl` record (d712331) - Fix namespace-conformance constraints (e062270) * rj/fix-httpd-format (inets) (2011-03-17) 1 commit - Fix log messages formating in httpd (cbe8b2e) * ta/erts-unused-vars (erts) (2011-03-10) 1 commit - erts: Remove unused variables (345454e) * ta/sendfile (erts, kernel, test_server) (2011-01-13) 1 commit - Implement file:sendfile (782dc4e) * uw/mnesia-majority (mnesia) (2011-01-30) 8 commits - Add documentation text about majority checking (f5b8427) - add mnesia_majority_test suite (9c2f765) - where_to_wlock optimization + change_table_majority/2 (a535b6c) - bug in mnesia_tm:needs_majority/2 (eb81e20) - optimize sticky_lock maj. check (5b304d4) - check majority for sticky locks (ae9e1fa) - Write locks now check majority when needed. (6f02d2e) - Add {majority, boolean()} per-table option. (c3241c0) * vb/shell (erts, kernel, stdlib) (2011-01-21) 6 commits - Add expandfmt_fun option for io:setopts (f139eab) - Correct JCL's help indentation (95672fa) - Handle JCL's "r" command error when no pool started (ba4b196) - Fix tab expansion in remote shell (e2077cb) - edlin_expand: fix matches formatting (838b84a) - Take into account arity len when calculating field's width (ff28c52) * sv/enif_is_exception (erts) (2011-02-22) 1 commit . add support for checking if an ERL_NIF_TERM is an exception (f8cc2b0) ------------------------------------------------------------ [Dropped] * es/pattern_match_on_magic_binaries (erts) (2011-03-16) 1 commit . Allow some limited pattern matching on magic binaries (e994db4) Does not make sens as is, req more work. * gc/gen_where (stdlib) (2011-03-29) 1 commit . gen: Use global:whereis_name/1 instead of safe_whereis_name/1. (4f6e8a1) Will be investigated later by OTP-team. * ks/erl_recomment (syntax_tools) (2011-02-23) 1 commit . Fix bug with some comments disappearing (64eb70d) Replaced by fix from Richard Carlsson. * ja/cocci-useless-cast (erts) (2011-02-01) 1 commit . Remove useless casts from the emulator (4163493602b68cd7bafa18f7c3f64aa7ef61fbbf) The automatic analyze and editing uses the *extension* of the datatype, not the *intension* From henrik@REDACTED Wed Apr 6 17:28:46 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 6 Apr 2011 17:28:46 +0200 Subject: [erlang-patches] Re: prim_file:exists/{1, 2} a new lightweight file existence check In-Reply-To: References: Message-ID: <4D9C86AE.90500@erlang.org> Hi Your patch has been cooking a longtime in 'pu' now. It is a good id? but still needs some work. test cases and some cleanup codework. https://github.com/erlang/otp/wiki/Submitting-patches -- /Henrik Nord Erlang/OTP From michael.santos@REDACTED Wed Apr 6 20:52:26 2011 From: michael.santos@REDACTED (Michael Santos) Date: Wed, 6 Apr 2011 14:52:26 -0400 Subject: [erlang-patches] Re: [PATCH] efile_drv: unsigned integer may overflow in error message In-Reply-To: <4D9C2CC5.1060008@erix.ericsson.se> References: <20110406004628.GA25182@ecn.lan> <4D9C2CC5.1060008@erix.ericsson.se> Message-ID: <20110406185226.GA26462@ecn.lan> On Wed, Apr 06, 2011 at 11:05:09AM +0200, Sverker Eriksson wrote: > Michael Santos wrote: >> --- >> erts/emulator/drivers/common/efile_drv.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c >> index 4e9b500..6e62342 100644 >> --- a/erts/emulator/drivers/common/efile_drv.c >> +++ b/erts/emulator/drivers/common/efile_drv.c >> @@ -410,7 +410,7 @@ struct t_data >> static void *ef_safe_alloc(Uint s) >> { >> void *p = EF_ALLOC(s); >> - if (!p) erl_exit(1, "efile drv: Can't allocate %d bytes of memory\n", s); >> + if (!p) erl_exit(1, "efile drv: Can't allocate %u bytes of memory\n", s); >> return p; >> } >> > May still overflow on 64-bit. > > %lu bytes of memory\n", (unsigned long)s); > > > won't. > > /Sverker Thanks! I see now that "Uint" is typedef'ed to "unsigned long" on 64-bit. I will resend the patch! From michael.santos@REDACTED Wed Apr 6 20:56:43 2011 From: michael.santos@REDACTED (Michael Santos) Date: Wed, 6 Apr 2011 14:56:43 -0400 Subject: [erlang-patches] [PATCH] Unsigned integer may overflow in error message Message-ID: <20110406185643.GA27079@ecn.lan> --- erts/emulator/drivers/common/efile_drv.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c index 4e9b500..6e62342 100644 --- a/erts/emulator/drivers/common/efile_drv.c +++ b/erts/emulator/drivers/common/efile_drv.c @@ -410,7 +410,7 @@ struct t_data static void *ef_safe_alloc(Uint s) { void *p = EF_ALLOC(s); - if (!p) erl_exit(1, "efile drv: Can't allocate %d bytes of memory\n", s); + if (!p) erl_exit(1, "efile drv: Can't allocate %lu bytes of memory\n", (unsigned long)s); return p; } -- 1.7.0.4 From michael.santos@REDACTED Wed Apr 6 21:03:15 2011 From: michael.santos@REDACTED (Michael Santos) Date: Wed, 6 Apr 2011 15:03:15 -0400 Subject: [erlang-patches] [PATCH] Fix format specifiers in erl_exit messages Message-ID: <20110406190315.GA27135@ecn.lan> Fix an error message by using an unsigned integer specifier as seen in a tweet by @metabrew: #erlang VM crashed with "no next heap size found: -2090496108, offset 0", suddenly allocated all available RAM Also correct mis-typed string formats in bif.c. --- erts/emulator/beam/bif.c | 4 ++-- erts/emulator/beam/erl_gc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c index bb237e3..9e88ac9 100644 --- a/erts/emulator/beam/bif.c +++ b/erts/emulator/beam/bif.c @@ -3352,7 +3352,7 @@ BIF_RETTYPE erts_debug_display_1(BIF_ALIST_1) erts_dsprintf_buf_t *dsbufp = erts_create_tmp_dsbuf(64); pres = erts_dsprintf(dsbufp, "%.*T\n", INT_MAX, BIF_ARG_1); if (pres < 0) - erl_exit(1, "Failed to convert term to string: %d (s)\n", + erl_exit(1, "Failed to convert term to string: %d (%s)\n", -pres, erl_errno_id(-pres)); hp = HAlloc(BIF_P, 2*dsbufp->str_len); /* we need length * 2 heap words */ res = buf_to_intlist(&hp, dsbufp->str, dsbufp->str_len, NIL); @@ -3470,7 +3470,7 @@ term2list_dsprintf(Process *p, Eterm term) erts_dsprintf_buf_t *dsbufp = erts_create_tmp_dsbuf(64); pres = erts_dsprintf(dsbufp, "%T", term); if (pres < 0) - erl_exit(1, "Failed to convert term to list: %d (s)\n", + erl_exit(1, "Failed to convert term to list: %d (%s)\n", -pres, erl_errno_id(-pres)); hp = HAlloc(p, 2*dsbufp->str_len); /* we need length * 2 heap words */ res = buf_to_intlist(&hp, dsbufp->str, dsbufp->str_len, NIL); diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c index 2aa932e..91eb420 100644 --- a/erts/emulator/beam/erl_gc.c +++ b/erts/emulator/beam/erl_gc.c @@ -214,7 +214,7 @@ erts_next_heap_size(Uint size, Uint offset) low = mid + 1; } } - erl_exit(1, "no next heap size found: %d, offset %d\n", size, offset); + erl_exit(1, "no next heap size found: %lu, offset %lu\n", (unsigned long)size, (unsigned long)offset); } return 0; } -- 1.7.0.4 From michael.santos@REDACTED Wed Apr 6 21:04:15 2011 From: michael.santos@REDACTED (Michael Santos) Date: Wed, 6 Apr 2011 15:04:15 -0400 Subject: [erlang-patches] Re: [PATCH] Fix format specifiers in erl_exit messages In-Reply-To: <20110406190315.GA27135@ecn.lan> References: <20110406190315.GA27135@ecn.lan> Message-ID: <20110406190415.GA27086@ecn.lan> On Wed, Apr 06, 2011 at 03:03:15PM -0400, Michael Santos wrote: > Fix an error message by using an unsigned integer specifier as seen in > a tweet by @metabrew: > > #erlang VM crashed with "no next heap size found: -2090496108, > offset 0", suddenly allocated all available RAM > > Also correct mis-typed string formats in bif.c. Could you drop the ms/beam-fix-format-specifiers-in-erl_exit-msg branch in pu and replace it with this one? Thanks! From henrik@REDACTED Thu Apr 7 10:30:41 2011 From: henrik@REDACTED (Henrik Nord) Date: Thu, 7 Apr 2011 10:30:41 +0200 Subject: [erlang-patches] Re: [PATCH] file: fix hang reading compressed files In-Reply-To: <20110130221118.GA2915@ecn.lan> References: <20110130221118.GA2915@ecn.lan> Message-ID: <4D9D7631.7010708@erlang.org> Hi Your patch has come up with feedback The fix looks OK, but the name 'offset' is confusing since there is another 'offset' also in context. Rename to e.g 'save_pos': @@ -632,6 +632,7 @@ erts_gzseek(gzFile file, int offset, int whence) while (s->position< pos) { char buf[512]; int n; + int offset = s->position; n = pos - s->position; if (n> sizeof(buf)) @@ -643,6 +644,7 @@ erts_gzseek(gzFile file, int offset, int whence) memset(buf, '\0', n); erts_gzwrite(file, buf, n); } + if (offset == s->position) break; } return s->position; Thank you -- /Henrik Nord Erlang/OTP From henrik@REDACTED Thu Apr 7 11:05:31 2011 From: henrik@REDACTED (Henrik Nord) Date: Thu, 7 Apr 2011 11:05:31 +0200 Subject: [erlang-patches] Re: Fix translation of fun((...) -> T) type In-Reply-To: <4D930EAD.2020200@cs.ntua.gr> References: <4D930EAD.2020200@cs.ntua.gr> Message-ID: <4D9D7E5B.90908@erlang.org> On 03/30/2011 01:06 PM, Kostis Sagonas wrote: > Fix the translation of fun((...) -> T) type so that it can be > processed by type manipulating tools that rely on erl_types.erl > > git fetch git://github.com/kostis/otp.git any-arity-fun > > Thanks to Andreas Hohw?-Christensen for reporting this! > > Kostis > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Rejected. The problem is not just that stdlib/src/erl_pp.erl and edoc/src/edoc_specs.erl recognize the exact tuple {type,Line,any} (this could be "fixed" but probably not a a minor release). No, the real problem is that the proposed tuple already has a meaning. Pretty-printing (with modified erl_parse.yrl and erl_lint.erl) -type t() :: 'fun'(any(), atom()). -type u() :: fun((...) -> atom()). shows that they will be printed like this: -type t() :: 'fun'(any(), atom()). -type u() :: 'fun'(any(), atom()). [Pretty-printing is done using the compiler's 'P' option.] -- /Henrik Nord Erlang/OTP From henrik@REDACTED Thu Apr 7 11:19:48 2011 From: henrik@REDACTED (Henrik Nord) Date: Thu, 7 Apr 2011 11:19:48 +0200 Subject: [erlang-patches] Re: [PATCH] Fix format specifiers in erl_exit messages In-Reply-To: <20110406190415.GA27086@ecn.lan> References: <20110406190315.GA27135@ecn.lan> <20110406190415.GA27086@ecn.lan> Message-ID: <4D9D81B4.4090302@erlang.org> On 04/06/2011 09:04 PM, Michael Santos wrote: > On Wed, Apr 06, 2011 at 03:03:15PM -0400, Michael Santos wrote: > >> Fix an error message by using an unsigned integer specifier as seen in >> a tweet by @metabrew: >> >> #erlang VM crashed with "no next heap size found: -2090496108, >> offset 0", suddenly allocated all available RAM >> >> Also correct mis-typed string formats in bif.c. >> > Could you drop the ms/beam-fix-format-specifiers-in-erl_exit-msg branch > in pu and replace it with this one? > > Thanks! > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > Thank you Iv "refetched" this branch -- /Henrik Nord Erlang/OTP From henrik@REDACTED Thu Apr 7 11:31:53 2011 From: henrik@REDACTED (Henrik Nord) Date: Thu, 7 Apr 2011 11:31:53 +0200 Subject: [erlang-patches] Re: [PATCH] Unsigned integer may overflow in error message In-Reply-To: <20110406185643.GA27079@ecn.lan> References: <20110406185643.GA27079@ecn.lan> Message-ID: <4D9D8489.2060503@erlang.org> On 04/06/2011 08:56 PM, Michael Santos wrote: > --- > erts/emulator/drivers/common/efile_drv.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c > index 4e9b500..6e62342 100644 > --- a/erts/emulator/drivers/common/efile_drv.c > +++ b/erts/emulator/drivers/common/efile_drv.c > @@ -410,7 +410,7 @@ struct t_data > static void *ef_safe_alloc(Uint s) > { > void *p = EF_ALLOC(s); > - if (!p) erl_exit(1, "efile drv: Can't allocate %d bytes of memory\n", s); > + if (!p) erl_exit(1, "efile drv: Can't allocate %lu bytes of memory\n", (unsigned long)s); > return p; > } > > Thank you this is now cooking in 'pu' Ill let you know if something breaks -- /Henrik Nord Erlang/OTP From contact@REDACTED Thu Apr 7 11:53:06 2011 From: contact@REDACTED (Evax Software) Date: Thu, 07 Apr 2011 11:53:06 +0200 Subject: [erlang-patches] Re: Allow limited pattern matching on magic binaries In-Reply-To: <4D81E9A6.3040808@erlang.org> References: <1300308108.4579.275.camel@thomas-laptop> <4D81E9A6.3040808@erlang.org> Message-ID: <1302169986.3286.49.camel@thomas-laptop> Ok, this patch has just been rejected. Maybe I was unclear as to the goal of the patch, I'll try to explain it a bit better. NIF resources are implemented as magic binaries. Magic binaries are special binaries holding private data but presenting an apparent length of zero. I understand that this is a good thing as the private data is not exposed directly to the Erlang side, but this has a special side effect for NIF resource users: any resource will match any other resource (even from a different resource type, as well of course as the empty binary. This is somehow dangerous as it prevents us from catching some errors from the Erlang side, where for example assigning a resource to a variable already bound to a resource will NOT cause an error. Moreover not being able to distinguish NIF resources from Erlang causes some extra work. Imagine a NIF project implementing some kind of socket-like mechanism (erlzmq2 or libev-erlang for example), and imagine a process handling several of these sockets in a receive loop (as in active mode), then one must wrap resources in a tuple with a ref to be able to match on them. The patch implements special cases for magic binaries in the eq and cmp operations, causing the private data to be compared, and magic binaries with identical private data to match. So, and maybe the patch name was badly chosen, there is no real sub-binary pattern matching happening on private data here, it's just a simple and straightforward way to tell resources apart, still without exposing the private data to the Erlang side. Evax Le jeudi 17 mars 2011 ? 11:59 +0100, Henrik Nord a ?crit : > On 03/16/2011 09:41 PM, Evax Software wrote: > > Hi, > > > > The proposed patch allows limited pattern matching on magic binaries. > > It tries to be the as non-intrusive as possible. > > The goal of the patch is to allow matching on NIF resources, but it > > shouldn't cause problems to other magic binary beam users. > > > > git fetch git@REDACTED:evax/otp.git pattern_match_on_magic_binaries > > > > Evax > > > > > > > > ________________________________________________________________ > > erlang-patches (at) erlang.org mailing list. > > See http://www.erlang.org/faq.html > > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > > > Hello > > I have included this in 'pu' and will let it cook for a while. > > /Henrik Nord, Erlang/OTP > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > From michael.santos@REDACTED Thu Apr 7 14:41:00 2011 From: michael.santos@REDACTED (Michael Santos) Date: Thu, 7 Apr 2011 08:41:00 -0400 Subject: [erlang-patches] [PATCH] file: fix hang reading compressed files Message-ID: <20110407124100.GA28828@ecn.lan> The gzio driver goes into an infinite loop when reading past the end of a compressed file. Reported-By: Alex Morarash --- erts/emulator/drivers/common/gzio.c | 2 ++ lib/kernel/test/file_SUITE.erl | 4 ++++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/erts/emulator/drivers/common/gzio.c b/erts/emulator/drivers/common/gzio.c index 5531a27..418b1b0 100644 --- a/erts/emulator/drivers/common/gzio.c +++ b/erts/emulator/drivers/common/gzio.c @@ -632,6 +632,7 @@ erts_gzseek(gzFile file, int offset, int whence) while (s->position < pos) { char buf[512]; int n; + int save_pos = s->position; n = pos - s->position; if (n > sizeof(buf)) @@ -643,6 +644,7 @@ erts_gzseek(gzFile file, int offset, int whence) memset(buf, '\0', n); erts_gzwrite(file, buf, n); } + if (save_pos == s->position) break; } return s->position; diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index 47592dd..2ad8880 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -2041,6 +2041,10 @@ try_read_file_list(Fd) -> ?line Title = "Real Programmers Don't Use PASCAL\n", ?line Title = io:get_line(Fd, ''), + %% Seek past the end of the file. + + ?line {ok, _} = ?FILE_MODULE:position(Fd, 25000), + %% Done. ?line ?FILE_MODULE:close(Fd), -- 1.7.0.4 From michael.santos@REDACTED Thu Apr 7 14:42:12 2011 From: michael.santos@REDACTED (Michael Santos) Date: Thu, 7 Apr 2011 08:42:12 -0400 Subject: [erlang-patches] Re: [PATCH] file: fix hang reading compressed files In-Reply-To: <4D9D7631.7010708@erlang.org> References: <20110130221118.GA2915@ecn.lan> <4D9D7631.7010708@erlang.org> Message-ID: <20110407124212.GA28752@ecn.lan> On Thu, Apr 07, 2011 at 10:30:41AM +0200, Henrik Nord wrote: > Hi > Your patch has come up with feedback > > > > The fix looks OK, but the name 'offset' is confusing since there is > another 'offset' also in context. Rename to e.g 'save_pos': I missed that, yes it is confusing! I've re-sent the patch, thanks for the feedback! From henrik@REDACTED Thu Apr 7 15:17:43 2011 From: henrik@REDACTED (Henrik Nord) Date: Thu, 7 Apr 2011 15:17:43 +0200 Subject: [erlang-patches] Re: [PATCH] file: fix hang reading compressed files In-Reply-To: <20110407124100.GA28828@ecn.lan> References: <20110407124100.GA28828@ecn.lan> Message-ID: <4D9DB977.3030709@erlang.org> On 04/07/2011 02:41 PM, Michael Santos wrote: > The gzio driver goes into an infinite loop when reading past the end of > a compressed file. > > Reported-By: Alex Morarash > --- > erts/emulator/drivers/common/gzio.c | 2 ++ > lib/kernel/test/file_SUITE.erl | 4 ++++ > 2 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/erts/emulator/drivers/common/gzio.c b/erts/emulator/drivers/common/gzio.c > index 5531a27..418b1b0 100644 > --- a/erts/emulator/drivers/common/gzio.c > +++ b/erts/emulator/drivers/common/gzio.c > @@ -632,6 +632,7 @@ erts_gzseek(gzFile file, int offset, int whence) > while (s->position< pos) { > char buf[512]; > int n; > + int save_pos = s->position; > > n = pos - s->position; > if (n> sizeof(buf)) > @@ -643,6 +644,7 @@ erts_gzseek(gzFile file, int offset, int whence) > memset(buf, '\0', n); > erts_gzwrite(file, buf, n); > } > + if (save_pos == s->position) break; > } > > return s->position; > diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl > index 47592dd..2ad8880 100644 > --- a/lib/kernel/test/file_SUITE.erl > +++ b/lib/kernel/test/file_SUITE.erl > @@ -2041,6 +2041,10 @@ try_read_file_list(Fd) -> > ?line Title = "Real Programmers Don't Use PASCAL\n", > ?line Title = io:get_line(Fd, ''), > > + %% Seek past the end of the file. > + > + ?line {ok, _} = ?FILE_MODULE:position(Fd, 25000), > + > %% Done. > > ?line ?FILE_MODULE:close(Fd), > Thanks Refetched -- /Henrik Nord Erlang/OTP From michael.santos@REDACTED Fri Apr 8 19:52:40 2011 From: michael.santos@REDACTED (Michael Santos) Date: Fri, 8 Apr 2011 13:52:40 -0400 Subject: [erlang-patches] [PATCH] erl_interface: fix compile error Message-ID: <20110408175240.GA31700@ecn.lan> --- lib/erl_interface/src/legacy/erl_timeout.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lib/erl_interface/src/legacy/erl_timeout.c b/lib/erl_interface/src/legacy/erl_timeout.c index d9560ee..146a106 100644 --- a/lib/erl_interface/src/legacy/erl_timeout.c +++ b/lib/erl_interface/src/legacy/erl_timeout.c @@ -43,6 +43,7 @@ # endif #endif +#include "erl_interface.h" #include "erl_timeout.h" typedef struct jmp_s { -- 1.7.0.4 From palle@REDACTED Sun Apr 10 21:17:37 2011 From: palle@REDACTED (Palle Lyckegaard) Date: Sun, 10 Apr 2011 19:17:37 +0000 (UTC) Subject: [erlang-patches] PATCH: Fix building on Solaris 11 Express Message-ID: Hi, the following patch is necessary to build on a Solaris 11 Express host: git fetch git://github.com/PalleLyckegaard/otp.git solaris11 In addition to the patch LD needs to be specified as LD=/usr/ccs/bin/ld ./configure && gmake otherwise the GNU ld located in /usr/gnu/bin/ld will incorrectly picked up. Regards Palle Lyckegaard From trond.norbye@REDACTED Mon Apr 11 11:29:51 2011 From: trond.norbye@REDACTED (Trond Norbye) Date: Mon, 11 Apr 2011 11:29:51 +0200 Subject: [erlang-patches] Patch to fix compilation on OpenIndiana Message-ID: <25F118BB-CDA2-4A11-8613-240692C99D41@gmail.com> inet_drv.c fails to compile on my system because I got SIOCGIFHWADDR defined, but I don't have the ifr_hwaddr member in the struct. I do have an enaddr (containing the ethernet address, but I believe the "correct way" to read out the mac address on my openindiana box would be to use libdlpi (at least that's how ifconfig does it). https://github.com/trondn/otp/commit/6511458100bb8e1d890cdbd5ade04a931ebf9efd Cheers, Trond Norbye -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Use-libdlpi-to-get-physical-address.patch.gz Type: application/x-gzip Size: 1462 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From sverker@REDACTED Mon Apr 11 12:22:38 2011 From: sverker@REDACTED (Sverker Eriksson) Date: Mon, 11 Apr 2011 12:22:38 +0200 Subject: [erlang-patches] Allow limited pattern matching on magic binaries In-Reply-To: <1302169986.3286.49.camel@thomas-laptop> References: <1300308108.4579.275.camel@thomas-laptop> <4D81E9A6.3040808@erlang.org> <1302169986.3286.49.camel@thomas-laptop> Message-ID: <4DA2D66E.5080300@erix.ericsson.se> Thank you for your explanation, but your patch was not rejected because of lack of understanding. (Hopefully the opposite) I understand the need to match NIF resources. But the simple solution of just comparing the (magic) binary data is just not enough as it may cause very strange behavior that violates the functional properties of the language. For example, the binary content of NIF resources are allowed to be mutated. Your binary comparison will expose such a mutation and violate the single assignment property. A variable referring a NIF resource may suddenly compare different to what it did earlier. Another (too) simple solution could be to compare the pointers *to* the magic binaries instead of their content. That would on the other hand introduce a comparison that is based on identity (rather than equality), which we otherwise don't have in the language. I think the right way to go, is to introduce a new callback for resource types, that allows the NIF resource designer to implement how comparisons should be done. /Sverker, Erlang/OTP Ericsson Evax Software wrote: > Ok, this patch has just been rejected. > > Maybe I was unclear as to the goal of the patch, I'll try to explain it > a bit better. > > NIF resources are implemented as magic binaries. > Magic binaries are special binaries holding private data but presenting > an apparent length of zero. > > I understand that this is a good thing as the private data is not > exposed directly to the Erlang side, but this has a special side effect > for NIF resource users: any resource will match any other resource (even > from a different resource type, as well of course as the empty binary. > > This is somehow dangerous as it prevents us from catching some errors > from the Erlang side, where for example assigning a resource to a > variable already bound to a resource will NOT cause an error. > > Moreover not being able to distinguish NIF resources from Erlang causes > some extra work. Imagine a NIF project implementing some kind of > socket-like mechanism (erlzmq2 or libev-erlang for example), and imagine > a process handling several of these sockets in a receive loop (as in > active mode), then one must wrap resources in a tuple with a ref to be > able to match on them. > > The patch implements special cases for magic binaries in the eq and cmp > operations, causing the private data to be compared, and magic binaries > with identical private data to match. > > So, and maybe the patch name was badly chosen, there is no real > sub-binary pattern matching happening on private data here, it's just a > simple and straightforward way to tell resources apart, still without > exposing the private data to the Erlang side. > > Evax > > Le jeudi 17 mars 2011 ? 11:59 +0100, Henrik Nord a ?crit : > >> On 03/16/2011 09:41 PM, Evax Software wrote: >> >>> Hi, >>> >>> The proposed patch allows limited pattern matching on magic binaries. >>> It tries to be the as non-intrusive as possible. >>> The goal of the patch is to allow matching on NIF resources, but it >>> shouldn't cause problems to other magic binary beam users. >>> >>> git fetch git@REDACTED:evax/otp.git pattern_match_on_magic_binaries >>> >>> Evax >>> >>> >>> >>> ________________________________________________________________ >>> erlang-patches (at) erlang.org mailing list. >>> See http://www.erlang.org/faq.html >>> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED >>> >>> >> Hello >> >> I have included this in 'pu' and will let it cook for a while. >> >> /Henrik Nord, Erlang/OTP >> >> ________________________________________________________________ >> erlang-patches (at) erlang.org mailing list. >> See http://www.erlang.org/faq.html >> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED >> >> > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > > From contact@REDACTED Mon Apr 11 16:12:50 2011 From: contact@REDACTED (Evax Software) Date: Mon, 11 Apr 2011 16:12:50 +0200 Subject: [erlang-patches] Allow limited pattern matching on magic binaries In-Reply-To: <4DA2D66E.5080300@erix.ericsson.se> References: <1300308108.4579.275.camel@thomas-laptop> <4D81E9A6.3040808@erlang.org> <1302169986.3286.49.camel@thomas-laptop> <4DA2D66E.5080300@erix.ericsson.se> Message-ID: <1302531170.3314.358.camel@thomas-laptop> Thanks for your answer and enlightening explanations. I'm fine with your proposal, and willing to implement it. Here's what I have in mind: * erts/emulator/beam/global.h: add cmp and eq entries to ErtsMagicBinary and the corresponding ERTS_MAGIC_BIN_{CMP,EQ} macros * erts/emulator/beam/erl_binary.h: update erts_create_magic_binary to handle those two extra callbacks * erts/emulator/beam/utils.c: update cmp and eq to use the corresponding callback if we have two magic binaries and the callbacks match * Add cmd and eq callbacks to the enif_resource_type_t struct, implement nif_resource_cmp and nif_resource_eq and modify enif_open_resource_type to take the extra two parameters (erts/emulator/beam/erl_nif.c) So the changes will only introduce a small memory overhead and two functions' signature updates. As erts_create_magic_binary is only used internally, it's easy enough to update all users. On the other hand enif_open_resource_type is widely used in existing NIFs. I believe these NIFs should made to compile unmodified against the new code. So, if you think the approach is right, how do you want me to handle the API change for this function ? Evax Le lundi 11 avril 2011 ? 12:22 +0200, Sverker Eriksson a ?crit : > Thank you for your explanation, but your patch was not rejected because > of lack of understanding. (Hopefully the opposite) > > I understand the need to match NIF resources. But the simple solution of > just comparing the (magic) binary data is just not enough as it may > cause very strange behavior that violates the functional properties of > the language. > > For example, the binary content of NIF resources are allowed to be > mutated. Your binary comparison will expose such a mutation and violate > the single assignment property. A variable referring a NIF resource may > suddenly compare different to what it did earlier. > > Another (too) simple solution could be to compare the pointers *to* the > magic binaries instead of their content. That would on the other hand > introduce a comparison that is based on identity (rather than equality), > which we otherwise don't have in the language. > > I think the right way to go, is to introduce a new callback for resource > types, that allows the NIF resource designer to implement how > comparisons should be done. > > /Sverker, Erlang/OTP Ericsson > > > > > > Evax Software wrote: > > Ok, this patch has just been rejected. > > > > Maybe I was unclear as to the goal of the patch, I'll try to explain it > > a bit better. > > > > NIF resources are implemented as magic binaries. > > Magic binaries are special binaries holding private data but presenting > > an apparent length of zero. > > > > I understand that this is a good thing as the private data is not > > exposed directly to the Erlang side, but this has a special side effect > > for NIF resource users: any resource will match any other resource (even > > from a different resource type, as well of course as the empty binary. > > > > This is somehow dangerous as it prevents us from catching some errors > > from the Erlang side, where for example assigning a resource to a > > variable already bound to a resource will NOT cause an error. > > > > Moreover not being able to distinguish NIF resources from Erlang causes > > some extra work. Imagine a NIF project implementing some kind of > > socket-like mechanism (erlzmq2 or libev-erlang for example), and imagine > > a process handling several of these sockets in a receive loop (as in > > active mode), then one must wrap resources in a tuple with a ref to be > > able to match on them. > > > > The patch implements special cases for magic binaries in the eq and cmp > > operations, causing the private data to be compared, and magic binaries > > with identical private data to match. > > > > So, and maybe the patch name was badly chosen, there is no real > > sub-binary pattern matching happening on private data here, it's just a > > simple and straightforward way to tell resources apart, still without > > exposing the private data to the Erlang side. > > > > Evax > > > > Le jeudi 17 mars 2011 ? 11:59 +0100, Henrik Nord a ?crit : > > > >> On 03/16/2011 09:41 PM, Evax Software wrote: > >> > >>> Hi, > >>> > >>> The proposed patch allows limited pattern matching on magic binaries. > >>> It tries to be the as non-intrusive as possible. > >>> The goal of the patch is to allow matching on NIF resources, but it > >>> shouldn't cause problems to other magic binary beam users. > >>> > >>> git fetch git@REDACTED:evax/otp.git pattern_match_on_magic_binaries > >>> > >>> Evax > >>> > >>> > >>> > >>> ________________________________________________________________ > >>> erlang-patches (at) erlang.org mailing list. > >>> See http://www.erlang.org/faq.html > >>> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > >>> > >>> > >> Hello > >> > >> I have included this in 'pu' and will let it cook for a while. > >> > >> /Henrik Nord, Erlang/OTP > >> > >> ________________________________________________________________ > >> erlang-patches (at) erlang.org mailing list. > >> See http://www.erlang.org/faq.html > >> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > >> > >> > > > > > > _______________________________________________ > > erlang-patches mailing list > > erlang-patches@REDACTED > > http://erlang.org/mailman/listinfo/erlang-patches > > > > > > From tuncer.ayaz@REDACTED Mon Apr 11 21:50:30 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Mon, 11 Apr 2011 21:50:30 +0200 Subject: [erlang-patches] dialyzer doc fixes Message-ID: git fetch git://github.com/tuncer/otp.git dialyzer-doc From henrik@REDACTED Tue Apr 12 09:36:50 2011 From: henrik@REDACTED (Henrik Nord) Date: Tue, 12 Apr 2011 09:36:50 +0200 Subject: [erlang-patches] dialyzer doc fixes In-Reply-To: References: Message-ID: <4DA40112.6070806@erlang.org> On 04/11/2011 09:50 PM, Tuncer Ayaz wrote: > git fetch git://github.com/tuncer/otp.git dialyzer-doc > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Thank you Tuncer I have included this in 'pu' -- /Henrik Nord Erlang/OTP From sverker@REDACTED Tue Apr 12 12:19:57 2011 From: sverker@REDACTED (Sverker Eriksson) Date: Tue, 12 Apr 2011 12:19:57 +0200 Subject: [erlang-patches] Allow limited pattern matching on magic binaries In-Reply-To: <1302531170.3314.358.camel@thomas-laptop> References: <1300308108.4579.275.camel@thomas-laptop> <4D81E9A6.3040808@erlang.org> <1302169986.3286.49.camel@thomas-laptop> <4DA2D66E.5080300@erix.ericsson.se> <1302531170.3314.358.camel@thomas-laptop> Message-ID: <4DA4274D.9000102@erix.ericsson.se> It seems you have a good grasp of the implementation. There are some design issues though, that need to be addressed. Here are the things that crawled out of the top of my head: Do we really need to support the distinction == vs =:=? Would it not be enough with just a cmp-function and let a return value of 0 imply both == and =:=. Comparing two magic binaries with different cmp-functions? Comparing magic binary vs other term? The property (A < B and B < C implies A < C) must be true for all types and values of terms A,B,C (relying on that resource type cmp-functions are correctly implemented). Having magic binaries compare as empty binaries toward other terms will break that property. One solution is to let a magic binary compare larger than all normal terms, that would make it behave like a normal binary with a very long prefix of <<255,255,255,255,255,...>>. What does the language buffs say? Are we passing the line of language extension? Is this a new language type that needs an eep? Or can we argue that magic binaries are still opaque terms that are not distinguishable from other terms. enif_open_resource_type? I guess the only decent way out is to create a new function enif_open_resource_type_2 (or a more clever name maybe?) and keep the old one for backward compatibility. Instead of new function pointer argument(s), it could take a pointer to a new struct ErlNifResourceInit where the callbacks are placed. That will make it possible to add new callbacks in future (serialize, print,?) without having to create new function names each time. And then of course test cases and documentation. I hope I didn't discourage you too much :-) /Sverker, Erlang/OTP Evax Software wrote: > Thanks for your answer and enlightening explanations. > I'm fine with your proposal, and willing to implement it. > > Here's what I have in mind: > > * erts/emulator/beam/global.h: > add cmp and eq entries to ErtsMagicBinary and the corresponding > ERTS_MAGIC_BIN_{CMP,EQ} macros > > * erts/emulator/beam/erl_binary.h: > update erts_create_magic_binary to handle those two extra callbacks > > * erts/emulator/beam/utils.c: > update cmp and eq to use the corresponding callback if we have two magic > binaries and the callbacks match > > * Add cmd and eq callbacks to the enif_resource_type_t struct, implement > nif_resource_cmp and nif_resource_eq and modify enif_open_resource_type > to take the extra two parameters (erts/emulator/beam/erl_nif.c) > > So the changes will only introduce a small memory overhead and two > functions' signature updates. > > As erts_create_magic_binary is only used internally, it's easy enough to > update all users. > On the other hand enif_open_resource_type is widely used in existing > NIFs. I believe these NIFs should made to compile unmodified against the > new code. So, if you think the approach is right, how do you want me to > handle the API change for this function ? > > Evax > > Le lundi 11 avril 2011 ? 12:22 +0200, Sverker Eriksson a ?crit : > >> Thank you for your explanation, but your patch was not rejected because >> of lack of understanding. (Hopefully the opposite) >> >> I understand the need to match NIF resources. But the simple solution of >> just comparing the (magic) binary data is just not enough as it may >> cause very strange behavior that violates the functional properties of >> the language. >> >> For example, the binary content of NIF resources are allowed to be >> mutated. Your binary comparison will expose such a mutation and violate >> the single assignment property. A variable referring a NIF resource may >> suddenly compare different to what it did earlier. >> >> Another (too) simple solution could be to compare the pointers *to* the >> magic binaries instead of their content. That would on the other hand >> introduce a comparison that is based on identity (rather than equality), >> which we otherwise don't have in the language. >> >> I think the right way to go, is to introduce a new callback for resource >> types, that allows the NIF resource designer to implement how >> comparisons should be done. >> >> /Sverker, Erlang/OTP Ericsson >> >> >> >> >> >> Evax Software wrote: >> >>> Ok, this patch has just been rejected. >>> >>> Maybe I was unclear as to the goal of the patch, I'll try to explain it >>> a bit better. >>> >>> NIF resources are implemented as magic binaries. >>> Magic binaries are special binaries holding private data but presenting >>> an apparent length of zero. >>> >>> I understand that this is a good thing as the private data is not >>> exposed directly to the Erlang side, but this has a special side effect >>> for NIF resource users: any resource will match any other resource (even >>> from a different resource type, as well of course as the empty binary. >>> >>> This is somehow dangerous as it prevents us from catching some errors >>> from the Erlang side, where for example assigning a resource to a >>> variable already bound to a resource will NOT cause an error. >>> >>> Moreover not being able to distinguish NIF resources from Erlang causes >>> some extra work. Imagine a NIF project implementing some kind of >>> socket-like mechanism (erlzmq2 or libev-erlang for example), and imagine >>> a process handling several of these sockets in a receive loop (as in >>> active mode), then one must wrap resources in a tuple with a ref to be >>> able to match on them. >>> >>> The patch implements special cases for magic binaries in the eq and cmp >>> operations, causing the private data to be compared, and magic binaries >>> with identical private data to match. >>> >>> So, and maybe the patch name was badly chosen, there is no real >>> sub-binary pattern matching happening on private data here, it's just a >>> simple and straightforward way to tell resources apart, still without >>> exposing the private data to the Erlang side. >>> >>> Evax >>> >>> Le jeudi 17 mars 2011 ? 11:59 +0100, Henrik Nord a ?crit : >>> >>> >>>> On 03/16/2011 09:41 PM, Evax Software wrote: >>>> >>>> >>>>> Hi, >>>>> >>>>> The proposed patch allows limited pattern matching on magic binaries. >>>>> It tries to be the as non-intrusive as possible. >>>>> The goal of the patch is to allow matching on NIF resources, but it >>>>> shouldn't cause problems to other magic binary beam users. >>>>> >>>>> git fetch git@REDACTED:evax/otp.git pattern_match_on_magic_binaries >>>>> >>>>> Evax >>>>> >>>>> >>>>> >>>>> ________________________________________________________________ >>>>> erlang-patches (at) erlang.org mailing list. >>>>> See http://www.erlang.org/faq.html >>>>> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED >>>>> >>>>> >>>>> >>>> Hello >>>> >>>> I have included this in 'pu' and will let it cook for a while. >>>> >>>> /Henrik Nord, Erlang/OTP >>>> >>>> ________________________________________________________________ >>>> erlang-patches (at) erlang.org mailing list. >>>> See http://www.erlang.org/faq.html >>>> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED >>>> >>>> >>>> >>> _______________________________________________ >>> erlang-patches mailing list >>> erlang-patches@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-patches >>> >>> >>> >> > > > From henrik@REDACTED Tue Apr 12 13:34:39 2011 From: henrik@REDACTED (Henrik Nord) Date: Tue, 12 Apr 2011 13:34:39 +0200 Subject: [erlang-patches] dialyzer doc fixes In-Reply-To: References: Message-ID: <4DA438CF.9030203@erlang.org> On 04/11/2011 09:50 PM, Tuncer Ayaz wrote: > git fetch git://github.com/tuncer/otp.git dialyzer-doc > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hi This .txt file is only used as "help text" in the GUI. instead of maintaining 2 versions of the same information, we should eliminate the need for the .txt, and use the documentation generated from the xml in its place. -- /Henrik Nord Erlang/OTP From contact@REDACTED Tue Apr 12 15:57:36 2011 From: contact@REDACTED (Evax Software) Date: Tue, 12 Apr 2011 15:57:36 +0200 Subject: [erlang-patches] Allow limited pattern matching on magic binaries In-Reply-To: <4DA4274D.9000102@erix.ericsson.se> References: <1300308108.4579.275.camel@thomas-laptop> <4D81E9A6.3040808@erlang.org> <1302169986.3286.49.camel@thomas-laptop> <4DA2D66E.5080300@erix.ericsson.se> <1302531170.3314.358.camel@thomas-laptop> <4DA4274D.9000102@erix.ericsson.se> Message-ID: <1302616656.3302.74.camel@thomas-laptop> Thanks for developing on this, my comments are inlined. Le mardi 12 avril 2011 ? 12:19 +0200, Sverker Eriksson a ?crit : > It seems you have a good grasp of the implementation. There are some > design issues though, that need to be addressed. Here are the things > that crawled out of the top of my head: > > Do we really need to support the distinction == vs =:=? Would it not be > enough with just a cmp-function and let a return value of 0 imply both > == and =:=. You're right, a cmp function should be enough. > Comparing two magic binaries with different cmp-functions? > Comparing magic binary vs other term? > The property (A < B and B < C implies A < C) must be true for all types > and values of terms A,B,C (relying on that resource type cmp-functions > are correctly implemented). Having magic binaries compare as empty > binaries toward other terms will break that property. One solution is to > let a magic binary compare larger than all normal terms, that would make > it behave like a normal binary with a very long prefix of > <<255,255,255,255,255,...>>. It's quite tricky here, indeed. Each distinct cmp function would define a specific magic binary subspace in the same way a distinct destructor does. If we have A < B with A and B from the same magic binary space (that is sharing the same cmp function), and C some other term, then the property holds: A < C (with A comparing here as empty binary just as B was before) What's subtly breaking, though, is when C is a magic binary from another subspace: we'd have B == C, A == C, but clearly not A == B. So I don't think we need to change how magic binary compare to other terms, but rather to introduce some arbitrary order between magic binary subspaces, so that the last example becomes indeed A < B, B < C and A < C. The same will hold for NIF resources, and it gets even trickier. As we introduce a new nested comparison level (the nif_resource_cmp function calling user defined callbacks), here again we'd need an arbitrary order between subspaces. The problem is that if on one hand magic binary users in the Erlang source code are few, unlikely to change and thus and easily ordered, on the other hand NIF resource types are potentially infinite and what's worse potentially different from node to node. > > What does the language buffs say? Are we passing the line of language > extension? Is this a new language type that needs an eep? Or can we > argue that magic binaries are still opaque terms that are not > distinguishable from other terms. > IMHO it would be much simpler if magic binaries were left as they are and NIF resources gained there own type. Also because doing as exposed above, we'd be introducing this whole cmp mechanism at the magic binary level for the sole real use of NIF resources. > enif_open_resource_type? I guess the only decent way out is to create a > new function enif_open_resource_type_2 (or a more clever name maybe?) > and keep the old one for backward compatibility. Instead of new function > pointer argument(s), it could take a pointer to a new struct > ErlNifResourceInit where the callbacks are placed. That will make it > possible to add new callbacks in future (serialize, print,?) without > having to create new function names each time. > > And then of course test cases and documentation. > That's fine > I hope I didn't discourage you too much :-) > Not totally yet :) Evax > /Sverker, Erlang/OTP > > > Evax Software wrote: > > Thanks for your answer and enlightening explanations. > > I'm fine with your proposal, and willing to implement it. > > > > Here's what I have in mind: > > > > * erts/emulator/beam/global.h: > > add cmp and eq entries to ErtsMagicBinary and the corresponding > > ERTS_MAGIC_BIN_{CMP,EQ} macros > > > > * erts/emulator/beam/erl_binary.h: > > update erts_create_magic_binary to handle those two extra callbacks > > > > * erts/emulator/beam/utils.c: > > update cmp and eq to use the corresponding callback if we have two magic > > binaries and the callbacks match > > > > * Add cmd and eq callbacks to the enif_resource_type_t struct, implement > > nif_resource_cmp and nif_resource_eq and modify enif_open_resource_type > > to take the extra two parameters (erts/emulator/beam/erl_nif.c) > > > > So the changes will only introduce a small memory overhead and two > > functions' signature updates. > > > > As erts_create_magic_binary is only used internally, it's easy enough to > > update all users. > > On the other hand enif_open_resource_type is widely used in existing > > NIFs. I believe these NIFs should made to compile unmodified against the > > new code. So, if you think the approach is right, how do you want me to > > handle the API change for this function ? > > > > Evax > > > > Le lundi 11 avril 2011 ? 12:22 +0200, Sverker Eriksson a ?crit : > > > >> Thank you for your explanation, but your patch was not rejected because > >> of lack of understanding. (Hopefully the opposite) > >> > >> I understand the need to match NIF resources. But the simple solution of > >> just comparing the (magic) binary data is just not enough as it may > >> cause very strange behavior that violates the functional properties of > >> the language. > >> > >> For example, the binary content of NIF resources are allowed to be > >> mutated. Your binary comparison will expose such a mutation and violate > >> the single assignment property. A variable referring a NIF resource may > >> suddenly compare different to what it did earlier. > >> > >> Another (too) simple solution could be to compare the pointers *to* the > >> magic binaries instead of their content. That would on the other hand > >> introduce a comparison that is based on identity (rather than equality), > >> which we otherwise don't have in the language. > >> > >> I think the right way to go, is to introduce a new callback for resource > >> types, that allows the NIF resource designer to implement how > >> comparisons should be done. > >> > >> /Sverker, Erlang/OTP Ericsson > >> > >> > >> > >> > >> > >> Evax Software wrote: > >> > >>> Ok, this patch has just been rejected. > >>> > >>> Maybe I was unclear as to the goal of the patch, I'll try to explain it > >>> a bit better. > >>> > >>> NIF resources are implemented as magic binaries. > >>> Magic binaries are special binaries holding private data but presenting > >>> an apparent length of zero. > >>> > >>> I understand that this is a good thing as the private data is not > >>> exposed directly to the Erlang side, but this has a special side effect > >>> for NIF resource users: any resource will match any other resource (even > >>> from a different resource type, as well of course as the empty binary. > >>> > >>> This is somehow dangerous as it prevents us from catching some errors > >>> from the Erlang side, where for example assigning a resource to a > >>> variable already bound to a resource will NOT cause an error. > >>> > >>> Moreover not being able to distinguish NIF resources from Erlang causes > >>> some extra work. Imagine a NIF project implementing some kind of > >>> socket-like mechanism (erlzmq2 or libev-erlang for example), and imagine > >>> a process handling several of these sockets in a receive loop (as in > >>> active mode), then one must wrap resources in a tuple with a ref to be > >>> able to match on them. > >>> > >>> The patch implements special cases for magic binaries in the eq and cmp > >>> operations, causing the private data to be compared, and magic binaries > >>> with identical private data to match. > >>> > >>> So, and maybe the patch name was badly chosen, there is no real > >>> sub-binary pattern matching happening on private data here, it's just a > >>> simple and straightforward way to tell resources apart, still without > >>> exposing the private data to the Erlang side. > >>> > >>> Evax > >>> > >>> Le jeudi 17 mars 2011 ? 11:59 +0100, Henrik Nord a ?crit : > >>> > >>> > >>>> On 03/16/2011 09:41 PM, Evax Software wrote: > >>>> > >>>> > >>>>> Hi, > >>>>> > >>>>> The proposed patch allows limited pattern matching on magic binaries. > >>>>> It tries to be the as non-intrusive as possible. > >>>>> The goal of the patch is to allow matching on NIF resources, but it > >>>>> shouldn't cause problems to other magic binary beam users. > >>>>> > >>>>> git fetch git@REDACTED:evax/otp.git pattern_match_on_magic_binaries > >>>>> > >>>>> Evax > >>>>> > >>>>> > >>>>> > >>>>> ________________________________________________________________ > >>>>> erlang-patches (at) erlang.org mailing list. > >>>>> See http://www.erlang.org/faq.html > >>>>> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > >>>>> > >>>>> > >>>>> > >>>> Hello > >>>> > >>>> I have included this in 'pu' and will let it cook for a while. > >>>> > >>>> /Henrik Nord, Erlang/OTP > >>>> > >>>> ________________________________________________________________ > >>>> erlang-patches (at) erlang.org mailing list. > >>>> See http://www.erlang.org/faq.html > >>>> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > >>>> > >>>> > >>>> > >>> _______________________________________________ > >>> erlang-patches mailing list > >>> erlang-patches@REDACTED > >>> http://erlang.org/mailman/listinfo/erlang-patches > >>> > >>> > >>> > >> > > > > > > > > From kostis@REDACTED Tue Apr 12 18:48:09 2011 From: kostis@REDACTED (Kostis Sagonas) Date: Tue, 12 Apr 2011 19:48:09 +0300 Subject: [erlang-patches] dialyzer doc fixes In-Reply-To: <4DA438CF.9030203@erlang.org> References: <4DA438CF.9030203@erlang.org> Message-ID: <4DA48249.8010907@cs.ntua.gr> Henrik Nord wrote: > On 04/11/2011 09:50 PM, Tuncer Ayaz wrote: >> git fetch git://github.com/tuncer/otp.git dialyzer-doc >> _______________________________________________ >> erlang-patches mailing list >> erlang-patches@REDACTED >> http://erlang.org/mailman/listinfo/erlang-patches > Hi > > This .txt file is only used as "help text" in the GUI. > instead of maintaining 2 versions of the same information, we should > eliminate the need for the .txt, > and use the documentation generated from the xml in its place. This is a good suggestion but it's independent of the above. Tuncer's patch synchronizes the two files and fixes some minor issues in them. It's a step in the right direction and I think it should be included to 'dev' independently of whether we decide to eliminate the .txt file with another patch. Now, dialyzer uses the gs:editor/2 function to display the .txt file. Does 'gs' have something that can display an .xml file? (Similar question for 'wx' I guess...) Kostis From vances@REDACTED Wed Apr 13 01:18:45 2011 From: vances@REDACTED (Vance Shipley) Date: Tue, 12 Apr 2011 19:18:45 -0400 Subject: [erlang-patches] Supervisor Shutdown In-Reply-To: References: <20110401191452.GN6861@h216-235-12-173.host.egate.net> <4D99C875.1090102@erlang.org> <20110406003326.GB4859@h216-235-12-174.host.egate.net> Message-ID: <20110412231844.GB4859@h216-235-12-174.host.egate.net> Siri et. al., Thank you, I'm glad there is agreement that the functionality is desired. In a similiar vein I'd like to see an enhancement to allow passing information back in the exit message of a child. Currently a child's init/1 function may return {ok,Child} or {ok,Child,Info} and supervisor:start_child/2 returns the same. I'd like to see the inverse where the child may exit with either 'shutdown' or {shutdown, Info}, in response to a shutdown request from it's supervisor, and 'normal' or {normal, Info} for a normal exit. The child may exit with any value now of course however if the exit value isn't expected the supervisor restart strategy and SASL error logging will not work as desired. You may look to my radierl(*) project for an example of a practical application of this functionality. In this stack application the radius_server module implements a gen_server which will dynamically start a new gen_fsm process, under supervision, to service requests. It keeps the gen_fsm's pid in state stored in a gb_tree() with the client's info as the key. In this way client requests can be quickly looked up and forwarded to the gen_fsm. When the gen_fsm terminates the gen_server needs to reap the state. I implemented a clause in radius_server to efficiently do this: handle_info({'EXIT', _Pid, {shutdown, Key}}, #state{handlers = Handlers} = State) -> NewHandlers = gb_trees:delete(Key, Handlers), NewState = State#state{handlers = NewHandlers}, {noreply, NewState}; However I can't use this because SASL reports are generated for normal terminations. Instead I have to handle the normal expected termination case in the same way as the unexpected case (i.e. inefficiently): handle_info({'EXIT', Fsm, _Reason}, #state{handlers = Handlers} = State) -> Fdel = fun(_F, {Key, Pid, _Iter}) when Pid == Fsm -> Key; (F, {_Key, _Val, Iter}) -> F(F, gb_trees:next(Iter)); (_F, none) -> none end, Iter = gb_trees:iterator(Handlers), case Fdel(Fdel, gb_trees:next(Iter)) of none -> {noreply, State}; Key -> NewHandlers = gb_trees:delete(Key, Handlers), NewState = State#state{handlers = NewHandlers}, {noreply, NewState} end. I would be willing to implement a patch if the team agrees with the approach. -Vance (*) http://github.com/vances/radierl http://motivity.ca/radius On Wed, Apr 06, 2011 at 10:40:56AM +0200, Siri Hansen wrote: } We have now discussed this matter and decided that instead of adding a new } terminate/1 function we will add a clause to terminate_child/2 and allow the } child to be pointed out by Pid instead of Id. } } The correction will be included in R14B03. } } Thank you for the contribution! } } Best regards } /siri From henrik@REDACTED Wed Apr 13 11:08:14 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 13 Apr 2011 11:08:14 +0200 Subject: [erlang-patches] dialyzer doc fixes In-Reply-To: <4DA48249.8010907@cs.ntua.gr> References: <4DA438CF.9030203@erlang.org> <4DA48249.8010907@cs.ntua.gr> Message-ID: <4DA567FE.8070305@erlang.org> On 04/12/2011 06:48 PM, Kostis Sagonas wrote: > Henrik Nord wrote: >> On 04/11/2011 09:50 PM, Tuncer Ayaz wrote: >>> git fetch git://github.com/tuncer/otp.git dialyzer-doc >>> _______________________________________________ >>> erlang-patches mailing list >>> erlang-patches@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-patches >> Hi >> >> This .txt file is only used as "help text" in the GUI. >> instead of maintaining 2 versions of the same information, we should >> eliminate the need for the .txt, >> and use the documentation generated from the xml in its place. > > This is a good suggestion but it's independent of the above. Tuncer's > patch synchronizes the two files and fixes some minor issues in them. > It's a step in the right direction and I think it should be included > to 'dev' independently of whether we decide to eliminate the .txt file > with another patch. > > Now, dialyzer uses the gs:editor/2 function to display the .txt file. > Does 'gs' have something that can display an .xml file? > (Similar question for 'wx' I guess...) > > Kostis Hi in wx there is a call to launchDefaultBrowser http://www.erlang.org/doc/man/wx_misc.html#launchDefaultBrowser-1 in gs we are not so lucky, there one has to introduce something like that. -- /Henrik Nord Erlang/OTP From erlangsiri@REDACTED Wed Apr 13 14:32:15 2011 From: erlangsiri@REDACTED (Siri Hansen) Date: Wed, 13 Apr 2011 14:32:15 +0200 Subject: [erlang-patches] Supervisor Shutdown In-Reply-To: <20110412231844.GB4859@h216-235-12-174.host.egate.net> References: <20110401191452.GN6861@h216-235-12-173.host.egate.net> <4D99C875.1090102@erlang.org> <20110406003326.GB4859@h216-235-12-174.host.egate.net> <20110412231844.GB4859@h216-235-12-174.host.egate.net> Message-ID: Hi Vance, a while back (I think R13B), there was a change in stdlib (from the release note): "When a process started with proc_lib, gen_server, or gen_fsm exits with reason {shutdown,Term}, a crash report will no longer be generated (to allow a clean shutdown, but still provide additional information to process that are linked to the terminating process)." I think - what causes your particular problem in radius is that supervisor is not adapted to this change. I.e. even though there will be no error- or crash report from the child process (gen_fsm) itself, there will still be a supervisor report. We find it fair to correct this! However, this change will not be fully backwards compatible because removing the supervisor report is not enough - we must also remove the supervisor's attempt at restarting the child (depening on the child's restart type). This means that we can not do this in a patch release - we must wait for R15. When it comes to {normal,Info} we have decided not to implement that since it is not obvious how it should work (if it should be equivalent to normal (which has a special meaning in the language) or as shutdown (which really only has a special meaning in OTP/supervisor/proc_lib)). I hope this is an ok solution for you? I will do the correction for R15. Regards /siri 2011/4/13 Vance Shipley > Siri et. al., > > Thank you, I'm glad there is agreement that the functionality is desired. > > In a similiar vein I'd like to see an enhancement to allow passing > information back in the exit message of a child. Currently a child's > init/1 function may return {ok,Child} or {ok,Child,Info} and > supervisor:start_child/2 returns the same. I'd like to see the inverse > where the child may exit with either 'shutdown' or {shutdown, Info}, > in response to a shutdown request from it's supervisor, and 'normal' > or {normal, Info} for a normal exit. > > The child may exit with any value now of course however if the exit > value isn't expected the supervisor restart strategy and SASL error > logging will not work as desired. > > You may look to my radierl(*) project for an example of a practical > application of this functionality. In this stack application the > radius_server module implements a gen_server which will dynamically > start a new gen_fsm process, under supervision, to service requests. > It keeps the gen_fsm's pid in state stored in a gb_tree() with the > client's info as the key. In this way client requests can be quickly > looked up and forwarded to the gen_fsm. When the gen_fsm terminates > the gen_server needs to reap the state. > > I implemented a clause in radius_server to efficiently do this: > > handle_info({'EXIT', _Pid, {shutdown, Key}}, > #state{handlers = Handlers} = State) -> > NewHandlers = gb_trees:delete(Key, Handlers), > NewState = State#state{handlers = NewHandlers}, > {noreply, NewState}; > > However I can't use this because SASL reports are generated for normal > terminations. Instead I have to handle the normal expected termination > case in the same way as the unexpected case (i.e. inefficiently): > > handle_info({'EXIT', Fsm, _Reason}, > #state{handlers = Handlers} = State) -> > Fdel = fun(_F, {Key, Pid, _Iter}) when Pid == Fsm -> > Key; > (F, {_Key, _Val, Iter}) -> > F(F, gb_trees:next(Iter)); > (_F, none) -> > none > end, > Iter = gb_trees:iterator(Handlers), > case Fdel(Fdel, gb_trees:next(Iter)) of > none -> > {noreply, State}; > Key -> > NewHandlers = gb_trees:delete(Key, Handlers), > NewState = State#state{handlers = NewHandlers}, > {noreply, NewState} > end. > > I would be willing to implement a patch if the team agrees with the > approach. > > -Vance > > (*) http://github.com/vances/radierl > http://motivity.ca/radius > > On Wed, Apr 06, 2011 at 10:40:56AM +0200, Siri Hansen wrote: > } We have now discussed this matter and decided that instead of adding a > new > } terminate/1 function we will add a clause to terminate_child/2 and allow > the > } child to be pointed out by Pid instead of Id. > } > } The correction will be included in R14B03. > } > } Thank you for the contribution! > } > } Best regards > } /siri > -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Wed Apr 13 14:59:26 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 13 Apr 2011 14:59:26 +0200 Subject: [erlang-patches] [PATCH] erl_interface: fix compile error In-Reply-To: <20110408175240.GA31700@ecn.lan> References: <20110408175240.GA31700@ecn.lan> Message-ID: <4DA59E2E.50301@erlang.org> On 04/08/2011 07:52 PM, Michael Santos wrote: > --- > lib/erl_interface/src/legacy/erl_timeout.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/lib/erl_interface/src/legacy/erl_timeout.c b/lib/erl_interface/src/legacy/erl_timeout.c > index d9560ee..146a106 100644 > --- a/lib/erl_interface/src/legacy/erl_timeout.c > +++ b/lib/erl_interface/src/legacy/erl_timeout.c > @@ -43,6 +43,7 @@ > # endif > #endif > > +#include "erl_interface.h" > #include "erl_timeout.h" > > typedef struct jmp_s { Hi Michael I have included this into 'pu', if something breaks I will let you know. Thank you for the contribution! -- /Henrik Nord Erlang/OTP From henrik@REDACTED Wed Apr 13 15:03:35 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 13 Apr 2011 15:03:35 +0200 Subject: [erlang-patches] PATCH: Fix building on Solaris 11 Express In-Reply-To: References: Message-ID: <4DA59F27.6040402@erlang.org> On 04/10/2011 09:17 PM, Palle Lyckegaard wrote: > Hi, > > the following patch is necessary to build on a Solaris 11 Express host: > > git fetch git://github.com/PalleLyckegaard/otp.git solaris11 > > In addition to the patch LD needs to be specified as > > LD=/usr/ccs/bin/ld ./configure && gmake > > otherwise the GNU ld located in /usr/gnu/bin/ld will incorrectly > picked up. > > Regards > Palle Lyckegaard > > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hi Palle This is now included in 'pu'. Thank you for your contribution! -- /Henrik Nord Erlang/OTP From henrik@REDACTED Wed Apr 13 15:24:15 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 13 Apr 2011 15:24:15 +0200 Subject: [erlang-patches] Patch to fix compilation on OpenIndiana In-Reply-To: <25F118BB-CDA2-4A11-8613-240692C99D41@gmail.com> References: <25F118BB-CDA2-4A11-8613-240692C99D41@gmail.com> Message-ID: <4DA5A3FF.6090500@erlang.org> On 04/11/2011 11:29 AM, Trond Norbye wrote: > inet_drv.c fails to compile on my system because I got SIOCGIFHWADDR > defined, but I don't have the ifr_hwaddr member in the struct. > > I do have an enaddr (containing the ethernet address, but I believe > the "correct way" to read out the mac address on my openindiana box > would be to use libdlpi (at least that's how ifconfig does it). > > https://github.com/trondn/otp/commit/6511458100bb8e1d890cdbd5ade04a931ebf9efd > > > Cheers, > > Trond Norbye > > > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hi would you kindly construct a branch from this, and submit a fetch adress e.g. git fetch git://github.com/trondn/otp.git OpenIndiana-inet_drv-fix Thank you -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From trond.norbye@REDACTED Wed Apr 13 15:30:27 2011 From: trond.norbye@REDACTED (Trond Norbye) Date: Wed, 13 Apr 2011 15:30:27 +0200 Subject: [erlang-patches] Patch to fix compilation on OpenIndiana In-Reply-To: <4DA5A3FF.6090500@erlang.org> References: <25F118BB-CDA2-4A11-8613-240692C99D41@gmail.com> <4DA5A3FF.6090500@erlang.org> Message-ID: <31720CA3-B0FE-4109-A0B5-5CFD10854E89@gmail.com> git fetch git://github.com/trondn/otp.git inet_drv-fix (btw. this patch adds an implementation for the problem that the solaris express patch you just applied to the pu branch just disabled... I would suspect a merge conflict with that..) Cheers, Trond On 13. apr. 2011, at 15.24, Henrik Nord wrote: > On 04/11/2011 11:29 AM, Trond Norbye wrote: >> >> inet_drv.c fails to compile on my system because I got SIOCGIFHWADDR defined, but I don't have the ifr_hwaddr member in the struct. >> >> I do have an enaddr (containing the ethernet address, but I believe the "correct way" to read out the mac address on my openindiana box would be to use libdlpi (at least that's how ifconfig does it). >> >> https://github.com/trondn/otp/commit/6511458100bb8e1d890cdbd5ade04a931ebf9efd >> >> >> Cheers, >> >> Trond Norbye >> >> >> >> >> _______________________________________________ >> erlang-patches mailing list >> erlang-patches@REDACTED >> http://erlang.org/mailman/listinfo/erlang-patches > Hi > would you kindly construct a branch from this, and submit a > fetch adress e.g. > > git fetch git://github.com/trondn/otp.git OpenIndiana-inet_drv-fix > > Thank you > -- > /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Wed Apr 13 15:37:11 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 13 Apr 2011 15:37:11 +0200 Subject: [erlang-patches] Disable flow control for beam started via run_erl In-Reply-To: References: Message-ID: <4DA5A707.2050101@erlang.org> Hi This branch has been long overdue for a review sense it was submitted over a year ago Here are the things that we would like to see done before it is included in 'dev' * RUN_ERL_DISABLE_FLOWCNTRL needs to be documented. * In the error messages, "terminals" should be changed to "terminal's". Thank you for your patience and contribution! -- /Henrik Nord Erlang/OTP From henrik@REDACTED Wed Apr 13 16:57:51 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 13 Apr 2011 16:57:51 +0200 Subject: [erlang-patches] What's cooking in erlang/otp (2011-04-13) Message-ID: <201104131457.p3DEvnjT014613@smaug.otp.ericsson.se> ------------------------------------------------------------ [Graduated] * at/os_mon_dragonfly_support (os_mon) (2011-04-01) 1 commit + Add support for DragonFlyBSD to memsup (6d1cfbc) * at/os_mon_netbsd_support (os_mon) (2011-04-03) 1 commit + Add NetBSD support to memsup and disksup (ca1223e) * gc/gen-format-status-improvements (stdlib) (2010-06-12) 1 commit + Fix format_status bug for unregistered gen_event processes (95ed86f) * hw/epmd-bind-to-address (erts) (2010-11-10) 1 commit + Allow user to specify the IP address epmd binds to (bcf3b3d) * mh/eunit-surefire-reports (eunit) (2011-04-07) 1 commit + Increase depth of error messages in Eunit Surefire reports (b6decaf) * mk/net-kernel-epmd-return-list (kernel) (2010-12-10) 1 commit + Fix list returned by net_kernel:epmd_module (169d7e4) * ms/epmd-local-access-check (erts) (2010-11-24) 1 commit + epmd: include host address in local access check (5b68030) * sa/dialyzer-invalid-spec-fix (dialyzer) (2011-03-29) 1 commit + Fix crash related with the contract blame assignment patch (beec181) * ta/erts-unused-vars (erts) (2011-03-10) 1 commit + erts: Remove unused variables (345454e) * ts/cover-with-export_all (tools) (2010-09-23) 1 commit + add user specified compiler options on form reloading (eb02beb) ------------------------------------------------------------ [New topics] * ms/erl_interface-compile-error (erl_interface) (2011-04-08) 1 commit - erl_interface: fix compile error (daad8e6) * ms/unsigned-integer-overflow-in-error (erts) (2011-04-06) 1 commit - Unsigned integer may overflow in error message (3257bb0) * pl/solaris11-build (erts) (2011-04-10) 1 commit - Fix building on Solaris 11 Express (49beba0) * ta/dialyzer-doc (dialyzer) (2011-04-11) 3 commits - dialyzer/doc: synchronize manual.txt and dialyzer.xml (8b852b4) - dialyzer/doc: fix whitespace errors (69f8ad2) - dialyzer/doc: use consistent colons in type specs (890defc) ------------------------------------------------------------ [Stalled] * jn/gen_stream (stdlib) (2011-01-31) 1 commit - Add gen_stream behaviour (730c7fd) Action expected from: OTP-Team * sa/callback-attr (compiler, inets, kernel, otp, stdlib) (2010-06-08) 6 commits - Add callback specs into 'application' module in kernel (a180fb1) - Add callback specs to tftp module following internet documentation (d0e32d8) - Add callback specs to inets_service module following possibly deprecated comments (d90e984) - Add '-callback' attributes in stdlib's behaviours (acf3d67) - Update primary bootstrap (30c1e91) - Add '-callback' attribute to language syntax (6ee955e) Action expected from: OTP-Team * uw/mnesia-majority (mnesia) (2011-01-30) 8 commits - Add documentation text about majority checking (f5b8427) - add mnesia_majority_test suite (9c2f765) - where_to_wlock optimization + change_table_majority/2 (a535b6c) - bug in mnesia_tm:needs_majority/2 (eb81e20) - optimize sticky_lock maj. check (5b304d4) - check majority for sticky locks (ae9e1fa) - Write locks now check majority when needed. (6f02d2e) - Add {majority, boolean()} per-table option. (c3241c0) Action expected from: OTP-Applications team * vb/shell (erts, kernel, stdlib) (2011-01-21) 6 commits - Add expandfmt_fun option for io:setopts (f139eab) - Correct JCL's help indentation (95672fa) - Handle JCL's "r" command error when no pool started (ba4b196) - Fix tab expansion in remote shell (e2077cb) - edlin_expand: fix matches formatting (838b84a) - Take into account arity len when calculating field's width (ff28c52) Action expected from: OTP-reviewer * ta/typer-quote-atoms (hipe, typer) (2011-03-20) 1 commit - Quote atoms if necessary in types (254e21e) Action expected from: Hipe-team reviewer * bw/efile_exists (erts) (2010-10-07) 1 commit - prim_file:exists/{1,2} which is lightweight file existence check (7203932) Action expected from: Topic author * fm/posix-fallocate (erts, kernel) (2011-01-10) 2 commits - Fix build on Solaris (38a922d) - Added file:allocate/2 (9870d9b) Action expected from: Topic author * jf/run_erl-disable-flow-control (erts) (2010-03-05) 1 commit - Teach run_erl RUN_ERL_DISABLE_FLOWCNTRL for disabling flow control (d0775cd) Action expected from: Topic author * lt/et-fix (et) (2011-03-30) 1 commit - Force contents window size to display correctly on Windows. (9836fb2) Action expected from: Topic author * pd/ttb_upgrade (observer) (2011-04-05) 30 commits - additional tests for ttb module (ee2dabc) - new tests for ttb module (6f8ec53) - updated documentation (d39fa78) - updated OTP tests (dc1af0f) - (BUGFIX) Error with ip tracing to wrap sets (5082fc8) - Add onviso_server and cli as an exemplary ttb usage (d5a68df) - Include logfile name in fetch directory name (45f3302) - missing files addes (3e759dd) - dbg-type tracing (ece6a3b) - Optional handler specification allowed in stop/1 - Allowed optional handler specification in trace/2 (97be5ad) - Flush file trace port buffers with given frequency (9d4b083) - Autoresume tracing (7101720) - etc... Action expected from: Topic author * nox/xmerl-namespace-axis (xmerl) (2010-12-07) 12 commits . Implement namespace axis (27d791f) . Add `#xmlPI` support to xmerl_xpath:write_node/1 (75e67f5) . Fix processing-instruction(name?) (f05e78b) . Fix path filters (610df56) . Support more top-level primary expressions (770d6d9) . Accumulate comments in element nodes (e5b6b3a) . Add `default_attrs` option (18584c5) . Allow whole documents to be returned (aef3dea) . Track parents and namespace in `#xmlAttribute` nodes (dc9b220) . Track parents in `#xmlPI` nodes (5095331) . Set `vsn` field in `#xmlDecl` record (d712331) . Fix namespace-conformance constraints (e062270) Planned for R15 ------------------------------------------------------------ [Cooking] * bd/mod_esi_timeout_fix (inets) (2011-03-17) 1 commit - Fix timeout message generated by mod_esi (eea0a7b) * bg/temp-hipe-fixes (compiler, hipe, kernel) (2010-03-15) 6 commits - Avoid crash by skipping compilation_SUITE:on_load/1 (8592a02) - Inline less aggressively for native-code compilation (e699ad4) - Crudely fix return type for the lists:key{search,find,member}/3 (2b72202) - seq_trace_SUITE: Don't native-compile (2712344) - Disable native code if on_load is used (e8d0ea4) - andor_SUITE: Don't native-compile (e25ef8c) This branch contains temporary workarounds to avoid failing test cases and is never intended to graduate. * bsmr/fix-makefile-in-for-xref-mod-app-escript (otp) (2010-12-10) 1 commit - Fix for Makefile.in invoking xref_mod_app.escript (10d4235) * hw/fix-epmd-perror (erts) (2010-11-13) 1 commit - Fix epmd's dbg_perror() output (b363d7d) * km/pool_connect-to-running-nodes (stdlib) (2010-09-02) 1 commit - Change pool module to attempt to attach to nodes that are already running (a9f4cbc) * ks/prim_file-fixes (erts) (2011-02-05) 3 commits - New version of the file (ca86ed3) - Driver names should be strings, not atoms (b8ea40c) - Cleanup and cosmetic changes (6adc116) * ks/snmp-specs (snmp) (2011-04-03) 1 commit - Add specs for functions that do not return (7354ffb) * ms/beam-fix-format-specifiers-in-erl_exit-msg (erts) (2011-04-06) 1 commit - Fix format specifiers in erl_exit messages (a8bacf3) * ms/file-fix-hang-reading-compressed-files (erts, kernel) (2011-04-07) 1 commit - file: fix hang reading compressed files (b9e8506) * ms/heart-rem-garbage-append (erts, kernel) (2011-04-05) 1 commit - heart: remove garbage appended to heart command (fa8456a) * rj/fix-httpd-format (inets) (2011-03-17) 1 commit - Fix log messages formating in httpd (cbe8b2e) * ta/sendfile (erts, kernel, test_server) (2011-01-13) 1 commit - Implement file:sendfile (a3f90ad) * ta/unicode-non-chars (stdlib) (2011-04-05) 1 commit - unicode: document 16#FFFE and 16#FFFF (non chars) (4207846) * sv/enif_is_exception (erts) (2011-02-22) 1 commit . add support for checking if an ERL_NIF_TERM is an exception (f8cc2b0) * dc/improved_find_redist (erts) (2011-03-18) 1 commit . support new SDKs in find_redist.sh and fallback to $ERL_TOP as last resort (f4f35aa) ------------------------------------------------------------ [Dropped] * fd/supervisor-delete-child-spec-on-child-termination (stdlib) (2011-01-19) 1 commit . Added supervisor:start_child/3 (bdf27ab) Reworked by OTP-application team * ks/any-arity-fun (erts, stdlib) (2011-03-30) 4 commits . Fix translation of fun((...) -> T) type (6121ade) . Remove CVS Id tags from the files (22a8272) . Remove CVS Id tags from the files (d39fbf6) . Remove CVS Id tags from the files (68f7040) Rejected: proposed tuple already has a meaning. From magnus.henoch@REDACTED Thu Apr 14 17:49:32 2011 From: magnus.henoch@REDACTED (Magnus Henoch) Date: Thu, 14 Apr 2011 15:49:32 +0000 (GMT) Subject: [erlang-patches] [PATCH] Inhibit electric newline after "->" when inside a type spec In-Reply-To: <1833709557.102061302796122165.JavaMail.root@zimbra> Message-ID: <1982701615.102091302796172473.JavaMail.root@zimbra> The Erlang mode for Emacs inserts a newline after every "->", which saves you one keystroke when writing a function, but that is inappropriate when writing a type spec, as you'd normally keep the spec on one line. This change inhibits the automatic insertion when the current line starts with "-spec" or "-type". --- lib/tools/emacs/erlang.el | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el index e1c0d31..6728bef 100644 --- a/lib/tools/emacs/erlang.el +++ b/lib/tools/emacs/erlang.el @@ -386,7 +386,8 @@ then no prototype is inserted. The test is performed by the function `erlang-test-criteria-list'.") (defvar erlang-electric-arrow-criteria - '(erlang-next-lines-empty-p + '(erlang-stop-when-in-type-spec + erlang-next-lines-empty-p erlang-at-end-of-function-p) "*List of functions controlling the arrow aspect of `erlang-electric-gt'. The functions in this list are called, in order, whenever a `>' @@ -4045,6 +4046,16 @@ This function is designed to be a member of a criteria list." nil))) +(defun erlang-stop-when-in-type-spec () + "Return `stop' when in a type spec line. + +This function is designed to be a member of a criteria list." + (save-excursion + (beginning-of-line) + (when (save-match-data (looking-at "-\\(spec\\|type\\)")) + 'stop))) + + (defun erlang-next-lines-empty-p () "Return non-nil if next lines are empty. -- 1.7.0.4 From fdmanana@REDACTED Thu Apr 14 21:42:09 2011 From: fdmanana@REDACTED (Filipe David Manana) Date: Thu, 14 Apr 2011 20:42:09 +0100 Subject: [erlang-patches] [PATCH] - missing OS family in os:type/0 documentation Message-ID: git fetch git://github.com/fdmanana/otp.git os_type_doc_missing_family regards, -- Filipe David Manana, fdmanana@REDACTED, fdmanana@REDACTED "Reasonable men adapt themselves to the world. ?Unreasonable men adapt the world to themselves. ?That's why all progress depends on unreasonable men." From henrik@REDACTED Fri Apr 15 09:50:22 2011 From: henrik@REDACTED (Henrik Nord) Date: Fri, 15 Apr 2011 09:50:22 +0200 Subject: [erlang-patches] [PATCH] Inhibit electric newline after "->" when inside a type spec In-Reply-To: <1982701615.102091302796172473.JavaMail.root@zimbra> References: <1982701615.102091302796172473.JavaMail.root@zimbra> Message-ID: <4DA7F8BE.6000203@erlang.org> On 04/14/2011 05:49 PM, Magnus Henoch wrote: > The Erlang mode for Emacs inserts a newline after every "->", which > saves you one keystroke when writing a function, but that is > inappropriate when writing a type spec, as you'd normally keep the > spec on one line. This change inhibits the automatic insertion when > the current line starts with "-spec" or "-type". > --- > lib/tools/emacs/erlang.el | 13 ++++++++++++- > 1 files changed, 12 insertions(+), 1 deletions(-) > > diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el > index e1c0d31..6728bef 100644 > --- a/lib/tools/emacs/erlang.el > +++ b/lib/tools/emacs/erlang.el > @@ -386,7 +386,8 @@ then no prototype is inserted. > The test is performed by the function `erlang-test-criteria-list'.") > > (defvar erlang-electric-arrow-criteria > - '(erlang-next-lines-empty-p > + '(erlang-stop-when-in-type-spec > + erlang-next-lines-empty-p > erlang-at-end-of-function-p) > "*List of functions controlling the arrow aspect of `erlang-electric-gt'. > The functions in this list are called, in order, whenever a `>' > @@ -4045,6 +4046,16 @@ This function is designed to be a member of a criteria list." > nil))) > > > +(defun erlang-stop-when-in-type-spec () > + "Return `stop' when in a type spec line. > + > +This function is designed to be a member of a criteria list." > + (save-excursion > + (beginning-of-line) > + (when (save-match-data (looking-at "-\\(spec\\|type\\)")) > + 'stop))) > + > + > (defun erlang-next-lines-empty-p () > "Return non-nil if next lines are empty. > Hi I have included this into 'pu' Thank you for the contribution! -- /Henrik Nord Erlang/OTP From jay@REDACTED Fri Apr 15 12:49:03 2011 From: jay@REDACTED (Jay Nelson) Date: Fri, 15 Apr 2011 03:49:03 -0700 Subject: [erlang-patches] gen_stream updated to common_test Message-ID: <74D843C7-2299-48C0-B24E-206A978A86EF@duomark.com> The gen_stream tests have been updated to reflect the new common_test method for testing (and the copyright year 2011 was added). git fetch git://github.com/jaynel/otp.git gen_stream jay From henrik@REDACTED Fri Apr 15 16:52:41 2011 From: henrik@REDACTED (Henrik Nord) Date: Fri, 15 Apr 2011 16:52:41 +0200 Subject: [erlang-patches] gen_stream updated to common_test In-Reply-To: <74D843C7-2299-48C0-B24E-206A978A86EF@duomark.com> References: <74D843C7-2299-48C0-B24E-206A978A86EF@duomark.com> Message-ID: <4DA85BB9.4010709@erlang.org> On 04/15/2011 12:49 PM, Jay Nelson wrote: > The gen_stream tests have been updated to reflect the new common_test method for testing (and the copyright year 2011 was added). > > git fetch git://github.com/jaynel/otp.git gen_stream > > jay > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hi Thank you, I have now refetched the branch. As you probably saw in the cooking mail, this is waiting for a OTP-Team review -- /Henrik Nord Erlang/OTP From henrik@REDACTED Mon Apr 18 09:46:07 2011 From: henrik@REDACTED (Henrik Nord) Date: Mon, 18 Apr 2011 09:46:07 +0200 Subject: [erlang-patches] Patch to fix compilation on OpenIndiana In-Reply-To: <31720CA3-B0FE-4109-A0B5-5CFD10854E89@gmail.com> References: <25F118BB-CDA2-4A11-8613-240692C99D41@gmail.com> <4DA5A3FF.6090500@erlang.org> <31720CA3-B0FE-4109-A0B5-5CFD10854E89@gmail.com> Message-ID: <4DABEC3F.5010007@erlang.org> On 04/13/2011 03:30 PM, Trond Norbye wrote: > git fetch git://github.com/trondn/otp.git inet_drv-fix > > (btw. this patch adds an implementation for the problem that the > solaris express patch you just applied to the pu branch just > disabled... I would suspect a merge conflict with that..) > > Cheers, > > Trond > > > > On 13. apr. 2011, at 15.24, Henrik Nord wrote: > >> On 04/11/2011 11:29 AM, Trond Norbye wrote: >>> inet_drv.c fails to compile on my system because I got SIOCGIFHWADDR >>> defined, but I don't have the ifr_hwaddr member in the struct. >>> >>> I do have an enaddr (containing the ethernet address, but I believe >>> the "correct way" to read out the mac address on my openindiana box >>> would be to use libdlpi (at least that's how ifconfig does it). >>> >>> https://github.com/trondn/otp/commit/6511458100bb8e1d890cdbd5ade04a931ebf9efd >>> >>> >>> Cheers, >>> >>> Trond Norbye >>> >>> >>> >>> >>> _______________________________________________ >>> erlang-patches mailing list >>> erlang-patches@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-patches >> Hi >> would you kindly construct a branch from this, and submit a >> fetch adress e.g. >> >> git fetch git://github.com/trondn/otp.git OpenIndiana-inet_drv-fix >> >> Thank you >> -- >> /Henrik Nord Erlang/OTP > Thank you This branch is now cooking in 'pu' replacing the 'pl/solaris11-build' branch Thank you for the contribution -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From klas.johansson@REDACTED Mon Apr 18 11:06:39 2011 From: klas.johansson@REDACTED (Klas Johansson) Date: Mon, 18 Apr 2011 11:06:39 +0200 Subject: [erlang-patches] eunit: fix race conditions Message-ID: Hi, When playing around with eunit's surefire XML reports I noticed that the files are sometimes not generated and I decided to have a look: Wait until all eunit listeners terminate Ensure that all eunit listeners (like eunit_surefire) get the chance to finish their work before terminating. Prior to this fix, the eunit_surefire XML was sometimes not generated. While addressing that problem I also noticed the following: Don't let eunit_surefire report back to eunit when stopping When eunit is terminating, a stop message is sent to all listeners and eunit then waits for *one* result message but previously both eunit_tty and eunit_surefire sent a response on error. Don't send a result message from eunit_surefire; let eunit_tty take care of all result reporting, both positive and negative to avoid race conditions and inconsistencies. Tested manually by running eunit with surefire report generation over and over again (with a timer:sleep/1 inserted to make sure that XML file generation takes time to complete). Code here: git fetch git://github.com/klajo/otp.git eunit-race-cond Cheers, Klas From henrik@REDACTED Mon Apr 18 12:07:13 2011 From: henrik@REDACTED (Henrik Nord) Date: Mon, 18 Apr 2011 12:07:13 +0200 Subject: [erlang-patches] [PATCH] - missing OS family in os:type/0 documentation In-Reply-To: References: Message-ID: <4DAC0D51.90306@erlang.org> On 04/14/2011 09:42 PM, Filipe David Manana wrote: > git fetch git://github.com/fdmanana/otp.git os_type_doc_missing_family > > regards, > Hi Rejected du to OSE is no longer supported. A better patch would be to remove the references to ose from the code. Thank you for the contribution -- /Henrik Nord Erlang/OTP From henrik@REDACTED Mon Apr 18 16:37:33 2011 From: henrik@REDACTED (Henrik Nord) Date: Mon, 18 Apr 2011 16:37:33 +0200 Subject: [erlang-patches] User input tab expansion and JCL menu related fixes In-Reply-To: References: Message-ID: <4DAC4CAD.4070606@erlang.org> Hello This area of the code is very sensitive and needs to be handled with care. We would like you to do the following: Separate each feature in a different branch, containing all changes regarding that feature. e.g. the Help indentation correction in one branch tab expansion in one etc. Each branch adding test cases covering the change you introduced. This will not only help with review, but we might be able to include some of the changes, and possible reject others. At this moment the different commits are to mixed together and the commits touch on code the previous commit added and so on. This makes it extremely hard to review the changes as they are mixed. Here are some links containing good info: https://github.com/erlang/otp/wiki/Submitting-patches https://github.com/erlang/otp/wiki/Writing-good-commit-messages -- /Henrik Nord Erlang/OTP From fdmanana@REDACTED Tue Apr 19 21:58:03 2011 From: fdmanana@REDACTED (Filipe David Manana) Date: Tue, 19 Apr 2011 20:58:03 +0100 Subject: [erlang-patches] [PATCH] - missing OS family in os:type/0 documentation In-Reply-To: <4DAC0D51.90306@erlang.org> References: <4DAC0D51.90306@erlang.org> Message-ID: Thanks. I was confused since there are quite a few places in the code that refer to the 'ose' atom. Will clean it up and submit a new patch. On Mon, Apr 18, 2011 at 11:07 AM, Henrik Nord wrote: > On 04/14/2011 09:42 PM, Filipe David Manana wrote: >> >> git ?fetch ?git://github.com/fdmanana/otp.git ?os_type_doc_missing_family >> >> regards, >> > Hi > Rejected du to OSE is no longer supported. > > A better patch would be to remove the references to ose from the code. > > Thank you for the contribution > > > -- > /Henrik Nord Erlang/OTP > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > -- Filipe David Manana, fdmanana@REDACTED, fdmanana@REDACTED "Reasonable men adapt themselves to the world. ?Unreasonable men adapt the world to themselves. ?That's why all progress depends on unreasonable men." From aronisstav@REDACTED Thu Apr 21 11:46:59 2011 From: aronisstav@REDACTED (Stavros Aronis) Date: Thu, 21 Apr 2011 12:46:59 +0300 Subject: [erlang-patches] Dialyzer tests update Message-ID: This branch contains a restructure of Dialyzer's test suites, a fix for the options1/compiler broken test and some more tests that have been added to the suites. git fetch git://github.com/aronisstav/otp.git dialyzer-tests -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Fri Apr 22 20:38:34 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 22 Apr 2011 20:38:34 +0200 Subject: [erlang-patches] Add DragonflyBSD support to test_server Message-ID: git fetch git://github.com/tuncer/otp.git test_server-configure-dragonflybsd From goran.a.larsson@REDACTED Tue Apr 26 06:59:49 2011 From: goran.a.larsson@REDACTED (=?iso-8859-1?Q?G=F6ran_Larsson_A?=) Date: Tue, 26 Apr 2011 06:59:49 +0200 Subject: [erlang-patches] Small fix to erl_interface legacy receive function Message-ID: When I was playing with the 'erl_interface' in an attempt to write a C++ wrapper for it, I used the 'cnode.c' test case from the 'erl_eterm_SUITE' as a base. Yes I know that the interface it uses is legacy, but it was an easy piece of code to start with. The problem I got into was when trying to process rpc calls from an erlang node. The function 'erl_xreceive_msg' returned garbage in the 'to' and 'to_name' members of the message. The reason for that was found in the 'erl_do_receive_msg' function. When no 'pid' is provided by the sender, like when doing rpc calls as those uses registered name sends, it doesn't initialize the 'to' member and also the 'to_name' member is copied by the function. The solution is a small modification to the 'erl_do_receive_msg' function in 'legacy/erl_connect.c' from line 294 (erl_interface-3.7.3). Unfortunatly I'm not able to use GIT due to firewall issues in China where I am currently. So have to provide the modified code snippet the old fashioned way! ---erl_connect.c-------------------------------------------------------- static int erl_do_receive_msg(int fd, ei_x_buff* x, ErlMessage* emsg) { ... if (msg.from.node[0] != '\0') emsg->from = erl_mk_pid(msg.from.node, msg.from.num, msg.from.serial, msg.from.creation); else emsg->from = NULL; /* Uninitialized pointers are no fun */ if (msg.to.node[0] != '\0') emsg->to = erl_mk_pid(msg.to.node, msg.to.num, msg.to.serial, msg.to.creation); else emsg->to = NULL; /* Uninitialized pointers are no fun */ memcpy(emsg->to_name, msg.toname, MAXATOMLEN+1); /* We might be referred by registered name rather than by pid */ return r; } ------------------------------------------------------------------------ Regards, G?ran Larsson, Ericsson AB From henrik@REDACTED Tue Apr 26 12:28:46 2011 From: henrik@REDACTED (Henrik Nord) Date: Tue, 26 Apr 2011 12:28:46 +0200 Subject: [erlang-patches] Dialyzer tests update In-Reply-To: References: Message-ID: <4DB69E5E.8070605@erlang.org> On 04/21/2011 11:46 AM, Stavros Aronis wrote: > This branch contains a restructure of Dialyzer's test suites, a fix > for the options1/compiler broken test and some more tests that have > been added to the suites. > > git fetch git://github.com/aronisstav/otp.git > dialyzer-tests > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Thanks your branch is now included in 'pu' -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From egil@REDACTED Tue Apr 26 15:19:33 2011 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Tue, 26 Apr 2011 15:19:33 +0200 Subject: [erlang-patches] Small fix to erl_interface legacy receive function In-Reply-To: References: Message-ID: <4DB6C665.3030307@erix.ericsson.se> Hi G?ran, Thanks for pointing out this issue. I will have a look at the fix and make a git branch for it. Regards, Bj?rn-Egil Dahlberg Erlang/OTP, Ericsson AB On 2011-04-26 06:59, G?ran Larsson A wrote: > When I was playing with the 'erl_interface' in an attempt to write a C++ wrapper for it, I used the 'cnode.c' test case from the 'erl_eterm_SUITE' as a base. Yes I know that the interface it uses is legacy, but it was an easy piece of code to start with. > > The problem I got into was when trying to process rpc calls from an erlang node. The function 'erl_xreceive_msg' returned garbage in the 'to' and 'to_name' members of the message. The reason for that was found in the 'erl_do_receive_msg' function. When no 'pid' is provided by the sender, like when doing rpc calls as those uses registered name sends, it doesn't initialize the 'to' member and also the 'to_name' member is copied by the function. > > The solution is a small modification to the 'erl_do_receive_msg' function in 'legacy/erl_connect.c' from line 294 (erl_interface-3.7.3). Unfortunatly I'm not able to use GIT due to firewall issues in China where I am currently. So have to provide the modified code snippet the old fashioned way! > > ---erl_connect.c-------------------------------------------------------- > static int erl_do_receive_msg(int fd, ei_x_buff* x, ErlMessage* emsg) > { > ... > if (msg.from.node[0] != '\0') > emsg->from = erl_mk_pid(msg.from.node, msg.from.num, msg.from.serial, msg.from.creation); > else > emsg->from = NULL; /* Uninitialized pointers are no fun */ > if (msg.to.node[0] != '\0') > emsg->to = erl_mk_pid(msg.to.node, msg.to.num, msg.to.serial, msg.to.creation); > else > emsg->to = NULL; /* Uninitialized pointers are no fun */ > memcpy(emsg->to_name, msg.toname, MAXATOMLEN+1); /* We might be referred by registered name rather than by pid */ > return r; > } > ------------------------------------------------------------------------ > > Regards, > G?ran Larsson, Ericsson AB > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > From goran.a.larsson@REDACTED Wed Apr 27 03:20:40 2011 From: goran.a.larsson@REDACTED (=?iso-8859-1?Q?G=F6ran_Larsson_A?=) Date: Wed, 27 Apr 2011 03:20:40 +0200 Subject: [erlang-patches] Small fix to erl_interface legacy receive function In-Reply-To: <4DB6C665.3030307@erix.ericsson.se> References: <4DB6C665.3030307@erix.ericsson.se> Message-ID: Hi Bj?rn-Egil, It turns out it was more my misunderstanding of how GIT works (used to Subversion and ClearCase) that was the problem than anything else. So, after some fiddling I finaly managed to create and commit my own branch. Hope this one will work, as it is the first time I ever commited anything in GIT; git fetch git://github.com/galarsson/otp.git erl_do_receive_msg /G?ran -----Original Message----- From: erlang-patches-bounces@REDACTED [mailto:erlang-patches-bounces@REDACTED] On Behalf Of Bj?rn-Egil Dahlberg Sent: Tuesday, April 26, 2011 9:20 PM To: erlang-patches@REDACTED Subject: Re: [erlang-patches] Small fix to erl_interface legacy receive function Hi G?ran, Thanks for pointing out this issue. I will have a look at the fix and make a git branch for it. Regards, Bj?rn-Egil Dahlberg Erlang/OTP, Ericsson AB On 2011-04-26 06:59, G?ran Larsson A wrote: > When I was playing with the 'erl_interface' in an attempt to write a C++ wrapper for it, I used the 'cnode.c' test case from the 'erl_eterm_SUITE' as a base. Yes I know that the interface it uses is legacy, but it was an easy piece of code to start with. > > The problem I got into was when trying to process rpc calls from an erlang node. The function 'erl_xreceive_msg' returned garbage in the 'to' and 'to_name' members of the message. The reason for that was found in the 'erl_do_receive_msg' function. When no 'pid' is provided by the sender, like when doing rpc calls as those uses registered name sends, it doesn't initialize the 'to' member and also the 'to_name' member is copied by the function. > > The solution is a small modification to the 'erl_do_receive_msg' function in 'legacy/erl_connect.c' from line 294 (erl_interface-3.7.3). Unfortunatly I'm not able to use GIT due to firewall issues in China where I am currently. So have to provide the modified code snippet the old fashioned way! > > ---erl_connect.c------------------------------------------------------ > -- static int erl_do_receive_msg(int fd, ei_x_buff* x, ErlMessage* > emsg) { > ... > if (msg.from.node[0] != '\0') > emsg->from = erl_mk_pid(msg.from.node, msg.from.num, msg.from.serial, msg.from.creation); > else > emsg->from = NULL; /* Uninitialized pointers are no fun */ > if (msg.to.node[0] != '\0') > emsg->to = erl_mk_pid(msg.to.node, msg.to.num, msg.to.serial, msg.to.creation); > else > emsg->to = NULL; /* Uninitialized pointers are no fun */ > memcpy(emsg->to_name, msg.toname, MAXATOMLEN+1); /* We might be referred by registered name rather than by pid */ > return r; > } > ---------------------------------------------------------------------- > -- > > Regards, > G?ran Larsson, Ericsson AB > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > _______________________________________________ erlang-patches mailing list erlang-patches@REDACTED http://erlang.org/mailman/listinfo/erlang-patches From tuncer.ayaz@REDACTED Wed Apr 27 17:26:47 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Wed, 27 Apr 2011 17:26:47 +0200 Subject: [erlang-patches] Change URL in test report pages to erlang.org Message-ID: git fetch git://github.com/tuncer/otp.git test-reports-url From henrik@REDACTED Wed Apr 27 17:39:48 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 27 Apr 2011 17:39:48 +0200 Subject: [erlang-patches] What's cooking in erlang/otp (2011-04-27) Message-ID: <201104271539.p3RFdkTw018938@smaug.otp.ericsson.se> ------------------------------------------------------------ [Graduated] * hw/fix-epmd-perror (erts) (2010-11-13) 1 commit + Fix epmd's dbg_perror() output (b363d7d) * ms/heart-rem-garbage-append (erts, kernel) (2011-04-05) 1 commit + heart: remove garbage appended to heart command (fa8456a) * ta/dialyzer-doc (dialyzer) (2011-04-11) 3 commits + dialyzer/doc: synchronize manual.txt and dialyzer.xml (8b852b4) + dialyzer/doc: fix whitespace errors (69f8ad2) + dialyzer/doc: use consistent colons in type specs (890defc) ------------------------------------------------------------ [New topics] * mh/inhibit-newline-inside-typespec (tools) (2011-04-14) 1 commit - Inhibit electric newline after "->" when inside a type spec (c0c600a) * pr/mnesia_frag_hash (mnesia) (2011-04-27) 2 commits - add mnesia_frag_hash test (69bbc9c) - Reduce calls to phash in key_to_frag_number (67a20c0) * sa/dialyzer-tests (dialyzer) (2011-03-21) 22 commits - Update dialyzer.spec (ebe1cab) - Add race/ets_insert_public (a0c71c6) - Add opaque/ewgi,ewgi2 (daf9793) - Add opaque/schuett_bug (f8b48ad) - Add small/param_types_crash (ff7eb30) - Add small/file_open_encoding (b2d6763) - Add small/false_false (03d4842) - Add small/ets_update_counter (fea24cb) - Add small/bin_compr (0a8e4e3) - Add small/tuple_set_crash (fa50197) - Add small/refine_failing (71f45fe) - Add small/not_bogus_warning (2a88480) ... * ta/dragonfly-test_server-config (test_server) (2011-04-22) 1 commit - Add DragonflyBSD support to test_server (0a97fea) * ta/driver_entry-typo (erts) (2011-04-26) 1 commit - driver_entry: Remove gratuitous paren and fix typo (4380605) * tn/inet_drv-fix (erts) (2011-04-08) 1 commit - Use libdlpi to get physical address (e360563) ------------------------------------------------------------ [Stalled] * bw/efile_exists (erts) (2010-10-07) 1 commit - prim_file:exists/{1,2} which is lightweight file existence check (7203932) Action expected from: Topic author * fm/posix-fallocate (erts, kernel) (2011-04-15) 4 commits - Added missing surrounding if statement (5ec9fab) - Fixes to file:allocate/2 and respective tests (d0fb479) - Fix build on Solaris (9b8aecf) - Added file:allocate/2 (7554dbb) Action expected from: Topic author * jf/run_erl-disable-flow-control (erts) (2010-03-05) 1 commit - Teach run_erl RUN_ERL_DISABLE_FLOWCNTRL for disabling flow control (d0775cd) Action expected from: Topic author * jn/gen_stream (stdlib) (2011-04-15) 2 commits - Update gen_stream tests to conform with common_test standard (9f50d34) - Add gen_stream behaviour (3065e10) Action expected from: OTP-Team * lt/et-fix (et) (2011-03-30) 1 commit - Force contents window size to display correctly on Windows. (9836fb2) Action expected from: Topic author * sa/callback-attr (compiler, inets, kernel, otp, stdlib) (2010-06-08) 6 commits - Add callback specs into 'application' module in kernel (a180fb1) - Add callback specs to tftp module following internet documentation (d0e32d8) - Add callback specs to inets_service module following possibly deprecated comments (d90e984) - Add '-callback' attributes in stdlib's behaviours (acf3d67) - Update primary bootstrap (30c1e91) - Add '-callback' attribute to language syntax (6ee955e) Action expected from: OTP-Team * ta/typer-quote-atoms (hipe, typer) (2011-03-20) 1 commit - Quote atoms if necessary in types (254e21e) Action expected from: Hipe-team reviewer * uw/mnesia-majority (mnesia) (2011-01-30) 8 commits - Add documentation text about majority checking (f5b8427) - add mnesia_majority_test suite (9c2f765) - where_to_wlock optimization + change_table_majority/2 (a535b6c) - bug in mnesia_tm:needs_majority/2 (eb81e20) - optimize sticky_lock maj. check (5b304d4) - check majority for sticky locks (ae9e1fa) - Write locks now check majority when needed. (6f02d2e) - Add {majority, boolean()} per-table option. (c3241c0) Action expected from: OTP-Applications team * vb/shell (erts, kernel, stdlib) (2011-01-21) 6 commits - Add expandfmt_fun option for io:setopts (f139eab) - Correct JCL's help indentation (95672fa) - Handle JCL's "r" command error when no pool started (ba4b196) - Fix tab expansion in remote shell (e2077cb) - edlin_expand: fix matches formatting (838b84a) - Take into account arity len when calculating field's width (ff28c52) Action expected from: OTP-reviewer * pd/ttb_upgrade (observer) (2011-04-05) 30 commits . additional tests for ttb module (ee2dabc) . new tests for ttb module (6f8ec53) . updated documentation (d39fa78) . updated OTP tests (dc1af0f) . (BUGFIX) Error with ip tracing to wrap sets (5082fc8) . Add onviso_server and cli as an exemplary ttb usage (d5a68df) . Include logfile name in fetch directory name (45f3302) . missing files addes (3e759dd) . dbg-type tracing (ece6a3b) . Optional handler specification allowed in stop/1 - Allowed optional handler specification in trace/2 (97be5ad) . Flush file trace port buffers with given frequency (9d4b083) . Autoresume tracing (7101720) . . . Action expected from: Topic author * nox/xmerl-namespace-axis (xmerl) (2010-12-07) 12 commits . Implement namespace axis (27d791f) . Add `#xmlPI` support to xmerl_xpath:write_node/1 (75e67f5) . Fix processing-instruction(name?) (f05e78b) . Fix path filters (610df56) . Support more top-level primary expressions (770d6d9) . Accumulate comments in element nodes (e5b6b3a) . Add `default_attrs` option (18584c5) . Allow whole documents to be returned (aef3dea) . Track parents and namespace in `#xmlAttribute` nodes (dc9b220) . Track parents in `#xmlPI` nodes (5095331) . Set `vsn` field in `#xmlDecl` record (d712331) . Fix namespace-conformance constraints (e062270) Planned for R15 ------------------------------------------------------------ [Cooking] * bd/mod_esi_timeout_fix (inets) (2011-03-17) 1 commit - Fix timeout message generated by mod_esi (eea0a7b) * bg/temp-hipe-fixes (compiler, hipe, kernel) (2010-03-15) 6 commits - Avoid crash by skipping compilation_SUITE:on_load/1 (0d913e0) - Inline less aggressively for native-code compilation (0215ac6) - Crudely fix return type for the lists:key{search,find,member}/3 (4f48864) - seq_trace_SUITE: Don't native-compile (3799b17) - Disable native code if on_load is used (f35872c) - andor_SUITE: Don't native-compile (a8ab68c) This branch contains temporary workarounds to avoid failing test cases and is never intended to graduate. * bsmr/fix-makefile-in-for-xref-mod-app-escript (otp) (2010-12-10) 1 commit - Fix for Makefile.in invoking xref_mod_app.escript (10d4235) * km/pool_connect-to-running-nodes (stdlib) (2010-09-02) 1 commit - Change pool module to attempt to attach to nodes that are already running (a9f4cbc) * ks/prim_file-fixes (erts) (2011-04-27) 3 commits - add prim_file.beam (e56d1c1) - Driver names should be strings, not atoms (0f03b1e) - Cleanup and cosmetic changes (bfc2254) * ks/snmp-specs (snmp) (2011-04-03) 1 commit - Add specs for functions that do not return (7354ffb) * ms/beam-fix-format-specifiers-in-erl_exit-msg (erts) (2011-04-06) 1 commit - Fix format specifiers in erl_exit messages (a8bacf3) * ms/erl_interface-compile-error (erl_interface) (2011-04-08) 1 commit - erl_interface: fix compile error (daad8e6) * ms/file-fix-hang-reading-compressed-files (erts, kernel) (2011-04-07) 1 commit - file: fix hang reading compressed files (b9e8506) * ms/unsigned-integer-overflow-in-error (erts) (2011-04-06) 1 commit - Unsigned integer may overflow in error message (3257bb0) * rj/fix-httpd-format (inets) (2011-03-17) 1 commit - Fix log messages formating in httpd (cbe8b2e) * ta/sendfile (erts, kernel) (2011-01-13) 1 commit - Implement file:sendfile (6c70e81) * ta/unicode-non-chars (stdlib) (2011-04-05) 1 commit - unicode: document 16#FFFE and 16#FFFF (non chars) (4207846) * dc/improved_find_redist (erts) (2011-03-18) 1 commit . support new SDKs in find_redist.sh and fallback to $ERL_TOP as last resort (f4f35aa) * sv/enif_is_exception (erts) (2011-02-22) 1 commit . add support for checking if an ERL_NIF_TERM is an exception (f8cc2b0) ------------------------------------------------------------ [Dropped] * fm/os_type_doc_missing_family (kernel) (2011-04-14) 1 commit . Add missing OS familiy 'ose' to os:type/0 documentation (188f3dd) Should remove 'ose' from code, not supported * pl/solaris11-build (erts) (2011-04-10) 1 commit . Fix building on Solaris 11 Express (49beba0) Dropped for tn/inet_drv-fix From tom@REDACTED Thu Apr 28 23:24:46 2011 From: tom@REDACTED (Tom Moertel) Date: Thu, 28 Apr 2011 17:24:46 -0400 Subject: [erlang-patches] Patch to xmerl_scan to fix character-reference normalization in attribute values Message-ID: The following short patch fixes a bug in xmerl that causes character references in attribute values to be normalized incorrectly: git fetch https://github.com/tmoertel/otp.git xmerl_attr_charref_fix Explanation: Section 3.3.3 of the XML Recommendation gives the rules for attribute-value normalization. One of those rules requires that character references not be re-normalized after being replaced with the referenced characters: For a character reference, append the referenced character to the normalized value. And, in particular: Note that if the unnormalized attribute value contains a character reference to a white space character other than space (#x20), the normalized value contains the referenced character itself (#xD, #xA or #x9). Source: http://www.w3.org/TR/xml/#AVNormalize In xmerl_scan, however, character references in attributes are normalized again after replacement. For example, the character reference " " in the following XML document gets normalized (incorrectly) into a space when parsed: 2> xmerl_scan:string(""). {... [{xmlAttribute,x,[],[],[],[],1,[]," ",false}] ...} This short patch restores the correct behavior: 2> xmerl_scan:string(""). {... [{xmlAttribute,x,[],[],[],[],1,[],"\n",false}] ...} NOTE: This change does not include tests because I could not find a test suite for xmerl. Cheers, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From shino.shun@REDACTED Fri Apr 29 08:07:41 2011 From: shino.shun@REDACTED (shunichi shinohara) Date: Fri, 29 Apr 2011 15:07:41 +0900 Subject: [erlang-patches] cover: fix file descriptor leak Message-ID: The patch below fixes file descriptor leak of cover module. git fetch https://github.com/shino/otp.git shino/fix-cover-fd-leak Explanation: Data import of cover module is called with a file path and open a fd internally. The fd should be closed in cover module, but it does not. As an additional information, in data export it closes a fd properly. This patch does not include test code because - I can't find the way to execute test suites, and - I don't know how to find fd list in beam process. Steps to reproduce: I tested the patch on Mac OS X 10.6.7, 64bit. 1. Run the escript below, and find the process id (OS pid). ============ #!/usr/bin/env escript -export([main/1]). main([]) -> file:write_file("sample.erl", <<"-module(sample).\n">>), {ok, sample} = cover:compile("sample.erl"), ok = cover:export("sample.coverdata", sample), ok = cover:import("sample.coverdata"), io:format("~s~n", [os:cmd("lsof -p " ++ os:getpid())]). ============ 2. Confirm cover's data file is NOT listed in output. Before apply this patch, script outputs the line like: beam.smp 17008 shino 11r REG 14,5 89 567192 /path/to/sample.coverdata After this patch is applied, lsof does not report "sample.coverdata". Regards, Shunichi Shinohara (shino.shun@REDACTED) From travis.jensen@REDACTED Fri Apr 29 19:14:59 2011 From: travis.jensen@REDACTED (Travis Jensen) Date: Fri, 29 Apr 2011 11:14:59 -0600 Subject: [erlang-patches] True streaming of AES CTR Message-ID: I've added a pull request to github for a change to the crypto module that allows true streaming of AES CTR mode. I'm afraid I didn't get things quite right on the formatting of the pull request (I'm more familiar with Mercurial than Git), but here it is, anyway: https://github.com/erlang/otp/pull/12 Basically, this change makes AES CTR behave similarly to the RC4 implementation. An example usage looks like: State = crypto:aes_ctr_state_init(Key, IV), { Cipher, State2 } = crypto:aes_ctr_encrypt_with_state(State, Data), { Cipher2, State3 } = crypto:aes_ctr_encrypt_with_state(State2, Data), I've used the existing AES CTR tests to implement tests for it as well. If I need to reformat the patch, I can certainly do that, but it really pretty minor. tj -- *Travis Jensen* *** *Read the Software Maven @ http://softwaremaven.innerbrane.com/ Read my LinkedIn profile @ http://www.linkedin.com/in/travisjensen Read my Twitter mumblings @ http://twitter.com/SoftwareMaven Send me email @ travis.jensen@REDACTED **What kind of guy calls himself the Software Maven???** -------------- next part -------------- An HTML attachment was scrubbed... URL: From kostis@REDACTED Sat Apr 30 09:52:39 2011 From: kostis@REDACTED (Kostis Sagonas) Date: Sat, 30 Apr 2011 10:52:39 +0300 Subject: [erlang-patches] False warning - function has no local return In-Reply-To: References: Message-ID: <4DBBBFC7.4000604@cs.ntua.gr> Ken Robinson wrote: > Hi, > > As per an earlier post from Kostis I'm reporting what I think is a > false warning of a function having no local return ... The hard coded type information about erlang:list_to_bitstring/1 in erl_bif_types was erroneous. The following patch fixes this. Please include in 'pu' and soon to 'dev'. git fetch git://github.com/kostis/otp.git list_to_bitstring Kostis From tuncer.ayaz@REDACTED Sat Apr 30 19:22:46 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sat, 30 Apr 2011 19:22:46 +0200 Subject: [erlang-patches] inet_drv: remove gratuitous assignment Message-ID: git fetch git://github.com/tuncer/otp.git inet_drv-gratuitous-assign