From vinoski@REDACTED Tue Jun 1 09:06:52 2010 From: vinoski@REDACTED (Steve Vinoski) Date: Tue, 1 Jun 2010 03:06:52 -0400 Subject: [erlang-patches] Serge's ei float patch In-Reply-To: <4C03D61F.7030008@erix.ericsson.se> References: <4C038A88.3010002@erix.ericsson.se> <4C03D61F.7030008@erix.ericsson.se> Message-ID: I've pushed an amended commit to github that I believe addresses all your suggestions: git fetch git://github.com/vinoski/otp.git serge_new_float_ext Thanks to your feedback, I found a number of other places that needed attention as part of this patch. If you could take another careful look at the new changes, that would be good. More comments below. 2010/5/31 Bj?rn-Egil Dahlberg : > On 2010-05-31 16:42, Steve Vinoski wrote: >> >> 2010/5/31 Bj?rn-Egil Dahlberg: >>> >>> ?- Distribution flags, the DFLAG_NEW_FLOATS option should be enabled in >>> ? lib/erl_interface/src/connect/ei_connect.c: static int >>> send_name_or_challenge. >>> ? See lib/erl_interface/src/connect/ei_connect_int.h and >>> lib/kernel/src/dist.hrl for some details. >> >> Does the recv_challenge function in ei_connect.c need to verify that >> DFLAG_NEW_FLOATS is set in the flags, treating it as an error if not >> set (e.g. the same way DFLAG_EXTENDED_REFERENCES is handled)? > > Right, need to ponder on that one. Should newer erl_interface be able to > handle ancient erts? Well, it can't since encode_double will always encode > with the new float. Hence yes, give them an error and let them upgrade > erlang. > > This will be incompatible with releases before R12B. Done. >>> Anyway, with DFLAGS_NEW_FLOATS flag enabled the code would be tested as >>> well >>> which is a necessity in order for it to be included in the otp relase. >> >> Which tests would exercise the DFLAGS_NEW_FLOATS flag? >> >> Note that the code already submitted in this patch is definitely >> tested by the erl_interface ei_print suite, since tests there were >> failing with just the original R12B-2 patch. > > Perhaps that is what I saw in code coverage. I see now that for some vxworks > reason the match_float is commented in the ei_encode/decode suites. It > shouldn't be. I reinstated these tests and modified them to match the style of other tests in the same suite. I also found that match_float could incorrectly fail when dealing with the float value 0.0 so I augmented it with another function clause that allows for simple equality. thanks, --steve From raimo+erlang-patches@REDACTED Tue Jun 1 10:18:51 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Tue, 1 Jun 2010 10:18:51 +0200 Subject: [erlang-patches] tid() is not a predefined type anymore In-Reply-To: <4C03CB00.4020101@cs.ntua.gr> References: <4BFFAF6F.60606@cs.ntua.gr> <20100531143351.GA21175@erix.ericsson.se> <4C03CB00.4020101@cs.ntua.gr> Message-ID: <20100601081851.GA26475@erix.ericsson.se> On Mon, May 31, 2010 at 05:43:12PM +0300, Kostis Sagonas wrote: > Raimo Niskanen wrote: > >On Fri, May 28, 2010 at 02:56:31PM +0300, Kostis Sagonas wrote: > >>There is a patch that removes tid() from the list of predefined types. > >>It can be included as is provided that the 'export_type' branch is first > >>included in OTP. Otherwise, one has to manually remove the line which > >>reads: > >> > >>-export_type([tab/0, tid/0]). > >> > >>from file ets.erl > >> > >> > >> git fetch git://github.com/kostis/otp.git ets-tid-type > > > >I got into merge conflicts due to the bootstrap code > >update and more. I will have to take this tomorrow... > > Raimo, > > The erl_lint.beam file in bootstrap is nothing special. It is just the > .beam file that corresponds to the erl_lint.erl file so any such .beam > file will do. > > The only thing that you have to be careful of is to include such a file > before including the change in lib/debugger/src/dbg_iload.erl Yes. That I can handle and/or ask Bj?rn. This is trickier: @@@ -46,7 -49,7 +49,11 @@@ load_mod(Mod, File, Binary, Db) - What end. ++<<<<<<< HEAD +-spec load_mod1(module(), file:filename(), binary(), tid()) -> no_return(). ++======= + -spec load_mod1(atom(), file:filename(), binary(), ets:tid()) -> no_return(). ++>>>>>>> ks/ets-tid-type load_mod1(Mod, File, Binary, Db) -> store_module(Mod, File, Binary, Db), In your new branch ks/ets-tid-type you use atom() instead of module() that was added by ks/cleanups as suggested by tidier. I know that the tid() -> ets:tid() change is expected buth the module() -> atom() is not my home turf... > > Kostis -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From kostis@REDACTED Tue Jun 1 10:20:07 2010 From: kostis@REDACTED (Kostis Sagonas) Date: Tue, 01 Jun 2010 11:20:07 +0300 Subject: [erlang-patches] tid() is not a predefined type anymore In-Reply-To: <20100601081851.GA26475@erix.ericsson.se> References: <4BFFAF6F.60606@cs.ntua.gr> <20100531143351.GA21175@erix.ericsson.se> <4C03CB00.4020101@cs.ntua.gr> <20100601081851.GA26475@erix.ericsson.se> Message-ID: <4C04C2B7.7060801@cs.ntua.gr> Raimo Niskanen wrote: > ++<<<<<<< HEAD > +-spec load_mod1(module(), file:filename(), binary(), tid()) -> no_return(). > ++======= > + -spec load_mod1(atom(), file:filename(), binary(), ets:tid()) -> no_return(). > ++>>>>>>> ks/ets-tid-type > > load_mod1(Mod, File, Binary, Db) -> > store_module(Mod, File, Binary, Db), > > In your new branch ks/ets-tid-type you use atom() instead of module() > that was added by ks/cleanups as suggested by tidier. I know that > the tid() -> ets:tid() change is expected buth the module() -> atom() > is not my home turf... You should take the atom() one (or change it manually). Kostis From dangud@REDACTED Tue Jun 1 11:54:39 2010 From: dangud@REDACTED (Dan Gudmundsson) Date: Tue, 1 Jun 2010 11:54:39 +0200 Subject: [erlang-patches] patch: Allow a user_defined function to wrap mnesia_schema:merge_schema() In-Reply-To: References: <4BE6831B.8090003@erlang-solutions.com> Message-ID: There are debug printouts left. Starting a cluster of more than 2 nodes (i.e. 3) crashes for me. /Dan 2010/5/10 Bj?rn Gustavsson : > On Sun, May 9, 2010 at 11:40 AM, Ulf Wiger > wrote: >> http://github.com/uwiger/otp/tree/schema_merge > > Thanks! Will include in 'pu'. > > For future contributions, please also include a "git fetch" line in > the email that I can > copy/paste into the shell. For instance: > > git fetch git://github.com/uwiger/otp.git schema_merge > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > > From egil@REDACTED Tue Jun 1 15:00:49 2010 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Tue, 01 Jun 2010 15:00:49 +0200 Subject: [erlang-patches] Serge's ei float patch In-Reply-To: References: <4C038A88.3010002@erix.ericsson.se> <4C03D61F.7030008@erix.ericsson.se> Message-ID: <4C050481.9060905@erix.ericsson.se> On 2010-06-01 09:06, Steve Vinoski wrote: > I've pushed an amended commit to github that I believe addresses all > your suggestions: > > git fetch git://github.com/vinoski/otp.git serge_new_float_ext > > Thanks to your feedback, I found a number of other places that needed > attention as part of this patch. If you could take another careful > look at the new changes, that would be good. Oops. I forgot something. (And yet again erl_interface is faced with a problem). ei_get_type exposes the internal representation (external format) of types. This is a problem. Earlier implementation had its own types ... which seemingly was a bad idea ... Angels are crying for suggesting this but, what do you think of letting get_type return ERL_FLOAT_EXT for both ERL_FLOAT_EXT and NEW_FLOAT_EXT? My aim is to remove the necessity for changing original source code dependent on erl_interface, if that is at all possible. What do you think? Hmm, actually this is somewhat more serious then I first thought. I need to talk it over with my team. > I reinstated these tests and modified them to match the style of other > tests in the same suite. I also found that match_float could > incorrectly fail when dealing with the float value 0.0 so I augmented > it with another function clause that allows for simple equality. Great! // Bj?rn-Egil From vinoski@REDACTED Tue Jun 1 15:16:21 2010 From: vinoski@REDACTED (Steve Vinoski) Date: Tue, 1 Jun 2010 09:16:21 -0400 Subject: [erlang-patches] Serge's ei float patch In-Reply-To: <4C050481.9060905@erix.ericsson.se> References: <4C038A88.3010002@erix.ericsson.se> <4C03D61F.7030008@erix.ericsson.se> <4C050481.9060905@erix.ericsson.se> Message-ID: 2010/6/1 Bj?rn-Egil Dahlberg : > On 2010-06-01 09:06, Steve Vinoski wrote: >> >> I've pushed an amended commit to github that I believe addresses all >> your suggestions: >> >> git fetch git://github.com/vinoski/otp.git serge_new_float_ext >> >> Thanks to your feedback, I found a number of other places that needed >> attention as part of this patch. If you could take another careful >> look at the new changes, that would be good. > > Oops. I forgot something. (And yet again erl_interface is faced with a > problem). ei_get_type exposes the internal representation (external format) > of types. This is a problem. Earlier implementation had its own types ... > which seemingly was a bad idea ... > > Angels are crying for suggesting this but, what do you think of letting > get_type return ERL_FLOAT_EXT for both ERL_FLOAT_EXT and NEW_FLOAT_EXT? > > My aim is to remove the necessity for changing original source code > dependent on erl_interface, if that is at all possible. > > What do you think? I think you're right -- I woke up this morning thinking exactly the same thing. The erl_interface code should accept and produce ERL_FLOAT_EXT, and accept but not produce NEW_FLOAT_EXT. I'll make those changes. > Hmm, actually this is somewhat more serious then I first thought. I need to > talk it over with my team. Another concern is term_to_binary, which for backwards compatibility has to be left using ERL_FLOAT_EXT -- this patch leaves it that way -- but binary_to_term should be able to accept NEW_FLOAT_EXT binaries too. This way, if this patch is adopted for R14, then perhaps R16 can switch to having term_to_binary produce NEW_FLOAT_EXT binaries by default. --steve From bgustavsson@REDACTED Tue Jun 1 15:40:40 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Tue, 1 Jun 2010 15:40:40 +0200 Subject: ms/file-exclusive-mode Message-ID: git fetch git://github.com/bjorng/otp.git ms/file-exclusive-mode We will probably graduate this branch (after testing it on more platforms), but with the following addition to the documentation: diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml index eed92d2..640137a 100644 --- a/lib/kernel/doc/src/file.xml +++ b/lib/kernel/doc/src/file.xml @@ -616,6 +616,11 @@ f.txt: {person, "kalle", 25}.

The file, when opened for writing, is created if it does not exist. If the file exists, open will return {error, eexist}.

+

This option does not guarantee exclusiveness on + file systems that do not support O_EXCL properly, + such as NFS. Do not depend on this option unless you + know that the file system support its (in general, local + file systems should be safe).

raw Is that OK? -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From michael.santos@REDACTED Tue Jun 1 16:02:46 2010 From: michael.santos@REDACTED (Michael Santos) Date: Tue, 1 Jun 2010 10:02:46 -0400 Subject: [erlang-patches] ms/file-exclusive-mode In-Reply-To: References: Message-ID: <20100601140246.GA28034@ecn.lan> On Tue, Jun 01, 2010 at 03:40:40PM +0200, Bj??rn Gustavsson wrote: > git fetch git://github.com/bjorng/otp.git ms/file-exclusive-mode > > We will probably graduate this branch (after testing it > on more platforms), but with the following addition > to the documentation: > > diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml > index eed92d2..640137a 100644 > --- a/lib/kernel/doc/src/file.xml > +++ b/lib/kernel/doc/src/file.xml > @@ -616,6 +616,11 @@ f.txt: {person, "kalle", 25}. >

The file, when opened for writing, is created if it > does not exist. If the file exists, open will return > {error, eexist}.

> +

This option does not guarantee exclusiveness on > + file systems that do not support O_EXCL properly, > + such as NFS. Do not depend on this option unless you > + know that the file system support its (in general, local > + file systems should be safe).

>
> raw > > > Is that OK? That is much better, thanks! One small typo: "support its" should be "supports it". From ulf.wiger@REDACTED Tue Jun 1 16:19:36 2010 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Tue, 01 Jun 2010 16:19:36 +0200 Subject: [erlang-patches] patch: Allow a user_defined function to wrap mnesia_schema:merge_schema() In-Reply-To: References: <4BE6831B.8090003@erlang-solutions.com> Message-ID: <4C0516F8.70906@erlang-solutions.com> What is the easiest way to address it? The debug printout: Line 2663 in http://github.com/erlang/otp/blob/pu/lib/mnesia/src/mnesia_schema.erl should be deleted (I've not seen any other debug printouts) The crash: Line 2676, 2679 - rename NewNodes to something else, e.g. OtherNodes. I could resubmit, but my git fu is still low enough that I'm likely to make a mess of things without detailed instructions. :) I have done the above and tested with four nodes (it did in fact crash before; now it doesn't). BR, Ulf W Dan Gudmundsson wrote: > There are debug printouts left. > Starting a cluster of more than 2 nodes (i.e. 3) crashes for me. > > /Dan > > 2010/5/10 Bj?rn Gustavsson : >> On Sun, May 9, 2010 at 11:40 AM, Ulf Wiger >> wrote: >>> http://github.com/uwiger/otp/tree/schema_merge >> Thanks! Will include in 'pu'. >> >> For future contributions, please also include a "git fetch" line in >> the email that I can >> copy/paste into the shell. For instance: >> >> git fetch git://github.com/uwiger/otp.git schema_merge >> >> -- >> Bj?rn Gustavsson, Erlang/OTP, Ericsson AB >> >> ________________________________________________________________ >> erlang-patches (at) erlang.org mailing list. >> See http://www.erlang.org/faq.html >> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED >> >> -- Ulf Wiger CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd http://www.erlang-solutions.com --------------------------------------------------- --------------------------------------------------- WE'VE CHANGED NAMES! Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD. www.erlang-solutions.com From serge@REDACTED Tue Jun 1 16:40:32 2010 From: serge@REDACTED (Serge Aleynikov) Date: Tue, 01 Jun 2010 10:40:32 -0400 Subject: [erlang-patches] Serge's ei float patch In-Reply-To: <4C050481.9060905@erix.ericsson.se> References: <4C038A88.3010002@erix.ericsson.se> <4C03D61F.7030008@erix.ericsson.se> <4C050481.9060905@erix.ericsson.se> Message-ID: <4C051BE0.6010802@aleynikov.org> On 6/1/2010 9:00 AM, Bj?rn-Egil Dahlberg wrote: > Oops. I forgot something. (And yet again erl_interface is faced with a > problem). ei_get_type exposes the internal representation (external > format) of types. This is a problem. Earlier implementation had its own > types ... which seemingly was a bad idea ... > > Angels are crying for suggesting this but, what do you think of letting > get_type return ERL_FLOAT_EXT for both ERL_FLOAT_EXT and NEW_FLOAT_EXT? > > My aim is to remove the necessity for changing original source code > dependent on erl_interface, if that is at all possible. > > What do you think? Since ei_get_type() is not implicitly used by the decoding family of functions in erl_interface (that rely on the wire-level representation of data types) this should be ok (though not pretty). There's a similar situation with ERL_REFERENCE_EXT and ERL_NEW_REFERENCE_EXT, in which case ei_get_type() distinguishes the two. Perhaps a better solution (that could be implemented later after this patch is released) would be for ei_get_type() always to return ERL_FLOAT_EXT and ERL_REFERENCE_EXT for "old" and "new" corresponding representations, but have another flavor of erl_init() that would set compatibility mode as a bitmask of flags. The mode would control turning on support for old format as default behavior. Serge From raimo+erlang-patches@REDACTED Tue Jun 1 17:57:53 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Tue, 1 Jun 2010 17:57:53 +0200 Subject: [erlang-patches] patch: Allow a user_defined function to wrap mnesia_schema:merge_schema() In-Reply-To: <4C0516F8.70906@erlang-solutions.com> References: <4BE6831B.8090003@erlang-solutions.com> <4C0516F8.70906@erlang-solutions.com> Message-ID: <20100601155753.GA27146@erix.ericsson.se> On Tue, Jun 01, 2010 at 04:19:36PM +0200, Ulf Wiger wrote: > > What is the easiest way to address it? > > The debug printout: > Line 2663 in > http://github.com/erlang/otp/blob/pu/lib/mnesia/src/mnesia_schema.erl > should be deleted (I've not seen any other debug printouts) > > The crash: > Line 2676, 2679 - rename NewNodes to something else, e.g. OtherNodes. > > I could resubmit, but my git fu is still low enough that I'm > likely to make a mess of things without detailed instructions. :) The easiest for you (and for us to follow) would be to just keep on working on the same branch: In your local repository (from which you pushed the local branch schema_merge) to your github repository 'origin' (assumed). $ git checkout schema_merge Do the changes above. Test it. $ git push origin schema_merge Send a mail to erlang-patches saying you have new commits available with: git fetch git://github.com/uwiger/otp.git schema_merge > > I have done the above and tested with four nodes (it did in fact > crash before; now it doesn't). > > BR, > Ulf W > > Dan Gudmundsson wrote: > >There are debug printouts left. > >Starting a cluster of more than 2 nodes (i.e. 3) crashes for me. > > > >/Dan > > > >2010/5/10 Bj?rn Gustavsson : > >>On Sun, May 9, 2010 at 11:40 AM, Ulf Wiger > >> wrote: > >>>http://github.com/uwiger/otp/tree/schema_merge > >>Thanks! Will include in 'pu'. > >> > >>For future contributions, please also include a "git fetch" line in > >>the email that I can > >>copy/paste into the shell. For instance: > >> > >>git fetch git://github.com/uwiger/otp.git schema_merge > >> > >>-- > >>Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > >> > >>________________________________________________________________ > >>erlang-patches (at) erlang.org mailing list. > >>See http://www.erlang.org/faq.html > >>To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > >> > >> > > > -- > Ulf Wiger > CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd > http://www.erlang-solutions.com > > --------------------------------------------------- > > --------------------------------------------------- > > WE'VE CHANGED NAMES! > > Since January 1st 2010 Erlang Training and Consulting Ltd. has become > ERLANG SOLUTIONS LTD. > > www.erlang-solutions.com > > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From ulf.wiger@REDACTED Tue Jun 1 18:48:50 2010 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Tue, 01 Jun 2010 18:48:50 +0200 Subject: [erlang-patches] patch: Allow a user_defined function to wrap mnesia_schema:merge_schema() In-Reply-To: <20100601155753.GA27146@erix.ericsson.se> References: <4BE6831B.8090003@erlang-solutions.com> <4C0516F8.70906@erlang-solutions.com> <20100601155753.GA27146@erix.ericsson.se> Message-ID: <4C0539F2.9060300@erlang-solutions.com> I thought I'd follow your advice, but am running into uwiger@REDACTED:~/src/otp/git/mine/mnesia_merge/otp$ git push origin schema_merge error: Cannot access URL http://github.com/uwiger/otp.git/, return code 22 fatal: git-http-push failed That's not an error I've seen before, and I've spent 30 minutes trying to hunt down the cause. It's a trivial fix, and the important test that needs to be done is running the mnesia test suite, which I don't have access to. Perhaps you could just do it at your end, this one time? :) BR, Ulf W On 06/01/2010 05:57 PM, Raimo Niskanen wrote: > On Tue, Jun 01, 2010 at 04:19:36PM +0200, Ulf Wiger wrote: >> >> What is the easiest way to address it? >> >> The debug printout: >> Line 2663 in >> http://github.com/erlang/otp/blob/pu/lib/mnesia/src/mnesia_schema.erl >> should be deleted (I've not seen any other debug printouts) >> >> The crash: >> Line 2676, 2679 - rename NewNodes to something else, e.g. OtherNodes. >> >> I could resubmit, but my git fu is still low enough that I'm >> likely to make a mess of things without detailed instructions. :) > > The easiest for you (and for us to follow) would be to > just keep on working on the same branch: > > In your local repository (from which you pushed the local branch > schema_merge) to your github repository 'origin' (assumed). > > $ git checkout schema_merge > > Do the changes above. > Test it. > > $ git push origin schema_merge > > Send a mail to erlang-patches saying you have new commits > available with: > > git fetch git://github.com/uwiger/otp.git schema_merge > >> >> I have done the above and tested with four nodes (it did in fact >> crash before; now it doesn't). >> >> BR, >> Ulf W >> >> Dan Gudmundsson wrote: >>> There are debug printouts left. >>> Starting a cluster of more than 2 nodes (i.e. 3) crashes for me. >>> >>> /Dan >>> >>> 2010/5/10 Bj?rn Gustavsson : >>>> On Sun, May 9, 2010 at 11:40 AM, Ulf Wiger >>>> wrote: >>>>> http://github.com/uwiger/otp/tree/schema_merge >>>> Thanks! Will include in 'pu'. >>>> >>>> For future contributions, please also include a "git fetch" line in >>>> the email that I can >>>> copy/paste into the shell. For instance: >>>> >>>> git fetch git://github.com/uwiger/otp.git schema_merge >>>> >>>> -- >>>> Bj?rn Gustavsson, Erlang/OTP, Ericsson AB >>>> >>>> ________________________________________________________________ >>>> erlang-patches (at) erlang.org mailing list. >>>> See http://www.erlang.org/faq.html >>>> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED >>>> >>>> >> >> >> -- >> Ulf Wiger >> CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd >> http://www.erlang-solutions.com >> >> --------------------------------------------------- >> >> --------------------------------------------------- >> >> WE'VE CHANGED NAMES! >> >> Since January 1st 2010 Erlang Training and Consulting Ltd. has become >> ERLANG SOLUTIONS LTD. >> >> www.erlang-solutions.com >> >> >> ________________________________________________________________ >> erlang-patches (at) erlang.org mailing list. >> See http://www.erlang.org/faq.html >> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED >> > --------------------------------------------------- --------------------------------------------------- WE'VE CHANGED NAMES! Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD. www.erlang-solutions.com From ulf.wiger@REDACTED Tue Jun 1 20:04:55 2010 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Tue, 01 Jun 2010 20:04:55 +0200 Subject: [erlang-patches] patch: Allow a user_defined function to wrap mnesia_schema:merge_schema() In-Reply-To: <20100601155753.GA27146@erix.ericsson.se> References: <4BE6831B.8090003@erlang-solutions.com> <4C0516F8.70906@erlang-solutions.com> <20100601155753.GA27146@erix.ericsson.se> Message-ID: <4C054BC7.2060609@erlang-solutions.com> git fetch git://github.com/uwiger/otp.git schema_merge "remove debug printout and accidental variable name reuse" http://github.com/uwiger/otp/commit/b4844311746b44e85aa49d6e7bd68703301998e0 Thanks Fredrik Thulin for helping me figure out what I did wrong. BR, Ulf W On 06/01/2010 05:57 PM, Raimo Niskanen wrote: > On Tue, Jun 01, 2010 at 04:19:36PM +0200, Ulf Wiger wrote: >> >> What is the easiest way to address it? >> >> The debug printout: >> Line 2663 in >> http://github.com/erlang/otp/blob/pu/lib/mnesia/src/mnesia_schema.erl >> should be deleted (I've not seen any other debug printouts) >> >> The crash: >> Line 2676, 2679 - rename NewNodes to something else, e.g. OtherNodes. >> >> I could resubmit, but my git fu is still low enough that I'm >> likely to make a mess of things without detailed instructions. :) > > The easiest for you (and for us to follow) would be to > just keep on working on the same branch: > > In your local repository (from which you pushed the local branch > schema_merge) to your github repository 'origin' (assumed). > > $ git checkout schema_merge > > Do the changes above. > Test it. > > $ git push origin schema_merge > > Send a mail to erlang-patches saying you have new commits > available with: > > git fetch git://github.com/uwiger/otp.git schema_merge > >> >> I have done the above and tested with four nodes (it did in fact >> crash before; now it doesn't). >> >> BR, >> Ulf W >> >> Dan Gudmundsson wrote: >>> There are debug printouts left. >>> Starting a cluster of more than 2 nodes (i.e. 3) crashes for me. >>> >>> /Dan >>> >>> 2010/5/10 Bj?rn Gustavsson : >>>> On Sun, May 9, 2010 at 11:40 AM, Ulf Wiger >>>> wrote: >>>>> http://github.com/uwiger/otp/tree/schema_merge >>>> Thanks! Will include in 'pu'. >>>> >>>> For future contributions, please also include a "git fetch" line in >>>> the email that I can >>>> copy/paste into the shell. For instance: >>>> >>>> git fetch git://github.com/uwiger/otp.git schema_merge >>>> >>>> -- >>>> Bj?rn Gustavsson, Erlang/OTP, Ericsson AB >>>> >>>> ________________________________________________________________ >>>> erlang-patches (at) erlang.org mailing list. >>>> See http://www.erlang.org/faq.html >>>> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED >>>> >>>> >> >> >> -- >> Ulf Wiger >> CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd >> http://www.erlang-solutions.com >> >> --------------------------------------------------- >> >> --------------------------------------------------- >> >> WE'VE CHANGED NAMES! >> >> Since January 1st 2010 Erlang Training and Consulting Ltd. has become >> ERLANG SOLUTIONS LTD. >> >> www.erlang-solutions.com >> >> >> ________________________________________________________________ >> erlang-patches (at) erlang.org mailing list. >> See http://www.erlang.org/faq.html >> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED >> > --------------------------------------------------- --------------------------------------------------- WE'VE CHANGED NAMES! Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD. www.erlang-solutions.com From jay@REDACTED Wed Jun 2 07:32:30 2010 From: jay@REDACTED (Jay Nelson) Date: Tue, 1 Jun 2010 22:32:30 -0700 Subject: Dialyzer warnings for gen_stream In-Reply-To: References: Message-ID: Fixed. git fetch git://github.com/jaynel/otp.git jn/gen_stream From raimo+erlang-patches@REDACTED Wed Jun 2 08:43:31 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Wed, 2 Jun 2010 08:43:31 +0200 Subject: [erlang-patches] patch: Allow a user_defined function to wrap mnesia_schema:merge_schema() In-Reply-To: <4C054BC7.2060609@erlang-solutions.com> References: <4BE6831B.8090003@erlang-solutions.com> <4C0516F8.70906@erlang-solutions.com> <20100601155753.GA27146@erix.ericsson.se> <4C054BC7.2060609@erlang-solutions.com> Message-ID: <20100602064331.GB15947@erix.ericsson.se> On Tue, Jun 01, 2010 at 08:04:55PM +0200, Ulf Wiger wrote: > > > git fetch git://github.com/uwiger/otp.git schema_merge Thank you! It will be included in 'pu' as uw/mnesia-schema-merge. > > "remove debug printout and accidental variable name reuse" > > http://github.com/uwiger/otp/commit/b4844311746b44e85aa49d6e7bd68703301998e0 > > > Thanks Fredrik Thulin for helping me figure out what I did wrong. > > BR, > Ulf W > > : -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-patches@REDACTED Wed Jun 2 08:47:50 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Wed, 2 Jun 2010 08:47:50 +0200 Subject: [erlang-patches] Emacs EUnit: Run Recent In-Reply-To: <24DF58A2-1C66-45F2-AEA0-ED840E443AF2@gmail.com> References: <20100531095933.GD6170@erix.ericsson.se> <24DF58A2-1C66-45F2-AEA0-ED840E443AF2@gmail.com> Message-ID: <20100602064750.GC15947@erix.ericsson.se> On Tue, Jun 01, 2010 at 01:32:56PM -0400, Chris Bernard wrote: > I updated the code to remove this warning. The code no longer uses > 'pairlis', setting cons cell cdrs instead. I manually tested and it > works fine. > > git fetch git://github.com/cebernard/otp.git emacs-eunit-run-recent Great! 'pu' will be updated (cb/emacs-eunit-run-recent). -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-patches@REDACTED Wed Jun 2 09:03:24 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Wed, 2 Jun 2010 09:03:24 +0200 Subject: [erlang-patches] Re: Dialyzer warnings for gen_stream In-Reply-To: References: Message-ID: <20100602070324.GD15947@erix.ericsson.se> On Tue, Jun 01, 2010 at 10:32:30PM -0700, Jay Nelson wrote: > Fixed. > > git fetch git://github.com/jaynel/otp.git jn/gen_stream Great! 'pu' will be updated. > > > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-patches@REDACTED Wed Jun 2 09:20:42 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Wed, 2 Jun 2010 09:20:42 +0200 Subject: [erlang-patches] ms/file-exclusive-mode In-Reply-To: <20100601140246.GA28034@ecn.lan> References: <20100601140246.GA28034@ecn.lan> Message-ID: <20100602072042.GA18109@erix.ericsson.se> On Tue, Jun 01, 2010 at 10:02:46AM -0400, Michael Santos wrote: > On Tue, Jun 01, 2010 at 03:40:40PM +0200, Bj??rn Gustavsson wrote: > > git fetch git://github.com/bjorng/otp.git ms/file-exclusive-mode > > > > We will probably graduate this branch (after testing it > > on more platforms), but with the following addition > > to the documentation: > > > > diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml > > index eed92d2..640137a 100644 > > --- a/lib/kernel/doc/src/file.xml > > +++ b/lib/kernel/doc/src/file.xml > > @@ -616,6 +616,11 @@ f.txt: {person, "kalle", 25}. > >

The file, when opened for writing, is created if it > > does not exist. If the file exists, open will return > > {error, eexist}.

> > +

This option does not guarantee exclusiveness on > > + file systems that do not support O_EXCL properly, > > + such as NFS. Do not depend on this option unless you > > + know that the file system support its (in general, local > > + file systems should be safe).

> >
> > raw > > > > > > Is that OK? > > That is much better, thanks! One small typo: "support its" should be > "supports it". I will --amend that to Bj?rn's commit. > > > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From bgustavsson@REDACTED Wed Jun 2 10:12:23 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Wed, 2 Jun 2010 10:12:23 +0200 Subject: Test for BIFs without type information In-Reply-To: References: Message-ID: I have added type information for all BIFs that didn't have them (except for BIFs in the hipe_bifs module). I have also strengthened the test case to detect some more common mistakes. git fetch git://github.com/bjorng/otp.git bg/bif-types -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From raimo+erlang-patches@REDACTED Wed Jun 2 14:06:03 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Wed, 2 Jun 2010 14:06:03 +0200 Subject: [erlang-patches] Re: Test for BIFs without type information In-Reply-To: References: Message-ID: <20100602120603.GA22709@erix.ericsson.se> On Wed, Jun 02, 2010 at 10:12:23AM +0200, Bj?rn Gustavsson wrote: > I have added type information for all BIFs that > didn't have them (except for BIFs in the hipe_bifs > module). I have also strengthened the test case > to detect some more common mistakes. > > git fetch git://github.com/bjorng/otp.git bg/bif-types Great. 'pu' will be updated with this. > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From per@REDACTED Wed Jun 2 23:21:08 2010 From: per@REDACTED (Per Hedeland) Date: Wed, 2 Jun 2010 23:21:08 +0200 (CEST) Subject: [erlang-patches] tid() is not a predefined type anymore In-Reply-To: <4BFFAF6F.60606@cs.ntua.gr> Message-ID: <201006022121.o52LL8P8095422@pluto.hedeland.org> Thanks a lot for this! Applied with minor tweaks to our R13B03-ish OTP. However seeing the actual list of predefined types for the first time:-), I think there are a few more of them that falls in the same category as tid(), and should be made module-specific for the same reasons: {array, 0}, {dict, 0}, {digraph, 0}, {gb_set, 0}, {gb_tree, 0}, {queue, 0}, {set, 0}, E.g. having a predefined type queue(), which can only be defined as "The opaque type returned by new/0 in the OTP module called 'queue'", and which prevents all use of that type name in user-written modules (where it could otherwise exist peacefully as mod:queue()), really doesn't seem like a good idea to me. I won't argue this point further though.:-) --Per Kostis Sagonas wrote: > >There is a patch that removes tid() from the list of predefined types. >It can be included as is provided that the 'export_type' branch is first >included in OTP. Otherwise, one has to manually remove the line which >reads: > >-export_type([tab/0, tid/0]). > >from file ets.erl > > > git fetch git://github.com/kostis/otp.git ets-tid-type > >Kostis From kostis@REDACTED Wed Jun 2 23:55:44 2010 From: kostis@REDACTED (Kostis Sagonas) Date: Thu, 03 Jun 2010 00:55:44 +0300 Subject: [erlang-patches] tid() is not a predefined type anymore In-Reply-To: <201006022121.o52LL8P8095422@pluto.hedeland.org> References: <201006022121.o52LL8P8095422@pluto.hedeland.org> Message-ID: <4C06D360.9040507@cs.ntua.gr> Per Hedeland wrote: > Thanks a lot for this! Applied with minor tweaks to our R13B03-ish OTP. > However seeing the actual list of predefined types for the first > time:-), I think there are a few more of them that falls in the same > category as tid(), and should be made module-specific for the same > reasons: > > {array, 0}, > {dict, 0}, > {digraph, 0}, > {gb_set, 0}, > {gb_tree, 0}, > {queue, 0}, > {set, 0}, > > E.g. having a predefined type queue(), which can only be defined as "The > opaque type returned by new/0 in the OTP module called 'queue'", and > which prevents all use of that type name in user-written modules (where > it could otherwise exist peacefully as mod:queue()), really doesn't seem > like a good idea to me. I won't argue this point further though.:-) Per, You are absolutely right about this and it is indeed my intention to take these out from the list of predefined types. However, this is a bit tricky to do at this point (for various reasons that I will not go into now) and IMO it is best done when two other features are in place: 1. The ability to write -import_type attributes (analogous to -import) so that one does not have to write: gb_trees:gb_tree() all over the place. 2. The ability to have parameterized opaque types, e.g. set(atom()) which is currently not possible. The first addition is relatively easy and may happen soon. The second one is a significant change. When these two are in place, we will take out these types from the list of predefined types. Kostis From pguyot@REDACTED Fri Jun 4 10:28:55 2010 From: pguyot@REDACTED (Paul Guyot) Date: Fri, 4 Jun 2010 10:28:55 +0200 Subject: Bug: erts_bld_string_n returns negative characters In-Reply-To: <3E409DAF-0CE0-43A1-9884-85DC6C9F6777@kallisys.net> References: <3E409DAF-0CE0-43A1-9884-85DC6C9F6777@kallisys.net> Message-ID: <2C129233-8B30-4303-B18B-AAFD9A42D722@kallisys.net> Hello, A patch with a test case for enif_make_string is available here: git fetch git://github.com/pguyot/otp.git pg/fix_erts_bld_string_n Regards, Paul Le 4 juin 2010 ? 00:29, Paul Guyot a ?crit : > Hello, > > I noticed a significant behaviour difference between ssl_imp new and ssl_imp old when using them with {packet, http} due to the fact that ssl_imp old decodes packets through inet driver (and the broker), while ssl_imp new decodes packets with erlang:decode_packet/3 and both do not generate the same data. > > The (simplified) http packet is: > <<71,69,84,32,47,230,157,177,228,186,172,32,72,84,84,80,47,49,46,49,13,10,13,10>> > > With {ssl_imp old}, I get: > {http_request,'GET', > {abs_path,[47,230,157,177,228,186,172]}, > {1,1}} > > With {ssl_imp, new}, I get: > {http_request,'GET', > {abs_path,[47,-26,-99,-79,-28,-70,-84]}, > {1,1}} > > One can get the same result with: > erlang:decode_packet(http, <<71,69,84,32,47,230,157,177,228,186,172,32,72,84,84,80,47,49,46,49,13,10,13,10>>, [{packet_size, 0}]). > > erlang:decode_packet eventually calls erts_bld_string_n. Things happen line 513 of current dev branch on github : > > http://github.com/erlang/otp/blob/dev/erts/emulator/beam/utils.c#L513 > > str[i] can be negative (> 0x7f) and therefore promoted to a small negative integer. > > It seems to me that erts_bld_string_n is supposed to take ISO-8859-1 characters, for example when called from enif_make_string_len (which is therefore broken?). It should return small positive integers instead of negative ones for values > 0x7f. Line 513 should be replaced from: > res = CONS(*hpp, make_small(str[i]), res); > to: > res = CONS(*hpp, make_small((const unsigned char) str[i]), res); > or: > res = CONS(*hpp, make_small((byte) str[i]), res); > > This change would mimic what happens with inet_drv. It encodes the string with ERL_DRV_STRING, which is then decoded in beam/io.c with buf_to_intlist, which goes like this: > > tail = CONS(hp, make_small((byte)*buf), tail); > > http://github.com/erlang/otp/blob/dev/erts/emulator/beam/utils.c#L2881 > > Regards, > > Paul > > PS: I realize this is not a valid HTTP packet (URIs should be encoded as ASCII 7 bits), but curl 7.20.0 sends it. > From raimo+erlang-patches@REDACTED Fri Jun 4 09:32:28 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Fri Jun 4 09:32:28 2010 Subject: What's cooking in erlang/otp (2010-06-04) Message-ID: <20100604095020.BC44A11C4@fingolfin.du.uab.ericsson.se> R14A is planned to be released on June 16. We will not include new features for that release. Bug fixes may be accepted depending on how necessary and risk free they are. We may still graduate a few of the cooking branches to the release... ------------------------------------------------------------ [Graduated] * am/net_kernel_catchall (kernel) (2010-02-20) 1 commit + Add catch all handle_call to net_kernel (7d37fee) * bg/compiler (compiler, stdlib) (2010-03-12) 5 commits + beam_peep: Remove optimization already done by beam_dead (0047185) + beam_dead: Combine is_eq_exact instructions into select_val instructions (e96f49f) + Evaluate is_record/3 at compile-time using type information (470c91d) + Evaluate element/2 at compile-time using type information (7ac0808) + erl_expand_records: Replace is_record() with matching (1858cb8) * bg/dist_utils (kernel) (2010-05-27) 1 commit + dist_utils: Eliminate crash when list_to_existing_atom/1 fails (39e563a) * bg/remove-stray-sae-support (erts) (2010-05-22) 2 commits + Remove unsupported erlang:blocking_read_file/1 (1e5e733) + Remove stray SAE support (32a6d4e) * dgud/emacs-catch-improvements (tools) (2010-05-28) 2 commits + Improved indentation of old catch. (16d48ac) + Added more type highlighting and fixed record indentation with types. (6f1e1cd) * jl/windows-file-share-delete (erts) (2010-02-22) 1 commit + Windows: Open files with FILE_SHARE_DELETE to get closer to UNIX semantics (426a5e2) * jv/autoimport-binary_to_term_2 (erts, stdlib) (2010-05-22) 1 commit + Change binary_to_term/2 to be auto-imported (a62abc9) * kj/emacs-erlang-flymake (tools) (2010-05-30) 5 commits + erlang-flymake: Document in README (54cda6a) + erlang-flymake: Make the syntax check command configurable (704ce3e) + erlang-flymake: By default pass /include and /ebin to compiler (418de1e) + erlang-flymake: Include in Makefile (8f0dd81) + erlang-flymake: Syntax check erlang code on the fly (using flymake) (766c27e) * ks/dialyzer (compiler, dialyzer, hipe, kernel, stdlib, syntax_tools) (2010-06-03) 15 commits + dialyzer: Build the PLT even if there are unresolved remote types (169507c) + proplists: Export the type property() (c9eae64) + erl_lint: Issue warnings for undefined exported types (f062463) + Minor fix in a print message (48599b8) + Add handling of unknown types (d775f62) + Add declaration for exported types (cafe056) + Add types and specs; performed some cleanups also (5279efd) + erl_scan: Add declarations for exported types (414b47a) + stdlib: Add declarations for exported types (7d672e4) + hipe: Add declarations for exported types (3c34f42) + compiler: Add declarations for exported types (d5e1d11) + syntax_tools: Add declarations for exported types (f614f22) . . . * rn/resolver-leaking-ports (kernel) (2010-05-27) 2 commits + Resolver: make inet_dns decode ugly truncated reply (93ba7ad) + Resolver: stop inet_res leaking ports (5099491) * uw/mnesia-overload (mnesia) (2010-05-09) 1 commit + Enable continuous monitoring of mnesia overload status (82c0904) * uw/mnesia-schema-merge (mnesia) (2010-06-01) 2 commits + remove debug printout and accidental variable name reuse (7abf617) + Allow a user_defined function to wrap mnesia_schema:merge_schema() (f58fcc6) ------------------------------------------------------------ [New topics] * cb/emacs-eunit-run-recent (tools) (2010-06-01) 5 commits - erlang-eunit: remove runtime dependency on cl package (2f9b0e4) - Add Emacs EUnit feature: run recent (7b5a6f1) - Add Emacs EUnit feature: auto-save (041ea7c) - erlang-eunit: Optionally run code coverage analysis during eunit tests (50a54b8) - erlang-eunit: Made alternative locations of files more flexible (c5067db) * ia/ssl_many_handshake_packages_at_once (ssl) (2010-06-02) 1 commit - Fixed handling of several ssl/tls packets arriving at the same time. This was broken during a refactoring of the code. (b279fe0) * kj/emacs-eunit-run-current-test-with-cover (tools) (2010-05-26) 2 commits - erlang-eunit: Optionally run code coverage analysis during eunit tests (50a54b8) - erlang-eunit: Made alternative locations of files more flexible (c5067db) * ks/ets-tid-type (debugger, stdlib) (2010-05-28) 1 commit - Remove tid() from the predefined builtin types. (94be2be) * sv/serge-new_float_ext (erl_interface, odbc) (2010-06-03) 3 commits - Fix ei_tmo to restrict dflags to NEW_FLOAT_EXT (cbfa739) - compact IEEE 754 double encoding in external binary format for ei (a39a5d8) - fix typo in ei_decode_ei_term documentation (003698b) ------------------------------------------------------------ [Stalled] * bg/safer-local_to_univ (erts) (2010-02-11) 1 commit - erl_time_sup.c: test for error return from mktime() (0f62f0b) We will not include this branch in R13B04 for two reasons: o We are not 100% sure that this change is harmless on all platforms in all timezones. o We have an idea how the underlying problem can be fixed in the calendar module (only) and I plan to try it out after the release. We will keep this branch in pu as a reminder. Action expected from: Bj??rn Gustavsson * db/tv_nthtail_fix (tv) (2009-12-01) 1 commit - Fix for tv which restarts while trying to open a table (abe0759) Since our long-term goal is to migrate from gs towards wx, maintaining the old gs applications has a low priority for the Erlang/OTP team. Therefore, we will accept patches that seem sound, but we are unlikely to spend much of our own time fixing bugs. The author of this topic branch has found the real reason for the problem, but uncovered additional issues. Action expected from: The topic author - to decide whether to include the topic branch (which is a workaround, but does eliminate the crash) or to wait for a better fix from himself or someone else with an interest to advance the topic. * er/ei-decode_msg (erl_interface) (2010-03-11) 1 commit - Add function to decode distribution header (864091a) Needs documentation and test cases. Action expected from: Topic author * gl/jinterface-pom (jinterface, otp) (2010-02-15) 2 commits - Exclude jinterface build artifact from git (5acf5fa) - Add pom.xml for jinterface build (aa68190) The pom.xml file should be generated by the toplevel Makefile since it contains the version number of Jinterface. This is along the same line as the .app files are generated. There should be a pom.xml.src that Makefile sed's into pom.xml. See stdlib/src/Makefile. Action expected from: Topic author * jn/gen_stream (stdlib) (2010-05-17) 1 commit - Add new gen_stream behaviour for efficiently consuming serial streams (65f3db8) This topic branch has failing test cases. shell_SUITE:start_restricted_from_shell; Although the whole pu branch could be guilty this topic branch is our prime suspect. The test case does not fail when run standalone so this has to be invesigated further. Action expected from: OTP team * jp/dependencies_makefile (compiler, erts) (2010-02-14) 3 commits - squash! eliminate dialyzer warning (434e2ca) - squash! fix snprintf for Windows (bf2708d) - Add dependencies Makefile generation to erlc(1) and compile(3) (7cbc437) Approved in principle by the OTP Technical Board; now awaits a closer review of the implementation. Action expected from: Bj??rn Gustavsson (the reviewer) * kr/gs-browser (gs) (2010-02-10) 1 commit - Change lib/gs/src/tool_utils.erl to select multiple browsers other than Netscape (802d159) This topic branch introduces a new call to the deprecated regexp module. Action expected from: Topic author or anyone else with an interest to advance the topic ------------------------------------------------------------ [Cooking] * bg/bif-types (erts, hipe) (2010-06-02) 13 commits - Add type information for erlang:garbage_collect_message_area/0 (11aae8f) - Add type information for erts_debug:* BIFs (4545ea0) - Add type information for erlang:port_call/2 (969dcd7) - Add type information for erlang:display* BIFs (dbb50e4) - Add type information for the BIFs in the binary module (3e2872c) - Introduce and use the t_endian() helper (465f62a) - Add type information for erlang:binary_part/2,3 (cde6d1b) - Add type info for erlang:append/2 and erlang:subtract/2 (4ac4d00) - Add type information for the erlang:adler32* BIFs (5acd3b0) - Add ppc64 return for erlang:system_info(hipe_architecture) (564577b) - Test that all BIFs have known types (c54da1b) - utils/make_tables: Produce bifs.lists to support testing (e8e7dc1) . . . * bg/external-funs (compiler, erts, otp, stdlib) (2010-05-30) 6 commits - Document erlang:make_fun/3 (4a3bc9f) - v3_kernel: Clean up fun handling code (f81fa69) - Test calling a parameterized module within a fun (d365ff3) - EEP-23: Allow variables in fun M:F/A (e5b36ed) - Reference manual: Improve the documentation for external funs (de19b3c) - beam_loader: Support external funs in the literal pool (08ffb6b) * bg/nif_error (crypto, erts, hipe) (2010-05-24) 3 commits - crypto: Add type specs for all documented functions (4b928be) - crypto: Use erlang:nif_error/1 to squelch false Dialyzer warnings (c28c4aa) - Add erlang:nif_error/1,2 (7ff117e) * bg/temp-hipe-fixes (compiler, hipe, kernel) (2010-03-15) 6 commits - Avoid crash by skipping compilation_SUITE:on_load/1 (234e13e) - Inline less aggressively for native-code compilation (9fcb48b) - Crudely fix return type for the lists:key{search,find,member}/3 (ef71597) - seq_trace_SUITE: Don't native-compile (2a81b1a) - Disable native code if on_load is used (3befa76) - andor_SUITE: Don't native-compile (97aa2da) This branch contains temporary workarounds to avoid failing test cases and is never intended to graduate. * cf/timer_tc (stdlib) (2010-04-06) 1 commit - Add timer:tc/2 to measure the elapsed time of anonymous functions (2cca650) * egil/call-time-trace-patterns (erts) (2010-06-02) 23 commits - Fix ops.tab to include i_return_time_trace (63751e0) - Let trace_call_time_SUITE scheduling test be more relaxed (a46147d) - Add documentation for call time breakpoints (9757f9b) - Fix bp_hash_put to do hash value after rehash (9a4c67f) - Extend trace_call_time_SUITE with bif-tests (97ea51c) - Fix assertion in trace_pattern for bifs (1e1482a) - Teach erlang:system_info/1 to list snifs (091c65e) - Add bif tests to call time trace tests (bf4e102) - Teach call time trace patterns to include bifs (b2369c6) - Fix BeamInstr code array in export.h (c523cc5) - Add trace call_time tests for nifs and bifs (00b691d) - Teach call count tracing to use atomics (96a6c45) . . . . . . * hm/reltool-find-regular (reltool) (2010-05-19) 1 commit - Improve lookup of erl files (05e0238) * jf/run_erl-disable-flow-control (erts) (2010-03-05) 1 commit - Teach run_erl RUN_ERL_DISABLE_FLOWCNTRL for disabling flow control (d0775cd) * jr/cover-src-path (tools) (2010-04-23) 1 commit - Fix searching for source files in analyse_to_file/* (b9d5068) * ks/cleanups (compiler, debugger, docbuilder, gs, stdlib) (2010-04-10) 5 commits - compiler: Fix incorrect types and specs (9021667) - escript: Add more types to records (edfbc4b) - debugger: Clean up as suggested by tidier (42c0c33) - docbuilder: Clean up as suggested by tidier (c22830a) - gs: Clean up as suggested by tidier (eda4f7a) Was formerly called ks/cleanups-after-r13b04. * ms/file-exclusive-mode (erts, kernel) (2010-06-04) 2 commits - Update preloaded modules (bac96ae) - Support opening files in exclusive mode (4bd026c) * sb/make-files-like-erlc (tools) (2010-05-18) 1 commit - Change make:files to behave more like erlc (5e9d051) * ta/asn1-reporting (asn1) (2010-04-23) 1 commit - asn1ct: Make formatting of errors and warnings consistent (93face2) * uw/epmd-fullnames (kernel) (2010-05-07) 1 commit - Allow the erlang nodename host part to differ from the hostname (e0774be) ------------------------------------------------------------ [Dropped] * am/kernel-stops (kernel) (2010-02-21) 1 commit . Change restart behavior of network apps from permanent to transient (397343b) Not safe. The Erlang/OTP system has not been designed to survive the termination of key processes. * hb/edoc (edoc) (2010-04-01) 1 commit . EDoc and Dialyzer specs and types (516e16c) Temporarily dropped. Waiting for updated dialyzer. From mikpe@REDACTED Fri Jun 4 11:58:33 2010 From: mikpe@REDACTED (Mikael Pettersson) Date: Fri, 4 Jun 2010 11:58:33 +0200 Subject: [erlang-bugs] Bug: erts_bld_string_n returns negative characters In-Reply-To: References: <3E409DAF-0CE0-43A1-9884-85DC6C9F6777@kallisys.net> Message-ID: <19464.52809.200482.73517@pilspetsen.it.uu.se> Paul Guyot writes: > > I noticed a significant behaviour difference between ssl_imp new and ssl_imp old when using them with {packet, http} due to the fact that ssl_imp old decodes packets through inet driver (and the broker), while ssl_imp new decodes packets with erlang:decode_packet/3 and both do not generate the same data. > > > > The (simplified) http packet is: > > <<71,69,84,32,47,230,157,177,228,186,172,32,72,84,84,80,47,49,46,49,13,10,13,10>> > > > > With {ssl_imp old}, I get: > > {http_request,'GET', > > {abs_path,[47,230,157,177,228,186,172]}, > > {1,1}} > > > > With {ssl_imp, new}, I get: > > {http_request,'GET', > > {abs_path,[47,-26,-99,-79,-28,-70,-84]}, > > {1,1}} > > > > One can get the same result with: > > erlang:decode_packet(http, <<71,69,84,32,47,230,157,177,228,186,172,32,72,84,84,80,47,49,46,49,13,10,13,10>>, [{packet_size, 0}]). > > > > erlang:decode_packet eventually calls erts_bld_string_n. Things happen line 513 of current dev branch on github : > > > > http://github.com/erlang/otp/blob/dev/erts/emulator/beam/utils.c#L513 > > > > str[i] can be negative (> 0x7f) and therefore promoted to a small negative integer. > > > > It seems to me that erts_bld_string_n is supposed to take ISO-8859-1 characters, for example when called from enif_make_string_len (which is therefore broken?). It should return small positive integers instead of negative ones for values > 0x7f. Line 513 should be replaced from: > > res = CONS(*hpp, make_small(str[i]), res); > > to: > > res = CONS(*hpp, make_small((const unsigned char) str[i]), res); > > or: > > res = CONS(*hpp, make_small((byte) str[i]), res); > > > > This change would mimic what happens with inet_drv. It encodes the string with ERL_DRV_STRING, which is then decoded in beam/io.c with buf_to_intlist, which goes like this: > > > > tail = CONS(hp, make_small((byte)*buf), tail); I'll just note that the Erlang VM has always been internally inconsistent in how it processes random binary data: sometimes it uses 'unsigned char' pointers (correct), sometimes it uses plain 'char' pointers (incorrect). Earlier I've only seen this result in annoying GCC warnings when building the VM, but here there's a case where the code obviously does the wrong thing at runtime. What's even worse is that the runtime behaviour depends on a subtle property of the underlying machine: whether plain 'char' is signed or unsigned. Casting make_small()'s operand to (byte) or (unsigned char) [no 'const' needed] is the correct short-term fix. From bgustavsson@REDACTED Sun Jun 6 11:15:12 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Sun, 6 Jun 2010 11:15:12 +0200 Subject: Test for BIFs without type information In-Reply-To: References: Message-ID: Updated again. Hopefully the final update for this branch: git fetch git://github.com/bjorng/otp.git bg/bif-types -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From pguyot@REDACTED Sun Jun 6 22:44:57 2010 From: pguyot@REDACTED (Paul Guyot) Date: Sun, 6 Jun 2010 22:44:57 +0200 Subject: Honor start type in rel files when building relup Message-ID: <831A7BD3-52EC-43A1-8A28-F02020CA3780@kallisys.net> Hello, As I mentioned in December 2009 on erlang-bugs [1], there is a bug in sasl where the relup file does not honor the start type from the rel file for newly added applications. A patch with a test case is available here: git fetch git://github.com/pguyot/otp.git pg/honor_start_type_in_rel_files Regards, Paul [1] http://www.erlang.org/cgi-bin/ezmlm-cgi?2:mss:1655:200912:okhiafcddfmanpmaldhm -- Semiocast http://titema.com/ http://semiocast.com/ +33.175000290 - 62 bis rue Gay-Lussac, 75005 Paris From raimo+erlang-patches@REDACTED Mon Jun 7 09:16:12 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Mon, 7 Jun 2010 09:16:12 +0200 Subject: [erlang-patches] Re: Test for BIFs without type information In-Reply-To: References: Message-ID: <20100607071612.GA6534@erix.ericsson.se> On Sun, Jun 06, 2010 at 11:15:12AM +0200, Bj?rn Gustavsson wrote: > Updated again. Hopefully the final update for this branch: > > git fetch git://github.com/bjorng/otp.git bg/bif-types Thank you. 'pu' will be updated. > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From kostis@REDACTED Mon Jun 7 16:09:58 2010 From: kostis@REDACTED (Kostis Sagonas) Date: Mon, 07 Jun 2010 17:09:58 +0300 Subject: dialyzer related changes Message-ID: <4C0CFDB6.7030502@cs.ntua.gr> The (hopefully final) set of changes to dialyzer for R14 can be obtained with the following command: git fetch git://github.com/kostis/otp.git dialyzer-R14-fixes It fixes all problems that I am aware of. It should be relatively straightforward to include and I do not expect any surprises (it has been thoroughly tested on our side). There are at least three set of changes that it needs so that it becomes complete, but these are already in 'pu': - bg/bif-types - bg/nif_error - the change described in: http://github.com/bjorng/otp/commit/23f14da94daf1f51e202febf1673177dda0d385d and they should also be included in 'dev'. Kostis From pguyot@REDACTED Mon Jun 7 18:17:47 2010 From: pguyot@REDACTED (Paul Guyot) Date: Mon, 7 Jun 2010 18:17:47 +0200 Subject: [bug & patch] xmerl_scan doesn't decode &#x refs properly Message-ID: <6F5F6C91-D072-42B4-B102-02E674752F62@kallisys.net> Hello, There is a bug in xmerl_scan. It doesn't decode &#x refs properly. Considering the following code : {UTF8Output, []} = xmerl_scan:string("\n" ++ [229, 145, 156] ++ ""), #xmlElement{content = [#xmlText{value = UTF8Text}]} = UTF8Output, {DecEntityOutput, []} = xmerl_scan:string("\n"), #xmlElement{content = [#xmlText{value = DecEntityText}]} = DecEntityOutput, {HexEntityOutput, []} = xmerl_scan:string("\n"), #xmlElement{content = [#xmlText{value = HexEntityText}]} = HexEntityOutput, UTF8Text and DecEntityText are equal and as expected ([16#545C]). HexEntityText is (incorrectly) a list composed of the three UTF8 bytes [229, 145, 156] while it should be equal to [16#545C]. A patch with a test case can be found here: git fetch git://github.com/pguyot/otp.git pg/xmerl_scan_hex_entities Regards, Paul -- Semiocast http://semiocast.com/ +33.175000290 - 62 bis rue Gay-Lussac, 75005 Paris From raimo+erlang-patches@REDACTED Tue Jun 8 09:58:51 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Tue, 8 Jun 2010 09:58:51 +0200 Subject: [erlang-patches] [bug & patch] xmerl_scan doesn't decode &#x refs properly In-Reply-To: <6F5F6C91-D072-42B4-B102-02E674752F62@kallisys.net> References: <6F5F6C91-D072-42B4-B102-02E674752F62@kallisys.net> Message-ID: <20100608075851.GA16978@erix.ericsson.se> On Mon, Jun 07, 2010 at 06:17:47PM +0200, Paul Guyot wrote: > Hello, > > There is a bug in xmerl_scan. It doesn't decode &#x refs properly. > > Considering the following code : > > {UTF8Output, []} = xmerl_scan:string("\n" ++ [229, 145, 156] ++ ""), > #xmlElement{content = [#xmlText{value = UTF8Text}]} = UTF8Output, > {DecEntityOutput, []} = xmerl_scan:string("\n"), > #xmlElement{content = [#xmlText{value = DecEntityText}]} = DecEntityOutput, > {HexEntityOutput, []} = xmerl_scan:string("\n"), > #xmlElement{content = [#xmlText{value = HexEntityText}]} = HexEntityOutput, > > UTF8Text and DecEntityText are equal and as expected ([16#545C]). > HexEntityText is (incorrectly) a list composed of the three UTF8 bytes [229, 145, 156] while it should be equal to [16#545C]. > > A patch with a test case can be found here: > > git fetch git://github.com/pguyot/otp.git pg/xmerl_scan_hex_entities Thank you! It will be included in 'pu', after reformatting the commit message and cherry-pick onto 'dev' since it was not based on 'dev' but on a merge result containing 'dev'. > > Regards, > > Paul > -- > Semiocast http://semiocast.com/ > +33.175000290 - 62 bis rue Gay-Lussac, 75005 Paris > > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From fritchie@REDACTED Tue Jun 8 10:01:16 2010 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Tue, 08 Jun 2010 03:01:16 -0500 Subject: Patch for configurable ERTS_DE_BUSY_LIMIT In-Reply-To: Message of "Thu, 25 Feb 2010 15:44:26 +0100." <4B868CCA.9010804@erlang.org> Message-ID: <87903.1275984076@snookles.snookles.com> Rickard Green wrote: rg> It seems reasonable to add a configuration parameter for this. rg> However: [...] Assuming I followed instructions correctly, version 2 of this new config knob should be available via: git fetch git://github.com/slfritchie/otp.git erts_de_busy_limit Add flag-based setting for 'erts_de_busy_limit' constant A prior patch to change the 'erts_de_busy_limit' constant, based on an environment variable, was rejected by the Ericsson OTP team because environment variables are no longer used for modifying the VM's behavior. Families of flags like "+s" are devoted to the scheduler (except for "+sss"), but it wasn't obvious to me where a "+"-style flag for 'erts_de_busy_limit' should go. So, this patch creates a new family of flags, prefixed with "+z", for miscellaneous VM settings. The full flag name is "+zerts_de_busy_limit", which goes against the tradition of using "+Qmbl" for adjusting some kind of "mumble mumble" value but "mumble mumble" is obviously too long to be useful. If "+zerts_de_busy_limit" is too long, then I'll leave it to the OTP team to create a tradition-fitting, impossible-to-remember abbreviation to use instead. I don't a functional Java compiler with the suitable Java compliance level, so compiling & running the test suite isn't an option for me yet. I've made the attempt to write a test, but I haven't executed it to know if it works. erlang:system_info(erts_de_busy_limit) was added to make a unit test possible. The documentation changes are terse but present. Given the lack of Java above, my doc-building toolchain is broken, so I don't know if the formatting is correct, sorry. -Scott From raimo+erlang-patches@REDACTED Tue Jun 8 10:34:46 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Tue, 8 Jun 2010 10:34:46 +0200 Subject: [erlang-patches] Re: Patch for configurable ERTS_DE_BUSY_LIMIT In-Reply-To: <87903.1275984076@snookles.snookles.com> References: <4B868CCA.9010804@erlang.org> <87903.1275984076@snookles.snookles.com> Message-ID: <20100608083446.GB16978@erix.ericsson.se> On Tue, Jun 08, 2010 at 03:01:16AM -0500, Scott Lystig Fritchie wrote: > Rickard Green wrote: > > rg> It seems reasonable to add a configuration parameter for this. > rg> However: [...] > > Assuming I followed instructions correctly, version 2 of this new config > knob should be available via: > > git fetch git://github.com/slfritchie/otp.git erts_de_busy_limit Thank you. Will be included in 'pu', but probably after the release. > > Add flag-based setting for 'erts_de_busy_limit' constant > > A prior patch to change the 'erts_de_busy_limit' constant, based on an > environment variable, was rejected by the Ericsson OTP team because > environment variables are no longer used for modifying the VM's > behavior. > > Families of flags like "+s" are devoted to the scheduler (except for > "+sss"), but it wasn't obvious to me where a "+"-style flag for > 'erts_de_busy_limit' should go. So, this patch creates a new family > of flags, prefixed with "+z", for miscellaneous VM settings. > > The full flag name is "+zerts_de_busy_limit", which goes against the > tradition of using "+Qmbl" for adjusting some kind of "mumble mumble" > value but "mumble mumble" is obviously too long to be useful. If > "+zerts_de_busy_limit" is too long, then I'll leave it to the OTP team > to create a tradition-fitting, impossible-to-remember abbreviation to > use instead. > > I don't a functional Java compiler with the suitable Java compliance > level, so compiling & running the test suite isn't an option for me > yet. I've made the attempt to write a test, but I haven't executed it > to know if it works. erlang:system_info(erts_de_busy_limit) was added > to make a unit test possible. > > The documentation changes are terse but present. Given the lack of > Java above, my doc-building toolchain is broken, so I don't know if > the formatting is correct, sorry. > > -Scott > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From kostis@REDACTED Wed Jun 9 10:48:33 2010 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 09 Jun 2010 11:48:33 +0300 Subject: auth Message-ID: <4C0F5561.7000108@cs.ntua.gr> Fix some types and specs: git fetch git://github.com/kostis/otp.git auth-specs Kostis From bgustavsson@REDACTED Wed Jun 9 12:36:07 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Wed, 9 Jun 2010 12:36:07 +0200 Subject: [erlang-patches] auth In-Reply-To: <4C0F5561.7000108@cs.ntua.gr> References: <4C0F5561.7000108@cs.ntua.gr> Message-ID: 2010/6/9 Kostis Sagonas : > Fix some types and specs: > > git fetch git://github.com/kostis/otp.git auth-specs > We don't want actual changes mixed with minor clean-up of the indentation. *If* indentation is to be cleaned up (I don't recommend such clean-ups unless the indentation is severely messed up), it should be made in a separate commit. (Reason: for ease of reviewing and for ease of browsing and understanding the history.) I have removed the part of the patch that changes the indentation. Your branch also contains merge commits, which will cause problems, so I have rebased your commit on top of the current 'dev'. The revised branch (suitable for inclusion in 'pu') can be found here: http://github.com/bjorng/otp/commit/1c511359ba2556fdf357d778d7e20b5468db97d8 git fetch git://github.com/bjorng/otp.git ks/auth-specs -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From sverker@REDACTED Thu Jun 10 16:20:31 2010 From: sverker@REDACTED (Sverker Eriksson) Date: Thu, 10 Jun 2010 16:20:31 +0200 Subject: [erlang-bugs] Too strict HTTP Status Line parsing In-Reply-To: <20100601212229.GA58321@zaa.local> References: <20100601212229.GA58321@zaa.local> Message-ID: <4C10F4AF.5040900@erix.ericsson.se> git fetch git://github.com/sverker/otp.git http_response_empty_phrase Alexander Zhuravlev wrote: > Hello, > > I've tried to use lhttpc library (http://bitbucket.org/etc/lhttpc) to fetch > a resource (http://www.qype.com/review/1376848) and got the following > error: > > {{http_error,"HTTP/1.1 200\r\n"}, > [{lhttpc_client,read_response,5}, > {lhttpc_client,execute,8}, > {lhttpc_client,request,9}]} > > I've checked lhttpc source code and found out that to receive and parse an HTTP > response it uses _standard_ erlang module gen_tcp on a socket in > {packet, http} mode. So it looks like the {http_error,"HTTP/1.1 200\r\n"} error was > in fact generated by erlang's http packet parsing code. > > I found the following code in packet_parse_http function from > erts/emulator/beam/packet_parser.c file: > > ... > p0 = ptr; > while (n && SP(ptr)) { > ptr++; n--; > } > if (ptr==p0) return -1; > ... > > As far as I understand "HTTP/1.1 200\r\n" line does not have any spaces > after the status code "200", and the function strips \r\n as a first step of > its operation. So the "while" cycle does not run and we get into the > "if (ptr==p0) branch" this basically leads to returning of > {http_error, "HTTP/1.1 200\r\n"} atom up to the call stack. > > Strictly speaking this is not a bug in erlang, but I suppose it > should take a more relaxed approach to HTTP Status Line parsing > and not return http_error if an HTTP response Status Line does not have > a Reason-phrase part. > > ________________________________________________________________ > erlang-bugs (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-bugs-unsubscribe@REDACTED > > From raimo+erlang-patches@REDACTED Fri Jun 11 13:13:37 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Fri Jun 11 13:13:37 2010 Subject: What's cooking in erlang/otp (2010-06-11) Message-ID: <20100611134202.9660311D0@fingolfin.du.uab.ericsson.se> R14A is planned to be released on June 16. We will not include new features for that release. Bug fixes will not be accepted unless they are true release stoppers. ------------------------------------------------------------ [Graduated] * bg/bif-types (erts, hipe) (2010-06-02) 12 commits + Add type information for erlang:garbage_collect_message_area/0 (3e56a01) + Add type information for erts_debug:* BIFs (8dd0b99) + Add type information for erlang:port_call/2 (31ea3c8) + Add type information for erlang:display* BIFs (fb832e3) + Add type information for the BIFs in the binary module (73dd7b9) + Introduce and use the t_endian() helper (ae4886f) + Add type information for erlang:binary_part/2,3 (f54f5e0) + Add type info for erlang:append/2 and erlang:subtract/2 (518bde0) + Add type information for the erlang:adler32* BIFs (adc4f6a) + Add ppc64 return for erlang:system_info(hipe_architecture) (8ee659b) + Test that all BIFs have known types (0e03473) + erl_types: Export is_erl_type/1 (c1a2183) * bg/nif_error (crypto, erts, hipe) (2010-05-24) 3 commits + crypto: Add type specs for all documented functions (4b928be) + crypto: Use erlang:nif_error/1 to squelch false Dialyzer warnings (c28c4aa) + Add erlang:nif_error/1,2 (7ff117e) * cb/emacs-eunit-run-recent (tools) (2010-06-01) 3 commits + erlang-eunit: remove runtime dependency on cl package (6105447) + Add Emacs EUnit feature: run recent (be2ea4e) + Add Emacs EUnit feature: auto-save (1a20478) * egil/call-time-trace-patterns (erts) (2010-06-02) 23 commits + Fix ops.tab to include i_return_time_trace (63751e0) + Let trace_call_time_SUITE scheduling test be more relaxed (a46147d) + Add documentation for call time breakpoints (9757f9b) + Fix bp_hash_put to do hash value after rehash (9a4c67f) + Extend trace_call_time_SUITE with bif-tests (97ea51c) + Fix assertion in trace_pattern for bifs (1e1482a) + Teach erlang:system_info/1 to list snifs (091c65e) + Add bif tests to call time trace tests (bf4e102) + Teach call time trace patterns to include bifs (b2369c6) + Fix BeamInstr code array in export.h (c523cc5) + Add trace call_time tests for nifs and bifs (00b691d) + Teach call count tracing to use atomics (96a6c45) . . . * egil/eprof (hipe, tools) (2010-06-09) 13 commits + Fix eprof to handle error cases (913c7f8) + Dialyzer cleanup for eprof (7b2c179) + Fix fprof_SUITE to use new eprof API (b630e27) + Switch pattern API for eprof profile with mfa (3f2c888) + Update eprof documentation (100b825) + Update eprof_SUITE with more basic tests (916eb8c) + Rename sorting choices for eprof (7727bce) + Teach eprof to align text output (a654622) + Add dump functionality to eprof (671c809) + Add log functionality to eprof (9a33a27) + Update eprof tests to reflect new eprof (f21f320) + Add start timestamp to eprof profiling (1123a64) . . . * hm/reltool-find-regular (reltool) (2010-05-19) 1 commit + Improve lookup of erl files (05e0238) * ia/ssl_many_handshake_packages_at_once (ssl) (2010-06-02) 1 commit + Fixed handling of several ssl/tls packets arriving at the same time. This was broken during a refactoring of the code. (b279fe0) * kj/emacs-eunit-run-current-test-with-cover () (2010-05-26) 0 commits * ks/dialyzer-R14-fixes (dialyzer, hipe) (2010-06-07) 1 commit + Various changes to dialyzer-related files for R14. (1a9e2dd) * ks/ets-tid-type (debugger, stdlib) (2010-05-28) 1 commit + Remove tid() from the predefined builtin types. (5a1b230) * ms/file-exclusive-mode (erts, kernel) (2010-06-04) 2 commits + Update preloaded modules (bac96ae) + Support opening files in exclusive mode (4bd026c) * pg/fix_erts_bld_string_n (erts) (2010-06-04) 1 commit + Fix erts_bld_string_n (called by enif_make_string and erlang:decode_packet/3) to work with 8 bits characters (8215a7a) * se/port_SUITE_env (erts) (2010-06-07) 2 commits + fix open_port with many unset env vars (65ccc30) + allow open_port with env vars with trailing '=' on Windows (6925a0d) * sv/serge-new_float_ext (erl_interface) (2010-06-03) 4 commits + Let ei_get_type() return ERL_FLOAT_EXT instead of NEW_FLOAT_EXT (84134ab) + Fix ei_tmo to restrict dflags to NEW_FLOAT_EXT (8b19e4d) + compact IEEE 754 double encoding in external binary format for ei (a6a8805) + fix typo in ei_decode_ei_term documentation (1222a9c) ------------------------------------------------------------ [New topics] * ks/auth-specs (kernel) (2010-06-09) 1 commit - auth: Fix types and specs (1c51135) * se/http_response_empty_phrase (erts) (2010-06-10) 1 commit - {packet,http} allow empty response phrase (288f54c) ------------------------------------------------------------ [Stalled] * bg/safer-local_to_univ (erts) (2010-02-11) 1 commit - erl_time_sup.c: test for error return from mktime() (0f62f0b) We will not include this branch in R13B04 for two reasons: o We are not 100% sure that this change is harmless on all platforms in all timezones. o We have an idea how the underlying problem can be fixed in the calendar module (only) and I plan to try it out after the release. We will keep this branch in pu as a reminder. Action expected from: Bj??rn Gustavsson * db/tv_nthtail_fix (tv) (2009-12-01) 1 commit - Fix for tv which restarts while trying to open a table (28f1e36) Since our long-term goal is to migrate from gs towards wx, maintaining the old gs applications has a low priority for the Erlang/OTP team. Therefore, we will accept patches that seem sound, but we are unlikely to spend much of our own time fixing bugs. The author of this topic branch has found the real reason for the problem, but uncovered additional issues. Action expected from: The topic author - to decide whether to include the topic branch (which is a workaround, but does eliminate the crash) or to wait for a better fix from himself or someone else with an interest to advance the topic. * er/ei-decode_msg (erl_interface) (2010-03-11) 1 commit - Add function to decode distribution header (864091a) Needs documentation and test cases. Action expected from: Topic author * gl/jinterface-pom (jinterface, otp) (2010-02-15) 2 commits - Exclude jinterface build artifact from git (5acf5fa) - Add pom.xml for jinterface build (aa68190) The pom.xml file should be generated by the toplevel Makefile since it contains the version number of Jinterface. This is along the same line as the .app files are generated. There should be a pom.xml.src that Makefile sed's into pom.xml. See stdlib/src/Makefile. Action expected from: Topic author * jp/dependencies_makefile (compiler, erts) (2010-02-14) 3 commits - squash! eliminate dialyzer warning (434e2ca) - squash! fix snprintf for Windows (bf2708d) - Add dependencies Makefile generation to erlc(1) and compile(3) (7cbc437) Approved in principle by the OTP Technical Board; now awaits a closer review of the implementation. Action expected from: Bj??rn Gustavsson (the reviewer) * kr/gs-browser (gs) (2010-02-10) 1 commit - Change lib/gs/src/tool_utils.erl to select multiple browsers other than Netscape (802d159) This topic branch introduces a new call to the deprecated regexp module. Action expected from: Topic author or anyone else with an interest to advance the topic ------------------------------------------------------------ [Cooking] * bg/temp-hipe-fixes (compiler, hipe, kernel) (2010-03-15) 6 commits - Avoid crash by skipping compilation_SUITE:on_load/1 (234e13e) - Inline less aggressively for native-code compilation (9fcb48b) - Crudely fix return type for the lists:key{search,find,member}/3 (ef71597) - seq_trace_SUITE: Don't native-compile (2a81b1a) - Disable native code if on_load is used (3befa76) - andor_SUITE: Don't native-compile (97aa2da) This branch contains temporary workarounds to avoid failing test cases and is never intended to graduate. * cf/timer_tc (stdlib) (2010-04-06) 1 commit - Add timer:tc/2 to measure the elapsed time of anonymous functions (2cca650) * jf/run_erl-disable-flow-control (erts) (2010-03-05) 1 commit - Teach run_erl RUN_ERL_DISABLE_FLOWCNTRL for disabling flow control (d0775cd) * jn/gen_stream (stdlib) (2010-05-17) 1 commit . Add new gen_stream behaviour for efficiently consuming serial streams (65f3db8) This topic branch has failing test cases. shell_SUITE:start_restricted_from_shell; We have now tested with and without this topic branch and when it is present that test case fails. We consider it proved to be guilty. The test case does not fail when run standalone so it seems to be tricky... Also, some of its own test cases fail sporadicly apparently since the assumption there shoul be no more processes after the test case does not hold; probably a timing issue. Action expected from: Topic author. * jr/cover-src-path (tools) (2010-04-23) 1 commit - Fix searching for source files in analyse_to_file/* (b9d5068) * ks/cleanups (compiler, debugger, docbuilder, stdlib) (2010-04-10) 4 commits - compiler: Fix incorrect types and specs (8e79baa) - escript: Add more types to records (f2a2139) - debugger: Clean up as suggested by tidier (9e962d7) - docbuilder: Clean up as suggested by tidier (3647def) Was formerly called ks/cleanups-after-r13b04. * sb/make-files-like-erlc (tools) (2010-05-18) 1 commit - Change make:files to behave more like erlc (5e9d051) * ta/asn1-reporting (asn1) (2010-04-23) 1 commit - asn1ct: Make formatting of errors and warnings consistent (93face2) * uw/epmd-fullnames (kernel) (2010-05-07) 1 commit - Allow the erlang nodename host part to differ from the hostname (e0774be) ------------------------------------------------------------ [Dropped] * bg/external-funs (compiler, erts, otp, stdlib) (2010-05-30) 6 commits . Document erlang:make_fun/3 (4a3bc9f) . v3_kernel: Clean up fun handling code (f81fa69) . Test calling a parameterized module within a fun (d365ff3) . EEP-23: Allow variables in fun M:F/A (e5b36ed) . Reference manual: Improve the documentation for external funs (de19b3c) . beam_loader: Support external funs in the literal pool (08ffb6b) Some issues remain. Might be included in R14B if Bjorn manages to find the time... * hb/edoc (edoc) (2010-04-01) 1 commit . EDoc and Dialyzer specs and types (516e16c) Temporarily dropped. Will be fixed to use updated dialyzer. * pg/xmerl_scan_hex_entities (xmerl) (2010-06-07) 1 commit . Fix decoding of hex entities (&#xXXXX;) in xmerl_scan (36448fc) The bug it fixes is recognized, but the fix in the branch is not complete... The test case is in our internal 'dev' branch but the test suites are not released yet due to remaining copyright issues. We will fix the bug in a future release. From jay@REDACTED Tue Jun 15 08:41:38 2010 From: jay@REDACTED (Jay Nelson) Date: Mon, 14 Jun 2010 23:41:38 -0700 Subject: shell_SUITE failure (presumably caused by gen_stream) Message-ID: The failure in shell_SUITE is a parsing error on rr(prim_file). It seems that prim_file.erl is an erts preloaded file. I do not know what that means. In what ways could my test_suite, which creates and destroys processes, impact a "preloaded file" module? If I create a crash, could it somehow unload the preloaded files or is there some way that preloaded memory could be modified or overwritten? jay From raimo+erlang-patches@REDACTED Tue Jun 15 10:38:33 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Tue, 15 Jun 2010 10:38:33 +0200 Subject: [erlang-patches] shell_SUITE failure (presumably caused by gen_stream) In-Reply-To: References: Message-ID: <20100615083833.GA1483@erix.ericsson.se> On Mon, Jun 14, 2010 at 11:41:38PM -0700, Jay Nelson wrote: > The failure in shell_SUITE is a parsing error on rr(prim_file). It Can you elaborate? Have you got an error message? > seems that prim_file.erl is an erts preloaded file. I do not know > what that means. In what ways could my test_suite, which creates and prim_file.beam is converted to a binary blob and linked into the emulator, so it is always loaded, before the code server is started, and can not be unloaded. I guess not reloaded either. > destroys processes, impact a "preloaded file" module? If I create a > crash, could it somehow unload the preloaded files or is there some > way that preloaded memory could be modified or overwritten? There should not be such a possibility. It seems more likely you have affected the shell process(es) or code server. The shell is divided in one process that does the evaluating and one that "is" the shell process and does the interpreting, or something like that. Which one that loads records I do not know. In case you did not know; rr(prim_file) loads all record definitions from the file prim_file.beam or from prim_file.erl, so it has to find the files in the code path, from the code server. > > jay > > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From jay@REDACTED Tue Jun 15 18:05:23 2010 From: jay@REDACTED (Jay Nelson) Date: Tue, 15 Jun 2010 09:05:23 -0700 Subject: shell_SUITE parsing error Message-ID: <07735117-843B-4D90-B38D-8AF5F6FAE2E2@duomark.com> > On Mon, Jun 14, 2010 at 11:41:38PM -0700, Jay Nelson wrote: > >> The failure in shell_SUITE is a parsing error on rr(prim_file). It >> > > Can you elaborate? Have you got an error message? > My code may be out of date, but I get an error when I run shell_SUITE by itself (although after I have once run my test suite by itself). I mean using ts:run(stdlib, shell_SUITE, [batch]) or ts:run(stdlib, shell_SUITE, records, [batch]). The error is on line 384: ?line PreReply = scan(<<"rr(prim_file).">>), % preloaded... failed: {{badmatch, {error, {1,erl_parse, ["syntax error before: ","'*'"]}}}, [{shell_SUITE,'-scan/1-fun-0-',1}, {shell_SUITE,scan,2}, {shell_SUITE,records,1}, {test_server,my_apply,3} {test_server,ts_tc,3}, {test_server,run_test_case_eval1,6}, {test_server,run_test_case_eval,8}]}, [{shell_SUITE,384}] I get the error every time, whether I run gen_server test or not, although after I have run gen_server once. jay From dujinfang@REDACTED Wed Jun 16 16:32:42 2010 From: dujinfang@REDACTED (Seven Du) Date: Wed, 16 Jun 2010 22:32:42 +0800 Subject: patch to allow delete a name from epmd database without restart epmd Message-ID: Hi, Sometimes some erlang nodes crashe but I found the registered name still exists in "epmd -names" so the erlang node cannot restart with the same name. I asked this question in the email list but no other ones seems to have this issue. I cannot replicate that but it did happend a few times on my server Ubuntun 7.10 with R13B02-1 compiled from source. I'm not sure if it is a bug, but since epmd_srv.c accepts EPMD_STOP_REQ but epmd just doesn't has a way to sent that request. So I made this patch to unregister a node name epmd -stop node_name I also fixed a few typos. This is the first time I submit patch, so please try the following and let me know if it has problems. git fetch git@REDACTED:seven1240/otp.git epmd_stop_cli Thanks. -- Blog: http://www.dujinfang.com Proj: http://www.freeswitch.org.cn From raimo+erlang-patches@REDACTED Thu Jun 17 10:59:17 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Thu, 17 Jun 2010 10:59:17 +0200 Subject: [erlang-patches] patch to allow delete a name from epmd database without restart epmd In-Reply-To: References: Message-ID: <20100617085917.GA30828@erix.ericsson.se> On Wed, Jun 16, 2010 at 10:32:42PM +0800, Seven Du wrote: > Hi, > > Sometimes some erlang nodes crashe but I found the registered name > still exists in "epmd -names" so the erlang node cannot restart with > the same name. > > I asked this question in the email list but no other ones seems to > have this issue. I cannot replicate that but it did happend a few > times on my server Ubuntun 7.10 with R13B02-1 compiled from source. > I'm not sure if it is a bug, but since epmd_srv.c accepts > EPMD_STOP_REQ but epmd just doesn't has a way to sent that request. So > I made this patch to unregister a node name > > epmd -stop node_name > > I also fixed a few typos. > > This is the first time I submit patch, so please try the following and > let me know if it has problems. > > git fetch git@REDACTED:seven1240/otp.git epmd_stop_cli Thank you! It will be included in 'pu'. That fetch command only works for you. This one I used: git fetch git://github.com/seven1240/otp.git epmd_stop_cli > > Thanks. > > -- > Blog: http://www.dujinfang.com > Proj: http://www.freeswitch.org.cn -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From pguyot@REDACTED Thu Jun 17 14:28:36 2010 From: pguyot@REDACTED (Paul Guyot) Date: Thu, 17 Jun 2010 14:28:36 +0200 Subject: Specification of beam_lib:cmp/2 return type Message-ID: Hello, R14A's beam_lib(3) man page and beam_lib:cmp_rsn() type do not completely cover the actual return type of beam_lib:cmp/2. Indeed, beam_lib:cmp/2 can return {error, beam_lib, different_chunks} if there is a non-useless chunk (i.e. a chunk other than "CInf") in Beam1 that is not in Beam2, or reciprocally -- (cf beam_lib.erl, line 352). A patch for this specification is available here: git fetch git://github.com/pguyot/otp.git pg/beam_lib_cmp_2_return_type_specification Regards, Paul From raimo+erlang-patches@REDACTED Fri Jun 18 16:07:03 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Fri, 18 Jun 2010 16:07:03 +0200 Subject: [erlang-patches] Specification of beam_lib:cmp/2 return type In-Reply-To: References: Message-ID: <20100618140703.GA358@erix.ericsson.se> On Thu, Jun 17, 2010 at 02:28:36PM +0200, Paul Guyot wrote: > Hello, > > R14A's beam_lib(3) man page and beam_lib:cmp_rsn() type do not completely cover the actual return type of beam_lib:cmp/2. > > Indeed, beam_lib:cmp/2 can return {error, beam_lib, different_chunks} if there is a non-useless chunk (i.e. a chunk other than "CInf") in Beam1 that is not in Beam2, or reciprocally -- (cf beam_lib.erl, line 352). > > A patch for this specification is available here: > > git fetch git://github.com/pguyot/otp.git pg/beam_lib_cmp_2_return_type_specification Thank you! It will be included in 'pu'. > > Regards, > > Paul > > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From per@REDACTED Sun Jun 20 22:16:12 2010 From: per@REDACTED (Per Hedeland) Date: Sun, 20 Jun 2010 22:16:12 +0200 (CEST) Subject: [erlang-questions] inet_res:getbyname/2 and udp:connect/3 In-Reply-To: <201006172019.o5HKJKZc029818@pluto.hedeland.org> Message-ID: <201006202016.o5KKGCTi032358@pluto.hedeland.org> Per Hedeland wrote: > I.e. it >seems this is actually a problem with the FreeBSD "port" build of >Erlang/OTP (I happened to have such a build of R12B-5 around too - same >problem there). Actually this wasn't quite correct - it's a problem with the FreeBSD port build only insofar as it uses --enable-sctp (which my other build didn't) - thereby exposing a bug in inet_drv. I.e. connected UDP (and handling of any other errors in UDP recv()) is broken in passive mode for all SCTP-enabled builds. Patch below against R13B04 - R14A has the same bug. --Per --- otp_src_R13B04/erts/emulator/drivers/common/inet_drv.c.ORIG 2010-02-19 19:03:43.000000000 +0100 +++ otp_src_R13B04/erts/emulator/drivers/common/inet_drv.c 2010-06-20 21:57:12.000000000 +0200 @@ -9382,9 +9382,8 @@ if (short_recv) async_error_am(desc, am_short_recv); else -#else - async_error(desc, err); #endif + async_error(desc, err); driver_cancel_timer(desc->port); sock_select(desc,FD_READ,0); } From raimo+erlang-patches@REDACTED Mon Jun 21 15:31:40 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Mon, 21 Jun 2010 15:31:40 +0200 Subject: [erlang-patches] Re: [erlang-questions] inet_res:getbyname/2 and udp:connect/3 In-Reply-To: <201006202016.o5KKGCTi032358@pluto.hedeland.org> References: <201006172019.o5HKJKZc029818@pluto.hedeland.org> <201006202016.o5KKGCTi032358@pluto.hedeland.org> Message-ID: <20100621133140.GA15329@erix.ericsson.se> On Sun, Jun 20, 2010 at 10:16:12PM +0200, Per Hedeland wrote: > Per Hedeland wrote: > > I.e. it > >seems this is actually a problem with the FreeBSD "port" build of > >Erlang/OTP (I happened to have such a build of R12B-5 around too - same > >problem there). > > Actually this wasn't quite correct - it's a problem with the FreeBSD > port build only insofar as it uses --enable-sctp (which my other build > didn't) - thereby exposing a bug in inet_drv. I.e. connected UDP (and > handling of any other errors in UDP recv()) is broken in passive mode > for all SCTP-enabled builds. Patch below against R13B04 - R14A has the > same bug. Thank you! Well done. http://github.com/RaimoNiskanen/otp/commit/5615d7ac85e94ec718a2acdc9e77381f9109a64c git fetch git://github.com/RaimoNiskanen/otp.git rani/sctp-udp-recv-error Will be included in 'pu'. > > --Per > > --- otp_src_R13B04/erts/emulator/drivers/common/inet_drv.c.ORIG 2010-02-19 19:03:43.000000000 +0100 > +++ otp_src_R13B04/erts/emulator/drivers/common/inet_drv.c 2010-06-20 21:57:12.000000000 +0200 > @@ -9382,9 +9382,8 @@ > if (short_recv) > async_error_am(desc, am_short_recv); > else > -#else > - async_error(desc, err); > #endif > + async_error(desc, err); > driver_cancel_timer(desc->port); > sock_select(desc,FD_READ,0); > } > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From martti.kuparinen@REDACTED Tue Jun 22 11:28:32 2010 From: martti.kuparinen@REDACTED (Martti Kuparinen) Date: Tue, 22 Jun 2010 12:28:32 +0300 Subject: NetBSD support for Erlang R14A Message-ID: <1277198912.2087.65.camel@tri10.nomadiclab.com> Hi, Please review and integrate if possible the following changes. Please be gentle, I'm totally new to git so I may have done something wrong... The "real" patches can be found in http://pkgsrc-wip.cvs.sourceforge.net/pkgsrc-wip/wip/erlang/patches/ Martti http://github.com/marttikuparinen/otp commit 20bcc74f6d513bae862c828d47bb4398070cef4d Author: Martti Kuparinen Date: Tue Jun 22 12:17:00 2010 +0300 Make sure the odbcserver binary finds the ODBC library at run-time The compiler/linker should be told where the generated odbcserver binary can find its ODBC dynamic library at run-time. The problem was detected in NetBSD pkgsrc where the Erlang package is build with temporary destdir. commit da60b9d7021f133f193acfccbf9631db9525a8df Author: Martti Kuparinen Date: Tue Jun 22 12:15:22 2010 +0300 Use xxx(void) instead of xxx(). Newer GCC complains if the function argument list does not exist. In that case, use "void". commit 4631f43336408ad69127a773a8d46a8075dc9811 Author: Martti Kuparinen Date: Tue Jun 22 12:12:29 2010 +0300 Use proper install method. Only real program files should be installed with INSTALL_PROGRAM while scripts should be installed with INSTALL_SCRIPT and data files with INSTALL_DATA. commit ed59755fea05ba877f1db74c10381596ed9f37b0 Author: Martti Kuparinen Date: Tue Jun 22 12:10:37 2010 +0300 Added support for DragonFly BSD. These are the current NetBSD pkgsrc patches. commit d00a5a909c7b0d629adefd8f19370802e2701fd8 Author: Martti Kuparinen Date: Tue Jun 22 12:08:54 2010 +0300 Added support for NetBSD. These are the current NetBSD pkgsrc patches. From martti.kuparinen@REDACTED Tue Jun 22 11:34:21 2010 From: martti.kuparinen@REDACTED (Martti Kuparinen) Date: Tue, 22 Jun 2010 12:34:21 +0300 Subject: [erlang-patches] NetBSD support for Erlang R14A In-Reply-To: <1277198912.2087.65.camel@tri10.nomadiclab.com> References: <1277198912.2087.65.camel@tri10.nomadiclab.com> Message-ID: <1277199261.2087.66.camel@tri10.nomadiclab.com> On Tue, 2010-06-22 at 12:28 +0300, Martti Kuparinen wrote: > http://github.com/marttikuparinen/otp This too... Martti commit 9c7e91140df911ac33f5673ed2e0609ddee419a4 Author: Martti Kuparinen Date: Tue Jun 22 12:31:34 2010 +0300 Do not hardcode browser name. Instead of hardcoding one browser name, define a list of possible browsers and pick one. Patch taken from NetBSD pkgsrc. From tuncer.ayaz@REDACTED Tue Jun 22 15:23:25 2010 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Tue, 22 Jun 2010 15:23:25 +0200 Subject: [erlang-patches] NetBSD support for Erlang R14A In-Reply-To: <1277199261.2087.66.camel@tri10.nomadiclab.com> References: <1277198912.2087.65.camel@tri10.nomadiclab.com> <1277199261.2087.66.camel@tri10.nomadiclab.com> Message-ID: On Tue, Jun 22, 2010 at 11:34 AM, Martti Kuparinen wrote: > > commit 9c7e91140df911ac33f5673ed2e0609ddee419a4 > Author: Martti Kuparinen > Date: ? Tue Jun 22 12:31:34 2010 +0300 > > ? ?Do not hardcode browser name. > > ? ?Instead of hardcoding one browser name, define a list of possible > ? ?browsers and pick one. Patch taken from NetBSD pkgsrc. Please use the re module instead of regexp. From raimo+erlang-patches@REDACTED Tue Jun 22 15:58:09 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Tue, 22 Jun 2010 15:58:09 +0200 Subject: [erlang-patches] NetBSD support for Erlang R14A In-Reply-To: <1277198912.2087.65.camel@tri10.nomadiclab.com> References: <1277198912.2087.65.camel@tri10.nomadiclab.com> Message-ID: <20100622135809.GA32238@erix.ericsson.se> On Tue, Jun 22, 2010 at 12:28:32PM +0300, Martti Kuparinen wrote: > Hi, > > Please review and integrate if possible the following changes. Please be > gentle, I'm totally new to git so I may have done something wrong... The > "real" patches can be found in > http://pkgsrc-wip.cvs.sourceforge.net/pkgsrc-wip/wip/erlang/patches/ > > Martti I'll be happy to. But I need to know which branch these changes are on. Either my Git skills are to low, or there is no way to fetch a certain commit nor to on Github find out which branches a commit belongs to... > > > http://github.com/marttikuparinen/otp > > > commit 20bcc74f6d513bae862c828d47bb4398070cef4d > Author: Martti Kuparinen > Date: Tue Jun 22 12:17:00 2010 +0300 > > Make sure the odbcserver binary finds the ODBC library at run-time > > The compiler/linker should be told where the generated odbcserver > binary > can find its ODBC dynamic library at run-time. The problem was > detected > in NetBSD pkgsrc where the Erlang package is build with temporary > destdir. > > commit da60b9d7021f133f193acfccbf9631db9525a8df > Author: Martti Kuparinen > Date: Tue Jun 22 12:15:22 2010 +0300 > > Use xxx(void) instead of xxx(). > > Newer GCC complains if the function argument list does not exist. In > that > case, use "void". > > commit 4631f43336408ad69127a773a8d46a8075dc9811 > Author: Martti Kuparinen > Date: Tue Jun 22 12:12:29 2010 +0300 > > Use proper install method. > > Only real program files should be installed with INSTALL_PROGRAM > while > scripts should be installed with INSTALL_SCRIPT and data files with > INSTALL_DATA. > > commit ed59755fea05ba877f1db74c10381596ed9f37b0 > Author: Martti Kuparinen > Date: Tue Jun 22 12:10:37 2010 +0300 > > Added support for DragonFly BSD. > > These are the current NetBSD pkgsrc patches. > > commit d00a5a909c7b0d629adefd8f19370802e2701fd8 > Author: Martti Kuparinen > Date: Tue Jun 22 12:08:54 2010 +0300 > > Added support for NetBSD. > > These are the current NetBSD pkgsrc patches. > > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-patches@REDACTED Tue Jun 22 16:03:32 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Tue, 22 Jun 2010 16:03:32 +0200 Subject: [erlang-patches] NetBSD support for Erlang R14A In-Reply-To: <20100622135809.GA32238@erix.ericsson.se> References: <1277198912.2087.65.camel@tri10.nomadiclab.com> <20100622135809.GA32238@erix.ericsson.se> Message-ID: <20100622140332.GA1396@erix.ericsson.se> On Tue, Jun 22, 2010 at 03:58:09PM +0200, Raimo Niskanen wrote: > On Tue, Jun 22, 2010 at 12:28:32PM +0300, Martti Kuparinen wrote: > > Hi, > > > > Please review and integrate if possible the following changes. Please be > > gentle, I'm totally new to git so I may have done something wrong... The > > "real" patches can be found in > > http://pkgsrc-wip.cvs.sourceforge.net/pkgsrc-wip/wip/erlang/patches/ > > > > Martti > > I'll be happy to. But I need to know which branch these changes are on. > Either my Git skills are to low, or there is no way to fetch a certain > commit nor to on Github find out which branches a commit belongs to... > > > > > > > http://github.com/marttikuparinen/otp Found it; 'master'. The correct fetch command was: git fetch git://github.com/marttikuparinen/otp.git master Will be included in 'pu', with one whitespace fix and commit rewording: Change all taglines to imperative with no trailing dot > > > > > > commit 20bcc74f6d513bae862c828d47bb4398070cef4d > > Author: Martti Kuparinen > > Date: Tue Jun 22 12:17:00 2010 +0300 > > > > Make sure the odbcserver binary finds the ODBC library at run-time > > > > The compiler/linker should be told where the generated odbcserver > > binary > > can find its ODBC dynamic library at run-time. The problem was > > detected > > in NetBSD pkgsrc where the Erlang package is build with temporary > > destdir. > > > > commit da60b9d7021f133f193acfccbf9631db9525a8df > > Author: Martti Kuparinen > > Date: Tue Jun 22 12:15:22 2010 +0300 > > > > Use xxx(void) instead of xxx(). > > > > Newer GCC complains if the function argument list does not exist. In > > that > > case, use "void". > > > > commit 4631f43336408ad69127a773a8d46a8075dc9811 > > Author: Martti Kuparinen > > Date: Tue Jun 22 12:12:29 2010 +0300 > > > > Use proper install method. > > > > Only real program files should be installed with INSTALL_PROGRAM > > while > > scripts should be installed with INSTALL_SCRIPT and data files with > > INSTALL_DATA. > > > > commit ed59755fea05ba877f1db74c10381596ed9f37b0 > > Author: Martti Kuparinen > > Date: Tue Jun 22 12:10:37 2010 +0300 > > > > Added support for DragonFly BSD. > > > > These are the current NetBSD pkgsrc patches. > > > > commit d00a5a909c7b0d629adefd8f19370802e2701fd8 > > Author: Martti Kuparinen > > Date: Tue Jun 22 12:08:54 2010 +0300 > > > > Added support for NetBSD. > > > > These are the current NetBSD pkgsrc patches. > > > > > > ________________________________________________________________ > > erlang-patches (at) erlang.org mailing list. > > See http://www.erlang.org/faq.html > > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From martti.kuparinen@REDACTED Wed Jun 23 07:35:27 2010 From: martti.kuparinen@REDACTED (Martti Kuparinen) Date: Wed, 23 Jun 2010 08:35:27 +0300 Subject: Few HiPE patches Message-ID: <1277271327.2087.81.camel@tri10.nomadiclab.com> Hi again, Do you guys have any idea what these are? Do they look reasonable? Obvious errors? http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/erlang/patches/patch-al?revision=1.2 http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/erlang/patches/patch-am?revision=1.2 http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/erlang/patches/patch-an?revision=1.2 http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/erlang/patches/patch-ao?revision=1.2 http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/erlang/patches/patch-ap?revision=1.2 I've contacted the original author but I haven't received any reply yet. I've no idea why these exist in the NetBSD pkgsrc but I'd like to either get rid of them or submit them to you guys to be included in the official code tree. Martti From martti.kuparinen@REDACTED Wed Jun 23 08:31:53 2010 From: martti.kuparinen@REDACTED (Martti Kuparinen) Date: Wed, 23 Jun 2010 09:31:53 +0300 Subject: [erlang-patches] Few HiPE patches In-Reply-To: <1277271327.2087.81.camel@tri10.nomadiclab.com> References: <1277271327.2087.81.camel@tri10.nomadiclab.com> Message-ID: <1277274713.2087.88.camel@tri10.nomadiclab.com> I just found this in our hacks.mk (http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/erlang/hacks.mk?revision=1.2) ### ### XXX Don't let the kernel put the map elsewhere. ### .if (${OPSYS} == "NetBSD" || \ ${OPSYS} == "OpenBSD" || \ ${OPSYS} == "FreeBSD" || \ ${OPSYS} == "Solaris") CFLAGS+= -DMMAP_MAP_FIXED .endif Any ideas why this is there? Martti From martti.kuparinen@REDACTED Wed Jun 23 10:13:53 2010 From: martti.kuparinen@REDACTED (Martti Kuparinen) Date: Wed, 23 Jun 2010 11:13:53 +0300 Subject: [erlang-patches] Few HiPE patches In-Reply-To: <1277274713.2087.88.camel@tri10.nomadiclab.com> References: <1277271327.2087.81.camel@tri10.nomadiclab.com> <1277274713.2087.88.camel@tri10.nomadiclab.com> Message-ID: <1277280833.2087.97.camel@tri10.nomadiclab.com> I got the following answer from the patch author. The same thing is valid for NetBSD as well so I'm going to submit a proper patch later... Martti If I understand your question, you're asking about MAP_FIXED. I work on FreeBSD, and those patches reflect the absense of MMAP_MAP_FIXED: $ grep -rF MMAP_MAP_FIXED /usr/include $ uname -mrs FreeBSD 6.3-STABLE i386 From martti.kuparinen@REDACTED Wed Jun 23 11:05:50 2010 From: martti.kuparinen@REDACTED (Martti Kuparinen) Date: Wed, 23 Jun 2010 12:05:50 +0300 Subject: Removing unused variables Message-ID: <1277283950.2087.134.camel@tri10.nomadiclab.com> Some minor tweaks... Martti http://github.com/marttikuparinen/otp/commits/warning_unused_variable commit 2c1f9958c33824abc7b445d457a0357726a4d0ec Author: Martti Kuparinen Date: Wed Jun 23 11:15:30 2010 +0300 Removed unused variables. From martti.kuparinen@REDACTED Wed Jun 23 11:29:19 2010 From: martti.kuparinen@REDACTED (Martti Kuparinen) Date: Wed, 23 Jun 2010 12:29:19 +0300 Subject: mmap Message-ID: <1277285359.2087.138.camel@tri10.nomadiclab.com> Please take a look at the hipe_mmap branch... http://github.com/marttikuparinen/otp/commit/a249550a372b354eacc11650cb6740bc67d36ae5 From mikpe@REDACTED Wed Jun 23 12:29:05 2010 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 23 Jun 2010 12:29:05 +0200 Subject: [erlang-patches] Few HiPE patches In-Reply-To: <1277271327.2087.81.camel@tri10.nomadiclab.com> References: <1277271327.2087.81.camel@tri10.nomadiclab.com> Message-ID: <19489.57841.76274.757322@pilspetsen.it.uu.se> Martti Kuparinen writes: > Hi again, > > Do you guys have any idea what these are? Do they look reasonable? > Obvious errors? > > http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/erlang/patches/patch-al?revision=1.2 For amd64: ignore the availability of MAP_32BIT if the fake MMAP_MAP_FIXED is defined. Weird. It also breaks Solaris. In a followup message you mention setting MMAP_MAP_FIXED outside of the original sources. Although that would seem to unbreak Solaris it's a totally unacceptable approach: the integrity of the sources must not depend on external hacks outside of our control. Why on earth would one want to ignore MAP_32BIT? If it's defined but doesn't work, then the correct solution is to #if ... #undef MAP_32BIT #endif somewhere before this code. > http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/erlang/patches/patch-am?revision=1.2 For arm: 1) Use MAP_ANON if MAP_ANONYMOUS isn't defined. This is Ok. 2. Add MAP_FIXED to mmap call if fake MMAP_MAP_FIXED is defined. With standard-compliant mmap() [ie POSIX or SUS] this would result in an attempt to mmap() anonymous memory at address zero, which is bogus and won't work. Just how broken is BSD's mmap()? And have they redefined MAP_FIXED to mean something completely non-standard? Strong NAK util proper justification is given. > http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/erlang/patches/patch-an?revision=1.2 For ppc: add MAP_FIXED to mmap() calls under the same conditions as above for arm. Same breakage, same NAK. > http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/erlang/patches/patch-ao?revision=1.2 For sparc: ditto. There's a cleanup there to remove some dead x86_64 code: that one is Ok. > http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/erlang/patches/patch-ap?revision=1.2 For x86 (32-bit): add MAP_FIXED to mmap() call as above. NAK. There's a similar adjustment wrt MAP_32BIT as in the amd64 patch, but that's dead code (#ifdef __x86_64__) so it seems unjustified. I'm amused by the CVS comments about HiPE triggering BSD kernel panics ... There are other patches in that directory that would seem to range from obvious (use $(INSTALL_DATA) not $(INSTALL_PROGRAM) for non-executables, proper ANSI/ISO C in F_PTR/L_PTR typedefs), to reasonable (BSD-specific snippets for signal handling), to questionable (why do you patch the BEAM code generator?). If you want to discuss specific patches, current or future, please post them (not links to them!) to erlang-patches. /Mikael From mikpe@REDACTED Wed Jun 23 12:40:08 2010 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 23 Jun 2010 12:40:08 +0200 Subject: [erlang-patches] mmap In-Reply-To: <1277285359.2087.138.camel@tri10.nomadiclab.com> References: <1277285359.2087.138.camel@tri10.nomadiclab.com> Message-ID: <19489.58504.175600.633611@pilspetsen.it.uu.se> Martti Kuparinen writes: > Please take a look at the hipe_mmap branch... > > http://github.com/marttikuparinen/otp/commit/a249550a372b354eacc11650cb6740bc67d36ae5 These as the same changes you posted under the subject "Few HiPE patches" and which I've replied to a few minutes ago. From martti.kuparinen@REDACTED Wed Jun 23 14:41:54 2010 From: martti.kuparinen@REDACTED (Martti Kuparinen) Date: Wed, 23 Jun 2010 15:41:54 +0300 Subject: [erlang-patches] Few HiPE patches In-Reply-To: <19489.57841.76274.757322@pilspetsen.it.uu.se> References: <1277271327.2087.81.camel@tri10.nomadiclab.com> <19489.57841.76274.757322@pilspetsen.it.uu.se> Message-ID: <1277296914.2087.146.camel@tri10.nomadiclab.com> On Wed, 2010-06-23 at 12:29 +0200, Mikael Pettersson wrote: > Why on earth would one want to ignore MAP_32BIT? If it's defined but doesn't Don't shoot the messenger (=me), I have to discuss with the original author and ask why he did things the way he did. I'll update the patch when I have a better solution. > I'm amused by the CVS comments about HiPE triggering BSD kernel panics ... I was running bleeding edge, development version of NetBSD and it had a bug for a short period of time (which is now fixed) and that had nothing to do with Erlang. The official NetBSD release version did not suffer from this bug. I admit I should have put a better commit message... Martti From martti.kuparinen@REDACTED Thu Jun 24 07:38:59 2010 From: martti.kuparinen@REDACTED (Martti Kuparinen) Date: Thu, 24 Jun 2010 08:38:59 +0300 Subject: [erlang-patches] Few HiPE patches In-Reply-To: <19489.57841.76274.757322@pilspetsen.it.uu.se> References: <1277271327.2087.81.camel@tri10.nomadiclab.com> <19489.57841.76274.757322@pilspetsen.it.uu.se> Message-ID: <1277357939.2087.183.camel@tri10.nomadiclab.com> You were absolutely right, those HiPE patches were not needed, I only left these two. At least NetBSD does not have MAP_ANONYOUS but MAP_ANON according to mmap(2). Happy with these? --- erts/emulator/hipe/hipe_arm.c.orig 2010-06-24 07:25:07.000000000 +0300 +++ erts/emulator/hipe/hipe_arm.c 2010-06-24 07:25:43.000000000 +0300 @@ -73,6 +73,10 @@ #define in_area(ptr,start,nbytes) \ ((unsigned long)((char*)(ptr) - (char*)(start)) < (nbytes)) +#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) +#define MAP_ANONYOUS MAP_ANON +#endif + static void *new_code_mapping(void) { return mmap(0, SEGMENT_NRBYTES, --- erts/emulator/hipe/hipe_sparc.c.orig 2010-06-24 07:26:50.000000000 +0 300 +++ erts/emulator/hipe/hipe_sparc.c 2010-06-24 07:27:25.000000000 +0300 @@ -130,6 +130,10 @@ #define ALLOC_CODE_STATS(X) do{}while(0) #endif +#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) +#define MAP_ANONYMOUS MAP_ANON +#endif + static void morecore(unsigned int alloc_bytes) { unsigned int map_bytes; > reasonable (BSD-specific snippets for signal handling) I looked at erts/emulator/hipe/hipe_x86_signal.c again and I have one question: INIT is defined inside #ifdef...#endif but used without any #ifdef..#endif check. Why? Without @@ -326,7 +327,9 @@ struct sigaction sa; int i; +#ifndef __NetBSD__ INIT(); +#endif hipe_sigaltstack_init(); I get an error like this obj/i386-unknown-netbsdelf5.99.30/opt/smp/hipe_x86_signal.o: In function `hipe_signal_init': hipe_x86_signal.c:(.text+0x9): undefined reference to `INIT' > to questionable (why do you patch the BEAM code generator?). I assume you are talking about the now-removed patch-ah (http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/erlang/patches/patch-ah?revision=1.3) which was --- lib/compiler/src/v3_codegen.erl.orig 2010-06-11 18:30:11.000000000 +0300 +++ lib/compiler/src/v3_codegen.erl 2010-06-17 10:19:44.000000000 +0300 @@ -1520,6 +1520,8 @@ Sizes = filter(fun({_,{integer,0}}) -> false; (_) -> true end, Sizes0), case Sizes of + [] -> + {bs_init2,[{integer,0}]}; [{1,_}|_] -> {bs_init_bits,cg_binary_bytes_to_bits(Sizes, [])}; [{8,_}|_] -> I've removed this now. Martti From mikpe@REDACTED Thu Jun 24 11:38:30 2010 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 24 Jun 2010 11:38:30 +0200 Subject: [erlang-patches] Few HiPE patches In-Reply-To: <1277357939.2087.183.camel@tri10.nomadiclab.com> References: <1277271327.2087.81.camel@tri10.nomadiclab.com> <19489.57841.76274.757322@pilspetsen.it.uu.se> <1277357939.2087.183.camel@tri10.nomadiclab.com> Message-ID: <19491.10134.545053.687764@pilspetsen.it.uu.se> Martti Kuparinen writes: > You were absolutely right, those HiPE patches were not needed, I only > left these two. At least NetBSD does not have MAP_ANONYOUS but MAP_ANON > according to mmap(2). Happy with these? > > > --- erts/emulator/hipe/hipe_arm.c.orig 2010-06-24 07:25:07.000000000 > +0300 > +++ erts/emulator/hipe/hipe_arm.c 2010-06-24 07:25:43.000000000 > +0300 > @@ -73,6 +73,10 @@ > #define in_area(ptr,start,nbytes) \ > ((unsigned long)((char*)(ptr) - (char*)(start)) < (nbytes)) > > +#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) > +#define MAP_ANONYOUS MAP_ANON > +#endif > + > static void *new_code_mapping(void) > { > return mmap(0, SEGMENT_NRBYTES, > > OK > --- erts/emulator/hipe/hipe_sparc.c.orig 2010-06-24 > 07:26:50.000000000 +0 > 300 > +++ erts/emulator/hipe/hipe_sparc.c 2010-06-24 07:27:25.000000000 > +0300 > @@ -130,6 +130,10 @@ > #define ALLOC_CODE_STATS(X) do{}while(0) > #endif > > +#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) > +#define MAP_ANONYMOUS MAP_ANON > +#endif > + > static void morecore(unsigned int alloc_bytes) > { > unsigned int map_bytes; > > OK > > reasonable (BSD-specific snippets for signal handling) > > I looked at erts/emulator/hipe/hipe_x86_signal.c again and I have one > question: INIT is defined inside #ifdef...#endif but used without any > #ifdef..#endif check. Why? Without > > > @@ -326,7 +327,9 @@ > struct sigaction sa; > int i; > > +#ifndef __NetBSD__ > INIT(); > +#endif > > hipe_sigaltstack_init(); > > > I get an error like this > > > obj/i386-unknown-netbsdelf5.99.30/opt/smp/hipe_x86_signal.o: In function > `hipe_signal_init': > hipe_x86_signal.c:(.text+0x9): undefined reference to `INIT' That's because the target in question should have selected one of the #if .. #endif sections for its sigaction() wrapper implementation, which would also define the INIT() macro. By not selecting any such section you don't get an INIT() macro definition, but you also don't get any sigaction() wrapper, which is the whole point of this file. The sigaction() wrapper to enforce SA_ONSTACK is required on x86/amd64. If a port to a target omits it then that port is unsafe and unsupported. > > to questionable (why do you patch the BEAM code generator?). > > I assume you are talking about the now-removed patch-ah > (http://pkgsrc-wip.cvs.sourceforge.net/viewvc/pkgsrc-wip/wip/erlang/patches/patch-ah?revision=1.3) which was > > --- lib/compiler/src/v3_codegen.erl.orig 2010-06-11 18:30:11.000000000 > +0300 > +++ lib/compiler/src/v3_codegen.erl 2010-06-17 10:19:44.000000000 +0300 > @@ -1520,6 +1520,8 @@ > Sizes = filter(fun({_,{integer,0}}) -> false; > (_) -> true end, Sizes0), > case Sizes of > + [] -> > + {bs_init2,[{integer,0}]}; > [{1,_}|_] -> > {bs_init_bits,cg_binary_bytes_to_bits(Sizes, [])}; > [{8,_}|_] -> > > > I've removed this now. I was. Maybe it is a good change, but we need the original author's comments about it and a review by the BEAM compiler folks. And it's not a HiPE patch so it should be handled separately. From martti.kuparinen@REDACTED Thu Jun 24 12:49:52 2010 From: martti.kuparinen@REDACTED (Martti Kuparinen) Date: Thu, 24 Jun 2010 13:49:52 +0300 Subject: Possible BEAM compiler patch Message-ID: <1277376592.3640.12.camel@tri10.nomadiclab.com> Hi, The NetBSD pkgsrc has this patch (pkgsrc/lang/erlang/patches/patch-ah) --- lib/compiler/src/v3_codegen.erl.orig 2008-02-05 08:37:35.000000000 -0 500 +++ lib/compiler/src/v3_codegen.erl @@ -1481,6 +1481,8 @@ cg_binary_size_1([], Bits, Acc) -> Sizes = filter(fun({_,{integer,0}}) -> false; (_) -> true end, Sizes0), case Sizes of + [] -> + {bs_init2,[{integer,0}]}; [{1,_}|_] -> {bs_init_bits,cg_binary_bytes_to_bits(Sizes, [])}; [{8,_}|_] -> but I don't know it that makes any sense or not. Could someone from the compiler team look at this and say if I should nuke this or submit a proper patch request so it can be included in the pu branch... Martti From gliptak@REDACTED Sat Jun 26 17:03:04 2010 From: gliptak@REDACTED (=?ISO-8859-1?B?R+Fib3IgTGlwdOFr?=) Date: Sat, 26 Jun 2010 11:03:04 -0400 Subject: [erlang-patches] What's cooking in erlang/otp (2010-06-11) In-Reply-To: <20100611134202.9660311D0@fingolfin.du.uab.ericsson.se> References: <20100611134202.9660311D0@fingolfin.du.uab.ericsson.se> Message-ID: A patch for this is available here: git fetch git://github.com/gliptak/otp.git Templatize generation of pom.xml http://github.com/gliptak/otp/commit/642a0ce6ecc1fd366ccc3a55c80c1dd97762b864 Branch jinterface On Fri, Jun 11, 2010 at 09:13, Raimo Niskanen wrote: > * gl/jinterface-pom (jinterface, otp) (2010-02-15) 2 commits > ?- Exclude jinterface build artifact from git (5acf5fa) > ?- Add pom.xml for jinterface build (aa68190) > > The pom.xml file should be generated by the toplevel Makefile > since it contains the version number of Jinterface. This is > along the same line as the .app files are generated. > There should be a pom.xml.src that Makefile sed's into > pom.xml. See stdlib/src/Makefile. > > Action expected from: Topic author From pguyot@REDACTED Sun Jun 27 16:42:56 2010 From: pguyot@REDACTED (Paul Guyot) Date: Sun, 27 Jun 2010 16:42:56 +0200 Subject: Patch to fix hipe crash when calling a module with on_load Message-ID: <8ED0AD1A-6799-43CD-A485-F96F5636D683@kallisys.net> Hello, Here is a patch with a test case for the hipe crash bug when calling functions to a module with on_load : git fetch git://github.com/pguyot/otp.git pg/hipe_crash_with_on_load Regards, Paul -- Semiocast http://semiocast.com/ +33.175000290 - 62 bis rue Gay-Lussac, 75005 Paris From raimo+erlang-patches@REDACTED Mon Jun 28 12:25:45 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Mon, 28 Jun 2010 12:25:45 +0200 Subject: [erlang-patches] NetBSD support for Erlang R14A In-Reply-To: <1277380678.3640.19.camel@tri10.nomadiclab.com> References: <1277198912.2087.65.camel@tri10.nomadiclab.com> <20100622135809.GA32238@erix.ericsson.se> <20100622140332.GA1396@erix.ericsson.se> <1277380678.3640.19.camel@tri10.nomadiclab.com> Message-ID: <20100628102545.GA8595@erix.ericsson.se> On Thu, Jun 24, 2010 at 02:57:58PM +0300, Martti Kuparinen wrote: > On Tue, 2010-06-22 at 16:03 +0200, Raimo Niskanen wrote: > > > > > http://github.com/marttikuparinen/otp > > > > Found it; 'master'. The correct fetch command was: > > As I'm still learning git, I'd like to remove my repository and start > over. I assume there's no problem as you already copied the mods to the > official repository? No problem. Except if I loose them or they need tweaking I would rather start over from your upcoming started over branch so there is someone that maintains the original patch request. > > Martti -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-patches@REDACTED Mon Jun 28 13:57:58 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Mon, 28 Jun 2010 13:57:58 +0200 Subject: [erlang-patches] What's cooking in erlang/otp (2010-06-11) In-Reply-To: References: <20100611134202.9660311D0@fingolfin.du.uab.ericsson.se> Message-ID: <20100628115758.GB8595@erix.ericsson.se> On Sat, Jun 26, 2010 at 11:03:04AM -0400, G?bor Lipt?k wrote: > A patch for this is available here: > > git fetch git://github.com/gliptak/otp.git > > Templatize generation of pom.xml > > http://github.com/gliptak/otp/commit/642a0ce6ecc1fd366ccc3a55c80c1dd97762b864 > > Branch jinterface Excellent. Next time, base your patch on 'dev', not 'pu', or on your old patch merged into 'pu'. I can not rebuild 'pu' on top of 'pu'... I have done the rebase, removed the commit with the incorrect change to .gitignore and squashed the remaining. We'll see if you recognize your changes :-) It will appear in 'pu' shortly as 165fbca9bd40e1dc1720f18b6303e250df7ab1de i.e URL to be: http://github.com/erlang/otp/commit/165fbca9bd40e1dc1720f18b6303e250df7ab1de > > On Fri, Jun 11, 2010 at 09:13, Raimo Niskanen > wrote: > > * gl/jinterface-pom (jinterface, otp) (2010-02-15) 2 commits > > ?- Exclude jinterface build artifact from git (5acf5fa) > > ?- Add pom.xml for jinterface build (aa68190) > > > > The pom.xml file should be generated by the toplevel Makefile > > since it contains the version number of Jinterface. This is > > along the same line as the .app files are generated. > > There should be a pom.xml.src that Makefile sed's into > > pom.xml. See stdlib/src/Makefile. > > > > Action expected from: Topic author > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-patches@REDACTED Mon Jun 28 14:09:44 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Mon, 28 Jun 2010 14:09:44 +0200 Subject: [erlang-patches] Patch to fix hipe crash when calling a module with on_load In-Reply-To: <8ED0AD1A-6799-43CD-A485-F96F5636D683@kallisys.net> References: <8ED0AD1A-6799-43CD-A485-F96F5636D683@kallisys.net> Message-ID: <20100628120944.GC8595@erix.ericsson.se> On Sun, Jun 27, 2010 at 04:42:56PM +0200, Paul Guyot wrote: > Hello, > > Here is a patch with a test case for the hipe crash bug when calling functions to a module with on_load : > > git fetch git://github.com/pguyot/otp.git pg/hipe_crash_with_on_load Thank you! It will be included in 'pu'. > > Regards, > > Paul > -- > Semiocast http://semiocast.com/ > +33.175000290 - 62 bis rue Gay-Lussac, 75005 Paris > > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-patches@REDACTED Mon Jun 28 13:33:39 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Mon Jun 28 13:33:39 2010 Subject: What's cooking in erlang/otp (2010-06-28) Message-ID: <20100628135424.A53DF114C@fingolfin.du.uab.ericsson.se> This issue of "What's cooking" is a weekend late due to midsummer holiday. Sorry about that. R14A was released as planned. We are now developing towards the R14B release. The 'dev' branch has just got updated version numbers, but more is to come... ------------------------------------------------------------ [Graduated] * egil/update-system-vsn (erts, kernel, stdlib) (2010-06-17) 1 commit + Update Erlang system version to R14B (1e3f585) ------------------------------------------------------------ [New topics] * mk/net-dragonfly-bsd-patches (asn1, common_test, erl_interface, erts, et, gs, mnesia, odbc, reltool, runtime_tools, test_server, wx) (2010-06-23) 7 commits - Remove unused variables (dab5af5) - Do not hardcode browser name (82dcc82) - Make sure the odbcserver binary finds the ODBC library at run-time (c86dff5) - Use xxx(void) instead of xxx() (7142d52) - Use proper install method (5314ae6) - Add support for DragonFly BSD (03baa22) - Add support for NetBSD (6b72959) * pg/beam_lib_cmp_2_return_type_specification (stdlib) (2010-06-17) 1 commit - Fix beam_lib:cmp/2 return type specification (8dad90e) * pg/hipe_crash_with_on_load (erts) (2010-06-27) 1 commit - Fix crash when calling functions in a module with an on_load attribute from a native module (495804b) * rani/sctp-udp-recv-error (erts) (2010-06-21) 1 commit - Fix inet_drv to detect passive mode UDP errors for SCTP builds (5615d7a) * sd/epmd-stop-cli (erts) (2010-06-16) 2 commits - fix typo (101b731) - allow epmd -stop name to unregister a client from epmd (b070575) * ta/filetypo (kernel) (2010-06-11) 1 commit - Correct trivial typos in file manual (6973f77) ------------------------------------------------------------ [Stalled] * bg/safer-local_to_univ (erts) (2010-02-11) 1 commit - erl_time_sup.c: test for error return from mktime() (0f62f0b) We will not include this branch in R13B04 for two reasons: o We are not 100% sure that this change is harmless on all platforms in all timezones. o We have a better solution for the underlying problem in the pipeline soon to surface in 'dev'. Action expected from: OTP Team * db/tv_nthtail_fix (tv) (2009-12-01) 1 commit - Fix for tv which restarts while trying to open a table (28f1e36) Since our long-term goal is to migrate from gs towards wx, maintaining the old gs applications has a low priority for the Erlang/OTP team. Therefore, we will accept patches that seem sound, but we are unlikely to spend much of our own time fixing bugs. The author of this topic branch has found the real reason for the problem, but uncovered additional issues. Action expected from: The topic author - to decide whether to include the topic branch (which is a workaround, but does eliminate the crash) or to wait for a better fix from himself or someone else with an interest to advance the topic. * er/ei-decode_msg (erl_interface) (2010-03-11) 1 commit - Add function to decode distribution header (864091a) Needs documentation and test cases. Action expected from: Topic author * jp/dependencies_makefile (compiler, erts) (2010-02-14) 3 commits - squash! eliminate dialyzer warning (434e2ca) - squash! fix snprintf for Windows (bf2708d) - Add dependencies Makefile generation to erlc(1) and compile(3) (7cbc437) Approved in principle by the OTP Technical Board; now awaits a closer review of the implementation. Action expected from: Bj??rn Gustavsson (the reviewer) * kr/gs-browser (gs) (2010-02-10) 1 commit - Change lib/gs/src/tool_utils.erl to select multiple browsers other than Netscape (802d159) This topic branch introduces a new call to the deprecated regexp module. Action expected from: Topic author or anyone else with an interest to advance the topic ------------------------------------------------------------ [Cooking] * bg/temp-hipe-fixes (compiler, hipe, kernel) (2010-03-15) 6 commits - Avoid crash by skipping compilation_SUITE:on_load/1 (234e13e) - Inline less aggressively for native-code compilation (9fcb48b) - Crudely fix return type for the lists:key{search,find,member}/3 (ef71597) - seq_trace_SUITE: Don't native-compile (2a81b1a) - Disable native code if on_load is used (3befa76) - andor_SUITE: Don't native-compile (97aa2da) This branch contains temporary workarounds to avoid failing test cases and is never intended to graduate. * cf/timer_tc (stdlib) (2010-04-06) 1 commit - Add timer:tc/2 to measure the elapsed time of anonymous functions (2cca650) * jf/run_erl-disable-flow-control (erts) (2010-03-05) 1 commit - Teach run_erl RUN_ERL_DISABLE_FLOWCNTRL for disabling flow control (d0775cd) * jn/gen_stream (stdlib) (2010-05-17) 1 commit - Add new gen_stream behaviour for efficiently consuming serial streams (65f3db8) . Add new gen_stream behaviour for efficiently consuming serial streams (65f3db8) This topic branch has failing test cases. shell_SUITE:start_restricted_from_shell; We have now tested with and without this topic branch and when it is present that test case fails. We consider it proved to be guilty. The test case does not fail when run standalone so it seems to be tricky... Also, some of its own test cases fail sporadicly apparently since the assumption there shoul be no more processes after the test case does not hold; probably a timing issue. Action expected from: Topic author. * jr/cover-src-path (tools) (2010-04-23) 1 commit - Fix searching for source files in analyse_to_file/* (b9d5068) * ks/auth-specs (kernel) (2010-06-09) 1 commit - auth: Fix types and specs (1c51135) * ks/cleanups (compiler, debugger, docbuilder, stdlib) (2010-04-10) 4 commits - compiler: Fix incorrect types and specs (8e79baa) - escript: Add more types to records (f2a2139) - debugger: Clean up as suggested by tidier (9e962d7) - docbuilder: Clean up as suggested by tidier (3647def) Was formerly called ks/cleanups-after-r13b04. * pg/honor-start-type-in-rel-files (sasl) (2010-06-06) 1 commit - Honor start type in .rel files when building relup files (7599900) . Honor start type in .rel files when building relup files (7f0192d) * sb/make-files-like-erlc (tools) (2010-05-18) 1 commit - Change make:files to behave more like erlc (5e9d051) * se/http_response_empty_phrase (erts) (2010-06-10) 1 commit - {packet,http} allow empty response phrase (288f54c) * sf/erts_de_busy_limit (erts) (2010-06-08) 1 commit - Add flag-based setting for 'erts_de_busy_limit' constant (57c0eaf) . Add flag-based setting for 'erts_de_busy_limit' constant (b584553) * ta/asn1-reporting (asn1) (2010-04-23) 1 commit - asn1ct: Make formatting of errors and warnings consistent (93face2) * uw/epmd-fullnames (kernel) (2010-05-07) 1 commit - Allow the erlang nodename host part to differ from the hostname (e0774be) * gl/jinterface-pom (jinterface, otp) (2010-02-08) 1 commit - Generate pom.xml during jinterface build (165fbca) ------------------------------------------------------------ [Dropped] * hb/edoc (edoc) (2010-04-01) 1 commit . EDoc and Dialyzer specs and types (516e16c) Temporarily dropped. Will be fixed to use updated dialyzer. * pg/xmerl_scan_hex_entities (xmerl) (2010-06-07) 1 commit . Fix decoding of hex entities (&#xXXXX;) in xmerl_scan (36448fc) The bug it fixes is recognized, but the fix in the branch is not complete... The test case is in our internal 'dev' branch but the test suites are not released yet due to remaining copyright issues. We will fix the bug in a future release. From aronisstav@REDACTED Tue Jun 29 17:33:54 2010 From: aronisstav@REDACTED (Stavros Aronis) Date: Tue, 29 Jun 2010 18:33:54 +0300 Subject: Callback attribute for better definition of behaviour callbacks. Message-ID: Hi! On March the following thread appeared in the erlang-questions list: http://www.erlang.org/cgi-bin/ezmlm-cgi?4:sss:50104:201003:hbmaknhcnnhjngliogof In that thread there was discussion about how the current idiom to define a behaviour lacks specific information about what the callbacks are supposed to do. The proposal was to somehow use '-spec' attributes in order to provide better information about the type of the arguments that each callback function requires and its result. This patch implements this using a new attribute: '-callback'. The reason why the already existent '-spec' keyword can't be used is that lint checks are performed to ensure that specs exist only for functions defined in the module where the spec is defined. This is not what a callback function requires, as it's going to be defined in another module. These '-callback' attributes can then be used to automatically generate the usual 'behaviour_info(callbacks)' export, required by the compiler to confirm that a module that implements a behaviour exports all the required callbacks. The patch can be obtained with: git fetch git://github.com/aronisstav/otp.git callback-attr Included in this patch are: - updates in the syntax of Erlang (erl_parse.yrl) to allow the new attribute with a form similar to that of the already familiar '-specs' - updates in the lint (erl_lint) to ensure that no duplicates are defined and no behaviour_info/1 function is defined as it will be automatically generated and exported - updates in the stdlib's, kernel's and inet's behaviours to use the new syntax. The type information I've added is based on current published documentation and comments in the files so it might be incorrect and should be double-checked by someone who has more experience in the actual usage of these behaviours than me. - updates to the bootstrap files Future additions: - Dialyzer can use such attributes to find errors in the inferred callback function types. (I've already implemented this but it's a different thing so I'm gonna make a separate request for it) - Documentation tools can use these attributes instead of comments to specify the types of the arguments and the result of callback functions. As this is my first patch, any feedback is gratefully accepted! Stavros Aronis From raimo+erlang-patches@REDACTED Wed Jun 30 12:23:56 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Wed, 30 Jun 2010 12:23:56 +0200 Subject: [erlang-patches] Callback attribute for better definition of behaviour callbacks. In-Reply-To: References: Message-ID: <20100630102356.GA5480@erix.ericsson.se> Two issues: 1) Your first commit (05ac0898ead518c92cd884bdbd2ffa78877f050b) adds a file bootstrap/lib/stdlib/egenerl_parse.erl but there is already a generated file bootstrap/lib/stdlib/egen/erl_parse.erl, which makes me suspect you slipped on the keybord on this commit... Is that so? 2) All your commit taglines has a trailing dot, which we prefer not to have, and if you are fixing the first commit, it is a good opportunity to take care of this too... On Tue, Jun 29, 2010 at 06:33:54PM +0300, Stavros Aronis wrote: > Hi! > > On March the following thread appeared in the erlang-questions list: > > http://www.erlang.org/cgi-bin/ezmlm-cgi?4:sss:50104:201003:hbmaknhcnnhjngliogof > > In that thread there was discussion about how the current idiom to define a > behaviour lacks specific information about what the callbacks are supposed > to do. The proposal was to somehow use '-spec' attributes in order to > provide better information about the type of the arguments that each > callback function requires and its result. This patch implements this using > a new attribute: '-callback'. > > The reason why the already existent '-spec' keyword can't be used is that > lint checks are performed to ensure that specs exist only for functions > defined in the module where the spec is defined. This is not what a callback > function requires, as it's going to be defined in another module. > > These '-callback' attributes can then be used to automatically generate the > usual 'behaviour_info(callbacks)' export, required by the compiler to > confirm that a module that implements a behaviour exports all the required > callbacks. > > The patch can be obtained with: > > git fetch git://github.com/aronisstav/otp.git callback-attr > > Included in this patch are: > > - updates in the syntax of Erlang (erl_parse.yrl) to allow the new attribute > with a form similar to that of the already familiar '-specs' > - updates in the lint (erl_lint) to ensure that no duplicates are defined > and no behaviour_info/1 function is defined as it will be automatically > generated and exported > - updates in the stdlib's, kernel's and inet's behaviours to use the new > syntax. The type information I've added is based on current published > documentation and comments in the files so it might be incorrect > and should be double-checked by someone who has more experience in the > actual usage of these behaviours than me. > - updates to the bootstrap files > > Future additions: > > - Dialyzer can use such attributes to find errors in the inferred callback > function types. (I've already implemented this but it's a different thing so > I'm gonna make a separate request for it) > - Documentation tools can use these attributes instead of comments to > specify the types of the arguments and the result of callback functions. > > As this is my first patch, any feedback is gratefully accepted! > > Stavros Aronis -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From aronisstav@REDACTED Wed Jun 30 14:13:09 2010 From: aronisstav@REDACTED (Stavros Aronis) Date: Wed, 30 Jun 2010 15:13:09 +0300 Subject: [erlang-patches] Callback attribute for better definition of behaviour callbacks. In-Reply-To: <20100630102356.GA5480@erix.ericsson.se> References: <20100630102356.GA5480@erix.ericsson.se> Message-ID: Thanks for pointing these out! I've addressed the two issues mentioned and updated the patch. On Wed, Jun 30, 2010 at 1:23 PM, Raimo Niskanen < raimo+erlang-patches@REDACTED > wrote: > Two issues: > > 1) Your first commit (05ac0898ead518c92cd884bdbd2ffa78877f050b) adds a file > bootstrap/lib/stdlib/egenerl_parse.erl but there is already a generated > file bootstrap/lib/stdlib/egen/erl_parse.erl, which makes me suspect > you slipped on the keybord on this commit... Is that so? > 2) All your commit taglines has a trailing dot, which we prefer not to > have, and if you are fixing the first commit, it is a good opportunity > to take care of this too... > > On Tue, Jun 29, 2010 at 06:33:54PM +0300, Stavros Aronis wrote: > > Hi! > > > > On March the following thread appeared in the erlang-questions list: > > > > > http://www.erlang.org/cgi-bin/ezmlm-cgi?4:sss:50104:201003:hbmaknhcnnhjngliogof > > > > In that thread there was discussion about how the current idiom to define > a > > behaviour lacks specific information about what the callbacks are > supposed > > to do. The proposal was to somehow use '-spec' attributes in order to > > provide better information about the type of the arguments that each > > callback function requires and its result. This patch implements this > using > > a new attribute: '-callback'. > > > > The reason why the already existent '-spec' keyword can't be used is that > > lint checks are performed to ensure that specs exist only for functions > > defined in the module where the spec is defined. This is not what a > callback > > function requires, as it's going to be defined in another module. > > > > These '-callback' attributes can then be used to automatically generate > the > > usual 'behaviour_info(callbacks)' export, required by the compiler to > > confirm that a module that implements a behaviour exports all the > required > > callbacks. > > > > The patch can be obtained with: > > > > git fetch git://github.com/aronisstav/otp.git callback-attr > > > > Included in this patch are: > > > > - updates in the syntax of Erlang (erl_parse.yrl) to allow the new > attribute > > with a form similar to that of the already familiar '-specs' > > - updates in the lint (erl_lint) to ensure that no duplicates are defined > > and no behaviour_info/1 function is defined as it will be automatically > > generated and exported > > - updates in the stdlib's, kernel's and inet's behaviours to use the new > > syntax. The type information I've added is based on current published > > documentation and comments in the files so it might be incorrect > > and should be double-checked by someone who has more experience in the > > actual usage of these behaviours than me. > > - updates to the bootstrap files > > > > Future additions: > > > > - Dialyzer can use such attributes to find errors in the inferred > callback > > function types. (I've already implemented this but it's a different thing > so > > I'm gonna make a separate request for it) > > - Documentation tools can use these attributes instead of comments to > > specify the types of the arguments and the result of callback functions. > > > > As this is my first patch, any feedback is gratefully accepted! > > > > Stavros Aronis > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > From mikpe@REDACTED Wed Jun 30 14:31:04 2010 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 30 Jun 2010 14:31:04 +0200 Subject: fix native code crash when calling unloaded module with on_load function Message-ID: <19499.14600.813671.501500@pilspetsen.it.uu.se> As reported in erlang-bugs, the following sequence of events crashes the VM: 1. Module M1 is loaded and in native mode. 2. Module M2 is not loaded, in emulated mode, and has an on_load function. 3. M1 calls some function in M2. This works. 4. M1 again calls some function in M2. This segfaults. The reason for the crash is that when the beam loader fixes up export entries after a successful on_load function call, it erroneously clears the ->code[3] field in that module's export entries. This is redundant (no code in beam relies on ->code[3] being NULL), inconsistent with modules without on_load functions (there ->code[3] remains a valid beam instruction after the module is loaded), and breaks native code which needs the old ->address value in an export entry to remain valid after a module load step (before the load ->address points to ->code[3], after the load ->address points to the real code but uses of the old ->address value remain so ->code[3] must remain valid). Thus the fix for the crash is to simply not clear ->code[3]. This patch fixes R14A and should also fix R13B04. (There does exist a performance bug in this area, but it is unrelated to the on_load feature so will be fixed separately.) /Mikael Pettersson, HiPE --- otp_src_R14A/erts/emulator/beam/beam_bif_load.c.~1~ 2010-06-11 17:30:16.000000000 +0200 +++ otp_src_R14A/erts/emulator/beam/beam_bif_load.c 2010-06-30 13:17:03.000000000 +0200 @@ -337,7 +337,6 @@ BIF_RETTYPE finish_after_on_load_2(BIF_A ep->code[0] == BIF_ARG_1 && ep->code[4] != 0) { ep->address = (void *) ep->code[4]; - ep->code[3] = 0; ep->code[4] = 0; } } From pguyot@REDACTED Wed Jun 30 15:02:27 2010 From: pguyot@REDACTED (Paul Guyot) Date: Wed, 30 Jun 2010 15:02:27 +0200 Subject: fix native code crash when calling unloaded module with on_load function In-Reply-To: <19499.14600.813671.501500@pilspetsen.it.uu.se> References: <19499.14600.813671.501500@pilspetsen.it.uu.se> Message-ID: <804B40A0-0E09-441B-A03E-E4A30A62FAC9@kallisys.net> Le 30 juin 2010 ? 14:31, Mikael Pettersson a ?crit : > As reported in erlang-bugs, the following sequence of events crashes the VM: > > 1. Module M1 is loaded and in native mode. > 2. Module M2 is not loaded, in emulated mode, and has an on_load function. > 3. M1 calls some function in M2. This works. > 4. M1 again calls some function in M2. This segfaults. > > The reason for the crash is that when the beam loader fixes up export > entries after a successful on_load function call, it erroneously clears > the ->code[3] field in that module's export entries. This is redundant > (no code in beam relies on ->code[3] being NULL), inconsistent with > modules without on_load functions (there ->code[3] remains a valid beam > instruction after the module is loaded), and breaks native code which needs > the old ->address value in an export entry to remain valid after a module > load step (before the load ->address points to ->code[3], after the load > ->address points to the real code but uses of the old ->address value > remain so ->code[3] must remain valid). > > Thus the fix for the crash is to simply not clear ->code[3]. > This patch fixes R14A and should also fix R13B04. > > (There does exist a performance bug in this area, but it is unrelated > to the on_load feature so will be fixed separately.) Hello Mikael, Did you have a chance to check the patch I submitted to erlang-patch and which is available here: http://github.com/pguyot/otp/commit/495804b097aea4015e218d7b5da8d1372395580c My impression is that if we do not clear ep->code[3], this still points to call_error_handler. Instead of not clearing the value and relying to its initial assignation, I replaced the beam instruction to call_error_handler with a new beam instruction (call_from_hipe_stub) that simply jumps to the function. > --- otp_src_R14A/erts/emulator/beam/beam_bif_load.c.~1~ 2010-06-11 17:30:16.000000000 +0200 > +++ otp_src_R14A/erts/emulator/beam/beam_bif_load.c 2010-06-30 13:17:03.000000000 +0200 > @@ -337,7 +337,6 @@ BIF_RETTYPE finish_after_on_load_2(BIF_A > ep->code[0] == BIF_ARG_1 && > ep->code[4] != 0) { > ep->address = (void *) ep->code[4]; > - ep->code[3] = 0; > ep->code[4] = 0; > } > } Regards, Paul -- Semiocast http://semiocast.com/ +33.175000290 - 62 bis rue Gay-Lussac, 75005 Paris From mikpe@REDACTED Wed Jun 30 15:24:22 2010 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 30 Jun 2010 15:24:22 +0200 Subject: fix native code crash when calling unloaded module with on_load function In-Reply-To: <804B40A0-0E09-441B-A03E-E4A30A62FAC9@kallisys.net> References: <19499.14600.813671.501500@pilspetsen.it.uu.se> <804B40A0-0E09-441B-A03E-E4A30A62FAC9@kallisys.net> Message-ID: <19499.17798.449872.208717@pilspetsen.it.uu.se> Paul Guyot writes: > Le 30 juin 2010 ? 14:31, Mikael Pettersson a ?crit : > > > As reported in erlang-bugs, the following sequence of events crashes the VM: > > > > 1. Module M1 is loaded and in native mode. > > 2. Module M2 is not loaded, in emulated mode, and has an on_load function. > > 3. M1 calls some function in M2. This works. > > 4. M1 again calls some function in M2. This segfaults. > > > > The reason for the crash is that when the beam loader fixes up export > > entries after a successful on_load function call, it erroneously clears > > the ->code[3] field in that module's export entries. This is redundant > > (no code in beam relies on ->code[3] being NULL), inconsistent with > > modules without on_load functions (there ->code[3] remains a valid beam > > instruction after the module is loaded), and breaks native code which needs > > the old ->address value in an export entry to remain valid after a module > > load step (before the load ->address points to ->code[3], after the load > > ->address points to the real code but uses of the old ->address value > > remain so ->code[3] must remain valid). > > > > Thus the fix for the crash is to simply not clear ->code[3]. > > This patch fixes R14A and should also fix R13B04. > > > > (There does exist a performance bug in this area, but it is unrelated > > to the on_load feature so will be fixed separately.) > > Hello Mikael, > > Did you have a chance to check the patch I submitted to erlang-patch and which is available here: > > http://github.com/pguyot/otp/commit/495804b097aea4015e218d7b5da8d1372395580c I did. It's way overkill for this specific bug. > My impression is that if we do not clear ep->code[3], this still points to call_error_handler. Instead of not clearing the value and relying to its initial assignation, I replaced the beam instruction to call_error_handler with a new beam instruction (call_from_hipe_stub) that simply jumps to the function. Your impression is correct, but it's not necessary to invent a new BEAM instruction to solve the on_load crash bug. Your approach is more related to my comment: > > (There does exist a performance bug in this area, but it is unrelated > > to the on_load feature so will be fixed separately.) But the performance bug exists whether or not on_load is used. And the solution I have in mind is very different from yours'. /Mikael From raimo+erlang-patches@REDACTED Wed Jun 30 16:29:18 2010 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Wed, 30 Jun 2010 16:29:18 +0200 Subject: [erlang-patches] Callback attribute for better definition of behaviour callbacks. In-Reply-To: References: <20100630102356.GA5480@erix.ericsson.se> Message-ID: <20100630142918.GA11962@erix.ericsson.se> On Wed, Jun 30, 2010 at 03:13:09PM +0300, Stavros Aronis wrote: > Thanks for pointing these out! > > I've addressed the two issues mentioned and updated the patch. > > On Wed, Jun 30, 2010 at 1:23 PM, Raimo Niskanen < > raimo+erlang-patches@REDACTED > > wrote: : : > > On Tue, Jun 29, 2010 at 06:33:54PM +0300, Stavros Aronis wrote: > > > Hi! : : : > > > The patch can be obtained with: > > > > > > git fetch git://github.com/aronisstav/otp.git callback-attr Thank you! It will be included in 'pu'. -- / Raimo Niskanen, Erlang/OTP, Ericsson AB