From txrev319@REDACTED Tue Apr 1 00:31:56 2014 From: txrev319@REDACTED (t x) Date: Mon, 31 Mar 2014 15:31:56 -0700 Subject: [erlang-questions] erlang.mk, relx, multiple apps, directory structure Message-ID: Hi, Can someone please point me to a git hub repo that: 1) uses erlang.mk + relx 2) has multiple apps 3) is an example of directory structure I should copy? Thanks! Problem: I'm starting to need to refactor my code, and I want to know what an idiomatic multiple-app directory structure looks like. From txrev319@REDACTED Tue Apr 1 00:35:41 2014 From: txrev319@REDACTED (t x) Date: Mon, 31 Mar 2014 15:35:41 -0700 Subject: [erlang-questions] erlang.mk, relx, multiple apps, directory structure In-Reply-To: References: Message-ID: To avoid the X-Y problem: I'm not particular attached to erlang.mk + relx. I just want a set of tools for "how do I design the directory structure of a multiple-app erlang program." On Mon, Mar 31, 2014 at 3:31 PM, t x wrote: > Hi, > > Can someone please point me to a git hub repo that: > > 1) uses erlang.mk + relx > > 2) has multiple apps > > 3) is an example of directory structure I should copy? > > Thanks! > > Problem: I'm starting to need to refactor my code, and I want to know > what an idiomatic multiple-app directory structure looks like. From essen@REDACTED Tue Apr 1 00:48:02 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 01 Apr 2014 00:48:02 +0200 Subject: [erlang-questions] erlang.mk, relx, multiple apps, directory structure In-Reply-To: References: Message-ID: <5339F0A2.2080305@ninenines.eu> I answered on IRC and am resaying it here for future reference. This is the method that RJ uses for IRCCloud and the one I bookmarked: https://gist.github.com/RJ/6977165 I understand it works very well, but as I do not use multi-apps repositories I do not have any interesting feedback to give. On 04/01/2014 12:31 AM, t x wrote: > Hi, > > Can someone please point me to a git hub repo that: > > 1) uses erlang.mk + relx > > 2) has multiple apps > > 3) is an example of directory structure I should copy? > > Thanks! > > Problem: I'm starting to need to refactor my code, and I want to know > what an idiomatic multiple-app directory structure looks like. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From a.shneyderman@REDACTED Tue Apr 1 01:08:47 2014 From: a.shneyderman@REDACTED (Alex Shneyderman) Date: Mon, 31 Mar 2014 19:08:47 -0400 Subject: [erlang-questions] erlang.mk, relx, multiple apps, directory structure In-Reply-To: References: Message-ID: https://github.com/rustyio/BashoBanjo https://github.com/sylane/erod both use rebar and multi-app setup. The problem that you are bound to run into with this setup is the long list of inter-dependent apps. The exact list of the apps becomes important as the ones that do not depend on anything should percolate to the top and the neediest apps should be at the bottom. It is possible to come up with a similar structure for erlang.mk + relx. But you'd have to do a lot of gnu make hacking before it works (for example, the link that Loic posted sidelines the problem of inter-dependent apps all-together, I believe; there is a lot more than meets the eye). Another problem is some dependencies are built with rebar, so some funky versioning schemes that rebar supports and pre and post hooks make it hard to live without rebar - erlang.mk can call rebar but still you will need rebar for those particular deps. On Mon, Mar 31, 2014 at 6:35 PM, t x wrote: > To avoid the X-Y problem: I'm not particular attached to erlang.mk + relx. > > I just want a set of tools for "how do I design the directory > structure of a multiple-app erlang program." > > On Mon, Mar 31, 2014 at 3:31 PM, t x wrote: >> Hi, >> >> Can someone please point me to a git hub repo that: >> >> 1) uses erlang.mk + relx >> >> 2) has multiple apps >> >> 3) is an example of directory structure I should copy? >> >> Thanks! >> >> Problem: I'm starting to need to refactor my code, and I want to know >> what an idiomatic multiple-app directory structure looks like. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From steve@REDACTED Tue Apr 1 08:20:45 2014 From: steve@REDACTED (Steve Strong) Date: Tue, 1 Apr 2014 08:20:45 +0200 Subject: [erlang-questions] erlang.mk, relx, multiple apps, directory structure In-Reply-To: References: Message-ID: <61BC3DFCBCA44829A0F34D87300BD05B@srstrong.com> Feel free to take a look at https://github.com/id3as/erl-mk - it?s a work-in-progress, but we are using it on a couple of projects? Cheers, Steve -- Steve Strong Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Tuesday, 1 April 2014 at 01:08, Alex Shneyderman wrote: > https://github.com/rustyio/BashoBanjo > https://github.com/sylane/erod > > both use rebar and multi-app setup. The problem that you are bound to > run into with this setup is the long list of inter-dependent apps. The > exact list of the apps becomes important as the ones that do not > depend on anything should percolate to the top and the neediest apps > should be at the bottom. > > It is possible to come up with a similar structure for erlang.mk + > relx. But you'd have to do a lot of gnu make hacking before it works > (for example, the link that Loic posted sidelines the problem of > inter-dependent apps all-together, I believe; there is a lot more than > meets the eye). Another problem is some dependencies are built with > rebar, so some funky versioning schemes that rebar supports and pre > and post hooks make it hard to live without rebar - erlang.mk can call > rebar but still you will need rebar for those particular deps. > > > On Mon, Mar 31, 2014 at 6:35 PM, t x wrote: > > To avoid the X-Y problem: I'm not particular attached to erlang.mk + relx. > > > > I just want a set of tools for "how do I design the directory > > structure of a multiple-app erlang program." > > > > On Mon, Mar 31, 2014 at 3:31 PM, t x wrote: > > > Hi, > > > > > > Can someone please point me to a git hub repo that: > > > > > > 1) uses erlang.mk + relx > > > > > > 2) has multiple apps > > > > > > 3) is an example of directory structure I should copy? > > > > > > Thanks! > > > > > > Problem: I'm starting to need to refactor my code, and I want to know > > > what an idiomatic multiple-app directory structure looks like. > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED (mailto:erlang-questions@REDACTED) > > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED (mailto:erlang-questions@REDACTED) > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Tue Apr 1 13:16:45 2014 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 1 Apr 2014 13:16:45 +0200 Subject: [erlang-questions] Problems with .app files Message-ID: This is a true story. Once upon a time in a far off land a programmer a put an Erlang .app file inside a .tar file and mailed it to another programmer. On arrival the .app file was missing and the mail contained the following *helpful* notice ----- FILE QUARANTINED Microsoft Forefront Protection for Exchange Server removed a file since it was found to match a filter. File name: "lttng_nif.tar->lttng/ebin/lttng.app" Filter name: "FILE FILTER= Filter_Delete: *.app" ---- The programmer who received the file, said "what the *****ing **** who the **** has **** ***' $$$*** ***$$$!!$$$ **** !!!!" and they all lived happily ever after /Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From txrev319@REDACTED Tue Apr 1 13:19:16 2014 From: txrev319@REDACTED (t x) Date: Tue, 1 Apr 2014 04:19:16 -0700 Subject: [erlang-questions] de-magic-fying of https://github.com/fycth/webrtcexample In-Reply-To: References: Message-ID: 1) I'm an idiot. :-) 2) This example uses both TURN and STUN, but neither via Erlang. See WebRTCO.js for details. On Mon, Mar 31, 2014 at 1:43 AM, t x wrote: > Hi, > > How does https://github.com/fycth/webrtcexample work? > > I've tested it with both webrtc clients behind a firewall (and thus > it should require TURN, not just STUN). Yet: > > * the two machines could talk to each other > > * it's not obvious to me where the embedded TURN server is in the above code > > How does the above work? > > * does it have a built in TURN server or > * does it actually not support TURN? > > Thanks! From n.oxyde@REDACTED Tue Apr 1 14:54:32 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 1 Apr 2014 14:54:32 +0200 Subject: [erlang-questions] Farewell to Erlang Message-ID: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> Hello everybody, Some of you might know me, some don?t, anyway it has been three years that I am contributing to Erlang and it has been a very exciting time for me. I have learnt a lot by fixing compiler bugs, messing with xmerl, the build system etc. Unfortunately, I feel like I have reached a point where I can not improve things anymore, because the community is too closed. For this reason I am now stopping all my Erlang contributions and will now become an Elixir hobbyist, as it?s where the future of the platform is. The future is homoiconic. Thanks for coping me with me all this time. Regards, -- Anthony Ramine From essen@REDACTED Tue Apr 1 14:55:40 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 01 Apr 2014 14:55:40 +0200 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> Message-ID: <533AB74C.10008@ninenines.eu> YES! He's gone! Party time! On 04/01/2014 02:54 PM, Anthony Ramine wrote: > Hello everybody, > > Some of you might know me, some don?t, anyway it has been three years that I am contributing to Erlang and it has been a very exciting time for me. I have learnt a lot by fixing compiler bugs, messing with xmerl, the build system etc. > > Unfortunately, I feel like I have reached a point where I can not improve things anymore, because the community is too closed. > > For this reason I am now stopping all my Erlang contributions and will now become an Elixir hobbyist, as it?s where the future of the platform is. The future is homoiconic. > > Thanks for coping me with me all this time. > > Regards, > -- Lo?c Hoguin http://ninenines.eu From mahesh@REDACTED Tue Apr 1 14:57:58 2014 From: mahesh@REDACTED (Mahesh Paolini-Subramanya) Date: Tue, 1 Apr 2014 08:57:58 -0400 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> Message-ID: Sigh. Bummed out. Sigh. Mahesh Paolini-Subramanya That tall bald Indian guy.. Google+? |?Blog?? |?Twitter? |?LinkedIn On April 1, 2014 at 8:54:46 AM, Anthony Ramine (n.oxyde@REDACTED) wrote: Hello everybody, Some of you might know me, some don?t, anyway it has been three years that I am contributing to Erlang and it has been a very exciting time for me. I have learnt a lot by fixing compiler bugs, messing with xmerl, the build system etc. Unfortunately, I feel like I have reached a point where I can not improve things anymore, because the community is too closed. For this reason I am now stopping all my Erlang contributions and will now become an Elixir hobbyist, as it?s where the future of the platform is. The future is homoiconic. Thanks for coping me with me all this time. Regards, -- Anthony Ramine _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From hq@REDACTED Tue Apr 1 15:00:59 2014 From: hq@REDACTED (Adam Rutkowski) Date: Tue, 1 Apr 2014 15:00:59 +0200 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> Message-ID: Anthony, Good! Your hostility was unacceptable anyway. You won't be missed. On Tue, Apr 1, 2014 at 2:57 PM, Mahesh Paolini-Subramanya < mahesh@REDACTED> wrote: > Sigh. > Bummed out. > Sigh. > > > * Mahesh Paolini-Subramanya > That > tall bald Indian guy.. * > * Google+ > | Blog | Twitter > | LinkedIn > * > > On April 1, 2014 at 8:54:46 AM, Anthony Ramine (n.oxyde@REDACTED) wrote: > > Hello everybody, > > Some of you might know me, some don't, anyway it has been three years that > I am contributing to Erlang and it has been a very exciting time for me. I > have learnt a lot by fixing compiler bugs, messing with xmerl, the build > system etc. > > Unfortunately, I feel like I have reached a point where I can not improve > things anymore, because the community is too closed. > > For this reason I am now stopping all my Erlang contributions and will now > become an Elixir hobbyist, as it's where the future of the platform is. The > future is homoiconic. > > Thanks for coping me with me all this time. > > Regards, > > -- > Anthony Ramine > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph@REDACTED Tue Apr 1 15:26:26 2014 From: ph@REDACTED (Pieter Hintjens) Date: Tue, 1 Apr 2014 15:26:26 +0200 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> Message-ID: Psych! It's still April 1st! On Tue, Apr 1, 2014 at 3:00 PM, Adam Rutkowski wrote: > Anthony, > > Good! Your hostility was unacceptable anyway. You won't be missed. > > > > On Tue, Apr 1, 2014 at 2:57 PM, Mahesh Paolini-Subramanya > wrote: >> >> Sigh. >> Bummed out. >> Sigh. >> >> Mahesh Paolini-Subramanya >> That tall bald Indian guy.. >> Google+ | Blog | Twitter | LinkedIn >> >> On April 1, 2014 at 8:54:46 AM, Anthony Ramine (n.oxyde@REDACTED) wrote: >> >> Hello everybody, >> >> Some of you might know me, some don't, anyway it has been three years that >> I am contributing to Erlang and it has been a very exciting time for me. I >> have learnt a lot by fixing compiler bugs, messing with xmerl, the build >> system etc. >> >> Unfortunately, I feel like I have reached a point where I can not improve >> things anymore, because the community is too closed. >> >> For this reason I am now stopping all my Erlang contributions and will now >> become an Elixir hobbyist, as it's where the future of the platform is. The >> future is homoiconic. >> >> Thanks for coping me with me all this time. >> >> Regards, >> >> -- >> Anthony Ramine >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From be.dmitry@REDACTED Tue Apr 1 15:30:56 2014 From: be.dmitry@REDACTED (Dmitry Belyaev) Date: Wed, 02 Apr 2014 00:30:56 +1100 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> Message-ID: Anthony! Your desire to help us all by fixing various problems in the compiler and virtual machine is great. And the contributions you have made are really valued. Thank you for all the time you have spent for the greater good! I hope you'll still contribute to the BEAM virtual machine even working on Elixir ;) -- Best wishes, Dmitry Belyaev On 1 April 2014 11:54:32 PM AEDT, Anthony Ramine wrote: >Hello everybody, > >Some of you might know me, some don?t, anyway it has been three years >that I am contributing to Erlang and it has been a very exciting time >for me. I have learnt a lot by fixing compiler bugs, messing with >xmerl, the build system etc. > >Unfortunately, I feel like I have reached a point where I can not >improve things anymore, because the community is too closed. > >For this reason I am now stopping all my Erlang contributions and will >now become an Elixir hobbyist, as it?s where the future of the platform >is. The future is homoiconic. > >Thanks for coping me with me all this time. > >Regards, > >-- >Anthony Ramine > >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From be.dmitry@REDACTED Tue Apr 1 15:32:52 2014 From: be.dmitry@REDACTED (Dmitry Belyaev) Date: Wed, 02 Apr 2014 00:32:52 +1100 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> Message-ID: Hmm, you may be right. I'm not sure though cause it's already 00:32 of 2nd here :P -- Best wishes, Dmitry Belyaev On 2 April 2014 12:26:26 AM AEDT, Pieter Hintjens wrote: >Psych! It's still April 1st! > >On Tue, Apr 1, 2014 at 3:00 PM, Adam Rutkowski wrote: >> Anthony, >> >> Good! Your hostility was unacceptable anyway. You won't be missed. >> >> >> >> On Tue, Apr 1, 2014 at 2:57 PM, Mahesh Paolini-Subramanya >> wrote: >>> >>> Sigh. >>> Bummed out. >>> Sigh. >>> >>> Mahesh Paolini-Subramanya >>> That tall bald Indian guy.. >>> Google+ | Blog | Twitter | LinkedIn >>> >>> On April 1, 2014 at 8:54:46 AM, Anthony Ramine (n.oxyde@REDACTED) >wrote: >>> >>> Hello everybody, >>> >>> Some of you might know me, some don't, anyway it has been three >years that >>> I am contributing to Erlang and it has been a very exciting time for >me. I >>> have learnt a lot by fixing compiler bugs, messing with xmerl, the >build >>> system etc. >>> >>> Unfortunately, I feel like I have reached a point where I can not >improve >>> things anymore, because the community is too closed. >>> >>> For this reason I am now stopping all my Erlang contributions and >will now >>> become an Elixir hobbyist, as it's where the future of the platform >is. The >>> future is homoiconic. >>> >>> Thanks for coping me with me all this time. >>> >>> Regards, >>> >>> -- >>> Anthony Ramine >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From co7eb@REDACTED Tue Apr 1 16:32:55 2014 From: co7eb@REDACTED (=?utf-8?Q?Ivan_Carmenates_Garc=C3=ADa?=) Date: Tue, 1 Apr 2014 10:32:55 -0400 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> Message-ID: <000001cf4db7$4e6b4300$eb41c900$@frcuba.co.cu> Hi all, hi Dmitry, Well I don?t know so good, what happened and why you are leaving, but I know that the Erlang community is getting small, since months ago I was receiving 30 emails per day from the community and now I merely receive 5 or 10 in the better cases. I?m just a simple Erlang programmer, since 2008, but have been fan to Erlang since I met it for the first time, and I will always defend it no matter what!, but I?m not a hero, not by myself, the hero is all of us contributing every each grain bit of knowledge, and that, combined with the real heroes, the ones who are in the back-end of Erlang, the ones that build Erlang through our contributions, all of that kinds of heroes makes possible today Erlang to be recognized, if not by the common programmers, by the Companies that wants to use it because Erlang is better than its old and traditional model. All that was possible because of the heroes, and a hero never left to be a hero and never give up. Best regards, Ivan. From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Dmitry Belyaev Sent: martes, 01 de abril de 2014 9:33 To: Pieter Hintjens; Adam Rutkowski Cc: Erlang Subject: Re: [erlang-questions] Farewell to Erlang Hmm, you may be right. I'm not sure though cause it's already 00:32 of 2nd here :P -- Best wishes, Dmitry Belyaev On 2 April 2014 12:26:26 AM AEDT, Pieter Hintjens < ph@REDACTED> wrote: Psych! It's still April 1st! On Tue, Apr 1, 2014 at 3:00 PM, Adam Rutkowski < hq@REDACTED> wrote: Anthony, Good! Your hostility was unacceptable anyway. You won't be missed. On Tue, Apr 1, 2014 at 2:57 PM, Mahesh Paolini-Subramanya < mahesh@REDACTED> wrote: Sigh. Bummed out. Sigh. Mahesh Paolini-Subramanya That tall bald Indian guy.. Google+ | Blog | Twitter | LinkedIn On April 1, 2014 at 8:54:46 AM, Anthony Ramine ( n.oxyde@REDACTED) wrote: Hello everybody, Some of you might know me, some don't, anyway it has been three years that I am contributing to Erlang and it has been a very exciting time for me. I have learnt a lot by fixing compiler bugs, messing with xmerl, the build system etc. Unfortunately, I feel like I have reached a point where I can not improve things anymore, because the community is too closed. For this reason I am now stopping all my Erlang contributions and will now become an Elixir hobbyist, as it's where the future of the platform is. The future is homoiconic. Thanks for coping me with me all this time. Regards, -- Anthony Ramine _____ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions _____ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions _____ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions _____ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: oledata.mso Type: application/octet-stream Size: 26737 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 27550 bytes Desc: not available URL: From max.lapshin@REDACTED Tue Apr 1 16:50:19 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 1 Apr 2014 18:50:19 +0400 Subject: [erlang-questions] How to use erl_parse, erl_scan, erl_eval? Message-ID: Hi. I want to write a test for a function that returns list of some tuples: my_logic:handle_event(Event, State1) -> {ok, Requests, State2} My idea is to write such test helper: step(Event, RequiredRequests) -> State1 = get(remembered_state), {ok, Requests, State2} = my_logic:handle_event(Event, State1), put(remembered_state, State2), true = lists:all(fun(Match) -> case lists:any(fun(Request) -> case Request of Match -> true; _ -> false end end, Requests), RequiredRequests), ok. and use this function like: step(playlist_ready, [{set_timer, download_playlist, _}]) %% This test should check if new timer is set with some not very important time Problem here is that I cannot pass a match into function "step". I have two ideas: 1) wrap each match into macros: -define(P(Match), fun(Request) -> case Request of Match -> true; _ -> false end end). and use it like: step(playlist_ready, [?P({set_timer, download_playlist, _})]) 2) make a macro: -define(step(Event, RequiredRequests), step(Event, ??RequiredRequests)). Now it will be: ?step(playlist_ready, [{set_timer, download_playlist, _}]) but I cannot find any guide how to use those erl_parse, erl_scan, erl_eval to split string "[{set_timer, download_playlist, _}]" into some tokens and create a list of matches from it. Should I don't try to make new problems and just use first option? Or there is some possibility to scan/parse/eval string with matches in runtime? -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Tue Apr 1 16:53:05 2014 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 1 Apr 2014 16:53:05 +0200 Subject: [erlang-questions] How to use erl_parse, erl_scan, erl_eval? In-Reply-To: References: Message-ID: You could also use a special value instead of _, for example '_'. Of course, in this case you must match the patterns by hand, but it's not difficult. regards, Vlad On Tue, Apr 1, 2014 at 4:50 PM, Max Lapshin wrote: > Hi. > > I want to write a test for a function that returns list of some tuples: > > my_logic:handle_event(Event, State1) -> {ok, Requests, State2} > > > > My idea is to write such test helper: > > step(Event, RequiredRequests) -> > State1 = get(remembered_state), > {ok, Requests, State2} = my_logic:handle_event(Event, State1), > put(remembered_state, State2), > true = lists:all(fun(Match) -> > case lists:any(fun(Request) -> > case Request of > Match -> true; > _ -> false > end > end, Requests), RequiredRequests), > ok. > > and use this function like: > > step(playlist_ready, [{set_timer, download_playlist, _}]) %% This test > should check if new timer is set with some not very important time > > Problem here is that I cannot pass a match into function "step". > > > I have two ideas: > > 1) wrap each match into macros: > > -define(P(Match), fun(Request) -> case Request of Match -> true; _ -> > false end end). > > and use it like: > > step(playlist_ready, [?P({set_timer, download_playlist, _})]) > > > 2) make a macro: > > -define(step(Event, RequiredRequests), step(Event, ??RequiredRequests)). > > Now it will be: > > ?step(playlist_ready, [{set_timer, download_playlist, _}]) > > but I cannot find any guide how to use those erl_parse, erl_scan, > erl_eval to split string "[{set_timer, download_playlist, _}]" into some > tokens and create a list of matches from it. > > > > > Should I don't try to make new problems and just use first option? > Or there is some possibility to scan/parse/eval string with matches in > runtime? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanfiedler@REDACTED Tue Apr 1 17:25:59 2014 From: nathanfiedler@REDACTED (Nathan Fiedler) Date: Tue, 1 Apr 2014 08:25:59 -0700 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: <000001cf4db7$4e6b4300$eb41c900$@frcuba.co.cu> References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> <000001cf4db7$4e6b4300$eb41c900$@frcuba.co.cu> Message-ID: With my help I hope you receive at least 11 emails on Erlang today. :) I'd like to say hello to the group. I've been interested in Erlang for ages and the last few weeks I've finally been doing something about it. Learn You Some Erlang for Great Good has been educating and entertaining me thoroughly, making learning the language a joy. My immediate goal is to write a small project to backup files to Amazon Glacier, but eventually I want to find a job that involves Erlang. After learning Erlang, Python has lost its luster, as has Go, not to mention Java and Clojure. By the way, I'm pretty sure the original message was an April Fools joke. At least I hope so. :) n On Tuesday, April 1, 2014, Ivan Carmenates Garc?a wrote: > Hi all, hi Dmitry, > > > > Well I don't know so good, what happened and why you are leaving, but I > know that the Erlang community is getting small, since months ago I was > receiving 30 emails per day from the community and now I merely receive 5 > or 10 in the better cases. > > > > I'm just a simple Erlang programmer, since 2008, but have been fan to > Erlang since I met it for the first time, and I will always defend it no > matter what!, but I'm not a hero, not by myself, the hero is all of us > contributing every each grain bit of knowledge, and that, combined with the > real heroes, the ones who are in the back-end of Erlang, the ones that > build Erlang through our contributions, all of that kinds of heroes makes > possible today Erlang to be recognized, if not by the common programmers, > by the Companies that wants to use it because Erlang is better than its old > and traditional model. All that was possible because of the heroes, and a > hero never left to be a hero and never give up. > > > > Best regards, > > Ivan. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Tue Apr 1 18:25:27 2014 From: g@REDACTED (Garrett Smith) Date: Tue, 1 Apr 2014 11:25:27 -0500 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> Message-ID: Break ups are always hard, on both sides. But I agree with Loic, there's occasion to party, but for different reasons... A brand newcomer was able to contribute to core Erlang - and the compiler no less - for three years. That might still be "too closed" for Anthony and others, but it's certainly something that a lot of language communities can envy. As a disgruntled contributor, Anthony has a viable alternative in moving to Elixir - which is more closely aligned with his sensibilities. That's a huge statement of openness and diversity within the Erlang community at large (language/syntax aside). I don't think there are *that* many folks here who care *that* much about the Erlang language, but rather the problems the technology can solve. I'm very happy that Anthony feels passionate about this platform to continue directing his talents and energy. That he has a choice here is a credit to the ecosystem. Anthony, I wish you the best of luck with whatever you apply yourself to. I'm sorry to see the negative sentiment expressed on the list that's directed at you personally. That's unbecoming and I don't believe representative of the Erlang community, which is typically more constructive. To that point, your "Dear John" letter may be cathartic for you personally, but I think there are some here who would like to improve the openness of the contributor process and could benefit from your constructive feedback. I don't have details and perhaps this is simply a personal dynamic and there's nothing further to exchange. Garrett On Tue, Apr 1, 2014 at 7:57 AM, Mahesh Paolini-Subramanya wrote: > Sigh. > Bummed out. > Sigh. > > Mahesh Paolini-Subramanya > That tall bald Indian guy.. > Google+ | Blog | Twitter | LinkedIn > > On April 1, 2014 at 8:54:46 AM, Anthony Ramine (n.oxyde@REDACTED) wrote: > > Hello everybody, > > Some of you might know me, some don't, anyway it has been three years that I > am contributing to Erlang and it has been a very exciting time for me. I > have learnt a lot by fixing compiler bugs, messing with xmerl, the build > system etc. > > Unfortunately, I feel like I have reached a point where I can not improve > things anymore, because the community is too closed. > > For this reason I am now stopping all my Erlang contributions and will now > become an Elixir hobbyist, as it's where the future of the platform is. The > future is homoiconic. > > Thanks for coping me with me all this time. > > Regards, > > -- > Anthony Ramine > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From hq@REDACTED Wed Apr 2 02:47:53 2014 From: hq@REDACTED (Adam Rutkowski) Date: Wed, 2 Apr 2014 02:47:53 +0200 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> Message-ID: This was April Fools' joke, Garrett. Btw congrats to people who replied with hostility towards nox, off-list, to my previous e-mail, y'all need some soul searching. Internet will never be the same, thanks Anthony. :) On Tue, Apr 1, 2014 at 6:25 PM, Garrett Smith wrote: > Break ups are always hard, on both sides. > > But I agree with Loic, there's occasion to party, but for different > reasons... > > A brand newcomer was able to contribute to core Erlang - and the > compiler no less - for three years. That might still be "too closed" > for Anthony and others, but it's certainly something that a lot of > language communities can envy. > > As a disgruntled contributor, Anthony has a viable alternative in > moving to Elixir - which is more closely aligned with his > sensibilities. That's a huge statement of openness and diversity > within the Erlang community at large (language/syntax aside). I don't > think there are *that* many folks here who care *that* much about the > Erlang language, but rather the problems the technology can solve. > > I'm very happy that Anthony feels passionate about this platform to > continue directing his talents and energy. That he has a choice here > is a credit to the ecosystem. > > Anthony, I wish you the best of luck with whatever you apply yourself > to. I'm sorry to see the negative sentiment expressed on the list > that's directed at you personally. That's unbecoming and I don't > believe representative of the Erlang community, which is typically > more constructive. > > To that point, your "Dear John" letter may be cathartic for you > personally, but I think there are some here who would like to improve > the openness of the contributor process and could benefit from your > constructive feedback. I don't have details and perhaps this is simply > a personal dynamic and there's nothing further to exchange. > > Garrett > > On Tue, Apr 1, 2014 at 7:57 AM, Mahesh Paolini-Subramanya > wrote: > > Sigh. > > Bummed out. > > Sigh. > > > > Mahesh Paolini-Subramanya > > That tall bald Indian guy.. > > Google+ | Blog | Twitter | LinkedIn > > > > On April 1, 2014 at 8:54:46 AM, Anthony Ramine (n.oxyde@REDACTED) > wrote: > > > > Hello everybody, > > > > Some of you might know me, some don't, anyway it has been three years > that I > > am contributing to Erlang and it has been a very exciting time for me. I > > have learnt a lot by fixing compiler bugs, messing with xmerl, the build > > system etc. > > > > Unfortunately, I feel like I have reached a point where I can not improve > > things anymore, because the community is too closed. > > > > For this reason I am now stopping all my Erlang contributions and will > now > > become an Elixir hobbyist, as it's where the future of the platform is. > The > > future is homoiconic. > > > > Thanks for coping me with me all this time. > > > > Regards, > > > > -- > > Anthony Ramine > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Wed Apr 2 02:53:04 2014 From: g@REDACTED (Garrett Smith) Date: Tue, 1 Apr 2014 19:53:04 -0500 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> Message-ID: Yeah, Mahesh chided this for me off list. Ya'll got me. :) On Tue, Apr 1, 2014 at 7:47 PM, Adam Rutkowski wrote: > This was April Fools' joke, Garrett. > Btw congrats to people who replied with hostility towards nox, off-list, to > my previous e-mail, y'all need some soul searching. > Internet will never be the same, thanks Anthony. :) > > On Tue, Apr 1, 2014 at 6:25 PM, Garrett Smith wrote: >> >> Break ups are always hard, on both sides. >> >> But I agree with Loic, there's occasion to party, but for different >> reasons... >> >> A brand newcomer was able to contribute to core Erlang - and the >> compiler no less - for three years. That might still be "too closed" >> for Anthony and others, but it's certainly something that a lot of >> language communities can envy. >> >> As a disgruntled contributor, Anthony has a viable alternative in >> moving to Elixir - which is more closely aligned with his >> sensibilities. That's a huge statement of openness and diversity >> within the Erlang community at large (language/syntax aside). I don't >> think there are *that* many folks here who care *that* much about the >> Erlang language, but rather the problems the technology can solve. >> >> I'm very happy that Anthony feels passionate about this platform to >> continue directing his talents and energy. That he has a choice here >> is a credit to the ecosystem. >> >> Anthony, I wish you the best of luck with whatever you apply yourself >> to. I'm sorry to see the negative sentiment expressed on the list >> that's directed at you personally. That's unbecoming and I don't >> believe representative of the Erlang community, which is typically >> more constructive. >> >> To that point, your "Dear John" letter may be cathartic for you >> personally, but I think there are some here who would like to improve >> the openness of the contributor process and could benefit from your >> constructive feedback. I don't have details and perhaps this is simply >> a personal dynamic and there's nothing further to exchange. >> >> Garrett >> >> On Tue, Apr 1, 2014 at 7:57 AM, Mahesh Paolini-Subramanya >> wrote: >> > Sigh. >> > Bummed out. >> > Sigh. >> > >> > Mahesh Paolini-Subramanya >> > That tall bald Indian guy.. >> > Google+ | Blog | Twitter | LinkedIn >> > >> > On April 1, 2014 at 8:54:46 AM, Anthony Ramine (n.oxyde@REDACTED) >> > wrote: >> > >> > Hello everybody, >> > >> > Some of you might know me, some don't, anyway it has been three years >> > that I >> > am contributing to Erlang and it has been a very exciting time for me. I >> > have learnt a lot by fixing compiler bugs, messing with xmerl, the build >> > system etc. >> > >> > Unfortunately, I feel like I have reached a point where I can not >> > improve >> > things anymore, because the community is too closed. >> > >> > For this reason I am now stopping all my Erlang contributions and will >> > now >> > become an Elixir hobbyist, as it's where the future of the platform is. >> > The >> > future is homoiconic. >> > >> > Thanks for coping me with me all this time. >> > >> > Regards, >> > >> > -- >> > Anthony Ramine >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > From eriksoe@REDACTED Wed Apr 2 08:06:47 2014 From: eriksoe@REDACTED (=?ISO-8859-1?Q?Erik_S=F8e_S=F8rensen?=) Date: Wed, 2 Apr 2014 08:06:47 +0200 Subject: [erlang-questions] How to use erl_parse, erl_scan, erl_eval? In-Reply-To: References: Message-ID: If it is a representation of a pattern you need, then perhaps it's match specifications you're looking for: http://www.erlang.org/doc/apps/erts/match_spec.html [Here, imagine the code example I'd have written if I weren't writing this on a phone :)] /Erik Den 01/04/2014 16.50 skrev "Max Lapshin" : > Hi. > > I want to write a test for a function that returns list of some tuples: > > my_logic:handle_event(Event, State1) -> {ok, Requests, State2} > > > > My idea is to write such test helper: > > step(Event, RequiredRequests) -> > State1 = get(remembered_state), > {ok, Requests, State2} = my_logic:handle_event(Event, State1), > put(remembered_state, State2), > true = lists:all(fun(Match) -> > case lists:any(fun(Request) -> > case Request of > Match -> true; > _ -> false > end > end, Requests), RequiredRequests), > ok. > > and use this function like: > > step(playlist_ready, [{set_timer, download_playlist, _}]) %% This test > should check if new timer is set with some not very important time > > Problem here is that I cannot pass a match into function "step". > > > I have two ideas: > > 1) wrap each match into macros: > > -define(P(Match), fun(Request) -> case Request of Match -> true; _ -> > false end end). > > and use it like: > > step(playlist_ready, [?P({set_timer, download_playlist, _})]) > > > 2) make a macro: > > -define(step(Event, RequiredRequests), step(Event, ??RequiredRequests)). > > Now it will be: > > ?step(playlist_ready, [{set_timer, download_playlist, _}]) > > but I cannot find any guide how to use those erl_parse, erl_scan, > erl_eval to split string "[{set_timer, download_playlist, _}]" into some > tokens and create a list of matches from it. > > > > > Should I don't try to make new problems and just use first option? > Or there is some possibility to scan/parse/eval string with matches in > runtime? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Wed Apr 2 08:51:36 2014 From: mjtruog@REDACTED (Michael Truog) Date: Tue, 01 Apr 2014 23:51:36 -0700 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> Message-ID: <533BB378.3020308@gmail.com> "Ce n'est pas un fil d'email" (just to try and echo http://en.wikipedia.org/wiki/The_Treachery_of_Images, to make this a bit more surreal) On 04/01/2014 05:53 PM, Garrett Smith wrote: > Yeah, Mahesh chided this for me off list. Ya'll got me. > > :) > > On Tue, Apr 1, 2014 at 7:47 PM, Adam Rutkowski wrote: >> This was April Fools' joke, Garrett. >> Btw congrats to people who replied with hostility towards nox, off-list, to >> my previous e-mail, y'all need some soul searching. >> Internet will never be the same, thanks Anthony. :) >> >> On Tue, Apr 1, 2014 at 6:25 PM, Garrett Smith wrote: >>> Break ups are always hard, on both sides. >>> >>> But I agree with Loic, there's occasion to party, but for different >>> reasons... >>> >>> A brand newcomer was able to contribute to core Erlang - and the >>> compiler no less - for three years. That might still be "too closed" >>> for Anthony and others, but it's certainly something that a lot of >>> language communities can envy. >>> >>> As a disgruntled contributor, Anthony has a viable alternative in >>> moving to Elixir - which is more closely aligned with his >>> sensibilities. That's a huge statement of openness and diversity >>> within the Erlang community at large (language/syntax aside). I don't >>> think there are *that* many folks here who care *that* much about the >>> Erlang language, but rather the problems the technology can solve. >>> >>> I'm very happy that Anthony feels passionate about this platform to >>> continue directing his talents and energy. That he has a choice here >>> is a credit to the ecosystem. >>> >>> Anthony, I wish you the best of luck with whatever you apply yourself >>> to. I'm sorry to see the negative sentiment expressed on the list >>> that's directed at you personally. That's unbecoming and I don't >>> believe representative of the Erlang community, which is typically >>> more constructive. >>> >>> To that point, your "Dear John" letter may be cathartic for you >>> personally, but I think there are some here who would like to improve >>> the openness of the contributor process and could benefit from your >>> constructive feedback. I don't have details and perhaps this is simply >>> a personal dynamic and there's nothing further to exchange. >>> >>> Garrett >>> >>> On Tue, Apr 1, 2014 at 7:57 AM, Mahesh Paolini-Subramanya >>> wrote: >>>> Sigh. >>>> Bummed out. >>>> Sigh. >>>> >>>> Mahesh Paolini-Subramanya >>>> That tall bald Indian guy.. >>>> Google+ | Blog | Twitter | LinkedIn >>>> >>>> On April 1, 2014 at 8:54:46 AM, Anthony Ramine (n.oxyde@REDACTED) >>>> wrote: >>>> >>>> Hello everybody, >>>> >>>> Some of you might know me, some don't, anyway it has been three years >>>> that I >>>> am contributing to Erlang and it has been a very exciting time for me. I >>>> have learnt a lot by fixing compiler bugs, messing with xmerl, the build >>>> system etc. >>>> >>>> Unfortunately, I feel like I have reached a point where I can not >>>> improve >>>> things anymore, because the community is too closed. >>>> >>>> For this reason I am now stopping all my Erlang contributions and will >>>> now >>>> become an Elixir hobbyist, as it's where the future of the platform is. >>>> The >>>> future is homoiconic. >>>> >>>> Thanks for coping me with me all this time. >>>> >>>> Regards, >>>> >>>> -- >>>> Anthony Ramine >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From erlang@REDACTED Wed Apr 2 09:34:48 2014 From: erlang@REDACTED (Andreas Stenius) Date: Wed, 2 Apr 2014 09:34:48 +0200 Subject: [erlang-questions] How to use erl_parse, erl_scan, erl_eval? In-Reply-To: References: Message-ID: I haven't looked long enough on your problem statement to fully grasp what you are trying to do, but from the feel of it, merl [1] may be a fit.. //Andreas [1] https://github.com/richcarl/merl 2014-04-01 16:50 GMT+02:00 Max Lapshin : > Hi. > > I want to write a test for a function that returns list of some tuples: > > my_logic:handle_event(Event, State1) -> {ok, Requests, State2} > > > > My idea is to write such test helper: > > step(Event, RequiredRequests) -> > State1 = get(remembered_state), > {ok, Requests, State2} = my_logic:handle_event(Event, State1), > put(remembered_state, State2), > true = lists:all(fun(Match) -> > case lists:any(fun(Request) -> > case Request of > Match -> true; > _ -> false > end > end, Requests), RequiredRequests), > ok. > > and use this function like: > > step(playlist_ready, [{set_timer, download_playlist, _}]) %% This test > should check if new timer is set with some not very important time > > Problem here is that I cannot pass a match into function "step". > > > I have two ideas: > > 1) wrap each match into macros: > > -define(P(Match), fun(Request) -> case Request of Match -> true; _ -> > false end end). > > and use it like: > > step(playlist_ready, [?P({set_timer, download_playlist, _})]) > > > 2) make a macro: > > -define(step(Event, RequiredRequests), step(Event, ??RequiredRequests)). > > Now it will be: > > ?step(playlist_ready, [{set_timer, download_playlist, _}]) > > but I cannot find any guide how to use those erl_parse, erl_scan, > erl_eval to split string "[{set_timer, download_playlist, _}]" into some > tokens and create a list of matches from it. > > > > > Should I don't try to make new problems and just use first option? > Or there is some possibility to scan/parse/eval string with matches in > runtime? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Wed Apr 2 09:50:52 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 2 Apr 2014 11:50:52 +0400 Subject: [erlang-questions] How to use erl_parse, erl_scan, erl_eval? In-Reply-To: References: Message-ID: Thank you, will check it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Wed Apr 2 10:25:44 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Wed, 2 Apr 2014 10:25:44 +0200 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> Message-ID: <8CDA891A-0BAF-48D0-90A3-8C40759EA47D@gmail.com> Poisson d?Avril ! Hint: next time I imply that Elixir is homoiconic, assume I am joking. -- Anthony Ramine Le 2 avr. 2014 ? 02:47, Adam Rutkowski a ?crit : > This was April Fools' joke, Garrett. > Btw congrats to people who replied with hostility towards nox, off-list, to my previous e-mail, y'all need some soul searching. > Internet will never be the same, thanks Anthony. :) From ph@REDACTED Wed Apr 2 12:49:48 2014 From: ph@REDACTED (Pieter Hintjens) Date: Wed, 2 Apr 2014 12:49:48 +0200 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: <8CDA891A-0BAF-48D0-90A3-8C40759EA47D@gmail.com> References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> <8CDA891A-0BAF-48D0-90A3-8C40759EA47D@gmail.com> Message-ID: Yes, the future is homoiconic... :-) The Elixir community was already preparing for the worst... I hear they're quite relieved now. On Wed, Apr 2, 2014 at 10:25 AM, Anthony Ramine wrote: > Poisson d'Avril ! > > Hint: next time I imply that Elixir is homoiconic, assume I am joking. > > -- > Anthony Ramine > > Le 2 avr. 2014 ? 02:47, Adam Rutkowski a ?crit : > >> This was April Fools' joke, Garrett. >> Btw congrats to people who replied with hostility towards nox, off-list, to my previous e-mail, y'all need some soul searching. >> Internet will never be the same, thanks Anthony. :) > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From jose.valim@REDACTED Wed Apr 2 13:43:29 2014 From: jose.valim@REDACTED (=?ISO-8859-1?Q?Jos=E9_Valim?=) Date: Wed, 2 Apr 2014 13:43:29 +0200 Subject: [erlang-questions] Farewell to Erlang In-Reply-To: References: <2ADA8B92-D9AD-4690-B159-C53A975E5380@gmail.com> <8CDA891A-0BAF-48D0-90A3-8C40759EA47D@gmail.com> Message-ID: Given we are past 1st April, I should probably clarify Elixir is not homoiconic, although it has a more regular AST representation than Erlang. If someone is actually taking this thread seriously and is looking for something homoiconic, Joxa and LFE is what you are looking for. *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Lead Developer On Wed, Apr 2, 2014 at 12:49 PM, Pieter Hintjens wrote: > Yes, the future is homoiconic... :-) > > The Elixir community was already preparing for the worst... I hear > they're quite relieved now. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From txrev319@REDACTED Wed Apr 2 13:59:17 2014 From: txrev319@REDACTED (t x) Date: Wed, 2 Apr 2014 04:59:17 -0700 Subject: [erlang-questions] noisy failures Message-ID: Hi, ## context: * I'm using erlang.mk + relx * I'm running my erlang apps as one of the following: _rel/bin/app_name start _rel/bin/app_name console * what I like about "_rel/bin/app_name start" <-- I feel like this is the right way for production use * what I like about "_rel/bin/app_name console" <-- I get noisy failures (i.e. when something goes wrong, it floods stdout ## what I want: I want to use "_rel/bin/app_name start", yet get the same level of errors/warnings/assertions as I do when I run it as "_rel/bin/app_name console" ## what I have tried: * _rel/bin/app_name start * _rel/bin/app_name remote_console However, "start + remote_console" does not seem to get me the same amount of errors as I do from "console". ## question: Is there a wya to use start + remote_console, yet get the same level of errors / warnings as with "console"? Thanks! From bayinamine@REDACTED Wed Apr 2 14:21:29 2014 From: bayinamine@REDACTED (Michael Scofield) Date: Wed, 02 Apr 2014 20:21:29 +0800 Subject: [erlang-questions] =?utf-8?b?W0VybGFuZy1xdWVzdGlvbnNdIOmrmOe6p0Vy?= =?utf-8?b?bGFuZ+W8gOWPkeW3peeoi+W4iA==?= In-Reply-To: References: <532BFB77.1060607@llaisdy.com> <532C19B8.8060605@llaisdy.com> Message-ID: <533C00C9.9000204@gmail.com> Wow! I know there are several online webgame companies in GuangZhou and ShenZhen are using Erlang as their webgames' backend services, instead of using Java and C++. But I don't realize that other company are using this exciting language as well! On 2014?03?21? 19:15, Barco You wrote: > Exactly! > > > 2014-03-21 18:51 GMT+08:00 Ivan Uemlianin >: > > Is the position based in Shenzhen? > > Ivan > > > On 21/03/2014 10:40, Barco You wrote: > > Competence of Chinese reading and writing is not mandate. We very > > welcome English-speaking people join us if only you are a > advocate of > > Erlang. > > > > > > 2014-03-21 16:42 GMT+08:00 Ivan Uemlianin > > >>: > > > > ???????????????? ;) > > > > On 21/03/2014 00:54, Barco You wrote: > > > > ?????????????????????__?????? > ???? > > ???? > > ?????????????????????__?????? > Functional > > Programming???????Erlang??????__????? > ???? > > ??? > > ??0755-83597260 mprtimes@REDACTED > > > > > > >> > > > > ??? > > > > ??Erlang????? > > > > ????? > > > > 1. ??????????????????????????? > > > > 2. ??????????????? > > > > 3. ??erlang??????????? > > > > ????? > > > > 1???erlang?????OTP?????__????????? > ?Functional > > Programming???? > > > > 2???HTTP?TCP/IP???? > > > > 3???????????????? > > > > 4???RDBMS????????Nosql???__?Mysql? > Postgresql?? > > ?????? > > > > 5???????????? > > > > 6???????????????? > > > > 7?????????? > > > > 8???Linux???????????????????? > > > > 9????????????/????????????? > > > > 10???????????????????__??????? > ???? > > ???? > > ???????????? > > > > 11??????????? > > > > 12???????????????????????? > > > > > > > > _________________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > > > http://erlang.org/mailman/__listinfo/erlang-questions > > > > > > > > -- > > ==============================__============================== > > Ivan A. Uemlianin PhD > > Llaisdy > > Speech Technology Research and Development > > > > ivan@REDACTED > > > > www.llaisdy.com > > llaisdy.wordpress.com > > > github.com/llaisdy > > > www.linkedin.com/in/__ivanuemlianin > > > > > > > festina lente > > ==============================__============================== > > > > > > -- > ============================================================ > Ivan A. Uemlianin PhD > Llaisdy > Speech Technology Research and Development > > ivan@REDACTED > www.llaisdy.com > llaisdy.wordpress.com > github.com/llaisdy > www.linkedin.com/in/ivanuemlianin > > > festina lente > ============================================================ > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Wed Apr 2 19:32:55 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Wed, 02 Apr 2014 19:32:55 +0200 Subject: [erlang-questions] NIF UTF-8 encoding Message-ID: <533C49C7.5060903@ninenines.eu> Hello, Wondering when UTF-8 character encoding will land in NIFs? Is it planned for R18 as I suspect? Thank you. -- Lo?c Hoguin http://ninenines.eu From Mark.Stoutchinine@REDACTED Wed Apr 2 17:54:34 2014 From: Mark.Stoutchinine@REDACTED (Stoutchinine, Mark) Date: Wed, 2 Apr 2014 15:54:34 +0000 Subject: [erlang-questions] cross compile of Erlang/OTP Message-ID: <7AC31FA7545D7F418D86AE1CF4C6044C75EB63@VEREXCH02.harrisbroadcast.com> Hello Everyone, I am looking for help with cross compilation. I am following the instruction on how to cross compile Erlang/OTP and it seems worked, I got bin//. built and there are multiple utilities/apps/executables exist in it: >> ls -al -rwxrwxr-x 1 mstoutch mstoutch 176653 Apr 2 11:19 epmd -rwxrwxr-x 1 mstoutch mstoutch 108341 Apr 2 11:19 erlc -rwxrwxr-x 1 mstoutch mstoutch 165065 Apr 2 11:19 erlexec -rwxrwxr-x 1 mstoutch mstoutch 105782 Apr 2 11:19 escript -rwxrwxr-x 1 mstoutch mstoutch 37746 Apr 2 11:19 heart -rwxrwxr-x 1 mstoutch mstoutch 154805 Apr 2 11:19 inet_gethost -rwxrwxr-x 1 mstoutch mstoutch 66273 Apr 2 11:19 run_erl -rwxrwxr-x 1 mstoutch mstoutch 32142 Apr 2 11:19 to_erl -rwxrwxr-x 1 mstoutch mstoutch 99598 Apr 2 11:19 typer erlc is definetly cross compiled: >> file ./bin/powerpc-none-linux-gnu/erlc ./bin/powerpc-none-linux-gnu/erlc: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0x07b32270e1dd4993ea729db6af2e3b42e1024c96, with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70401, not stripped Now at later stages when build process is trying to build some applications like asn1, it fails because it is trying to run cross built erlc on host system, which is incorrect - wrong architecture: ..... make[1]: Leaving directory `/home/shares/public/mstoutch/otp_src_R16B03-1/erts' cd lib && \ ERL_TOP=/home/shares/public/mstoutch/otp_src_R16B03-1 PATH=/home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin:"${PATH}" \ make opt SECONDARY_BOOTSTRAP=true make[1]: Entering directory `/home/shares/public/mstoutch/otp_src_R16B03-1/lib' make[2]: Entering directory `/home/shares/public/mstoutch/otp_src_R16B03-1/lib/asn1/src' erlc -W -bbeam -o../ebin +debug_info -I/home/shares/public/mstoutch/otp_src_R16B03-1/lib/stdlib -Werror -Dvsn=\"2.0.4\" asn1ct.erl /home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin/erlc: 1: /home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin/erlc: Syntax error: end of file unexpected make[2]: *** [../ebin/asn1ct.beam] Error 2 .... Does anyone know how to turn this off, configure the build not to do that, or maybe I am doing something wrong and it is not supposed to use host erlc? Or I need to rebuild these applications on target? Anyone had this problem before? Thank a lot to everyone. Mark ______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com ______________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From roe.adrian@REDACTED Wed Apr 2 20:11:54 2014 From: roe.adrian@REDACTED (Adrian Roe) Date: Wed, 2 Apr 2014 19:11:54 +0100 Subject: [erlang-questions] Building / releasing with HIPE / native Message-ID: <1E378C75002143A194B7F481F447BAE8@gmail.com> We?ve been using Erlang in production for quite a few years now and for the first time we have a project that really benefits from HIPE / native code being turned on (before things have always been fast enough without and the benefit of more detailed stack traces etc outweighed any performance gains). We did some benchmarking by compiling single modules with HIPE - both in our application code and then going through key OTP / Erlang library modules, clearing sticky_directory errors and recompiling them one by one with +native. Now that it is clear that (for this use case) native / HIPE is the way to go, I went to the project?s build box and recompiled Erlang (R16B03) from source with ./configure --enable-hipe --enable-native-libs in the expectation that all libraries would be compiled with +native Checking (for example) lists.beam gives: > Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V5.10.4 (abort with ^G) > 1> lists:module_info(). > [{exports,[{append,2}, > {append,1}, > {subtract,2}, > {nth,2}, > {nthtail,2}, > {prefix,2}, > {suffix,2}, > {last,1}, > {seq,2}, > {seq,3}, > {sum,1}, > {duplicate,2}, > {min,1}, > {max,1}, > {sublist,3}, > {sublist,2}, > {zip,2}, > {zip3,3}, > {unzip3,1}, > {zipwith,3}, > {zipwith3,4}, > {merge,1}, > {merge3,3}, > {rmerge3,3}, > {merge,...}, > {...}|...]}, > {imports,[]}, > {attributes,[{vsn,[329984570326751442388870353176450263952]}]}, > {compile,[{options,[{outdir,"/net/isildur/ldisk/daily_build/r16b03_prebuild_opu_o.2013-12-09_20/otp_src_R16B03/lib/stdlib/src/../ebin"}, > {i,"/net/isildur/ldisk/daily_build/r16b03_prebuild_opu_o.2013-12-09_20/otp_src_R16B03/lib/stdlib/src/../include"}, > {i,"/net/isildur/ldisk/daily_build/r16b03_prebuild_opu_o.2013-12-09_20/otp_src_R16B03/lib/stdlib/src/../../kernel/include"}, > warnings_as_errors,debug_info]}, > {version,"4.9.3"}, > {time,{2013,12,9,19,26,33}}, > {source,"/net/isildur/ldisk/daily_build/r16b03_prebuild_opu_o.2013-12-09_20/otp_src_R16B03/lib/stdlib/src/lists.erl"}]}] No sign of native anywhere? I?ve tried this on OSX, CentOS and Ubuntu all with the same result, so it?s clearly me doing something stupid, but I can?t see it. I obviously could go through and rebuild each module in turn (as we did for the benchmarking) but it doesn?t feel like the right way forward. Any suggestions gratefully received! Kind regards Adrian -- Dr Adrian Roe Director -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Wed Apr 2 20:13:03 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Wed, 2 Apr 2014 21:13:03 +0300 Subject: [erlang-questions] cross compile of Erlang/OTP In-Reply-To: <7AC31FA7545D7F418D86AE1CF4C6044C75EB63@VEREXCH02.harrisbroadcast.com> References: <7AC31FA7545D7F418D86AE1CF4C6044C75EB63@VEREXCH02.harrisbroadcast.com> Message-ID: Hello, Just to double check... Have you used ./otp_build configure \ --xcomp-conf=... and make noboot to build things. What environment your are trying to build it and what compiler ? Best Regards, Dmitry >-|-|-(*> > On 02 Apr 2014, at 18:54, "Stoutchinine, Mark" wrote: > > Hello Everyone, > > I am looking for help with cross compilation. I am following the instruction on how to cross compile Erlang/OTP and it seems worked, I got bin//. built and there are multiple utilities/apps/executables exist in it: > > >> ls -al > -rwxrwxr-x 1 mstoutch mstoutch 176653 Apr 2 11:19 epmd > -rwxrwxr-x 1 mstoutch mstoutch 108341 Apr 2 11:19 erlc > -rwxrwxr-x 1 mstoutch mstoutch 165065 Apr 2 11:19 erlexec > -rwxrwxr-x 1 mstoutch mstoutch 105782 Apr 2 11:19 escript > -rwxrwxr-x 1 mstoutch mstoutch 37746 Apr 2 11:19 heart > -rwxrwxr-x 1 mstoutch mstoutch 154805 Apr 2 11:19 inet_gethost > -rwxrwxr-x 1 mstoutch mstoutch 66273 Apr 2 11:19 run_erl > -rwxrwxr-x 1 mstoutch mstoutch 32142 Apr 2 11:19 to_erl > -rwxrwxr-x 1 mstoutch mstoutch 99598 Apr 2 11:19 typer > > erlc is definetly cross compiled: > > >> file ./bin/powerpc-none-linux-gnu/erlc > ./bin/powerpc-none-linux-gnu/erlc: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0x07b32270e1dd4993ea729db6af2e3b42e1024c96, with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70401, not stripped > > Now at later stages when build process is trying to build some applications like asn1, it fails because it is trying to run cross built erlc on host system, which is incorrect ? wrong architecture: > > ?.. > make[1]: Leaving directory `/home/shares/public/mstoutch/otp_src_R16B03-1/erts' > cd lib && \ > ERL_TOP=/home/shares/public/mstoutch/otp_src_R16B03-1 PATH=/home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin:"${PATH}" \ > make opt SECONDARY_BOOTSTRAP=true > make[1]: Entering directory `/home/shares/public/mstoutch/otp_src_R16B03-1/lib' > make[2]: Entering directory `/home/shares/public/mstoutch/otp_src_R16B03-1/lib/asn1/src' > erlc -W -bbeam -o../ebin +debug_info -I/home/shares/public/mstoutch/otp_src_R16B03-1/lib/stdlib -Werror -Dvsn=\"2.0.4\" asn1ct.erl > /home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin/erlc: 1: /home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin/erlc: Syntax error: end of file unexpected > make[2]: *** [../ebin/asn1ct.beam] Error 2 > ?. > > Does anyone know how to turn this off, configure the build not to do that, or maybe I am doing something wrong and it is not supposed to use host erlc? Or I need to rebuild these applications on target? Anyone had this problem before? > > Thank a lot to everyone. > Mark > > ______________________________________________________________________ > This email has been scanned by the Symantec Email Security.cloud service. > For more information please visit http://www.symanteccloud.com > ______________________________________________________________________ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From sverker.eriksson@REDACTED Wed Apr 2 20:27:58 2014 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Wed, 2 Apr 2014 20:27:58 +0200 Subject: [erlang-questions] Building / releasing with HIPE / native In-Reply-To: <1E378C75002143A194B7F481F447BAE8@gmail.com> References: <1E378C75002143A194B7F481F447BAE8@gmail.com> Message-ID: <533C56AE.6050907@erix.ericsson.se> What does code:is_module_native(lists) say? /Sverker On 04/02/2014 08:11 PM, Adrian Roe wrote: > We've been using Erlang in production for quite a few years now and for the first time we have a project that really benefits from HIPE / native code being turned on (before things have always been fast enough without and the benefit of more detailed stack traces etc outweighed any performance gains). We did some benchmarking by compiling single modules with HIPE - both in our application code and then going through key OTP / Erlang library modules, clearing sticky_directory errors and recompiling them one by one with +native. > > Now that it is clear that (for this use case) native / HIPE is the way to go, I went to the project's build box and recompiled Erlang (R16B03) from source with > > ./configure --enable-hipe --enable-native-libs > > in the expectation that all libraries would be compiled with +native > > Checking (for example) lists.beam gives: > >> Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V5.10.4 (abort with ^G) >> 1> lists:module_info(). >> [{exports,[{append,2}, >> {append,1}, >> {subtract,2}, >> {nth,2}, >> {nthtail,2}, >> {prefix,2}, >> {suffix,2}, >> {last,1}, >> {seq,2}, >> {seq,3}, >> {sum,1}, >> {duplicate,2}, >> {min,1}, >> {max,1}, >> {sublist,3}, >> {sublist,2}, >> {zip,2}, >> {zip3,3}, >> {unzip3,1}, >> {zipwith,3}, >> {zipwith3,4}, >> {merge,1}, >> {merge3,3}, >> {rmerge3,3}, >> {merge,...}, >> {...}|...]}, >> {imports,[]}, >> {attributes,[{vsn,[329984570326751442388870353176450263952]}]}, >> {compile,[{options,[{outdir,"/net/isildur/ldisk/daily_build/r16b03_prebuild_opu_o.2013-12-09_20/otp_src_R16B03/lib/stdlib/src/../ebin"}, >> {i,"/net/isildur/ldisk/daily_build/r16b03_prebuild_opu_o.2013-12-09_20/otp_src_R16B03/lib/stdlib/src/../include"}, >> {i,"/net/isildur/ldisk/daily_build/r16b03_prebuild_opu_o.2013-12-09_20/otp_src_R16B03/lib/stdlib/src/../../kernel/include"}, >> warnings_as_errors,debug_info]}, >> {version,"4.9.3"}, >> {time,{2013,12,9,19,26,33}}, >> {source,"/net/isildur/ldisk/daily_build/r16b03_prebuild_opu_o.2013-12-09_20/otp_src_R16B03/lib/stdlib/src/lists.erl"}]}] > No sign of native anywhere... > > I've tried this on OSX, CentOS and Ubuntu all with the same result, so it's clearly me doing something stupid, but I can't see it. > > I obviously could go through and rebuild each module in turn (as we did for the benchmarking) but it doesn't feel like the right way forward. > > Any suggestions gratefully received! > > Kind regards > > Adrian > -- > Dr Adrian Roe > Director > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From roe.adrian@REDACTED Wed Apr 2 20:34:46 2014 From: roe.adrian@REDACTED (Adrian Roe) Date: Wed, 2 Apr 2014 19:34:46 +0100 Subject: [erlang-questions] Building / releasing with HIPE / native In-Reply-To: <533C56AE.6050907@erix.ericsson.se> References: <1E378C75002143A194B7F481F447BAE8@gmail.com> <533C56AE.6050907@erix.ericsson.se> Message-ID: <9BFD202C59F641F7A0F454935D399090@gmail.com> Sverker Many thanks for the response. The code module agrees, at least on the two systems I have to hand (OSX and CentOS) > Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V5.10.4 (abort with ^G) > 1> code:is_module_native(lists). > false > > > When we were compiling the modules by hand we certainly saw native in the module:info() response, but the code:is_module_native() call is a much cleaner way to tell! Kind regards Adrian -- Adrian Roe Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Wednesday, 2 April 2014 at 19:27, Sverker Eriksson wrote: > What does code:is_module_native(lists) say? > > /Sverker > > > On 04/02/2014 08:11 PM, Adrian Roe wrote: > > We?ve been using Erlang in production for quite a few years now and for the first time we have a project that really benefits from HIPE / native code being turned on (before things have always been fast enough without and the benefit of more detailed stack traces etc outweighed any performance gains). We did some benchmarking by compiling single modules with HIPE - both in our application code and then going through key OTP / Erlang library modules, clearing sticky_directory errors and recompiling them one by one with +native. Now that it is clear that (for this use case) native / HIPE is the way to go, I went to the project?s build box and recompiled Erlang (R16B03) from source with ./configure --enable-hipe --enable-native-libs in the expectation that all libraries would be compiled with +native Checking (for example) lists.beam gives: > > > Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V5.10.4 (abort with ^G) 1> lists:module_info(). [{exports,[{append,2}, {append,1}, {subtract,2}, {nth,2}, {nthtail,2}, {prefix,2}, {suffix,2}, {last,1}, {seq,2}, {seq,3}, {sum,1}, {duplicate,2}, {min,1}, {max,1}, {sublist,3}, {sublist,2}, {zip,2}, {zip3,3}, {unzip3,1}, {zipwith,3}, {zipwith3,4}, {merge,1}, {merge3,3}, {rmerge3,3}, {merge,...}, {...}|...]}, {imports,[]}, {attributes,[{vsn,[329984570326751442388870353176450263952]}]}, {compile,[{options,[{outdir,"/net/isildur/ldisk/daily_build/r16b03_prebuild_opu_o.2013-12-09_20/otp_src_R16B03/lib/stdlib/src/../ebin"}, {i,"/net/isildur/ldisk/daily_build/r16b03_prebuild_opu_o.2013-12-09_20/otp_src_R16B03/lib/stdlib/src/../include"}, {i,"/net/isildur/ldisk/daily_build/r16b03_prebuild_opu_o.2013-12-09_20/otp_src_R16B03/lib/stdlib/src/../../kernel/include"}, warnings_as_errors,debug_info]}, {version,"4.9.3"}, {time,{2013,12,9,19,26,33}}, {source,"/net/isildur/ldisk/daily_build/r16b03_prebuild_opu_o.2013-12-09_20/otp_src_R16B03/lib/stdlib/src/lists.erl"}]}] > > > > > > > No sign of native anywhere? I?ve tried this on OSX, CentOS and Ubuntu all with the same result, so it?s clearly me doing something stupid, but I can?t see it. I obviously could go through and rebuild each module in turn (as we did for the benchmarking) but it doesn?t feel like the right way forward. Any suggestions gratefully received! Kind regards Adrian -- Dr Adrian Roe Director > > > > > > _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED (mailto:erlang-questions@REDACTED) http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From kostis@REDACTED Wed Apr 2 22:31:23 2014 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 02 Apr 2014 22:31:23 +0200 Subject: [erlang-questions] Building / releasing with HIPE / native In-Reply-To: <1E378C75002143A194B7F481F447BAE8@gmail.com> References: <1E378C75002143A194B7F481F447BAE8@gmail.com> Message-ID: <533C739B.4020800@cs.ntua.gr> On 04/02/2014 08:11 PM, Adrian Roe wrote: > We?ve been using Erlang in production for quite a few years now and for > the first time we have a project that really benefits from HIPE / native > code being turned on (before things have always been fast enough without > and the benefit of more detailed stack traces etc outweighed any > performance gains). We did some benchmarking by compiling single > modules with HIPE - both in our application code and then going through > key OTP / Erlang library modules, clearing sticky_directory errors and > recompiling them one by one with +native. > > Now that it is clear that (for this use case) native / HIPE is the way > to go, I went to the project?s build box and recompiled Erlang (R16B03) > from source with > > ./configure --enable-hipe --enable-native-libs > in the expectation that all libraries would be compiled with +native > > I?ve tried this on OSX, CentOS and Ubuntu all with the same result, so > it?s clearly me doing something stupid, but I can?t see it. Can it be that you have not done a 'make clean'? Note that ./configure (with or without flags) does not actually build the system or recreate any dependencies. Can you try the following sequence of commands on your Ubuntu machine (unfortunately, I've never tried HiPE on OSX or CentOS to know what is its status there) and tell us what happened? make clean ./otp_build autoconf ./configure --enable-native-libs make -j As Sverker suggested, you can find out whether some module, say lists, contains native code or not by: code:is_module_native(lists). Some more info: - Note that for better or worse, --enable-native-libs does not build the complete set of libraries with native code. Only kernel, stdlib, compiler, hipe, syntax_tools and dialyzer are built with native code. If your application requires some other modules in native code, you need to explicitly compile them to native or change the Makefile of their library in a way similar to the Makefiles of these libraries. - I would recommend against R16B03 as it is seriously broken in some respects. (This comment is unrelated to native code.) Use R16B03-1 instead. Kostis From essen@REDACTED Wed Apr 2 22:40:06 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Wed, 02 Apr 2014 22:40:06 +0200 Subject: [erlang-questions] Building / releasing with HIPE / native In-Reply-To: <533C739B.4020800@cs.ntua.gr> References: <1E378C75002143A194B7F481F447BAE8@gmail.com> <533C739B.4020800@cs.ntua.gr> Message-ID: <533C75A6.8020708@ninenines.eu> On 04/02/2014 10:31 PM, Kostis Sagonas wrote: > - Note that for better or worse, --enable-native-libs does not build > the complete set of libraries with native code. Only kernel, stdlib, > compiler, hipe, syntax_tools and dialyzer are built with native code. If > your application requires some other modules in native code, you need to > explicitly compile them to native or change the Makefile of their > library in a way similar to the Makefiles of these libraries. Isn't there a big potential boost in performance by enabling native code for SSL and related apps? Do you know if anyone has experimented with it? -- Lo?c Hoguin http://ninenines.eu From kostis@REDACTED Wed Apr 2 22:44:04 2014 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 02 Apr 2014 22:44:04 +0200 Subject: [erlang-questions] Building / releasing with HIPE / native In-Reply-To: <533C75A6.8020708@ninenines.eu> References: <1E378C75002143A194B7F481F447BAE8@gmail.com> <533C739B.4020800@cs.ntua.gr> <533C75A6.8020708@ninenines.eu> Message-ID: <533C7694.3010304@cs.ntua.gr> On 04/02/2014 10:40 PM, Lo?c Hoguin wrote: > Isn't there a big potential boost in performance by enabling native code > for SSL and related apps? Do you know if anyone has experimented with it? No idea. But there is nothing that prevents one from trying it out. The change required is to add the following lines: ifeq ($(NATIVE_LIBS_ENABLED),yes) ERL_COMPILE_FLAGS += +native endif immediately before the ERL_COMPILE_FLAGS += .... line in the corresponding Makefile. (e.g in lib/ssl/src/Makefile) Kostis From vladimir.ralev@REDACTED Thu Apr 3 00:25:05 2014 From: vladimir.ralev@REDACTED (Vladimir Ralev) Date: Thu, 3 Apr 2014 01:25:05 +0300 Subject: [erlang-questions] Heavy duty erlang HTTP/REST client Message-ID: Hi all, I've been struggling with httpc and ibrowse to do sort of long-polling REST requests in large numbers. Basically I have a "slow" server that responds in 30-60 seconds to all HTTP requests. Both httpc and ibrowse seem to freeze at some point no matter what settings I use - I set max sessions to 10000, disable pipelining, adjust timeouts tried several random configs, but at some point they all freeze and no longer attempt to connect and send new requests. Ibrowse gives the retry_later and httpc just freezes. Any recommendation? -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Thu Apr 3 00:42:10 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Thu, 03 Apr 2014 00:42:10 +0200 Subject: [erlang-questions] Heavy duty erlang HTTP/REST client In-Reply-To: References: Message-ID: <533C9242.1060106@ninenines.eu> Have you tried gun? github.com/extend/gun It's still pretty much alpha but it's made for long-running connections so perhaps it will work well in your case. Expect small bugs though. On 04/03/2014 12:25 AM, Vladimir Ralev wrote: > Hi all, > > I've been struggling with httpc and ibrowse to do sort of long-polling > REST requests in large numbers. Basically I have a "slow" server that > responds in 30-60 seconds to all HTTP requests. Both httpc and ibrowse > seem to freeze at some point no matter what settings I use - I set max > sessions to 10000, disable pipelining, adjust timeouts tried several > random configs, but at some point they all freeze and no longer attempt > to connect and send new requests. Ibrowse gives the retry_later and > httpc just freezes. Any recommendation? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From mononcqc@REDACTED Thu Apr 3 01:22:53 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 2 Apr 2014 19:22:53 -0400 Subject: [erlang-questions] Heavy duty erlang HTTP/REST client In-Reply-To: References: Message-ID: <20140402232252.GE77980@ferdmbp.local> For cases where you have lots of requests to restriced number of endpoints, I've written pooling on top of lhttpc, which shows up in this fork: https://github.com/ferd/lhttpc It's been used in production for years and will do very basic GET/POST kinds of requests, but with efficiency. If that one begins to be a point of contention (too many reqs per endpoint), https://github.com/ferd/dlhttpc is its successor -- same API, but stronger pooling mechanism. Regards, Fred. On 04/03, Vladimir Ralev wrote: > Hi all, > > I've been struggling with httpc and ibrowse to do sort of long-polling REST > requests in large numbers. Basically I have a "slow" server that responds > in 30-60 seconds to all HTTP requests. Both httpc and ibrowse seem to > freeze at some point no matter what settings I use - I set max sessions to > 10000, disable pipelining, adjust timeouts tried several random configs, > but at some point they all freeze and no longer attempt to connect and send > new requests. Ibrowse gives the retry_later and httpc just freezes. Any > recommendation? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From ddosia@REDACTED Thu Apr 3 09:33:29 2014 From: ddosia@REDACTED (Daniil Churikov) Date: Thu, 3 Apr 2014 00:33:29 -0700 (PDT) Subject: [erlang-questions] noisy failures In-Reply-To: References: Message-ID: <3afc1286-5fc4-4953-b7e4-149db22eff86@googlegroups.com> Here is my relx.config: {release, {app_name, "0.0.1"}, [app_name, sasl]}. {extended_start_script, true}. If you add sasl, you can see more verbose logs in _rel/log/ directory On Wednesday, April 2, 2014 3:59:17 PM UTC+4, t x wrote: > > Hi, > > > ## context: > > * I'm using erlang.mk + relx > > * I'm running my erlang apps as one of the following: > _rel/bin/app_name start > _rel/bin/app_name console > > * what I like about "_rel/bin/app_name start" <-- I feel like this > is the right way for production use > > * what I like about "_rel/bin/app_name console" <-- I get noisy > failures (i.e. when something goes wrong, it floods stdout > > > ## what I want: > > I want to use "_rel/bin/app_name start", yet get the same level of > errors/warnings/assertions as I do when I run it as "_rel/bin/app_name > console" > > > ## what I have tried: > > * _rel/bin/app_name start > * _rel/bin/app_name remote_console > > However, "start + remote_console" does not seem to get me the same > amount of errors as I do from "console". > > > ## question: > > Is there a wya to use start + remote_console, yet get the same level > of errors / warnings as with "console"? > > Thanks! > _______________________________________________ > erlang-questions mailing list > erlang-q...@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ddosia@REDACTED Thu Apr 3 09:55:56 2014 From: ddosia@REDACTED (Daniil Churikov) Date: Thu, 3 Apr 2014 00:55:56 -0700 (PDT) Subject: [erlang-questions] noisy failures In-Reply-To: <3afc1286-5fc4-4953-b7e4-149db22eff86@googlegroups.com> References: <3afc1286-5fc4-4953-b7e4-149db22eff86@googlegroups.com> Message-ID: <36129573-5ecc-4928-84d6-249f4dfbb50b@googlegroups.com> Also if you put in your relx.config: {sys_config, "./config/sys.config"}. and create ./config/sys.config: [ {sasl, [ {sasl_error_logger, {file, "log/sasl.log"}}, {errlog_type, all}, {error_logger_mf_dir, "log"}, % Log directory {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size {error_logger_mf_maxfiles, 5} % 5 files max ]} ]. you will get additional sasl features like log rotation On Thursday, April 3, 2014 11:33:29 AM UTC+4, Daniil Churikov wrote: > > Here is my relx.config: > > > {release, {app_name, "0.0.1"}, [app_name, > sasl]}. > > {extended_start_script, > true}. > > > > If you add sasl, you can see more verbose logs in _rel/log/ directory > > > On Wednesday, April 2, 2014 3:59:17 PM UTC+4, t x wrote: >> >> Hi, >> >> >> ## context: >> >> * I'm using erlang.mk + relx >> >> * I'm running my erlang apps as one of the following: >> _rel/bin/app_name start >> _rel/bin/app_name console >> >> * what I like about "_rel/bin/app_name start" <-- I feel like this >> is the right way for production use >> >> * what I like about "_rel/bin/app_name console" <-- I get noisy >> failures (i.e. when something goes wrong, it floods stdout >> >> >> ## what I want: >> >> I want to use "_rel/bin/app_name start", yet get the same level of >> errors/warnings/assertions as I do when I run it as "_rel/bin/app_name >> console" >> >> >> ## what I have tried: >> >> * _rel/bin/app_name start >> * _rel/bin/app_name remote_console >> >> However, "start + remote_console" does not seem to get me the same >> amount of errors as I do from "console". >> >> >> ## question: >> >> Is there a wya to use start + remote_console, yet get the same level >> of errors / warnings as with "console"? >> >> Thanks! >> _______________________________________________ >> erlang-questions mailing list >> erlang-q...@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Thu Apr 3 11:57:56 2014 From: lukas@REDACTED (Lukas Larsson) Date: Thu, 3 Apr 2014 11:57:56 +0200 Subject: [erlang-questions] cross compile of Erlang/OTP In-Reply-To: References: <7AC31FA7545D7F418D86AE1CF4C6044C75EB63@VEREXCH02.harrisbroadcast.com> Message-ID: Hello, When cross compiling I always use these commands: export ERL_TOP=`pwd` ./otp_build autoconf ./otp_build configure --xcomp-conf=xcomp/my.conf ./otp_build boot -a ./otp_build release -a This takes care of setting up the proper compiler etc for building Erlang/OTP Lukas On Wed, Apr 2, 2014 at 8:13 PM, Dmitry Kolesnikov wrote: > Hello, > > Just to double check... > Have you used ./otp_build configure \ --xcomp-conf=... and make noboot > to build things. > > What environment your are trying to build it and what compiler ? > > Best Regards, > Dmitry > >-|-|-(*> > > On 02 Apr 2014, at 18:54, "Stoutchinine, Mark" < > Mark.Stoutchinine@REDACTED> wrote: > > Hello Everyone, > > > > I am looking for help with cross compilation. I am following the > instruction on how to cross compile Erlang/OTP and it seems worked, I got > bin//. built and there are multiple utilities/apps/executables > exist in it: > > > > >> ls -al > > -rwxrwxr-x 1 mstoutch mstoutch 176653 Apr 2 11:19 epmd > > -rwxrwxr-x 1 mstoutch mstoutch 108341 Apr 2 11:19 erlc > > -rwxrwxr-x 1 mstoutch mstoutch 165065 Apr 2 11:19 erlexec > > -rwxrwxr-x 1 mstoutch mstoutch 105782 Apr 2 11:19 escript > > -rwxrwxr-x 1 mstoutch mstoutch 37746 Apr 2 11:19 heart > > -rwxrwxr-x 1 mstoutch mstoutch 154805 Apr 2 11:19 inet_gethost > > -rwxrwxr-x 1 mstoutch mstoutch 66273 Apr 2 11:19 run_erl > > -rwxrwxr-x 1 mstoutch mstoutch 32142 Apr 2 11:19 to_erl > > -rwxrwxr-x 1 mstoutch mstoutch 99598 Apr 2 11:19 typer > > > > erlc is definetly cross compiled: > > > > >> file ./bin/powerpc-none-linux-gnu/erlc > > ./bin/powerpc-none-linux-gnu/erlc: ELF 32-bit MSB executable, PowerPC or > cisco 4500, version 1 (SYSV), dynamically linked (uses shared libs), for > GNU/Linux 2.6.16, BuildID[sha1]=0x07b32270e1dd4993ea729db6af2e3b42e1024c96, > with unknown capability 0x41000000 = 0xf676e75, with unknown capability > 0x10000 = 0x70401, not stripped > > > > Now at later stages when build process is trying to build some > applications like asn1, it fails because it is trying to run cross built > erlc on host system, which is incorrect - wrong architecture: > > > > ..... > > make[1]: Leaving directory > `/home/shares/public/mstoutch/otp_src_R16B03-1/erts' > > cd lib && \ > > ERL_TOP=/home/shares/public/mstoutch/otp_src_R16B03-1 > PATH=/home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin:"${PATH}" \ > > make opt SECONDARY_BOOTSTRAP=true > > make[1]: Entering directory > `/home/shares/public/mstoutch/otp_src_R16B03-1/lib' > > make[2]: Entering directory > `/home/shares/public/mstoutch/otp_src_R16B03-1/lib/asn1/src' > > erlc -W -bbeam -o../ebin +debug_info > -I/home/shares/public/mstoutch/otp_src_R16B03-1/lib/stdlib -Werror > -Dvsn=\"2.0.4\" asn1ct.erl > > /home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin/erlc: 1: > /home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin/erlc: Syntax > error: end of file unexpected > > make[2]: *** [../ebin/asn1ct.beam] Error 2 > > .... > > > > Does anyone know how to turn this off, configure the build not to do that, > or maybe I am doing something wrong and it is not supposed to use host > erlc? Or I need to rebuild these applications on target? Anyone had this > problem before? > > > > Thank a lot to everyone. > > Mark > > ______________________________________________________________________ > This email has been scanned by the Symantec Email Security.cloud service. > For more information please visit http://www.symanteccloud.com > ______________________________________________________________________ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roe.adrian@REDACTED Thu Apr 3 12:36:37 2014 From: roe.adrian@REDACTED (Adrian Roe) Date: Thu, 3 Apr 2014 11:36:37 +0100 Subject: [erlang-questions] Building / releasing with HIPE / native In-Reply-To: <533C739B.4020800@cs.ntua.gr> References: <1E378C75002143A194B7F481F447BAE8@gmail.com> <533C739B.4020800@cs.ntua.gr> Message-ID: <28E509ADB5354E0993449B32070D876B@gmail.com> Paul / Kostis / Group First off many thanks for your help - I have got to the bottom of what was happening. Basically there are beam files included in the src release tar balls that meant certain beams were not being built. The details are below and I would be interested to know if the presence of the beam files in the source tar balls is deliberate. I was building Erlang from a script that did the following: # Download and install erlang OtpDir=otp_src_R16B03-1 rm -rf $OtpDir wget http://www.erlang.org/download/otp_src_R16B03-1.tar.gz tar xf otp_src_R16B03-1.tar.gz rm otp_src_R16B03-1.tar.gz pushd $OtpDir ./configure --enable-native-libs make sudo make install popd Every time it tried again I would re-run the script so that what I was doing was entirely reproducible. The issue is that the otp_src_R16B03-1.tar.gz contains files in otp_src_R16B03-1/lib/stdlib/ebin/ including lists.beam and others and the make process above was not marking the beams in that directory as obsolete (the beam files don't have a dependency on the Makefile). I was concerned about side-effects from previous attempts impacting settings so between every attempt ran "rm -rf otp_src_R16B03-1? and started again - reintroducing the obsolete beams every time. I think the minimal set of commands to get a native build from the src release tar is: ./configure --enable-native-libs make clean # you need to run ./configure before clean as you don?t have a Makefile otherwise ./configure --enable-native-libs # as the make clean will have deleted the settings make sudo make install This deletes the beams included in the top tar ball and then runs make from a clean base. Pulling the source from Github should work as well as the beams are not part of the repo. Thanks again for your help, Adrian -- Adrian Roe Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Wednesday, 2 April 2014 at 21:31, Kostis Sagonas wrote: > On 04/02/2014 08:11 PM, Adrian Roe wrote: > > We?ve been using Erlang in production for quite a few years now and for > > the first time we have a project that really benefits from HIPE / native > > code being turned on (before things have always been fast enough without > > and the benefit of more detailed stack traces etc outweighed any > > performance gains). We did some benchmarking by compiling single > > modules with HIPE - both in our application code and then going through > > key OTP / Erlang library modules, clearing sticky_directory errors and > > recompiling them one by one with +native. > > > > Now that it is clear that (for this use case) native / HIPE is the way > > to go, I went to the project?s build box and recompiled Erlang (R16B03) > > from source with > > > > ./configure --enable-hipe --enable-native-libs > > in the expectation that all libraries would be compiled with +native > > > > I?ve tried this on OSX, CentOS and Ubuntu all with the same result, so > > it?s clearly me doing something stupid, but I can?t see it. > > > > > Can it be that you have not done a 'make clean'? Note that ./configure > (with or without flags) does not actually build the system or recreate > any dependencies. > > Can you try the following sequence of commands on your Ubuntu machine > (unfortunately, I've never tried HiPE on OSX or CentOS to know what is > its status there) and tell us what happened? > > make clean > ./otp_build autoconf > ./configure --enable-native-libs > make -j > > As Sverker suggested, you can find out whether some module, say lists, > contains native code or not by: code:is_module_native(lists). > > > Some more info: > > - Note that for better or worse, --enable-native-libs does not build > the complete set of libraries with native code. Only kernel, stdlib, > compiler, hipe, syntax_tools and dialyzer are built with native code. If > your application requires some other modules in native code, you need to > explicitly compile them to native or change the Makefile of their > library in a way similar to the Makefiles of these libraries. > > - I would recommend against R16B03 as it is seriously broken in some > respects. (This comment is unrelated to native code.) Use R16B03-1 > instead. > > Kostis -------------- next part -------------- An HTML attachment was scrubbed... URL: From atulatri2004@REDACTED Fri Apr 4 10:33:02 2014 From: atulatri2004@REDACTED (atul atri) Date: Fri, 4 Apr 2014 14:03:02 +0530 Subject: [erlang-questions] SSL crashes while decoding alert. Message-ID: Hi, I am using httpc to connect to a website that is using invalid certificate. But it is crashing while ssl handshake. ====== 7> httpc:request(post, {"https://somewhere.com", [], "application/x-www-form-urlencoded", ""}, [{ssl, [{verify, verify_none}]}], []). {error,{failed_connect,[{to_address,{" somewhere.com", 443}}, {inet,[inet], {eoptions,{{function_clause,[{tls_connection,handle_alert, [{alert,1,112,{"tls_connection.erl",375}}, hello, {state,client, {#Ref<0.0.0.137>,<0.74.0>}, gen_tcp,tls_connection,tcp,tcp_closed,tcp_error,...}], [{file,"tls_connection.erl"},{line,834}]}, {tls_connection,handle_alerts,2, [{file,"tls_connection.erl"},{line,832}]}, {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]}, {proc_lib,init_p_do_apply,3, [{file,"proc_lib.erl"},{line,239}]}]}, {gen_fsm,sync_send_all_state_event, [<0.75.0>,{start,infinity},infinity]}}}}]}} ======= I am able to browse website in Firefox. My elang version is ==== [root@REDACTED ~]# erl Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false] Eshell V5.10.4 (abort with ^G) ==== I googled it and it looks some thing related to http://permalink.gmane.org/gmane.comp.lang.erlang.bugs/4302. Any help to fix or work around this is much appreciated. Thanks & Regards, Atul Atri. -------------- next part -------------- An HTML attachment was scrubbed... URL: From olivier.boudeville@REDACTED Fri Apr 4 10:33:30 2014 From: olivier.boudeville@REDACTED (Olivier BOUDEVILLE) Date: Fri, 4 Apr 2014 10:33:30 +0200 Subject: [erlang-questions] Maximising memory compactness Message-ID: Hello all, Let's suppose one would like to run a large, distributed (Erlang) application, with many processes, and that ends up, in some cases, being RAM-bound. In order to squeeze more processes into each node, apart from using the best data-structures to reduce memory footprint and from having the least active processes hibernate, I imagine that a good option could be to rely on "smaller pointers" (as they must be used internally a lot by the VM, for most terms), i.e. either using the 64-bit half-word emulator or instanciating as many 32-bit VMs as needed to "pave" the actual RAM of each host, and have them communicate. Apparently large gains in terms of memory could be expected. The half-word emulator would seem the simplest/most elegant solution to do so (ex: I suppose that CPU extended registers, instruction sets, etc. can then be used - which wouldn't be the case for VMs compiled for 32-bit addressing; moreover 32-bit VMs would probably have to communicate through the loopback or alike, involving I suppose much marshalling/demarshalling) but apparently: - we currently cannot have both the half-word emulator *and* the HiPe-based native compilation, so we have to choose between RAM and CPU (don't know if targeting Erllvm could help) - more importantly, with the half-word emulator, the total RAM for stacks + heaps for processes would still have to be under 4GB (as stated apparently by http://www.erlang-factory.com/upload/presentations/569/Halfword_Erlang_Factory_SF_2012.pdf ) So, my question: would relying on a set of 32-bit VMs per host, instead of a single 64-bit VM, look like the best option here? Thanks in advance for any hint! Best regards, Olivier. --------------------------- Olivier Boudeville EDF R&D : 1, avenue du G?n?ral de Gaulle, 92140 Clamart, France D?partement SINETICS, groupe ASICS (I2A), bureau B-226 Office : +33 1 47 65 59 58 / Mobile : +33 6 16 83 37 22 / Fax : +33 1 47 65 27 13 Ce message et toutes les pi?ces jointes (ci-apr?s le 'Message') sont ?tablis ? l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme ? sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse. Si vous n'?tes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez re?u ce Message par erreur, merci de le supprimer de votre syst?me, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions ?galement d'en avertir imm?diatement l'exp?diteur par retour du message. Il est impossible de garantir que les communications par messagerie ?lectronique arrivent en temps utile, sont s?curis?es ou d?nu?es de toute erreur ou virus. ____________________________________________________ This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message. E-mail communication cannot be guaranteed to be timely secure, error or virus-free. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Fri Apr 4 10:42:34 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Fri, 4 Apr 2014 10:42:34 +0200 Subject: [erlang-questions] Maximising memory compactness In-Reply-To: References: Message-ID: On Fri, Apr 4, 2014 at 10:33 AM, Olivier BOUDEVILLE < olivier.boudeville@REDACTED> wrote: > Thanks in advance for any hint! In the case of large ETS tables which hold lots of data, the 'compressed' option is of interest in such a setup. It trades memory usage for CPU cycles. But on modern CPUs, this gap is probably smaller than what people think. The best solution is to decide upon a critical breaking point where you stop wasting time on optimizing for a single node and begin considering introducing multiple nodes. The switch has an overhead, but hunting for small amounts of memory seem wasteful. Also consider that memory bounds on modern machines tend to go up. In two years, you will probably have 64 gigabyte machines at Amazon without any hitch where we use 32 gigabyte now. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dszoboszlay@REDACTED Fri Apr 4 10:51:13 2014 From: dszoboszlay@REDACTED (=?utf-8?Q?Szoboszlay_D=C3=A1niel?=) Date: Fri, 04 Apr 2014 10:51:13 +0200 Subject: [erlang-questions] Maximising memory compactness In-Reply-To: References: Message-ID: Hi, I'd be in favor of the half-word mode: Having multiple 32-bit VMs would multiply the beam code stored in memory as well. This could mean a lot of memory wasted. Using 32-bit VMs would not solve the 4GB limit on stack/heap size. On the contrary, the 4GB limit is for the total memory consumption of the 32-bit node. In the half-word mode the limit is per process; and you could even move data to private ETS tables from the heap for extremely memory hungry processes if nothing else helps. If parts of your code needs HiPE, consider splitting out that part into a separate 32-bit VM running on the same node. So you will have two nodes per host: one half-word node for processes handling lot of data, and one 32-bit node with HiPE for processes doing number crunching. Regards, Daniel On Fri, 04 Apr 2014 10:33:30 +0200, Olivier BOUDEVILLE wrote: > Hello all, > Let's suppose one would like to run a large, distributed (Erlang) > application, with many processes, and that ends up, in some cases, being > RAM-bound. > In order to squeeze more processes into each node, apart from using the > best data-structures to reduce memory footprint and from having the > least active processes hibernate, I >imagine that a good option could be > to rely on "smaller pointers" (as they must be used internally a lot by > the VM, for most terms), i.e. either using the 64-bit half-word emulator > or >instanciating as many 32-bit VMs as needed to "pave" the actual RAM > of each host, and have them communicate. Apparently large gains in terms > of memory could be expected. > The half-word emulator would seem the simplest/most elegant solution to > do so (ex: I suppose that CPU extended registers, instruction sets, etc. > can then be used - which wouldn't >be the case for VMs compiled for > 32-bit addressing; moreover 32-bit VMs would probably have to > communicate through the loopback or alike, involving I suppose much > >marshalling/demarshalling) but apparently: - we currently cannot > have both the half-word emulator *and* the HiPe-based native > compilation, so we have to choose between RAM and CPU (don't know if > targeting Erllvm >could help) - more importantly, with the > half-word emulator, the total RAM for stacks + heaps for processes would > still have to be under 4GB (as stated apparently by > http://www.erlang->factory.com/upload/presentations/569/Halfword_Erlang_Factory_SF_2012.pdf) > So, my question: would relying on a set of 32-bit VMs per host, instead > of a single 64-bit VM, look like the best option here? > Thanks in advance for any hint! > Best regards, >> Olivier. > --------------------------- > Olivier Boudeville > > EDF R&D : 1, avenue du G?n?ral de Gaulle, 92140 Clamart, France > D?partement SINETICS, groupe ASICS (I2A), bureau B-226 > Office : +33 1 47 65 59 58 / Mobile : +33 6 16 83 37 22 / Fax : +33 1 47 > 65 27 13 > > Ce message et toutes les pi?ces jointes (ci-apr?s le 'Message') sont > ?tablis ? l'intention exclusive des destinataires et les informations > qui y figurent sont strictement confidentielles. Toute >utilisation de > ce Message non conforme ? sa destination, toute diffusion ou toute > publication totale ou partielle, est interdite sauf autorisation > expresse. > > Si vous n'?tes pas le destinataire de ce Message, il vous est interdit > de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout > ou partie. Si vous avez re?u ce Message par erreur, merci >de le > supprimer de votre syst?me, ainsi que toutes ses copies, et de n'en > garder aucune trace sur quelque support que ce soit. Nous vous > remercions ?galement d'en avertir imm?diatement >l'exp?diteur par retour > du message. > > Il est impossible de garantir que les communications par messagerie > ?lectronique arrivent en temps utile, sont s?curis?es ou d?nu?es de > toute erreur ou virus. > ____________________________________________________ > > This message and any attachments (the 'Message') are intended solely for > the addressees. The information contained in this Message is > confidential. Any use of information contained in this >Message not in > accord with its purpose, any dissemination or disclosure, either whole > or partial, is prohibited except formal approval. > > If you are not the addressee, you may not copy, forward, disclose or use > any part of it. If you have received this message in error, please > delete it and all copies from your system and notify the >sender > immediately by return message. > > E-mail communication cannot be guaranteed to be timely secure, error or > virus-free. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kostis@REDACTED Fri Apr 4 11:39:14 2014 From: kostis@REDACTED (Kostis Sagonas) Date: Fri, 04 Apr 2014 11:39:14 +0200 Subject: [erlang-questions] Maximising memory compactness In-Reply-To: References: Message-ID: <533E7DC2.6080209@cs.ntua.gr> On 04/04/2014 10:33 AM, Olivier BOUDEVILLE wrote: > Let's suppose one would like to run a large, distributed (Erlang) > application, with many processes, and that ends up, in some cases, being > RAM-bound. > ... > The half-word emulator would seem the simplest/most elegant solution to > do so .... > > So, my question: would relying on a set of 32-bit VMs per host, > instead of a single 64-bit VM, look like the best option here? My opinion is (and has always been) that the half-word emulator seems cute on the surface but deep down is a bad idea (esp. for a language with automatic memory management like Erlang, or if your application has any plans of growing someday). So I would really advice against it. In fact, IMO it's better to try to forget about its existence for anything other than for small embedded devices or in machines that do not have more than 3GB of memory. Unfortunately, I am very busy to elaborate more on this right now. But even if I had more time, I would probably try to find better things to do than think/talk about the half-word emulator. Leaning back and relax until you forget about it (or simply waiting for the day that it is taken out of the distribution) is preferable IMO. Kostis From andreas@REDACTED Fri Apr 4 13:33:37 2014 From: andreas@REDACTED (Andreas Schumacher) Date: Fri, 4 Apr 2014 13:33:37 +0200 Subject: [erlang-questions] Fwd: FW: Maximising memory compactness In-Reply-To: <58912684E2630B45963406CF7D8C52581C39692C@ESESSMB103.ericsson.se> References: <533E7DC2.6080209@cs.ntua.gr> <58912684E2630B45963406CF7D8C52581C39692C@ESESSMB103.ericsson.se> Message-ID: As a matter of fact, the half-word emulator will be deprecated in OTP 17.0, which will be released next week. The reason for that is that there have been very few (if any) users; and thus, the maintenance costs outweigh its value. Andreas Schumacher, Erlang/OTP, Ericsson AB -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto: erlang-questions-bounces@REDACTED] On Behalf Of Kostis Sagonas Sent: den 4 april 2014 11:39 To: Erlang Subject: Re: [erlang-questions] Maximising memory compactness On 04/04/2014 10:33 AM, Olivier BOUDEVILLE wrote: > Let's suppose one would like to run a large, distributed (Erlang) > application, with many processes, and that ends up, in some cases, > being RAM-bound. > ... > The half-word emulator would seem the simplest/most elegant solution > to do so .... > > So, my question: would relying on a set of 32-bit VMs per host, > instead of a single 64-bit VM, look like the best option here? My opinion is (and has always been) that the half-word emulator seems cute on the surface but deep down is a bad idea (esp. for a language with automatic memory management like Erlang, or if your application has any plans of growing someday). So I would really advice against it. In fact, IMO it's better to try to forget about its existence for anything other than for small embedded devices or in machines that do not have more than 3GB of memory. Unfortunately, I am very busy to elaborate more on this right now. But even if I had more time, I would probably try to find better things to do than think/talk about the half-word emulator. Leaning back and relax until you forget about it (or simply waiting for the day that it is taken out of the distribution) is preferable IMO. Kostis _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From arif.ishaq@REDACTED Fri Apr 4 14:10:05 2014 From: arif.ishaq@REDACTED (Arif Ishaq) Date: Fri, 4 Apr 2014 12:10:05 +0000 Subject: [erlang-questions] security concerns Message-ID: <1CAB695D2C2A8F4BB0B242A5B44C75E9125A9758@ESESSMB301.ericsson.se> I just saw a post by Carlos-Trigoso on the security, or rather lack thereof in Erlang (http://carlos-trigoso.com/2014/03/04/security-taken-lightly/) . It seems like a fair evaluation. Is there anything in the making to improve on it? Thanks and best regards Arif -------------- next part -------------- An HTML attachment was scrubbed... URL: From txrev319@REDACTED Fri Apr 4 14:10:13 2014 From: txrev319@REDACTED (t x) Date: Fri, 4 Apr 2014 05:10:13 -0700 Subject: [erlang-questions] kv store as a service Message-ID: Hi, This is my current setup: * a bunch of $5/month digital ocean droplets [1] * these droplets have a 20GB SSD harddrive Now, I need to have a gigantic key-value store. I don't want to deal with the error condition of "error: you ran out of disk space" In my particular design, I only have "create new value". I don't have "update value". Thus, I don't have to worry about invalidating caches, and intend to use the 20GB SSD drives as as "cache" for the real key-value store. Now, my question is: what should I use for my key-value store? I want to optimize for: * minimum cost * minimum administration Currently, the best I have is Amazon S3. (I'd prefer to not setup my own Riak cluster + deal with replication + how many servers to run + ... ). I'm okay with the 99.99% (or whatever SLA Amazon S3 provides). Question: Is S3 the right approach as a giant K-V store for my Erlang nodes to hit, or should I be using something else? Thanks! [1] This is not an advertisement for DO. I do not have any DO equity. From tuncer.ayaz@REDACTED Fri Apr 4 14:24:54 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 4 Apr 2014 14:24:54 +0200 Subject: [erlang-questions] Fwd: FW: Maximising memory compactness In-Reply-To: References: <533E7DC2.6080209@cs.ntua.gr> <58912684E2630B45963406CF7D8C52581C39692C@ESESSMB103.ericsson.se> Message-ID: On Fri, Apr 4, 2014 at 1:33 PM, Andreas Schumacher wrote: > As a matter of fact, the half-word emulator will be deprecated in > OTP 17.0, which will be released next week. The reason for that is > that there have been very few (if any) users; and thus, the > maintenance costs outweigh its value. FWIW, I use it. But more importantly, how did you measure the number of users? For comparison, JVM's compressed oops has been default enabled for a long time, but to be precise it's not _exactly_ the same thing. http://docs.oracle.com/javase/7/docs/technotes/guides/vm/performance-enhancements-7.html "Compressed oops is supported and enabled by default in Java SE 6u23 and later. In Java SE 7, use of compressed oops is the default for 64-bit JVM processes when -Xmx isn't specified and for values of -Xmx less than 32 gigabytes." https://wikis.oracle.com/display/HotSpotInternals/CompressedOops That said, what about implementing x32 ABI support as an alternative? As far as I can tell this would have to be explicitly implemented in HiPE too. > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Kostis Sagonas > Sent: den 4 april 2014 11:39 > To: Erlang > Subject: Re: [erlang-questions] Maximising memory compactness > > On 04/04/2014 10:33 AM, Olivier BOUDEVILLE wrote: >> Let's suppose one would like to run a large, distributed (Erlang) >> application, with many processes, and that ends up, in some cases, >> being RAM-bound. > > ... >> The half-word emulator would seem the simplest/most elegant solution >> to do so .... > > >> So, my question: would relying on a set of 32-bit VMs per host, >> instead of a single 64-bit VM, look like the best option here? > > My opinion is (and has always been) that the half-word emulator > seems cute on the surface but deep down is a bad idea (esp. for a > language with automatic memory management like Erlang, or if your > application has any plans of growing someday). > > So I would really advice against it. In fact, IMO it's better to try > to forget about its existence for anything other than for small > embedded devices or in machines that do not have more than 3GB of > memory. > > Unfortunately, I am very busy to elaborate more on this right now. > But even if I had more time, I would probably try to find better > things to do than think/talk about the half-word emulator. Leaning > back and relax until you forget about it (or simply waiting for the > day that it is taken out of the distribution) is preferable IMO. From essen@REDACTED Fri Apr 4 14:30:59 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Fri, 04 Apr 2014 14:30:59 +0200 Subject: [erlang-questions] security concerns In-Reply-To: <1CAB695D2C2A8F4BB0B242A5B44C75E9125A9758@ESESSMB301.ericsson.se> References: <1CAB695D2C2A8F4BB0B242A5B44C75E9125A9758@ESESSMB301.ericsson.se> Message-ID: <533EA603.2070602@ninenines.eu> I do not know of any programming language that provides automatic secure communication between nodes (most don't provide anything at all, meaning you have a lot more to take care of yourself), or access control for calling built-in functions (often just a matter of pushing a file to the server one way or another) (some languages allow *disabling* functions entirely, which is not the same). The post does not mention any, nor does it give any hint as to what should be considered for addition to Erlang. Distributed Erlang comes with very little to support multi-DC, considering it's fully meshed, deals badly with netsplits (global for example) and so on and so forth. It would be very surprising to see secure communication available before the other problems are solved. On 04/04/2014 02:10 PM, Arif Ishaq wrote: > I just saw a post by Carlos-Trigoso on the security, or rather lack > thereof in Erlang > (http://carlos-trigoso.com/2014/03/04/security-taken-lightly/) . > > It seems like a fair evaluation. Is there anything in the making to > improve on it? > > Thanks and best regards -- Lo?c Hoguin http://ninenines.eu From tuncer.ayaz@REDACTED Fri Apr 4 14:45:38 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 4 Apr 2014 14:45:38 +0200 Subject: [erlang-questions] beam.smp startup time regression Message-ID: The recent HiPE and half-word-emu threads made me recheck a subjective impression I had about the steady increase of beam.smp startup time over several OTP releases. I used to build with --enable-native-libs, but the already not quick enough startup time of beam.smp got even longer, so in default nodes I use neither HiPE nor --enable-native-libs. Unscientifically and quickly measured average time to run $ time erl -eval 'halt(0).' with different Erlang/OTP releases (no native-libs at all): # R13B03 real 0m0.261s # min 0.254 max 0.264 user 0m0.143s sys 0m0.020s # R14B04 real 0m0.293s # min 0.289 max 0.301 user 0m0.167s sys 0m0.033s # R15B03-1 real 0m0.318s # min 0.315 max 0.323 user 0m0.203s sys 0m0.002s # R16B03-1 real 0m0.373s # min 0.354 max 0.381 user 0m0.257s sys 0m0.053s To be precise, R16B03-1 is the only beam.smp with halfword-emu, but the last time I measured this some time back, R16 without halfword-emu on i386 was also considerably slower. I believe the R15 increase is due to Raimo's flushing fixes and that's the right thing to do, but it steadily increases with each release and especially so in R16. Personally, I think this is a regression and makes using escripts less fun than it used to be. A proper measurement would build beam.smp with the same configure flags and probably even use git-bisect to track down commits. I don't have time for this right now, but decreasing startup time could be a fun project :). From john@REDACTED Fri Apr 4 14:48:19 2014 From: john@REDACTED (John Kemp) Date: Fri, 04 Apr 2014 08:48:19 -0400 Subject: [erlang-questions] security concerns In-Reply-To: <1CAB695D2C2A8F4BB0B242A5B44C75E9125A9758@ESESSMB301.ericsson.se> References: <1CAB695D2C2A8F4BB0B242A5B44C75E9125A9758@ESESSMB301.ericsson.se> Message-ID: <533EAA13.9030101@jkemp.net> On 04/04/2014 08:10 AM, Arif Ishaq wrote: > I just saw a post by Carlos-Trigoso on the security, or rather lack > thereof in Erlang > (http://carlos-trigoso.com/2014/03/04/security-taken-lightly/) . > > It seems like a fair evaluation. I would suggest that it is _not_ a fair evaluation. As Lo?c mentioned, name any language or OS environment that does something like what the author suggests for Erlang? But more than that, why would protocols for connecting nodes inside of a network be the same as protocols used between data-centres, particularly when connections between data centres will possibly go across networks not owned by the owner of the data centres? The cookie mechanism used by Erlang seems perfectly fine within the context of a local network. If the threat is that an attacker could bring up a "rogue" node which was able to talk to the valid nodes, that attacker would first have to compromise the Erlang cookie value from another node on the network, at which point, you probably have worse problems than Erlang interconnection ones. Hypervisor security (in a virtualized environment) and standard network firewalling should take care of this. Perhaps there is some specific security threat there, but the author certainly doesn't mention it in any detail. As for across data centres, I would suggest that the common protocols for talking across insecure networks are used, for which TLS/SSL transport encryption is a very good suggestion from Fred. Any protocol you use in a high-latency, lossy connection should in any case likely be different than a protocol for low-latency, lossless communication between local nodes. - johnk > Is there anything in the making to > improve on it? > > Thanks and best regards > > Arif > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From egil@REDACTED Fri Apr 4 14:59:25 2014 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Fri, 4 Apr 2014 14:59:25 +0200 Subject: [erlang-questions] beam.smp startup time regression In-Reply-To: References: Message-ID: <533EACAD.8010205@erlang.org> Most the time you measure has to do with file handling and loading modules. I believe there is around 75 files (modules) that loads during startup. You can strip the system if you want faster load time and perhaps archives would be another choice. Also, async threads delivers some overhead, you can disable them (don't do it). // Bj?rn-Egil On 2014-04-04 14:45, Tuncer Ayaz wrote: > The recent HiPE and half-word-emu threads made me recheck a subjective > impression I had about the steady increase of beam.smp startup time > over several OTP releases. > > I used to build with --enable-native-libs, but the already not quick > enough startup time of beam.smp got even longer, so in default nodes I > use neither HiPE nor --enable-native-libs. > > Unscientifically and quickly measured average time to run > $ time erl -eval 'halt(0).' > with different Erlang/OTP releases (no native-libs at all): > > # R13B03 > real 0m0.261s # min 0.254 max 0.264 > user 0m0.143s > sys 0m0.020s > > # R14B04 > real 0m0.293s # min 0.289 max 0.301 > user 0m0.167s > sys 0m0.033s > > # R15B03-1 > real 0m0.318s # min 0.315 max 0.323 > user 0m0.203s > sys 0m0.002s > > # R16B03-1 > real 0m0.373s # min 0.354 max 0.381 > user 0m0.257s > sys 0m0.053s > > To be precise, R16B03-1 is the only beam.smp with halfword-emu, but > the last time I measured this some time back, R16 without halfword-emu > on i386 was also considerably slower. > > I believe the R15 increase is due to Raimo's flushing fixes and that's > the right thing to do, but it steadily increases with each release and > especially so in R16. > > Personally, I think this is a regression and makes using escripts less > fun than it used to be. > > A proper measurement would build beam.smp with the same configure > flags and probably even use git-bisect to track down commits. I don't > have time for this right now, but decreasing startup time could be a > fun project :). > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > From s.j.thompson@REDACTED Fri Apr 4 15:18:03 2014 From: s.j.thompson@REDACTED (Simon Thompson) Date: Fri, 4 Apr 2014 14:18:03 +0100 Subject: [erlang-questions] Dynamic Languages Symposium 2014 Message-ID: <1A1D01C0-92D8-4FDD-B66C-08D8C97F470F@kent.ac.uk> Something that some Erlangers may be interested in? Simon =========================================================================== Dynamic Languages Symposium 2014 October 21, 2014 Co-located with SPLASH 2014, Portland, OR, USA http://www.dynamic-languages-symposium.org/dls-14/ =========================================================================== The 10th Dynamic Languages Symposium (DLS) at SPLASH 2014 is the premier forum for researchers and practitioners to share knowledge and research on dynamic languages, their implementation, and applications. The influence of dynamic languages -- from Lisp to Smalltalk to Python to Javascript -- on real-world practice, and research, continues to grow. DLS 2014 invites high quality papers reporting original research, innovative contributions, or experience related to dynamic languages, their implementation, and applications. Accepted papers will be published in the ACM Digital Library, and freely available for 2 weeks before and after the event itself. Areas of interest include but are not limited to: * Innovative language features and implementation techniques * Development and platform support, tools * Interesting applications * Domain-oriented programming * Very late binding, dynamic composition, and run-time adaptation * Reflection and meta-programming * Software evolution * Language symbiosis and multi-paradigm languages * Dynamic optimization * Hardware support * Experience reports and case studies * Educational approaches and perspectives * Semantics of dynamic languages Submissions Submissions should not have been published previously nor be under review at other events. Research papers should describe work that advances the current state of the art. Experience papers should be of broad interest and should describe insights gained from substantive practical applications. The program committee will evaluate each contributed paper based on its relevance, significance, clarity, length, and originality. Papers are to be submitted electronically at http://www.easychair.org/conferences?conf=dls14 in PDF format. Submissions must be in the ACM format (see http://www.sigplan.org/authorInformation.htm) and not exceed 12 pages. Authors are reminded that brevity is a virtue. DLS 2014 will run a two-phase reviewing process to help authors make their final papers the best that they can be. After the first round of reviews, papers will be rejected, conditionally accepted, or unconditionally accepted. Conditionally accepted papers will be given a list of issues raised by reviewers. Authors will then submit a revised version of the paper with a cover letter explaining how they have / why they have not addressed these issues. The reviewers will then consider the cover letter and revised paper and recommend final acceptance / rejection. Important dates Submissions: June 8 2014 (FIRM DEADLINE) First phase notification: July 14 2014 Revisions due: August 4 2014 Final notification: August 11 2014 Camera ready: August 15 2014 DLS: October 21 2014 Programme chair Laurence Tratt, King's College London, UK e-mail: dls14@REDACTED Publicity chair Edd Barrett, King's College London, UK Programme committee Gilad Bracha, Google, US Jonathan Edwards, MIT, US Robert Hirschfeld, Hasso-Plattner-Institut Potsdam, DE Roberto Ierusalimschy, PUC-Rio, BR Sergio Maffeis, Imperial College London, UK Stefan Marr, INRIA, FR Oscar Nierstrasz, University of Bern, CH James Noble, Victoria University of Wellington, NZ Shriram Krishnamurthi, Brown University, US Chris Seaton, University of Manchester, UK Nikolai Tillmann, Microsoft Research, US Sam Tobin-Hochstadt, Indiana University, US Jan Vitek, Purdue University, US Christian Wimmer, Oracle Labs, US Peng Wu, IBM Research, US Simon Thompson | Professor of Logic and Computation School of Computing | University of Kent | Canterbury, CT2 7NF, UK s.j.thompson@REDACTED | M +44 7986 085754 | W www.cs.kent.ac.uk/~sjt From mfidelman@REDACTED Fri Apr 4 15:44:30 2014 From: mfidelman@REDACTED (Miles Fidelman) Date: Fri, 04 Apr 2014 09:44:30 -0400 Subject: [erlang-questions] security concerns In-Reply-To: <533EAA13.9030101@jkemp.net> References: <1CAB695D2C2A8F4BB0B242A5B44C75E9125A9758@ESESSMB301.ericsson.se> <533EAA13.9030101@jkemp.net> Message-ID: <533EB73E.7000806@meetinghouse.net> John Kemp wrote: > On 04/04/2014 08:10 AM, Arif Ishaq wrote: >> I just saw a post by Carlos-Trigoso on the security, or rather lack >> thereof in Erlang >> (http://carlos-trigoso.com/2014/03/04/security-taken-lightly/) . >> >> It seems like a fair evaluation. > > I would suggest that it is _not_ a fair evaluation. > > As Lo?c mentioned, name any language or OS environment that does > something like what the author suggests for Erlang? Well.... Fabric comes to mind: http://web.mit.edu/fabric_v0.2.0/fabric.pdf, so does E (erights.org). As does a LOT of work in the areas of secure distributed operating systems, distributed agent systems, and such. I guess you could also look at various web service platforms. On the other hand, Erlang stands alone as a mature, proven, in-production distributed run-time environment for highly concurrent systems - so it's not clear that comparisons to other languages or operating system environments apply. > > But more than that, why would protocols for connecting nodes inside of > a network be the same as protocols used between data-centres, > particularly when connections between data centres will possibly go > across networks not owned by the owner of the data centres? > Am I wrong, but I wasn't under the impression that Erlang's distributed processing functions are only for connecting nodes inside a data center. Miles Fidelman -- In theory, there is no difference between theory and practice. In practice, there is. .... Yogi Berra From tuncer.ayaz@REDACTED Fri Apr 4 16:10:12 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 4 Apr 2014 16:10:12 +0200 Subject: [erlang-questions] beam.smp startup time regression In-Reply-To: <533EACAD.8010205@erlang.org> References: <533EACAD.8010205@erlang.org> Message-ID: On Fri, Apr 4, 2014 at 2:59 PM, Bj?rn-Egil Dahlberg wrote: > Most the time you measure has to do with file handling and loading > modules. I believe there is around 75 files (modules) that loads > during startup. Recalling the code from the last time (2011) I touched escript.erl and erl_prim_loader, it's a safe assumption to make that we won't be able to exclude anything of significance out of the 75 files for implementing a slim startup mode for escript. > You can strip the system if you want faster load time and perhaps > archives would be another choice. Assuming, it would speed up load time, any reason why the default install does not use stdlib-1.19.4.ez, ssl-5.5.3.ez etc, besides "we didn't have a need for it"? Also, maybe the code increase due to Bjorn's line number implementation is also responsible for some of the time. And, no, I wouldn't want to miss it :). Node startup should be profiled, and given Erlang/OTP's primary use case, there might be fruit reachable with a short ladder. > Also, async threads delivers some overhead, you can disable them > (don't do it). Going from zero to ten kernel threads (spun up by default) is not cheap, and the lowest I could get with R16B03-1 +A0 was "real 0.342s". > On 2014-04-04 14:45, Tuncer Ayaz wrote: >> >> The recent HiPE and half-word-emu threads made me recheck a subjective >> impression I had about the steady increase of beam.smp startup time >> over several OTP releases. >> >> I used to build with --enable-native-libs, but the already not quick >> enough startup time of beam.smp got even longer, so in default nodes I >> use neither HiPE nor --enable-native-libs. >> >> Unscientifically and quickly measured average time to run >> $ time erl -eval 'halt(0).' >> with different Erlang/OTP releases (no native-libs at all): >> >> # R13B03 >> real 0m0.261s # min 0.254 max 0.264 >> user 0m0.143s >> sys 0m0.020s >> >> # R14B04 >> real 0m0.293s # min 0.289 max 0.301 >> user 0m0.167s >> sys 0m0.033s >> >> # R15B03-1 >> real 0m0.318s # min 0.315 max 0.323 >> user 0m0.203s >> sys 0m0.002s >> >> # R16B03-1 >> real 0m0.373s # min 0.354 max 0.381 >> user 0m0.257s >> sys 0m0.053s >> >> To be precise, R16B03-1 is the only beam.smp with halfword-emu, but >> the last time I measured this some time back, R16 without halfword-emu >> on i386 was also considerably slower. >> >> I believe the R15 increase is due to Raimo's flushing fixes and that's >> the right thing to do, but it steadily increases with each release and >> especially so in R16. >> >> Personally, I think this is a regression and makes using escripts less >> fun than it used to be. >> >> A proper measurement would build beam.smp with the same configure >> flags and probably even use git-bisect to track down commits. I >> don't have time for this right now, but decreasing startup time >> could be a fun project :). From olivier.boudeville@REDACTED Fri Apr 4 16:11:29 2014 From: olivier.boudeville@REDACTED (Olivier BOUDEVILLE) Date: Fri, 4 Apr 2014 16:11:29 +0200 Subject: [erlang-questions] RE Fwd: FW: Maximising memory compactness In-Reply-To: References: <533E7DC2.6080209@cs.ntua.gr> <58912684E2630B45963406CF7D8C52581C39692C@ESESSMB103.ericsson.se> Message-ID: Hi, > > As a matter of fact, the half-word emulator will be deprecated in > OTP 17.0, which will be released next week. The reason for that is > that there have been very few (if any) users; and thus, the > maintenance costs outweigh its value. > > Andreas Schumacher, Erlang/OTP, Ericsson AB > Thanks to all for your pieces of advice; so we will stay away from the half-word emulator then (despite its interesting features), and probably bet on multiple 32-bit VMs instead. Jesper: I should have mentioned that we are not using ETS (just many processes, each looping over its own state, seen as a mere Erlang term). Daniel : indeed, in terms of memory, we would lose, for each additional node, the base footprint of a blank VM + application-specific modules and all; but I think overall we would still gain *a lot* (of course this would deserve being verified!); currently processings and data are rather well-dispatched, everything is quite fine grain, hence we can keep a uniform solution (no ETS node or alike); the goal of an increased in-RAM compactness is to be able to reduce the number of nodes, which we believe is the biggest showstopper in terms of scaling Thanks for your answers! Best regards, Olivier. > > -----Original Message----- > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions- > bounces@REDACTED] On Behalf Of Kostis Sagonas > Sent: den 4 april 2014 11:39 > To: Erlang > Subject: Re: [erlang-questions] Maximising memory compactness > > On 04/04/2014 10:33 AM, Olivier BOUDEVILLE wrote: > > Let's suppose one would like to run a large, distributed (Erlang) > > application, with many processes, and that ends up, in some cases, > > being RAM-bound. > > ... > > The half-word emulator would seem the simplest/most elegant solution > > to do so .... > > > > So, my question: would relying on a set of 32-bit VMs per host, > > instead of a single 64-bit VM, look like the best option here? > > My opinion is (and has always been) that the half-word emulator > seems cute on the surface but deep down is a bad idea (esp. for a > language with automatic memory management like Erlang, or if your > application has any plans of growing someday). > > So I would really advice against it. In fact, IMO it's better to try > to forget about its existence for anything other than for small > embedded devices or in machines that do not have more than 3GB of memory. > > Unfortunately, I am very busy to elaborate more on this right now. > But even if I had more time, I would probably try to find better > things to do than think/talk about the half-word emulator. Leaning > back and relax until you forget about it (or simply waiting for the > day that it is taken out of the distribution) is preferable IMO. > > Kostis > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- Ce message et toutes les pi?ces jointes (ci-apr?s le 'Message') sont ?tablis ? l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme ? sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse. Si vous n'?tes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez re?u ce Message par erreur, merci de le supprimer de votre syst?me, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions ?galement d'en avertir imm?diatement l'exp?diteur par retour du message. Il est impossible de garantir que les communications par messagerie ?lectronique arrivent en temps utile, sont s?curis?es ou d?nu?es de toute erreur ou virus. ____________________________________________________ This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message. E-mail communication cannot be guaranteed to be timely secure, error or virus-free. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Fri Apr 4 16:25:51 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Fri, 4 Apr 2014 16:25:51 +0200 Subject: [erlang-questions] security concerns In-Reply-To: <533EAA13.9030101@jkemp.net> References: <1CAB695D2C2A8F4BB0B242A5B44C75E9125A9758@ESESSMB301.ericsson.se> <533EAA13.9030101@jkemp.net> Message-ID: On Fri, Apr 4, 2014 at 2:48 PM, John Kemp wrote: > As Lo?c mentioned, name any language or OS environment that does something > like what the author suggests for Erlang? There is the CSlab STEAM project: http://www.erlang.se/publications/paam97.pdf which is about Secure Mobile Agents written as an Erlang extension. The basic idea is that you can host untrusted agents in "the open" but still have security inside the system. It does not touch too much on the part of secure communication, but the concern is definitely there. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From john@REDACTED Fri Apr 4 16:26:30 2014 From: john@REDACTED (John Kemp) Date: Fri, 04 Apr 2014 10:26:30 -0400 Subject: [erlang-questions] security concerns In-Reply-To: <533EB73E.7000806@meetinghouse.net> References: <1CAB695D2C2A8F4BB0B242A5B44C75E9125A9758@ESESSMB301.ericsson.se> <533EAA13.9030101@jkemp.net> <533EB73E.7000806@meetinghouse.net> Message-ID: <533EC116.6020205@jkemp.net> On 04/04/2014 09:44 AM, Miles Fidelman wrote: > John Kemp wrote: >> On 04/04/2014 08:10 AM, Arif Ishaq wrote: >>> I just saw a post by Carlos-Trigoso on the security, or rather lack >>> thereof in Erlang >>> (http://carlos-trigoso.com/2014/03/04/security-taken-lightly/) . >>> >>> It seems like a fair evaluation. >> >> I would suggest that it is _not_ a fair evaluation. >> >> As Lo?c mentioned, name any language or OS environment that does >> something like what the author suggests for Erlang? > > Well.... Fabric comes to mind: > http://web.mit.edu/fabric_v0.2.0/fabric.pdf, so does E (erights.org). As > does a LOT of work in the areas of secure distributed operating systems, > distributed agent systems, and such. Ah, yes, if you are talking about object capability languages, then we're into a different ballgame. In commonly-used languages, only ECMAScript, as implemented in browsers (not node) is also close: http://wiki.ecmascript.org/doku.php?id=ses:ses. And then we have the other secure Javascript variants, Caja, FBJS and Adsafe. None of these address how network nodes talk to each other at all. iGoogle (using Caja) did address how malicious code could be prevented from messing with valid code even when Javascripts came from different vendors and was combined within the same iGoogle page. iframe sandboxing and several other techniques are used in web pages to allow message passing between DOM nodes within the web browser, which is a somewhat similar (but not identical) problem. > > I guess you could also look at various web service platforms. > > On the other hand, Erlang stands alone as a mature, proven, > in-production distributed run-time environment for highly concurrent > systems - so it's not clear that comparisons to other languages or > operating system environments apply. > >> >> But more than that, why would protocols for connecting nodes inside of >> a network be the same as protocols used between data-centres, >> particularly when connections between data centres will possibly go >> across networks not owned by the owner of the data centres? >> > Am I wrong, but I wasn't under the impression that Erlang's distributed > processing functions are only for connecting nodes inside a data center. Just to take one example. The Amazon Dynamo paper describes a gossip protocol between nodes on a ring. Would you want to implement that same gossip protocol across two data centres separated by high-latency networks? I wouldn't. Erlang nodes pass messages to each other in patterns defined by application developers. In some cases, those patterns will be appropriate between DCs, but in others, they probably won't. Speaking personally, I would still not (except in rare cases) expect a protocol used for connecting nodes inside a local network to be appropriate for connecting nodes across WANs, regardless of whether it is possible to do so. - johnk > > Miles Fidelman > From g@REDACTED Fri Apr 4 16:30:24 2014 From: g@REDACTED (Garrett Smith) Date: Fri, 4 Apr 2014 09:30:24 -0500 Subject: [erlang-questions] security concerns In-Reply-To: <1CAB695D2C2A8F4BB0B242A5B44C75E9125A9758@ESESSMB301.ericsson.se> References: <1CAB695D2C2A8F4BB0B242A5B44C75E9125A9758@ESESSMB301.ericsson.se> Message-ID: On Fri, Apr 4, 2014 at 7:10 AM, Arif Ishaq wrote: > I just saw a post by Carlos-Trigoso on the security, or rather lack thereof > in Erlang (http://carlos-trigoso.com/2014/03/04/security-taken-lightly/) . > > It seems like a fair evaluation. Is there anything in the making to improve > on it? Fairness aside, and in keeping with the other comments on this thread, you can tackle this problem at the application level. This library provides an easy, safe, secure way to communicate between not only Erlang based processes, but also include slew of other languages that have CZMQ support: https://github.com/gar1t/erlang-czmq Garrett From tuncer.ayaz@REDACTED Fri Apr 4 16:49:11 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 4 Apr 2014 16:49:11 +0200 Subject: [erlang-questions] beam.smp startup time regression In-Reply-To: References: <533EACAD.8010205@erlang.org> Message-ID: In addition to "erl -eval 'halt(0).'", I tried "rebar --version", and the results (ignoring extreme outliers) with R16B03-1 +A0 are promising. $ time rebar --version low: real 0m0.280s user 0m0.240s sys 0m0.053s high: real 0m0.375s user 0m0.313s sys 0m0.063s $ export ERL_FLAGS=+A0 $ time rebar --version low: real 0m0.244s user 0m0.200s sys 0m0.037s high: real 0m0.262s user 0m0.217s sys 0m0.033s Egil, would you advise against adding +A0 to rebar's escript emu_args in the header? I mean, is it generally important to have async threads for any kind of erlang code running on R16 and later? From dangud@REDACTED Fri Apr 4 17:01:00 2014 From: dangud@REDACTED (Dan Gudmundsson) Date: Fri, 4 Apr 2014 17:01:00 +0200 Subject: [erlang-questions] beam.smp startup time regression In-Reply-To: References: <533EACAD.8010205@erlang.org> Message-ID: Doesn't rebar compile erlang files in parallel? If so you want async threads.. On Fri, Apr 4, 2014 at 4:49 PM, Tuncer Ayaz wrote: > In addition to "erl -eval 'halt(0).'", I tried "rebar --version", and > the results (ignoring extreme outliers) with R16B03-1 +A0 are > promising. > > $ time rebar --version > low: > real 0m0.280s > user 0m0.240s > sys 0m0.053s > > high: > real 0m0.375s > user 0m0.313s > sys 0m0.063s > > $ export ERL_FLAGS=+A0 > $ time rebar --version > low: > real 0m0.244s > user 0m0.200s > sys 0m0.037s > > high: > real 0m0.262s > user 0m0.217s > sys 0m0.033s > > Egil, would you advise against adding +A0 to rebar's escript emu_args > in the header? I mean, is it generally important to have async threads > for any kind of erlang code running on R16 and later? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From egil@REDACTED Fri Apr 4 17:10:36 2014 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Fri, 4 Apr 2014 17:10:36 +0200 Subject: [erlang-questions] beam.smp startup time regression In-Reply-To: References: <533EACAD.8010205@erlang.org> Message-ID: <533ECB6C.3090005@erlang.org> Async threads are there for a reason. If your threads (schedulers hangs on files - nfs for instance) you are in big trouble, time will not progress in the system - hence the async threads. This has been reiterated many times on this list. I think the better solution would be to use archives instead, fewer files to load and hence fewer file access latency overheads. I believe this would help the startup time greatly. So why don't we have archives right now .. well modules works fine and there hasn't been a great need for archives. Ideally applications should be compiled to archives directly and loaded as an application entity, not as modules. This would have other implications as well .. such as we could allow inlining between modules within the same application. Holistically, application entities would be great! For escript +A0 might work in some cases but I would not recommend it. In most cases it would probably seem like it works fine though. // Bj?rn-Egil On 2014-04-04 16:49, Tuncer Ayaz wrote: > In addition to "erl -eval 'halt(0).'", I tried "rebar --version", and > the results (ignoring extreme outliers) with R16B03-1 +A0 are > promising. > > $ time rebar --version > low: > real 0m0.280s > user 0m0.240s > sys 0m0.053s > > high: > real 0m0.375s > user 0m0.313s > sys 0m0.063s > > $ export ERL_FLAGS=+A0 > $ time rebar --version > low: > real 0m0.244s > user 0m0.200s > sys 0m0.037s > > high: > real 0m0.262s > user 0m0.217s > sys 0m0.033s > > Egil, would you advise against adding +A0 to rebar's escript emu_args > in the header? I mean, is it generally important to have async threads > for any kind of erlang code running on R16 and later? > > From andreas@REDACTED Fri Apr 4 17:26:01 2014 From: andreas@REDACTED (Andreas Schumacher) Date: Fri, 4 Apr 2014 17:26:01 +0200 Subject: [erlang-questions] Fwd: Maximising memory compactness In-Reply-To: <58912684E2630B45963406CF7D8C52581C396E8C@ESESSMB103.ericsson.se> References: <58912684E2630B45963406CF7D8C52581C396E8C@ESESSMB103.ericsson.se> Message-ID: Honestly, we did not measure the number of users, but we made a rough guess based on the questions, comments, and/or bug reports we got for the half-word emulator. Andreas -----Original Message----- From: Tuncer Ayaz [mailto:tuncer.ayaz@REDACTED] Sent: den 4 april 2014 14:25 To: Andreas Schumacher Cc: erlang-questions@REDACTED; Olivier BOUDEVILLE Subject: Re: [erlang-questions] Fwd: FW: Maximising memory compactness On Fri, Apr 4, 2014 at 1:33 PM, Andreas Schumacher wrote: > As a matter of fact, the half-word emulator will be deprecated in OTP > 17.0, which will be released next week. The reason for that is that > there have been very few (if any) users; and thus, the maintenance > costs outweigh its value. FWIW, I use it. But more importantly, how did you measure the number of users? For comparison, JVM's compressed oops has been default enabled for a long time, but to be precise it's not _exactly_ the same thing. http://docs.oracle.com/javase/7/docs/technotes/guides/vm/performance-enhancements-7.html "Compressed oops is supported and enabled by default in Java SE 6u23 and later. In Java SE 7, use of compressed oops is the default for 64-bit JVM processes when -Xmx isn't specified and for values of -Xmx less than 32 gigabytes." https://wikis.oracle.com/display/HotSpotInternals/CompressedOops That said, what about implementing x32 ABI support as an alternative? As far as I can tell this would have to be explicitly implemented in HiPE too. > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Kostis > Sagonas > Sent: den 4 april 2014 11:39 > To: Erlang > Subject: Re: [erlang-questions] Maximising memory compactness > > On 04/04/2014 10:33 AM, Olivier BOUDEVILLE wrote: >> Let's suppose one would like to run a large, distributed (Erlang) >> application, with many processes, and that ends up, in some cases, >> being RAM-bound. > > ... >> The half-word emulator would seem the simplest/most elegant solution >> to do so .... > > >> So, my question: would relying on a set of 32-bit VMs per host, >> instead of a single 64-bit VM, look like the best option here? > > My opinion is (and has always been) that the half-word emulator seems > cute on the surface but deep down is a bad idea (esp. for a language > with automatic memory management like Erlang, or if your application > has any plans of growing someday). > > So I would really advice against it. In fact, IMO it's better to try > to forget about its existence for anything other than for small > embedded devices or in machines that do not have more than 3GB of > memory. > > Unfortunately, I am very busy to elaborate more on this right now. > But even if I had more time, I would probably try to find better > things to do than think/talk about the half-word emulator. Leaning > back and relax until you forget about it (or simply waiting for the > day that it is taken out of the distribution) is preferable IMO. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ericbmerritt@REDACTED Fri Apr 4 18:01:25 2014 From: ericbmerritt@REDACTED (Eric Merritt) Date: Fri, 4 Apr 2014 09:01:25 -0700 Subject: [erlang-questions] [ANN] ErlangCamp Austin 2014 Message-ID: *Greetings all, We are happy to announce ErlangCamp 2014 is going to be in Austin, Texas this Fall on October the 10th and 11th. ErlangCamp is a two day hands on workshop for those wanting to go from novice or even an experienced level of programming Erlang to being able to confidently write production grade Erlang/OTP applications. Erlang Camp Austin is an opportunity to learn from Erlang/OTP experts. Engineers who have put many lines of code into production at companies of all sizes. Two of the presenters are the authors of "Erlang and OTP in Action". The curriculum will roughly follow the progression from the book (found at http://manning.com/logan) but present a great deal of new material from different angles. When you leave you will know how to confidently put massively parallel, fault tolerant, distributed Erlang/OTP applications into production and then manage them from there. For more information and early-bird registration price of only 100 dollars, please go to: http://erlangcamp.com. To keep up with what is going on with the Camp you can follow us on twitter here http://twitter.com/erlangcamp or register for an email update on the site. For any questions, please e-mail us at organizers@REDACTED Thanks, The Erlang Camp team* -------------- next part -------------- An HTML attachment was scrubbed... URL: From Mark.Stoutchinine@REDACTED Fri Apr 4 17:50:18 2014 From: Mark.Stoutchinine@REDACTED (Stoutchinine, Mark) Date: Fri, 4 Apr 2014 15:50:18 +0000 Subject: [erlang-questions] cross compile of Erlang/OTP In-Reply-To: References: <7AC31FA7545D7F418D86AE1CF4C6044C75EB63@VEREXCH02.harrisbroadcast.com> Message-ID: <7AC31FA7545D7F418D86AE1CF4C6044C75EBC9@VEREXCH02.harrisbroadcast.com> Hello, Thanks to everyone who responded. I realized that Erlang/OTP package has to be installed on build system to cross compile. I had to dig into ?configure? to make things work. It is not clear from INSTALL document. Thanks. Mark. From: Dmitry Kolesnikov [mailto:dmkolesnikov@REDACTED] Sent: Wednesday, April 02, 2014 2:13 PM To: Stoutchinine, Mark Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] cross compile of Erlang/OTP Hello, Just to double check... Have you used ./otp_build configure \ --xcomp-conf=... and make noboot to build things. What environment your are trying to build it and what compiler ? Best Regards, Dmitry >-|-|-(*> On 02 Apr 2014, at 18:54, "Stoutchinine, Mark" > wrote: Hello Everyone, I am looking for help with cross compilation. I am following the instruction on how to cross compile Erlang/OTP and it seems worked, I got bin//. built and there are multiple utilities/apps/executables exist in it: >> ls -al -rwxrwxr-x 1 mstoutch mstoutch 176653 Apr 2 11:19 epmd -rwxrwxr-x 1 mstoutch mstoutch 108341 Apr 2 11:19 erlc -rwxrwxr-x 1 mstoutch mstoutch 165065 Apr 2 11:19 erlexec -rwxrwxr-x 1 mstoutch mstoutch 105782 Apr 2 11:19 escript -rwxrwxr-x 1 mstoutch mstoutch 37746 Apr 2 11:19 heart -rwxrwxr-x 1 mstoutch mstoutch 154805 Apr 2 11:19 inet_gethost -rwxrwxr-x 1 mstoutch mstoutch 66273 Apr 2 11:19 run_erl -rwxrwxr-x 1 mstoutch mstoutch 32142 Apr 2 11:19 to_erl -rwxrwxr-x 1 mstoutch mstoutch 99598 Apr 2 11:19 typer erlc is definetly cross compiled: >> file ./bin/powerpc-none-linux-gnu/erlc ./bin/powerpc-none-linux-gnu/erlc: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0x07b32270e1dd4993ea729db6af2e3b42e1024c96, with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70401, not stripped Now at later stages when build process is trying to build some applications like asn1, it fails because it is trying to run cross built erlc on host system, which is incorrect ? wrong architecture: ?.. make[1]: Leaving directory `/home/shares/public/mstoutch/otp_src_R16B03-1/erts' cd lib && \ ERL_TOP=/home/shares/public/mstoutch/otp_src_R16B03-1 PATH=/home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin:"${PATH}" \ make opt SECONDARY_BOOTSTRAP=true make[1]: Entering directory `/home/shares/public/mstoutch/otp_src_R16B03-1/lib' make[2]: Entering directory `/home/shares/public/mstoutch/otp_src_R16B03-1/lib/asn1/src' erlc -W -bbeam -o../ebin +debug_info -I/home/shares/public/mstoutch/otp_src_R16B03-1/lib/stdlib -Werror -Dvsn=\"2.0.4\" asn1ct.erl /home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin/erlc: 1: /home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin/erlc: Syntax error: end of file unexpected make[2]: *** [../ebin/asn1ct.beam] Error 2 ?. Does anyone know how to turn this off, configure the build not to do that, or maybe I am doing something wrong and it is not supposed to use host erlc? Or I need to rebuild these applications on target? Anyone had this problem before? Thank a lot to everyone. Mark ______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com ______________________________________________________________________ _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions ______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com ______________________________________________________________________ ______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com ______________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Fri Apr 4 19:20:48 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 4 Apr 2014 19:20:48 +0200 Subject: [erlang-questions] beam.smp startup time regression In-Reply-To: References: <533EACAD.8010205@erlang.org> Message-ID: On Fri, Apr 4, 2014 at 5:01 PM, Dan Gudmundsson wrote: > Doesn't rebar compile erlang files in parallel? Yes, -j/--jobs defaults to 3 processes. > If so you want async threads.. Have I been under the wrong impression that the process schedulers independently make use of os threads and that +AN is for inet_drv, efile_drv, zlib_drv, etc.? I mean, I was under the impression that +AN is mostly for erl_check_io. > On Fri, Apr 4, 2014 at 4:49 PM, Tuncer Ayaz wrote: >> >> In addition to "erl -eval 'halt(0).'", I tried "rebar --version", >> and the results (ignoring extreme outliers) with R16B03-1 +A0 are >> promising. >> >> $ time rebar --version >> low: >> real 0m0.280s >> user 0m0.240s >> sys 0m0.053s >> >> high: >> real 0m0.375s >> user 0m0.313s >> sys 0m0.063s >> >> $ export ERL_FLAGS=+A0 >> $ time rebar --version >> low: >> real 0m0.244s >> user 0m0.200s >> sys 0m0.037s >> >> high: >> real 0m0.262s >> user 0m0.217s >> sys 0m0.033s >> >> Egil, would you advise against adding +A0 to rebar's escript >> emu_args in the header? I mean, is it generally important to have >> async threads for any kind of erlang code running on R16 and later? From tuncer.ayaz@REDACTED Fri Apr 4 19:46:56 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 4 Apr 2014 19:46:56 +0200 Subject: [erlang-questions] beam.smp startup time regression In-Reply-To: <533ECB6C.3090005@erlang.org> References: <533EACAD.8010205@erlang.org> <533ECB6C.3090005@erlang.org> Message-ID: On Fri, Apr 4, 2014 at 5:10 PM, Bj?rn-Egil Dahlberg wrote: > Async threads are there for a reason. If your threads (schedulers > hangs on files - nfs for instance) you are in big trouble, time will > not progress in the system - hence the async threads. This has been > reiterated many times on this list. Sure, I won't argue with that, but the change from +A0 to +A10 was made in R16, so was async-threads support experimental in the past? I'd have to check the archives, but IIRC, +A10 was made the default for some other reason, so if it was a bad idea to run +A0, why did it take this long for the default to change. Did everyone, including the OTP team, always override the default? Does that mean +Ktrue should also be the default in 18.0? > I think the better solution would be to use archives instead, fewer > files to load and hence fewer file access latency overheads. I > believe this would help the startup time greatly. I totally agree. > So why don't we have archives right now .. well modules works fine > and there hasn't been a great need for archives. Ideally > applications should be compiled to archives directly and loaded as > an application entity, not as modules. This would have other > implications as well .. such as we could allow inlining between > modules within the same application. Holistically, application > entities would be great! Good idea, but maybe we should take small steps: 1. install only .ez files 2. fix code that had assumptions I have a feeling that there's enough stuff to fix doing that, before we can attempt to change the unit of compilation. If the compiler has to produce .ez files, it most probably also has to more tightly rely on and integrate an .app file. That raises various questions: * how do I easily change the version of stdlib-1.2.3.ez? - let erlc repackage the .ez file without touching the .beam files? * should, say, ssl-1.2.3 hard-require a precise version of stdlib? * etc... With that being said, I very much like the goal, and it's way overdue. That will hopefully put to rest all the confusion why it's a good idea (or rebar requirement) to provide .app[.src[.script]]. > For escript +A0 might work in some cases but I would not recommend > it. In most cases it would probably seem like it works fine though. My motivation for asking, besides startup time, is that the default has been +A0 for all those years. Therefore, I didn't assume +A0 to be a bad choice. > On 2014-04-04 16:49, Tuncer Ayaz wrote: >> >> In addition to "erl -eval 'halt(0).'", I tried "rebar --version", and >> the results (ignoring extreme outliers) with R16B03-1 +A0 are >> promising. >> >> $ time rebar --version >> low: >> real 0m0.280s >> user 0m0.240s >> sys 0m0.053s >> >> high: >> real 0m0.375s >> user 0m0.313s >> sys 0m0.063s >> >> $ export ERL_FLAGS=+A0 >> $ time rebar --version >> low: >> real 0m0.244s >> user 0m0.200s >> sys 0m0.037s >> >> high: >> real 0m0.262s >> user 0m0.217s >> sys 0m0.033s >> >> Egil, would you advise against adding +A0 to rebar's escript emu_args >> in the header? I mean, is it generally important to have async threads >> for any kind of erlang code running on R16 and later? From wallentin.dahlberg@REDACTED Fri Apr 4 19:57:54 2014 From: wallentin.dahlberg@REDACTED (=?UTF-8?Q?Bj=C3=B6rn=2DEgil_Dahlberg?=) Date: Fri, 4 Apr 2014 19:57:54 +0200 Subject: [erlang-questions] beam.smp startup time regression In-Reply-To: References: <533EACAD.8010205@erlang.org> <533ECB6C.3090005@erlang.org> Message-ID: 2014-04-04 19:46 GMT+02:00 Tuncer Ayaz : > On Fri, Apr 4, 2014 at 5:10 PM, Bj?rn-Egil Dahlberg > wrote: > > Async threads are there for a reason. If your threads (schedulers > > hangs on files - nfs for instance) you are in big trouble, time will > > not progress in the system - hence the async threads. This has been > > reiterated many times on this list. > > Sure, I won't argue with that, but the change from +A0 to +A10 was > made in R16, so was async-threads support experimental in the past? > I'd have to check the archives, but IIRC, +A10 was made the default > for some other reason, so if it was a bad idea to run +A0, why did it > take this long for the default to change. Did everyone, including the > OTP team, always override the default? > > When the mechanism of "thread progress" was introduced to increase runtime scalability the schedulers became more sensitive to long interruptions. Rickard does not like to acknowledge this, but I think he would at least agree that the symptom became more plain. That's why 10 async threads became the default. I say it again .. don't mess with the schedulers. ^^ The problem was there before but it was not as hostile. =) // Bj?rn-Egil -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Fri Apr 4 20:09:58 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 4 Apr 2014 20:09:58 +0200 Subject: [erlang-questions] Maximising memory compactness In-Reply-To: References: <58912684E2630B45963406CF7D8C52581C396E8C@ESESSMB103.ericsson.se> Message-ID: On Fri, Apr 4, 2014 at 5:26 PM, Andreas Schumacher wrote: > Honestly, we did not measure the number of users, but we made a > rough guess based on the questions, comments, and/or bug reports we > got for the half-word emulator. I'm not arguing for or against halfword-emu, as I'm not the designated maintainer, but it just works and most likely does for everyone else who has it enabled. I never had a bug caused by it, and on some machines it's the reason I can use Dialyzer with an amd64 beam.smp. If my professional experience with users of code I was responsible for is any indication, then it's very safe to assume that users only report bugs. I've learned that users won't even report back if a hotfix works. Hence, you can't use non-existence of bug reports or comments as an indication of how widely/successfully something is used. Some code has vocal users (gamers), most doesn't. As you didn't answer the x32 ABI question, I take that to mean there's no plan for that. Correct? > -----Original Message----- > From: Tuncer Ayaz [mailto:tuncer.ayaz@REDACTED] > Sent: den 4 april 2014 14:25 > To: Andreas Schumacher > Cc: erlang-questions@REDACTED; Olivier BOUDEVILLE > Subject: Re: [erlang-questions] Fwd: FW: Maximising memory compactness > > On Fri, Apr 4, 2014 at 1:33 PM, Andreas Schumacher wrote: >> As a matter of fact, the half-word emulator will be deprecated in >> OTP 17.0, which will be released next week. The reason for that is >> that there have been very few (if any) users; and thus, the >> maintenance costs outweigh its value. > > FWIW, I use it. But more importantly, how did you measure the number > of users? For comparison, JVM's compressed oops has been default > enabled for a long time, but to be precise it's not _exactly_ the > same thing. > > http://docs.oracle.com/javase/7/docs/technotes/guides/vm/performance-enhancements-7.html > "Compressed oops is supported and enabled by default in Java SE 6u23 > and later. In Java SE 7, use of compressed oops is the default for > 64-bit JVM processes when -Xmx isn't specified and for values of > -Xmx less than 32 gigabytes." > > https://wikis.oracle.com/display/HotSpotInternals/CompressedOops > > That said, what about implementing x32 ABI support as an > alternative? As far as I can tell this would have to be explicitly > implemented in HiPE too. > >> -----Original Message----- >> From: erlang-questions-bounces@REDACTED >> [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Kostis >> Sagonas >> Sent: den 4 april 2014 11:39 >> To: Erlang >> Subject: Re: [erlang-questions] Maximising memory compactness >> >> On 04/04/2014 10:33 AM, Olivier BOUDEVILLE wrote: >>> Let's suppose one would like to run a large, distributed (Erlang) >>> application, with many processes, and that ends up, in some cases, >>> being RAM-bound. >> > ... >>> The half-word emulator would seem the simplest/most elegant solution >>> to do so .... >> > >>> So, my question: would relying on a set of 32-bit VMs per host, >>> instead of a single 64-bit VM, look like the best option here? >> >> My opinion is (and has always been) that the half-word emulator >> seems cute on the surface but deep down is a bad idea (esp. for a >> language with automatic memory management like Erlang, or if your >> application has any plans of growing someday). >> >> So I would really advice against it. In fact, IMO it's better to >> try to forget about its existence for anything other than for small >> embedded devices or in machines that do not have more than 3GB of >> memory. >> >> Unfortunately, I am very busy to elaborate more on this right now. >> But even if I had more time, I would probably try to find better >> things to do than think/talk about the half-word emulator. Leaning >> back and relax until you forget about it (or simply waiting for the >> day that it is taken out of the distribution) is preferable IMO. From tuncer.ayaz@REDACTED Fri Apr 4 20:34:34 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 4 Apr 2014 20:34:34 +0200 Subject: [erlang-questions] Maximising memory compactness In-Reply-To: References: <58912684E2630B45963406CF7D8C52581C396E8C@ESESSMB103.ericsson.se> Message-ID: On Fri, Apr 4, 2014 at 8:09 PM, Tuncer Ayaz wrote: > On Fri, Apr 4, 2014 at 5:26 PM, Andreas Schumacher wrote: >> Honestly, we did not measure the number of users, but we made a >> rough guess based on the questions, comments, and/or bug reports we >> got for the half-word emulator. > > I'm not arguing for or against halfword-emu, as I'm not the designated > maintainer, but it just works and most likely does for everyone else > who has it enabled. I never had a bug caused by it, and on some > machines it's the reason I can use Dialyzer with an amd64 beam.smp. > > If my professional experience with users of code I was responsible for > is any indication, then it's very safe to assume that users only > report bugs. I've learned that users won't even report back if a Sorry, forgot a word: s/that users/that some users/ > hotfix works. Hence, you can't use non-existence of bug reports or > comments as an indication of how widely/successfully something is used. > Some code has vocal users (gamers), most doesn't. > > > As you didn't answer the x32 ABI question, I take that to mean there's > no plan for that. Correct? > >> -----Original Message----- >> From: Tuncer Ayaz [mailto:tuncer.ayaz@REDACTED] >> Sent: den 4 april 2014 14:25 >> To: Andreas Schumacher >> Cc: erlang-questions@REDACTED; Olivier BOUDEVILLE >> Subject: Re: [erlang-questions] Fwd: FW: Maximising memory compactness >> >> On Fri, Apr 4, 2014 at 1:33 PM, Andreas Schumacher wrote: >>> As a matter of fact, the half-word emulator will be deprecated in >>> OTP 17.0, which will be released next week. The reason for that is >>> that there have been very few (if any) users; and thus, the >>> maintenance costs outweigh its value. >> >> FWIW, I use it. But more importantly, how did you measure the number >> of users? For comparison, JVM's compressed oops has been default >> enabled for a long time, but to be precise it's not _exactly_ the >> same thing. >> >> http://docs.oracle.com/javase/7/docs/technotes/guides/vm/performance-enhancements-7.html >> "Compressed oops is supported and enabled by default in Java SE 6u23 >> and later. In Java SE 7, use of compressed oops is the default for >> 64-bit JVM processes when -Xmx isn't specified and for values of >> -Xmx less than 32 gigabytes." >> >> https://wikis.oracle.com/display/HotSpotInternals/CompressedOops >> >> That said, what about implementing x32 ABI support as an >> alternative? As far as I can tell this would have to be explicitly >> implemented in HiPE too. >> >>> -----Original Message----- >>> From: erlang-questions-bounces@REDACTED >>> [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Kostis >>> Sagonas >>> Sent: den 4 april 2014 11:39 >>> To: Erlang >>> Subject: Re: [erlang-questions] Maximising memory compactness >>> >>> On 04/04/2014 10:33 AM, Olivier BOUDEVILLE wrote: >>>> Let's suppose one would like to run a large, distributed (Erlang) >>>> application, with many processes, and that ends up, in some cases, >>>> being RAM-bound. >>> > ... >>>> The half-word emulator would seem the simplest/most elegant solution >>>> to do so .... >>> > >>>> So, my question: would relying on a set of 32-bit VMs per host, >>>> instead of a single 64-bit VM, look like the best option here? >>> >>> My opinion is (and has always been) that the half-word emulator >>> seems cute on the surface but deep down is a bad idea (esp. for a >>> language with automatic memory management like Erlang, or if your >>> application has any plans of growing someday). >>> >>> So I would really advice against it. In fact, IMO it's better to >>> try to forget about its existence for anything other than for small >>> embedded devices or in machines that do not have more than 3GB of >>> memory. >>> >>> Unfortunately, I am very busy to elaborate more on this right now. >>> But even if I had more time, I would probably try to find better >>> things to do than think/talk about the half-word emulator. Leaning >>> back and relax until you forget about it (or simply waiting for the >>> day that it is taken out of the distribution) is preferable IMO. From chandrashekhar.mullaparthi@REDACTED Fri Apr 4 22:10:17 2014 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Fri, 4 Apr 2014 21:10:17 +0100 Subject: [erlang-questions] Fwd: Heavy duty erlang HTTP/REST client In-Reply-To: References: Message-ID: Just for the record, ibrowse is not the problem! Thanks for the update Vlad. Chandru ---------- Forwarded message ---------- From: Vladimir Ralev Date: 4 April 2014 17:34 Subject: Re: [erlang-questions] Heavy duty erlang HTTP/REST client To: Chandru Thanks guys. Ibrowse actually works, my settings were being reset by a third party app that uses it periodically in the background since these settings are global. On Thu, Apr 3, 2014 at 1:49 AM, Chandru < chandrashekhar.mullaparthi@REDACTED> wrote: > Hi Vladimir, > > Would love to help ibrowse work for you. Do you want to work together on > this? > > cheers > Chandru > > > On 2 April 2014 23:25, Vladimir Ralev wrote: > >> Hi all, >> >> I've been struggling with httpc and ibrowse to do sort of long-polling >> REST requests in large numbers. Basically I have a "slow" server that >> responds in 30-60 seconds to all HTTP requests. Both httpc and ibrowse seem >> to freeze at some point no matter what settings I use - I set max sessions >> to 10000, disable pipelining, adjust timeouts tried several random configs, >> but at some point they all freeze and no longer attempt to connect and send >> new requests. Ibrowse gives the retry_later and httpc just freezes. Any >> recommendation? >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryankbrown@REDACTED Fri Apr 4 23:52:58 2014 From: ryankbrown@REDACTED (Ryan Brown) Date: Fri, 4 Apr 2014 15:52:58 -0600 Subject: [erlang-questions] gen_server timeout in RabbitMq publish confirm process Message-ID: I have an application that acts as, essentially, a rest wrapper around rabbitmq. (There is obviously some special logic that makes it necessary to build our own). Some background: We have been using this application (current code available at https://github.com/PearsonEducation/subpub) as an internal pub/sub for several years now. It has now grown dramatically in importance to our vision and we are beginning to get inundated with requests for features and enhancements. One of those enhancements is to allow publishers to specify with a header whether they want the application to require confirmed publishing to rabbit. We had begun this process by checking for the header value and passing down the chain. However, we are not currently setting-up a channel that is set for publish confirms. Anyway, TMI... The state I'm in now is that, on startup, we create connections to each of our brokers. In this process we create a channel and save it in state. I have now added logic to create a second channel on that connection that sets: #'confirm.select_ok'{} = amqp_channel:call(ConfirmedChannel, #'confirm.select'{}), And saves it to state. Then on publish, I select which one to use based on the values passed-down the stack from message intake. Set self() as the confirm handler and respond with a wait so that up the stack I can initiate a receive loop in the message intake which is not a gen_server. I have debug messages throughout and it appears that everything is happening as expected. I trace the message through the publish path. To being published and passing the wait back up to the receiver. I also see where the basic.ack is received and the publish_confirm acknowledgement passed all the way up to the receive loop. However, then things go awry. I get the attached dump. My take-away, although likely I am wrong, is that somewhere, apparently in amqp_balanced_publisher, a gen_server call is timing-out while waiting for a response. But, I seem to be able to trace the responses through the whole stack so I am thoroughly confused. I realize this is vague and additional details/code are likely still needed. Please let me know. I've spent way too much time on this already and it's getting quite frustrating. And I know I am likely missing something obvious but am finding supporting documentation for erlang lacking. But I'm probably just looking in the right places. Best regards, Ryan -- -rb -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryankbrown@REDACTED Fri Apr 4 23:53:56 2014 From: ryankbrown@REDACTED (Ryan Brown) Date: Fri, 4 Apr 2014 15:53:56 -0600 Subject: [erlang-questions] gen_server timeout in RabbitMq publish confirm process In-Reply-To: References: Message-ID: Accidentally forgot to attach the dump file. -rb On Fri, Apr 4, 2014 at 3:52 PM, Ryan Brown wrote: > I have an application that acts as, essentially, a rest wrapper around > rabbitmq. (There is obviously some special logic that makes it necessary to > build our own). > > Some background: We have been using this application (current code > available at https://github.com/PearsonEducation/subpub) as an internal > pub/sub for several years now. It has now grown dramatically in importance > to our vision and we are beginning to get inundated with requests for > features and enhancements. One of those enhancements is to allow publishers > to specify with a header whether they want the application to require > confirmed publishing to rabbit. We had begun this process by checking for > the header value and passing down the chain. However, we are not currently > setting-up a channel that is set for publish confirms. Anyway, TMI... > > The state I'm in now is that, on startup, we create connections to each of > our brokers. In this process we create a channel and save it in state. I > have now added logic to create a second channel on that connection that > sets: > > #'confirm.select_ok'{} = amqp_channel:call(ConfirmedChannel, > #'confirm.select'{}), > > And saves it to state. Then on publish, I select which one to use based on > the values passed-down the stack from message intake. Set self() as the > confirm handler and respond with a wait so that up the stack I can initiate > a receive loop in the message intake which is not a gen_server. I have > debug messages throughout and it appears that everything is happening as > expected. I trace the message through the publish path. To being published > and passing the wait back up to the receiver. I also see where the > basic.ack is received and the publish_confirm acknowledgement passed all > the way up to the receive loop. However, then things go awry. I get the > attached dump. > > My take-away, although likely I am wrong, is that somewhere, apparently in > amqp_balanced_publisher, a gen_server call is timing-out while waiting for > a response. But, I seem to be able to trace the responses through the whole > stack so I am thoroughly confused. > > I realize this is vague and additional details/code are likely still > needed. Please let me know. I've spent way too much time on this already > and it's getting quite frustrating. And I know I am likely missing > something obvious but am finding supporting documentation for erlang > lacking. But I'm probably just looking in the right places. > > Best regards, > > Ryan > > -- > -rb > -- -rb -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pub_confirm_dump Type: application/octet-stream Size: 41657 bytes Desc: not available URL: From vladimir.ralev@REDACTED Sat Apr 5 05:42:29 2014 From: vladimir.ralev@REDACTED (Vladimir Ralev) Date: Sat, 5 Apr 2014 06:42:29 +0300 Subject: [erlang-questions] Fwd: Heavy duty erlang HTTP/REST client In-Reply-To: References: Message-ID: Right, it comes down to this: 1. I set this in my app: ibrowse:set_max_sessions("mydest.com",80,10000). 2. The other app calls apply_config which apparently deletes all previous configs for all destinations: apply_config(Terms) -> ets:delete_all_objects(ibrowse_conf), insert_config(Terms). Thanks again. On Fri, Apr 4, 2014 at 11:10 PM, Chandru < chandrashekhar.mullaparthi@REDACTED> wrote: > Just for the record, ibrowse is not the problem! Thanks for the update > Vlad. > > Chandru > > ---------- Forwarded message ---------- > From: Vladimir Ralev > Date: 4 April 2014 17:34 > Subject: Re: [erlang-questions] Heavy duty erlang HTTP/REST client > To: Chandru > > > Thanks guys. Ibrowse actually works, my settings were being reset by a > third party app that uses it periodically in the background since these > settings are global. > > > On Thu, Apr 3, 2014 at 1:49 AM, Chandru < > chandrashekhar.mullaparthi@REDACTED> wrote: > >> Hi Vladimir, >> >> Would love to help ibrowse work for you. Do you want to work together on >> this? >> >> cheers >> Chandru >> >> >> On 2 April 2014 23:25, Vladimir Ralev wrote: >> >>> Hi all, >>> >>> I've been struggling with httpc and ibrowse to do sort of long-polling >>> REST requests in large numbers. Basically I have a "slow" server that >>> responds in 30-60 seconds to all HTTP requests. Both httpc and ibrowse seem >>> to freeze at some point no matter what settings I use - I set max sessions >>> to 10000, disable pipelining, adjust timeouts tried several random configs, >>> but at some point they all freeze and no longer attempt to connect and send >>> new requests. Ibrowse gives the retry_later and httpc just freezes. Any >>> recommendation? >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Sat Apr 5 09:13:03 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sat, 5 Apr 2014 09:13:03 +0200 Subject: [erlang-questions] Heavy duty erlang HTTP/REST client In-Reply-To: References: Message-ID: On Thursday, April 3, 2014, Vladimir Ralev wrote: > Hi all, > > I've been struggling with httpc and ibrowse to do sort of long-polling > REST requests in large numbers. Basically I have a "slow" server that > responds in 30-60 seconds to all HTTP requests. Both httpc and ibrowse seem > to freeze at some point no matter what settings I use - I set max sessions > to 10000, disable pipelining, adjust timeouts tried several random configs, > but at some point they all freeze and no longer attempt to connect and send > new requests. Ibrowse gives the retry_later and httpc just freezes. Any > recommendation? > you can try hackney: http://github.com/benoitc/hackney -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas@REDACTED Sat Apr 5 15:03:53 2014 From: andreas@REDACTED (Andreas Schumacher) Date: Sat, 5 Apr 2014 15:03:53 +0200 Subject: [erlang-questions] Fwd: Maximising memory compactness In-Reply-To: References: Message-ID: That is correct; right now, there are no plans for x32 ABI support. Andreas ---------- Forwarded message ---------- From: Andreas Schumacher Date: Sat, Apr 5, 2014 at 3:01 PM Subject: [erlang-questions] Maximising memory compactness To: "andreasschu@REDACTED" *From: *Tuncer Ayaz *Subject: * *Re: [erlang-questions] Maximising memory compactness* *Date: *4 Apr 2014 20:09:58 GMT+2 *To: *Andreas Schumacher *Cc: *"erlang-questions@REDACTED" On Fri, Apr 4, 2014 at 5:26 PM, Andreas Schumacher wrote: Honestly, we did not measure the number of users, but we made a rough guess based on the questions, comments, and/or bug reports we got for the half-word emulator. I'm not arguing for or against halfword-emu, as I'm not the designated maintainer, but it just works and most likely does for everyone else who has it enabled. I never had a bug caused by it, and on some machines it's the reason I can use Dialyzer with an amd64 beam.smp. If my professional experience with users of code I was responsible for is any indication, then it's very safe to assume that users only report bugs. I've learned that users won't even report back if a hotfix works. Hence, you can't use non-existence of bug reports or comments as an indication of how widely/successfully something is used. Some code has vocal users (gamers), most doesn't. As you didn't answer the x32 ABI question, I take that to mean there's no plan for that. Correct? -----Original Message----- From: Tuncer Ayaz [mailto:tuncer.ayaz@REDACTED ] Sent: den 4 april 2014 14:25 To: Andreas Schumacher Cc: erlang-questions@REDACTED; Olivier BOUDEVILLE Subject: Re: [erlang-questions] Fwd: FW: Maximising memory compactness On Fri, Apr 4, 2014 at 1:33 PM, Andreas Schumacher wrote: As a matter of fact, the half-word emulator will be deprecated in OTP 17.0, which will be released next week. The reason for that is that there have been very few (if any) users; and thus, the maintenance costs outweigh its value. FWIW, I use it. But more importantly, how did you measure the number of users? For comparison, JVM's compressed oops has been default enabled for a long time, but to be precise it's not _exactly_ the same thing. http://docs.oracle.com/javase/7/docs/technotes/guides/vm/performance-enhancements-7.html "Compressed oops is supported and enabled by default in Java SE 6u23 and later. In Java SE 7, use of compressed oops is the default for 64-bit JVM processes when -Xmx isn't specified and for values of -Xmx less than 32 gigabytes." https://wikis.oracle.com/display/HotSpotInternals/CompressedOops That said, what about implementing x32 ABI support as an alternative? As far as I can tell this would have to be explicitly implemented in HiPE too. -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Kostis Sagonas Sent: den 4 april 2014 11:39 To: Erlang Subject: Re: [erlang-questions] Maximising memory compactness On 04/04/2014 10:33 AM, Olivier BOUDEVILLE wrote: Let's suppose one would like to run a large, distributed (Erlang) application, with many processes, and that ends up, in some cases, being RAM-bound. ... The half-word emulator would seem the simplest/most elegant solution to do so .... So, my question: would relying on a set of 32-bit VMs per host, instead of a single 64-bit VM, look like the best option here? My opinion is (and has always been) that the half-word emulator seems cute on the surface but deep down is a bad idea (esp. for a language with automatic memory management like Erlang, or if your application has any plans of growing someday). So I would really advice against it. In fact, IMO it's better to try to forget about its existence for anything other than for small embedded devices or in machines that do not have more than 3GB of memory. Unfortunately, I am very busy to elaborate more on this right now. But even if I had more time, I would probably try to find better things to do than think/talk about the half-word emulator. Leaning back and relax until you forget about it (or simply waiting for the day that it is taken out of the distribution) is preferable IMO. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kunthar@REDACTED Sat Apr 5 18:02:07 2014 From: kunthar@REDACTED (Gokhan Boranalp) Date: Sat, 5 Apr 2014 19:02:07 +0300 Subject: [erlang-questions] kv store as a service In-Reply-To: References: Message-ID: Amazon S3 and Riak are different species and actually not directly comparable types in the nature of K/V world. Question shows that you are not aware of usage types of these two and you are not efficiently examined your problem domain by looking closely to your data. Please let us know more about your data types to be used. What kind of data really you would like to store? Why do you need cache? Why do you believe SSD disks could be sufficient for cache operations? What is your data access pattern in terms of retrieval of data back? BR On Fri, Apr 4, 2014 at 3:10 PM, t x wrote: > Hi, > > > This is my current setup: > > * a bunch of $5/month digital ocean droplets [1] > > * these droplets have a 20GB SSD harddrive > > Now, I need to have a gigantic key-value store. I don't want to deal > with the error condition of "error: you ran out of disk space" > > In my particular design, I only have "create new value". I don't > have "update value". Thus, I don't have to worry about invalidating > caches, and intend to use the 20GB SSD drives as as "cache" for the > real key-value store. > > > > Now, my question is: what should I use for my key-value store? > > I want to optimize for: > > * minimum cost > * minimum administration > > Currently, the best I have is Amazon S3. (I'd prefer to not setup my > own Riak cluster + deal with replication + how many servers to run + > ... ). I'm okay with the 99.99% (or whatever SLA Amazon S3 provides). > > > > Question: Is S3 the right approach as a giant K-V store for my > Erlang nodes to hit, or should I be using something else? > > Thanks! > > > [1] This is not an advertisement for DO. I do not have any DO equity. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- BR, \|/ Kunthar From serge@REDACTED Sat Apr 5 19:01:56 2014 From: serge@REDACTED (Serge Aleynikov) Date: Sat, 5 Apr 2014 13:01:56 -0400 Subject: [erlang-questions] security concerns In-Reply-To: <533EB73E.7000806@meetinghouse.net> References: <1CAB695D2C2A8F4BB0B242A5B44C75E9125A9758@ESESSMB301.ericsson.se> <533EAA13.9030101@jkemp.net> <533EB73E.7000806@meetinghouse.net> Message-ID: There's a patch available that partly addresses this issue of secure multi-protocol support of nodes using SSL between data centers ( https://github.com/erlang/otp/pull/121), and non-secure communication on a local network. Though rejected for inclusion in OTP in its current form ( http://erlang.org/pipermail/erlang-patches/2014-January/004523.html), the gradual introduction of these features is still on the radar. Serge On Fri, Apr 4, 2014 at 9:44 AM, Miles Fidelman wrote: > John Kemp wrote: > >> On 04/04/2014 08:10 AM, Arif Ishaq wrote: >> >>> I just saw a post by Carlos-Trigoso on the security, or rather lack >>> thereof in Erlang >>> (http://carlos-trigoso.com/2014/03/04/security-taken-lightly/) . >>> >>> It seems like a fair evaluation. >>> >> >> I would suggest that it is _not_ a fair evaluation. >> >> As Lo?c mentioned, name any language or OS environment that does >> something like what the author suggests for Erlang? >> > > Well.... Fabric comes to mind: http://web.mit.edu/fabric_v0.2.0/fabric.pdf, > so does E (erights.org). As does a LOT of work in the areas of secure > distributed operating systems, distributed agent systems, and such. > > I guess you could also look at various web service platforms. > > On the other hand, Erlang stands alone as a mature, proven, in-production > distributed run-time environment for highly concurrent systems - so it's > not clear that comparisons to other languages or operating system > environments apply. > > >> But more than that, why would protocols for connecting nodes inside of a >> network be the same as protocols used between data-centres, particularly >> when connections between data centres will possibly go across networks not >> owned by the owner of the data centres? >> >> Am I wrong, but I wasn't under the impression that Erlang's distributed > processing functions are only for connecting nodes inside a data center. > > Miles Fidelman > > -- > In theory, there is no difference between theory and practice. > In practice, there is. .... Yogi Berra > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From txrev319@REDACTED Sat Apr 5 19:02:17 2014 From: txrev319@REDACTED (t x) Date: Sat, 5 Apr 2014 10:02:17 -0700 Subject: [erlang-questions] kv store as a service In-Reply-To: References: Message-ID: Gokhan: Thanks for pointing out what I need to clarify. What kind of data? I'm basically building a wiki. Each "value" is an svg-document + the history of the svg document. Why do you need cache? S3 pricing comes out to $120 / TB. DO pricing is $5 / TB. Thus, I'd prefer DO to read from S3, cache it on DO, then serve from DO. This saves bandwidth cost by factor of 24. (sorry for not explaining this earlier) Why do you believe SSD will suffice for cache? The site is for a class -- so the notes are "weekly" -- thus, it's highly likely that the most accessed entries are the most recent entries (i.e. it's the user requests is not uniformly random over the keys; but rather heavily weighted in favor of recent keys) What is your retrieval pattern? I don't have hard data yet -- I'm still building this. (preempting a possible future question): Why do you group S3 and Riak into the same thought? Eventual consistency doesn't really matter to me here. key = sha hash of content, thus, "updates = new entry", and I don't worry much about invalidating cache. I was thinking purely in terms of k/v store -- and the two most scalable stores I know of are S3 and Riak. Please let me know if my thinking appears sloppy anywhere else. (I have a decent theoretical CS background so I can do the logic/proof -- but this is my first time building a distributed system -- so I may be asking the wrong questions / not aware of what I'm jumping into). Thanks! On Sat, Apr 5, 2014 at 9:02 AM, Gokhan Boranalp wrote: > Amazon S3 and Riak are different species and actually not directly > comparable types in the nature of K/V world. > Question shows that you are not aware of usage types of these two and > you are not efficiently examined your problem domain by looking > closely to your data. > > Please let us know more about your data types to be used. > What kind of data really you would like to store? > Why do you need cache? > Why do you believe SSD disks could be sufficient for cache operations? > What is your data access pattern in terms of retrieval of data back? > > > BR > > On Fri, Apr 4, 2014 at 3:10 PM, t x wrote: >> Hi, >> >> >> This is my current setup: >> >> * a bunch of $5/month digital ocean droplets [1] >> >> * these droplets have a 20GB SSD harddrive >> >> Now, I need to have a gigantic key-value store. I don't want to deal >> with the error condition of "error: you ran out of disk space" >> >> In my particular design, I only have "create new value". I don't >> have "update value". Thus, I don't have to worry about invalidating >> caches, and intend to use the 20GB SSD drives as as "cache" for the >> real key-value store. >> >> >> >> Now, my question is: what should I use for my key-value store? >> >> I want to optimize for: >> >> * minimum cost >> * minimum administration >> >> Currently, the best I have is Amazon S3. (I'd prefer to not setup my >> own Riak cluster + deal with replication + how many servers to run + >> ... ). I'm okay with the 99.99% (or whatever SLA Amazon S3 provides). >> >> >> >> Question: Is S3 the right approach as a giant K-V store for my >> Erlang nodes to hit, or should I be using something else? >> >> Thanks! >> >> >> [1] This is not an advertisement for DO. I do not have any DO equity. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > BR, > \|/ Kunthar From txrev319@REDACTED Sat Apr 5 19:02:45 2014 From: txrev319@REDACTED (t x) Date: Sat, 5 Apr 2014 10:02:45 -0700 Subject: [erlang-questions] kv store as a service In-Reply-To: References: Message-ID: I should also add, for this particular case, HDFS as a service would work for me too -- all what I really need is just a k/v store. On Sat, Apr 5, 2014 at 10:02 AM, t x wrote: > Gokhan: Thanks for pointing out what I need to clarify. > > > What kind of data? > > I'm basically building a wiki. Each "value" is an svg-document + the > history of the svg document. > > > Why do you need cache? > > S3 pricing comes out to $120 / TB. > DO pricing is $5 / TB. > Thus, I'd prefer DO to read from S3, cache it on DO, then serve from > DO. This saves bandwidth cost by factor of 24. (sorry for not > explaining this earlier) > > > Why do you believe SSD will suffice for cache? > > The site is for a class -- so the notes are "weekly" -- thus, it's > highly likely that the most accessed entries are the most recent > entries (i.e. it's the user requests is not uniformly random over the > keys; but rather heavily weighted in favor of recent keys) > > > What is your retrieval pattern? > > I don't have hard data yet -- I'm still building this. > > > > (preempting a possible future question): Why do you group S3 and Riak > into the same thought? > > Eventual consistency doesn't really matter to me here. key = sha hash > of content, thus, "updates = new entry", and I don't worry much about > invalidating cache. > > I was thinking purely in terms of k/v store -- and the two most > scalable stores I know of are S3 and Riak. > > > Please let me know if my thinking appears sloppy anywhere else. (I > have a decent theoretical CS background so I can do the logic/proof -- > but this is my first time building a distributed system -- so I may be > asking the wrong questions / not aware of what I'm jumping into). > > > Thanks! > > > > On Sat, Apr 5, 2014 at 9:02 AM, Gokhan Boranalp wrote: >> Amazon S3 and Riak are different species and actually not directly >> comparable types in the nature of K/V world. >> Question shows that you are not aware of usage types of these two and >> you are not efficiently examined your problem domain by looking >> closely to your data. >> >> Please let us know more about your data types to be used. >> What kind of data really you would like to store? >> Why do you need cache? >> Why do you believe SSD disks could be sufficient for cache operations? >> What is your data access pattern in terms of retrieval of data back? >> >> >> BR >> >> On Fri, Apr 4, 2014 at 3:10 PM, t x wrote: >>> Hi, >>> >>> >>> This is my current setup: >>> >>> * a bunch of $5/month digital ocean droplets [1] >>> >>> * these droplets have a 20GB SSD harddrive >>> >>> Now, I need to have a gigantic key-value store. I don't want to deal >>> with the error condition of "error: you ran out of disk space" >>> >>> In my particular design, I only have "create new value". I don't >>> have "update value". Thus, I don't have to worry about invalidating >>> caches, and intend to use the 20GB SSD drives as as "cache" for the >>> real key-value store. >>> >>> >>> >>> Now, my question is: what should I use for my key-value store? >>> >>> I want to optimize for: >>> >>> * minimum cost >>> * minimum administration >>> >>> Currently, the best I have is Amazon S3. (I'd prefer to not setup my >>> own Riak cluster + deal with replication + how many servers to run + >>> ... ). I'm okay with the 99.99% (or whatever SLA Amazon S3 provides). >>> >>> >>> >>> Question: Is S3 the right approach as a giant K-V store for my >>> Erlang nodes to hit, or should I be using something else? >>> >>> Thanks! >>> >>> >>> [1] This is not an advertisement for DO. I do not have any DO equity. >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> -- >> BR, >> \|/ Kunthar From txrev319@REDACTED Sun Apr 6 06:19:35 2014 From: txrev319@REDACTED (t x) Date: Sat, 5 Apr 2014 21:19:35 -0700 Subject: [erlang-questions] include as a library rather than an application? Message-ID: Hi, For this problem has a "working hack" -- but I'd prefer to do it without a hack. I'm including erldn in my app.src as: {applications, [kernel, stdlib, cowboy, gproc, erldn]}, To do this, erldn must have an application behaviour. Thus, I was forced to add: https://github.com/txrev319/erldn/blob/d607db5d3826a7f3ad0eff918c8c7691a362ad94/src/erldn_app.erl a no-op file to make it an application. My question: is there a way to include erldn as a library rather than an application? I.e. I want access to erldn:parse_str(...) . However, I don't want to spawn an app just to include erldn. Thanks! From essen@REDACTED Sun Apr 6 09:09:02 2014 From: essen@REDACTED (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=) Date: Sun, 06 Apr 2014 09:09:02 +0200 Subject: [erlang-questions] include as a library rather than an application? Message-ID: You don't need the app behaviour to do that. -- Lo?c Hoguin http://ninenines.eu -------- Original Message -------- From:t x Sent:Sun, 06 Apr 2014 06:19:35 +0200 To:erlang-questions@REDACTED Subject:[erlang-questions] include as a library rather than an application? >Hi, > >For this problem has a "working hack" -- but I'd prefer to do it without a hack. > >I'm including erldn in my app.src as: > >{applications, [kernel, stdlib, cowboy, gproc, erldn]}, > > >To do this, erldn must have an application behaviour. Thus, I was forced to add: > >https://github.com/txrev319/erldn/blob/d607db5d3826a7f3ad0eff918c8c7691a362ad94/src/erldn_app.erl > > >a no-op file to make it an application. > > >My question: is there a way to include erldn as a library rather than >an application? I.e. I want access to erldn:parse_str(...) . However, >I don't want to spawn an app just to include erldn. > > >Thanks! >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomasl_erlang@REDACTED Sun Apr 6 12:31:05 2014 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Sun, 6 Apr 2014 03:31:05 -0700 (PDT) Subject: [erlang-questions] include as a library rather than an application? In-Reply-To: References: Message-ID: <1396780265.53984.YahooMailNeo@web140106.mail.bf1.yahoo.com> If it's just a code library, you don't need the module. Take a look at the 'mod' key in the 'app' man page:?http://www.erlang.org/doc/man/app.html Best, Thomas On Sunday, April 6, 2014 6:20 AM, t x wrote: Hi, > >For this problem has a "working hack" -- but I'd prefer to do it without a hack. > >I'm including erldn in my app.src as: > >{applications, [kernel, stdlib, cowboy, gproc, erldn]}, > > >To do this, erldn must have an application behaviour. Thus, I was forced to add: > >https://github.com/txrev319/erldn/blob/d607db5d3826a7f3ad0eff918c8c7691a362ad94/src/erldn_app.erl > > >a no-op file to make it an application. > > >My question: is there a way to include erldn as a library rather than >an application? I.e. I want access to erldn:parse_str(...) . However, >I don't want to spawn an app just to include erldn. > > >Thanks! >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jbothma@REDACTED Sun Apr 6 15:35:22 2014 From: jbothma@REDACTED (JD Bothma) Date: Sun, 6 Apr 2014 15:35:22 +0200 Subject: [erlang-questions] include as a library rather than an application? In-Reply-To: References: Message-ID: For more detail, search for library at http://www.erlang.org/doc/design_principles/applications.html. You should skip the mod entry in .app A library application, which can not be started or stopped, does not need any application callback module. 7.3 Application Resource File To define an application, we create an *application specification* which is put in an *application resource file*, or in short .app file: {application, Application, [Opt1,...,OptN]}. Application, an atom, is the name of the application. The file must be named Application.app. Each Opt is a tuple {Key, Value} which define a certain property of the application. All keys are optional. Default values are used for any omitted keys. The contents of a minimal .app file for a library application libapp looks like this: {application, libapp, []}. The contents of a minimal .app file ch_app.app for a supervision tree application like ch_app looks like this: {application, ch_app, [{mod, {ch_app,[]}}]}. On 6 April 2014 09:09, Lo?c Hoguin wrote: > You don't need the app behaviour to do that. > > -- > Lo?c Hoguin > http://ninenines.eu > > > -------- Original Message -------- > From:t x > Sent:Sun, 06 Apr 2014 06:19:35 +0200 > To:erlang-questions@REDACTED > Subject:[erlang-questions] include as a library rather than an application? > > Hi, > > For this problem has a "working hack" -- but I'd prefer to do it without a > hack. > > I'm including erldn in my app.src as: > > {applications, [kernel, stdlib, cowboy, gproc, erldn]}, > > > To do this, erldn must have an application behaviour. Thus, I was forced > to add: > > > https://github.com/txrev319/erldn/blob/d607db5d3826a7f3ad0eff918c8c7691a362ad94/src/erldn_app.erl > > > a no-op file to make it an application. > > > My question: is there a way to include erldn as a library rather than > an application? I.e. I want access to erldn:parse_str(...) . However, > I don't want to spawn an app just to include erldn. > > > Thanks! > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eshikafe@REDACTED Sun Apr 6 16:51:08 2014 From: eshikafe@REDACTED (austin aigbe) Date: Sun, 6 Apr 2014 15:51:08 +0100 Subject: [erlang-questions] Diameter header cmd_code field bit size Message-ID: Hello, According to RFC6733, the diameter header Command Code field is three octets (i.e 24 bits) but the Erlang diameter header implementation has it defined as a 1 octet field (i.e 8 bits). Why? *RFC 6733*: 3. Diameter Header A summary of the Diameter header format is shown below. The fields are transmitted in network byte order. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version | Message Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Command Flags | Command Code | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Application-ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Hop-by-Hop Identifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | End-to-End Identifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | AVPs ... +-+-+-+-+-+-+-+-+-+-+-+-+- *C:\Program Files\erl6.0\lib\diameter-1.6\include\diameter.hrl:* -record(diameter_header, {version, %% 8-bit unsigned length, %% 24-bit unsigned * cmd_code, %% 8-bit unsigned* application_id, %% 24-bit unsigned hop_by_hop_id, %% 32-bit unsigned end_to_end_id, %% 32-bit unsigned is_request, %% boolean() R flag is_proxiable, %% boolean() P flag is_error, %% boolean() E flag is_retransmitted}). %% boolean() T flag BR, Austin -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf@REDACTED Sun Apr 6 18:42:08 2014 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 6 Apr 2014 18:42:08 +0200 Subject: [erlang-questions] Diameter header cmd_code field bit size In-Reply-To: References: Message-ID: The *actual implementation* in diameter_codec.erl [1] gets it right, though. BR, Ulf W [1] https://github.com/erlang/otp/blob/maint/lib/diameter/src/base/diameter_codec.erl#L104 https://github.com/erlang/otp/blob/maint/lib/diameter/src/base/diameter_codec.erl#L296 On 06 Apr 2014, at 16:51, austin aigbe wrote: > Hello, > > According to RFC6733, the diameter header Command Code field is three octets (i.e 24 bits) but the Erlang diameter header implementation has it defined as a 1 octet field (i.e 8 bits). Why? > > > > RFC 6733: > > 3. Diameter Header > > A summary of the Diameter header format is shown below. The fields > are transmitted in network byte order. > > 0 1 2 3 > 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > | Version | Message Length | > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > | Command Flags | Command Code | > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > | Application-ID | > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > | Hop-by-Hop Identifier | > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > | End-to-End Identifier | > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > | AVPs ... > +-+-+-+-+-+-+-+-+-+-+-+-+- > > C:\Program Files\erl6.0\lib\diameter-1.6\include\diameter.hrl: > -record(diameter_header, > {version, %% 8-bit unsigned > length, %% 24-bit unsigned > cmd_code, %% 8-bit unsigned > application_id, %% 24-bit unsigned > hop_by_hop_id, %% 32-bit unsigned > end_to_end_id, %% 32-bit unsigned > is_request, %% boolean() R flag > is_proxiable, %% boolean() P flag > is_error, %% boolean() E flag > is_retransmitted}). %% boolean() T flag > > BR, > Austin > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From slashfoo@REDACTED Mon Apr 7 00:57:46 2014 From: slashfoo@REDACTED (Jamiel Almeida) Date: Sun, 6 Apr 2014 15:57:46 -0700 Subject: [erlang-questions] Problems building erlang from source Message-ID: Hey guys, I'm trying to build erlang from source (tried github and tar.gz sources from erlang.org) I'm running into issues when it proceeds to build the pcre side of things. Here's an excerpt of the point where `make` breaks: gcc -c -Werror=return-type -g -O2 -I/home/jamiel/repos/erlang/erts/x86_64-unknown-linux-gnu -fno-tree-copyrename -D_GNU_SOURCE -DERTS_SMP -DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -DERLANG_INTEGRATION -o /home/jamiel/repos/erlang/erts/emulator/pcre/obj/x86_64-unknown-linux-gnu/opt/pcre_exec.o pcre/pcre_exec.c In file included from pcre/pcre_exec.c:4451:0: pcre/pcre_exec.c: In function ?match?: pcre/pcre_exec_loop_break_cases.inc:3:1: error: label ?L_LOOP_COUNT_585? used but not defined case 685: goto L_LOOP_COUNT_585; ^ pcre/pcre_exec_loop_break_cases.inc:2:1: error: label ?L_LOOP_COUNT_499? used but not defined case 599: goto L_LOOP_COUNT_499; ^ pcre/pcre_exec_loop_break_cases.inc:1:1: error: label ?L_LOOP_COUNT_474? used but not defined case 574: goto L_LOOP_COUNT_474; ^ pcre/pcre.mk:60: recipe for target '/home/jamiel/repos/erlang/erts/emulator/pcre/obj/x86_64-unknown-linux-gnu/opt/pcre_exec.o' failed Full output of the (./configure && make) commands is here: https://gist.github.com/slashfoo/c71437a01e708086072f My system is an x86_64 Arch Linux install with kernel 3.13.8-1 $ gcc --version gcc (GCC) 4.8.2 20140206 (prerelease) Other prereq versions: m4 1.4.17-1 flex 2.5.39-1 perl 5.18.2-2 jre7-openjdk 7.u51_2.4.6-1 jdk7-openjdk 7.u51_2.4.6-1 make 4.0-2 gcc 4.8.2-8 libxslt 1.1.28-3 fop 1.1-1 autoconf 2.69-1 I have tried building other "tags" on the git checkout, and from their respective tarballs from erlang.org with the same results. Grepping for "L_LOOP_COUNT" on the source directory yields two files that make use of it, and the build-time-generated file erts/emulator/pcre/pcre_exec_loop_break_cases.inc . Googling for L_LOOP_COUNT and erlang, etc yields no useful results, of which the most "informative" is this one: http://stackoverflow.com/questions/9647427/fail-to-compile-erlang-r14b03 But the only use for that result is knowing that I'm not the only one seeing this and that the issue is at least 2 years old. I'm not using MacOS, or kerl; I'm using Arch Linux, and building by HOWTO/INSTALL.md. In a blind/crazy idea that it might be trying to use my system PCRE (8.34-2) instead of the one in the sources directory I tried installing some of those locally to my home directory and using LDFLAGS and CFLAGS pointing to lib/include dirs where I installed them. This had no effect. And, of course, running from a clean bash instance with no shell magic applied to the environment. The reason I want to install from source is that I require R17 to poke around, and my distro doesn't have packages for it yet. When it failed, I tried building other Rs from source, and found I was getting the same issues. I have the very deep feeling that I'm missing some simple thing, but can't spot it. What steps would you suggest I follow? Any ideas? Thanks in advance. -- Jamiel Almeida -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.molozian@REDACTED Mon Apr 7 01:14:09 2014 From: chris.molozian@REDACTED (Chris Molozian) Date: Mon, 7 Apr 2014 00:14:09 +0100 Subject: [erlang-questions] kv store as a service In-Reply-To: References: Message-ID: Hi, Based on your requirements: - unlimited disk space - each value is an SVG document (and its history) -?minimum cost - minimum administration I wonder if you might be interested in a service like Orchestrate (http://orchestrate.io/docs/). I?m an engineer at Orchestrate, we?re big fans of Erlang as most of us worked on Riak before building this service. I think Orchestrate could be a good fit because: - the pricing model is based on MOps (per million requests) with a free tier of 1MOp/month. - we do not charge for disk usage. - all data in the service is immutable, with ?ref? history (you can retrieve previous versions of a KV object) - there is no administration overhead, we?re the infrastructure team for you Normally I'm wary of promoting a company (when working for them) on a community mailing list,?but in this case I really do think we could be a good fit. Hope this helps. Kind Regards, Chris --? Chris Molozian Software Engineer Sent with Airmail On 5 April 2014 at 18:02:55, t x (txrev319@REDACTED) wrote: I should also add, for this particular case, HDFS as a service would work for me too -- all what I really need is just a k/v store. On Sat, Apr 5, 2014 at 10:02 AM, t x wrote: > Gokhan: Thanks for pointing out what I need to clarify. > > > What kind of data? > > I'm basically building a wiki. Each "value" is an svg-document + the > history of the svg document. > > > Why do you need cache? > > S3 pricing comes out to $120 / TB. > DO pricing is $5 / TB. > Thus, I'd prefer DO to read from S3, cache it on DO, then serve from > DO. This saves bandwidth cost by factor of 24. (sorry for not > explaining this earlier) > > > Why do you believe SSD will suffice for cache? > > The site is for a class -- so the notes are "weekly" -- thus, it's > highly likely that the most accessed entries are the most recent > entries (i.e. it's the user requests is not uniformly random over the > keys; but rather heavily weighted in favor of recent keys) > > > What is your retrieval pattern? > > I don't have hard data yet -- I'm still building this. > > > > (preempting a possible future question): Why do you group S3 and Riak > into the same thought? > > Eventual consistency doesn't really matter to me here. key = sha hash > of content, thus, "updates = new entry", and I don't worry much about > invalidating cache. > > I was thinking purely in terms of k/v store -- and the two most > scalable stores I know of are S3 and Riak. > > > Please let me know if my thinking appears sloppy anywhere else. (I > have a decent theoretical CS background so I can do the logic/proof -- > but this is my first time building a distributed system -- so I may be > asking the wrong questions / not aware of what I'm jumping into). > > > Thanks! > > > > On Sat, Apr 5, 2014 at 9:02 AM, Gokhan Boranalp wrote: >> Amazon S3 and Riak are different species and actually not directly >> comparable types in the nature of K/V world. >> Question shows that you are not aware of usage types of these two and >> you are not efficiently examined your problem domain by looking >> closely to your data. >> >> Please let us know more about your data types to be used. >> What kind of data really you would like to store? >> Why do you need cache? >> Why do you believe SSD disks could be sufficient for cache operations? >> What is your data access pattern in terms of retrieval of data back? >> >> >> BR >> >> On Fri, Apr 4, 2014 at 3:10 PM, t x wrote: >>> Hi, >>> >>> >>> This is my current setup: >>> >>> * a bunch of $5/month digital ocean droplets [1] >>> >>> * these droplets have a 20GB SSD harddrive >>> >>> Now, I need to have a gigantic key-value store. I don't want to deal >>> with the error condition of "error: you ran out of disk space" >>> >>> In my particular design, I only have "create new value". I don't >>> have "update value". Thus, I don't have to worry about invalidating >>> caches, and intend to use the 20GB SSD drives as as "cache" for the >>> real key-value store. >>> >>> >>> >>> Now, my question is: what should I use for my key-value store? >>> >>> I want to optimize for: >>> >>> * minimum cost >>> * minimum administration >>> >>> Currently, the best I have is Amazon S3. (I'd prefer to not setup my >>> own Riak cluster + deal with replication + how many servers to run + >>> ... ). I'm okay with the 99.99% (or whatever SLA Amazon S3 provides). >>> >>> >>> >>> Question: Is S3 the right approach as a giant K-V store for my >>> Erlang nodes to hit, or should I be using something else? >>> >>> Thanks! >>> >>> >>> [1] This is not an advertisement for DO. I do not have any DO equity. >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> -- >> BR, >> \|/ Kunthar _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From txrev319@REDACTED Mon Apr 7 05:21:25 2014 From: txrev319@REDACTED (t x) Date: Sun, 6 Apr 2014 20:21:25 -0700 Subject: [erlang-questions] specifying directory for mnesia database Message-ID: Hi, * I'm learning to use Mnesia (until I run into 2GB table issues.) * I'm using erlang.mk + relx. * Everything appears to be working, _EXCEPT_ * mnesia appears to be storing its tables in _rel/'node()' * these tables appear to get wiped when I type "make" * I'm not happy when my db gets wiped when I recompile my code. I've done some googling, and it appears my options are: ## 1) specify directory on erl commandline example: erl -mnesia dir '"/tmp/funky"' documentation: http://www.erlang.org/doc/apps/mnesia/Mnesia_chap2.html I'd prefer to not take this approach, as I don't want to hack erlang.mk/relx. ## 2) specify in env config in app.src documentation: http://www.erlang.org/doc/man/app.html I think this is the approach I want. I also think there's a one line fix. Can someone tell me how to, via app.src, tell mnesia to store all it's dbs in "/tmp/mnesia" ? Thanks! From sean@REDACTED Mon Apr 7 08:00:06 2014 From: sean@REDACTED (Functional Jobs) Date: Mon, 7 Apr 2014 02:00:06 -0400 Subject: [erlang-questions] New Functional Programming Job Opportunities Message-ID: <53423eeca7472@functionaljobs.com> Here are some functional programming job opportunities that were posted recently: Server Game Developer at Quark Games http://functionaljobs.com/jobs/8701-server-game-developer-at-quark-games Infrastructure Engineer at Zeta Project Germany GmbH http://functionaljobs.com/jobs/8699-infrastructure-engineer-at-zeta-project-germany-gmbh Cheers, Sean Murphy FunctionalJobs.com From anders.otp@REDACTED Mon Apr 7 10:16:02 2014 From: anders.otp@REDACTED (Anders Svensson) Date: Mon, 7 Apr 2014 10:16:02 +0200 Subject: [erlang-questions] Diameter header cmd_code field bit size In-Reply-To: References: Message-ID: It's a comment typo. Even application_id is wrong: should be 32-bit, not 24. I'll fix this for the coming 17.0 release. Thanks for the report. /Anders, Erlang/OTP On Sun, Apr 6, 2014 at 4:51 PM, austin aigbe wrote: > Hello, > > According to RFC6733, the diameter header Command Code field is three octets > (i.e 24 bits) but the Erlang diameter header implementation has it defined > as a 1 octet field (i.e 8 bits). Why? > > > > RFC 6733: > > 3. Diameter Header > > A summary of the Diameter header format is shown below. The fields > are transmitted in network byte order. > > 0 1 2 3 > 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > | Version | Message Length | > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > | Command Flags | Command Code | > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > | Application-ID | > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > | Hop-by-Hop Identifier | > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > | End-to-End Identifier | > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > | AVPs ... > +-+-+-+-+-+-+-+-+-+-+-+-+- > > C:\Program Files\erl6.0\lib\diameter-1.6\include\diameter.hrl: > -record(diameter_header, > {version, %% 8-bit unsigned > length, %% 24-bit unsigned > cmd_code, %% 8-bit unsigned > application_id, %% 24-bit unsigned > hop_by_hop_id, %% 32-bit unsigned > end_to_end_id, %% 32-bit unsigned > is_request, %% boolean() R flag > is_proxiable, %% boolean() P flag > is_error, %% boolean() E flag > is_retransmitted}). %% boolean() T flag > > BR, > Austin > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From erlangsiri@REDACTED Mon Apr 7 11:11:39 2014 From: erlangsiri@REDACTED (Siri Hansen) Date: Mon, 7 Apr 2014 11:11:39 +0200 Subject: [erlang-questions] Monitor limitations In-Reply-To: References: Message-ID: Hi Michal, sorry again for the long delay. We will make sure that erlang:spawn_opt/5 is properly documented regarding the use of monitor. Unfortunately we won't make it in 17.0, but it will be there in 17.1. Thanks for your input! Regards /siri 2014-03-28 11:46 GMT+01:00 Micha? Ptaszek : > Hey Siri, > > thanks for a detailed reply :) > > I completely understand the rationale for making sure the code is 100% > correct and complete. > > The way I see it, there are 2 major difficulties in implementing this > change: > 1. erlang:spawn_opt, and as a result - proc_lib:spawn_opt + all functions > that use it can return 2 different data types, depending on the contents of > the option list (either pid() or {pid(), reference()}). As you pointed out, > making all gen* functions compatible with the new format (not to mention > potential incompatibilities with the application code) is a pretty tedious > task, and I'm not sure if it's worth it. > 2. The fact that distribution protocol supports links, but not monitors. > Again, IMO relatively major change, and I guess somewhat tricky to > implement (to make both spawn and monitor atomic). > > As a matter of fact lack of this feature is not a show stopper for us: > it's rather something that I wanted to use few times in the code (which > later was replaced by calls to proc_lib:spawn_opt and erlang:monitor a > moment after), but the functionality wasn't there. After digging into the > stdlib code I found the TODO/FIXME note, hence my question posted to the > list. > > On top of that, I am a big fan of the principle of least astonishment: > when using functions from erlang:spawn_opt/N family, I expected the > 'monitor' option to work in all cases, not only in cases when we spawn > processes locally to the caller. > > On the side note: since remote spawn with 'monitor' option is not > supported, maybe we should change the docs to explicitly state that? ( > http://www.erlang.org/doc/man/erlang.html#spawn_opt-5) > > Cheers, > Michal > > > On Wed, Mar 26, 2014 at 5:02 PM, Siri Hansen wrote: > >> Hi Michal! >> >> Sorry for the delay, but we had to investigate a bit and discuss this >> before we could answer. >> >> First of all, the implementation would be rather extensive and error >> prone since it would cause a new possible return value from >> proc_lib:spawn_opt and proc_lib:start*. This must of course be handled by >> all users, including all gen* behaviours and the supervisor, requiring >> extensive testing and thorough documentation. >> >> When it comes to spawning processes on remote nodes, a change of the >> distribution protocol would be needed to allow the 'monitor' option (i.e. >> to make spawn+monitor atomic). We would need to consider if it is ok to >> allow using monitor with proc_lib on local node but not on remote node, or >> if the distribution must be updated first. >> >> Jobs with such impact on core functionality always require quite much >> effort from our side, even if they are implemented by our excellent open >> source contributors. We need to fully understand all changes and also do a >> quite large investigation to make sure no consequence is missed. It is also >> such a big change, that we would probably not allow >> it in a maintenance release, but rather postpone it to the next major >> release. >> >> In order to help us get an idea of the need and the priority of this >> feature, would it be possible for you to elaborate a bit on the use case? >> Other people on the list are of course also very welcome with their >> comments and thoughts on this. >> >> Thanks >> /siri >> >> >> >> 2014-03-24 18:16 GMT+01:00 Micha? Ptaszek : >> >> Even if there was an additional cost for gen modules when spawning new >>> process I still don't see a connection with a complete removal of 'monitor' >>> flag from available options in spawn_opt BIF (or rather, replacing it with >>> throw(badarg)). Moreover there is no public API allowing people to spawn >>> gen_servers on the remote nodes (and only the remote spawn_opt functions >>> were crippled by that change). >>> >>> Would a patch re-enabling that flag be accepted by the OTP team? >>> >>> >>> On Mon, Mar 24, 2014 at 5:37 PM, Siri Hansen wrote: >>> >>>> From the notes in the ticket: >>>> >>>> "Some analysis yields that the cause is that the gen_server:start() call >>>> ends up in erlang:spawn_opt(..., [monitor]) which return {Pid, Monitor}, >>>> making the proc_lib:sync_wait() wait for {Pid, Monitor} and not Pid >>>> which is what the newly spawned process sends in the ack-message." >>>> >>>> I haven't investigated further, so I don't know anything more about it. >>>> It doesn't seem too hard to solve, though, so it seems strange that the >>>> solution was to throw a badarg. Or maybe I missed something crucial... >>>> >>>> /siri >>>> >>>> >>>> 2014-03-22 11:44 GMT+01:00 Micha? Ptaszek : >>>> >>>>> Hey everyone, >>>>> >>>>> can anyone please shed some more light on OTP-6345? >>>>> >>>>> For some reasons we can not atomically spawn processes with >>>>> proc_lib:spawn_opt with 'monitor' flag. The same problem happens with >>>>> erlang:spawn_opt/5 where we can not spawn a remote process with 'monitor' >>>>> (however linking is totally ok). >>>>> >>>>> Thanks, >>>>> Michal >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From garazdawi@REDACTED Mon Apr 7 11:31:45 2014 From: garazdawi@REDACTED (Lukas Larsson) Date: Mon, 7 Apr 2014 11:31:45 +0200 Subject: [erlang-questions] Problems building erlang from source In-Reply-To: References: Message-ID: Hello, I'm not sure why, but it seems like on your system for some reason the expression below does not filter out the "COST_CHK(N)" clauses: grep -n COST_CHK erts/emulator/pcre/pcre_exec.c | grep -v 'COST_CHK(N)' 691: COST_CHK(1); 1792: COST_CHK(1); 1899: COST_CHK(1); 2067: COST_CHK(1); 2087: COST_CHK(1); 2184: COST_CHK(1); 2412: COST_CHK(1); 2483: COST_CHK(1); 2522: COST_CHK(1); 2716: COST_CHK(1); 2735: COST_CHK(1); 2846: COST_CHK(1); 3035: COST_CHK(1); 3849: COST_CHK(1); 3865: COST_CHK(1); 3879: COST_CHK(1); 3893: COST_CHK(1); 3907: COST_CHK(1); 3945: COST_CHK(1); 3947: COST_CHK(1); 3993: COST_CHK(1); 4003: COST_CHK(1); 4019: COST_CHK(1); 4058: COST_CHK(1); 4097: COST_CHK(1); 4124: COST_CHK(1); 4136: COST_CHK(1); 4148: COST_CHK(1); 4160: COST_CHK(1); 4172: COST_CHK(1); 4184: COST_CHK(1); 4196: COST_CHK(1); 4229: COST_CHK(1); 4260: COST_CHK(1); 4271: COST_CHK(1); 4282: COST_CHK(1); 4294: COST_CHK(1); 4306: COST_CHK(1); 4316: COST_CHK(1); 4326: COST_CHK(1); 4336: COST_CHK(1); 4346: COST_CHK(1); 4356: COST_CHK(1); 4366: COST_CHK(1); What version of grep are you using? Lukas On Mon, Apr 7, 2014 at 12:57 AM, Jamiel Almeida wrote: > Hey guys, > > I'm trying to build erlang from source (tried github and tar.gz sources > from erlang.org) > > I'm running into issues when it proceeds to build the pcre side of things. > > Here's an excerpt of the point where `make` breaks: > gcc -c -Werror=return-type -g -O2 > -I/home/jamiel/repos/erlang/erts/x86_64-unknown-linux-gnu > -fno-tree-copyrename -D_GNU_SOURCE -DERTS_SMP -DHAVE_CONFIG_H -Wall > -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement > -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS > -D_POSIX_THREAD_SAFE_FUNCTIONS -DERLANG_INTEGRATION -o > /home/jamiel/repos/erlang/erts/emulator/pcre/obj/x86_64-unknown-linux-gnu/opt/pcre_exec.o > pcre/pcre_exec.c > In file included from pcre/pcre_exec.c:4451:0: > pcre/pcre_exec.c: In function 'match': > pcre/pcre_exec_loop_break_cases.inc:3:1: error: label 'L_LOOP_COUNT_585' > used but not defined > case 685: goto L_LOOP_COUNT_585; > ^ > pcre/pcre_exec_loop_break_cases.inc:2:1: error: label 'L_LOOP_COUNT_499' > used but not defined > case 599: goto L_LOOP_COUNT_499; > ^ > pcre/pcre_exec_loop_break_cases.inc:1:1: error: label 'L_LOOP_COUNT_474' > used but not defined > case 574: goto L_LOOP_COUNT_474; > ^ > pcre/pcre.mk:60: recipe for target > '/home/jamiel/repos/erlang/erts/emulator/pcre/obj/x86_64-unknown-linux-gnu/opt/pcre_exec.o' > failed > > Full output of the (./configure && make) commands is here: > https://gist.github.com/slashfoo/c71437a01e708086072f > > My system is an x86_64 Arch Linux install with kernel 3.13.8-1 > > $ gcc --version > gcc (GCC) 4.8.2 20140206 (prerelease) > > Other prereq versions: > m4 1.4.17-1 > flex 2.5.39-1 > perl 5.18.2-2 > jre7-openjdk 7.u51_2.4.6-1 > jdk7-openjdk 7.u51_2.4.6-1 > make 4.0-2 > gcc 4.8.2-8 > libxslt 1.1.28-3 > fop 1.1-1 > autoconf 2.69-1 > > I have tried building other "tags" on the git checkout, and from their > respective tarballs from erlang.org with the same results. > > Grepping for "L_LOOP_COUNT" on the source directory yields two files that > make use of it, and the build-time-generated file erts/emulator/pcre/pcre_exec_loop_break_cases.inc > . > > Googling for L_LOOP_COUNT and erlang, etc yields no useful results, of > which the most "informative" is this one: > http://stackoverflow.com/questions/9647427/fail-to-compile-erlang-r14b03 > > But the only use for that result is knowing that I'm not the only one > seeing this and that the issue is at least 2 years old. > > I'm not using MacOS, or kerl; I'm using Arch Linux, and building by > HOWTO/INSTALL.md. > > In a blind/crazy idea that it might be trying to use my system PCRE > (8.34-2) instead of the one in the sources directory I tried installing > some of those locally to my home directory and using LDFLAGS and CFLAGS > pointing to lib/include dirs where I installed them. This had no effect. > And, of course, running from a clean bash instance with no shell magic > applied to the environment. > > The reason I want to install from source is that I require R17 to poke > around, and my distro doesn't have packages for it yet. When it failed, I > tried building other Rs from source, and found I was getting the same > issues. > > I have the very deep feeling that I'm missing some simple thing, but can't > spot it. > > What steps would you suggest I follow? Any ideas? > > Thanks in advance. > > -- > Jamiel Almeida > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From txrev319@REDACTED Mon Apr 7 11:45:58 2014 From: txrev319@REDACTED (t x) Date: Mon, 7 Apr 2014 02:45:58 -0700 Subject: [erlang-questions] specifying directory for mnesia database In-Reply-To: References: Message-ID: I've tried: {env, [{mnesia, "/home/x/code/data/"}]} this compiles, but does not change the directory. I've also tried: {env, [{mnesia, dir, "/home/x/code/data/"}]} but this does not compile. Reading: http://stackoverflow.com/questions/1842462/erlang-specifying-a-working-directory-for-mnesia it says I should try application:set_env(mnesia, dir, Dir) How do I encode that into my app.src? Thanks! On Sun, Apr 6, 2014 at 8:21 PM, t x wrote: > Hi, > > * I'm learning to use Mnesia (until I run into 2GB table issues.) > > * I'm using erlang.mk + relx. > > * Everything appears to be working, _EXCEPT_ > > * mnesia appears to be storing its tables in _rel/'node()' > > * these tables appear to get wiped when I type "make" > > * I'm not happy when my db gets wiped when I recompile my code. > > > I've done some googling, and it appears my options are: > > > ## 1) specify directory on erl commandline > > example: erl -mnesia dir '"/tmp/funky"' > documentation: http://www.erlang.org/doc/apps/mnesia/Mnesia_chap2.html > > I'd prefer to not take this approach, as I don't want to hack erlang.mk/relx. > > > ## 2) specify in env config in app.src > > documentation: http://www.erlang.org/doc/man/app.html > > I think this is the approach I want. I also think there's a one line fix. > > Can someone tell me how to, via app.src, tell mnesia to store all it's > dbs in "/tmp/mnesia" ? > > Thanks! From essen@REDACTED Mon Apr 7 11:52:00 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 07 Apr 2014 11:52:00 +0200 Subject: [erlang-questions] specifying directory for mnesia database In-Reply-To: References: Message-ID: <53427540.9010702@ninenines.eu> Your .app file contains environment keys for your application. To change for another application you can use a sys.config file or call application:set_env/3 directly from your code. sys.config isn't very complicated, see: http://www.erlang.org/doc/man/config.html On 04/07/2014 11:45 AM, t x wrote: > I've tried: > > {env, [{mnesia, "/home/x/code/data/"}]} > > > this compiles, but does not change the directory. > > > I've also tried: > > {env, [{mnesia, dir, "/home/x/code/data/"}]} > > > but this does not compile. > > > Reading: http://stackoverflow.com/questions/1842462/erlang-specifying-a-working-directory-for-mnesia > it says I should try application:set_env(mnesia, dir, Dir) > > > How do I encode that into my app.src? > > > Thanks! > > On Sun, Apr 6, 2014 at 8:21 PM, t x wrote: >> Hi, >> >> * I'm learning to use Mnesia (until I run into 2GB table issues.) >> >> * I'm using erlang.mk + relx. >> >> * Everything appears to be working, _EXCEPT_ >> >> * mnesia appears to be storing its tables in _rel/'node()' >> >> * these tables appear to get wiped when I type "make" >> >> * I'm not happy when my db gets wiped when I recompile my code. >> >> >> I've done some googling, and it appears my options are: >> >> >> ## 1) specify directory on erl commandline >> >> example: erl -mnesia dir '"/tmp/funky"' >> documentation: http://www.erlang.org/doc/apps/mnesia/Mnesia_chap2.html >> >> I'd prefer to not take this approach, as I don't want to hack erlang.mk/relx. >> >> >> ## 2) specify in env config in app.src >> >> documentation: http://www.erlang.org/doc/man/app.html >> >> I think this is the approach I want. I also think there's a one line fix. >> >> Can someone tell me how to, via app.src, tell mnesia to store all it's >> dbs in "/tmp/mnesia" ? >> >> Thanks! > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From ingela.andin@REDACTED Mon Apr 7 11:53:17 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 7 Apr 2014 11:53:17 +0200 Subject: [erlang-questions] Fwd: SSL crashes while decoding alert. In-Reply-To: References: Message-ID: Hi! This is fixed in the latest version 17.0 (comming soon) or check master branch at github. Regards Ingela Erlang/OTP team - Ericsson AB 2014-04-04 10:33 GMT+02:00 atul atri : > Hi, > > I am using httpc to connect to a website that is using invalid > certificate. But it is crashing while ssl handshake. > > ====== > 7> httpc:request(post, {"https://somewhere.com", [], > "application/x-www-form-urlencoded", ""}, [{ssl, [{verify, verify_none}]}], > []). {error,{failed_connect,[{to_address,{" > somewhere.com", > 443}}, > {inet,[inet], > > {eoptions,{{function_clause,[{tls_connection,handle_alert, > > [{alert,1,112,{"tls_connection.erl",375}}, > > hello, > > {state,client, > > {#Ref<0.0.0.137>,<0.74.0>}, > > gen_tcp,tls_connection,tcp,tcp_closed,tcp_error,...}], > > [{file,"tls_connection.erl"},{line,834}]}, > > {tls_connection,handle_alerts,2, > > [{file,"tls_connection.erl"},{line,832}]}, > > {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]}, > > {proc_lib,init_p_do_apply,3, > > [{file,"proc_lib.erl"},{line,239}]}]}, > > {gen_fsm,sync_send_all_state_event, > > [<0.75.0>,{start,infinity},infinity]}}}}]}} > ======= > > I am able to browse website in Firefox. > > My elang version is > ==== > [root@REDACTED ~]# erl > Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:2:2] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V5.10.4 (abort with ^G) > ==== > > I googled it and it looks some thing related to > http://permalink.gmane.org/gmane.comp.lang.erlang.bugs/4302. > > Any help to fix or work around this is much appreciated. > > Thanks & Regards, > Atul Atri. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From garazdawi@REDACTED Mon Apr 7 12:05:42 2014 From: garazdawi@REDACTED (Lukas Larsson) Date: Mon, 7 Apr 2014 12:05:42 +0200 Subject: [erlang-questions] Problems building erlang from source In-Reply-To: References: Message-ID: grep should probably be added to this[1] list and maybe with a note that says to make sure that no grep options are set in the environment. [1]: https://github.com/erlang/otp/blob/master/HOWTO/INSTALL.md#building On Mon, Apr 7, 2014 at 11:48 AM, Jamiel Almeida wrote: > [2:34:13] [jamiel@REDACTED:erlang/] $ grep --version > grep (GNU grep) 2.18 > > I'll be damned... > > export GREP_OPTIONS='' > > and now it builds... and there I was wondering what was going on, and even > when I ran a bash (I don't have a .bashrc .bash_profile) and thought my > customizations and path from zsh wouldn't carry over... env was still > poisoned by that one variable that contained the a '-E' making the () in > there selectors for grouping regex instead of just characters. > > Is there a way we can detect this and/or put it on the README somewhere? > Might save some people the googling around. > > and THANKS! > > > On Mon, Apr 7, 2014 at 2:31 AM, Lukas Larsson wrote: > >> Hello, >> >> I'm not sure why, but it seems like on your system for some reason the >> expression below does not filter out the "COST_CHK(N)" clauses: >> >> grep -n COST_CHK erts/emulator/pcre/pcre_exec.c | grep -v 'COST_CHK(N)' >> 691: COST_CHK(1); >> 1792: COST_CHK(1); >> 1899: COST_CHK(1); >> 2067: COST_CHK(1); >> 2087: COST_CHK(1); >> 2184: COST_CHK(1); >> 2412: COST_CHK(1); >> 2483: COST_CHK(1); >> 2522: COST_CHK(1); >> 2716: COST_CHK(1); >> 2735: COST_CHK(1); >> 2846: COST_CHK(1); >> 3035: COST_CHK(1); >> 3849: COST_CHK(1); >> 3865: COST_CHK(1); >> 3879: COST_CHK(1); >> 3893: COST_CHK(1); >> 3907: COST_CHK(1); >> 3945: COST_CHK(1); >> 3947: COST_CHK(1); >> 3993: COST_CHK(1); >> 4003: COST_CHK(1); >> 4019: COST_CHK(1); >> 4058: COST_CHK(1); >> 4097: COST_CHK(1); >> 4124: COST_CHK(1); >> 4136: COST_CHK(1); >> 4148: COST_CHK(1); >> 4160: COST_CHK(1); >> 4172: COST_CHK(1); >> 4184: COST_CHK(1); >> 4196: COST_CHK(1); >> 4229: COST_CHK(1); >> 4260: COST_CHK(1); >> 4271: COST_CHK(1); >> 4282: COST_CHK(1); >> 4294: COST_CHK(1); >> 4306: COST_CHK(1); >> 4316: COST_CHK(1); >> 4326: COST_CHK(1); >> 4336: COST_CHK(1); >> 4346: COST_CHK(1); >> 4356: COST_CHK(1); >> 4366: COST_CHK(1); >> >> What version of grep are you using? >> >> Lukas >> >> >> On Mon, Apr 7, 2014 at 12:57 AM, Jamiel Almeida wrote: >> >>> Hey guys, >>> >>> I'm trying to build erlang from source (tried github and tar.gz sources >>> from erlang.org) >>> >>> I'm running into issues when it proceeds to build the pcre side of >>> things. >>> >>> Here's an excerpt of the point where `make` breaks: >>> gcc -c -Werror=return-type -g -O2 >>> -I/home/jamiel/repos/erlang/erts/x86_64-unknown-linux-gnu >>> -fno-tree-copyrename -D_GNU_SOURCE -DERTS_SMP -DHAVE_CONFIG_H -Wall >>> -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement >>> -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS >>> -D_POSIX_THREAD_SAFE_FUNCTIONS -DERLANG_INTEGRATION -o >>> /home/jamiel/repos/erlang/erts/emulator/pcre/obj/x86_64-unknown-linux-gnu/opt/pcre_exec.o >>> pcre/pcre_exec.c >>> In file included from pcre/pcre_exec.c:4451:0: >>> pcre/pcre_exec.c: In function 'match': >>> pcre/pcre_exec_loop_break_cases.inc:3:1: error: label 'L_LOOP_COUNT_585' >>> used but not defined >>> case 685: goto L_LOOP_COUNT_585; >>> ^ >>> pcre/pcre_exec_loop_break_cases.inc:2:1: error: label 'L_LOOP_COUNT_499' >>> used but not defined >>> case 599: goto L_LOOP_COUNT_499; >>> ^ >>> pcre/pcre_exec_loop_break_cases.inc:1:1: error: label 'L_LOOP_COUNT_474' >>> used but not defined >>> case 574: goto L_LOOP_COUNT_474; >>> ^ >>> pcre/pcre.mk:60: recipe for target >>> '/home/jamiel/repos/erlang/erts/emulator/pcre/obj/x86_64-unknown-linux-gnu/opt/pcre_exec.o' >>> failed >>> >>> Full output of the (./configure && make) commands is here: >>> https://gist.github.com/slashfoo/c71437a01e708086072f >>> >>> My system is an x86_64 Arch Linux install with kernel 3.13.8-1 >>> >>> $ gcc --version >>> gcc (GCC) 4.8.2 20140206 (prerelease) >>> >>> Other prereq versions: >>> m4 1.4.17-1 >>> flex 2.5.39-1 >>> perl 5.18.2-2 >>> jre7-openjdk 7.u51_2.4.6-1 >>> jdk7-openjdk 7.u51_2.4.6-1 >>> make 4.0-2 >>> gcc 4.8.2-8 >>> libxslt 1.1.28-3 >>> fop 1.1-1 >>> autoconf 2.69-1 >>> >>> I have tried building other "tags" on the git checkout, and from their >>> respective tarballs from erlang.org with the same results. >>> >>> Grepping for "L_LOOP_COUNT" on the source directory yields two files >>> that make use of it, and the build-time-generated file erts/emulator/pcre/pcre_exec_loop_break_cases.inc >>> . >>> >>> Googling for L_LOOP_COUNT and erlang, etc yields no useful results, of >>> which the most "informative" is this one: >>> http://stackoverflow.com/questions/9647427/fail-to-compile-erlang-r14b03 >>> >>> But the only use for that result is knowing that I'm not the only one >>> seeing this and that the issue is at least 2 years old. >>> >>> I'm not using MacOS, or kerl; I'm using Arch Linux, and building by >>> HOWTO/INSTALL.md. >>> >>> In a blind/crazy idea that it might be trying to use my system PCRE >>> (8.34-2) instead of the one in the sources directory I tried installing >>> some of those locally to my home directory and using LDFLAGS and CFLAGS >>> pointing to lib/include dirs where I installed them. This had no effect. >>> And, of course, running from a clean bash instance with no shell magic >>> applied to the environment. >>> >>> The reason I want to install from source is that I require R17 to poke >>> around, and my distro doesn't have packages for it yet. When it failed, I >>> tried building other Rs from source, and found I was getting the same >>> issues. >>> >>> I have the very deep feeling that I'm missing some simple thing, but >>> can't spot it. >>> >>> What steps would you suggest I follow? Any ideas? >>> >>> Thanks in advance. >>> >>> -- >>> Jamiel Almeida >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > > > -- > Jamiel Almeida > -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Mon Apr 7 12:10:19 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Mon, 7 Apr 2014 12:10:19 +0200 Subject: [erlang-questions] Problems building erlang from source In-Reply-To: References: Message-ID: The onus should be on the build system to properly ignore GREP_OPTIONS. -- Anthony Ramine Le 7 avr. 2014 ? 12:05, Lukas Larsson a ?crit : > grep should probably be added to this[1] list and maybe with a note that says to make sure that no grep options are set in the environment. From g@REDACTED Mon Apr 7 12:21:30 2014 From: g@REDACTED (Garrett Smith) Date: Mon, 7 Apr 2014 05:21:30 -0500 Subject: [erlang-questions] Controlling an Erlang system process Message-ID: Historically I've used run_erl + to_erl to daemonize and programmatically interact with an Erlang system process (i.e. VM). I don't care to use distributed Erlang because it relies on epmd and a second node -- two moving parts that should not be required for something as simple as, say, shutting down an Erlang system. On R16 at least, to_erl has some strange "search" artifact that breaks this functionality: $ echo "init:stop()." | to_erl /path/to/pipes/ I'll check out more recent releases to see if this is fixed. But while run_erl/to_erl works, I've never liked it for controlling Erlang system processes. I think I'd like a native wrapper that can start an Erlang system and that handles OS signals, passing them through to a custom handler in Erlang. Has anyone seen/written something like this? Garrett From txrev319@REDACTED Mon Apr 7 12:31:20 2014 From: txrev319@REDACTED (t x) Date: Mon, 7 Apr 2014 03:31:20 -0700 Subject: [erlang-questions] specifying directory for mnesia database In-Reply-To: <53427540.9010702@ninenines.eu> References: <53427540.9010702@ninenines.eu> Message-ID: I've already tried (in .app.src) {env, [{mnesia, [{dir, "/home/x/data/"}]}]} then, when I run _rel/bin/blah console mnesia:info() it still shows /home/x/code/_rel/... With all due respect, I think this is a case I'd learn much more from seeing the correct config and working backwards rather than trying to brute force all *.app.src combinations On Mon, Apr 7, 2014 at 2:52 AM, Lo?c Hoguin wrote: > Your .app file contains environment keys for your application. To change for > another application you can use a sys.config file or call > application:set_env/3 directly from your code. > > sys.config isn't very complicated, see: > http://www.erlang.org/doc/man/config.html > > > On 04/07/2014 11:45 AM, t x wrote: >> >> I've tried: >> >> {env, [{mnesia, "/home/x/code/data/"}]} >> >> >> this compiles, but does not change the directory. >> >> >> I've also tried: >> >> {env, [{mnesia, dir, "/home/x/code/data/"}]} >> >> >> but this does not compile. >> >> >> Reading: >> http://stackoverflow.com/questions/1842462/erlang-specifying-a-working-directory-for-mnesia >> it says I should try application:set_env(mnesia, dir, Dir) >> >> >> How do I encode that into my app.src? >> >> >> Thanks! >> >> On Sun, Apr 6, 2014 at 8:21 PM, t x wrote: >>> >>> Hi, >>> >>> * I'm learning to use Mnesia (until I run into 2GB table issues.) >>> >>> * I'm using erlang.mk + relx. >>> >>> * Everything appears to be working, _EXCEPT_ >>> >>> * mnesia appears to be storing its tables in _rel/'node()' >>> >>> * these tables appear to get wiped when I type "make" >>> >>> * I'm not happy when my db gets wiped when I recompile my code. >>> >>> >>> I've done some googling, and it appears my options are: >>> >>> >>> ## 1) specify directory on erl commandline >>> >>> example: erl -mnesia dir '"/tmp/funky"' >>> documentation: http://www.erlang.org/doc/apps/mnesia/Mnesia_chap2.html >>> >>> I'd prefer to not take this approach, as I don't want to hack >>> erlang.mk/relx. >>> >>> >>> ## 2) specify in env config in app.src >>> >>> documentation: http://www.erlang.org/doc/man/app.html >>> >>> I think this is the approach I want. I also think there's a one line fix. >>> >>> Can someone tell me how to, via app.src, tell mnesia to store all it's >>> dbs in "/tmp/mnesia" ? >>> >>> Thanks! >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > -- > Lo?c Hoguin > http://ninenines.eu From g@REDACTED Mon Apr 7 12:31:02 2014 From: g@REDACTED (Garrett Smith) Date: Mon, 7 Apr 2014 05:31:02 -0500 Subject: [erlang-questions] Controlling an Erlang system process In-Reply-To: References: Message-ID: On Mon, Apr 7, 2014 at 5:21 AM, Garrett Smith wrote: > I think I'd like a native wrapper that can > start an Erlang system and that handles OS signals, passing them > through to a custom handler in Erlang. > > Has anyone seen/written something like this? Naturally, after asking this question I thought, why not try a search engine? This turned up, which seems to do the trick: https://github.com/jkingsbery/sighandler Thanks Internet! From ali.sabil@REDACTED Mon Apr 7 12:32:41 2014 From: ali.sabil@REDACTED (Ali Sabil) Date: Mon, 7 Apr 2014 12:32:41 +0200 Subject: [erlang-questions] Controlling an Erlang system process In-Reply-To: References: Message-ID: Never used it myself, but this came to mind: https://github.com/ShoreTel-Inc/erld On Mon, Apr 7, 2014 at 12:31 PM, Garrett Smith wrote: > On Mon, Apr 7, 2014 at 5:21 AM, Garrett Smith wrote: > > I think I'd like a native wrapper that can > > start an Erlang system and that handles OS signals, passing them > > through to a custom handler in Erlang. > > > > Has anyone seen/written something like this? > > Naturally, after asking this question I thought, why not try a search > engine? > > This turned up, which seems to do the trick: > > https://github.com/jkingsbery/sighandler > > Thanks Internet! > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Mon Apr 7 12:35:48 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 07 Apr 2014 12:35:48 +0200 Subject: [erlang-questions] specifying directory for mnesia database In-Reply-To: References: <53427540.9010702@ninenines.eu> Message-ID: <53427F84.4080805@ninenines.eu> In the .app file you can only put environment for *your* application. Not *mnesia*'s. You have to use a sys.config file to put environment for any applications. Your sys.config file should contain [{mnesia, [{dir, "/home/x/data/"}]}]. though. This part is right. Where you put it, isn't. I do not have a handy example, sorry. On 04/07/2014 12:31 PM, t x wrote: > I've already tried (in .app.src) > > {env, [{mnesia, [{dir, "/home/x/data/"}]}]} > > then, when I run _rel/bin/blah console > > mnesia:info() > > it still shows /home/x/code/_rel/... > > > With all due respect, I think this is a case I'd learn much more from > seeing the correct config and working backwards rather than trying to > brute force all *.app.src combinations > > On Mon, Apr 7, 2014 at 2:52 AM, Lo?c Hoguin wrote: >> Your .app file contains environment keys for your application. To change for >> another application you can use a sys.config file or call >> application:set_env/3 directly from your code. >> >> sys.config isn't very complicated, see: >> http://www.erlang.org/doc/man/config.html >> >> >> On 04/07/2014 11:45 AM, t x wrote: >>> >>> I've tried: >>> >>> {env, [{mnesia, "/home/x/code/data/"}]} >>> >>> >>> this compiles, but does not change the directory. >>> >>> >>> I've also tried: >>> >>> {env, [{mnesia, dir, "/home/x/code/data/"}]} >>> >>> >>> but this does not compile. >>> >>> >>> Reading: >>> http://stackoverflow.com/questions/1842462/erlang-specifying-a-working-directory-for-mnesia >>> it says I should try application:set_env(mnesia, dir, Dir) >>> >>> >>> How do I encode that into my app.src? >>> >>> >>> Thanks! >>> >>> On Sun, Apr 6, 2014 at 8:21 PM, t x wrote: >>>> >>>> Hi, >>>> >>>> * I'm learning to use Mnesia (until I run into 2GB table issues.) >>>> >>>> * I'm using erlang.mk + relx. >>>> >>>> * Everything appears to be working, _EXCEPT_ >>>> >>>> * mnesia appears to be storing its tables in _rel/'node()' >>>> >>>> * these tables appear to get wiped when I type "make" >>>> >>>> * I'm not happy when my db gets wiped when I recompile my code. >>>> >>>> >>>> I've done some googling, and it appears my options are: >>>> >>>> >>>> ## 1) specify directory on erl commandline >>>> >>>> example: erl -mnesia dir '"/tmp/funky"' >>>> documentation: http://www.erlang.org/doc/apps/mnesia/Mnesia_chap2.html >>>> >>>> I'd prefer to not take this approach, as I don't want to hack >>>> erlang.mk/relx. >>>> >>>> >>>> ## 2) specify in env config in app.src >>>> >>>> documentation: http://www.erlang.org/doc/man/app.html >>>> >>>> I think this is the approach I want. I also think there's a one line fix. >>>> >>>> Can someone tell me how to, via app.src, tell mnesia to store all it's >>>> dbs in "/tmp/mnesia" ? >>>> >>>> Thanks! >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> >> -- >> Lo?c Hoguin >> http://ninenines.eu -- Lo?c Hoguin http://ninenines.eu From g@REDACTED Mon Apr 7 12:52:10 2014 From: g@REDACTED (Garrett Smith) Date: Mon, 7 Apr 2014 05:52:10 -0500 Subject: [erlang-questions] Controlling an Erlang system process In-Reply-To: References: Message-ID: On Mon, Apr 7, 2014 at 5:21 AM, Garrett Smith wrote: > On R16 at least, to_erl has some strange "search" artifact that breaks > this functionality: > > $ echo "init:stop()." | to_erl /path/to/pipes/ > > I'll check out more recent releases to see if this is fixed. For the record, this has indeed been fixed at least in R16B03. Garrett From slashfoo@REDACTED Mon Apr 7 11:48:02 2014 From: slashfoo@REDACTED (Jamiel Almeida) Date: Mon, 7 Apr 2014 02:48:02 -0700 Subject: [erlang-questions] Problems building erlang from source In-Reply-To: References: Message-ID: [2:34:13] [jamiel@REDACTED:erlang/] $ grep --version grep (GNU grep) 2.18 I'll be damned... export GREP_OPTIONS='' and now it builds... and there I was wondering what was going on, and even when I ran a bash (I don't have a .bashrc .bash_profile) and thought my customizations and path from zsh wouldn't carry over... env was still poisoned by that one variable that contained the a '-E' making the () in there selectors for grouping regex instead of just characters. Is there a way we can detect this and/or put it on the README somewhere? Might save some people the googling around. and THANKS! On Mon, Apr 7, 2014 at 2:31 AM, Lukas Larsson wrote: > Hello, > > I'm not sure why, but it seems like on your system for some reason the > expression below does not filter out the "COST_CHK(N)" clauses: > > grep -n COST_CHK erts/emulator/pcre/pcre_exec.c | grep -v 'COST_CHK(N)' > 691: COST_CHK(1); > 1792: COST_CHK(1); > 1899: COST_CHK(1); > 2067: COST_CHK(1); > 2087: COST_CHK(1); > 2184: COST_CHK(1); > 2412: COST_CHK(1); > 2483: COST_CHK(1); > 2522: COST_CHK(1); > 2716: COST_CHK(1); > 2735: COST_CHK(1); > 2846: COST_CHK(1); > 3035: COST_CHK(1); > 3849: COST_CHK(1); > 3865: COST_CHK(1); > 3879: COST_CHK(1); > 3893: COST_CHK(1); > 3907: COST_CHK(1); > 3945: COST_CHK(1); > 3947: COST_CHK(1); > 3993: COST_CHK(1); > 4003: COST_CHK(1); > 4019: COST_CHK(1); > 4058: COST_CHK(1); > 4097: COST_CHK(1); > 4124: COST_CHK(1); > 4136: COST_CHK(1); > 4148: COST_CHK(1); > 4160: COST_CHK(1); > 4172: COST_CHK(1); > 4184: COST_CHK(1); > 4196: COST_CHK(1); > 4229: COST_CHK(1); > 4260: COST_CHK(1); > 4271: COST_CHK(1); > 4282: COST_CHK(1); > 4294: COST_CHK(1); > 4306: COST_CHK(1); > 4316: COST_CHK(1); > 4326: COST_CHK(1); > 4336: COST_CHK(1); > 4346: COST_CHK(1); > 4356: COST_CHK(1); > 4366: COST_CHK(1); > > What version of grep are you using? > > Lukas > > > On Mon, Apr 7, 2014 at 12:57 AM, Jamiel Almeida wrote: > >> Hey guys, >> >> I'm trying to build erlang from source (tried github and tar.gz sources >> from erlang.org) >> >> I'm running into issues when it proceeds to build the pcre side of things. >> >> Here's an excerpt of the point where `make` breaks: >> gcc -c -Werror=return-type -g -O2 >> -I/home/jamiel/repos/erlang/erts/x86_64-unknown-linux-gnu >> -fno-tree-copyrename -D_GNU_SOURCE -DERTS_SMP -DHAVE_CONFIG_H -Wall >> -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement >> -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS >> -D_POSIX_THREAD_SAFE_FUNCTIONS -DERLANG_INTEGRATION -o >> /home/jamiel/repos/erlang/erts/emulator/pcre/obj/x86_64-unknown-linux-gnu/opt/pcre_exec.o >> pcre/pcre_exec.c >> In file included from pcre/pcre_exec.c:4451:0: >> pcre/pcre_exec.c: In function ?match?: >> pcre/pcre_exec_loop_break_cases.inc:3:1: error: label ?L_LOOP_COUNT_585? >> used but not defined >> case 685: goto L_LOOP_COUNT_585; >> ^ >> pcre/pcre_exec_loop_break_cases.inc:2:1: error: label ?L_LOOP_COUNT_499? >> used but not defined >> case 599: goto L_LOOP_COUNT_499; >> ^ >> pcre/pcre_exec_loop_break_cases.inc:1:1: error: label ?L_LOOP_COUNT_474? >> used but not defined >> case 574: goto L_LOOP_COUNT_474; >> ^ >> pcre/pcre.mk:60: recipe for target >> '/home/jamiel/repos/erlang/erts/emulator/pcre/obj/x86_64-unknown-linux-gnu/opt/pcre_exec.o' >> failed >> >> Full output of the (./configure && make) commands is here: >> https://gist.github.com/slashfoo/c71437a01e708086072f >> >> My system is an x86_64 Arch Linux install with kernel 3.13.8-1 >> >> $ gcc --version >> gcc (GCC) 4.8.2 20140206 (prerelease) >> >> Other prereq versions: >> m4 1.4.17-1 >> flex 2.5.39-1 >> perl 5.18.2-2 >> jre7-openjdk 7.u51_2.4.6-1 >> jdk7-openjdk 7.u51_2.4.6-1 >> make 4.0-2 >> gcc 4.8.2-8 >> libxslt 1.1.28-3 >> fop 1.1-1 >> autoconf 2.69-1 >> >> I have tried building other "tags" on the git checkout, and from their >> respective tarballs from erlang.org with the same results. >> >> Grepping for "L_LOOP_COUNT" on the source directory yields two files that >> make use of it, and the build-time-generated file erts/emulator/pcre/pcre_exec_loop_break_cases.inc >> . >> >> Googling for L_LOOP_COUNT and erlang, etc yields no useful results, of >> which the most "informative" is this one: >> http://stackoverflow.com/questions/9647427/fail-to-compile-erlang-r14b03 >> >> But the only use for that result is knowing that I'm not the only one >> seeing this and that the issue is at least 2 years old. >> >> I'm not using MacOS, or kerl; I'm using Arch Linux, and building by >> HOWTO/INSTALL.md. >> >> In a blind/crazy idea that it might be trying to use my system PCRE >> (8.34-2) instead of the one in the sources directory I tried installing >> some of those locally to my home directory and using LDFLAGS and CFLAGS >> pointing to lib/include dirs where I installed them. This had no effect. >> And, of course, running from a clean bash instance with no shell magic >> applied to the environment. >> >> The reason I want to install from source is that I require R17 to poke >> around, and my distro doesn't have packages for it yet. When it failed, I >> tried building other Rs from source, and found I was getting the same >> issues. >> >> I have the very deep feeling that I'm missing some simple thing, but >> can't spot it. >> >> What steps would you suggest I follow? Any ideas? >> >> Thanks in advance. >> >> -- >> Jamiel Almeida >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- Jamiel Almeida -------------- next part -------------- An HTML attachment was scrubbed... URL: From txrev319@REDACTED Mon Apr 7 13:05:01 2014 From: txrev319@REDACTED (t x) Date: Mon, 7 Apr 2014 04:05:01 -0700 Subject: [erlang-questions] specifying directory for mnesia database In-Reply-To: <53427F84.4080805@ninenines.eu> References: <53427540.9010702@ninenines.eu> <53427F84.4080805@ninenines.eu> Message-ID: This is my fault for not creating a minimal failure case. Working to remedy this. On Mon, Apr 7, 2014 at 3:35 AM, Lo?c Hoguin wrote: > In the .app file you can only put environment for *your* application. Not > *mnesia*'s. You have to use a sys.config file to put environment for any > applications. > > Your sys.config file should contain > > [{mnesia, [{dir, "/home/x/data/"}]}]. > > though. This part is right. Where you put it, isn't. > > I do not have a handy example, sorry. > > > On 04/07/2014 12:31 PM, t x wrote: >> >> I've already tried (in .app.src) >> >> {env, [{mnesia, [{dir, "/home/x/data/"}]}]} >> >> then, when I run _rel/bin/blah console >> >> mnesia:info() >> >> it still shows /home/x/code/_rel/... >> >> >> With all due respect, I think this is a case I'd learn much more from >> seeing the correct config and working backwards rather than trying to >> brute force all *.app.src combinations >> >> On Mon, Apr 7, 2014 at 2:52 AM, Lo?c Hoguin wrote: >>> >>> Your .app file contains environment keys for your application. To change >>> for >>> another application you can use a sys.config file or call >>> application:set_env/3 directly from your code. >>> >>> sys.config isn't very complicated, see: >>> http://www.erlang.org/doc/man/config.html >>> >>> >>> On 04/07/2014 11:45 AM, t x wrote: >>>> >>>> >>>> I've tried: >>>> >>>> {env, [{mnesia, "/home/x/code/data/"}]} >>>> >>>> >>>> this compiles, but does not change the directory. >>>> >>>> >>>> I've also tried: >>>> >>>> {env, [{mnesia, dir, "/home/x/code/data/"}]} >>>> >>>> >>>> but this does not compile. >>>> >>>> >>>> Reading: >>>> >>>> http://stackoverflow.com/questions/1842462/erlang-specifying-a-working-directory-for-mnesia >>>> it says I should try application:set_env(mnesia, dir, Dir) >>>> >>>> >>>> How do I encode that into my app.src? >>>> >>>> >>>> Thanks! >>>> >>>> On Sun, Apr 6, 2014 at 8:21 PM, t x wrote: >>>>> >>>>> >>>>> Hi, >>>>> >>>>> * I'm learning to use Mnesia (until I run into 2GB table issues.) >>>>> >>>>> * I'm using erlang.mk + relx. >>>>> >>>>> * Everything appears to be working, _EXCEPT_ >>>>> >>>>> * mnesia appears to be storing its tables in _rel/'node()' >>>>> >>>>> * these tables appear to get wiped when I type "make" >>>>> >>>>> * I'm not happy when my db gets wiped when I recompile my code. >>>>> >>>>> >>>>> I've done some googling, and it appears my options are: >>>>> >>>>> >>>>> ## 1) specify directory on erl commandline >>>>> >>>>> example: erl -mnesia dir '"/tmp/funky"' >>>>> documentation: http://www.erlang.org/doc/apps/mnesia/Mnesia_chap2.html >>>>> >>>>> I'd prefer to not take this approach, as I don't want to hack >>>>> erlang.mk/relx. >>>>> >>>>> >>>>> ## 2) specify in env config in app.src >>>>> >>>>> documentation: http://www.erlang.org/doc/man/app.html >>>>> >>>>> I think this is the approach I want. I also think there's a one line >>>>> fix. >>>>> >>>>> Can someone tell me how to, via app.src, tell mnesia to store all it's >>>>> dbs in "/tmp/mnesia" ? >>>>> >>>>> Thanks! >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>> >>> -- >>> Lo?c Hoguin >>> http://ninenines.eu > > > -- > Lo?c Hoguin > http://ninenines.eu From txrev319@REDACTED Mon Apr 7 13:16:31 2014 From: txrev319@REDACTED (t x) Date: Mon, 7 Apr 2014 04:16:31 -0700 Subject: [erlang-questions] minimal failure case for specifying mnesia directory Message-ID: Hi, Here is my minimal failure case: https://github.com/txrev319/fail0 This is what's going on here. When I * run _rel/bin/fail0 console * and then I type in "mnesia:info()" * I get /home/x/tmp/fail0/_rel/Mnesia.fail0@REDACTED despite putting "/home/x/data" into priv/sys.config. See: https://github.com/txrev319/fail0/blob/master/priv/sys.config I'm clearly doing something retarded. What am I doing wrong? Thanks! ## begin copy/paste x@REDACTED:~/tmp/fail0$ _rel/bin/fail0 console Exec: /home/x/tmp/fail0/_rel/erts-6.0/bin/erlexec -boot /home/x/tmp/fail0/_rel/releases/1/fail0 -env ERL_LIBS /home/x/tmp/fail0/_rel/releases/1/lib -config /home/x/tmp/fail0/_rel/releases/1/sys.config -args_file /home/x/tmp/fail0/_rel/releases/1/vm.args -- console Root: /home/x/tmp/fail0/_rel Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) (fail0@REDACTED)1> mnesia:info(). ---> Processes holding locks <--- ---> Processes waiting for locks <--- ---> Participant transactions <--- ---> Coordinator transactions <--- ---> Uncertain transactions <--- ---> Active tables <--- schema : with 1 records occupying 397 words of mem ===> System info in version "4.12", debug level = none <=== opt_disc. Directory "/home/x/tmp/fail0/_rel/Mnesia.fail0@REDACTED" is NOT used. use fallback at restart = false running db nodes = ['fail0@REDACTED'] stopped db nodes = [] master node tables = [] remote = [] ram_copies = [schema] disc_copies = [] disc_only_copies = [] [{'fail0@REDACTED',ram_copies}] = [schema] 2 transactions committed, 0 aborted, 0 restarted, 0 logged to disc 0 held locks, 0 in queue; 0 local transactions, 0 remote 0 transactions waits for other nodes: [] ok From essen@REDACTED Mon Apr 7 13:20:09 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 07 Apr 2014 13:20:09 +0200 Subject: [erlang-questions] minimal failure case for specifying mnesia directory In-Reply-To: References: Message-ID: <534289E9.20309@ninenines.eu> You have to tell relx about your sys.config file, it doesn't magically find it. From the relx wiki page: %% If you have a sys.config file you need to tell relx where it is. If you do %% that relx will include the sys.config in the appropriate place %% automatically. {sys_config, "./config/sys.config"}. https://github.com/erlware/relx/wiki/configuration On 04/07/2014 01:16 PM, t x wrote: > Hi, > > Here is my minimal failure case: > > https://github.com/txrev319/fail0 > > This is what's going on here. When I > * run _rel/bin/fail0 console > * and then I type in "mnesia:info()" > > * I get /home/x/tmp/fail0/_rel/Mnesia.fail0@REDACTED > > despite putting "/home/x/data" into priv/sys.config. See: > https://github.com/txrev319/fail0/blob/master/priv/sys.config > > > I'm clearly doing something retarded. What am I doing wrong? > > Thanks! > > ## begin copy/paste > > x@REDACTED:~/tmp/fail0$ _rel/bin/fail0 console > Exec: /home/x/tmp/fail0/_rel/erts-6.0/bin/erlexec -boot > /home/x/tmp/fail0/_rel/releases/1/fail0 -env ERL_LIBS > /home/x/tmp/fail0/_rel/releases/1/lib -config > /home/x/tmp/fail0/_rel/releases/1/sys.config -args_file > /home/x/tmp/fail0/_rel/releases/1/vm.args -- console > Root: /home/x/tmp/fail0/_rel > Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source] [64-bit] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > (fail0@REDACTED)1> mnesia:info(). > ---> Processes holding locks <--- > ---> Processes waiting for locks <--- > ---> Participant transactions <--- > ---> Coordinator transactions <--- > ---> Uncertain transactions <--- > ---> Active tables <--- > schema : with 1 records occupying 397 words of mem > ===> System info in version "4.12", debug level = none <=== > opt_disc. Directory "/home/x/tmp/fail0/_rel/Mnesia.fail0@REDACTED" is NOT used. > use fallback at restart = false > running db nodes = ['fail0@REDACTED'] > stopped db nodes = [] > master node tables = [] > remote = [] > ram_copies = [schema] > disc_copies = [] > disc_only_copies = [] > [{'fail0@REDACTED',ram_copies}] = [schema] > 2 transactions committed, 0 aborted, 0 restarted, 0 logged to disc > 0 held locks, 0 in queue; 0 local transactions, 0 remote > 0 transactions waits for other nodes: [] > ok > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From txrev319@REDACTED Mon Apr 7 13:27:28 2014 From: txrev319@REDACTED (t x) Date: Mon, 7 Apr 2014 04:27:28 -0700 Subject: [erlang-questions] minimal failure case for specifying mnesia directory In-Reply-To: <534289E9.20309@ninenines.eu> References: <534289E9.20309@ninenines.eu> Message-ID: This works. This issue is now resolved. Thanks for your patience with this. :-) On Mon, Apr 7, 2014 at 4:20 AM, Lo?c Hoguin wrote: > You have to tell relx about your sys.config file, it doesn't magically find > it. From the relx wiki page: > > %% If you have a sys.config file you need to tell relx where it is. If you > do > %% that relx will include the sys.config in the appropriate place > %% automatically. > {sys_config, "./config/sys.config"}. > > https://github.com/erlware/relx/wiki/configuration > > > On 04/07/2014 01:16 PM, t x wrote: >> >> Hi, >> >> Here is my minimal failure case: >> >> https://github.com/txrev319/fail0 >> >> This is what's going on here. When I >> * run _rel/bin/fail0 console >> * and then I type in "mnesia:info()" >> >> * I get /home/x/tmp/fail0/_rel/Mnesia.fail0@REDACTED >> >> despite putting "/home/x/data" into priv/sys.config. See: >> https://github.com/txrev319/fail0/blob/master/priv/sys.config >> >> >> I'm clearly doing something retarded. What am I doing wrong? >> >> Thanks! >> >> ## begin copy/paste >> >> x@REDACTED:~/tmp/fail0$ _rel/bin/fail0 console >> Exec: /home/x/tmp/fail0/_rel/erts-6.0/bin/erlexec -boot >> /home/x/tmp/fail0/_rel/releases/1/fail0 -env ERL_LIBS >> /home/x/tmp/fail0/_rel/releases/1/lib -config >> /home/x/tmp/fail0/_rel/releases/1/sys.config -args_file >> /home/x/tmp/fail0/_rel/releases/1/vm.args -- console >> Root: /home/x/tmp/fail0/_rel >> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source] [64-bit] >> [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V6.0 (abort with ^G) >> (fail0@REDACTED)1> mnesia:info(). >> ---> Processes holding locks <--- >> ---> Processes waiting for locks <--- >> ---> Participant transactions <--- >> ---> Coordinator transactions <--- >> ---> Uncertain transactions <--- >> ---> Active tables <--- >> schema : with 1 records occupying 397 words of mem >> ===> System info in version "4.12", debug level = none <=== >> opt_disc. Directory "/home/x/tmp/fail0/_rel/Mnesia.fail0@REDACTED" is NOT >> used. >> use fallback at restart = false >> running db nodes = ['fail0@REDACTED'] >> stopped db nodes = [] >> master node tables = [] >> remote = [] >> ram_copies = [schema] >> disc_copies = [] >> disc_only_copies = [] >> [{'fail0@REDACTED',ram_copies}] = [schema] >> 2 transactions committed, 0 aborted, 0 restarted, 0 logged to disc >> 0 held locks, 0 in queue; 0 local transactions, 0 remote >> 0 transactions waits for other nodes: [] >> ok >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > -- > Lo?c Hoguin > http://ninenines.eu From lukas@REDACTED Mon Apr 7 14:32:25 2014 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 7 Apr 2014 14:32:25 +0200 Subject: [erlang-questions] Problems building erlang from source In-Reply-To: References: Message-ID: On Mon, Apr 7, 2014 at 12:10 PM, Anthony Ramine wrote: > The onus should be on the build system to properly ignore GREP_OPTIONS. > > Why should it? What if on some system you have to pass some compatibility flag to grep? Ignoring GREP_OPTIONS would make that impossible. If we want the build system to fix this, I think we should pass the -F flag to grep when invoking it. That way we can set GREP_OPTIONS when needed and force the grep in pcre to use fixed strings. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From egil@REDACTED Mon Apr 7 14:41:16 2014 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Mon, 7 Apr 2014 14:41:16 +0200 Subject: [erlang-questions] beam.smp startup time regression In-Reply-To: References: <533EACAD.8010205@erlang.org> Message-ID: <53429CEC.3070607@erlang.org> On 2014-04-04 19:20, Tuncer Ayaz wrote: > On Fri, Apr 4, 2014 at 5:01 PM, Dan Gudmundsson wrote: >> Doesn't rebar compile erlang files in parallel? > Yes, -j/--jobs defaults to 3 processes. > >> If so you want async threads.. > Have I been under the wrong impression that the process schedulers > independently make use of os threads and that +AN is for inet_drv, > efile_drv, zlib_drv, etc.? I mean, I was under the impression that +AN > is mostly for erl_check_io. Async-threads are for the file-handling and thus the efile_drv. Async-threads should be used regardless if the jobs are done in parallel or not. > >> On Fri, Apr 4, 2014 at 4:49 PM, Tuncer Ayaz wrote: >>> In addition to "erl -eval 'halt(0).'", I tried "rebar --version", >>> and the results (ignoring extreme outliers) with R16B03-1 +A0 are >>> promising. >>> >>> $ time rebar --version >>> low: >>> real 0m0.280s >>> user 0m0.240s >>> sys 0m0.053s >>> >>> high: >>> real 0m0.375s >>> user 0m0.313s >>> sys 0m0.063s >>> >>> $ export ERL_FLAGS=+A0 >>> $ time rebar --version >>> low: >>> real 0m0.244s >>> user 0m0.200s >>> sys 0m0.037s >>> >>> high: >>> real 0m0.262s >>> user 0m0.217s >>> sys 0m0.033s >>> >>> Egil, would you advise against adding +A0 to rebar's escript >>> emu_args in the header? I mean, is it generally important to have >>> async threads for any kind of erlang code running on R16 and later? > From z@REDACTED Tue Apr 8 06:37:09 2014 From: z@REDACTED (Danil Zagoskin) Date: Tue, 8 Apr 2014 08:37:09 +0400 Subject: [erlang-questions] Does Erlang/OTP SSL app have heartbleed vulnerability? Message-ID: Hello! Recently heartbleed bug was found in openssl: http://heartbleed.com/ As far as I know, OTP SSL and crypto apps use openssl, but some of SSL handshake logic is rewritten in Erlang. Grepping lib/ssl and lib/crypto sources for 'heartbeat' didn't give any results. I have not found any tool to check a server for the vulnerability either. So, should anyone using SSL in OTP immediately upgrade openssl to fix this bug? -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From paulperegud@REDACTED Tue Apr 8 08:00:47 2014 From: paulperegud@REDACTED (Paul Peregud) Date: Tue, 8 Apr 2014 08:00:47 +0200 Subject: [erlang-questions] Does Erlang/OTP SSL app have heartbleed vulnerability? In-Reply-To: References: Message-ID: Since we are at SSL, it would be almost On Topic. Frankencert - Adversarial Testing of Certificate Validation in SSL/TLS Implementations: https://github.com/sumanj/frankencert/blob/master/README.md On Apr 8, 2014 6:37 AM, "Danil Zagoskin" wrote: > Hello! > > Recently heartbleed bug was found in openssl: http://heartbleed.com/ > > As far as I know, OTP SSL and crypto apps use openssl, but some of SSL > handshake logic is rewritten in Erlang. > > Grepping lib/ssl and lib/crypto sources for 'heartbeat' didn't give any > results. > I have not found any tool to check a server for the vulnerability either. > > So, should anyone using SSL in OTP immediately upgrade openssl to fix this > bug? > > > -- > Danil Zagoskin | z@REDACTED > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From arif.ishaq@REDACTED Tue Apr 8 09:07:58 2014 From: arif.ishaq@REDACTED (Arif Ishaq) Date: Tue, 8 Apr 2014 07:07:58 +0000 Subject: [erlang-questions] security concerns In-Reply-To: References: <1CAB695D2C2A8F4BB0B242A5B44C75E9125A9758@ESESSMB301.ericsson.se> Message-ID: <1CAB695D2C2A8F4BB0B242A5B44C75E9125B313A@ESESSMB301.ericsson.se> Thanks for all the great insights. I was thinking along the lines of sandboxing and frameworks such as DCE when I read the article, but I see now that the article was rather misleading. Best regards Arif -----Original Message----- Cc: erlang-questions@REDACTED Subject: [erlang-questions] security concerns > I just saw a post by Carlos-Trigoso on the security, or rather lack > thereof in Erlang (http://carlos-trigoso.com/2014/03/04/security-taken-lightly/) . > > It seems like a fair evaluation. Is there anything in the making to > improve on it? From alex@REDACTED Tue Apr 8 06:58:40 2014 From: alex@REDACTED (Alex Wilson) Date: Tue, 8 Apr 2014 14:58:40 +1000 Subject: [erlang-questions] Does Erlang/OTP SSL app have heartbleed vulnerability? In-Reply-To: References: Message-ID: On 8 Apr 2014, at 2:37 pm, Danil Zagoskin wrote: > As far as I know, OTP SSL and crypto apps use openssl, but some of SSL handshake logic is rewritten in Erlang. From my reading, it's more like all of the handshake logic is in Erlang. It really looks like it only uses OpenSSL for the crypto features like ciphers. The code to encode/decode TLS extensions in the Hello messages doesn't appear to support RFC6520 (the "heartbeat" extension) -- it's extension type #15, which is not in any of the logic there (it will just drop it or else never send it, as far as I can tell). So from what I can see, it won't negotiate heartbeat support at the start, and will just ignore any messages about it (since it doesn't understand them). It would be nice to have a quick test that can be run for this vulnerability though... From ingela.andin@REDACTED Tue Apr 8 09:38:03 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 8 Apr 2014 09:38:03 +0200 Subject: [erlang-questions] Does Erlang/OTP SSL app have heartbleed vulnerability? In-Reply-To: References: Message-ID: Hi! 2014-04-08 6:37 GMT+02:00 Danil Zagoskin : > Hello! > > Recently heartbleed bug was found in openssl: http://heartbleed.com/ > > As far as I know, OTP SSL and crypto apps use openssl, but some of SSL > handshake logic is rewritten in Erlang. > All of the SSL/TLS handshake logic is written in Erlang. Only OpenSSLs crypto library is used directly via the crypto application or indirectly via the public_key application. The crypto library is used to perform encryption/decryption/verification - operations (number crunching). So this OpenSSL bug will not effect Erlangs SSL/TLS-application. But if an OpenSSL client/server communicates with a Erlang client/server you can of course still have a problem. > Grepping lib/ssl and lib/crypto sources for 'heartbeat' didn't give any > results. > I have not found any tool to check a server for the vulnerability either. > > So, should anyone using SSL in OTP immediately upgrade openssl to fix this > bug? > > > Well not for the sake of Erlang, but this is probably a good idea anyway. Regards Ingela Erlang/OTP team - Ericsson AB > -- > Danil Zagoskin | z@REDACTED > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Tue Apr 8 09:54:43 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 8 Apr 2014 09:54:43 +0200 Subject: [erlang-questions] Does Erlang/OTP SSL app have heartbleed vulnerability? In-Reply-To: References: Message-ID: Hi! 2014-04-08 6:58 GMT+02:00 Alex Wilson : > On 8 Apr 2014, at 2:37 pm, Danil Zagoskin wrote: > > As far as I know, OTP SSL and crypto apps use openssl, but some of SSL > handshake logic is rewritten in Erlang. > > From my reading, it's more like all of the handshake logic is in Erlang. Yes it is! > It really looks like it only uses OpenSSL for the crypto features like > ciphers. The code to encode/decode TLS extensions in the Hello messages > doesn't appear to support RFC6520 (the "heartbeat" extension) -- it's > extension type #15, which is not in any of the logic there (it will just > drop it or else never send it, as far as I can tell). > > So from what I can see, it won't negotiate heartbeat support at the start, > and will just ignore any messages about it (since it doesn't understand > them). It would be nice to have a quick test that can be run for this > vulnerability though... > > You are correct the heartbeat extension is not currently supported, but will likely be implemented in the future. As far as I understood the OpenSSL bug is du to a memory boundary problem, which really is not a problem you have when you use Erlang to write your code :) Regards Ingela Erlang/OTP team - Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From txrev319@REDACTED Tue Apr 8 11:06:10 2014 From: txrev319@REDACTED (t x) Date: Tue, 8 Apr 2014 02:06:10 -0700 Subject: [erlang-questions] mnesia vs raw file Message-ID: I have the following problem: On my client side, I have an editor where I want to record _individual keystrokes_ (so I can replay how the file was composed.) Thus, my "document" is a list of {timestamp, cursor-location, key-pressed} Now, when I'm recording this on the erlang side, I want the following conditions: * writing a new term (i.e. recording a keystroke) should be amortized O(1) * reading the entire document should be O(N), where N = number of entries, and it should involve minimum number of seeks (I would prefer all the terms be continuous blocks) My two options: * opt1: mnesia * opt2: raw file I'm almost certainly convinced that opt2 = correct option. However, I want the opinions of those more qualified than me to see if I have missed anything / if any part of my thinking is not clear. Thanks! From jesper.louis.andersen@REDACTED Tue Apr 8 12:47:20 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Tue, 8 Apr 2014 12:47:20 +0200 Subject: [erlang-questions] mnesia vs raw file In-Reply-To: References: Message-ID: On Tue, Apr 8, 2014 at 11:06 AM, t x wrote: > My two options: > > * opt1: mnesia > * opt2: raw file > erl -man disk_log ? Also look up "Operational Transforms". -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidnwelton@REDACTED Tue Apr 8 17:52:32 2014 From: davidnwelton@REDACTED (David Welton) Date: Tue, 8 Apr 2014 17:52:32 +0200 Subject: [erlang-questions] Any reason not to have a string:replace? Message-ID: It would be convenient to have something like binary:replace, but for strings. I'd be happy to try to put together a pull request that does this, although I'd likely need some help with the finer points of what options to add. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From sean@REDACTED Tue Apr 8 18:10:10 2014 From: sean@REDACTED (Sean Cribbs) Date: Tue, 8 Apr 2014 11:10:10 -0500 Subject: [erlang-questions] Any reason not to have a string:replace? In-Reply-To: References: Message-ID: Why not use re:replace/3,4? http://www.erlang.org/doc/man/re.html#replace-4 On Tue, Apr 8, 2014 at 10:52 AM, David Welton wrote: > It would be convenient to have something like binary:replace, but for > strings. > > I'd be happy to try to put together a pull request that does this, > although I'd likely need some help with the finer points of what > options to add. > > -- > David N. Welton > > http://www.welton.it/davidw/ > > http://www.dedasys.com/ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Sean Cribbs Software Engineer Basho Technologies, Inc. http://basho.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidnwelton@REDACTED Tue Apr 8 18:29:30 2014 From: davidnwelton@REDACTED (David Welton) Date: Tue, 8 Apr 2014 18:29:30 +0200 Subject: [erlang-questions] Any reason not to have a string:replace? In-Reply-To: References: Message-ID: Because it's convenient to have string:replace that does the simple thing one expects of it. > Why not use re:replace/3,4? > > http://www.erlang.org/doc/man/re.html#replace-4 > > > On Tue, Apr 8, 2014 at 10:52 AM, David Welton > wrote: >> >> It would be convenient to have something like binary:replace, but for >> strings. >> >> I'd be happy to try to put together a pull request that does this, >> although I'd likely need some help with the finer points of what >> options to add. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From kenji@REDACTED Tue Apr 8 18:48:27 2014 From: kenji@REDACTED (Kenji Rikitake) Date: Wed, 9 Apr 2014 01:48:27 +0900 Subject: [erlang-questions] Does Erlang/OTP SSL app have heartbleed vulnerability? In-Reply-To: References: Message-ID: <20140408164827.GA75864@k2r.org> ++> Ingela Andin [2014-04-08 09:38:03 +0200]: > 2014-04-08 6:37 GMT+02:00 Danil Zagoskin : > > So, should anyone using SSL in OTP immediately upgrade openssl to fix this > > bug? > Well not for the sake of Erlang, but this is probably a good idea anyway. On Erlang R16B03-1 and coming 17.0, OpenSSL libraries are dynamically linked. Check the version with crypto:info_lib(). FYI Kenji Rikitake From mononcqc@REDACTED Tue Apr 8 22:40:29 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Tue, 8 Apr 2014 16:40:29 -0400 Subject: [erlang-questions] Difference in 'close' for gen_tcp recv vs. active Message-ID: <20140408204028.GA18870@ferdair.local> Hi there, Happy fun case we're hitting on nodes using Erlang right now. We have an HTTP proxy that does direct data streaming from a server to a client. This is done through a series of recv from the server, and of sends to the client. The TCP sockets involved are all in passive mode. The problem with this approach is that because this is a purely unidirectional stream until the server says so or the client quits, we'd like to detect both of these events. The server quitting or being done is easy enough, but the client quitting cannot be detected, apparently. It turns out that gen_tcp:send/2 always returns 'ok' even if the connection has been closed by the peer before. Erlang/OTP just won't acknowledge the fact unless someone tries to read from the socket, either through gen_tcp:recv or by using inet:setopts(Port, [{active, once}]), at which point {error, closed}?starts being returned by gen_tcp:send/2. This happens, even if `{exit_on_close, true}` is specified as an option. The question I have here is why is this behavior different for send than recv. It seems that `gen_tcp:send` will happily wait for hours pretending to send data (no matter the timeout values used are), even once the connection has been closed by the other peer. Is there any way for me to detect that a connection has been closed without possibly having to poll `recv` on each packet I try to send (and then may need to buffer all that data, which I'd prefer to avoid) or changing the entire app's workflow to be active? In case, here are the socket options we use: [{active,false}, {broadcast,false}, {buffer,1460}, {delay_send,false}, {dontroute,false}, {exit_on_close,true}, {header,0}, {high_watermark,8192}, {keepalive,false}, {linger,{false,0}}, {low_watermark,4096}, {mode,binary}, {nodelay,true}, {packet,0}, {packet_size,0}, {priority,0}, {recbuf,87380}, {reuseaddr,true}, {send_timeout,infinity}, {sndbuf,65536}] Regards, Fred. From ryankbrown@REDACTED Tue Apr 8 23:14:48 2014 From: ryankbrown@REDACTED (Ryan Brown) Date: Tue, 8 Apr 2014 15:14:48 -0600 Subject: [erlang-questions] MNesia replication in ec2 Message-ID: We are in the process of laying the groundwork for deploying our application to ec2. We currently depend upon mnesia replication for a small amount of shared metadata in our datacenter. I've read a number of posts/articles that have given me pause when thinking about how mnesia will work across AZs, regions in ec2. Primarily regarding network partitioning. We are currently considering removing our use of mnesia and pushing the small amount of data we replicate to shared store (possibly Riak). Does anybody out there have experience with this or guidance? -- -rb -------------- next part -------------- An HTML attachment was scrubbed... URL: From nem@REDACTED Tue Apr 8 23:20:39 2014 From: nem@REDACTED (Geoff Cant) Date: Tue, 8 Apr 2014 14:20:39 -0700 Subject: [erlang-questions] MNesia replication in ec2 In-Reply-To: References: Message-ID: On EC2 you will inevitably experience network conditions that will cause mnesia to decide that it is partitioned. There is no way to perform an online recovery from a partition event[1] without stopping and restarting the mnesia application. Unless you design your app to go into a degraded operation mode where all mnesia operations are either avoided or errors caught, then you'll experience a lot of trouble with it. Additionally, mnesia recovers by copying the entire table from another node - this is fine(ish) for small datasets, but if your dataset grows over time, you'll eventually find yourself unable to bring new/recovering nodes online quickly which blows up your Mean Time To Repair. I think multi-data-center Riak sounds like a better fit for multi-region ec2 work honestly, but I have not personally used Riak in that scenario so I defer to others. -Geoff [1] Pretty sure that's still true? On 2014-04-08, at 14:14 , Ryan Brown wrote: > We are in the process of laying the groundwork for deploying our application to ec2. We currently depend upon mnesia replication for a small amount of shared metadata in our datacenter. I've read a number of posts/articles that have given me pause when thinking about how mnesia will work across AZs, regions in ec2. Primarily regarding network partitioning. We are currently considering removing our use of mnesia and pushing the small amount of data we replicate to shared store (possibly Riak). > > Does anybody out there have experience with this or guidance? > > -- > -rb From garret.smith@REDACTED Wed Apr 9 01:25:23 2014 From: garret.smith@REDACTED (Garret Smith) Date: Tue, 8 Apr 2014 16:25:23 -0700 Subject: [erlang-questions] Difference in 'close' for gen_tcp recv vs. active In-Reply-To: <20140408204028.GA18870@ferdair.local> References: <20140408204028.GA18870@ferdair.local> Message-ID: Basically, this has everything to do with TCP sockets (and the OS implementation) and very little to do with Erlang. I do get {error, closed} from gen_tcp:send when the client disconnects. I'm running R16B03-1 on FreeBSD 10. Here are some decent descriptions of the problem: http://www.linuxquestions.org/questions/programming-9/how-could-server-detect-closed-client-socket-using-tcp-and-c-824615/ The second answer in the page above has some good links too, pulled out for easy reference: http://stackoverflow.com/questions/722240/instantly-detect-client-disconnection-from-server-socket http://www.softlab.ntua.gr/facilities/documentation/unix/unix-socket-faq/unix-socket-faq-2.html#ss2.8 -Garret On Tue, Apr 8, 2014 at 1:40 PM, Fred Hebert wrote: > Hi there, > > Happy fun case we're hitting on nodes using Erlang right now. We have an > HTTP proxy that does direct data streaming from a server to a client. > This is done through a series of recv from the server, and of sends to > the client. The TCP sockets involved are all in passive mode. > > The problem with this approach is that because this is a purely > unidirectional stream until the server says so or the client quits, we'd > like to detect both of these events. > > The server quitting or being done is easy enough, but the client > quitting cannot be detected, apparently. > > It turns out that gen_tcp:send/2 always returns 'ok' even if the > connection has been closed by the peer before. Erlang/OTP just won't > acknowledge the fact unless someone tries to read from the socket, > either through gen_tcp:recv or by using inet:setopts(Port, [{active, > once}]), at which point {error, closed} starts being returned by > gen_tcp:send/2. This happens, even if `{exit_on_close, true}` is > specified as an option. > > The question I have here is why is this behavior different for send than > recv. It seems that `gen_tcp:send` will happily wait for hours > pretending to send data (no matter the timeout values used are), even > once the connection has been closed by the other peer. > > Is there any way for me to detect that a connection has been closed > without possibly having to poll `recv` on each packet I try to send (and > then may need to buffer all that data, which I'd prefer to avoid) or > changing the entire app's workflow to be active? > > In case, here are the socket options we use: > > [{active,false}, > {broadcast,false}, > {buffer,1460}, > {delay_send,false}, > {dontroute,false}, > {exit_on_close,true}, > {header,0}, > {high_watermark,8192}, > {keepalive,false}, > {linger,{false,0}}, > {low_watermark,4096}, > {mode,binary}, > {nodelay,true}, > {packet,0}, > {packet_size,0}, > {priority,0}, > {recbuf,87380}, > {reuseaddr,true}, > {send_timeout,infinity}, > {sndbuf,65536}] > > Regards, > Fred. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Wed Apr 9 02:49:12 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Tue, 8 Apr 2014 20:49:12 -0400 Subject: [erlang-questions] Difference in 'close' for gen_tcp recv vs. active In-Reply-To: References: <20140408204028.GA18870@ferdair.local> Message-ID: <20140409004911.GA22866@ferdmbp.local> The difference here is that we have a peer that actively closes the connection and the packets are readable and detected as far as tcpdumps go. Things like FINs or RSTs. They're making it to our host, they're just entirely ignored unless we're willing to read undefined amounts of data from the buffer for the stack to apparently get access to them. 99.99% of the time that's gonna be 0 bytes because of HTTP clients' rare tendency to pipeline requests. I'm just extremely annoyed having to figure out a way to add in a buffer to carry possibly unlimited amounts of data to read from a socket so it can figure out if a FIN or RST was sent recently, but I guess that's the way we'll have to do it. Oh well. On 04/08, Garret Smith wrote: > Basically, this has everything to do with TCP sockets (and the OS > implementation) and very little to do with Erlang. I do get {error, > closed} from gen_tcp:send when the client disconnects. I'm running > R16B03-1 on FreeBSD 10. > > Here are some decent descriptions of the problem: > > http://www.linuxquestions.org/questions/programming-9/how-could-server-detect-closed-client-socket-using-tcp-and-c-824615/ > > The second answer in the page above has some good links too, pulled out for > easy reference: > > http://stackoverflow.com/questions/722240/instantly-detect-client-disconnection-from-server-socket > http://www.softlab.ntua.gr/facilities/documentation/unix/unix-socket-faq/unix-socket-faq-2.html#ss2.8 > > -Garret > > > On Tue, Apr 8, 2014 at 1:40 PM, Fred Hebert wrote: > > > Hi there, > > > > Happy fun case we're hitting on nodes using Erlang right now. We have an > > HTTP proxy that does direct data streaming from a server to a client. > > This is done through a series of recv from the server, and of sends to > > the client. The TCP sockets involved are all in passive mode. > > > > The problem with this approach is that because this is a purely > > unidirectional stream until the server says so or the client quits, we'd > > like to detect both of these events. > > > > The server quitting or being done is easy enough, but the client > > quitting cannot be detected, apparently. > > > > It turns out that gen_tcp:send/2 always returns 'ok' even if the > > connection has been closed by the peer before. Erlang/OTP just won't > > acknowledge the fact unless someone tries to read from the socket, > > either through gen_tcp:recv or by using inet:setopts(Port, [{active, > > once}]), at which point {error, closed} starts being returned by > > gen_tcp:send/2. This happens, even if `{exit_on_close, true}` is > > specified as an option. > > > > The question I have here is why is this behavior different for send than > > recv. It seems that `gen_tcp:send` will happily wait for hours > > pretending to send data (no matter the timeout values used are), even > > once the connection has been closed by the other peer. > > > > Is there any way for me to detect that a connection has been closed > > without possibly having to poll `recv` on each packet I try to send (and > > then may need to buffer all that data, which I'd prefer to avoid) or > > changing the entire app's workflow to be active? > > > > In case, here are the socket options we use: > > > > [{active,false}, > > {broadcast,false}, > > {buffer,1460}, > > {delay_send,false}, > > {dontroute,false}, > > {exit_on_close,true}, > > {header,0}, > > {high_watermark,8192}, > > {keepalive,false}, > > {linger,{false,0}}, > > {low_watermark,4096}, > > {mode,binary}, > > {nodelay,true}, > > {packet,0}, > > {packet_size,0}, > > {priority,0}, > > {recbuf,87380}, > > {reuseaddr,true}, > > {send_timeout,infinity}, > > {sndbuf,65536}] > > > > Regards, > > Fred. > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > From moxford@REDACTED Wed Apr 9 03:34:26 2014 From: moxford@REDACTED (Mike Oxford) Date: Tue, 8 Apr 2014 18:34:26 -0700 Subject: [erlang-questions] Difference in 'close' for gen_tcp recv vs. active In-Reply-To: <20140409004911.GA22866@ferdmbp.local> References: <20140408204028.GA18870@ferdair.local> <20140409004911.GA22866@ferdmbp.local> Message-ID: http://en.wikipedia.org/wiki/Transmission_Control_Protocol#Out-of-band_data? On Tue, Apr 8, 2014 at 5:49 PM, Fred Hebert wrote: > The difference here is that we have a peer that actively closes the > connection and the packets are readable and detected as far as tcpdumps > go. Things like FINs or RSTs. They're making it to our host, they're > just entirely ignored unless we're willing to read undefined amounts of > data from the buffer for the stack to apparently get access to them. > 99.99% of the time that's gonna be 0 bytes because of HTTP clients' rare > tendency to pipeline requests. > > I'm just extremely annoyed having to figure out a way to add in a buffer > to carry possibly unlimited amounts of data to read from a socket so it > can figure out if a FIN or RST was sent recently, but I guess that's the > way we'll have to do it. > > Oh well. > > On 04/08, Garret Smith wrote: > > Basically, this has everything to do with TCP sockets (and the OS > > implementation) and very little to do with Erlang. I do get {error, > > closed} from gen_tcp:send when the client disconnects. I'm running > > R16B03-1 on FreeBSD 10. > > > > Here are some decent descriptions of the problem: > > > > > http://www.linuxquestions.org/questions/programming-9/how-could-server-detect-closed-client-socket-using-tcp-and-c-824615/ > > > > The second answer in the page above has some good links too, pulled out > for > > easy reference: > > > > > http://stackoverflow.com/questions/722240/instantly-detect-client-disconnection-from-server-socket > > > http://www.softlab.ntua.gr/facilities/documentation/unix/unix-socket-faq/unix-socket-faq-2.html#ss2.8 > > > > -Garret > > > > > > On Tue, Apr 8, 2014 at 1:40 PM, Fred Hebert wrote: > > > > > Hi there, > > > > > > Happy fun case we're hitting on nodes using Erlang right now. We have > an > > > HTTP proxy that does direct data streaming from a server to a client. > > > This is done through a series of recv from the server, and of sends to > > > the client. The TCP sockets involved are all in passive mode. > > > > > > The problem with this approach is that because this is a purely > > > unidirectional stream until the server says so or the client quits, > we'd > > > like to detect both of these events. > > > > > > The server quitting or being done is easy enough, but the client > > > quitting cannot be detected, apparently. > > > > > > It turns out that gen_tcp:send/2 always returns 'ok' even if the > > > connection has been closed by the peer before. Erlang/OTP just won't > > > acknowledge the fact unless someone tries to read from the socket, > > > either through gen_tcp:recv or by using inet:setopts(Port, [{active, > > > once}]), at which point {error, closed} starts being returned by > > > gen_tcp:send/2. This happens, even if `{exit_on_close, true}` is > > > specified as an option. > > > > > > The question I have here is why is this behavior different for send > than > > > recv. It seems that `gen_tcp:send` will happily wait for hours > > > pretending to send data (no matter the timeout values used are), even > > > once the connection has been closed by the other peer. > > > > > > Is there any way for me to detect that a connection has been closed > > > without possibly having to poll `recv` on each packet I try to send > (and > > > then may need to buffer all that data, which I'd prefer to avoid) or > > > changing the entire app's workflow to be active? > > > > > > In case, here are the socket options we use: > > > > > > [{active,false}, > > > {broadcast,false}, > > > {buffer,1460}, > > > {delay_send,false}, > > > {dontroute,false}, > > > {exit_on_close,true}, > > > {header,0}, > > > {high_watermark,8192}, > > > {keepalive,false}, > > > {linger,{false,0}}, > > > {low_watermark,4096}, > > > {mode,binary}, > > > {nodelay,true}, > > > {packet,0}, > > > {packet_size,0}, > > > {priority,0}, > > > {recbuf,87380}, > > > {reuseaddr,true}, > > > {send_timeout,infinity}, > > > {sndbuf,65536}] > > > > > > Regards, > > > Fred. > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From garret.smith@REDACTED Wed Apr 9 07:37:33 2014 From: garret.smith@REDACTED (Garret Smith) Date: Tue, 8 Apr 2014 22:37:33 -0700 Subject: [erlang-questions] Difference in 'close' for gen_tcp recv vs. active In-Reply-To: <20140409004911.GA22866@ferdmbp.local> References: <20140408204028.GA18870@ferdair.local> <20140409004911.GA22866@ferdmbp.local> Message-ID: What OS are you running, and has the TCP stack been tuned/optimized with sysctl's? Does the problem happen all the time, or only sometimes? In my quick test before posting, gen_tcp:send() returned {error, closed} soon after my client disconnected without any recv's on the socket. I was sending single bytes at a time with a 1-second delay, so I'm sure no buffers were overflowing to trigger the disconnect. It acted pretty much the same in about 5 attempts, so I'm really curious why we see different behavior. Tangential, but possibly interesting, I had to comment out 2 of the socket options in your list. I got a badarg from inet_tcp:listen with the 'broadcast' and 'dontroute' options. -G On Tue, Apr 8, 2014 at 5:49 PM, Fred Hebert wrote: > The difference here is that we have a peer that actively closes the > connection and the packets are readable and detected as far as tcpdumps > go. Things like FINs or RSTs. They're making it to our host, they're > just entirely ignored unless we're willing to read undefined amounts of > data from the buffer for the stack to apparently get access to them. > 99.99% of the time that's gonna be 0 bytes because of HTTP clients' rare > tendency to pipeline requests. > > I'm just extremely annoyed having to figure out a way to add in a buffer > to carry possibly unlimited amounts of data to read from a socket so it > can figure out if a FIN or RST was sent recently, but I guess that's the > way we'll have to do it. > > Oh well. > > On 04/08, Garret Smith wrote: > > Basically, this has everything to do with TCP sockets (and the OS > > implementation) and very little to do with Erlang. I do get {error, > > closed} from gen_tcp:send when the client disconnects. I'm running > > R16B03-1 on FreeBSD 10. > > > > Here are some decent descriptions of the problem: > > > > > http://www.linuxquestions.org/questions/programming-9/how-could-server-detect-closed-client-socket-using-tcp-and-c-824615/ > > > > The second answer in the page above has some good links too, pulled out > for > > easy reference: > > > > > http://stackoverflow.com/questions/722240/instantly-detect-client-disconnection-from-server-socket > > > http://www.softlab.ntua.gr/facilities/documentation/unix/unix-socket-faq/unix-socket-faq-2.html#ss2.8 > > > > -Garret > > > > > > On Tue, Apr 8, 2014 at 1:40 PM, Fred Hebert wrote: > > > > > Hi there, > > > > > > Happy fun case we're hitting on nodes using Erlang right now. We have > an > > > HTTP proxy that does direct data streaming from a server to a client. > > > This is done through a series of recv from the server, and of sends to > > > the client. The TCP sockets involved are all in passive mode. > > > > > > The problem with this approach is that because this is a purely > > > unidirectional stream until the server says so or the client quits, > we'd > > > like to detect both of these events. > > > > > > The server quitting or being done is easy enough, but the client > > > quitting cannot be detected, apparently. > > > > > > It turns out that gen_tcp:send/2 always returns 'ok' even if the > > > connection has been closed by the peer before. Erlang/OTP just won't > > > acknowledge the fact unless someone tries to read from the socket, > > > either through gen_tcp:recv or by using inet:setopts(Port, [{active, > > > once}]), at which point {error, closed} starts being returned by > > > gen_tcp:send/2. This happens, even if `{exit_on_close, true}` is > > > specified as an option. > > > > > > The question I have here is why is this behavior different for send > than > > > recv. It seems that `gen_tcp:send` will happily wait for hours > > > pretending to send data (no matter the timeout values used are), even > > > once the connection has been closed by the other peer. > > > > > > Is there any way for me to detect that a connection has been closed > > > without possibly having to poll `recv` on each packet I try to send > (and > > > then may need to buffer all that data, which I'd prefer to avoid) or > > > changing the entire app's workflow to be active? > > > > > > In case, here are the socket options we use: > > > > > > [{active,false}, > > > {broadcast,false}, > > > {buffer,1460}, > > > {delay_send,false}, > > > {dontroute,false}, > > > {exit_on_close,true}, > > > {header,0}, > > > {high_watermark,8192}, > > > {keepalive,false}, > > > {linger,{false,0}}, > > > {low_watermark,4096}, > > > {mode,binary}, > > > {nodelay,true}, > > > {packet,0}, > > > {packet_size,0}, > > > {priority,0}, > > > {recbuf,87380}, > > > {reuseaddr,true}, > > > {send_timeout,infinity}, > > > {sndbuf,65536}] > > > > > > Regards, > > > Fred. > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From groovenino@REDACTED Wed Apr 9 09:58:22 2014 From: groovenino@REDACTED (Oscar Felipe) Date: Wed, 9 Apr 2014 09:58:22 +0200 Subject: [erlang-questions] xref: adding directories dinamically Message-ID: Hi dear list, I can successfully import the dependencies I need in my node importing them manually with -pa as following: erl -pa ebin deps/*/ebin /path/to/release/*/ebin Then I start xref and add a release without errors. Whereas when I start a node and try to add the path in this way : code:add_patha("ebin"), Libs = filelib:wildcard("/path/to/release/*/ebin"), Deps = filelib:wildcard("deps/*/ebin"), code:add_pathsa(Libs ++ Deps) This does not work, despite that file:get_cwd() gives the same result as when I load the libraries manually including the paths with -pa flag. After that I also tried to add the directories to xref without success: xref:start(xr), [xref:add_directory(xr,D) || D <- Libs ++ Deps]. What do I am missing to provide all the paths that xref needs to start? I really appreciate any help you can provide, [Oscar] -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex@REDACTED Wed Apr 9 10:43:46 2014 From: alex@REDACTED (Alex Wilson) Date: Wed, 9 Apr 2014 18:43:46 +1000 Subject: [erlang-questions] Does Erlang/OTP SSL app have heartbleed vulnerability? In-Reply-To: References: Message-ID: <0626D748-9C7F-4296-B4A3-F0F9DF1C8EE7@cooperi.net> On 8 Apr 2014, at 5:54 pm, Ingela Andin wrote: > You are correct the heartbeat extension is not currently supported, but will likely be implemented in the future. As far as I understood the OpenSSL bug is du to a memory boundary problem, > which really is not a problem you have when you use Erlang to write your code :) After reading this, I went away and wrote a basic implementation of the Heartbeat extension -- just to learn to understand the extension thoroughly and be able to write a checker in Erlang that looks for the vulnerability. I've attached the patch in case it might be useful to someone out there, and a simple escript to use the (internal API) heartbeat function to check for Heartbleed on a host. Patch is against R16B03-1, but should apply cleanly on R17 and probably other R16 releases. (the whitespace is probably messed up though, might need -l to patch) Now you can use Erlang to check your other servers for it instead of horrible Python code ;) (it's more robust than many of the Python/go checkers too, since it borrows the full SSL implementation that's already there instead of hard-coded Hello packets and other things) -------------- next part -------------- A non-text attachment was scrubbed... Name: ssl-heartbeat.patch Type: application/octet-stream Size: 16885 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: heartbreaker.erl Type: application/octet-stream Size: 4443 bytes Desc: not available URL: From dialtone@REDACTED Wed Apr 9 12:02:07 2014 From: dialtone@REDACTED (Valentino Volonghi) Date: Wed, 9 Apr 2014 11:02:07 +0100 Subject: [erlang-questions] Erlang R16B03-1 and Linux 3.10.34 Message-ID: Hey guys, I'm trying to compile Erlang R16 on Amazon Linux 2014.03 released a week or so ago. Unfortunately it seems like it's really hard to compile erlang in it, in fact it fails when it uses hrtime_t. Here is the make result with its failure, the branching is breaking on is the ifdef of the Real HRTime and I suppose it assumes it's solaris. Is there any way I can disable the check or usage of hrtimers in the configure? Thanks! if utils/gen_git_version x86_64-unknown-linux-gnu/gen_git_version.mk; then touch beam/erl_bif_info.c; fi gcc -Werror=return-type -O3 -Ofast -flto -pipe -I/tmp/install/otp_src_R16B03-1/erts/x86_64-unknown-linux-gnu -fno-tree-copyrename -D_GNU_SOURCE -DERTS_SMP -DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -DERTS_ENABLE_LOCK_COUNT -Ix86_64-unknown-linux-gnu/opt/smp -Ibeam -Isys/unix -Isys/common -Ix86_64-unknown-linux-gnu -Izlib -Ipcre -Ihipe -I../include -I../include/x86_64-unknown-linux-gnu -I../include/internal -I../include/internal/x86_64-unknown-linux-gnu -c sys/unix/erl_main.c -o obj/x86_64-unknown-linux-gnu/opt/smp/erl_main.o In file included from beam/sys.h:42:0, from sys/unix/erl_main.c:22: sys/unix/erl_unix_sys.h:181:1: error: unknown type name ?hrtime_t? typedef hrtime_t SysHrTime; ^ make[3]: *** [obj/x86_64-unknown-linux-gnu/opt/smp/erl_main.o] Error 1 make[3]: Leaving directory `/tmp/install/otp_src_R16B03-1/erts/emulator' make[2]: *** [opt] Error 2 make[2]: Leaving directory `/tmp/install/otp_src_R16B03-1/erts/emulator' make[1]: *** [smp] Error 2 make[1]: Leaving directory `/tmp/install/otp_src_R16B03-1/erts' make: *** [emulator] Error 2 -- Valentino Volonghi From dialtone@REDACTED Wed Apr 9 12:32:36 2014 From: dialtone@REDACTED (Valentino Volonghi) Date: Wed, 9 Apr 2014 11:32:36 +0100 Subject: [erlang-questions] Erlang R16B03-1 and Linux 3.10.34 In-Reply-To: References: Message-ID: On Wed, Apr 9, 2014 at 11:02 AM, Valentino Volonghi wrote: > Here is the make result with its failure, the branching is breaking on > is the ifdef of the Real HRTime and I suppose it assumes it's solaris. > > Is there any way I can disable the check or usage of hrtimers in the configure? It seems to be related to this issue, and should be an autoconf bug with 2.59, should be fixed with 2.69: https://bugs.gentoo.org/show_bug.cgi?id=437558 and it might be related to the flags I'm using to compile erlang: export LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--strip-all" export CFLAGS="-O3 -Ofast -flto -pipe" Going to try and experiment a bit suppose -- Valentino Volonghi From davidnwelton@REDACTED Wed Apr 9 12:38:58 2014 From: davidnwelton@REDACTED (David Welton) Date: Wed, 9 Apr 2014 12:38:58 +0200 Subject: [erlang-questions] Reusing servers in a new supervision tree Message-ID: Hi, We have a supervision tree that seems to be working well and we are happy with. However, now we need to be able to put the system in "testing" mode, where, instead of a tree that has FSM A, and servers B, C, D, E and F, we only have a tree with B, D, and F. I don't think it's particularly important to be able to do this all that smoothly or cleanly: we can probably even restart the machine to put it in testing mode, or something like that - it's not a configuration where we have any kind of stringent uptime requirements! My idea is to actually have a separate application, say testing_mode that has a testing_mode_sup that directly starts B, D, and F. Can I do that across applications, though? Should I include the testing mode sup in the same application as the other stuff? We had some hopes of keeping it separate so that various additional testing mode pieces could be developed and distributed separately from the main bunch of code. Thank you for your thoughts, -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From donpedrothird@REDACTED Wed Apr 9 14:26:08 2014 From: donpedrothird@REDACTED (Evgeny M) Date: Wed, 9 Apr 2014 05:26:08 -0700 (PDT) Subject: [erlang-questions] Any reason not to have a string:replace? In-Reply-To: References: Message-ID: +1, would be nice to have it. string module does not support to_lower/to_upper for utf-8 strings as well ???????, 8 ?????? 2014 ?., 19:52:32 UTC+4 ???????????? David Welton ???????: > > It would be convenient to have something like binary:replace, but for > strings. > > I'd be happy to try to put together a pull request that does this, > although I'd likely need some help with the finer points of what > options to add. > > -- > David N. Welton > > http://www.welton.it/davidw/ > > http://www.dedasys.com/ > _______________________________________________ > erlang-questions mailing list > erlang-q...@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jacob01@REDACTED Wed Apr 9 14:56:20 2014 From: jacob01@REDACTED (Jacob) Date: Wed, 09 Apr 2014 14:56:20 +0200 Subject: [erlang-questions] Difference in 'close' for gen_tcp recv vs. active In-Reply-To: <20140409004911.GA22866@ferdmbp.local> References: <20140408204028.GA18870@ferdair.local> <20140409004911.GA22866@ferdmbp.local> Message-ID: <53454374.2060304@gmx.net> Hi, On 09.04.2014 02:49, Fred Hebert wrote: > The difference here is that we have a peer that actively closes the > connection Does the peer use close(s) or shutdown(s, SHUT_WR) to "close" the connection? > and the packets are readable and detected as far as tcpdumps > go. Things like FINs or RSTs. They're making it to our host, It makes a difference here, whether these are FINs or RSTs. Just receiving a FIN from the peer will not stop the OS from accepting for and sending data to the peer. > they're > just entirely ignored unless we're willing to read undefined amounts of > data from the buffer for the stack to apparently get access to them. If the peer uses shutdown() only you have no choice with standard sockets. You probably don't want to start using pcap. > 99.99% of the time that's gonna be 0 bytes because of HTTP clients' rare > tendency to pipeline requests. > > I'm just extremely annoyed having to figure out a way to add in a buffer > to carry possibly unlimited amounts of data to read from a socket so it > can figure out if a FIN or RST was sent recently, but I guess that's the > way we'll have to do it. > > Oh well. Regards Jacob From mononcqc@REDACTED Wed Apr 9 15:22:01 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 9 Apr 2014 09:22:01 -0400 Subject: [erlang-questions] Difference in 'close' for gen_tcp recv vs. active In-Reply-To: <53454374.2060304@gmx.net> References: <20140408204028.GA18870@ferdair.local> <20140409004911.GA22866@ferdmbp.local> <53454374.2060304@gmx.net> Message-ID: <20140409132200.GA19145@ferdair.local> On 04/09, Jacob wrote: > Hi, > > Does the peer use close(s) or shutdown(s, SHUT_WR) to "close" the > connection? > We don't control the peer. I'm not sure what the specific call is. > > It makes a difference here, whether these are FINs or RSTs. Just > receiving a FIN from the peer will not stop the OS from accepting for > and sending data to the peer. > it is indeed a FIN for the specific dump I have. It seems to be ACKed back (peer = AAAA, our host = BBBB): 19:10:55.748018 IP AAAA > BBBB: Flags [.], ack 385, win 62, options [nop,nop,TS val 229098891 ecr 89024950], length 0 19:10:56.070985 IP AAAA > BBBB: Flags [F.], seq 156, ack 385, win 62, options [nop,nop,TS val 229098972 ecr 89024950], length 0 19:10:56.113998 IP BBBB > AAAA: Flags [.], ack 157, win 12, options [nop,nop,TS val 89024987 ecr 229098972], length 0 19:10:56.747853 IP BBBB > AAAA: Flags [P.], seq 385:416, ack 157, win 12, options [nop,nop,TS val 89025050 ecr 229098972], length 31 19:10:56.748490 IP AAAA > BBBB: Flags [.], ack 416, win 62, options [nop,nop,TS val 229099141 ecr 89025050], length 0 It sounds like we're getting dumped into a partially closed session. I'm guessing the peer (AAAA) gets stuck into FIN-WAIT-2, waiting for a FIN coming from our end (BBBB), giving us a half-open connection. What confuses me is given we have the option {exit_on_close, true} being set explicitly, we expect Erlang to close that connection once that FIN comes in, and not to keep half-open the way it would if we had set {exit_on_close, false}, as set in the docs: {exit_on_close, Boolean} By default this option is set to true. The only reason to set it to false is if you want to continue sending data to the socket after a close has been detected, for instance if the peer has used gen_tcp:shutdown/2 to shutdown the write side. Given we have it set to true, we do expect to not be able to keep sending data after the fact. We still can, though. > > If the peer uses shutdown() only you have no choice with standard > sockets. You probably don't want to start using pcap. > Again, I'm not sure I have an easy way to know there. Thanks for your help, Fred. From essen@REDACTED Wed Apr 9 15:25:33 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Wed, 09 Apr 2014 15:25:33 +0200 Subject: [erlang-questions] NIF resource and typespecs Message-ID: <53454A4D.90503@ninenines.eu> Hello, NIF resources appear as a magic empty binary on the Erlang side. What typespec should I use for them though? Is there anything better than this? -opaque my_nif_resource() :: any(). Thanks. -- Lo?c Hoguin http://ninenines.eu From mononcqc@REDACTED Wed Apr 9 15:39:37 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 9 Apr 2014 09:39:37 -0400 Subject: [erlang-questions] Difference in 'close' for gen_tcp recv vs. active In-Reply-To: References: <20140408204028.GA18870@ferdair.local> <20140409004911.GA22866@ferdmbp.local> Message-ID: <20140409133936.GB19145@ferdair.local> Linux 2.6.32-359-ec2 x86_64 on one of the instances on which it can be triggered. The issue doesn't seem to be reproducible when everything takes place on localhost. I'm trying to play around with other instances in similar security groups to reproduce it using only Erlang stuff. I'll comb over the sysctl stuff for a culprit. Regards, Fred. On 04/08, Garret Smith wrote: > What OS are you running, and has the TCP stack been tuned/optimized with > sysctl's? > > Does the problem happen all the time, or only sometimes? > > In my quick test before posting, gen_tcp:send() returned {error, closed} > soon after my client disconnected without any recv's on the socket. I was > sending single bytes at a time with a 1-second delay, so I'm sure no > buffers were overflowing to trigger the disconnect. It acted pretty much > the same in about 5 attempts, so I'm really curious why we see different > behavior. > > Tangential, but possibly interesting, I had to comment out 2 of the socket > options in your list. I got a badarg from inet_tcp:listen with the > 'broadcast' and 'dontroute' options. > > -G > > > > On Tue, Apr 8, 2014 at 5:49 PM, Fred Hebert wrote: > > > The difference here is that we have a peer that actively closes the > > connection and the packets are readable and detected as far as tcpdumps > > go. Things like FINs or RSTs. They're making it to our host, they're > > just entirely ignored unless we're willing to read undefined amounts of > > data from the buffer for the stack to apparently get access to them. > > 99.99% of the time that's gonna be 0 bytes because of HTTP clients' rare > > tendency to pipeline requests. > > > > I'm just extremely annoyed having to figure out a way to add in a buffer > > to carry possibly unlimited amounts of data to read from a socket so it > > can figure out if a FIN or RST was sent recently, but I guess that's the > > way we'll have to do it. > > > > Oh well. > > > > On 04/08, Garret Smith wrote: > > > Basically, this has everything to do with TCP sockets (and the OS > > > implementation) and very little to do with Erlang. I do get {error, > > > closed} from gen_tcp:send when the client disconnects. I'm running > > > R16B03-1 on FreeBSD 10. > > > > > > Here are some decent descriptions of the problem: > > > > > > > > http://www.linuxquestions.org/questions/programming-9/how-could-server-detect-closed-client-socket-using-tcp-and-c-824615/ > > > > > > The second answer in the page above has some good links too, pulled out > > for > > > easy reference: > > > > > > > > http://stackoverflow.com/questions/722240/instantly-detect-client-disconnection-from-server-socket > > > > > http://www.softlab.ntua.gr/facilities/documentation/unix/unix-socket-faq/unix-socket-faq-2.html#ss2.8 > > > > > > -Garret > > > > > > > > > On Tue, Apr 8, 2014 at 1:40 PM, Fred Hebert wrote: > > > > > > > Hi there, > > > > > > > > Happy fun case we're hitting on nodes using Erlang right now. We have > > an > > > > HTTP proxy that does direct data streaming from a server to a client. > > > > This is done through a series of recv from the server, and of sends to > > > > the client. The TCP sockets involved are all in passive mode. > > > > > > > > The problem with this approach is that because this is a purely > > > > unidirectional stream until the server says so or the client quits, > > we'd > > > > like to detect both of these events. > > > > > > > > The server quitting or being done is easy enough, but the client > > > > quitting cannot be detected, apparently. > > > > > > > > It turns out that gen_tcp:send/2 always returns 'ok' even if the > > > > connection has been closed by the peer before. Erlang/OTP just won't > > > > acknowledge the fact unless someone tries to read from the socket, > > > > either through gen_tcp:recv or by using inet:setopts(Port, [{active, > > > > once}]), at which point {error, closed} starts being returned by > > > > gen_tcp:send/2. This happens, even if `{exit_on_close, true}` is > > > > specified as an option. > > > > > > > > The question I have here is why is this behavior different for send > > than > > > > recv. It seems that `gen_tcp:send` will happily wait for hours > > > > pretending to send data (no matter the timeout values used are), even > > > > once the connection has been closed by the other peer. > > > > > > > > Is there any way for me to detect that a connection has been closed > > > > without possibly having to poll `recv` on each packet I try to send > > (and > > > > then may need to buffer all that data, which I'd prefer to avoid) or > > > > changing the entire app's workflow to be active? > > > > > > > > In case, here are the socket options we use: > > > > > > > > [{active,false}, > > > > {broadcast,false}, > > > > {buffer,1460}, > > > > {delay_send,false}, > > > > {dontroute,false}, > > > > {exit_on_close,true}, > > > > {header,0}, > > > > {high_watermark,8192}, > > > > {keepalive,false}, > > > > {linger,{false,0}}, > > > > {low_watermark,4096}, > > > > {mode,binary}, > > > > {nodelay,true}, > > > > {packet,0}, > > > > {packet_size,0}, > > > > {priority,0}, > > > > {recbuf,87380}, > > > > {reuseaddr,true}, > > > > {send_timeout,infinity}, > > > > {sndbuf,65536}] > > > > > > > > Regards, > > > > Fred. > > > > _______________________________________________ > > > > erlang-questions mailing list > > > > erlang-questions@REDACTED > > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > From jacob01@REDACTED Wed Apr 9 17:24:07 2014 From: jacob01@REDACTED (Jacob) Date: Wed, 09 Apr 2014 17:24:07 +0200 Subject: [erlang-questions] Difference in 'close' for gen_tcp recv vs. active In-Reply-To: <20140409132200.GA19145@ferdair.local> References: <20140408204028.GA18870@ferdair.local> <20140409004911.GA22866@ferdmbp.local> <53454374.2060304@gmx.net> <20140409132200.GA19145@ferdair.local> Message-ID: <53456617.5090702@gmx.net> On 09.04.2014 15:22, Fred Hebert wrote: > On 04/09, Jacob wrote: >> >> It makes a difference here, whether these are FINs or RSTs. Just >> receiving a FIN from the peer will not stop the OS from accepting for >> and sending data to the peer. >> > > it is indeed a FIN for the specific dump I have. It seems to be ACKed > back (peer = AAAA, our host = BBBB): > > 19:10:55.748018 IP AAAA > BBBB: Flags [.], ack 385, win 62, options [nop,nop,TS val 229098891 ecr 89024950], length 0 > 19:10:56.070985 IP AAAA > BBBB: Flags [F.], seq 156, ack 385, win 62, options [nop,nop,TS val 229098972 ecr 89024950], length 0 > 19:10:56.113998 IP BBBB > AAAA: Flags [.], ack 157, win 12, options [nop,nop,TS val 89024987 ecr 229098972], length 0 > 19:10:56.747853 IP BBBB > AAAA: Flags [P.], seq 385:416, ack 157, win 12, options [nop,nop,TS val 89025050 ecr 229098972], length 31 > 19:10:56.748490 IP AAAA > BBBB: Flags [.], ack 416, win 62, options [nop,nop,TS val 229099141 ecr 89025050], length 0 > > It sounds like we're getting dumped into a partially closed session. I'm > guessing the peer (AAAA) gets stuck into FIN-WAIT-2, waiting for a FIN > coming from our end (BBBB), giving us a half-open connection. Yes, most probably. > > What confuses me is given we have the option {exit_on_close, true} being > set explicitly, we expect Erlang to close that connection once that FIN > comes in, and not to keep half-open the way it would if we had set > {exit_on_close, false}, as set in the docs: How should Erlang know this without calling recv()/read()/... until that returns 0 or some related error? gen_tcp shouldn't do that in passive mode, otherwise the were no TCP flow control. > > {exit_on_close, Boolean} > By default this option is set to true. > The only reason to set it to false is if you want to > continue sending data to the socket after a close has been > detected, for instance if the peer has used > gen_tcp:shutdown/2 to shutdown the write side. > > Given we have it set to true, we do expect to not be able to keep > sending data after the fact. We still can, though. Jacob From kenneth.lundin@REDACTED Wed Apr 9 17:24:54 2014 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Wed, 9 Apr 2014 17:24:54 +0200 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released Message-ID: Erlang/OTP 17.0 has been released. Erlang/OTP 17.0 is a new major release with new features, characteristics improvements, as well as some minor incompatibilities. Some highlights of the release are: - Erlang/OTP has been ported to the realtime operating system OSE. - Maps, a new dictionary data type (experimental) - A more natural mapping from ASN.1 OCTET STRING and BIT STRING to Erlang types, and other ASN.1 improvements and optimizations - The {active, N} socket option for TCP, UDP, and SCTP - A new (optional) scheduler utilization balancing mechanism - Migration of memory carriers has been enabled by default on all ERTS internal memory allocators - Increased garbage collection tenure rate - Experimental "dirty schedulers" functionality - Funs can now be given names - Miscellaneous unicode support enhancements - A new version scheme for OTP its applications has been introduced You can find the README file with more detailed info at http://www.erlang.org/download/otp_src_17.0.readme You can download the full source distribution from http://www.erlang.org/download/otp_src_17.0.tar.gz Note: To unpack the TAR archive you need a GNU TAR compatible program. For installation instructions please read the README that is part of the distribution. You can also find this release at the official Erlang/OTP Git-repository at Github here: https://github.com/erlang/otp tagged "OTP-17.0" The Windows binary distribution can be downloaded from http://www.erlang.org/download/otp_win32_17.0.exe http://www.erlang.org/download/otp_win64_17.0.exe You can also download the complete HTML documentation or the Unix manual files http://www.erlang.org/download/otp_doc_html_17.0.tar.gz http://www.erlang.org/download/otp_doc_man_17.0.tar.gz We also want to thank those that sent us patches, suggestions and bug reports. The Erlang/OTP Team at Ericsson -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Wed Apr 9 17:29:43 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Wed, 09 Apr 2014 17:29:43 +0200 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: References: Message-ID: <53456767.4030502@ninenines.eu> Congratulations! Best Erlang release yet! On 04/09/2014 05:24 PM, Kenneth Lundin wrote: > Erlang/OTP 17.0 has been released. > > Erlang/OTP 17.0 is a new major release with new features, > characteristics improvements, as well as some minor incompatibilities. > > Some highlights of the release are: > > * Erlang/OTP has been ported to the realtime operating system OSE. > * Maps, a new dictionary data type (experimental) > * A more natural mapping from ASN.1 OCTET STRING and BIT STRING to > Erlang types, and other ASN.1 improvements and optimizations > * The {active, N} socket option for TCP, UDP, and SCTP > * A new (optional) scheduler utilization balancing mechanism > * Migration of memory carriers has been enabled by default on all ERTS > internal memory allocators > * Increased garbage collection tenure rate > * Experimental "dirty schedulers" functionality > * Funs can now be given names > * Miscellaneous unicode support enhancements > * A new version scheme for OTP its applications has been introduced > > You can find the README file with more detailed info at > http://www.erlang.org/download/otp_src_17.0.readme > > > You can download the full source distribution from > http://www.erlang.org/download/otp_src_17.0.tar.gz > > > Note: To unpack the TAR archive you need a GNU TAR compatible program. > For installation instructions please read the README that is part of the > distribution. > > You can also find this release at the official Erlang/OTP Git-repository > at Github here: https://github.com/erlang/otp tagged "OTP-17.0" > > The Windows binary distribution can be downloaded from > > http://www.erlang.org/download/otp_win32_17.0.exe > > > http://www.erlang.org/download/otp_win64_17.0.exe > > > You can also download the complete HTML documentation or the Unix manual > files > > http://www.erlang.org/download/otp_doc_html_17.0.tar.gz > > http://www.erlang.org/download/otp_doc_man_17.0.tar.gz > > > We also want to thank those that sent us patches, suggestions and bug > reports. > > The Erlang/OTP Team at Ericsson > > > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From karol.urbanski@REDACTED Wed Apr 9 17:52:40 2014 From: karol.urbanski@REDACTED (Karol Urbanski) Date: Wed, 9 Apr 2014 17:52:40 +0200 Subject: [erlang-questions] 17.0 binary packages for CentOS, Debian, Mac, Ubuntu and Windows Message-ID: <20140409155239.GA9105@dex.erlang-solutions.com> Hello, You can find our binary packages for the newest Erlang release (17.0) at http://www.erlang-solutions.com/downloads/download-erlang-otp The systems we provide the packages for are CentOS 6, Mac OS X Snow Leopard and newer, Debian 7.0.0, Ubuntu 13.10 + 13.04 + 12.04 and Windows. More to come soon! Best regards, Karol Urbanski From elbrujohalcon@REDACTED Wed Apr 9 18:13:33 2014 From: elbrujohalcon@REDACTED (Brujo Benavides @ Inaka) Date: Wed, 9 Apr 2014 13:13:33 -0300 Subject: [erlang-questions] [ANN] Erlang BA Meetup Message-ID: <83A272DD-E218-493A-9143-2672C358AFA5@inaka.net> All, We have the HUGE honor of a visit from one of the biggest names in the Erlang community, Francesco Cesarini, founder of Erlang Solutions Ltd in London. He is going to speak at our Erlounge in our Inaka office Villa Crespo on Monday, 28th of April. Please come to our office in Villa Crespo Monday night to hear from Francesco and have some beers and pizza! Please register here: http://bit.ly/erlangba or send an email to elbrujohalcon@REDACTED Brujo Benavides elbrujohalcon@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Wed Apr 9 18:17:09 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 9 Apr 2014 20:17:09 +0400 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: <53456767.4030502@ninenines.eu> References: <53456767.4030502@ninenines.eu> Message-ID: Thanks for your excelent work! -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomasl_erlang@REDACTED Wed Apr 9 18:35:55 2014 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 9 Apr 2014 09:35:55 -0700 (PDT) Subject: [erlang-questions] Reusing servers in a new supervision tree In-Reply-To: References: Message-ID: <1397061355.63152.YahooMailNeo@web140103.mail.bf1.yahoo.com> Hi David, You could have two applications as you propose, in which case it might be useful to actually have three of them: one that just loads the common code, and the other two setting up the supervisor trees and depending on the first one.? Another approach is to write the supervisor something like the following, and set the application key 'test_mode' to the desired value for your environment. init(Args) ->? ? case application:get_env(test_mode) of ? ? true -> init_test(Args); ? ? _ -> init_production(Args) ? end. (Or generalize suitably.) Option 3: use supervisor:start_child and supervisor:terminate_child to dynamically start and stop supervised processes. Have a look at the man page for more ideas:?http://www.erlang.org/doc/man/supervisor.html Finally, another option might be to have a look at gen_app (https://github.com/thomasl/gen_app) for easy assembly of (basic) supervisor trees. That could be sufficient for your testing purposes. Best, Thomas On Wednesday, April 9, 2014 12:39 PM, David Welton wrote: Hi, > >We have a supervision tree that seems to be working well and we are >happy with.? However, now we need to be able to put the system in >"testing" mode, where, instead of a tree that has FSM A, and servers >B, C, D, E and F, we only have a tree with B, D, and F. > >I don't think it's particularly important to be able to do this all >that smoothly or cleanly: we can probably even restart the machine to >put it in testing mode, or something like that - it's not a >configuration where we have any kind of stringent uptime requirements! > >My idea is to actually have a separate application, say testing_mode >that has a testing_mode_sup that directly starts B, D, and F.? Can I >do that across applications, though?? Should I include the testing >mode sup in the same application as the other stuff?? We had some >hopes of keeping it separate so that various additional testing mode >pieces could be developed and distributed separately from the main >bunch of code. > >Thank you for your thoughts, >-- >David N. Welton > >http://www.welton.it/davidw/ > >http://www.dedasys.com/ >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Wed Apr 9 18:50:06 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 9 Apr 2014 12:50:06 -0400 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: References: Message-ID: <20140409165004.GC19145@ferdair.local> For the people interested, here's a bonus LYSE chapter on Maps: http://learnyousomeerlang.com/maps Regards, Fred. On 04/09, Kenneth Lundin wrote: > Erlang/OTP 17.0 has been released. > > Erlang/OTP 17.0 is a new major release with new features, characteristics > improvements, as well as some minor incompatibilities. > > Some highlights of the release are: > > - Erlang/OTP has been ported to the realtime operating system OSE. > - Maps, a new dictionary data type (experimental) > - A more natural mapping from ASN.1 OCTET STRING and BIT STRING to > Erlang types, and other ASN.1 improvements and optimizations > - The {active, N} socket option for TCP, UDP, and SCTP > - A new (optional) scheduler utilization balancing mechanism > - Migration of memory carriers has been enabled by default on all ERTS > internal memory allocators > - Increased garbage collection tenure rate > - Experimental "dirty schedulers" functionality > - Funs can now be given names > - Miscellaneous unicode support enhancements > - A new version scheme for OTP its applications has been introduced > > You can find the README file with more detailed info at > http://www.erlang.org/download/otp_src_17.0.readme > > You can download the full source distribution from > http://www.erlang.org/download/otp_src_17.0.tar.gz > > Note: To unpack the TAR archive you need a GNU TAR compatible program. For > installation instructions please read the README that is part of the > distribution. > > You can also find this release at the official Erlang/OTP Git-repository at > Github here: https://github.com/erlang/otp tagged "OTP-17.0" > > The Windows binary distribution can be downloaded from > > http://www.erlang.org/download/otp_win32_17.0.exe > > http://www.erlang.org/download/otp_win64_17.0.exe > > You can also download the complete HTML documentation or the Unix manual > files > > http://www.erlang.org/download/otp_doc_html_17.0.tar.gz > http://www.erlang.org/download/otp_doc_man_17.0.tar.gz > > We also want to thank those that sent us patches, suggestions and bug > reports. > > The Erlang/OTP Team at Ericsson > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From rexxe98@REDACTED Wed Apr 9 18:58:20 2014 From: rexxe98@REDACTED (Andrew Berman) Date: Wed, 9 Apr 2014 09:58:20 -0700 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: <20140409165004.GC19145@ferdair.local> References: <20140409165004.GC19145@ferdair.local> Message-ID: Awesome stuff, Fred!! Thanks for this. On Wed, Apr 9, 2014 at 9:50 AM, Fred Hebert wrote: > For the people interested, here's a bonus LYSE chapter on Maps: > http://learnyousomeerlang.com/maps > > Regards, > Fred. > > On 04/09, Kenneth Lundin wrote: > > Erlang/OTP 17.0 has been released. > > > > Erlang/OTP 17.0 is a new major release with new features, characteristics > > improvements, as well as some minor incompatibilities. > > > > Some highlights of the release are: > > > > - Erlang/OTP has been ported to the realtime operating system OSE. > > - Maps, a new dictionary data type (experimental) > > - A more natural mapping from ASN.1 OCTET STRING and BIT STRING to > > Erlang types, and other ASN.1 improvements and optimizations > > - The {active, N} socket option for TCP, UDP, and SCTP > > - A new (optional) scheduler utilization balancing mechanism > > - Migration of memory carriers has been enabled by default on all ERTS > > internal memory allocators > > - Increased garbage collection tenure rate > > - Experimental "dirty schedulers" functionality > > - Funs can now be given names > > - Miscellaneous unicode support enhancements > > - A new version scheme for OTP its applications has been introduced > > > > You can find the README file with more detailed info at > > http://www.erlang.org/download/otp_src_17.0.readme > > > > You can download the full source distribution from > > http://www.erlang.org/download/otp_src_17.0.tar.gz > > > > Note: To unpack the TAR archive you need a GNU TAR compatible program. > For > > installation instructions please read the README that is part of the > > distribution. > > > > You can also find this release at the official Erlang/OTP Git-repository > at > > Github here: https://github.com/erlang/otp tagged "OTP-17.0" > > > > The Windows binary distribution can be downloaded from > > > > http://www.erlang.org/download/otp_win32_17.0.exe > > > > http://www.erlang.org/download/otp_win64_17.0.exe > > > > You can also download the complete HTML documentation or the Unix manual > > files > > > > http://www.erlang.org/download/otp_doc_html_17.0.tar.gz > > http://www.erlang.org/download/otp_doc_man_17.0.tar.gz > > > > We also want to thank those that sent us patches, suggestions and bug > > reports. > > > > The Erlang/OTP Team at Ericsson > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryankbrown@REDACTED Wed Apr 9 20:04:41 2014 From: ryankbrown@REDACTED (Ryan Brown) Date: Wed, 9 Apr 2014 12:04:41 -0600 Subject: [erlang-questions] MNesia replication in ec2 In-Reply-To: References: Message-ID: Thanks Geoff. That is pretty-much what I thought. Wasn't sure if anybody had experience using something like Ulf Wiger's unsplit ( https://github.com/uwiger/unsplit) to handle these events in this type of environment or not. But, ultimately, I think an external solution like Riak will be the best option as well. Thanks again. -rb On Tue, Apr 8, 2014 at 3:20 PM, Geoff Cant wrote: > On EC2 you will inevitably experience network conditions that will cause > mnesia to decide that it is partitioned. There is no way to perform an > online recovery from a partition event[1] without stopping and restarting > the mnesia application. Unless you design your app to go into a degraded > operation mode where all mnesia operations are either avoided or errors > caught, then you'll experience a lot of trouble with it. > > Additionally, mnesia recovers by copying the entire table from another > node - this is fine(ish) for small datasets, but if your dataset grows over > time, you'll eventually find yourself unable to bring new/recovering nodes > online quickly which blows up your Mean Time To Repair. > > I think multi-data-center Riak sounds like a better fit for multi-region > ec2 work honestly, but I have not personally used Riak in that scenario so > I defer to others. > > -Geoff > > [1] Pretty sure that's still true? > > On 2014-04-08, at 14:14 , Ryan Brown wrote: > > > We are in the process of laying the groundwork for deploying our > application to ec2. We currently depend upon mnesia replication for a > small amount of shared metadata in our datacenter. I've read a number of > posts/articles that have given me pause when thinking about how mnesia will > work across AZs, regions in ec2. Primarily regarding network partitioning. > We are currently considering removing our use of mnesia and pushing the > small amount of data we replicate to shared store (possibly Riak). > > > > Does anybody out there have experience with this or guidance? > > > > -- > > -rb > > > -- -rb -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Wed Apr 9 20:16:33 2014 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 9 Apr 2014 20:16:33 +0200 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: References: Message-ID: Thank you, OTP team! Erlide v0.27.0 and forward supports v17.0. Projects targeting v17 get utf-8 encoding and there is support for maps and named funs. There might be corner cases where erlide doesn't do what it should, please file tickets if you find issues. It is especially difficult to test all combinations of OS/Java/Erlang to see if the encoding is correct in all cases. Also please note that support for R14 is dropped at the same time. regards, Vlad On Wed, Apr 9, 2014 at 5:24 PM, Kenneth Lundin wrote: > Erlang/OTP 17.0 has been released. > > Erlang/OTP 17.0 is a new major release with new features, characteristics > improvements, as well as some minor incompatibilities. > > Some highlights of the release are: > > - Erlang/OTP has been ported to the realtime operating system OSE. > - Maps, a new dictionary data type (experimental) > - A more natural mapping from ASN.1 OCTET STRING and BIT STRING to > Erlang types, and other ASN.1 improvements and optimizations > - The {active, N} socket option for TCP, UDP, and SCTP > - A new (optional) scheduler utilization balancing mechanism > - Migration of memory carriers has been enabled by default on all ERTS > internal memory allocators > - Increased garbage collection tenure rate > - Experimental "dirty schedulers" functionality > - Funs can now be given names > - Miscellaneous unicode support enhancements > - A new version scheme for OTP its applications has been introduced > > You can find the README file with more detailed info at > http://www.erlang.org/download/otp_src_17.0.readme > > You can download the full source distribution from > http://www.erlang.org/download/otp_src_17.0.tar.gz > > Note: To unpack the TAR archive you need a GNU TAR compatible program. For > installation instructions please read the README that is part of the > distribution. > > You can also find this release at the official Erlang/OTP Git-repository > at Github here: https://github.com/erlang/otp tagged "OTP-17.0" > > The Windows binary distribution can be downloaded from > > http://www.erlang.org/download/otp_win32_17.0.exe > > http://www.erlang.org/download/otp_win64_17.0.exe > > You can also download the complete HTML documentation or the Unix manual > files > > http://www.erlang.org/download/otp_doc_html_17.0.tar.gz > http://www.erlang.org/download/otp_doc_man_17.0.tar.gz > > We also want to thank those that sent us patches, suggestions and bug > reports. > > The Erlang/OTP Team at Ericsson > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vances@REDACTED Wed Apr 9 20:22:44 2014 From: vances@REDACTED (Vance Shipley) Date: Wed, 9 Apr 2014 23:52:44 +0530 Subject: [erlang-questions] 17.0 binary packages for CentOS, Debian, Mac, Ubuntu and Windows In-Reply-To: <20140409155239.GA9105@dex.erlang-solutions.com> References: <20140409155239.GA9105@dex.erlang-solutions.com> Message-ID: It hasn't shown up on Google Play as yet. :) On Apr 9, 2014 9:22 PM, "Karol Urbanski" < karol.urbanski@REDACTED> wrote: > You can find our binary packages for the newest Erlang release (17.0) at > http://www.erlang-solutions.com/downloads/download-erlang-otp > > The systems we provide the packages for are CentOS 6, Mac OS X Snow > Leopard and newer, Debian 7.0.0, Ubuntu 13.10 + 13.04 + 12.04 and Windows. > More to come soon! > > Best regards, > Karol Urbanski -------------- next part -------------- An HTML attachment was scrubbed... URL: From gumm@REDACTED Wed Apr 9 22:02:37 2014 From: gumm@REDACTED (Jesse Gumm) Date: Wed, 9 Apr 2014 15:02:37 -0500 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: References: Message-ID: Awesome! I've been very eagerly awaiting maps. High fives all around! -Jesse -- Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm On Apr 9, 2014 10:25 AM, "Kenneth Lundin" wrote: > Erlang/OTP 17.0 has been released. > > Erlang/OTP 17.0 is a new major release with new features, characteristics > improvements, as well as some minor incompatibilities. > > Some highlights of the release are: > > - Erlang/OTP has been ported to the realtime operating system OSE. > - Maps, a new dictionary data type (experimental) > - A more natural mapping from ASN.1 OCTET STRING and BIT STRING to > Erlang types, and other ASN.1 improvements and optimizations > - The {active, N} socket option for TCP, UDP, and SCTP > - A new (optional) scheduler utilization balancing mechanism > - Migration of memory carriers has been enabled by default on all ERTS > internal memory allocators > - Increased garbage collection tenure rate > - Experimental "dirty schedulers" functionality > - Funs can now be given names > - Miscellaneous unicode support enhancements > - A new version scheme for OTP its applications has been introduced > > You can find the README file with more detailed info at > http://www.erlang.org/download/otp_src_17.0.readme > > You can download the full source distribution from > http://www.erlang.org/download/otp_src_17.0.tar.gz > > Note: To unpack the TAR archive you need a GNU TAR compatible program. For > installation instructions please read the README that is part of the > distribution. > > You can also find this release at the official Erlang/OTP Git-repository > at Github here: https://github.com/erlang/otp tagged "OTP-17.0" > > The Windows binary distribution can be downloaded from > > http://www.erlang.org/download/otp_win32_17.0.exe > > http://www.erlang.org/download/otp_win64_17.0.exe > > You can also download the complete HTML documentation or the Unix manual > files > > http://www.erlang.org/download/otp_doc_html_17.0.tar.gz > http://www.erlang.org/download/otp_doc_man_17.0.tar.gz > > We also want to thank those that sent us patches, suggestions and bug > reports. > > The Erlang/OTP Team at Ericsson > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Wed Apr 9 22:06:51 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Wed, 9 Apr 2014 22:06:51 +0200 Subject: [erlang-questions] otp.git 17.0 tag Message-ID: Was it a deliberate decision to tag 17.0 as OTP-17.0 and not OTP_17.0? I'm asking because 17.0-rc1 and 17.0-rc2 use the old prefix. Looking at the following list, I also wonder why there's no R16A tag. $ git tag OTP-17.0 OTP_17.0-rc1 OTP_17.0-rc2 OTP_R13B03 OTP_R13B04 OTP_R14A OTP_R14B OTP_R14B01 OTP_R14B02 OTP_R14B03 OTP_R14B04 OTP_R15A OTP_R15B OTP_R15B01 OTP_R15B02 OTP_R15B03 OTP_R15B03-1 OTP_R16A_RELEASE_CANDIDATE OTP_R16B OTP_R16B01 OTP_R16B01_RC1 OTP_R16B02 OTP_R16B03 OTP_R16B03-1 OTP_R16B03_yielding_binary_to_term R16B02_yielding_binary_to_term erl_1252 For reference: https://github.com/erlang/otp/tags From lloyd@REDACTED Wed Apr 9 22:56:06 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Wed, 9 Apr 2014 16:56:06 -0400 (EDT) Subject: [erlang-questions] =?utf-8?q?Getting_started_with_Cowboy_and_then?= =?utf-8?q?=3F?= Message-ID: <1397076966.410911705@apps.rackspace.com> Hello, If it's not one thing, it's another. Attempting to deepen my understanding of Cowboy, I went back to Getting Started. First time through it worked like a charm. Then I renamed the app and tried to rearrange directories a bit to support multiple applications: From: hello_erlang erlang.mk Makefile relx.config src To: lit apps lit src erlang.mk Makefile relx.config Now make gave me an error: ... Cloning into '/home/lloyd/Erl/Cowboy/lit/deps/cowboy'... fatal: https://github.com/extend/cowboy/info/refs not found: did you run git update-server-info on the server? make: *** [/home/lloyd/Erl/Cowboy/lit1/deps/cowboy] Error 128 So... started all over again from scratch in a new directory, following Getting Started explicitly. But now, I get the same error; e.g. worked the first time, but not the second. Google suggests that I might need to update git. But I'm running git version 1.7.10.4; and the github site suggests that all above 1.7.10 should be stable. Three questions: 1) Why would make work the first time around, but not the second? 2) How can I fix it? 3) What else do I need to do, in Makefile for instance, to successfully compile my new directory organization? Many thanks, LRP ********************************************* My books: THE GOSPEL OF ASHES http://thegospelofashes.com Strength is not enough. Do they have the courage and the cunning? Can they survive long enough to save the lives of millions? FREEIN' PANCHO http://freeinpancho.com A community of misfits help a troubled boy find his way AYA TAKEO http://ayatakeo.com Star-crossed love, war and power in an alternative universe Available through Amazon or by request from your favorite bookstore ********************************************** From bchesneau@REDACTED Wed Apr 9 23:37:59 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 9 Apr 2014 23:37:59 +0200 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: References: Message-ID: On Wed, Apr 9, 2014 at 5:24 PM, Kenneth Lundin wrote: > Erlang/OTP 17.0 has been released. > > Erlang/OTP 17.0 is a new major release with new features, characteristics > improvements, as well as some minor incompatibilities. > > Some highlights of the release are: > > - Erlang/OTP has been ported to the realtime operating system OSE. > - Maps, a new dictionary data type (experimental) > - A more natural mapping from ASN.1 OCTET STRING and BIT STRING to > Erlang types, and other ASN.1 improvements and optimizations > - The {active, N} socket option for TCP, UDP, and SCTP > - A new (optional) scheduler utilization balancing mechanism > - Migration of memory carriers has been enabled by default on all ERTS > internal memory allocators > - Increased garbage collection tenure rate > - Experimental "dirty schedulers" functionality > - Funs can now be given names > - Miscellaneous unicode support enhancements > - A new version scheme for OTP its applications has been introduced > > You can find the README file with more detailed info at > http://www.erlang.org/download/otp_src_17.0.readme > > You can download the full source distribution from > http://www.erlang.org/download/otp_src_17.0.tar.gz > > Note: To unpack the TAR archive you need a GNU TAR compatible program. For > installation instructions please read the README that is part of the > distribution. > > You can also find this release at the official Erlang/OTP Git-repository > at Github here: https://github.com/erlang/otp tagged "OTP-17.0" > > The Windows binary distribution can be downloaded from > > http://www.erlang.org/download/otp_win32_17.0.exe > > http://www.erlang.org/download/otp_win64_17.0.exe > > You can also download the complete HTML documentation or the Unix manual > files > > http://www.erlang.org/download/otp_doc_html_17.0.tar.gz > http://www.erlang.org/download/otp_doc_man_17.0.tar.gz > > We also want to thank those that sent us patches, suggestions and bug > reports. > > The Erlang/OTP Team at Ericsson > does the cross compilation of erlang on android allows it to be embedded in an application? Is there any example on how to use it? - benot -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Wed Apr 9 23:53:25 2014 From: mjtruog@REDACTED (Michael Truog) Date: Wed, 09 Apr 2014 14:53:25 -0700 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: References: Message-ID: <5345C155.6020106@gmail.com> I am glad we have a new release, but there remains a version checking concern: I am a bit concerned the new versioning with 17.0 (not the release candidates) doesn't provide the minor release number. This goes beyond the fact the erlang:system_info(otp_correction_package) removal breaks existing version checking source code (as was mentioned here http://erlang.org/pipermail/erlang-questions/2014-March/077998.html). I understand the html doc says "As of OTP release 17, the OTP release number corresponds to the major OTP version number. There is no erlang:system_info() argument giving the exact OTP version. This since the exact OTP version in the general case is hard to determine." (http://www.erlang.org/doc/man/erlang.html#system_info-1). This could force the error-prone parsing of erlang:system_info(system_version) to get the release candidate number in the future, but the minor release number remains missing. Isn't the minor release number required for support issues, to understand what anyone has installed? The current documentation wants people to make custom OTP_VERSION file in their target system (http://www.erlang.org/doc/system_principles/versions.html) but that isn't part of the installation, so it is in no way a standard, just an obscure detail. How should we deal with understanding what has changed in a minor release? Thanks, Michael On 04/09/2014 08:24 AM, Kenneth Lundin wrote: > Erlang/OTP 17.0 has been released. > > Erlang/OTP 17.0 is a new major release with new features, characteristics improvements, as well as some minor incompatibilities. > > Some highlights of the release are: > > * Erlang/OTP has been ported to the realtime operating system OSE. > * Maps, a new dictionary data type (experimental) > * A more natural mapping from ASN.1 OCTET STRING and BIT STRING to Erlang types, and other ASN.1 improvements and optimizations > * The {active, N} socket option for TCP, UDP, and SCTP > * A new (optional) scheduler utilization balancing mechanism > * Migration of memory carriers has been enabled by default on all ERTS internal memory allocators > * Increased garbage collection tenure rate > * Experimental "dirty schedulers" functionality > * Funs can now be given names > * Miscellaneous unicode support enhancements > * A new version scheme for OTP its applications has been introduced > > You can find the README file with more detailed info at http://www.erlang.org/download/otp_src_17.0.readme > > You can download the full source distribution from http://www.erlang.org/download/otp_src_17.0.tar.gz > > Note: To unpack the TAR archive you need a GNU TAR compatible program. For installation instructions please read the README that is part of the distribution. > > You can also find this release at the official Erlang/OTP Git-repository at Github here: https://github.com/erlang/otp tagged "OTP-17.0" > > The Windows binary distribution can be downloaded from > > http://www.erlang.org/download/otp_win32_17.0.exe > > http://www.erlang.org/download/otp_win64_17.0.exe > > You can also download the complete HTML documentation or the Unix manual files > > http://www.erlang.org/download/otp_doc_html_17.0.tar.gz > http://www.erlang.org/download/otp_doc_man_17.0.tar.gz > > We also want to thank those that sent us patches, suggestions and bug reports. > > The Erlang/OTP Team at Ericsson > > > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From moxford@REDACTED Wed Apr 9 23:59:30 2014 From: moxford@REDACTED (Mike Oxford) Date: Wed, 9 Apr 2014 14:59:30 -0700 Subject: [erlang-questions] Getting started with Cowboy and then? In-Reply-To: <1397076966.410911705@apps.rackspace.com> References: <1397076966.410911705@apps.rackspace.com> Message-ID: When you run git, it creates a hidden ".git" directory which is not normally visible. Inside the .git/config file is the repo you cloned from, called the upstream. Nuke the .git directory completely. Move stuff around git init your own repo once you're done reorganizing. You can then set the upstream to your own github if needed later. or the more difficult route: modify the .git/config file directly (vi/emacs) or reset the upstream via `git remote` calls. When you rename the project, you'll need to update your Makefile with the correct project name. I am not sure if erlang.mk does directory traversals or if you'll need to tell it where the new src file is. Commonly you'll see a top-level Makefile calling sub-Makefiles, one for each project. G'luck. -mox On Wed, Apr 9, 2014 at 1:56 PM, wrote: > Hello, > > If it's not one thing, it's another. > > Attempting to deepen my understanding of Cowboy, I went back to Getting > Started. First time through it worked like a charm. Then I renamed the app > and tried to rearrange directories a bit to support multiple applications: > > From: > > hello_erlang > erlang.mk > Makefile > relx.config > src > > To: > > lit > apps > lit > src > erlang.mk > Makefile > relx.config > > Now make gave me an error: > > ... > Cloning into '/home/lloyd/Erl/Cowboy/lit/deps/cowboy'... > fatal: https://github.com/extend/cowboy/info/refs not found: did you run > git update-server-info on the server? > make: *** [/home/lloyd/Erl/Cowboy/lit1/deps/cowboy] Error 128 > > So... started all over again from scratch in a new directory, following > Getting Started explicitly. But now, I get the same error; e.g. worked the > first time, but not the second. > > Google suggests that I might need to update git. But I'm running git > version 1.7.10.4; and the github site suggests that all above 1.7.10 should > be stable. > > Three questions: > > 1) Why would make work the first time around, but not the second? > 2) How can I fix it? > 3) What else do I need to do, in Makefile for instance, to successfully > compile my new directory organization? > > Many thanks, > > LRP > > > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Thu Apr 10 05:07:39 2014 From: erlang@REDACTED (Andreas Stenius) Date: Thu, 10 Apr 2014 05:07:39 +0200 Subject: [erlang-questions] Getting started with Cowboy and then? In-Reply-To: <1397076966.410911705@apps.rackspace.com> References: <1397076966.410911705@apps.rackspace.com> Message-ID: <3409890.5lD53spboL@cypher> On Wednesday 09 April 2014 16.56.06 lloyd@REDACTED wrote: > Hello, > > If it's not one thing, it's another. > > Attempting to deepen my understanding of Cowboy, I went back to Getting > Started. First time through it worked like a charm. Then I renamed the app > and tried to rearrange directories a bit to support multiple applications: > > From: > > hello_erlang > erlang.mk > Makefile > relx.config > src > > To: > > lit > apps > lit > src > erlang.mk > Makefile > relx.config > I recall Loic saying that erlang.mk doesn't support the apps directory layout, and pointed to a [gist](https://gist.github.com/RJ/6977165) as example how it could be used with a wrapper to overcome this limitation. Cheers, Andreas -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: From pierrefenoll@REDACTED Thu Apr 10 05:23:04 2014 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Thu, 10 Apr 2014 05:23:04 +0200 Subject: [erlang-questions] Getting started with Cowboy and then? In-Reply-To: <3409890.5lD53spboL@cypher> References: <1397076966.410911705@apps.rackspace.com> <3409890.5lD53spboL@cypher> Message-ID: Here [1] is a fork of my own project. A makefile that supports the apps directory layout. [1]: https://github.com/id3as/erl-mk Cheers, -- Pierre Fenoll On 10 April 2014 05:07, Andreas Stenius wrote: > On Wednesday 09 April 2014 16.56.06 lloyd@REDACTED wrote: > > Hello, > > > > If it's not one thing, it's another. > > > > Attempting to deepen my understanding of Cowboy, I went back to Getting > > Started. First time through it worked like a charm. Then I renamed the > app > > and tried to rearrange directories a bit to support multiple > applications: > > > > From: > > > > hello_erlang > > erlang.mk > > Makefile > > relx.config > > src > > > > To: > > > > lit > > apps > > lit > > src > > erlang.mk > > Makefile > > relx.config > > > > I recall Loic saying that erlang.mk doesn't support the apps directory > layout, > and pointed to a [gist](https://gist.github.com/RJ/6977165) as example > how it > could be used with a wrapper to overcome this limitation. > > Cheers, > Andreas > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Thu Apr 10 05:24:06 2014 From: erlang@REDACTED (Andreas Stenius) Date: Thu, 10 Apr 2014 05:24:06 +0200 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: <20140409165004.GC19145@ferdair.local> References: <20140409165004.GC19145@ferdair.local> Message-ID: <3052768.MBEfViv5Sz@cypher> On Wednesday 09 April 2014 12.50.06 Fred Hebert wrote: > For the people interested, here's a bonus LYSE chapter on Maps: > http://learnyousomeerlang.com/maps Very well written (and informative), thank you Fred :) (and two thumbs up to the OTP team and everyone else who've contributed in any way to this release) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: From lloyd@REDACTED Thu Apr 10 00:58:50 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Wed, 9 Apr 2014 18:58:50 -0400 (EDT) Subject: [erlang-questions] =?utf-8?q?Getting_started_with_Cowboy_and_then?= =?utf-8?q?=3F?= In-Reply-To: References: <1397076966.410911705@apps.rackspace.com> Message-ID: <1397084330.649429884@apps.rackspace.com> Many thanks, Mike, for the detailed and thoughtful response. I'll give it ago. Best wishes, Lloyd -----Original Message----- From: "Mike Oxford" Sent: Wednesday, April 9, 2014 5:59pm To: lloyd@REDACTED Cc: "Erlang Questions" Subject: Re: [erlang-questions] Getting started with Cowboy and then? When you run git, it creates a hidden ".git" directory which is not normally visible. Inside the .git/config file is the repo you cloned from, called the upstream. Nuke the .git directory completely. Move stuff around git init your own repo once you're done reorganizing. You can then set the upstream to your own github if needed later. or the more difficult route: modify the .git/config file directly (vi/emacs) or reset the upstream via `git remote` calls. When you rename the project, you'll need to update your Makefile with the correct project name. I am not sure if erlang.mk does directory traversals or if you'll need to tell it where the new src file is. Commonly you'll see a top-level Makefile calling sub-Makefiles, one for each project. G'luck. -mox On Wed, Apr 9, 2014 at 1:56 PM, wrote: > Hello, > > If it's not one thing, it's another. > > Attempting to deepen my understanding of Cowboy, I went back to Getting > Started. First time through it worked like a charm. Then I renamed the app > and tried to rearrange directories a bit to support multiple applications: > > From: > > hello_erlang > erlang.mk > Makefile > relx.config > src > > To: > > lit > apps > lit > src > erlang.mk > Makefile > relx.config > > Now make gave me an error: > > ... > Cloning into '/home/lloyd/Erl/Cowboy/lit/deps/cowboy'... > fatal: https://github.com/extend/cowboy/info/refs not found: did you run > git update-server-info on the server? > make: *** [/home/lloyd/Erl/Cowboy/lit1/deps/cowboy] Error 128 > > So... started all over again from scratch in a new directory, following > Getting Started explicitly. But now, I get the same error; e.g. worked the > first time, but not the second. > > Google suggests that I might need to update git. But I'm running git > version 1.7.10.4; and the github site suggests that all above 1.7.10 should > be stable. > > Three questions: > > 1) Why would make work the first time around, but not the second? > 2) How can I fix it? > 3) What else do I need to do, in Makefile for instance, to successfully > compile my new directory organization? > > Many thanks, > > LRP > > > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From boris.muehmer@REDACTED Thu Apr 10 05:42:56 2014 From: boris.muehmer@REDACTED (=?UTF-8?Q?Boris_M=C3=BChmer?=) Date: Thu, 10 Apr 2014 05:42:56 +0200 Subject: [erlang-questions] otp_src_17.0.tar.gz: "make docs" fails in "system/doc/top" Message-ID: Yesterday I did a build with the new otp_src_17.0.tar.gz tarball using my script which served me quite well from R13Bxx to R17RC2, but this time it failed at "make docs": make[2]: Entering directory `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/reference_manual' make[2]: Nothing to be done for `docs'. make[2]: Leaving directory `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/reference_manual' make[2]: Entering directory `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/programming_examples' make[2]: Nothing to be done for `docs'. make[2]: Leaving directory `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/programming_examples' make[2]: Entering directory `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/top' make[2]: *** No rule to make target `../../README', needed by `docs'. Stop. make[2]: Leaving directory `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/top' make[1]: *** [docs] Error 2 make[1]: Leaving directory `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc' make: *** [docs] Error 2 I compared the 17.0 to the 17RC2 structure: it looks like the file "system/README" is missing. I could "fix" the build process with a "touch system/README"... not a real fix of course. Regards, Boris -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickard@REDACTED Thu Apr 10 06:28:21 2014 From: rickard@REDACTED (Rickard Green) Date: Thu, 10 Apr 2014 06:28:21 +0200 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: <5345C155.6020106@gmail.com> References: <5345C155.6020106@gmail.com> Message-ID: On Wed, Apr 9, 2014 at 11:53 PM, Michael Truog wrote: > I am glad we have a new release, but there remains a version checking > concern: > > I am a bit concerned the new versioning with 17.0 (not the release > candidates) doesn't provide the minor release number. This goes beyond the > fact the erlang:system_info(otp_correction_package) removal breaks existing > version checking source code (as was mentioned here > http://erlang.org/pipermail/erlang-questions/2014-March/077998.html). erlang:system_info(otp_correction_package) has only existed in one release candidate. Never in a supported release. > I > understand the html doc says "As of OTP release 17, the OTP release number > corresponds to the major OTP version number. There is no > erlang:system_info() argument giving the exact OTP version. This since the > exact OTP version in the general case is hard to determine." > (http://www.erlang.org/doc/man/erlang.html#system_info-1). This could force > the error-prone parsing of erlang:system_info(system_version) to get the > release candidate number in the future, but the minor release number remains > missing. Isn't the minor release number required for support issues, to > understand what anyone has installed? No. This since an OTP installation may consist of multiple OTP versions (in the case of licensed customers this is the typical case). The set of installed application versions is more interesting information. The installation may, however, also consist of other modifications not associated with an OTP version, be configured in different ways, etc. In order to get the information we need, we've introduced system_information:to_file/1 . This since an OTP version gives us very little useful information. > The current documentation wants > people to make custom OTP_VERSION file in their target system > (http://www.erlang.org/doc/system_principles/versions.html) but that isn't > part of the installation, so it is in no way a standard, just an obscure > detail. The OTP version can only describe what is installed in the special case when you build and install the system from one OTP version and after that do not touch it. It may perhaps be a quite common special case, but it is still a special case. If you know this about your installed systems, you can put this information in your installation. We do however not know that this is the case, and would present false information to our users if we put the information there. > How should we deal with understanding what has changed in a minor > release? > I'm not sure I understand this question. Please, elaborate. Regards, Rickard Green, Erlang/OTP, Ericsson AB > Thanks, > Michael > > > On 04/09/2014 08:24 AM, Kenneth Lundin wrote: > > Erlang/OTP 17.0 has been released. > > Erlang/OTP 17.0 is a new major release with new features, characteristics > improvements, as well as some minor incompatibilities. > > Some highlights of the release are: > > Erlang/OTP has been ported to the realtime operating system OSE. > Maps, a new dictionary data type (experimental) > A more natural mapping from ASN.1 OCTET STRING and BIT STRING to Erlang > types, and other ASN.1 improvements and optimizations > The {active, N} socket option for TCP, UDP, and SCTP > A new (optional) scheduler utilization balancing mechanism > Migration of memory carriers has been enabled by default on all ERTS > internal memory allocators > Increased garbage collection tenure rate > Experimental "dirty schedulers" functionality > Funs can now be given names > Miscellaneous unicode support enhancements > A new version scheme for OTP its applications has been introduced > > You can find the README file with more detailed info at > http://www.erlang.org/download/otp_src_17.0.readme > > You can download the full source distribution from > http://www.erlang.org/download/otp_src_17.0.tar.gz > > Note: To unpack the TAR archive you need a GNU TAR compatible program. For > installation instructions please read the README that is part of the > distribution. > > You can also find this release at the official Erlang/OTP Git-repository at > Github here: https://github.com/erlang/otp tagged "OTP-17.0" > > The Windows binary distribution can be downloaded from > > http://www.erlang.org/download/otp_win32_17.0.exe > > http://www.erlang.org/download/otp_win64_17.0.exe > > You can also download the complete HTML documentation or the Unix manual > files > > http://www.erlang.org/download/otp_doc_html_17.0.tar.gz > http://www.erlang.org/download/otp_doc_man_17.0.tar.gz > > We also want to thank those that sent us patches, suggestions and bug > reports. > > The Erlang/OTP Team at Ericsson > > > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From rickard@REDACTED Thu Apr 10 06:35:01 2014 From: rickard@REDACTED (Rickard Green) Date: Thu, 10 Apr 2014 06:35:01 +0200 Subject: [erlang-questions] otp.git 17.0 tag In-Reply-To: References: Message-ID: On Wed, Apr 9, 2014 at 10:06 PM, Tuncer Ayaz wrote: > Was it a deliberate decision to tag 17.0 as OTP-17.0 and not OTP_17.0? Yes, and the format will not change from now on. Regards, Rickard Green, Erlang/OTP, Ericsson AB From magnus.falk@REDACTED Thu Apr 10 07:35:55 2014 From: magnus.falk@REDACTED (Magnus Falk) Date: Thu, 10 Apr 2014 13:35:55 +0800 Subject: [erlang-questions] Making a window non-resizable in wxWidgets Message-ID: I've been playing around with wxWidgets and want to make a window non-resizable. I understand you can do that in other implementations of wxWidgets, where you xor all those flags, like in this stackoverflow question: http://stackoverflow.com/questions/6829853/wxpython-disable-frame-resizing But is it actually possible to do that in the Erlang implementation, where you work with flag tuples? Regards, Magnus -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Thu Apr 10 07:43:06 2014 From: mjtruog@REDACTED (Michael Truog) Date: Wed, 09 Apr 2014 22:43:06 -0700 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: References: <5345C155.6020106@gmail.com> Message-ID: <53462F6A.9020602@gmail.com> On 04/09/2014 09:28 PM, Rickard Green wrote: > On Wed, Apr 9, 2014 at 11:53 PM, Michael Truog wrote: >> I am glad we have a new release, but there remains a version checking >> concern: >> >> I am a bit concerned the new versioning with 17.0 (not the release >> candidates) doesn't provide the minor release number. This goes beyond the >> fact the erlang:system_info(otp_correction_package) removal breaks existing >> version checking source code (as was mentioned here >> http://erlang.org/pipermail/erlang-questions/2014-March/077998.html). > erlang:system_info(otp_correction_package) has only existed in one > release candidate. Never in a supported release. That may be true, but that doesn't remove the fact that code existed that was written against it. I have updated it to handle the removal, but the absence of its information remains: https://github.com/CloudI/CloudI/blob/develop/src/m4/ax_erlang_otp_version.m4 > >> I >> understand the html doc says "As of OTP release 17, the OTP release number >> corresponds to the major OTP version number. There is no >> erlang:system_info() argument giving the exact OTP version. This since the >> exact OTP version in the general case is hard to determine." >> (http://www.erlang.org/doc/man/erlang.html#system_info-1). This could force >> the error-prone parsing of erlang:system_info(system_version) to get the >> release candidate number in the future, but the minor release number remains >> missing. Isn't the minor release number required for support issues, to >> understand what anyone has installed? > No. This since an OTP installation may consist of multiple OTP > versions (in the case of licensed customers this is the typical case). > The set of installed application versions is more interesting > information. > > The installation may, however, also consist of other modifications not > associated with an OTP version, be configured in different ways, etc. > In order to get the information we need, we've introduced > system_information:to_file/1 > . > This since an OTP version gives us very little useful information. I understand that the individual OTP applications that are in an Erlang/OTP official/public release are better to check for compatibility but this problem relies heavily on the packaging of the Erlang/OTP release. If individual OTP applications were truly separate, Erlang/OTP would provide downloads for each OTP application as individual links and installables. I am not trying to say that the Erlang/OTP release should be split in this way, just that the current packaging does enforce the versioning of a set of individual OTP applications. So, 17.0 really is a version set that contains all the individual OTP application versions and these individual OTP application versions are known to work together through both public and private testing. Other version sets that include private variations on these individual OTP applications would be used by Ericsson customers, but those version sets are a variation on the 17.0 release as it is released publicly, just due to different versions being used in the individual OTP applications (the individual OTP application versions being changed is my assumption for customers, so they are able to track what they have, but I do not have proof that this occurs, you would know). >> The current documentation wants >> people to make custom OTP_VERSION file in their target system >> (http://www.erlang.org/doc/system_principles/versions.html) but that isn't >> part of the installation, so it is in no way a standard, just an obscure >> detail. > The OTP version can only describe what is installed in the special > case when you build and install the system from one OTP version and > after that do not touch it. It may perhaps be a quite common special > case, but it is still a special case. If you know this about your > installed systems, you can put this information in your installation. > We do however not know that this is the case, and would present false > information to our users if we put the information there. My main concern about removing information about the version set named "17.0", such that you are only ever able to check for "17" is that the minor release version number and the release candidate number is lost. The main problem is the missing minor release version number, since that is generally more important for support and compatibility. > >> How should we deal with understanding what has changed in a minor >> release? >> > I'm not sure I understand this question. Please, elaborate. An example of this problem is with R14B02. I happen to know that erlzmq2 (https://github.com/zeromq/erlzmq2/) requires R14B02 due to the NIF support within that release. I know that checking for that release isn't as much of an issue now, due to its age, but when a similar problem appears for release 17 I will be unable to check for it, avoid it, or handle it, unless I try to do it based on individual OTP application versions. That requires that I know all the individual OTP applications which are at fault for the problem, or offer a new feature, but they are interconnected in various ways that are not trivial. Due to Erlang/OTP commonly being released with a single version number, which defines a version set, a set of individual OTP application versions that work together, I think it is important to be able to check what version set exists is a simple way to make development and support issues simpler. I could also take all individual OTP application versions and put them through a hash to get a sequence of hexadecimal, but the resulting string doesn't mean much to a person that just sees the hexadecimal string associated with an Erlang/OTP release. The alternative would be to have separate installables for each individual OTP application, but that makes the situation more unstable if something doesn't enforce what version set is being used. So, it would be much easier to check the existence of 17.0 or 17.0rc1 to avoid development and support problems. Best Regards, Michael > > Regards, > Rickard Green, Erlang/OTP, Ericsson AB > >> Thanks, >> Michael >> >> >> On 04/09/2014 08:24 AM, Kenneth Lundin wrote: >> >> Erlang/OTP 17.0 has been released. >> >> Erlang/OTP 17.0 is a new major release with new features, characteristics >> improvements, as well as some minor incompatibilities. >> >> Some highlights of the release are: >> >> Erlang/OTP has been ported to the realtime operating system OSE. >> Maps, a new dictionary data type (experimental) >> A more natural mapping from ASN.1 OCTET STRING and BIT STRING to Erlang >> types, and other ASN.1 improvements and optimizations >> The {active, N} socket option for TCP, UDP, and SCTP >> A new (optional) scheduler utilization balancing mechanism >> Migration of memory carriers has been enabled by default on all ERTS >> internal memory allocators >> Increased garbage collection tenure rate >> Experimental "dirty schedulers" functionality >> Funs can now be given names >> Miscellaneous unicode support enhancements >> A new version scheme for OTP its applications has been introduced >> >> You can find the README file with more detailed info at >> http://www.erlang.org/download/otp_src_17.0.readme >> >> You can download the full source distribution from >> http://www.erlang.org/download/otp_src_17.0.tar.gz >> >> Note: To unpack the TAR archive you need a GNU TAR compatible program. For >> installation instructions please read the README that is part of the >> distribution. >> >> You can also find this release at the official Erlang/OTP Git-repository at >> Github here: https://github.com/erlang/otp tagged "OTP-17.0" >> >> The Windows binary distribution can be downloaded from >> >> http://www.erlang.org/download/otp_win32_17.0.exe >> >> http://www.erlang.org/download/otp_win64_17.0.exe >> >> You can also download the complete HTML documentation or the Unix manual >> files >> >> http://www.erlang.org/download/otp_doc_html_17.0.tar.gz >> http://www.erlang.org/download/otp_doc_man_17.0.tar.gz >> >> We also want to thank those that sent us patches, suggestions and bug >> reports. >> >> The Erlang/OTP Team at Ericsson >> >> >> >> >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> From kenneth.lundin@REDACTED Thu Apr 10 08:09:28 2014 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Thu, 10 Apr 2014 08:09:28 +0200 Subject: [erlang-questions] [erlang-bugs] otp_src_17.0.tar.gz: "make docs" fails in "system/doc/top" In-Reply-To: References: Message-ID: I think this has to do with that we deleted the system/README file on purpose because it did only contain useless outdated information. Apparently there is still some Makefile dependency which should not be there. So your quick fix with touch is ok, you will not miss anything interesting in the docs. /Kenneth , Erlang/OTP Ericsson Den 10 apr 2014 05:55 skrev "Boris M?hmer" : > Yesterday I did a build with the new otp_src_17.0.tar.gz tarball using my > script which served me quite well from R13Bxx to R17RC2, but this time it > failed at "make docs": > > > make[2]: Entering directory > `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/reference_manual' > make[2]: Nothing to be done for `docs'. > make[2]: Leaving directory > `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/reference_manual' > make[2]: Entering directory > `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/programming_examples' > make[2]: Nothing to be done for `docs'. > make[2]: Leaving directory > `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/programming_examples' > make[2]: Entering directory > `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/top' > make[2]: *** No rule to make target `../../README', needed by `docs'. > Stop. > make[2]: Leaving directory > `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/top' > make[1]: *** [docs] Error 2 > make[1]: Leaving directory > `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc' > make: *** [docs] Error 2 > > > I compared the 17.0 to the 17RC2 structure: it looks like the file "system/README" > is missing. I could "fix" the build process with a "touch > system/README"... not a real fix of course. > > Regards, > Boris > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickard@REDACTED Thu Apr 10 08:52:07 2014 From: rickard@REDACTED (Rickard Green) Date: Thu, 10 Apr 2014 08:52:07 +0200 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: <53462F6A.9020602@gmail.com> References: <5345C155.6020106@gmail.com> <53462F6A.9020602@gmail.com> Message-ID: >> >>> How should we deal with understanding what has changed in a minor >>> release? >>> >> I'm not sure I understand this question. Please, elaborate. > > An example of this problem is with R14B02. I happen to know that erlzmq2 > (https://github.com/zeromq/erlzmq2/) requires R14B02 due to the NIF support > within that release. I know that checking for that release isn't as much of > an issue now, due to its age, but when a similar problem appears for release > 17 I will be unable to check for it, avoid it, or handle it, unless I try to > do it based on individual OTP application versions. That requires that I > know all the individual OTP applications which are at fault for the problem, > or offer a new feature, but they are interconnected in various ways that are > not trivial. Due to Erlang/OTP commonly being released with a single > version number, which defines a version set, a set of individual OTP > application versions that work together, I think it is important to be able > to check what version set exists is a simple way to make development and > support issues simpler. I could also take all individual OTP application > versions and put them through a hash to get a sequence of hexadecimal, but > the resulting string doesn't mean much to a person that just sees the > hexadecimal string associated with an Erlang/OTP release. The alternative > would be to have separate installables for each individual OTP application, > but that makes the situation more unstable if something doesn't enforce what > version set is being used. So, it would be much easier to check the > existence of 17.0 or 17.0rc1 to avoid development and support problems. > If you make such decisions based on an OTP version, you will make the wrong decisions on OTP installations consisting of applications from multiple OTP versions. An OTP application is the smallest installable unit supported. If you want to make such decisions based on version, you should look at application version. Regards, Rickard Green, Erlang/OTP, Ericsson AB From boris.muehmer@REDACTED Thu Apr 10 08:32:29 2014 From: boris.muehmer@REDACTED (=?UTF-8?Q?Boris_M=C3=BChmer?=) Date: Thu, 10 Apr 2014 08:32:29 +0200 Subject: [erlang-questions] [erlang-bugs] otp_src_17.0.tar.gz: "make docs" fails in "system/doc/top" In-Reply-To: References: Message-ID: Should I provide an patch/pull request, or will You OTP guys do it? (I can't provide the patch right now, because I am pretty busy at the office right now...) Regards, Boris 2014-04-10 8:09 GMT+02:00 Kenneth Lundin : > I think this has to do with that we deleted > the system/README file on purpose because it did only contain useless > outdated information. Apparently there is still some Makefile dependency > which should not be there. > > So your quick fix with touch is ok, you will not miss anything interesting > in the docs. > > /Kenneth , Erlang/OTP Ericsson > Den 10 apr 2014 05:55 skrev "Boris M?hmer" : > >> Yesterday I did a build with the new otp_src_17.0.tar.gz tarball using my >> script which served me quite well from R13Bxx to R17RC2, but this time it >> failed at "make docs": >> >> >> make[2]: Entering directory >> `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/reference_manual' >> make[2]: Nothing to be done for `docs'. >> make[2]: Leaving directory >> `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/reference_manual' >> make[2]: Entering directory >> `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/programming_examples' >> make[2]: Nothing to be done for `docs'. >> make[2]: Leaving directory >> `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/programming_examples' >> make[2]: Entering directory >> `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/top' >> make[2]: *** No rule to make target `../../README', needed by `docs'. >> Stop. >> make[2]: Leaving directory >> `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc/top' >> make[1]: *** [docs] Error 2 >> make[1]: Leaving directory >> `/tmp/tmp.6FO62sEXov-erlang-otp/otp_src_17.0/system/doc' >> make: *** [docs] Error 2 >> >> >> I compared the 17.0 to the 17RC2 structure: it looks like the file "system/README" >> is missing. I could "fix" the build process with a "touch >> system/README"... not a real fix of course. >> >> Regards, >> Boris >> >> >> _______________________________________________ >> erlang-bugs mailing list >> erlang-bugs@REDACTED >> http://erlang.org/mailman/listinfo/erlang-bugs >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Thu Apr 10 09:09:01 2014 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 10 Apr 2014 00:09:01 -0700 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: References: <5345C155.6020106@gmail.com> <53462F6A.9020602@gmail.com> Message-ID: <5346438D.9090109@gmail.com> On 04/09/2014 11:52 PM, Rickard Green wrote: >>>> How should we deal with understanding what has changed in a minor >>>> release? >>>> >>> I'm not sure I understand this question. Please, elaborate. >> An example of this problem is with R14B02. I happen to know that erlzmq2 >> (https://github.com/zeromq/erlzmq2/) requires R14B02 due to the NIF support >> within that release. I know that checking for that release isn't as much of >> an issue now, due to its age, but when a similar problem appears for release >> 17 I will be unable to check for it, avoid it, or handle it, unless I try to >> do it based on individual OTP application versions. That requires that I >> know all the individual OTP applications which are at fault for the problem, >> or offer a new feature, but they are interconnected in various ways that are >> not trivial. Due to Erlang/OTP commonly being released with a single >> version number, which defines a version set, a set of individual OTP >> application versions that work together, I think it is important to be able >> to check what version set exists is a simple way to make development and >> support issues simpler. I could also take all individual OTP application >> versions and put them through a hash to get a sequence of hexadecimal, but >> the resulting string doesn't mean much to a person that just sees the >> hexadecimal string associated with an Erlang/OTP release. The alternative >> would be to have separate installables for each individual OTP application, >> but that makes the situation more unstable if something doesn't enforce what >> version set is being used. So, it would be much easier to check the >> existence of 17.0 or 17.0rc1 to avoid development and support problems. >> > If you make such decisions based on an OTP version, you will make the > wrong decisions on OTP installations consisting of applications from > multiple OTP versions. An OTP application is the smallest installable > unit supported. If you want to make such decisions based on version, > you should look at application version. If an OTP application is the smallest installable unit supported, it would be nice if the public Erlang/OTP release was broken up into these separate units so that they can be managed as distinct entities, the way they are intended to be. Best Regards, Michael > > Regards, > Rickard Green, Erlang/OTP, Ericsson AB > From bchesneau@REDACTED Thu Apr 10 09:18:01 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Thu, 10 Apr 2014 09:18:01 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? Message-ID: Hi all, I would like to rework the way I am building releases and find a good way to handle the inclusion of dependencies in them. I am generally using the easy path for now by mostly using rebar to get the dependencies but I wonder what others are doing. How do you get the dependencies, build them and adding them to the release? Are you using your own scripts? Using a makefile like some? In that case how do you maintain the dependencies list and their upgrades? Any feedback is appreciated :) - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From dangud@REDACTED Thu Apr 10 09:24:31 2014 From: dangud@REDACTED (Dan Gudmundsson) Date: Thu, 10 Apr 2014 09:24:31 +0200 Subject: [erlang-questions] Making a window non-resizable in wxWidgets In-Reply-To: References: Message-ID: The style option is (currently) only a integer which is 'bor'ed together as in wxpython and C++. Erlang is just a thin wrapper above wxWidgets, what differs are that optional arguments are in a list, and the event handling can be async with messages. /Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Thu Apr 10 09:26:48 2014 From: g@REDACTED (Garrett Smith) Date: Thu, 10 Apr 2014 09:26:48 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: Message-ID: On Thu, Apr 10, 2014 at 9:18 AM, Benoit Chesneau wrote: > Hi all, > > I would like to rework the way I am building releases and find a good way to > handle the inclusion of dependencies in them. I am generally using the easy > path for now by mostly using rebar to get the dependencies but I wonder what > others are doing. > > How do you get the dependencies, build them and adding them to the release? > Are you using your own scripts? Using a makefile like some? In that case how > do you maintain the dependencies list and their upgrades? I've started using relx for creating releases -- and, guess what -- it totally works! I was going to set out to use the core Erlang chain for this (reltool, etc.) and some Makefile scripts but relx just worked fine and this is a world of *severe* pain that I'm very happy to not enter (again). Garrett From ivan@REDACTED Thu Apr 10 09:35:17 2014 From: ivan@REDACTED (Ivan Uemlianin) Date: Thu, 10 Apr 2014 08:35:17 +0100 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: Message-ID: <534649B5.8080001@llaisdy.com> I am using erlang.mk to get dependencies and do the building, and relx to package the release. See eg http://ninenines.eu/articles/erlang.mk-and-relx/ http://blog.troutwine.us/2013/09/13/trivial_otp_releases.html Ivan On 10/04/2014 08:18, Benoit Chesneau wrote: > Hi all, > > I would like to rework the way I am building releases and find a good > way to handle the inclusion of dependencies in them. I am generally > using the easy path for now by mostly using rebar to get the > dependencies but I wonder what others are doing. > > How do you get the dependencies, build them and adding them to the > release? Are you using your own scripts? Using a makefile like some? In > that case how do you maintain the dependencies list and their upgrades? > > Any feedback is appreciated :) > > - benoit > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- ============================================================ Ivan A. Uemlianin PhD Llaisdy Speech Technology Research and Development ivan@REDACTED www.llaisdy.com llaisdy.wordpress.com github.com/llaisdy www.linkedin.com/in/ivanuemlianin festina lente ============================================================ From nickelchen@REDACTED Thu Apr 10 09:24:08 2014 From: nickelchen@REDACTED (nickel chen) Date: Thu, 10 Apr 2014 00:24:08 -0700 (PDT) Subject: [erlang-questions] ejabberd translate crash Message-ID: <1397114648.17048.YahooMailNeo@web125706.mail.ne1.yahoo.com> ?Hi all, I'm new to erlang and I'm learning the code of ejabberd 13.12, I already have ejabberd installed, then start it with sudo ejabberdctl start There is a crash message in /var/log/ejabberd.log 2014-04-10 14:37:56.520 [info] <0.7.0> Application ejabberd exited with reason: bad argument in call to erlang:iolist_to_binary([916,953,945,956,972,961,966,969,963,951,32,928,961,972,963,946,945,963,951,962]) in translate:'-load_file/2-fun-2-'/3 line 91 i added some debug info to the source code ` translate.erl` ?and recompile ejabberd. then start it again, below is the debug message: 2014-04-10 14:37:56.517 [info] <0.38.0>@translate:load_file:87 File is: <<"//lib/ejabberd/priv/msgs/el.msg">>, Orig is:"Access Configuration", Trans is: [916,953,945,956,972,961,966,969,963,951,32,928,961,972,963,946,945,963,951,962] well it's clear that there are unicode characters in I18N translation , when passed to?the?erlang:iolist_to_binary/1, it crashed with badarg, because iolist only accepts byte( ) binary( ) and other iolist( ) 9> erlang:iolist_to_binary([256]). ** exception error: bad argument ?? ? in function? iolist_to_binary/1 ? ? ? ? called as iolist_to_binary([256]) 10> erlang:iolist_to_binary([255]). <<"?">> 11>? My question is simple, how to get around with this problem and get ejabberd launched? Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus.falk@REDACTED Thu Apr 10 09:43:44 2014 From: magnus.falk@REDACTED (Magnus Falk) Date: Thu, 10 Apr 2014 15:43:44 +0800 Subject: [erlang-questions] Making a window non-resizable in wxWidgets In-Reply-To: References: Message-ID: Yeah okay, that's what I figured. Thanks! /Magnus On Thu, Apr 10, 2014 at 3:24 PM, Dan Gudmundsson wrote: > The style option is (currently) only a integer which is 'bor'ed together > as in wxpython and C++. > > Erlang is just a thin wrapper above wxWidgets, what differs are that > optional arguments are in a list, > and the event handling can be async with messages. > > /Dan > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Thu Apr 10 10:41:13 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 10 Apr 2014 12:41:13 +0400 Subject: [erlang-questions] Store maps in ets/dets? Message-ID: Maybe I have missed something and failed to google this info, but are there any plans to store maps in ets? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Thu Apr 10 11:05:23 2014 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 10 Apr 2014 02:05:23 -0700 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: Message-ID: <53465ED3.2020409@gmail.com> If you need "rebar generate" behavior in a way that doesn't have extra checks blocking its success and is able to report errors (problems rebar has had in the past), without the logic for windows support, there is a script here: https://github.com/okeuday/reltool_util/blob/master/release However, relx should be a better way to go, if you can part with your reltool file. I haven't found all the reltool options to be supported by relx, so I don't believe it is a fit for all situations. On 04/10/2014 12:18 AM, Benoit Chesneau wrote: > Hi all, > > I would like to rework the way I am building releases and find a good way to handle the inclusion of dependencies in them. I am generally using the easy path for now by mostly using rebar to get the dependencies but I wonder what others are doing. > > How do you get the dependencies, build them and adding them to the release? Are you using your own scripts? Using a makefile like some? In that case how do you maintain the dependencies list and their upgrades? > > Any feedback is appreciated :) > > - benoit > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Thu Apr 10 11:09:24 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 10 Apr 2014 11:09:24 +0200 Subject: [erlang-questions] Store maps in ets/dets? In-Reply-To: References: Message-ID: The semantics of maps is that of a persistent data type. ETS is ephemeral. So the fit is not good. Furthermore, maps are living int he process heap and thus, they are automatically garbage collected. ETS is manually collected in contrast. So the fit is even worse. Maps currently has no order (based on maps:map/2 and maps:fold/3), which means they can be implemented as HAMTs (like in Clojure) once they grow large. This has very good runtime behaviour, while keeping the process semantics intact. The other option is to give maps order, but then we can't use digital searching techniques anymore and must resort to balanced search trees, e.g., AVL or RB trees and friends. The current representation is very memory efficient however. It will probably be very good for small maps with a keyset that doesn't change. On Thu, Apr 10, 2014 at 10:41 AM, Max Lapshin wrote: > Maybe I have missed something and failed to google this info, but are > there any plans to store maps in ets? > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Thu Apr 10 11:17:38 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Thu, 10 Apr 2014 11:17:38 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <53465ED3.2020409@gmail.com> References: <53465ED3.2020409@gmail.com> Message-ID: On Thu, Apr 10, 2014 at 11:05 AM, Michael Truog wrote: > If you need "rebar generate" behavior in a way that doesn't have extra > checks blocking its success and is able to report errors (problems rebar > has had in the past), without the logic for windows support, there is a > script here: > https://github.com/okeuday/reltool_util/blob/master/release > > However, relx should be a better way to go, if you can part with your > reltool file. I haven't found all the reltool options to be supported by > relx, so I don't believe it is a fit for all situations. > > But how do you manage the dependencies? In a rebar world you're doing: 1. rebar get-deps 2. rebar compile which build deps and what you have in subdirs 3. rebar generate which reuses what you fetched in deps etc. Using erlang.mk: 1. fetch the dependeinces using curl and some links you have in a file or such thing 2. compile, but not sure if every apps in apps/* are compiled 3. use relx or anything else to buld the relese You can also have 1 make file per app etc. I am curious how people manage to get the dependencies without rebar or erlang.mk, build them and then tell to reltools or relx where to find to include them in the release. IN cloudi it seems for examle that you're using rebar for that. but I can see some projects around publishing their app without any support for rebar. How is it handled behind? - benoit > > On 04/10/2014 12:18 AM, Benoit Chesneau wrote: > > Hi all, > > I would like to rework the way I am building releases and find a good > way to handle the inclusion of dependencies in them. I am generally using > the easy path for now by mostly using rebar to get the dependencies but I > wonder what others are doing. > > How do you get the dependencies, build them and adding them to the > release? Are you using your own scripts? Using a makefile like some? In > that case how do you maintain the dependencies list and their upgrades? > > Any feedback is appreciated :) > > - benoit > > > _______________________________________________ > erlang-questions mailing listerlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Thu Apr 10 11:29:53 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Thu, 10 Apr 2014 11:29:53 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: <53465ED3.2020409@gmail.com> Message-ID: <53466491.2010301@ninenines.eu> > Using erlang.mk : > > 1. fetch the dependeinces using curl and some links you have in a file > or such thing > 2. compile, but not sure if every apps in apps/* are compiled > 3. use relx or anything else to buld the relese Have you read the readme? It's the same logic as rebar, except you put deps in your Makefile instead of rebar.config. After that, you simply type "make" and it does the fetching, compiling and even builds the release if there is a relx.config file. It does not support the terrible apps/* layout directly, but it's easily done using a top-level Makefile like the one that was posted in that other thread earlier today: https://gist.github.com/RJ/6977165 -- Lo?c Hoguin http://ninenines.eu From mjtruog@REDACTED Thu Apr 10 11:38:59 2014 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 10 Apr 2014 02:38:59 -0700 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: <53465ED3.2020409@gmail.com> Message-ID: <534666B3.2030000@gmail.com> On 04/10/2014 02:17 AM, Benoit Chesneau wrote: > > > > On Thu, Apr 10, 2014 at 11:05 AM, Michael Truog > wrote: > > If you need "rebar generate" behavior in a way that doesn't have extra checks blocking its success and is able to report errors (problems rebar has had in the past), without the logic for windows support, there is a script here: > https://github.com/okeuday/reltool_util/blob/master/release > > However, relx should be a better way to go, if you can part with your reltool file. I haven't found all the reltool options to be supported by relx, so I don't believe it is a fit for all situations. > > > But how do you manage the dependencies? > > In a rebar world you're doing: > > 1. rebar get-deps > 2. rebar compile which build deps and what you have in subdirs > 3. rebar generate which reuses what you fetched in deps etc. > > Using erlang.mk : > > 1. fetch the dependeinces using curl and some links you have in a file or such thing > 2. compile, but not sure if every apps in apps/* are compiled > 3. use relx or anything else to buld the relese > > You can also have 1 make file per app etc. > > I am curious how people manage to get the dependencies without rebar or erlang.mk , build them and then tell to reltools or relx where to find to include them in the release. > > IN cloudi it seems for examle that you're using rebar for that. but I can see some projects around publishing their app without any support for rebar. How is it handled behind? In CloudI (in the main repository) the dependencies are stored locally, and they are modified so that all modules and applications have a 'cloudi_x_' prefix, so that they don't conflict with the same applications running in the same Erlang VM, possibly at a different version. However, the cloudi_core repository uses rebar to do get-deps without any modification of the modules/application names while limiting it to internal service support. Both repositories use the rebar compile for building. I am not trying to say rebar should be used. I just ended up using rebar due to a lack of better options. I know erlang.mk exists now, but I also have autoconf/automake which has its own support for Erlang. Then there is also emake. I was attempting to use something more automatic and simpler than a makefile, though I know erlang.mk should be simple to use. Best Regards, Michael > > - benoit > > > > On 04/10/2014 12:18 AM, Benoit Chesneau wrote: >> Hi all, >> >> I would like to rework the way I am building releases and find a good way to handle the inclusion of dependencies in them. I am generally using the easy path for now by mostly using rebar to get the dependencies but I wonder what others are doing. >> >> How do you get the dependencies, build them and adding them to the release? Are you using your own scripts? Using a makefile like some? In that case how do you maintain the dependencies list and their upgrades? >> >> Any feedback is appreciated :) >> >> - benoit >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.nijhof@REDACTED Thu Apr 10 11:46:24 2014 From: mark.nijhof@REDACTED (Mark Nijhof) Date: Thu, 10 Apr 2014 11:46:24 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <534666B3.2030000@gmail.com> References: <53465ED3.2020409@gmail.com> <534666B3.2030000@gmail.com> Message-ID: You may also want to look at: https://github.com/id3as/erl-mk which we use, it is inspired from different solutions currently around and does support apps structure straight from the get go, it is also very much inline with how make works. On Thu, Apr 10, 2014 at 11:38 AM, Michael Truog wrote: > On 04/10/2014 02:17 AM, Benoit Chesneau wrote: > > > > > On Thu, Apr 10, 2014 at 11:05 AM, Michael Truog wrote: > >> If you need "rebar generate" behavior in a way that doesn't have extra >> checks blocking its success and is able to report errors (problems rebar >> has had in the past), without the logic for windows support, there is a >> script here: >> https://github.com/okeuday/reltool_util/blob/master/release >> >> However, relx should be a better way to go, if you can part with your >> reltool file. I haven't found all the reltool options to be supported by >> relx, so I don't believe it is a fit for all situations. >> >> > But how do you manage the dependencies? > > In a rebar world you're doing: > > 1. rebar get-deps > 2. rebar compile which build deps and what you have in subdirs > 3. rebar generate which reuses what you fetched in deps etc. > > Using erlang.mk: > > 1. fetch the dependeinces using curl and some links you have in a file > or such thing > 2. compile, but not sure if every apps in apps/* are compiled > 3. use relx or anything else to buld the relese > > You can also have 1 make file per app etc. > > I am curious how people manage to get the dependencies without rebar or > erlang.mk, build them and then tell to reltools or relx where to find to > include them in the release. > > IN cloudi it seems for examle that you're using rebar for that. but I > can see some projects around publishing their app without any support for > rebar. How is it handled behind? > > In CloudI (in the main repository) the dependencies are stored locally, > and they are modified so that all modules and applications have a > 'cloudi_x_' prefix, so that they don't conflict with the same applications > running in the same Erlang VM, possibly at a different version. However, > the cloudi_core repository uses rebar to do get-deps without any > modification of the modules/application names while limiting it to internal > service support. Both repositories use the rebar compile for building. I > am not trying to say rebar should be used. I just ended up using rebar due > to a lack of better options. > > I know erlang.mk exists now, but I also have autoconf/automake which has > its own support for Erlang. Then there is also emake. I was attempting to > use something more automatic and simpler than a makefile, though I know > erlang.mk should be simple to use. > > Best Regards, > Michael > > > > - benoit > > > >> >> On 04/10/2014 12:18 AM, Benoit Chesneau wrote: >> >> Hi all, >> >> I would like to rework the way I am building releases and find a good >> way to handle the inclusion of dependencies in them. I am generally using >> the easy path for now by mostly using rebar to get the dependencies but I >> wonder what others are doing. >> >> How do you get the dependencies, build them and adding them to the >> release? Are you using your own scripts? Using a makefile like some? In >> that case how do you maintain the dependencies list and their upgrades? >> >> Any feedback is appreciated :) >> >> - benoit >> >> >> _______________________________________________ >> erlang-questions mailing listerlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions >> >> >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Mark Nijhof t: @MarkNijhof s: marknijhof -------------- next part -------------- An HTML attachment was scrubbed... URL: From sverker.eriksson@REDACTED Thu Apr 10 12:11:48 2014 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Thu, 10 Apr 2014 12:11:48 +0200 Subject: [erlang-questions] NIF resource and typespecs In-Reply-To: <53454A4D.90503@ninenines.eu> References: <53454A4D.90503@ninenines.eu> Message-ID: <53466E64.4020309@erix.ericsson.se> On 04/09/2014 03:25 PM, Lo?c Hoguin wrote: > Hello, > > NIF resources appear as a magic empty binary on the Erlang side. What > typespec should I use for them though? Is there anything better than > this? > > -opaque my_nif_resource() :: any(). > > Thanks. > I think this is the way to go: -type my_nif_resource() :: any(). @Tuncer: Wasn't that your conclusion? /Sverker, Erlang/OTP From vladdu55@REDACTED Thu Apr 10 12:44:07 2014 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 10 Apr 2014 12:44:07 +0200 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: References: <5345C155.6020106@gmail.com> <53462F6A.9020602@gmail.com> Message-ID: Hi! On Thu, Apr 10, 2014 at 8:52 AM, Rickard Green wrote: > If you make such decisions based on an OTP version, you will make the > wrong decisions on OTP installations consisting of applications from > multiple OTP versions. An OTP application is the smallest installable > unit supported. If you want to make such decisions based on version, > you should look at application version. > To detect (breaking) changes to the BEAM opcodes or the external term format, I suppose the application to check is erts? For changes to the language syntax - is it still erts? Having a global OTP version makes it easier to refer to these things when talking about them, especially now when R16 and earlier are still around. For most people, it doesn't make much sense to say "Erlang has maps from erts-6.0", because when they go to the download page, they see only the OTP version... So there is still a need for a generic label. Alternatively, maybe erts version could be made "17.0" and use that as the "language version"? This precludes having major OTP versions for purely marketing reasons, though... BTW, is the file "installed_application_versions" something to count on? regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Thu Apr 10 14:02:00 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 10 Apr 2014 08:02:00 -0400 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <53466491.2010301@ninenines.eu> References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> Message-ID: <20140410120159.GC22866@ferdmbp.local> On 04/10, Lo?c Hoguin wrote: > It does not support the terrible apps/* layout directly, but it's easily > done using a top-level Makefile like the one that was posted in that other > thread earlier today: https://gist.github.com/RJ/6977165 > There's nothing terrible for that layout. It's in fact the one used by OTP itself (replace 'apps' by 'lib' as a name). It's, in my opinion, the most logical structure to build releases where you have many applications that you manage yourself. How weird would OTP be as a release if it had that structure? bin/ bootstrap/ erts/ lib/ asn1 common_test ... make/ plt/ src/ stdlib.app system/ ... It just doesn't always make sense to have one top-level application be set apart in a system. The moment you own two specific apps that may run at the top level, whatever they might be, the apps/* layout starts making sense, especially when the project is still too small to warrant having a separate repository just to build releases in (the way Basho does it for Riak, more or less). The real pain with it at this point is in the poor support from tools. I gave the example of running the CT suites with rebar of all apps in apps/ yesterday in IRC. This requires calling 'rebar ct -r skip_deps=true' to make the command recursive, but ignoring deps when running it. It's less than optimal, but at least works. Figuring it out is non-trivial, however! In general, none of the Erlang build tool really make it easy to distinguish between apps I use and never touch (say, cowboy, jsx, erlsom, etc.) and apps I use and will keep on modifying all the time (two or three apps I own and may be developing together in a system). Tools (read: rebar, erlang.mk) more or less just assume you're gonna build everything from a single top-level OTP app, every time, whether it's a release or not. Older tools like Sinan didn't, but they lost to convenience over time. Regards, Fred. From mononcqc@REDACTED Thu Apr 10 14:42:44 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 10 Apr 2014 08:42:44 -0400 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: <20140409165004.GC19145@ferdair.local> References: <20140409165004.GC19145@ferdair.local> Message-ID: <20140410124242.GE19145@ferdair.local> I'm gonna reply to myself here to let people know that I've also just pushed erlang-history so that it works with 17.0 also. https://github.com/ferd/erlang-history Enjoy! On 04/09, Fred Hebert wrote: > For the people interested, here's a bonus LYSE chapter on Maps: > http://learnyousomeerlang.com/maps > > Regards, > Fred. > > On 04/09, Kenneth Lundin wrote: > > Erlang/OTP 17.0 has been released. > > > > Erlang/OTP 17.0 is a new major release with new features, characteristics > > improvements, as well as some minor incompatibilities. > > > > Some highlights of the release are: > > > > - Erlang/OTP has been ported to the realtime operating system OSE. > > - Maps, a new dictionary data type (experimental) > > - A more natural mapping from ASN.1 OCTET STRING and BIT STRING to > > Erlang types, and other ASN.1 improvements and optimizations > > - The {active, N} socket option for TCP, UDP, and SCTP > > - A new (optional) scheduler utilization balancing mechanism > > - Migration of memory carriers has been enabled by default on all ERTS > > internal memory allocators > > - Increased garbage collection tenure rate > > - Experimental "dirty schedulers" functionality > > - Funs can now be given names > > - Miscellaneous unicode support enhancements > > - A new version scheme for OTP its applications has been introduced > > > > You can find the README file with more detailed info at > > http://www.erlang.org/download/otp_src_17.0.readme > > > > You can download the full source distribution from > > http://www.erlang.org/download/otp_src_17.0.tar.gz > > > > Note: To unpack the TAR archive you need a GNU TAR compatible program. For > > installation instructions please read the README that is part of the > > distribution. > > > > You can also find this release at the official Erlang/OTP Git-repository at > > Github here: https://github.com/erlang/otp tagged "OTP-17.0" > > > > The Windows binary distribution can be downloaded from > > > > http://www.erlang.org/download/otp_win32_17.0.exe > > > > http://www.erlang.org/download/otp_win64_17.0.exe > > > > You can also download the complete HTML documentation or the Unix manual > > files > > > > http://www.erlang.org/download/otp_doc_html_17.0.tar.gz > > http://www.erlang.org/download/otp_doc_man_17.0.tar.gz > > > > We also want to thank those that sent us patches, suggestions and bug > > reports. > > > > The Erlang/OTP Team at Ericsson > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > From davidnwelton@REDACTED Thu Apr 10 16:12:10 2014 From: davidnwelton@REDACTED (David Welton) Date: Thu, 10 Apr 2014 16:12:10 +0200 Subject: [erlang-questions] Reusing servers in a new supervision tree In-Reply-To: <566BC1E4-AD43-46FA-842C-372F625AC19E@gmail.com> References: <566BC1E4-AD43-46FA-842C-372F625AC19E@gmail.com> Message-ID: > On another hand if you have processes A, B, C, D, E and F but B, D and F form a functional subsystem. > Would it make sense to run them behind own supervisor? Thus, you can configure run time to switch on / off subsystem by starting stopping supervisors. Well, in the "testing" mode, the supervision tree really isn't as important as in production mode - we just need all the executables that are behind the erlang services up and running. So far it looks like using terminate_child to swap modes is the easiest thing... I just wanted to check and see if the idea was not completely abhorrent to right minded Erlang programmers. Thank you -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From g@REDACTED Thu Apr 10 17:55:44 2014 From: g@REDACTED (Garrett Smith) Date: Thu, 10 Apr 2014 17:55:44 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <20140410120159.GC22866@ferdmbp.local> References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> Message-ID: On Thu, Apr 10, 2014 at 2:02 PM, Fred Hebert wrote: > On 04/10, Lo?c Hoguin wrote: >> It does not support the terrible apps/* layout directly, but it's easily >> done using a top-level Makefile like the one that was posted in that other >> thread earlier today: https://gist.github.com/RJ/6977165 > > There's nothing terrible for that layout. It's in fact the one used by > OTP itself (replace 'apps' by 'lib' as a name). Meh, I've never looked at the source tree for OTP and said, "boy, I wish *my* project was this big and complex" :) Nothing against OTP -- things over time get big and complex. But I'm looking for some practical ways to curb this... > It's, in my opinion, the most logical structure to build releases where > you have many applications that you manage yourself. How weird would OTP > be as a release if it had that structure? > > bin/ > bootstrap/ > erts/ > lib/ > asn1 > common_test > ... > make/ > plt/ > src/ > stdlib.app > system/ > ... > > It just doesn't always make sense to have one top-level application be > set apart in a system. The moment you own two specific apps that may run > at the top level, whatever they might be, the apps/* layout starts > making sense, especially when the project is still too small to warrant > having a separate repository just to build releases in (the way Basho > does it for Riak, more or less). I've historically thought along this line as well -- anything "big" ought to have a lib/apps top level dir under which the apps live. But I've been thinking differently recently. I'm not settled yet, but I'm experimenting with this approach: | Always keep an app in a separate repo and let the rebar/erlang.mk | approach stitch apps together, regardless of how big the things gets. Many folks here will reject this out of hand, claiming that the overhead of dealing with one-app-per-repo is crazy on its face. Maybe, but I'm trying it because I think there's some upside: - A separate app per repo helps isolate it from others This is more than code organization. Separate apps are easier to stitch together in interesting combinations. The "repo" has proven itself as a suitable container for consumption by Erlang build tools. I want to see the point this breaks down in real life and what specific problems arise (rather than my theoretical objections). If anyone has experiences here, I'm very interested to learn from them. - Big apps just keep getting bigger We (CloudBees) have a decent sized project with over 20 apps. It's hard to use the apps outside of it and this problem only gets worse over time. Is it really too big to be managed using the one-app-per-repo pattern? Dunno, but I'm curious. - The extra cost could be a benefit - a "sin tax" Raising the price of creating a new app will slow new app creation -- programmers will think just a little more about going down that road. The "never duplicate code" religion gets a little poke in the eye -- it's not as easy to willy nilly break something into a "shared library" simply to consolidate code. Same goes for the cost of creating a dependency. When using the one-repo-per-app trick, I satisfy dependencies on other local apps by creating symlinks under "deps". This satisfies erlang.mk real good and seamlessly propagates changes. Code commits are trickier because I need to cd across apps. I have to be careful to commit and push changes, lest they get lost in the sea of peers. So far I haven't found this terrible but haven't seen it at scale yet. Garrett From essen@REDACTED Thu Apr 10 17:59:39 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Thu, 10 Apr 2014 17:59:39 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <1397144114.400931191@apps.rackspace.com> References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> <1397144114.400931191@apps.rackspace.com> Message-ID: <5346BFEB.3000708@ninenines.eu> On 04/10/2014 05:35 PM, lloyd@REDACTED wrote: > Hi Lo?c, > >> It does not support the terrible apps/* layout directly > > What, then, is a better way to organize/build a large project with multiple applications? One application per repository. Most of your development at any one time should only touch a single application. If that is not the case, then you should probably consider making these inter-dependent applications a single application. Working on a single application at a time brings a lot of advantages: * You can work on them separately * You do not have to worry about keeping compatibility with the rest of the system all the time, you can use tags for that and only focus on compatibility when you update your release * You will be able to test/benchmark/dialyze/.. applications individually instead of testing only your system (but doing both is important); you can also do it with apps/* layout, but it's too easy not to * It's easier to reason about a smaller unit than "the whole system" -- Lo?c Hoguin http://ninenines.eu From essen@REDACTED Thu Apr 10 18:05:49 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Thu, 10 Apr 2014 18:05:49 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <20140410120159.GC22866@ferdmbp.local> References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> Message-ID: <5346C15D.60003@ninenines.eu> > It just doesn't always make sense to have one top-level application be > set apart in a system. You don't have to, you can have a repository for the release itself, and then one repository per application. If you have a big system this is definitely something you should do as it will also allow you to keep the system tests/docs independent from the app tests/docs a lot more easily. -- Lo?c Hoguin http://ninenines.eu From mloftis@REDACTED Thu Apr 10 18:14:05 2014 From: mloftis@REDACTED (Michael Loftis) Date: Thu, 10 Apr 2014 09:14:05 -0700 Subject: [erlang-questions] Store maps in ets/dets? In-Reply-To: References: Message-ID: On Thu, Apr 10, 2014 at 2:09 AM, Jesper Louis Andersen wrote: > The semantics of maps is that of a persistent data type. ETS is ephemeral. > So the fit is not good. Furthermore, maps are living int he process heap and > thus, they are automatically garbage collected. ETS is manually collected in > contrast. So the fit is even worse. > I think you might mean the opposite here....that maps is ephemeral and ETS is persistent (or can be persistent using DETS anyway) > Maps currently has no order (based on maps:map/2 and maps:fold/3), which > means they can be implemented as HAMTs (like in Clojure) once they grow > large. This has very good runtime behaviour, while keeping the process > semantics intact. The other option is to give maps order, but then we can't > use digital searching techniques anymore and must resort to balanced search > trees, e.g., AVL or RB trees and friends. > > The current representation is very memory efficient however. It will > probably be very good for small maps with a keyset that doesn't change. > > > On Thu, Apr 10, 2014 at 10:41 AM, Max Lapshin wrote: >> >> Maybe I have missed something and failed to google this info, but are >> there any plans to store maps in ets? >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > > -- > J. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- "Genius might be described as a supreme capacity for getting its possessors into trouble of all kinds." -- Samuel Butler From egil@REDACTED Thu Apr 10 18:33:38 2014 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Thu, 10 Apr 2014 18:33:38 +0200 Subject: [erlang-questions] Store maps in ets/dets? In-Reply-To: References: Message-ID: <5346C7E2.2050209@erlang.org> On 2014-04-10 18:14, Michael Loftis wrote: > On Thu, Apr 10, 2014 at 2:09 AM, Jesper Louis Andersen > wrote: >> The semantics of maps is that of a persistent data type. ETS is ephemeral. >> So the fit is not good. Furthermore, maps are living int he process heap and >> thus, they are automatically garbage collected. ETS is manually collected in >> contrast. So the fit is even worse. >> > I think you might mean the opposite here....that maps is ephemeral and > ETS is persistent (or can be persistent using DETS anyway) I don't like the word ephemeral here =) Persistent is used all over to describe Maps as immutable. Though if you have a database background the meaning of "persistent" is of course another. Describing ETS as persistent is stretching it a bit far. Maps are copied on update (atleast the values are copied) i.e. Maps are immutable and in some circles this is equivalent to persistent. // Bj?rn-Egil > >> Maps currently has no order (based on maps:map/2 and maps:fold/3), which >> means they can be implemented as HAMTs (like in Clojure) once they grow >> large. This has very good runtime behaviour, while keeping the process >> semantics intact. The other option is to give maps order, but then we can't >> use digital searching techniques anymore and must resort to balanced search >> trees, e.g., AVL or RB trees and friends. >> >> The current representation is very memory efficient however. It will >> probably be very good for small maps with a keyset that doesn't change. >> >> >> On Thu, Apr 10, 2014 at 10:41 AM, Max Lapshin wrote: >>> Maybe I have missed something and failed to google this info, but are >>> there any plans to store maps in ets? >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> >> >> -- >> J. >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > From g@REDACTED Thu Apr 10 18:34:08 2014 From: g@REDACTED (Garrett Smith) Date: Thu, 10 Apr 2014 18:34:08 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <5346C15D.60003@ninenines.eu> References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <5346C15D.60003@ninenines.eu> Message-ID: On Thu, Apr 10, 2014 at 6:05 PM, Lo?c Hoguin wrote: >> It just doesn't always make sense to have one top-level application be >> set apart in a system. > > > You don't have to, you can have a repository for the release itself, and > then one repository per application. If you have a big system this is > definitely something you should do as it will also allow you to keep the > system tests/docs independent from the app tests/docs a lot more easily. FWIW, this model has proven itself to scale very well for operating system packaging schemes. I'm very careful to say this, but Lo?c might just be right on this one. Garrett From jesper.louis.andersen@REDACTED Thu Apr 10 18:36:17 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 10 Apr 2014 18:36:17 +0200 Subject: [erlang-questions] Store maps in ets/dets? In-Reply-To: References: Message-ID: On Thu, Apr 10, 2014 at 6:14 PM, Michael Loftis wrote: > I think you might mean the opposite here....that maps is ephemeral and > ETS is persistent (or can be persistent using DETS anyway) > Actually not. Two things to address though: Max might have asked if you can store maps in ets: 5> ets:new(foo, [named_table]). foo 6> ets:insert(foo, {#{a => 3, b => 4}}). true 7> ets:match_object(foo, '_'). [{#{a => 3,b => 4}}] 8> ets:insert(foo, #{'not' => possible}). ** exception error: bad argument in function ets:insert/2 called as ets:insert(foo,#{'not' => possible}) and the answer is that you can, but the topmost entry must be a tuple as the example shows. The other thing is about persistent vs ephemeral data structures. http://en.wikipedia.org/wiki/Persistent_data_structure Maps are persistent, but ETS in general is not. It is ephemeral according to the wikipedia definition. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Thu Apr 10 17:35:14 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Thu, 10 Apr 2014 11:35:14 -0400 (EDT) Subject: [erlang-questions] =?utf-8?q?how_do_you_build_your_releases_with/?= =?utf-8?q?without_rebar=3F?= In-Reply-To: <53466491.2010301@ninenines.eu> References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> Message-ID: <1397144114.400931191@apps.rackspace.com> Hi Lo?c, > It does not support the terrible apps/* layout directly What, then, is a better way to organize/build a large project with multiple applications? Thanks, LRP -----Original Message----- From: "Lo?c Hoguin" Sent: Thursday, April 10, 2014 5:29am To: "Benoit Chesneau" Cc: "erlang-questions@REDACTED" Subject: Re: [erlang-questions] how do you build your releases with/without rebar? > Using erlang.mk : > > 1. fetch the dependeinces using curl and some links you have in a file > or such thing > 2. compile, but not sure if every apps in apps/* are compiled > 3. use relx or anything else to buld the relese Have you read the readme? It's the same logic as rebar, except you put deps in your Makefile instead of rebar.config. After that, you simply type "make" and it does the fetching, compiling and even builds the release if there is a relx.config file. It does not support the terrible apps/* layout directly, but it's easily done using a top-level Makefile like the one that was posted in that other thread earlier today: https://gist.github.com/RJ/6977165 -- Lo?c Hoguin http://ninenines.eu _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions From lloyd@REDACTED Thu Apr 10 17:46:38 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Thu, 10 Apr 2014 11:46:38 -0400 (EDT) Subject: [erlang-questions] =?utf-8?q?how_do_you_build_your_releases_with/?= =?utf-8?q?without_rebar=3F?= In-Reply-To: <20140410120159.GC22866@ferdmbp.local> References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> Message-ID: <1397144798.86949356@apps.rackspace.com> Hi Fred, > In general, none of the Erlang build tool really make it easy to > distinguish between apps I use and never touch (say, cowboy, jsx, > erlsom, etc.) and apps I use and will keep on modifying all the time > (two or three apps I own and may be developing together in a system). As a know-little relative noobie just beginning to struggle with these issues, I can only say at this point that my head hurts. Oh how I wish that an Erlang guru would write and publish the definitive tutorial on how to organize and build a large Erlang project in simple, easy-to-understand language. All the best, LRP -----Original Message----- From: "Fred Hebert" Sent: Thursday, April 10, 2014 8:02am To: "Lo?c Hoguin" Cc: "erlang-questions@REDACTED" Subject: Re: [erlang-questions] how do you build your releases with/without rebar? On 04/10, Lo?c Hoguin wrote: > It does not support the terrible apps/* layout directly, but it's easily > done using a top-level Makefile like the one that was posted in that other > thread earlier today: https://gist.github.com/RJ/6977165 > There's nothing terrible for that layout. It's in fact the one used by OTP itself (replace 'apps' by 'lib' as a name). It's, in my opinion, the most logical structure to build releases where you have many applications that you manage yourself. How weird would OTP be as a release if it had that structure? bin/ bootstrap/ erts/ lib/ asn1 common_test ... make/ plt/ src/ stdlib.app system/ ... It just doesn't always make sense to have one top-level application be set apart in a system. The moment you own two specific apps that may run at the top level, whatever they might be, the apps/* layout starts making sense, especially when the project is still too small to warrant having a separate repository just to build releases in (the way Basho does it for Riak, more or less). The real pain with it at this point is in the poor support from tools. I gave the example of running the CT suites with rebar of all apps in apps/ yesterday in IRC. This requires calling 'rebar ct -r skip_deps=true' to make the command recursive, but ignoring deps when running it. It's less than optimal, but at least works. Figuring it out is non-trivial, however! In general, none of the Erlang build tool really make it easy to distinguish between apps I use and never touch (say, cowboy, jsx, erlsom, etc.) and apps I use and will keep on modifying all the time (two or three apps I own and may be developing together in a system). Tools (read: rebar, erlang.mk) more or less just assume you're gonna build everything from a single top-level OTP app, every time, whether it's a release or not. Older tools like Sinan didn't, but they lost to convenience over time. Regards, Fred. _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions From mononcqc@REDACTED Thu Apr 10 19:52:05 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 10 Apr 2014 13:52:05 -0400 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> Message-ID: <20140410175204.GH19145@ferdair.local> On 04/10, Garrett Smith wrote: > > - A separate app per repo helps isolate it from others > That works well, unless the apps are tightly related to each other, but still warrant different supervision strategies, configurations, etc. My apps are already well isolated based on having a bunch of processes and whatnot. I need to isolate code and state, not necessarily development. One example of this is when I have 3 apps: my reporting UI, my web front-end, and my application that manages the data model for my app. When I change the data model for my app (I'm adding a new field!), the change will likely need to be reflected in the reporting UI and the web front-end, whether it is through calling convention, type specs, etc. These 3 apps do vastly different things, warrant their own OTP app (I can restart, kill, upgrade the reporting UI without touching the two others, for example), but their development cycle and the decision making that goes behind them is still vastly similar and tightly bound to the team that operates the project. If there are three separate apps in 3 repos, I've successfully helped separate them all, but I now need to have a pull request (or whatever equivalent) for the model app, for the reporting UI, and for the web front-end. Then if I'm using releases, I need a 4th pull request to fetch from the new branches from the 3 other apps to send it to staging, for example. Then I need to merge them together in the right order, do my code reviews across repositories to see if the approach is coherent, and so on. If there was an error? Time to start over. Now if I'm using 3 apps within the same repo, they are still isolated in terms of code, manipulations, updates, abstraction, but the development process to deal with them is a lot simpler: make a fork with all the changes done at once. Deploy that one, merge it in as one unit. The changes are related together anyway. Rollback the entire set at once if there's an issue. Code isolation is good. When that code isolation is done with the cost of making reasoning about your code harder, or with the cost of dictating your team's workflow, you have to think about it harder. It's possible the price is worth it in the long run, in fact it's even likely. If you end up having to pay that price purely because the build tool you settled for was opinionated about whether the apps in the apps/ or lib/ directory need to be checked out from other repositories or if they can be in there already, fix that build tool of yours, because it's clearly making decisions it should not be making. What's more important is that a tool that supports both the apps/* and the OTP app model can be able to also support *both* of these workflows (using deps or not to build the release), depending on which is appropriate for your project, team, and/or community. Denying people a way to organize their own workflow because of your personal opinion when the end result for the files on disk is the exact same (someone just disagrees about how they ended up there), to me, tells me that maybe your tool is a bit too opinionated and may need to take a step back. > > - Big apps just keep getting bigger > Fine, you can migrate when the need arises. It's not hard to move OTP apps out of apps/* and into their own repo *when you need to*. > > - The extra cost could be a benefit - a "sin tax" > Note that for organizations or contractors that have limited budgets and want to host private repositories, it also has a literal dollar cost that might be something you want to avoid. There is a place for multiple apps in multiple repos (most of the larger projects I work on end up being that way) -- and to then only make a release by fetching deps in a release-building repository. This place is not everywhere, though. Regards, Fred. From essen@REDACTED Thu Apr 10 20:10:34 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Thu, 10 Apr 2014 20:10:34 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <20140410175204.GH19145@ferdair.local> References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> Message-ID: <5346DE9A.20402@ninenines.eu> Just want to make sure one thing is clear. On 04/10/2014 07:52 PM, Fred Hebert wrote: > If you end up having to pay that price purely because the build tool you > settled for was opinionated about whether the apps in the apps/ or lib/ > directory need to be checked out from other repositories or if they can > be in there already, fix that build tool of yours, because it's > clearly making decisions it should not be making. > > What's more important is that a tool that supports both the apps/* and > the OTP app model can be able to also support *both* of these workflows > (using deps or not to build the release), depending on which is > appropriate for your project, team, and/or community. > > Denying people a way to organize their own workflow because of your > personal opinion when the end result for the files on disk is the exact > same (someone just disagrees about how they ended up there), to me, > tells me that maybe your tool is a bit too opinionated and may need to > take a step back. With regards to erlang.mk, there's nothing to fix. There's nothing it does that prevent you from using the apps/* layout. There's nothing in it that makes it all happen for you either, because that's simply not the goal of the tool. But it can still fit very easily in an apps/* layout, as demonstrated by the gist previously posted. IRCCloud is one such big project that uses both erlang.mk and an apps/* layout, all without any problems AFAIK. erlang.mk will always focus on one OTP application because that's what it's designed to do well. Making it work on two different scopes just makes everything harder, and then you end up with nonsense like "rebar ct compile -r skip_deps=true" (quoting you) to make it do what you want. I do not want that. On the other hand I want to give greater power to the user to override or complement the default behavior, and that alongside Windows support is most of the work that remains to be done for erlang.mk 1.0. (Not that you can't change its behavior already -it's a text file after all!- but I want to make it even simpler.) tl;dr Do one thing and do it well; do it right by default but allow overriding its behavior easily. -- Lo?c Hoguin http://ninenines.eu From essen@REDACTED Thu Apr 10 20:16:08 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Thu, 10 Apr 2014 20:16:08 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <5346DE9A.20402@ninenines.eu> References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> Message-ID: <5346DFE8.4090406@ninenines.eu> Another clarification. On 04/10/2014 08:10 PM, Lo?c Hoguin wrote: > Just want to make sure one thing is clear. > > On 04/10/2014 07:52 PM, Fred Hebert wrote: >> If you end up having to pay that price purely because the build tool you >> settled for was opinionated about whether the apps in the apps/ or lib/ >> directory need to be checked out from other repositories or if they can >> be in there already, fix that build tool of yours, because it's >> clearly making decisions it should not be making. >> >> What's more important is that a tool that supports both the apps/* and >> the OTP app model can be able to also support *both* of these workflows >> (using deps or not to build the release), depending on which is >> appropriate for your project, team, and/or community. >> >> Denying people a way to organize their own workflow because of your >> personal opinion when the end result for the files on disk is the exact >> same (someone just disagrees about how they ended up there), to me, >> tells me that maybe your tool is a bit too opinionated and may need to >> take a step back. > > With regards to erlang.mk, there's nothing to fix. There's nothing it > does that prevent you from using the apps/* layout. There's nothing in > it that makes it all happen for you either, because that's simply not > the goal of the tool. But it can still fit very easily in an apps/* > layout, as demonstrated by the gist previously posted. IRCCloud is one > such big project that uses both erlang.mk and an apps/* layout, all > without any problems AFAIK. > > erlang.mk will always focus on one OTP application because that's what > it's designed to do well. Making it work on two different scopes just > makes everything harder, and then you end up with nonsense like "rebar > ct compile -r skip_deps=true" (quoting you) to make it do what you want. > I do not want that. On the other hand I want to give greater power to "I do not want that" refers to supporting the two scopes in erlang.mk itself. It is of course very easy to have two different scopes that do exactly what you want by simply having one Makefile at the top-level and one Makefile for each application. There's nothing preventing you to achieve that in a clean manner. I will not provide a .mk file for the apps/* layout because I do not use it and have no idea what it should do, but I probably would accept a community supported "apps/* layout" file in the repository. As long as it's in a contrib/ directory or something of course. > the user to override or complement the default behavior, and that > alongside Windows support is most of the work that remains to be done > for erlang.mk 1.0. (Not that you can't change its behavior already -it's > a text file after all!- but I want to make it even simpler.) > > tl;dr Do one thing and do it well; do it right by default but allow > overriding its behavior easily. -- Lo?c Hoguin http://ninenines.eu From mononcqc@REDACTED Thu Apr 10 20:22:19 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 10 Apr 2014 14:22:19 -0400 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <5346DFE8.4090406@ninenines.eu> References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> Message-ID: <20140410182218.GI19145@ferdair.local> That's all fine by me too. As I said, the apps/* layout is a layout I'd love to see get better support overall (I am mostly using rebar, which does a lot of things halfway for that pattern, and relx, which does it right). I'm in no position to tell tool builders what to do or how to write their code -- I'm free to go around and fix it myself. If erlang.mk allows to override behavior (you did mention using a top-level makefile to make things work), that's usually good enough and will let people fix things the way they need it. Rebar makes it more complex because of how it builds its list of path for transient deps (it needs to go down the directories recursively, as with a 'compile' command or by specifying -r) -- which often conflicts with running commands within a single directory (apps/ but not deps/). This is what requires, for CT, calling 'rebar ct -r skip_deps=true', which is far from obvious. But I felt like I should defend the directory structure I feel makes the more sense for release-building, and therefore that I would like to see love given for from tool builders :) Regards, Fred. On 04/10, Lo?c Hoguin wrote: > Another clarification. > > On 04/10/2014 08:10 PM, Lo?c Hoguin wrote: > >Just want to make sure one thing is clear. > > > >On 04/10/2014 07:52 PM, Fred Hebert wrote: > >>If you end up having to pay that price purely because the build tool you > >>settled for was opinionated about whether the apps in the apps/ or lib/ > >>directory need to be checked out from other repositories or if they can > >>be in there already, fix that build tool of yours, because it's > >>clearly making decisions it should not be making. > >> > >>What's more important is that a tool that supports both the apps/* and > >>the OTP app model can be able to also support *both* of these workflows > >>(using deps or not to build the release), depending on which is > >>appropriate for your project, team, and/or community. > >> > >>Denying people a way to organize their own workflow because of your > >>personal opinion when the end result for the files on disk is the exact > >>same (someone just disagrees about how they ended up there), to me, > >>tells me that maybe your tool is a bit too opinionated and may need to > >>take a step back. > > > >With regards to erlang.mk, there's nothing to fix. There's nothing it > >does that prevent you from using the apps/* layout. There's nothing in > >it that makes it all happen for you either, because that's simply not > >the goal of the tool. But it can still fit very easily in an apps/* > >layout, as demonstrated by the gist previously posted. IRCCloud is one > >such big project that uses both erlang.mk and an apps/* layout, all > >without any problems AFAIK. > > > >erlang.mk will always focus on one OTP application because that's what > >it's designed to do well. Making it work on two different scopes just > >makes everything harder, and then you end up with nonsense like "rebar > >ct compile -r skip_deps=true" (quoting you) to make it do what you want. > >I do not want that. On the other hand I want to give greater power to > > "I do not want that" refers to supporting the two scopes in erlang.mk > itself. It is of course very easy to have two different scopes that do > exactly what you want by simply having one Makefile at the top-level and one > Makefile for each application. There's nothing preventing you to achieve > that in a clean manner. > > I will not provide a .mk file for the apps/* layout because I do not use it > and have no idea what it should do, but I probably would accept a community > supported "apps/* layout" file in the repository. As long as it's in a > contrib/ directory or something of course. > > >the user to override or complement the default behavior, and that > >alongside Windows support is most of the work that remains to be done > >for erlang.mk 1.0. (Not that you can't change its behavior already -it's > >a text file after all!- but I want to make it even simpler.) > > > >tl;dr Do one thing and do it well; do it right by default but allow > >overriding its behavior easily. > > -- > Lo?c Hoguin > http://ninenines.eu From eriksoe@REDACTED Fri Apr 11 00:28:15 2014 From: eriksoe@REDACTED (=?ISO-8859-1?Q?Erik_S=F8e_S=F8rensen?=) Date: Fri, 11 Apr 2014 00:28:15 +0200 Subject: [erlang-questions] Reusing servers in a new supervision tree In-Reply-To: References: <566BC1E4-AD43-46FA-842C-372F625AC19E@gmail.com> Message-ID: Do you need a supervision tree at all - or could you start the servers "manually"? What kind of test is it - unit tests or some larger test? You could let the _sup module (or for that matter _app) choose a different structure based on whether the system's in testing mode, and/or you could "-ifdef" the behavior to be different (this could pay well with e.g. eunit, which defines TEST). I've built systems where the set of server processes in an application vary depending on what parts are configured in the .config file. That's fairly easy to do in _sup/_app. Den 10/04/2014 16.12 skrev "David Welton" : > > On another hand if you have processes A, B, C, D, E and F but B, D and F > form a functional subsystem. > > Would it make sense to run them behind own supervisor? Thus, you can > configure run time to switch on / off subsystem by starting stopping > supervisors. > > Well, in the "testing" mode, the supervision tree really isn't as > important as in production mode - we just need all the executables > that are behind the erlang services up and running. So far it looks > like using terminate_child to swap modes is the easiest thing... I > just wanted to check and see if the idea was not completely abhorrent > to right minded Erlang programmers. > > Thank you > -- > David N. Welton > > http://www.welton.it/davidw/ > > http://www.dedasys.com/ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mloftis@REDACTED Fri Apr 11 01:49:22 2014 From: mloftis@REDACTED (Michael Loftis) Date: Thu, 10 Apr 2014 16:49:22 -0700 Subject: [erlang-questions] Store maps in ets/dets? In-Reply-To: <5346C7E2.2050209@erlang.org> References: <5346C7E2.2050209@erlang.org> Message-ID: On Thu, Apr 10, 2014 at 9:33 AM, Bj?rn-Egil Dahlberg wrote: > On 2014-04-10 18:14, Michael Loftis wrote: >> I think you might mean the opposite here....that maps is ephemeral and >> ETS is persistent (or can be persistent using DETS anyway) > > > I don't like the word ephemeral here =) > > Persistent is used all over to describe Maps as immutable. Though if you > have a database background the meaning of "persistent" is of course another. > Describing ETS as persistent is stretching it a bit far. > > Maps are copied on update (atleast the values are copied) i.e. Maps are > immutable and in some circles this is equivalent to persistent. Immutable is definitely the word...ephemeral definitely isn't the best fit - and they're most definitely not persistent if they're in-process. From demeshchuk@REDACTED Fri Apr 11 02:02:42 2014 From: demeshchuk@REDACTED (Dmitry Demeshchuk) Date: Thu, 10 Apr 2014 17:02:42 -0700 Subject: [erlang-questions] Abusing OTP-8623 for high-priority messages Message-ID: Hi list, Today (yeah, just a couple years have passed since R14A) I learned about OTP-8623, which allows to do selective receive for messages that contain a known reference with O(1) complexity. Which made me think: what if we make a gen_server'ish process that: 1. Creates a reference that is being passed along with the pid, meaning, our start_link returns {ok, {Pid, ManageRef}} or something like that. ManageRef is actually created within the new process inside init/1 or such. 2. Introduce an operation named priority_call, which, basically, sends something like {ManageRef, {Pid, Ref}, Msg}. 3. The process itself (on its own side) does a selective receive like that: receive {ManageRef, From, Msg} -> handle_call(From, Msg, State) after 0 -> receive Msg -> gen_server_like_dispatch_msg(Msg) end end This could potentially help with sending managing messages to the processes that may have overloaded inbox with thousands of messages. Say, we see that the process gets overloaded and we send an operational message of some kind ("discard the entire inbox", for example). Thoughts? -- Best regards, Dmitry Demeshchuk -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Fri Apr 11 02:24:54 2014 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 10 Apr 2014 17:24:54 -0700 Subject: [erlang-questions] Abusing OTP-8623 for high-priority messages In-Reply-To: References: Message-ID: <53473656.3010902@gmail.com> On 04/10/2014 05:02 PM, Dmitry Demeshchuk wrote: > Hi list, > > Today (yeah, just a couple years have passed since R14A) I learned about OTP-8623, which allows to do selective receive for messages that contain a known reference with O(1) complexity. > > Which made me think: what if we make a gen_server'ish process that: > 1. Creates a reference that is being passed along with the pid, meaning, our start_link returns {ok, {Pid, ManageRef}} or something like that. ManageRef is actually created within the new process inside init/1 or such. > 2. Introduce an operation named priority_call, which, basically, sends something like {ManageRef, {Pid, Ref}, Msg}. > 3. The process itself (on its own side) does a selective receive like that: > > receive > {ManageRef, From, Msg} -> handle_call(From, Msg, State) > after 0 -> > receive > Msg -> gen_server_like_dispatch_msg(Msg) > end > end > > This could potentially help with sending managing messages to the processes that may have overloaded inbox with thousands of messages. Say, we see that the process gets overloaded and we send an operational message of some kind ("discard the entire inbox", for example). > > Thoughts? You could get this interaction by creating an internal service with CloudI (http://cloudi.org). That means you just use the cloudi_service behaviour for the service request receiver. You can use the cloudi module to send from normal Erlang pids, or use the cloudi_service behaviour to send from a second internal service. Every CloudI service requests provides a unique v1 UUID to identify the service request, a priority (defaulting to 0, but between -128 (high) and 127 (low), inclusive), and the source Erlang pid, in addition to the two payloads RequestInfo and Request (where RequestInfo is generally key/value message meta-data and Request is the main data, both are any type when used with internal services). The priority of the service request impacts the queuing of the received service request, to determine the order service requests get processed by a service. There is a queue_limit service configuration option which can be provided for any CloudI service to limit the number of pending service requests (i.e. unhandled) that may be stored (http://cloudi.org/api.html#2_services_add). So, the same use-case you have described with added features that includes details for high-availability and partition tolerance. > > -- > Best regards, > Dmitry Demeshchuk > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Fri Apr 11 04:28:23 2014 From: zxq9@REDACTED (zxq9) Date: Fri, 11 Apr 2014 11:28:23 +0900 Subject: [erlang-questions] Abusing OTP-8623 for high-priority messages In-Reply-To: <53473656.3010902@gmail.com> References: <53473656.3010902@gmail.com> Message-ID: <8246312.lygyUFqWVV@jalapeno> On Thursday 10 April 2014 17:24:54 Michael Truog wrote: > On 04/10/2014 05:02 PM, Dmitry Demeshchuk wrote: > > Hi list, > > > > Today (yeah, just a couple years have passed since R14A) I learned about > > OTP-8623, which allows to do selective receive for messages that contain > > a known reference with O(1) complexity. ... > > This could potentially help with sending managing messages to the > > processes that may have overloaded inbox with thousands of messages. Say, > > we see that the process gets overloaded and we send an operational > > message of some kind ("discard the entire inbox", for example). > > > > Thoughts? > > You could get this interaction by creating an internal service with CloudI > (http://cloudi.org). Not so sure this is what the OP was getting at. "Is OTP8623 a lightweight way to overcome a clogged queue?" /= "Base everything you do on some new service stack" From demeshchuk@REDACTED Fri Apr 11 05:56:15 2014 From: demeshchuk@REDACTED (Dmitry Demeshchuk) Date: Thu, 10 Apr 2014 20:56:15 -0700 Subject: [erlang-questions] Abusing OTP-8623 for high-priority messages In-Reply-To: <8246312.lygyUFqWVV@jalapeno> References: <53473656.3010902@gmail.com> <8246312.lygyUFqWVV@jalapeno> Message-ID: Well, actually, if Michael pointed me at a module that handles that and it was something similar, that could have been helpful :) But, judging by the priorities from -128 to 127, it's probably a manual filter of some kind, probably with an intermediate mailbox-reducer process. Which is fine, actually, but my question wasn't "how to handle huge queues?", but "is using OTP-8623 for that an anti-pattern of some sort?". And yeah, definitely not "what platform should I use?". On Thu, Apr 10, 2014 at 7:28 PM, zxq9 wrote: > On Thursday 10 April 2014 17:24:54 Michael Truog wrote: > > On 04/10/2014 05:02 PM, Dmitry Demeshchuk wrote: > > > Hi list, > > > > > > Today (yeah, just a couple years have passed since R14A) I learned > about > > > OTP-8623, which allows to do selective receive for messages that > contain > > > a known reference with O(1) complexity. > ... > > > This could potentially help with sending managing messages to the > > > processes that may have overloaded inbox with thousands of messages. > Say, > > > we see that the process gets overloaded and we send an operational > > > message of some kind ("discard the entire inbox", for example). > > > > > > Thoughts? > > > > You could get this interaction by creating an internal service with > CloudI > > (http://cloudi.org). > > Not so sure this is what the OP was getting at. > > "Is OTP8623 a lightweight way to overcome a clogged queue?" /= "Base > everything you do on some new service stack" > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Best regards, Dmitry Demeshchuk -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjollnir.ray@REDACTED Fri Apr 11 06:30:02 2014 From: mjollnir.ray@REDACTED (Wu Ray) Date: Fri, 11 Apr 2014 12:30:02 +0800 Subject: [erlang-questions] Cannot build a work vm on FreeBSD with dtrace AND enable dirty-schedulers Message-ID: Hi, list I cannot build a working erlang 17 on FreeBSD 10.0, with dtrace AND enabled dirty-schedulers at the same time, that's my steps: ./configure --with-dynamic-trace=dtrace --enable-dirty-schedulers gmake then, the build erl vm just quit with: Segmentation fault(core dumped) I've tried gcc47, same result. CC=gcc47 CXX=g++47 ./configure --with-dynamic-trace=dtrace --enable-dirty-schedulers if I build with-dtrace OR enable dirty-schedulers separately, the VMs run well. but the dirty-schedulers number looks strange: Erlang/OTP 17 [erts-6.0] [source] [64-bit] [ds:10:5851653:18446744073709551611] [async-threads:38554976] [hipe] [kernel-poll:] Eshell V6.0 (abort with ^G) 1> erlang:system_info(dirty_cpu_schedulers). ** exception error: bad argument in function erlang:system_info/1 called as erlang:system_info(dirty_cpu_schedulers) And, gcc48 cannot build a working VM with enabled dirty-schedulers, the vm quit with Segmentation fault. BTW: my FreeBSD 10.0 is running in VirtualBox 4.3.10 on Ubuntu13.10 regards, -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri Apr 11 06:31:50 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 11 Apr 2014 08:31:50 +0400 Subject: [erlang-questions] Store maps in ets/dets? In-Reply-To: References: <5346C7E2.2050209@erlang.org> Message-ID: I'm asking exactly about ets:insert(web_sessions, #{session_id => <<"1234">>,bytes => 0}). ets:update_counter(web_sessions, <<"1234">>, {bytes, 150}) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Fri Apr 11 07:50:07 2014 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 10 Apr 2014 22:50:07 -0700 Subject: [erlang-questions] Abusing OTP-8623 for high-priority messages In-Reply-To: References: <53473656.3010902@gmail.com> <8246312.lygyUFqWVV@jalapeno> Message-ID: <5347828F.3000100@gmail.com> On 04/10/2014 08:56 PM, Dmitry Demeshchuk wrote: > Well, actually, if Michael pointed me at a module that handles that and it was something similar, that could have been helpful :) > > But, judging by the priorities from -128 to 127, it's probably a manual filter of some kind, probably with an intermediate mailbox-reducer process. The v1 UUID acts as the known reference with O(1) complexity here. The priority is being handled by an Erlang priority queue data structure called pqueue4 since there has to be some queue structure for queuing service requests so that atomic transactions can occur for service requests. This might not have been the priority you had in mind if you were thinking about various pattern matching cases on different priority values, but I have found the approach with a data structure more flexible and useful for the dynamic nature of a service, due to the need for a queue (which enforces the incoming limit, since it is easier than trying to do something error-prone with an Erlang pid directly, i.e., something that would modify the Erlang pid state or try to check it repeatedly). > > Which is fine, actually, but my question wasn't "how to handle huge queues?", but "is using OTP-8623 for that an anti-pattern of some sort?". > > And yeah, definitely not "what platform should I use?". > > > On Thu, Apr 10, 2014 at 7:28 PM, zxq9 > wrote: > > On Thursday 10 April 2014 17:24:54 Michael Truog wrote: > > On 04/10/2014 05:02 PM, Dmitry Demeshchuk wrote: > > > Hi list, > > > > > > Today (yeah, just a couple years have passed since R14A) I learned about > > > OTP-8623, which allows to do selective receive for messages that contain > > > a known reference with O(1) complexity. > ... > > > This could potentially help with sending managing messages to the > > > processes that may have overloaded inbox with thousands of messages. Say, > > > we see that the process gets overloaded and we send an operational > > > message of some kind ("discard the entire inbox", for example). > > > > > > Thoughts? > > > > You could get this interaction by creating an internal service with CloudI > > (http://cloudi.org). > > Not so sure this is what the OP was getting at. > > "Is OTP8623 a lightweight way to overcome a clogged queue?" /= "Base > everything you do on some new service stack" > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -- > Best regards, > Dmitry Demeshchuk > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From nickelchen@REDACTED Fri Apr 11 08:41:46 2014 From: nickelchen@REDACTED (nickel chen) Date: Thu, 10 Apr 2014 23:41:46 -0700 (PDT) Subject: [erlang-questions] =?utf-8?b?5Zue5aSN77yaIGVqYWJiZXJkIHRyYW5zbGF0?= =?utf-8?q?e_crash?= In-Reply-To: <1397114648.17048.YahooMailNeo@web125706.mail.ne1.yahoo.com> References: <1397114648.17048.YahooMailNeo@web125706.mail.ne1.yahoo.com> Message-ID: <1397198506.90976.YahooMailNeo@web125703.mail.ne1.yahoo.com> anyone information, ?please? i'm stucked at this problem. nickel chen ? 2014?4?10?, ???, 3:24 ?? ??? ?Hi all, I'm new to erlang and I'm learning the code of ejabberd 13.12, I already have ejabberd installed, then start it with sudo ejabberdctl start There is a crash message in /var/log/ejabberd.log 2014-04-10 14:37:56.520 [info] <0.7.0> Application ejabberd exited with reason: bad argument in call to erlang:iolist_to_binary([916,953,945,956,972,961,966,969,963,951,32,928,961,972,963,946,945,963,951,962]) in translate:'-load_file/2-fun-2-'/3 line 91 i added some debug info to the source code ` translate.erl` ?and recompile ejabberd. then start it again, below is the debug message: 2014-04-10 14:37:56.517 [info] <0.38.0>@translate:load_file:87 File is: <<"//lib/ejabberd/priv/msgs/el.msg">>, Orig is:"Access Configuration", Trans is: [916,953,945,956,972,961,966,969,963,951,32,928,961,972,963,946,945,963,951,962] well it's clear that there are unicode characters in I18N translation , when passed to?the?erlang:iolist_to_binary/1, it crashed with badarg, because iolist only accepts byte( ) binary( ) and other iolist( ) 9> erlang:iolist_to_binary([256]). ** exception error: bad argument ?? ? in function? iolist_to_binary/1 ? ? ? ? called as iolist_to_binary([256]) 10> erlang:iolist_to_binary([255]). <<"?">> 11>? My question is simple, how to get around with this problem and get ejabberd launched? Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias@REDACTED Fri Apr 11 09:21:16 2014 From: matthias@REDACTED (Matthias Lang) Date: Fri, 11 Apr 2014 09:21:16 +0200 Subject: [erlang-questions] Store maps in ets/dets? In-Reply-To: References: <5346C7E2.2050209@erlang.org> Message-ID: <20140411072116.GA31336@corelatus.com> > On Thu, Apr 10, 2014 at 9:33 AM, Bj?rn-Egil Dahlberg wrote: > > Persistent is used all over to describe Maps as immutable. Though if you > > have a database background the meaning of "persistent" is of course another. ... On Thursday, April 10, Michael Loftis wrote: > and they're most definitely not persistent if they're in-process. 'persistent' means (at least) two different things. Here are the wikipedia pages on those two different things: http://en.wikipedia.org/wiki/Persistence_%28computer_science%29 http://en.wikipedia.org/wiki/Persistent_data_structure When you write "[maps] are most definitely not persistent", I think you're using the first definition. Bj?rn-Egil indicated that he was using the second. Matt From tuncer.ayaz@REDACTED Fri Apr 11 09:52:43 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 11 Apr 2014 09:52:43 +0200 Subject: [erlang-questions] otp.git 17.0 tag In-Reply-To: References: Message-ID: On Thu, Apr 10, 2014 at 6:35 AM, Rickard Green wrote: > On Wed, Apr 9, 2014 at 10:06 PM, Tuncer Ayaz wrote: >> Was it a deliberate decision to tag 17.0 as OTP-17.0 and not OTP_17.0? > > Yes, and the format will not change from now on. Okay. What about the missing R16A tag? From H.Li@REDACTED Fri Apr 11 10:16:03 2014 From: H.Li@REDACTED (H.Li@REDACTED) Date: Fri, 11 Apr 2014 09:16:03 +0100 (BST) Subject: [erlang-questions] [ANN] Erlang/OTP 17.0 has been released In-Reply-To: <20140410124242.GE19145@ferdair.local> References: <20140409165004.GC19145@ferdair.local> <20140410124242.GE19145@ferdair.local> Message-ID: <5a04bfe1ce583d9e081a02d13d39d3bf.squirrel@webmail.cs.kent.ac.uk> Just a quick word to say that we have updated Wrangler (the Erlang refactoring tool) to work with Maps and named Funs. https://github.com/RefactoringTools/wrangler Happy refactoring, Huiqing > ines: 75 > > I'm gonna reply to myself here to let people know that I've also just > pushed erlang-history so that it works with 17.0 also. > > https://github.com/ferd/erlang-history > > Enjoy! > > On 04/09, Fred Hebert wrote: >> For the people interested, here's a bonus LYSE chapter on Maps: >> http://learnyousomeerlang.com/maps >> >> Regards, >> Fred. >> >> On 04/09, Kenneth Lundin wrote: >> > Erlang/OTP 17.0 has been released. >> > >> > Erlang/OTP 17.0 is a new major release with new features, >> characteristics >> > improvements, as well as some minor incompatibilities. >> > >> > Some highlights of the release are: >> > >> > - Erlang/OTP has been ported to the realtime operating system OSE. >> > - Maps, a new dictionary data type (experimental) >> > - A more natural mapping from ASN.1 OCTET STRING and BIT STRING to >> > Erlang types, and other ASN.1 improvements and optimizations >> > - The {active, N} socket option for TCP, UDP, and SCTP >> > - A new (optional) scheduler utilization balancing mechanism >> > - Migration of memory carriers has been enabled by default on all >> ERTS >> > internal memory allocators >> > - Increased garbage collection tenure rate >> > - Experimental "dirty schedulers" functionality >> > - Funs can now be given names >> > - Miscellaneous unicode support enhancements >> > - A new version scheme for OTP its applications has been introduced >> > >> > You can find the README file with more detailed info at >> > http://www.erlang.org/download/otp_src_17.0.readme >> > >> > You can download the full source distribution from >> > http://www.erlang.org/download/otp_src_17.0.tar.gz >> > >> > Note: To unpack the TAR archive you need a GNU TAR compatible program. >> For >> > installation instructions please read the README that is part of the >> > distribution. >> > >> > You can also find this release at the official Erlang/OTP >> Git-repository at >> > Github here: https://github.com/erlang/otp tagged "OTP-17.0" >> > >> > The Windows binary distribution can be downloaded from >> > >> > http://www.erlang.org/download/otp_win32_17.0.exe >> > >> > http://www.erlang.org/download/otp_win64_17.0.exe >> > >> > You can also download the complete HTML documentation or the Unix >> manual >> > files >> > >> > http://www.erlang.org/download/otp_doc_html_17.0.tar.gz >> > http://www.erlang.org/download/otp_doc_man_17.0.tar.gz >> > >> > We also want to thank those that sent us patches, suggestions and bug >> > reports. >> > >> > The Erlang/OTP Team at Ericsson >> >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang From lukas@REDACTED Fri Apr 11 10:23:07 2014 From: lukas@REDACTED (Lukas Larsson) Date: Fri, 11 Apr 2014 10:23:07 +0200 Subject: [erlang-questions] otp.git 17.0 tag In-Reply-To: References: Message-ID: On Fri, Apr 11, 2014 at 9:52 AM, Tuncer Ayaz wrote: > What about the missing R16A tag? > > OTP_R16A_RELEASE_CANDIDATE is the tag for R16A. We added the _RELEASE_CANDIDATE postfix because people used R15A in production without realising that it was a release candidate and we wanted to make it clear that R16A was not to be used in a production system. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From gomoripeti@REDACTED Fri Apr 11 10:46:28 2014 From: gomoripeti@REDACTED (=?ISO-8859-1?Q?Peti_G=F6m=F6ri?=) Date: Fri, 11 Apr 2014 10:46:28 +0200 Subject: [erlang-questions] Abusing OTP-8623 for high-priority messages In-Reply-To: <5347828F.3000100@gmail.com> References: <53473656.3010902@gmail.com> <8246312.lygyUFqWVV@jalapeno> <5347828F.3000100@gmail.com> Message-ID: Hi As far as I understand OTP-8623 how it works is it puts a marker in the message queue when a reference is created (and other special conditions apply) and in case of a selective receive which contains that reference only the messages received after that marker are scanned. This makes sense as messages that were sent before the reference was created cannot contain that reference. Considering this it makes no sense to use a reference that was created in init since all (or almost all) messages will be sent after init. The readme stating "constant time" is at least a bit misleading. It probably only refers to the fact that no matter how long your message queue already is if you create a reference now and you only expect to receive one or few new messages after this it will be cheap to find that message in the queue. It will still scan the new messages in sequence, no hashing or anything. I might be wrong of course br Peter On Fri, Apr 11, 2014 at 7:50 AM, Michael Truog wrote: > On 04/10/2014 08:56 PM, Dmitry Demeshchuk wrote: > > Well, actually, if Michael pointed me at a module that handles that and it > was something similar, that could have been helpful :) > > But, judging by the priorities from -128 to 127, it's probably a manual > filter of some kind, probably with an intermediate mailbox-reducer process. > > The v1 UUID acts as the known reference with O(1) complexity here. The > priority is being handled by an Erlang priority queue data structure called > pqueue4 since there has to be some queue structure for queuing service > requests so that atomic transactions can occur for service requests. This > might not have been the priority you had in mind if you were thinking about > various pattern matching cases on different priority values, but I have > found the approach with a data structure more flexible and useful for the > dynamic nature of a service, due to the need for a queue (which enforces > the incoming limit, since it is easier than trying to do something > error-prone with an Erlang pid directly, i.e., something that would modify > the Erlang pid state or try to check it repeatedly). > > > > Which is fine, actually, but my question wasn't "how to handle huge > queues?", but "is using OTP-8623 for that an anti-pattern of some sort?". > > And yeah, definitely not "what platform should I use?". > > > On Thu, Apr 10, 2014 at 7:28 PM, zxq9 wrote: > >> On Thursday 10 April 2014 17:24:54 Michael Truog wrote: >> > On 04/10/2014 05:02 PM, Dmitry Demeshchuk wrote: >> > > Hi list, >> > > >> > > Today (yeah, just a couple years have passed since R14A) I learned >> about >> > > OTP-8623, which allows to do selective receive for messages that >> contain >> > > a known reference with O(1) complexity. >> ... >> > > This could potentially help with sending managing messages to the >> > > processes that may have overloaded inbox with thousands of messages. >> Say, >> > > we see that the process gets overloaded and we send an operational >> > > message of some kind ("discard the entire inbox", for example). >> > > >> > > Thoughts? >> > >> > You could get this interaction by creating an internal service with >> CloudI >> > (http://cloudi.org). >> >> Not so sure this is what the OP was getting at. >> >> "Is OTP8623 a lightweight way to overcome a clogged queue?" /= "Base >> everything you do on some new service stack" >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > > -- > Best regards, > Dmitry Demeshchuk > > > _______________________________________________ > erlang-questions mailing listerlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn@REDACTED Fri Apr 11 11:01:23 2014 From: bjorn@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Fri, 11 Apr 2014 11:01:23 +0200 Subject: [erlang-questions] Abusing OTP-8623 for high-priority messages In-Reply-To: References: Message-ID: On Fri, Apr 11, 2014 at 2:02 AM, Dmitry Demeshchuk wrote: > Hi list, > > Today (yeah, just a couple years have passed since R14A) I learned about > OTP-8623, which allows to do selective receive for messages that contain a > known reference with O(1) complexity. Yes, that is basically how it was described in the release note and how it works in practice. It is implemented by not looking at the first part of the message queue that contain messages received before the reference was created. In practice, there should only be a small number of new messages received after the creation of the reference, so in practice we have O(1) complexity for reading out the message. > Which made me think: what if we make a gen_server'ish process that: > 1. Creates a reference that is being passed along with the pid, meaning, our > start_link returns {ok, {Pid, ManageRef}} or something like that. ManageRef > is actually created within the new process inside init/1 or such. > 2. Introduce an operation named priority_call, which, basically, sends > something like {ManageRef, {Pid, Ref}, Msg}. Apart from the fact that the optimization cannot at all be applied in this context because it is a compiler optimization, it would not help at all because the reference is created when the process queue is empty, so there are no messages that can be skipped. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From tony@REDACTED Fri Apr 11 11:04:43 2014 From: tony@REDACTED (Tony Rogvall) Date: Fri, 11 Apr 2014 11:04:43 +0200 Subject: [erlang-questions] Abusing OTP-8623 for high-priority messages In-Reply-To: References: Message-ID: <78D25E65-7551-46CC-A270-E9F1FD7E0681@rogvall.se> Reacting (as always) when the word abuse is tagged in the subject line :-) Reading the comments in beam_receive.erl (compiler) the layout of the code using this "selective" feature must have the following layout: 1) Ref= make_ref(), %% or monitor(process, Pid) / spawn_monitor(..) ... receive 2) _Mesg = {Ref, Data} -> do_some_stuff() end. The compiler will only put out the code you want (recv_mark) if it follows this pattern. The actual reference created in 1) must be matched in a syntactic pattern that contain the variable 'Ref'. The beam_receive optimization is done pretty late in the compiler process so it is a bit more complicated that that. Example -module(beam_prio_msg). -compile(export_all). test1() -> Ref = make_ref(), receive {Ref, x} -> x after 100 -> timeout end. test2() -> Ref = make_ref(), Ref1 = Ref, receive {Ref1, x} -> x after 100 -> timeout end. test3() -> Ref = make_ref(), Ref1 = {Ref}, receive {Ref1, x} -> x after 100 -> timeout end. Both test1 and test2 put out the (recv_mark) instruction even though test2 is matching on an other variable Ref1. But test3 will not put out the (recv_mark) instruction, since the reference is put into an other term and therefor is potentially not in a register anymore. Anyway. If your plan is to work at all the code fragment must somehow send a message somewhere saying that "now it is time to send a priority message to me" and then wait for that message. PrioRef = make_ref(), ManagerPid ! {send_me_prio_request_with_this_ref, PrioRef}, receive {PrioRef, From, Msg} -> handle_call(From, Msg, State) after 0 -> receive Msg -> gen_server_like_dispatch_msg(Msg) end end This plan could almost work (theoretically), but would spam ManagerPid for every call to probe for high prio message. And you surly add latency since you need to wait more than 0 millis for a high prio response. In other words, with my current mindset, the scheme is not really working. But with some new and fresh input this may inspire to even more abuse :-) /Tony On 11 apr 2014, at 02:02, Dmitry Demeshchuk wrote: > Hi list, > > Today (yeah, just a couple years have passed since R14A) I learned about OTP-8623, which allows to do selective receive for messages that contain a known reference with O(1) complexity. > > Which made me think: what if we make a gen_server'ish process that: > 1. Creates a reference that is being passed along with the pid, meaning, our start_link returns {ok, {Pid, ManageRef}} or something like that. ManageRef is actually created within the new process inside init/1 or such. > 2. Introduce an operation named priority_call, which, basically, sends something like {ManageRef, {Pid, Ref}, Msg}. > 3. The process itself (on its own side) does a selective receive like that: > > receive > {ManageRef, From, Msg} -> handle_call(From, Msg, State) > after 0 -> > receive > Msg -> gen_server_like_dispatch_msg(Msg) > end > end > > This could potentially help with sending managing messages to the processes that may have overloaded inbox with thousands of messages. Say, we see that the process gets overloaded and we send an operational message of some kind ("discard the entire inbox", for example). > > Thoughts? > > -- > Best regards, > Dmitry Demeshchuk > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions "Installing applications can lead to corruption over time. Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix" -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Fri Apr 11 12:25:03 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 11 Apr 2014 12:25:03 +0200 Subject: [erlang-questions] NIF resource and typespecs In-Reply-To: <53466E64.4020309@erix.ericsson.se> References: <53454A4D.90503@ninenines.eu> <53466E64.4020309@erix.ericsson.se> Message-ID: On Thu, Apr 10, 2014 at 12:11 PM, Sverker Eriksson wrote: > On 04/09/2014 03:25 PM, Lo?c Hoguin wrote: > > > > Hello, > > > > NIF resources appear as a magic empty binary on the Erlang side. > > What typespec should I use for them though? Is there anything > > better than this? > > > > -opaque my_nif_resource() :: any(). > > > > Thanks. > > > > I think this is the way to go: > > -type my_nif_resource() :: any(). > > > @Tuncer: Wasn't that your conclusion? Yes, I settled on that because: 1. If you declare :: any() as an opaque type, then the compiler will complain that it's underspecified. 2. Opaque types only make sense when exported, and the compiler will rightly complain about that. Also, the magic empty binary is an implementation detail and may change in any erts release, so should not be pattern matched at all. From ulf@REDACTED Fri Apr 11 12:52:38 2014 From: ulf@REDACTED (Ulf Wiger) Date: Fri, 11 Apr 2014 12:52:38 +0200 Subject: [erlang-questions] Abusing OTP-8623 for high-priority messages In-Reply-To: <78D25E65-7551-46CC-A270-E9F1FD7E0681@rogvall.se> References: <78D25E65-7551-46CC-A270-E9F1FD7E0681@rogvall.se> Message-ID: <78C5E064-7ED4-4F08-8F6A-8E93B2CA01F1@feuerlabs.com> On 11 Apr 2014, at 11:04, Tony Rogvall wrote: > This plan could almost work (theoretically), but would spam ManagerPid for every call to probe for > high prio message. And you surly add latency since you need to wait more than 0 > millis for a high prio response. > > In other words, with my current mindset, the scheme is not really working. > But with some new and fresh input this may inspire to even more abuse :-) This is how to do it, of course: ;-) PrioRef = make_ref(), ManagerPid ! {send_me_prio_request_with_this_ref, PrioRef}, erlang:hibernate( fun() -> receive {PrioRef, From, Msg} -> handle_call(From, Msg, State) after 0 -> receive Msg -> gen_server_like_dispatch_msg(Msg) end end). Of course, hibernate/1 doesn?t exist, and the compiler would have to make the fun ?inherit? the receive mark. BR, Ulf Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony@REDACTED Fri Apr 11 13:48:10 2014 From: tony@REDACTED (Tony Rogvall) Date: Fri, 11 Apr 2014 13:48:10 +0200 Subject: [erlang-questions] Abusing OTP-8623 for high-priority messages In-Reply-To: <78C5E064-7ED4-4F08-8F6A-8E93B2CA01F1@feuerlabs.com> References: <78D25E65-7551-46CC-A270-E9F1FD7E0681@rogvall.se> <78C5E064-7ED4-4F08-8F6A-8E93B2CA01F1@feuerlabs.com> Message-ID: <31DBC002-D49A-412E-B22C-D0EE5BFB576A@rogvall.se> Now we are getting somewhere ! Good thinking ulf. :-) /Tony On 11 apr 2014, at 12:52, Ulf Wiger wrote: > > On 11 Apr 2014, at 11:04, Tony Rogvall wrote: > >> This plan could almost work (theoretically), but would spam ManagerPid for every call to probe for >> high prio message. And you surly add latency since you need to wait more than 0 >> millis for a high prio response. >> >> In other words, with my current mindset, the scheme is not really working. >> But with some new and fresh input this may inspire to even more abuse :-) > > This is how to do it, of course: ;-) > > PrioRef = make_ref(), > ManagerPid ! {send_me_prio_request_with_this_ref, PrioRef}, > erlang:hibernate( > fun() -> > receive > {PrioRef, From, Msg} -> handle_call(From, Msg, State) > after 0 -> > receive > Msg -> gen_server_like_dispatch_msg(Msg) > end > end). > > Of course, hibernate/1 doesn?t exist, and the compiler would have > to make the fun ?inherit? the receive mark. > > BR, > Ulf > > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. > http://feuerlabs.com > > > "Installing applications can lead to corruption over time. Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix" -------------- next part -------------- An HTML attachment was scrubbed... URL: From elbrujohalcon@REDACTED Fri Apr 11 15:27:26 2014 From: elbrujohalcon@REDACTED (Brujo Benavides @ Inaka) Date: Fri, 11 Apr 2014 10:27:26 -0300 Subject: [erlang-questions] [ANN] Erlang BA Meetup In-Reply-To: <83A272DD-E218-493A-9143-2672C358AFA5@inaka.net> References: <83A272DD-E218-493A-9143-2672C358AFA5@inaka.net> Message-ID: <681632BD-6D9A-4ABE-9D89-84AD35A4836C@inaka.net> All, Thank you very much for the huge interest in our Erlounge. We got tons of registrations and due to place constraints we needed to close the registration and can't accept any new ones. We apologize to all of you who couldn't get in and we expect to meet you soon in our next Erlounge BA! On Apr 9, 2014, at 13:13, Brujo Benavides @ Inaka wrote: > All, > > We have the HUGE honor of a visit from one of the biggest names in the Erlang community, Francesco Cesarini, founder of Erlang Solutions Ltd in London. He is going to speak at our Erlounge in our Inaka office Villa Crespo on Monday, 28th of April. > > Please come to our office in Villa Crespo Monday night to hear from Francesco and have some beers and pizza! Please register here: http://bit.ly/erlangba or send an email to elbrujohalcon@REDACTED > > Brujo Benavides > elbrujohalcon@REDACTED > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Fri Apr 11 15:39:14 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Fri, 11 Apr 2014 09:39:14 -0400 Subject: [erlang-questions] Cannot build a work vm on FreeBSD with dtrace AND enable dirty-schedulers In-Reply-To: References: Message-ID: On Fri, Apr 11, 2014 at 12:30 AM, Wu Ray wrote: > Hi, list > > I cannot build a working erlang 17 on FreeBSD 10.0, with dtrace AND > enabled dirty-schedulers at the same time, that's my steps: > ./configure --with-dynamic-trace=dtrace --enable-dirty-schedulers > gmake > > then, the build erl vm just quit with: > Segmentation fault(core dumped) > > I've tried gcc47, same result. > CC=gcc47 CXX=g++47 ./configure --with-dynamic-trace=dtrace > --enable-dirty-schedulers > > if I build with-dtrace OR enable dirty-schedulers separately, the VMs run > well. > but the dirty-schedulers number looks strange: > > Erlang/OTP 17 [erts-6.0] [source] [64-bit] > [ds:10:5851653:18446744073709551611] [async-threads:38554976] [hipe] > [kernel-poll:] > > Eshell V6.0 (abort with ^G) > 1> erlang:system_info(dirty_cpu_schedulers). > ** exception error: bad argument > in function erlang:system_info/1 > called as erlang:system_info(dirty_cpu_schedulers) > > > And, gcc48 cannot build a working VM with enabled dirty-schedulers, the vm > quit with Segmentation fault. > > BTW: my FreeBSD 10.0 is running in VirtualBox 4.3.10 on Ubuntu13.10 > I'm currently running Erlang 17.0 with both dtrace support and dirty scheduler support on OS X 10.8, so I'm guessing this problem is specific to FreeBSD. Notice your async thread count is wrong as well. If you build without dtrace and without dirty schedulers, what is the async thread count? I'll try to get FreeBSD 10.0 running in a VM to see if I can duplicate the problem. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From eddie_serban@REDACTED Fri Apr 11 14:46:44 2014 From: eddie_serban@REDACTED (Serban Eduard) Date: Fri, 11 Apr 2014 05:46:44 -0700 (PDT) Subject: [erlang-questions] meck fail to compile with latest erlang R17 (a test failed) Message-ID: <1397220404.75322.YahooMailNeo@web120205.mail.ne1.yahoo.com> Hi all, After i switched to new erlang R17 i can't compile my project since it fails when meck dependency? compiles. I tried also to build meck only and when i ran: "make"? i received : Compiled test/meck_tests.erl =ERROR REPORT==== 11-Apr-2014::15:30:15 === ** Generic server mymod_meck terminating ** Last message in was {'EXIT',<0.77.0>,expected_test_exit} ** When Server state == {state,mymod,any, ?????????????????????????????? {dict,0,16,16,8,80,48, ???????????????????????????????????? {[],[],[],[],[],[],[],[],[],[],[],[],[], ????????????????????????????????????? [],[],[]}, ???????????????????????????????????? {{[],[],[],[],[],[],[],[],[],[],[],[],[], ?????????????????????????????????????? [],[],[]}}}, ?????????????????????????????? true,[], ?????????????????????????????? {false,no_binary}, ?????????????????????????????? false,undefined,[]} ** Reason for termination == ** expected_test_exit =ERROR REPORT==== 11-Apr-2014::15:30:17 === Can't load module that resides in sticky dir =ERROR REPORT==== 11-Apr-2014::15:30:18 === Error in process <0.1195.0> with exit value: {timeout,[{meck_proc,wait,6,[{file,"src/meck_proc.erl"},{line,169}]},{meck_tests,'-wait_for_the_same_pattern_on_different_processes_test/0-fun-2-',0,[{file,"test/meck_tests.erl"},{line,1355}]}]} =ERROR REPORT==== 11-Apr-2014::15:30:18 === Error in process <0.1203.0> with exit value: {timeout,[{meck_proc,wait,6,[{file,"src/meck_proc.erl"},{line,169}]},{meck_tests,'-wait_for_different_patterns_on_different_processes_test/0-fun-0-',0,[{file,"test/meck_tests.erl"},{line,1376}]}]} It fails when a test ran... Do you have a clue ? Thanks, Eddie -------------- next part -------------- An HTML attachment was scrubbed... URL: From shayan@REDACTED Fri Apr 11 16:03:05 2014 From: shayan@REDACTED (Shayan Pooya) Date: Fri, 11 Apr 2014 10:03:05 -0400 Subject: [erlang-questions] Erlang 17 issue with dialyzer and nowarn_deprecated_type Message-ID: Hello, In order to make Disco compile with Erlang 17 without warnings, I added nowarn_deprecated_type to silence the warnings. However, after doing so, dialyzer fails with the following error: ddfs_master.erl:345: Attempt to test for inequality between a term of type 'false' and a term of opaque type 'false' | gb_set() ( https://github.com/discoproject/disco/blob/develop/master/src/ddfs/ddfs_master.erl#L345 ) Oddly enough, a simple s/gb_set()/gb_sets:gb_set()/g in this file fixes this issue but I do not want to do that since it breaks the builds for older versions (and that's the reason nowarn_deprecated_type has been added). Any suggestions? The error message itself does not make much sense to me. Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangsiri@REDACTED Fri Apr 11 16:45:40 2014 From: erlangsiri@REDACTED (Siri Hansen) Date: Fri, 11 Apr 2014 16:45:40 +0200 Subject: [erlang-questions] Erlang release and config includes In-Reply-To: References: Message-ID: Hi Alexander! This is a bug in application_controller:change_application_data/2, which is called from the release_handler. It occurs for applications that are added in an upgrade only (i.e. not for already loaded applications). It will be corrected in OTP-17.1. Thanks for the report! /siri 2014-02-20 14:31 GMT+01:00 Alexander Petrovsky : > Hello! > > I have the problem on erlang release upgrade and config includes. I have > the follow config structure of sys.config with app.config (that generated > dynamically) include: > > /usr/local/lib/myapp/releases/1.0.8/sys.config: > [ > .... > "/etc/myapp/app.config" > ]. > > I added new application myapp2 into myapp, and want to upgrade myapp to > new version (1.0.9). > > Firstly I add the settings for new application myapp2 in app.conf file, > and then run upgrade the Erlang application: > > release_handler:unpack_release, > release_handler:check_install_release, > release_handler:install_release > > The new version of myapp (1.0.9) run the myapp2 application. myapp2 try > read the settings and crash due badmatch error, i.e. no settings in config > for myapp2. When I put settings for new application myapp2 into sys.config, > all works without any problems. > > Looks like, release_handler doesn't re-read included config files. > > -- > ?????????? ????????? / Alexander Petrovsky, > > Skype: askjuise > Phone: +7 914 8 820 815 > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lee.sylvester@REDACTED Fri Apr 11 16:51:59 2014 From: lee.sylvester@REDACTED (Lee Sylvester) Date: Fri, 11 Apr 2014 15:51:59 +0100 Subject: [erlang-questions] meck fail to compile with latest erlang R17 (a test failed) In-Reply-To: <1397220404.75322.YahooMailNeo@web120205.mail.ne1.yahoo.com> References: <1397220404.75322.YahooMailNeo@web120205.mail.ne1.yahoo.com> Message-ID: <6CD34147-1B7C-4BDA-9449-C6D5B2EA555C@gmail.com> You need to work through meck and change any signs of dict() to dict:dict(). I had to do this myself for meck last night. Lee On 11 Apr 2014, at 13:46, Serban Eduard wrote: > Hi all, > > After i switched to new erlang R17 i can't compile my project since it fails when meck dependency compiles. > I tried also to build meck only and when i ran: "make" i received : > > Compiled test/meck_tests.erl > > =ERROR REPORT==== 11-Apr-2014::15:30:15 === > ** Generic server mymod_meck terminating > ** Last message in was {'EXIT',<0.77.0>,expected_test_exit} > ** When Server state == {state,mymod,any, > {dict,0,16,16,8,80,48, > {[],[],[],[],[],[],[],[],[],[],[],[],[], > [],[],[]}, > {{[],[],[],[],[],[],[],[],[],[],[],[],[], > [],[],[]}}}, > true,[], > {false,no_binary}, > false,undefined,[]} > ** Reason for termination == > ** expected_test_exit > > =ERROR REPORT==== 11-Apr-2014::15:30:17 === > Can't load module that resides in sticky dir > > =ERROR REPORT==== 11-Apr-2014::15:30:18 === > Error in process <0.1195.0> with exit value: {timeout,[{meck_proc,wait,6,[{file,"src/meck_proc.erl"},{line,169}]},{meck_tests,'-wait_for_the_same_pattern_on_different_processes_test/0-fun-2-',0,[{file,"test/meck_tests.erl"},{line,1355}]}]} > > > =ERROR REPORT==== 11-Apr-2014::15:30:18 === > Error in process <0.1203.0> with exit value: {timeout,[{meck_proc,wait,6,[{file,"src/meck_proc.erl"},{line,169}]},{meck_tests,'-wait_for_different_patterns_on_different_processes_test/0-fun-0-',0,[{file,"test/meck_tests.erl"},{line,1376}]}]} > > It fails when a test ran... > > Do you have a clue ? > > Thanks, > Eddie > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Fri Apr 11 17:18:20 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Fri, 11 Apr 2014 17:18:20 +0200 Subject: [erlang-questions] SSL crashes while decoding alert. In-Reply-To: References: Message-ID: Hi! This is what happens when I do what you say you do. Erlang/OTP 17 [erts-6.0] [source-fa45816] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> inets:start(). ok 2> ssl:start(). ok 3> httpc:request("https://somewhere.com"). {ok,{{"HTTP/1.1",200,"OK"}, [{"cache-control","max-age=0, private, must-revalidate"}, {"connection","keep-alive"}, {"date","Fri, 11 Apr 2014 15:03:08 GMT"}, {"etag","\"abf551bf9c340cc2649822f9e27e82ff\""}, {"vary","Accept-Encoding"}, {"content-length","41024"}, {"content-type","text/html; charset=utf-8"}, {"last-modified","Thu, 30 Jan 2014 17:12:43 GMT"}, {"access-control-allow-methods","POST, GET, OPTIONS"}, {"access-control-allow-origin","*"}, {"access-control-max-age","1728000"}, {"set-cookie", "_session_id=613ae6fdb421a8eb1cbc1d43509c4d53; path=/; expires=Fri, 18-Apr-2014 15:03:08 GMT; HttpOnly"}, {"status","200 OK"}, {"x-rack-cache","miss"}, {"x-request-id","9b2a35c1-f4c8-47fa-bcdc-e7f80090fe72"}, {"x-runtime","1.182360"}, {"x-ua-compatible","IE=Edge,chrome=1"}], [60,33,68,79,67,84,89,80,69,32,104,116,109,108,62,60,104, 116,109,108,62,60,104,101|...]}} Regards Ingela Erlang/OTP team - Ericsson AB 2014-04-11 16:53 GMT+02:00 atul atri : > Hi Ingela, > > I just tested this issue with erlang 17. This issue is not fixed. > > ============= > [root@REDACTED otp_src_17.0]# erl > Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10] > [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> inets:start(). > ok > 2> ssl:start(). > ok > 3> httpc:request("https://somewhere.com"). > > {error,{failed_connect,[{to_address,{"somewhere.com", > 443}}, > {inet,[inet], > > {eoptions,{{function_clause,[{tls_connection,handle_alert, > > [{alert,1,112,{"tls_connection.erl",375}}, > > hello, > > {state,client, > > {#Ref<0.0.0.63>,<0.57.0>}, > > gen_tcp,tls_connection,tcp,tcp_closed,tcp_error,...}], > > [{file,"tls_connection.erl"},{line,836}]}, > > {tls_connection,handle_alerts,2, > > [{file,"tls_connection.erl"},{line,834}]}, > > {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, > > > {proc_lib,init_p_do_apply,3, > > [{file,"proc_lib.erl"},{line,239}]}]}, > > {gen_fsm,sync_send_all_state_event, > > [<0.61.0>,{start,infinity},infinity]}}}}]}} > ================= > > Server sends alert warning 112 (unrecognized_name), but tls_connection.erl > has no function to handle this alert. ssl_alert.hrl do mention this alert. > > I also found > http://stackoverflow.com/questions/7615645/ssl-handshake-alert-unrecognized-name-error-since-upgrade-to-java-1-7-0. > Java 1.7 is also behaving kind of same. I have not tested myself though. As > first answer mentions, that most choose to ignore server alert warning 112 > (unrecognized_name). Erlang/Otp should also consider to ignore it. This > thread mentions that we can disable SNI in java 1.7. Do we have similar > option in Erlang/Otp? Is disabling SNI right choice? > > Adding following function in tls_connection.erl solves the problem: > ========= > handle_alert(#alert{level = ?WARNING, description = ?UNRECOGNISED_NAME} = > Alert, StateName, > #state{ssl_options = SslOpts} = State0) -> > log_alert(SslOpts#ssl_options.log_alert, StateName, Alert), > {Record, State} = next_record(State0), > next_state(StateName, StateName, Record, State). > =========== > > This issue supposed to be fixed in > https://github.com/erlang/otp/commit/d18e7b25a17a0c62c0beddc81f23b1dea18b7ef4. > But It seems like you forgot to commit changes in file tls_connection.erl. > > Waiting for your kind reply to sort out this issue asap. > > Thanks & Regards, > Atul Atri. > > > > > > On Fri, Apr 4, 2014 at 7:10 PM, Ingela Andin wrote: > >> Hi! >> >> This is fixed in the latest version 17.0 (comming soon) or check master >> branch at github. >> >> Regards Ingela Erlang/OTP team - Ericsson AB >> >> >> 2014-04-04 10:33 GMT+02:00 atul atri : >> >>> Hi, >>> >>> I am using httpc to connect to a website that is using invalid >>> certificate. But it is crashing while ssl handshake. >>> >>> ====== >>> 7> httpc:request(post, {"https://somewhere.com", [], >>> "application/x-www-form-urlencoded", ""}, [{ssl, [{verify, verify_none}]}], >>> []). {error,{failed_connect,[{to_address,{" >>> somewhere.com", >>> 443}}, >>> {inet,[inet], >>> >>> {eoptions,{{function_clause,[{tls_connection,handle_alert, >>> >>> [{alert,1,112,{"tls_connection.erl",375}}, >>> >>> hello, >>> >>> {state,client, >>> >>> {#Ref<0.0.0.137>,<0.74.0>}, >>> >>> gen_tcp,tls_connection,tcp,tcp_closed,tcp_error,...}], >>> >>> [{file,"tls_connection.erl"},{line,834}]}, >>> >>> {tls_connection,handle_alerts,2, >>> >>> [{file,"tls_connection.erl"},{line,832}]}, >>> >>> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]}, >>> >>> {proc_lib,init_p_do_apply,3, >>> >>> [{file,"proc_lib.erl"},{line,239}]}]}, >>> >>> {gen_fsm,sync_send_all_state_event, >>> >>> [<0.75.0>,{start,infinity},infinity]}}}}]}} >>> ======= >>> >>> I am able to browse website in Firefox. >>> >>> My elang version is >>> ==== >>> [root@REDACTED ~]# erl >>> Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:2:2] >>> [async-threads:10] [hipe] [kernel-poll:false] >>> >>> Eshell V5.10.4 (abort with ^G) >>> ==== >>> >>> I googled it and it looks some thing related to >>> http://permalink.gmane.org/gmane.comp.lang.erlang.bugs/4302. >>> >>> Any help to fix or work around this is much appreciated. >>> >>> Thanks & Regards, >>> Atul Atri. >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From atulatri2004@REDACTED Fri Apr 11 19:46:45 2014 From: atulatri2004@REDACTED (atul atri) Date: Fri, 11 Apr 2014 23:16:45 +0530 Subject: [erlang-questions] SSL crashes while decoding alert. In-Reply-To: References: Message-ID: Hi, My Bad. I wanted to hide website URL so I replaced it by somewhere.com. I will mail you website URL separately. Thanks & Regards, Atul Atri. On Fri, Apr 11, 2014 at 8:48 PM, Ingela Andin wrote: > > Hi! > > This is what happens when I do what you say you do. > > Erlang/OTP 17 [erts-6.0] [source-fa45816] [64-bit] [smp:8:8] > [async-threads:10] [hipe] [kernel-poll:false] > > > Eshell V6.0 (abort with ^G) > 1> inets:start(). > ok > 2> ssl:start(). > ok > 3> httpc:request("https://somewhere.com"). > {ok,{{"HTTP/1.1",200,"OK"}, > [{"cache-control","max-age=0, private, must-revalidate"}, > {"connection","keep-alive"}, > {"date","Fri, 11 Apr 2014 15:03:08 GMT"}, > {"etag","\"abf551bf9c340cc2649822f9e27e82ff\""}, > {"vary","Accept-Encoding"}, > {"content-length","41024"}, > {"content-type","text/html; charset=utf-8"}, > {"last-modified","Thu, 30 Jan 2014 17:12:43 GMT"}, > {"access-control-allow-methods","POST, GET, OPTIONS"}, > {"access-control-allow-origin","*"}, > {"access-control-max-age","1728000"}, > {"set-cookie", > "_session_id=613ae6fdb421a8eb1cbc1d43509c4d53; path=/; expires=Fri, > 18-Apr-2014 15:03:08 GMT; HttpOnly"}, > {"status","200 OK"}, > {"x-rack-cache","miss"}, > {"x-request-id","9b2a35c1-f4c8-47fa-bcdc-e7f80090fe72"}, > {"x-runtime","1.182360"}, > {"x-ua-compatible","IE=Edge,chrome=1"}], > [60,33,68,79,67,84,89,80,69,32,104,116,109,108,62,60,104, > 116,109,108,62,60,104,101|...]}} > > Regards Ingela Erlang/OTP team - Ericsson AB > > > 2014-04-11 16:53 GMT+02:00 atul atri : > > Hi Ingela, >> >> I just tested this issue with erlang 17. This issue is not fixed. >> >> ============= >> [root@REDACTED otp_src_17.0]# erl >> Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10] >> [hipe] [kernel-poll:false] >> >> Eshell V6.0 (abort with ^G) >> 1> inets:start(). >> ok >> 2> ssl:start(). >> ok >> 3> httpc:request("https://somewhere.com"). >> >> {error,{failed_connect,[{to_address,{"somewhere.com", >> 443}}, >> {inet,[inet], >> >> {eoptions,{{function_clause,[{tls_connection,handle_alert, >> >> [{alert,1,112,{"tls_connection.erl",375}}, >> >> hello, >> >> {state,client, >> >> {#Ref<0.0.0.63>,<0.57.0>}, >> >> gen_tcp,tls_connection,tcp,tcp_closed,tcp_error,...}], >> >> [{file,"tls_connection.erl"},{line,836}]}, >> >> {tls_connection,handle_alerts,2, >> >> [{file,"tls_connection.erl"},{line,834}]}, >> >> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, >> >> >> {proc_lib,init_p_do_apply,3, >> >> [{file,"proc_lib.erl"},{line,239}]}]}, >> >> {gen_fsm,sync_send_all_state_event, >> >> [<0.61.0>,{start,infinity},infinity]}}}}]}} >> ================= >> >> Server sends alert warning 112 (unrecognized_name), but >> tls_connection.erl has no function to handle this alert. ssl_alert.hrl do >> mention this alert. >> >> I also found >> http://stackoverflow.com/questions/7615645/ssl-handshake-alert-unrecognized-name-error-since-upgrade-to-java-1-7-0. >> Java 1.7 is also behaving kind of same. I have not tested myself though. As >> first answer mentions, that most choose to ignore server alert warning 112 >> (unrecognized_name). Erlang/Otp should also consider to ignore it. This >> thread mentions that we can disable SNI in java 1.7. Do we have similar >> option in Erlang/Otp? Is disabling SNI right choice? >> >> Adding following function in tls_connection.erl solves the problem: >> ========= >> handle_alert(#alert{level = ?WARNING, description = ?UNRECOGNISED_NAME} = >> Alert, StateName, >> #state{ssl_options = SslOpts} = State0) -> >> log_alert(SslOpts#ssl_options.log_alert, StateName, Alert), >> {Record, State} = next_record(State0), >> next_state(StateName, StateName, Record, State). >> =========== >> >> This issue supposed to be fixed in >> https://github.com/erlang/otp/commit/d18e7b25a17a0c62c0beddc81f23b1dea18b7ef4. >> But It seems like you forgot to commit changes in file tls_connection.erl. >> >> Waiting for your kind reply to sort out this issue asap. >> >> Thanks & Regards, >> Atul Atri. >> >> >> >> >> >> On Fri, Apr 4, 2014 at 7:10 PM, Ingela Andin wrote: >> >>> Hi! >>> >>> This is fixed in the latest version 17.0 (comming soon) or check master >>> branch at github. >>> >>> Regards Ingela Erlang/OTP team - Ericsson AB >>> >>> >>> 2014-04-04 10:33 GMT+02:00 atul atri : >>> >>>> Hi, >>>> >>>> I am using httpc to connect to a website that is using invalid >>>> certificate. But it is crashing while ssl handshake. >>>> >>>> ====== >>>> 7> httpc:request(post, {"https://somewhere.com", [], >>>> "application/x-www-form-urlencoded", ""}, [{ssl, [{verify, verify_none}]}], >>>> []). {error,{failed_connect,[{to_address,{" >>>> somewhere.com", >>>> 443}}, >>>> {inet,[inet], >>>> >>>> {eoptions,{{function_clause,[{tls_connection,handle_alert, >>>> >>>> [{alert,1,112,{"tls_connection.erl",375}}, >>>> >>>> hello, >>>> >>>> {state,client, >>>> >>>> {#Ref<0.0.0.137>,<0.74.0>}, >>>> >>>> gen_tcp,tls_connection,tcp,tcp_closed,tcp_error,...}], >>>> >>>> [{file,"tls_connection.erl"},{line,834}]}, >>>> >>>> {tls_connection,handle_alerts,2, >>>> >>>> [{file,"tls_connection.erl"},{line,832}]}, >>>> >>>> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]}, >>>> >>>> {proc_lib,init_p_do_apply,3, >>>> >>>> [{file,"proc_lib.erl"},{line,239}]}]}, >>>> >>>> {gen_fsm,sync_send_all_state_event, >>>> >>>> [<0.75.0>,{start,infinity},infinity]}}}}]}} >>>> ======= >>>> >>>> I am able to browse website in Firefox. >>>> >>>> My elang version is >>>> ==== >>>> [root@REDACTED ~]# erl >>>> Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:2:2] >>>> [async-threads:10] [hipe] [kernel-poll:false] >>>> >>>> Eshell V5.10.4 (abort with ^G) >>>> ==== >>>> >>>> I googled it and it looks some thing related to >>>> http://permalink.gmane.org/gmane.comp.lang.erlang.bugs/4302. >>>> >>>> Any help to fix or work around this is much appreciated. >>>> >>>> Thanks & Regards, >>>> Atul Atri. >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Fri Apr 11 20:50:46 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Fri, 11 Apr 2014 20:50:46 +0200 Subject: [erlang-questions] meck fail to compile with latest erlang R17 (a test failed) In-Reply-To: <6CD34147-1B7C-4BDA-9449-C6D5B2EA555C@gmail.com> References: <1397220404.75322.YahooMailNeo@web120205.mail.ne1.yahoo.com> <6CD34147-1B7C-4BDA-9449-C6D5B2EA555C@gmail.com> Message-ID: On Fri, Apr 11, 2014 at 4:51 PM, Lee Sylvester wrote: > You need to work through meck and change any signs of dict() to > dict:dict(). I had to do this myself for meck last night. Did you create a Pull Request? -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From k.petrauskas@REDACTED Fri Apr 11 22:09:28 2014 From: k.petrauskas@REDACTED (Karolis Petrauskas) Date: Fri, 11 Apr 2014 23:09:28 +0300 Subject: [erlang-questions] meck fail to compile with latest erlang R17 (a test failed) In-Reply-To: References: <1397220404.75322.YahooMailNeo@web120205.mail.ne1.yahoo.com> <6CD34147-1B7C-4BDA-9449-C6D5B2EA555C@gmail.com> Message-ID: The master branch works for me with Erlang 17.0. Karolis On Fri, Apr 11, 2014 at 9:50 PM, Jesper Louis Andersen wrote: > > On Fri, Apr 11, 2014 at 4:51 PM, Lee Sylvester > wrote: >> >> You need to work through meck and change any signs of dict() to >> dict:dict(). I had to do this myself for meck last night. > > > Did you create a Pull Request? > > > -- > J. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From ingela.andin@REDACTED Fri Apr 11 22:18:47 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Fri, 11 Apr 2014 22:18:47 +0200 Subject: [erlang-questions] SSL crashes while decoding alert. In-Reply-To: References: Message-ID: *Hi!* *After some private discussions (should have been more suspicious of the link ;)) I think we found a bug related to warning alerts that just happen to manifest itself on the alert 112 that was missing from the SNI-contribution, and that I just added to 17. So the following patch, if proven correct, will be included for 17.1 (Makes the last clause of handle_alert - handle all not previously matched warning alerts.)* *diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl* *index ffa04ee..0946a47 100644* *--- a/lib/ssl/src/tls_connection.erl* *+++ b/lib/ssl/src/tls_connection.erl* @@ -859,7 +859,7 @@ handle_alert(#alert{level = ?WARNING, description = ?NO_RENE {Record, State} = next_record(State0), next_state(StateName, connection, Record, State); -handle_alert(#alert{level = ?WARNING, description = ?USER_CANCELED} = Alert, St +handle_alert(#alert{level = ?WARNING} = Alert, StateName, Regards Ingela Erlang/OTP team - Ericsson AB 2014-04-11 17:18 GMT+02:00 Ingela Andin : > > Hi! > > This is what happens when I do what you say you do. > > Erlang/OTP 17 [erts-6.0] [source-fa45816] [64-bit] [smp:8:8] > [async-threads:10] [hipe] [kernel-poll:false] > > > Eshell V6.0 (abort with ^G) > 1> inets:start(). > ok > 2> ssl:start(). > ok > 3> httpc:request("https://somewhere.com"). > {ok,{{"HTTP/1.1",200,"OK"}, > [{"cache-control","max-age=0, private, must-revalidate"}, > {"connection","keep-alive"}, > {"date","Fri, 11 Apr 2014 15:03:08 GMT"}, > {"etag","\"abf551bf9c340cc2649822f9e27e82ff\""}, > {"vary","Accept-Encoding"}, > {"content-length","41024"}, > {"content-type","text/html; charset=utf-8"}, > {"last-modified","Thu, 30 Jan 2014 17:12:43 GMT"}, > {"access-control-allow-methods","POST, GET, OPTIONS"}, > {"access-control-allow-origin","*"}, > {"access-control-max-age","1728000"}, > {"set-cookie", > "_session_id=613ae6fdb421a8eb1cbc1d43509c4d53; path=/; expires=Fri, > 18-Apr-2014 15:03:08 GMT; HttpOnly"}, > {"status","200 OK"}, > {"x-rack-cache","miss"}, > {"x-request-id","9b2a35c1-f4c8-47fa-bcdc-e7f80090fe72"}, > {"x-runtime","1.182360"}, > {"x-ua-compatible","IE=Edge,chrome=1"}], > [60,33,68,79,67,84,89,80,69,32,104,116,109,108,62,60,104, > 116,109,108,62,60,104,101|...]}} > > Regards Ingela Erlang/OTP team - Ericsson AB > > > 2014-04-11 16:53 GMT+02:00 atul atri : > > Hi Ingela, >> >> I just tested this issue with erlang 17. This issue is not fixed. >> >> ============= >> [root@REDACTED otp_src_17.0]# erl >> Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10] >> [hipe] [kernel-poll:false] >> >> Eshell V6.0 (abort with ^G) >> 1> inets:start(). >> ok >> 2> ssl:start(). >> ok >> 3> httpc:request("https://somewhere.com"). >> >> {error,{failed_connect,[{to_address,{"somewhere.com", >> 443}}, >> {inet,[inet], >> >> {eoptions,{{function_clause,[{tls_connection,handle_alert, >> >> [{alert,1,112,{"tls_connection.erl",375}}, >> >> hello, >> >> {state,client, >> >> {#Ref<0.0.0.63>,<0.57.0>}, >> >> gen_tcp,tls_connection,tcp,tcp_closed,tcp_error,...}], >> >> [{file,"tls_connection.erl"},{line,836}]}, >> >> {tls_connection,handle_alerts,2, >> >> [{file,"tls_connection.erl"},{line,834}]}, >> >> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, >> >> >> {proc_lib,init_p_do_apply,3, >> >> [{file,"proc_lib.erl"},{line,239}]}]}, >> >> {gen_fsm,sync_send_all_state_event, >> >> [<0.61.0>,{start,infinity},infinity]}}}}]}} >> ================= >> >> Server sends alert warning 112 (unrecognized_name), but >> tls_connection.erl has no function to handle this alert. ssl_alert.hrl do >> mention this alert. >> >> I also found >> http://stackoverflow.com/questions/7615645/ssl-handshake-alert-unrecognized-name-error-since-upgrade-to-java-1-7-0. >> Java 1.7 is also behaving kind of same. I have not tested myself though. As >> first answer mentions, that most choose to ignore server alert warning 112 >> (unrecognized_name). Erlang/Otp should also consider to ignore it. This >> thread mentions that we can disable SNI in java 1.7. Do we have similar >> option in Erlang/Otp? Is disabling SNI right choice? >> >> Adding following function in tls_connection.erl solves the problem: >> ========= >> handle_alert(#alert{level = ?WARNING, description = ?UNRECOGNISED_NAME} = >> Alert, StateName, >> #state{ssl_options = SslOpts} = State0) -> >> log_alert(SslOpts#ssl_options.log_alert, StateName, Alert), >> {Record, State} = next_record(State0), >> next_state(StateName, StateName, Record, State). >> =========== >> >> This issue supposed to be fixed in >> https://github.com/erlang/otp/commit/d18e7b25a17a0c62c0beddc81f23b1dea18b7ef4. >> But It seems like you forgot to commit changes in file tls_connection.erl. >> >> Waiting for your kind reply to sort out this issue asap. >> >> Thanks & Regards, >> Atul Atri. >> >> >> >> >> >> On Fri, Apr 4, 2014 at 7:10 PM, Ingela Andin wrote: >> >>> Hi! >>> >>> This is fixed in the latest version 17.0 (comming soon) or check master >>> branch at github. >>> >>> Regards Ingela Erlang/OTP team - Ericsson AB >>> >>> >>> 2014-04-04 10:33 GMT+02:00 atul atri : >>> >>>> Hi, >>>> >>>> I am using httpc to connect to a website that is using invalid >>>> certificate. But it is crashing while ssl handshake. >>>> >>>> ====== >>>> 7> httpc:request(post, {"https://somewhere.com", [], >>>> "application/x-www-form-urlencoded", ""}, [{ssl, [{verify, verify_none}]}], >>>> []). {error,{failed_connect,[{to_address,{" >>>> somewhere.com", >>>> 443}}, >>>> {inet,[inet], >>>> >>>> {eoptions,{{function_clause,[{tls_connection,handle_alert, >>>> >>>> [{alert,1,112,{"tls_connection.erl",375}}, >>>> >>>> hello, >>>> >>>> {state,client, >>>> >>>> {#Ref<0.0.0.137>,<0.74.0>}, >>>> >>>> gen_tcp,tls_connection,tcp,tcp_closed,tcp_error,...}], >>>> >>>> [{file,"tls_connection.erl"},{line,834}]}, >>>> >>>> {tls_connection,handle_alerts,2, >>>> >>>> [{file,"tls_connection.erl"},{line,832}]}, >>>> >>>> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]}, >>>> >>>> {proc_lib,init_p_do_apply,3, >>>> >>>> [{file,"proc_lib.erl"},{line,239}]}]}, >>>> >>>> {gen_fsm,sync_send_all_state_event, >>>> >>>> [<0.75.0>,{start,infinity},infinity]}}}}]}} >>>> ======= >>>> >>>> I am able to browse website in Firefox. >>>> >>>> My elang version is >>>> ==== >>>> [root@REDACTED ~]# erl >>>> Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:2:2] >>>> [async-threads:10] [hipe] [kernel-poll:false] >>>> >>>> Eshell V5.10.4 (abort with ^G) >>>> ==== >>>> >>>> I googled it and it looks some thing related to >>>> http://permalink.gmane.org/gmane.comp.lang.erlang.bugs/4302. >>>> >>>> Any help to fix or work around this is much appreciated. >>>> >>>> Thanks & Regards, >>>> Atul Atri. >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From txrev319@REDACTED Sat Apr 12 02:48:30 2014 From: txrev319@REDACTED (t x) Date: Fri, 11 Apr 2014 17:48:30 -0700 Subject: [erlang-questions] cowboy: dispatch on chrome/firefox vs android/iphone Message-ID: Hi, Using cowboy, is there a easy way to, for: mysite.com/ serve * ~/static/desktop.html if browser = chrome/firefox * ~/static/mobile.html if browser = android/iphone ? (Sample code to steal would be ideal; though functions to lookup suffices too.) Thanks! From kenji@REDACTED Sat Apr 12 03:16:13 2014 From: kenji@REDACTED (Kenji Rikitake) Date: Sat, 12 Apr 2014 10:16:13 +0900 Subject: [erlang-questions] Erlang 17 issue with dialyzer and nowarn_deprecated_type In-Reply-To: References: Message-ID: <20140412011613.GA84595@k2r.org> See OTP-10342 at http://www.erlang.org/download/otp_src_17.0.readme. Quote: A compiler option, nowarn_deprecated_type, has been introduced. By including the attribute -compile(nowarn_deprecated_type). in an Erlang source file, warnings about deprecated types can be avoided in Erlang/OTP 17.0. The option can also be given as a compiler flag: erlc +nowarn_deprecated_type file.erl Unquote. Kenji Rikitake ++> Shayan Pooya [2014-04-11 10:03:05 -0400]: > Date: Fri, 11 Apr 2014 10:03:05 -0400 > From: Shayan Pooya > To: "erlang-questions@REDACTED" > Subject: [erlang-questions] Erlang 17 issue with dialyzer and > nowarn_deprecated_type > > Hello, > > In order to make Disco compile with Erlang 17 without warnings, I added > nowarn_deprecated_type to silence the warnings. However, after doing so, > dialyzer fails with the following error: > > ddfs_master.erl:345: Attempt to test for inequality between a term of type > 'false' and a term of opaque type 'false' | gb_set() > > > ( > https://github.com/discoproject/disco/blob/develop/master/src/ddfs/ddfs_master.erl#L345 > ) > > > Oddly enough, a simple s/gb_set()/gb_sets:gb_set()/g in this file fixes > this issue but I do not want to do that since it breaks the builds for > older versions (and that's the reason nowarn_deprecated_type has been > added). > > Any suggestions? The error message itself does not make much sense to me. > > Regards. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From kenji@REDACTED Sat Apr 12 04:15:00 2014 From: kenji@REDACTED (Kenji Rikitake) Date: Sat, 12 Apr 2014 11:15:00 +0900 Subject: [erlang-questions] Cannot build a work vm on FreeBSD with dtrace AND enable dirty-schedulers In-Reply-To: References: Message-ID: <20140412021500.GB84595@k2r.org> The dirty scheduler on FreeBSD 10-STABLE on a *non-VM native* machine (Core i5, 16GB RAM) works alright here with both gcc47 and *clang*. I'm using kerl. I suspect it's a VirtualBox-on-Ubuntu problem. uname -a: FreeBSD minimax.priv.k2r.org 10.0-STABLE FreeBSD 10.0-STABLE #33 r264285: Wed Apr 9 09:25:02 JST 2014 root@REDACTED:/usr/obj/usr/src/sys/K2RKERNEL amd64 .kerlrc setting: # since .kerl is a dot file for /bin/sh, exporting inside the environment will define the env variables # NOTE WELL: these export command will affect *your login environment* when activating curl! # for clang with concurrent make export CC=clang CXX=clang CFLAGS="-g -O3 -fstack-protector" LDFLAGS="-fstack-protector" MAKEFLAGS="-j" # for gcc47 #export CC=gcc47 CXX=gcc47 CFLAGS="-g -O3 -fomit-frame-pointer -fstack-protector" LDFLAGS="-fstack-protector" MAKEFLAGS="-j" # KERL_CONFIGURE_OPTIONS="--disable-native-libs --enable-vm-probes --with-dynamic-trace=dtrace --with-ssl=/usr/local --with-javac --enable-hipe --enable-kernel-poll --with-wx-config=/usr/local/bin/wxgtk2u-2.8-config --without-odbc --enable-threads --enable-sctp --enable-smp-support -enable-dirty-schedulers --disable-silent-rules" erl shell output: Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] Eshell V6.0 (abort with ^G) 1> erlang:system_info(dirty_cpu_schedulers). 4 2> Kenji Rikitake ++> Wu Ray [2014-04-11 12:30:02 +0800]: > Date: Fri, 11 Apr 2014 12:30:02 +0800 > From: Wu Ray > To: erlang-questions@REDACTED > Subject: [erlang-questions] Cannot build a work vm on FreeBSD with dtrace > AND enable dirty-schedulers > > Hi, list > > I cannot build a working erlang 17 on FreeBSD 10.0, with dtrace AND enabled > dirty-schedulers at the same time, that's my steps: > ./configure --with-dynamic-trace=dtrace --enable-dirty-schedulers > gmake > > then, the build erl vm just quit with: > Segmentation fault(core dumped) > > I've tried gcc47, same result. > CC=gcc47 CXX=g++47 ./configure --with-dynamic-trace=dtrace > --enable-dirty-schedulers > > if I build with-dtrace OR enable dirty-schedulers separately, the VMs run > well. > but the dirty-schedulers number looks strange: > > Erlang/OTP 17 [erts-6.0] [source] [64-bit] > [ds:10:5851653:18446744073709551611] [async-threads:38554976] [hipe] > [kernel-poll:] > > Eshell V6.0 (abort with ^G) > 1> erlang:system_info(dirty_cpu_schedulers). > ** exception error: bad argument > in function erlang:system_info/1 > called as erlang:system_info(dirty_cpu_schedulers) > > > And, gcc48 cannot build a working VM with enabled dirty-schedulers, the vm > quit with Segmentation fault. > > BTW: my FreeBSD 10.0 is running in VirtualBox 4.3.10 on Ubuntu13.10 > > > regards, > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From shayan@REDACTED Sat Apr 12 03:58:05 2014 From: shayan@REDACTED (Shayan Pooya) Date: Fri, 11 Apr 2014 21:58:05 -0400 Subject: [erlang-questions] Erlang 17 issue with dialyzer and nowarn_deprecated_type In-Reply-To: <20140412011613.GA84595@k2r.org> References: <20140412011613.GA84595@k2r.org> Message-ID: Kenji: Thanks for the response, but my question was about the dialyzer error *with* this option given to the compiler. On Fri, Apr 11, 2014 at 9:16 PM, Kenji Rikitake wrote: > See OTP-10342 at http://www.erlang.org/download/otp_src_17.0.readme. > > Quote: > > A compiler option, nowarn_deprecated_type, has been > introduced. By including the attribute > > -compile(nowarn_deprecated_type). > > in an Erlang source file, warnings about deprecated types can > be avoided in Erlang/OTP 17.0. > > The option can also be given as a compiler flag: > > erlc +nowarn_deprecated_type file.erl > > Unquote. > > Kenji Rikitake > > ++> Shayan Pooya [2014-04-11 10:03:05 -0400]: > > Date: Fri, 11 Apr 2014 10:03:05 -0400 > > From: Shayan Pooya > > To: "erlang-questions@REDACTED" > > Subject: [erlang-questions] Erlang 17 issue with dialyzer and > > nowarn_deprecated_type > > > > Hello, > > > > In order to make Disco compile with Erlang 17 without warnings, I added > > nowarn_deprecated_type to silence the warnings. However, after doing so, > > dialyzer fails with the following error: > > > > ddfs_master.erl:345: Attempt to test for inequality between a term of > type > > 'false' and a term of opaque type 'false' | gb_set() > > > > > > ( > > > https://github.com/discoproject/disco/blob/develop/master/src/ddfs/ddfs_master.erl#L345 > > ) > > > > > > Oddly enough, a simple s/gb_set()/gb_sets:gb_set()/g in this file fixes > > this issue but I do not want to do that since it breaks the builds for > > older versions (and that's the reason nowarn_deprecated_type has been > > added). > > > > Any suggestions? The error message itself does not make much sense to > me. > > > > Regards. > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Sat Apr 12 07:43:26 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sat, 12 Apr 2014 01:43:26 -0400 (EDT) Subject: [erlang-questions] Erlang make out Message-ID: <1397281406.49314842@apps.rackspace.com> Hello, A heap of Googling and a recent thread on Erlang Questions suggests that there is little unanimity on the best way to organize and make large (multiple application) Erlang systems--- Erlang make, GNU make, Sinan, Rebar, erlang.mk, erl.mk, yada, yada. Enough to give a noob a colossal headache. Two questions: 1) Is this a matter of reinventing the wheel? Or are there sound technical reasons for so many options? 2) Is there an emerging consensus? Thanks, LRP From bchesneau@REDACTED Sat Apr 12 10:41:27 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sat, 12 Apr 2014 10:41:27 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <20140410182218.GI19145@ferdair.local> References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> <20140410182218.GI19145@ferdair.local> Message-ID: I tend to think like Fred. Between `apps/*` and having 1 repo per app, I think it all depends the way your are coding how how independent the apps are. Also depends how big you are. I tend to use the apps/ structure when I need to have different supervision strategy / apps but apps are not useful by themselves. Or at least at this stage not enough isolated to be used by themselves. Another reason for that is that it make sometimes really difficult to test a *product* update that goes over different apps, if they are isolated: - you have to make sure to use the correct branch / apps - you need to dl/link each apps - you need to communicate to other what you're doing, freezing some branches, etc.. All of this requires a mechanic, that - if manageable - takes times. (Changing he makefile to point to the right branch, communicate overseas, sync the source repo, updating the release to tell we are testing such feature...) and need to be done very carefully once you have more than one developer working on your product. I'm thinking that most of the time when your product needs to use self-dependent apps it's more solid to take a cathedral logic: keeping these apps in one place and update them. (the apps/* folder similar to the /usr and / folder on bsd systems). I am only speaking about core applications - the one you invent/write -. Imo you only need to split them as independent applications, when you think that their code could be used independently (and want to support it as a standalone app) or habe become optional in your core application. SInce your applications may use applications coming from external, you still need a way to handle external depencies though. And then we are back to my question ;) I originally tested the cloudi approach, but I wonder how do you support bugs and features request? What happen if someone post you a patch on the Cloudi repository instead of the standalone apps? Can really cloudi works only with its core? I mean is the core like riak_core be usable by itself ? (don't see any offense in these questions, I just don't know). I also tested erlang.mk, + erl.mk and was aware about the deps passed as variable in the makefile, but I didn't test it yet how it works with C binding. For example I wonder how Garrett does with erlang-czmq to embed it in another application with only the makefile. With rebar it's quite easy, but with erlang.mk how does it works? (in the case you have have 1 app depending from erlang-czmq and building from it). - benoit On Thu, Apr 10, 2014 at 8:22 PM, Fred Hebert wrote: > That's all fine by me too. As I said, the apps/* layout is a layout I'd > love to see get better support overall (I am mostly using rebar, which > does a lot of things halfway for that pattern, and relx, which does it > right). > > I'm in no position to tell tool builders what to do or how to write > their code -- I'm free to go around and fix it myself. If erlang.mk > allows to override behavior (you did mention using a top-level makefile > to make things work), that's usually good enough and will let people fix > things the way they need it. > > Rebar makes it more complex because of how it builds its list of path > for transient deps (it needs to go down the directories recursively, as > with a 'compile' command or by specifying -r) -- which often conflicts > with running commands within a single directory (apps/ but not deps/). > This is what requires, for CT, calling 'rebar ct -r skip_deps=true', > which is far from obvious. > > But I felt like I should defend the directory structure I feel makes the > more sense for release-building, and therefore that I would like to see > love given for from tool builders :) > > Regards, > Fred. > > On 04/10, Lo?c Hoguin wrote: > > Another clarification. > > > > On 04/10/2014 08:10 PM, Lo?c Hoguin wrote: > > >Just want to make sure one thing is clear. > > > > > >On 04/10/2014 07:52 PM, Fred Hebert wrote: > > >>If you end up having to pay that price purely because the build tool > you > > >>settled for was opinionated about whether the apps in the apps/ or lib/ > > >>directory need to be checked out from other repositories or if they can > > >>be in there already, fix that build tool of yours, because it's > > >>clearly making decisions it should not be making. > > >> > > >>What's more important is that a tool that supports both the apps/* and > > >>the OTP app model can be able to also support *both* of these workflows > > >>(using deps or not to build the release), depending on which is > > >>appropriate for your project, team, and/or community. > > >> > > >>Denying people a way to organize their own workflow because of your > > >>personal opinion when the end result for the files on disk is the exact > > >>same (someone just disagrees about how they ended up there), to me, > > >>tells me that maybe your tool is a bit too opinionated and may need to > > >>take a step back. > > > > > >With regards to erlang.mk, there's nothing to fix. There's nothing it > > >does that prevent you from using the apps/* layout. There's nothing in > > >it that makes it all happen for you either, because that's simply not > > >the goal of the tool. But it can still fit very easily in an apps/* > > >layout, as demonstrated by the gist previously posted. IRCCloud is one > > >such big project that uses both erlang.mk and an apps/* layout, all > > >without any problems AFAIK. > > > > > >erlang.mk will always focus on one OTP application because that's what > > >it's designed to do well. Making it work on two different scopes just > > >makes everything harder, and then you end up with nonsense like "rebar > > >ct compile -r skip_deps=true" (quoting you) to make it do what you want. > > >I do not want that. On the other hand I want to give greater power to > > > > "I do not want that" refers to supporting the two scopes in erlang.mk > > itself. It is of course very easy to have two different scopes that do > > exactly what you want by simply having one Makefile at the top-level and > one > > Makefile for each application. There's nothing preventing you to achieve > > that in a clean manner. > > > > I will not provide a .mk file for the apps/* layout because I do not use > it > > and have no idea what it should do, but I probably would accept a > community > > supported "apps/* layout" file in the repository. As long as it's in a > > contrib/ directory or something of course. > > > > >the user to override or complement the default behavior, and that > > >alongside Windows support is most of the work that remains to be done > > >for erlang.mk 1.0. (Not that you can't change its behavior already > -it's > > >a text file after all!- but I want to make it even simpler.) > > > > > >tl;dr Do one thing and do it well; do it right by default but allow > > >overriding its behavior easily. > > > > -- > > Lo?c Hoguin > > http://ninenines.eu > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Sat Apr 12 11:17:52 2014 From: g@REDACTED (Garrett Smith) Date: Sat, 12 Apr 2014 11:17:52 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> <20140410182218.GI19145@ferdair.local> Message-ID: On Sat, Apr 12, 2014 at 10:41 AM, Benoit Chesneau wrote: > I also tested erlang.mk, + erl.mk and was aware about the deps passed as > variable in the makefile, but I didn't test it yet how it works with C > binding. For example I wonder how Garrett does with erlang-czmq to embed it > in another application with only the makefile. With rebar it's quite easy, > but with erlang.mk how does it works? (in the case you have have 1 app > depending from erlang-czmq and building from it). I just did this the other day -- I added erlang-czmq to an uber container project with 20+ apps. I copied top-level dir from the github repo under a "lib" directory and it just worked. I've done this with a variety of apps though -- some rebar, others a home brewed Makefile, etc. -- and sometimes there is tweaking. The top-level Makefile is very straight forward to write -- scanning through this libs/apps dir and running "make" along the way. As cryptic as they can be, I've found Makefiles incomparably simpler to work with than rebar, at least as far as understanding what the tool is doing and why. Btw, I have a change to erlang.mk (I haven't assembled for Loic yet) that looks for a configure file under a project and runs it to generate a Makefile if one doesn't already exist. This is to accommodate the awesome build process for erlang-czmq that you (Benoit) drove :) Garrett From mjtruog@REDACTED Sat Apr 12 11:35:29 2014 From: mjtruog@REDACTED (Michael Truog) Date: Sat, 12 Apr 2014 02:35:29 -0700 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> <20140410182218.GI19145@ferdair.local> Message-ID: <534908E1.5040302@gmail.com> On 04/12/2014 01:41 AM, Benoit Chesneau wrote: > I tend to think like Fred. Between `apps/*` and having 1 repo per app, I think it all depends the way your are coding how how independent the apps are. Also depends how big you are. > > I tend to use the apps/ structure when I need to have different supervision strategy / apps but apps are not useful by themselves. Or at least at this stage not enough isolated to be used by themselves. Another reason for that is that it make sometimes really difficult to test a *product* update that goes over different apps, if they are isolated: > > - you have to make sure to use the correct branch / apps > - you need to dl/link each apps > - you need to communicate to other what you're doing, freezing some branches, etc.. > > All of this requires a mechanic, that - if manageable - takes times. (Changing he makefile to point to the right branch, communicate overseas, sync the source repo, updating the release to tell we are testing such feature...) and need to be done very carefully once you have more than one developer working on your product. I'm thinking that most of the time when your product needs to use self-dependent apps it's more solid to take a cathedral logic: keeping these apps in one place and update them. (the apps/* folder similar to the /usr and / folder on bsd systems). I am only speaking about core applications - the one you invent/write -. Imo you only need to split them as independent applications, when you think that their code could be used independently (and want to support it as a standalone app) or habe become optional in your core application. > > SInce your applications may use applications coming from external, you still need a way to handle external depencies though. And then we are back to my question ;) > > I originally tested the cloudi approach, but I wonder how do you support bugs and features request? What happen if someone post you a patch on the Cloudi repository instead of the standalone apps? Can really cloudi works only with its core? I mean is the core like riak_core be usable by itself ? (don't see any offense in these questions, I just don't know). With the (main) CloudI repository at https://github.com/CloudI/CloudI all the dependencies are contained within the repository (with a README that describes where the code has come from with details, commit, authors, etc.) for the sake of having a stable platform. Also, since CloudI wants to support private cloud installations, it wants to have only a single installable source which is transparent. The other CloudI repository https://github.com/CloudI/cloudi_core and the associated https://github.com/CloudI/cloudi_service_* repositories are relying on rebar deps for their dependencies. Both approaches work, but the rebar deps method of doing things can be prone to problems if tags are not being used or if tags are changed for a dependency, or even if a dependency history is rewritten. Having all the dependencies in the main repo requires tracking the dependencies for changes manually, which is more time consuming but helps protect the stability of the main project, despite the service isolation (present in CloudI) that almost all the dependencies utilize. So, this choice really depends on your stability requirements and your testing for verification of new dependencies, it all takes time, and the goal is to avoid failures in the source code. If you do go the rebar deps route, it generally is best if you don't checkin a rebar binary that lacks transparency (into your source code repo, this has been a problem in the past) and if you use tags for your external dependencies to lock down the potential problems partially. > > I also tested erlang.mk , + erl.mk and was aware about the deps passed as variable in the makefile, but I didn't test it yet how it works with C binding. For example I wonder how Garrett does with erlang-czmq to embed it in another application with only the makefile. With rebar it's quite easy, but with erlang.mk how does it works? (in the case you have have 1 app depending from erlang-czmq and building from it). > > > - benoit > > > > > On Thu, Apr 10, 2014 at 8:22 PM, Fred Hebert > wrote: > > That's all fine by me too. As I said, the apps/* layout is a layout I'd > love to see get better support overall (I am mostly using rebar, which > does a lot of things halfway for that pattern, and relx, which does it > right). > > I'm in no position to tell tool builders what to do or how to write > their code -- I'm free to go around and fix it myself. If erlang.mk > allows to override behavior (you did mention using a top-level makefile > to make things work), that's usually good enough and will let people fix > things the way they need it. > > Rebar makes it more complex because of how it builds its list of path > for transient deps (it needs to go down the directories recursively, as > with a 'compile' command or by specifying -r) -- which often conflicts > with running commands within a single directory (apps/ but not deps/). > This is what requires, for CT, calling 'rebar ct -r skip_deps=true', > which is far from obvious. > > But I felt like I should defend the directory structure I feel makes the > more sense for release-building, and therefore that I would like to see > love given for from tool builders :) > > Regards, > Fred. > > On 04/10, Lo?c Hoguin wrote: > > Another clarification. > > > > On 04/10/2014 08:10 PM, Lo?c Hoguin wrote: > > >Just want to make sure one thing is clear. > > > > > >On 04/10/2014 07:52 PM, Fred Hebert wrote: > > >>If you end up having to pay that price purely because the build tool you > > >>settled for was opinionated about whether the apps in the apps/ or lib/ > > >>directory need to be checked out from other repositories or if they can > > >>be in there already, fix that build tool of yours, because it's > > >>clearly making decisions it should not be making. > > >> > > >>What's more important is that a tool that supports both the apps/* and > > >>the OTP app model can be able to also support *both* of these workflows > > >>(using deps or not to build the release), depending on which is > > >>appropriate for your project, team, and/or community. > > >> > > >>Denying people a way to organize their own workflow because of your > > >>personal opinion when the end result for the files on disk is the exact > > >>same (someone just disagrees about how they ended up there), to me, > > >>tells me that maybe your tool is a bit too opinionated and may need to > > >>take a step back. > > > > > >With regards to erlang.mk , there's nothing to fix. There's nothing it > > >does that prevent you from using the apps/* layout. There's nothing in > > >it that makes it all happen for you either, because that's simply not > > >the goal of the tool. But it can still fit very easily in an apps/* > > >layout, as demonstrated by the gist previously posted. IRCCloud is one > > >such big project that uses both erlang.mk and an apps/* layout, all > > >without any problems AFAIK. > > > > > >erlang.mk will always focus on one OTP application because that's what > > >it's designed to do well. Making it work on two different scopes just > > >makes everything harder, and then you end up with nonsense like "rebar > > >ct compile -r skip_deps=true" (quoting you) to make it do what you want. > > >I do not want that. On the other hand I want to give greater power to > > > > "I do not want that" refers to supporting the two scopes in erlang.mk > > itself. It is of course very easy to have two different scopes that do > > exactly what you want by simply having one Makefile at the top-level and one > > Makefile for each application. There's nothing preventing you to achieve > > that in a clean manner. > > > > I will not provide a .mk file for the apps/* layout because I do not use it > > and have no idea what it should do, but I probably would accept a community > > supported "apps/* layout" file in the repository. As long as it's in a > > contrib/ directory or something of course. > > > > >the user to override or complement the default behavior, and that > > >alongside Windows support is most of the work that remains to be done > > >for erlang.mk 1.0. (Not that you can't change its behavior already -it's > > >a text file after all!- but I want to make it even simpler.) > > > > > >tl;dr Do one thing and do it well; do it right by default but allow > > >overriding its behavior easily. > > > > -- > > Lo?c Hoguin > > http://ninenines.eu > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksoe@REDACTED Sat Apr 12 13:05:03 2014 From: eriksoe@REDACTED (=?ISO-8859-1?Q?Erik_S=F8e_S=F8rensen?=) Date: Sat, 12 Apr 2014 13:05:03 +0200 Subject: [erlang-questions] Erlang make out In-Reply-To: <1397281406.49314842@apps.rackspace.com> References: <1397281406.49314842@apps.rackspace.com> Message-ID: [Off-topic] Wellp, there's my next Erlang project name: yada - "yet another distributed application" ;-) Den 12/04/2014 08.25 skrev : > Hello, > > A heap of Googling and a recent thread on Erlang Questions suggests that > there is little unanimity on the best way to organize and make large > (multiple application) Erlang systems--- Erlang make, GNU make, Sinan, > Rebar, erlang.mk, erl.mk, yada, yada. Enough to give a noob a colossal > headache. > > Two questions: > > 1) Is this a matter of reinventing the wheel? Or are there sound technical > reasons for so many options? > > 2) Is there an emerging consensus? > > Thanks, > > LRP > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Sat Apr 12 14:23:22 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Sat, 12 Apr 2014 14:23:22 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: <53465ED3.2020409@gmail.com> <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> <20140410182218.GI19145@ferdair.local> Message-ID: <5349303A.4030000@ninenines.eu> When I read this and Fred's posts there's something that strikes me though. It sounds to me that the only way this can work in a team is if you misuse git. Git is made for non-linear development: that is, someone forks your repository, does changes, then sends a patch and you merge it, with one repository = one user. If you do non-linear development with the apps/* layout where you have to always make sure the whole code is synced, this makes it pretty hard to merge things, especially bigger changes. Basically the guy merging things would be doing nothing else than make sure it works. So I'm guessing you guys must be having more than one committer per repository, which comes with its own set of problems, but sounds more workable than my initial assumptions. But it also makes it more difficult to push things, because the number of things you must take care of increases, and everytime something new gets added before you could push, you have to test again or risk breaking things. To take a well known example, look at what OTP does. Basically they pull patches, put them in a nightly test build and then depending on the results can decide whether to merge things. Now imagine how faster it could be if when you send a patch to the ssl app you don't have to worry about anything else? It could be tested faster, you would get feedback faster and fix things faster and get it merged faster. Smaller iterations = faster development speed. Now OTP would still need to do nightly test of everything, but they would only need to do so when they bump the version of an included application. Of course in the case of your smaller "big" repositories where you only need to support one target OS and Erlang version you don't run into these issues. I suppose you are in a sweet spot where doing things the messy way doesn't stabs you in the back too much and you can live with it. But add proper support for more combinations of OS and Erlang versions and you'll start suffering. (Or I suppose you could do it wrong again, use travis-ci and not care if your repository gets broken and just fix it afterwards, which also means you won't be able to use git bisect etc.) tl;dr A rant that probably makes little sense to you. But you know, whatever works. On 04/12/2014 10:41 AM, Benoit Chesneau wrote: > I tend to think like Fred. Between `apps/*` and having 1 repo per app, I > think it all depends the way your are coding how how independent the > apps are. Also depends how big you are. > > I tend to use the apps/ structure when I need to have different > supervision strategy / apps but apps are not useful by themselves. Or at > least at this stage not enough isolated to be used by themselves. > Another reason for that is that it make sometimes really difficult to > test a *product* update that goes over different apps, if they are isolated: > > - you have to make sure to use the correct branch / apps > - you need to dl/link each apps > - you need to communicate to other what you're doing, freezing some > branches, etc.. > > All of this requires a mechanic, that - if manageable - takes times. > (Changing he makefile to point to the right branch, communicate > overseas, sync the source repo, updating the release to tell we are > testing such feature...) and need to be done very carefully once you > have more than one developer working on your product. I'm thinking that > most of the time when your product needs to use self-dependent apps it's > more solid to take a cathedral logic: keeping these apps in one place > and update them. (the apps/* folder similar to the /usr and / folder on > bsd systems). I am only speaking about core applications - the one you > invent/write -. Imo you only need to split them as independent > applications, when you think that their code could be used independently > (and want to support it as a standalone app) or habe become optional in > your core application. > > SInce your applications may use applications coming from external, you > still need a way to handle external depencies though. And then we are > back to my question ;) > > I originally tested the cloudi approach, but I wonder how do you support > bugs and features request? What happen if someone post you a patch on > the Cloudi repository instead of the standalone apps? Can really cloudi > works only with its core? I mean is the core like riak_core be usable by > itself ? (don't see any offense in these questions, I just don't know). > > I also tested erlang.mk , + erl.mk and > was aware about the deps passed as variable in the makefile, but I > didn't test it yet how it works with C binding. For example I wonder how > Garrett does with erlang-czmq to embed it in another application with > only the makefile. With rebar it's quite easy, but with erlang.mk > how does it works? (in the case you have have 1 app > depending from erlang-czmq and building from it). > > > - benoit > > > > > On Thu, Apr 10, 2014 at 8:22 PM, Fred Hebert > wrote: > > That's all fine by me too. As I said, the apps/* layout is a layout I'd > love to see get better support overall (I am mostly using rebar, which > does a lot of things halfway for that pattern, and relx, which does it > right). > > I'm in no position to tell tool builders what to do or how to write > their code -- I'm free to go around and fix it myself. If erlang.mk > > allows to override behavior (you did mention using a top-level makefile > to make things work), that's usually good enough and will let people fix > things the way they need it. > > Rebar makes it more complex because of how it builds its list of path > for transient deps (it needs to go down the directories recursively, as > with a 'compile' command or by specifying -r) -- which often conflicts > with running commands within a single directory (apps/ but not deps/). > This is what requires, for CT, calling 'rebar ct -r skip_deps=true', > which is far from obvious. > > But I felt like I should defend the directory structure I feel makes the > more sense for release-building, and therefore that I would like to see > love given for from tool builders :) > > Regards, > Fred. > > On 04/10, Lo?c Hoguin wrote: > > Another clarification. > > > > On 04/10/2014 08:10 PM, Lo?c Hoguin wrote: > > >Just want to make sure one thing is clear. > > > > > >On 04/10/2014 07:52 PM, Fred Hebert wrote: > > >>If you end up having to pay that price purely because the build > tool you > > >>settled for was opinionated about whether the apps in the apps/ > or lib/ > > >>directory need to be checked out from other repositories or if > they can > > >>be in there already, fix that build tool of yours, because it's > > >>clearly making decisions it should not be making. > > >> > > >>What's more important is that a tool that supports both the > apps/* and > > >>the OTP app model can be able to also support *both* of these > workflows > > >>(using deps or not to build the release), depending on which is > > >>appropriate for your project, team, and/or community. > > >> > > >>Denying people a way to organize their own workflow because of your > > >>personal opinion when the end result for the files on disk is > the exact > > >>same (someone just disagrees about how they ended up there), to me, > > >>tells me that maybe your tool is a bit too opinionated and may > need to > > >>take a step back. > > > > > >With regards to erlang.mk , there's nothing to > fix. There's nothing it > > >does that prevent you from using the apps/* layout. There's > nothing in > > >it that makes it all happen for you either, because that's > simply not > > >the goal of the tool. But it can still fit very easily in an apps/* > > >layout, as demonstrated by the gist previously posted. IRCCloud > is one > > >such big project that uses both erlang.mk and > an apps/* layout, all > > >without any problems AFAIK. > > > > > >erlang.mk will always focus on one OTP > application because that's what > > >it's designed to do well. Making it work on two different scopes > just > > >makes everything harder, and then you end up with nonsense like > "rebar > > >ct compile -r skip_deps=true" (quoting you) to make it do what > you want. > > >I do not want that. On the other hand I want to give greater > power to > > > > "I do not want that" refers to supporting the two scopes in > erlang.mk > > itself. It is of course very easy to have two different scopes > that do > > exactly what you want by simply having one Makefile at the > top-level and one > > Makefile for each application. There's nothing preventing you to > achieve > > that in a clean manner. > > > > I will not provide a .mk file for the apps/* layout because I do > not use it > > and have no idea what it should do, but I probably would accept a > community > > supported "apps/* layout" file in the repository. As long as it's > in a > > contrib/ directory or something of course. > > > > >the user to override or complement the default behavior, and that > > >alongside Windows support is most of the work that remains to be > done > > >for erlang.mk 1.0. (Not that you can't change > its behavior already -it's > > >a text file after all!- but I want to make it even simpler.) > > > > > >tl;dr Do one thing and do it well; do it right by default but allow > > >overriding its behavior easily. > > > > -- > > Lo?c Hoguin > > http://ninenines.eu > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Lo?c Hoguin http://ninenines.eu From mononcqc@REDACTED Sat Apr 12 15:39:46 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Sat, 12 Apr 2014 09:39:46 -0400 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <5349303A.4030000@ninenines.eu> References: <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> <20140410182218.GI19145@ferdair.local> <5349303A.4030000@ninenines.eu> Message-ID: <20140412133945.GD22866@ferdmbp.local> On 04/12, Lo?c Hoguin wrote: > When I read this and Fred's posts there's something that strikes me though. > It sounds to me that the only way this can work in a team is if you misuse > git. Git is made for non-linear development: that is, someone forks your > repository, does changes, then sends a patch and you merge it, with one > repository = one user. If you do non-linear development with the apps/* > layout where you have to always make sure the whole code is synced, this > makes it pretty hard to merge things, especially bigger changes. Basically > the guy merging things would be doing nothing else than make sure it works. > Well, first, not everyone will use git (we do), and the workflow of a language shouldn't be so intricately tied to its version control tool unless we desire the language practice to end the next time a new version control tool supercedes whatever we're using right now. > So I'm guessing you guys must be having more than one committer per > repository, which comes with its own set of problems, but sounds more > workable than my initial assumptions. But it also makes it more difficult to > push things, because the number of things you must take care of increases, > and everytime something new gets added before you could push, you have to > test again or risk breaking things. > We do have multiple committers per repository on Heroku's routing team -- along with a policy of code review and peer approval of changes so that more than one person knows what is going on in a code base, both in order to catch errors, and spread knowledge to reduce our bus factor. Anyway, that's where communication is important. Smaller change sets can be done by just merging branches the way you would regularly. Git or hg or whatever should be clever enough to do 5 merges in 5 repos, or do one merge of 5 files in different directories that have the same independence in terms of what they contain. The challenge here is coordinating changes and development efforts through bugfixes, feature development, improvements, and so on. One way to do it is to just merge back into master what is stable and ready to be deployed. Then you test it again once it's merged to make sure nothing exploded, and then cut a branch or a tag that is deployable from there. The rest can keep being done concurrently through branches and forks as much as you want. In my opinion, the challenge is people and coordinating their efforts, not the toolset used, although it can be a hindering or enhancing factor. > To take a well known example, look at what OTP does. Basically they pull > patches, put them in a nightly test build and then depending on the results > can decide whether to merge things. Now imagine how faster it could be if > when you send a patch to the ssl app you don't have to worry about anything > else? It could be tested faster, you would get feedback faster and fix > things faster and get it merged faster. Smaller iterations = faster > development speed. Now OTP would still need to do nightly test of > everything, but they would only need to do so when they bump the version of > an included application. > Right, for patches and fixes, that model is simpler and usually faster. Even for big ones within one app, that's usually super flexible. But when it comes to bigger coordination -- say the task at hand is "improve httpd to have it support SNI", then you *need* to coordinate changes across httpd, inets, private_key, ssl, etc. and this is where the cognitive load can increase with multiple respositories. So to me, the choice of how much split you need is a function of that kind of workflow. If you have a tendency to provide libraries that can be used independently, individual apps work very well. If you have a tendency to do deeply integrated projects across your stack, with possibly breaking changes, then moving more apps to a single repo becomes a lot more interesting, and makes the entire change-tracking simpler. To some extent this is still doable when your tool (rebar or erlang.mk) fetches git repos because you have the possibility to do everything from the same set of subdirectories, but it's not nearly as nice for stability. > > Of course in the case of your smaller "big" repositories where you only need > to support one target OS and Erlang version you don't run into these issues. > I suppose you are in a sweet spot where doing things the messy way doesn't > stabs you in the back too much and you can live with it. But add proper > support for more combinations of OS and Erlang versions and you'll start > suffering. (Or I suppose you could do it wrong again, use travis-ci and not > care if your repository gets broken and just fix it afterwards, which also > means you won't be able to use git bisect etc.) > > tl;dr A rant that probably makes little sense to you. > > But you know, whatever works. > You're right that we tend to support far fewer versions and OSes than a project set like Cowboy would. For us it's not just a question of the messy way, but that we can break what we want whenever we want as long as the behavior stays the same for users of the stack, for example. Whatever is generic as a lib we tend to extract out and open source, but for business rules material -- stuff that is soft, squishy, and frequently changing, that's private code. The rant makes sense to me, and I totally get the use case for split repos. I wanted to sell the idea of integrated ones to show that it may work better in some cases. Even other developers on Heroku's routing team may disagree with me on that point, and that's entirely fine. Regards, Fred. From vinoski@REDACTED Sat Apr 12 16:38:45 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Sat, 12 Apr 2014 10:38:45 -0400 Subject: [erlang-questions] Cannot build a work vm on FreeBSD with dtrace AND enable dirty-schedulers In-Reply-To: <20140412021500.GB84595@k2r.org> References: <20140412021500.GB84595@k2r.org> Message-ID: I can't reproduce the problem either. Running FreeBSD 10.0 in a Parallels VM on OS X 10.8.5, using gcc49 and with the VM configured for 4 cores: $ CC=gcc49 CXX=g++49 MAKE=gmake ./configure --with-dynamic-trace=dtrace --enable-dirty-schedulers $ ./bin/erl Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] Eshell V6.0 (abort with ^G) 1> So, perhaps Kenji is correct that it's a problem specific to VirtualBox on Ubuntu. One thing to check is that SMP support is enabled, since dirty scheduler support currently requires SMP support. --steve On Fri, Apr 11, 2014 at 10:15 PM, Kenji Rikitake wrote: > The dirty scheduler on FreeBSD 10-STABLE on a *non-VM native* machine > (Core i5, 16GB RAM) works alright here with both gcc47 and *clang*. I'm > using kerl. I suspect it's a VirtualBox-on-Ubuntu problem. > > uname -a: > > FreeBSD minimax.priv.k2r.org 10.0-STABLE FreeBSD 10.0-STABLE #33 r264285: > Wed Apr 9 09:25:02 JST 2014 root@REDACTED:/usr/obj/usr/src/sys/K2RKERNEL > amd64 > > .kerlrc setting: > > # since .kerl is a dot file for /bin/sh, exporting inside the environment > will define the env variables > # NOTE WELL: these export command will affect *your login environment* > when activating curl! > # for clang with concurrent make > export CC=clang CXX=clang CFLAGS="-g -O3 -fstack-protector" > LDFLAGS="-fstack-protector" MAKEFLAGS="-j" > # for gcc47 > #export CC=gcc47 CXX=gcc47 CFLAGS="-g -O3 -fomit-frame-pointer > -fstack-protector" LDFLAGS="-fstack-protector" MAKEFLAGS="-j" > # > KERL_CONFIGURE_OPTIONS="--disable-native-libs --enable-vm-probes > --with-dynamic-trace=dtrace --with-ssl=/usr/local --with-javac > --enable-hipe --enable-kernel-poll > --with-wx-config=/usr/local/bin/wxgtk2u-2.8-config --without-odbc > --enable-threads --enable-sctp --enable-smp-support > -enable-dirty-schedulers --disable-silent-rules" > > erl shell output: > > Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] > [async-threads:10] [hipe] [kernel-poll:false] [dtrace] > > Eshell V6.0 (abort with ^G) > 1> erlang:system_info(dirty_cpu_schedulers). > 4 > 2> > > Kenji Rikitake > > ++> Wu Ray [2014-04-11 12:30:02 +0800]: > > Date: Fri, 11 Apr 2014 12:30:02 +0800 > > From: Wu Ray > > To: erlang-questions@REDACTED > > Subject: [erlang-questions] Cannot build a work vm on FreeBSD with dtrace > > AND enable dirty-schedulers > > > > Hi, list > > > > I cannot build a working erlang 17 on FreeBSD 10.0, with dtrace AND > enabled > > dirty-schedulers at the same time, that's my steps: > > ./configure --with-dynamic-trace=dtrace --enable-dirty-schedulers > > gmake > > > > then, the build erl vm just quit with: > > Segmentation fault(core dumped) > > > > I've tried gcc47, same result. > > CC=gcc47 CXX=g++47 ./configure --with-dynamic-trace=dtrace > > --enable-dirty-schedulers > > > > if I build with-dtrace OR enable dirty-schedulers separately, the VMs run > > well. > > but the dirty-schedulers number looks strange: > > > > Erlang/OTP 17 [erts-6.0] [source] [64-bit] > > [ds:10:5851653:18446744073709551611] [async-threads:38554976] [hipe] > > [kernel-poll:] > > > > Eshell V6.0 (abort with ^G) > > 1> erlang:system_info(dirty_cpu_schedulers). > > ** exception error: bad argument > > in function erlang:system_info/1 > > called as erlang:system_info(dirty_cpu_schedulers) > > > > > > And, gcc48 cannot build a working VM with enabled dirty-schedulers, the > vm > > quit with Segmentation fault. > > > > BTW: my FreeBSD 10.0 is running in VirtualBox 4.3.10 on Ubuntu13.10 > > > > > > regards, > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Sat Apr 12 16:59:49 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Sat, 12 Apr 2014 16:59:49 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <20140412133945.GD22866@ferdmbp.local> References: <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> <20140410182218.GI19145@ferdair.local> <5349303A.4030000@ninenines.eu> <20140412133945.GD22866@ferdmbp.local> Message-ID: <534954E5.9080209@ninenines.eu> On 04/12/2014 03:39 PM, Fred Hebert wrote: >> To take a well known example, look at what OTP does. Basically they pull >> patches, put them in a nightly test build and then depending on the results >> can decide whether to merge things. Now imagine how faster it could be if >> when you send a patch to the ssl app you don't have to worry about anything >> else? It could be tested faster, you would get feedback faster and fix >> things faster and get it merged faster. Smaller iterations = faster >> development speed. Now OTP would still need to do nightly test of >> everything, but they would only need to do so when they bump the version of >> an included application. >> > > Right, for patches and fixes, that model is simpler and usually faster. > Even for big ones within one app, that's usually super flexible. > But when it comes to bigger coordination -- say the task at hand is > "improve httpd to have it support SNI", then you *need* to coordinate > changes across httpd, inets, private_key, ssl, etc. and this is where > the cognitive load can increase with multiple respositories. You need to coordinate changes, yes. But it's much easier to do it if the repositories are separate. Because you can start by changing private_key and then release a new version of that. OTP itself still uses the previous version so nothing breaks. Then you can change ssl and release a new version of that. Similarly, OTP doesn't break. So on and so forth until all the applications are updated. Then you can think of bumping the versions used by the OTP release, and you can bump all at once and only then make sure it still works with everything else. The big difference here is that you didn't need to worry about "the rest of OTP" while you were making the changes, only at the very end. So you can focus on implementing the new feature and nothing else until it time comes to bump the versions used by OTP. Anyway I get your points, and hopefully one day someone will take a serious look at the apps/* layout and make something beautiful. -- Lo?c Hoguin http://ninenines.eu From txrev319@REDACTED Sat Apr 12 17:56:27 2014 From: txrev319@REDACTED (t x) Date: Sat, 12 Apr 2014 08:56:27 -0700 Subject: [erlang-questions] Erlang make out In-Reply-To: References: <1397281406.49314842@apps.rackspace.com> Message-ID: https://xkcd.com/927/ :-) On Sat, Apr 12, 2014 at 4:05 AM, Erik S?e S?rensen wrote: > [Off-topic] Wellp, there's my next Erlang project name: yada - "yet another > distributed application" ;-) > > Den 12/04/2014 08.25 skrev : > >> Hello, >> >> A heap of Googling and a recent thread on Erlang Questions suggests that >> there is little unanimity on the best way to organize and make large >> (multiple application) Erlang systems--- Erlang make, GNU make, Sinan, >> Rebar, erlang.mk, erl.mk, yada, yada. Enough to give a noob a colossal >> headache. >> >> Two questions: >> >> 1) Is this a matter of reinventing the wheel? Or are there sound technical >> reasons for so many options? >> >> 2) Is there an emerging consensus? >> >> Thanks, >> >> LRP >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From barcojie@REDACTED Sun Apr 13 08:09:59 2014 From: barcojie@REDACTED (Barco You) Date: Sun, 13 Apr 2014 14:09:59 +0800 Subject: [erlang-questions] cowboy: dispatch on chrome/firefox vs android/iphone In-Reply-To: References: Message-ID: No. I think you have to parse the HTTP Header by yourself and then return corresponding body as "desktop.html" or "mobile.html" Barco On Sat, Apr 12, 2014 at 8:48 AM, t x wrote: > Hi, > > Using cowboy, is there a easy way to, for: > > mysite.com/ serve > > * ~/static/desktop.html if browser = chrome/firefox > * ~/static/mobile.html if browser = android/iphone ? > > (Sample code to steal would be ideal; though functions to lookup > suffices too.) > > Thanks! > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mahesh@REDACTED Sun Apr 13 10:45:32 2014 From: mahesh@REDACTED (Mahesh Paolini-Subramanya) Date: Sun, 13 Apr 2014 10:45:32 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <534954E5.9080209@ninenines.eu> References: <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> <20140410182218.GI19145@ferdair.local> <5349303A.4030000@ninenines.eu> <20140412133945.GD22866@ferdmbp.local> <534954E5.9080209@ninenines.eu> Message-ID: This is as much a discussion of Methodology(tm) as of anything else - as with all things Methodology(tm), there are two over-riding rules 1) Any Methodology(tm) can be made to work (*) 2) All Methodology(tm) fail at the edge. The sad truth about most projects is that - if they survive long enough - they *will* hit the edge, and modifications to the methodology *will* be necessary. There is any amount of literature out there about this, but it all boils down to the issue of "communication overhead" vs "process". Basically, the more people / components / resources that a project has, the more work involved in co-ordinating all of this, and eventually the co-ordination overhead gets so huge that nothing ever gets Done. Enter "process", which reduces efficiency, but also the communication overhead, thus increasing the likelihood of something getting Done. (**) The bottom line is that apps/*, (libs, relx, rebar, erlang.mk, git, "drunken stumble", whatever) may or may not be the panacea for what you are trying to accomplish, it really, *really* depends on the specifics of your situation. If your field-of-vision gets wide enough, you'll end up finding issues with pretty much anything that you try. But then again, to paraphrase Keynes, "In the long run, everything fails". This doesn't mean we shouldn't try to accomplish anything, it is just one more indication that discussions like these are very helpful in exposing - Which systems are out there - Who is using a particular system - What the rationale behind these systems is - Why certain systems work, and other systems don't for some - How to go about implementing any particular Methodology(tm) - Where to look to get help - (And most importantly) When to change the Methodology(tm) About the only certainty in all of this is that one shouldn't trust Purists. If anyone starts advocating The One True Way, run in the opposite direction - preferably with your hand on your wallet... * -1- can end up involving godzilla-sized vats of elbow-grease ** There is a long rant about this here, which was written in a different time and place, but the core points are fairly valid, viz., small groups, loose-coupling, co-ordination, and flexible mindsets. And yes, erlang helps. On Sat, Apr 12, 2014 at 4:59 PM, Lo?c Hoguin wrote: > > You need to coordinate changes, yes. But it's much easier to do it if the > repositories are separate. Because you can start by changing private_key > and then release a new version of that. OTP itself still uses the previous > version so nothing breaks. Then you can change ssl and release a new > version of that. Similarly, OTP doesn't break. So on and so forth until all > the applications are updated. Then you can think of bumping the versions > used by the OTP release, and you can bump all at once and only then make > sure it still works with everything else. The big difference here is that > you didn't need to worry about "the rest of OTP" while you were making the > changes, only at the very end. So you can focus on implementing the new > feature and nothing else until it time comes to bump the versions used by > OTP. > > Anyway I get your points, and hopefully one day someone will take a > serious look at the apps/* layout and make something beautiful. > > > -- > Lo?c Hoguin > http://ninenines.eu > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- * Mahesh Paolini-Subramanya That tall bald Indian guy..* * Google+ | Blog | Twitter | LinkedIn * -------------- next part -------------- An HTML attachment was scrubbed... URL: From drormein@REDACTED Sun Apr 13 17:35:10 2014 From: drormein@REDACTED (Dror Mein) Date: Sun, 13 Apr 2014 08:35:10 -0700 (PDT) Subject: [erlang-questions] Difference in 'close' for gen_tcp recv vs. active Message-ID: <1397403310.61269.YahooMailNeo@web164502.mail.gq1.yahoo.com> I had the same problem, but I thought using {keepalive,true} or {send_timeout,Time} would help. I see in wireshark that keep alive does not pass through but I still don't get an {error, closed}. Someone wrote that default timeout for keepalive is two hours. where can it be configured? -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Sun Apr 13 19:13:18 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Sun, 13 Apr 2014 21:13:18 +0400 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> <20140410182218.GI19145@ferdair.local> <5349303A.4030000@ninenines.eu> <20140412133945.GD22866@ferdmbp.local> <534954E5.9080209@ninenines.eu> Message-ID: I tried to develop erlyvideo as a set of separate libraries in separate repositories. It was a horror. Problem is in tools. It is very hard to lock specific configuration of application and sublibraries with rebar or git. Problem is folllowing: when you are doing bisect or just revert to some specific version, you get problems with going through all libraries and revert them back. All this is just a problem of tools. For example ruby bundler will not start application untill all libraries are of proper version. So as for me I prefer to keep in common repo all libraries that are not used in any other apps. Extraction into separate repository means that this library has stable and clear api and will be reused in other apps. I don't see what for to split erlang into separate repo -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Sun Apr 13 19:19:22 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Sun, 13 Apr 2014 19:19:22 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> <20140410182218.GI19145@ferdair.local> <5349303A.4030000@ninenines.eu> <20140412133945.GD22866@ferdmbp.local> <534954E5.9080209@ninenines.eu> Message-ID: <534AC71A.3040402@ninenines.eu> On 04/13/2014 07:13 PM, Max Lapshin wrote: > So as for me I prefer to keep in common repo all libraries that are not > used in any other apps. Extraction into separate repository means that > this library has stable and clear api and will be reused in other apps. > > I don't see what for to split erlang into separate repo You said it yourself, if the library has stable and clean API and is reused in other apps then it makes sense to separate it into its own repository. The apps that come with Erlang are the most stable Erlang app you can find, because they have very strict backward compatibility requirements. So there's no issue of "reverting something in one app breaks everything else", because by definition you would break backward compatibility. -- Lo?c Hoguin http://ninenines.eu From max.lapshin@REDACTED Sun Apr 13 20:02:50 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Sun, 13 Apr 2014 22:02:50 +0400 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <534AC71A.3040402@ninenines.eu> References: <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> <20140410182218.GI19145@ferdair.local> <5349303A.4030000@ninenines.eu> <20140412133945.GD22866@ferdmbp.local> <534954E5.9080209@ninenines.eu> <534AC71A.3040402@ninenines.eu> Message-ID: "and will be reused in other apps" Separation of library into another repo brings new problem. Git submodules are a never-try-again hell, rebar has its weakness in managing submodules (yes, I know, pull-request or GTFO, but I haven't done it). So extracting library into separate repo is useful when you are going to reuse it into another project without other big app. Are you going to make erlang distribution without otp but with SSL? -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Sun Apr 13 20:25:30 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Sun, 13 Apr 2014 20:25:30 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> <20140410182218.GI19145@ferdair.local> <5349303A.4030000@ninenines.eu> <20140412133945.GD22866@ferdmbp.local> <534954E5.9080209@ninenines.eu> <534AC71A.3040402@ninenines.eu> Message-ID: <534AD69A.5090801@ninenines.eu> You can't run Erlang without OTP today. (You *could* after you rewrite half of it, and send a couple patches to OTP, but there's no alternative today.) But you can run it without ssl, or diameter, or wx, or edoc... Most applications could be separated from the Erlang repository without much trouble. I don't use git submodules or rebar so I can't say how it is for them. Personally when I need to change the interface of a library I first make that change, tag a new version, then go to the applications and bump the dependency's version. If I need to make sure this change is improving the bigger application while doing it, I just create a symlink and do changes in both sides at the same time. The bump in the other repository doesn't often happen immediately. I usually want user feedback about a new Ranch version before I make Cowboy use it, for example. Quick user feedback is very important. There are a lot of people who would gladly run the bleeding edge ssl application (for example) rather than the one from 3 months ago, and these people give early feedback that allows the ssl application to get improved faster. It's currently hard to use a bleeding edge version of an app that comes with Erlang, you pretty much have to run master or go through hoops to extract only the ssl application (and more hoops to keep it up to date possibly). There's been hints from the OTP team of going in a similar direction to that already. Or perhaps it was just Bjorn-Egil the rebel. We'll see! On 04/13/2014 08:02 PM, Max Lapshin wrote: > "and will be reused in other apps" > > Separation of library into another repo brings new problem. Git > submodules are a never-try-again hell, rebar has its weakness in > managing submodules (yes, I know, pull-request or GTFO, but I haven't > done it). > > So extracting library into separate repo is useful when you are going to > reuse it into another project without other big app. > > Are you going to make erlang distribution without otp but with SSL? > -- Lo?c Hoguin http://ninenines.eu From jacob01@REDACTED Sun Apr 13 22:20:44 2014 From: jacob01@REDACTED (Jacob) Date: Sun, 13 Apr 2014 22:20:44 +0200 Subject: [erlang-questions] Difference in 'close' for gen_tcp recv vs. active In-Reply-To: <1397403310.61269.YahooMailNeo@web164502.mail.gq1.yahoo.com> References: <1397403310.61269.YahooMailNeo@web164502.mail.gq1.yahoo.com> Message-ID: <534AF19C.4060807@gmx.net> Hi On 13.04.2014 17:35, Dror Mein wrote: > I had the same problem, but I thought using {keepalive,true} or > {send_timeout,Time} would help. I see in wireshark that keep alive does > not pass through but I still don't get an {error, closed}. > Someone wrote that default timeout for keepalive is two hours. where can > it be configured? TCP keepalive configuration is OS dependant. What OS are you using? NOTE: The following applies to _Linux_ : With Linux you can either set it a) globally via sysctl net.ipv4.tcp_keepalive_* b) globally per /proc/sys/net/ipv4/tcp_keepalive_* c) per socket with setsockopt() and TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL d) per started (ELF) executable with the libkeepalive wrapper (see below). see tcp(7) for details. A helpful HOWTO can be found here: http://www.tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/ ad d): See the HOWTO above for details. I installed the libkeepalive0 package (Ubuntu 13.10), tried it with Erlang (erts-6.0) and according to strace it seems to work. I would avoid LD_PRELOAD hacks in production though. The command line was LD_PRELOAD=libkeepalive.so KEEPCNT=20 KEEPIDLE=180 KEEPINTVL=60 erl If you want to use strace to check what happens enter: LD_PRELOAD=libkeepalive.so KEEPCNT=20 KEEPIDLE=180 KEEPINTVL=60 strace -f -o keep.str -e trace=setsockopt erl and look into keep.str after using gen_tcp:connect/3. HTH, Jacob From z@REDACTED Sun Apr 13 23:27:07 2014 From: z@REDACTED (Danil Zagoskin) Date: Mon, 14 Apr 2014 01:27:07 +0400 Subject: [erlang-questions] Errors in SSL handshake (weird client) Message-ID: Hello! Recently after upgrading to newer openssl our server started to suggest ECC cipher suites. Most of clients work fine, but there is at least one which does not ? WebDAV client in OmniPlan application under MacOS 10.9. This application makes three connections to check connectivity. First two of them fail with "error: bad record mac" or sometimes badarg in erlang:size([22,3,1,0,158,1,0,0,154,3,1,83,74|...]) at tls_record.erl:122. Third connection always fail with {case_clause,{4}} in ssl_v3:mac_hash because it is negotiated as SSLv3 with SHA256 hash which is not described in RFC and thus not supported in Erlang. I tried to examine SSL code to understand how that could be true (didn't succeed so far), tried to replay third connection client_hello (server replies with very different server_hello), finally I've written a tool to dump traffic. So, using https://github.com/stolen/ssldump I've collected this log showing the three connections from weird client to simple SSL server (listen ? transport_accept ? ssl_accept ? die) leading to erroneous negotiation: http://pastebin.com/Ym7na7mi Currently I've found workaround ? disabling ECC cipher suites with hashes other than MD5 and SHA, but I think it may be possible to behave better allowing even this client to work. So, there are two bugs: * Somewhere packet is received as list instead of binary leading to badarg in erlang:size * At some conditions it is possible to negotiate SSLv3 with SHA256 and then crash server worker at encoding message. Also maybe "bad record mac" is a bug too. -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From be.dmitry@REDACTED Sun Apr 13 23:40:23 2014 From: be.dmitry@REDACTED (Dmitry Belyaev) Date: Mon, 14 Apr 2014 07:40:23 +1000 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> <20140410182218.GI19145@ferdair.local> <5349303A.4030000@ninenines.eu> <20140412133945.GD22866@ferdmbp.local> <534954E5.9080209@ninenines.eu> <534AC71A.3040402@ninenines.eu> Message-ID: What kind of problems did you experienced with git submodules? I had never had any problems with them in git and only minor problems in web UIs. Submodules allow manual control over versions used which is sometimes the only way if dependencies want different versions of a library. -- Best wishes, Dmitry Belyaev On 14 April 2014 4:02:50 AM AEST, Max Lapshin wrote: >"and will be reused in other apps" > >Separation of library into another repo brings new problem. Git >submodules >are a never-try-again hell, rebar has its weakness in managing >submodules >(yes, I know, pull-request or GTFO, but I haven't done it). > >So extracting library into separate repo is useful when you are going >to >reuse it into another project without other big app. > >Are you going to make erlang distribution without otp but with SSL? > > >------------------------------------------------------------------------ > >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean@REDACTED Mon Apr 14 02:08:26 2014 From: sean@REDACTED (Sean Cribbs) Date: Sun, 13 Apr 2014 19:08:26 -0500 Subject: [erlang-questions] Erlang make out In-Reply-To: <1397281406.49314842@apps.rackspace.com> References: <1397281406.49314842@apps.rackspace.com> Message-ID: Java has: Maven, Ant, Ivy, and a host of IDEs that over the years had integrated build tools. Ruby has (not compiled!): Rake, Thor, mkmf, and many not-so-notable others. I don't there are as many technical decisions involved as human ones: people like to work in different ways. On Sat, Apr 12, 2014 at 12:43 AM, wrote: > Hello, > > A heap of Googling and a recent thread on Erlang Questions suggests that > there is little unanimity on the best way to organize and make large > (multiple application) Erlang systems--- Erlang make, GNU make, Sinan, > Rebar, erlang.mk, erl.mk, yada, yada. Enough to give a noob a colossal > headache. > > Two questions: > > 1) Is this a matter of reinventing the wheel? Or are there sound technical > reasons for so many options? > > 2) Is there an emerging consensus? > > Thanks, > > LRP > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Sean Cribbs Software Engineer Basho Technologies, Inc. http://basho.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenji@REDACTED Mon Apr 14 04:25:49 2014 From: kenji@REDACTED (Kenji Rikitake) Date: Mon, 14 Apr 2014 11:25:49 +0900 Subject: [erlang-questions] 17.0 source tar.gz content change Message-ID: <20140414022549.GA33657@k2r.org> I've noticed that otp_src_17.0.tar.gz content at erlang.org http://www.erlang.org/download/otp_src_17.0.tar.gz has been changed between the version of April 9th to April 10th (and later). Old version (of April 9th): MD5(otp_src_17.0.tar.gz)= f6c59175c38e878b5002516047602d65 size: 66633305 bytes New version (of April 10th): MD5(otp_src_17.0.tar.gz)= a5f78c1cf0eb7724de3a59babc1a28e5 size: 66640875 bytes The diffs between the extracted directories show the difference between the two versions is only at adding otp_src_17.0/system/README to the new version so this won't affect running 17.0 BEAMs, but I'd be glad if OTP Team could explain why this happened. Regards, Kenji Rikitake From vinoski@REDACTED Mon Apr 14 04:45:58 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Sun, 13 Apr 2014 22:45:58 -0400 Subject: [erlang-questions] 17.0 source tar.gz content change In-Reply-To: <20140414022549.GA33657@k2r.org> References: <20140414022549.GA33657@k2r.org> Message-ID: On Sun, Apr 13, 2014 at 10:25 PM, Kenji Rikitake wrote: > I've noticed that otp_src_17.0.tar.gz content at erlang.org > http://www.erlang.org/download/otp_src_17.0.tar.gz > has been changed between the version of April 9th to April 10th (and > later). > > Old version (of April 9th): > MD5(otp_src_17.0.tar.gz)= f6c59175c38e878b5002516047602d65 > size: 66633305 bytes > > New version (of April 10th): > MD5(otp_src_17.0.tar.gz)= a5f78c1cf0eb7724de3a59babc1a28e5 > size: 66640875 bytes > > The diffs between the extracted directories show the difference between > the two versions is only at adding > otp_src_17.0/system/README > to the new version so this won't affect running 17.0 BEAMs, > but I'd be glad if OTP Team could explain why this happened. > Hi Kenji, It was updated as described in this message in erlang-bugs: http://erlang.org/pipermail/erlang-bugs/2014-April/004306.html --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From txrev319@REDACTED Mon Apr 14 06:02:54 2014 From: txrev319@REDACTED (t x) Date: Sun, 13 Apr 2014 21:02:54 -0700 Subject: [erlang-questions] erlang autobuild Message-ID: Hi, In clojurescript, I can do something like: "lein autobuild" which basically means, any time src/**/*.cljs changes, recompile everything. Is there a similar way to do something like the above in erlang ? I would like to do : "erlang-magic autobuild" so that any time I save a file in src/*.erl, it does: "make" (since I'm running erlang.mk) _rel/bin/release/my_app stop _rel/bin/release/my_app start ? Thanks! Basically, I want a "file save" in Emacs to trigger: * recompile * kill old app * start new app From nickelchen@REDACTED Mon Apr 14 03:26:51 2014 From: nickelchen@REDACTED (nickel chen) Date: Sun, 13 Apr 2014 18:26:51 -0700 (PDT) Subject: [erlang-questions] =?utf-8?b?5Zue5aSN77yaICDlm57lpI3vvJogZWphYmJl?= =?utf-8?q?rd_translate_crash?= In-Reply-To: <363807f7-afeb-408b-b783-0ca19ea62f23@googlegroups.com> References: <1397114648.17048.YahooMailNeo@web125706.mail.ne1.yahoo.com> <1397198506.90976.YahooMailNeo@web125703.mail.ne1.yahoo.com> <363807f7-afeb-408b-b783-0ca19ea62f23@googlegroups.com> Message-ID: <1397438811.52642.YahooMailNeo@web125705.mail.ne1.yahoo.com> Yep. I was using R17. ?After switching to R16, everything works fine. alamo ? 2014?4?13?, ???, 8:41 ?? ??? Compile with?R16B03 On Thursday, 10 April 2014 23:41:46 UTC-7, nickel chen wrote: anyone information, ?please? i'm stucked at this problem. >nickel chen ? 2014?4?10?, ???, 3:24 ?? ??? > > >?Hi all, I'm new to erlang and I'm learning the code of ejabberd 13.12, I already have ejabberd installed, then start it with > > >sudo ejabberdctl start > > >There is a crash message in /var/log/ejabberd.log > > >2014-04-10 14:37:56.520 [info] <0.7.0> Application ejabberd exited with reason: bad argument in call to erlang:iolist_to_binary([916, 953,945,956,972,961,966,969, 963,951,32,928,961,972,963, 946,945,963,951,962]) in translate:'-load_file/2-fun-2- '/3 line 91 > > >i added some debug info to the source code ` translate.erl` ?and recompile ejabberd. then start it again, below is the debug message: > > > >2014-04-10 14:37:56.517 [info] <0.38.0>@translate:load_file: 87 File is: <<"//lib/ejabberd/priv/msgs/ el.msg">>, Orig is:"Access Configuration", Trans is: [916,953,945,956,972,961,966, 969,963,951,32,928,961,972, 963,946,945,963,951,962] > > >well it's clear that there are unicode characters in I18N translation , when passed to?the?erlang:iolist_to_ binary/1, it crashed with badarg, because iolist only accepts byte( ) binary( ) and other iolist( ) > > >9> erlang:iolist_to_binary([256]) . >** exception error: bad argument >?? ? in function? iolist_to_binary/1 >? ? ? ? called as iolist_to_binary([256]) >10> erlang:iolist_to_binary([255]) . ><<"?">> >11>? > > >My question is simple, how to get around with this problem and get ejabberd launched? > > >Thanks in advance! > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitrii.bushmelev@REDACTED Mon Apr 14 06:48:44 2014 From: dmitrii.bushmelev@REDACTED (Dmitry Bushmelev) Date: Mon, 14 Apr 2014 08:48:44 +0400 Subject: [erlang-questions] erlang autobuild In-Reply-To: References: Message-ID: <6625B037-F74D-4F13-A0B1-8409B00F06A7@gmail.com> Hi, look at https://github.com/rustyio/sync. On 14 Apr 2014, at 08:02, t x wrote: > Hi, > > In clojurescript, I can do something like: > > "lein autobuild" > > which basically means, any time src/**/*.cljs changes, recompile everything. > > > > Is there a similar way to do something like the above in erlang ? > > I would like to do : > > "erlang-magic autobuild" > > so that any time I save a file in src/*.erl, it does: > > "make" (since I'm running erlang.mk) > _rel/bin/release/my_app stop > _rel/bin/release/my_app start > > ? > > Thanks! > > > Basically, I want a "file save" in Emacs to trigger: > * recompile > * kill old app > * start new app > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Mon Apr 14 09:43:21 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 14 Apr 2014 09:43:21 +0200 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: Hi! 2014-04-13 23:27 GMT+02:00 Danil Zagoskin : Hello! > > Recently after upgrading to newer openssl our server started to suggest > ECC cipher suites. > Most of clients work fine, but there is at least one which does not ? > WebDAV client in OmniPlan application under MacOS 10.9. > > This application makes three connections to check connectivity. First two > of them fail with "error: bad record mac" or sometimes badarg in > erlang:size([22,3,1,0,158,1,0,0,154,3,1,83,74|...]) at tls_record.erl:122. > Third connection always fail with {case_clause,{4}} in ssl_v3:mac_hash > because it is negotiated as SSLv3 with SHA256 hash which is not described > in RFC and thus not supported in Erlang. > > I tried to examine SSL code to understand how that could be true (didn't > succeed so far), tried to replay third connection client_hello (server > replies with very different server_hello), finally I've written a tool to > dump traffic. > > So, using https://github.com/stolen/ssldump I've collected this log > showing the three connections from weird client to simple SSL server > (listen ? transport_accept ? ssl_accept ? die) leading to erroneous > negotiation: http://pastebin.com/Ym7na7mi > > > Currently I've found workaround ? disabling ECC cipher suites with hashes > other than MD5 and SHA, but I think it may be possible to behave better > allowing even this client to work. > > So, there are two bugs: > * Somewhere packet is received as list instead of binary leading to > badarg in erlang:size > We will look into it, do you have a easy way to reproduce it? > * At some conditions it is possible to negotiate SSLv3 with SHA256 and > then crash server worker at encoding message. > > This sounds like a bug fixed in the latest version of the ssl application (ssl-5.3.4 released in 17.0) "Fix possible mismatch between SSL/TLS version and default ciphers. Could happen when you specified SSL/TLS-version in optionlist to listen or accept. Own Id: OTP-11712" Have you tried this version? Regards Ingela Erlang/OTP team - Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Mon Apr 14 10:01:29 2014 From: z@REDACTED (Danil Zagoskin) Date: Mon, 14 Apr 2014 12:01:29 +0400 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: > This sounds like a bug fixed in the latest version of the ssl application (ssl-5.3.4 released in 17.0) > Have you tried this version? I forgot to say I was using 17.0 to reproduce this crash, so it seems to be still there. server_hello in third connection (one that crashes) still has server_version = {3,0} and cipher_suite = <<0,61>> which is {rsa,aes_256_cbc,sha256} I may provide more info if you tell what is needed. > We will look into it, do you have a easy way to reproduce it? I'll try to find it. Should be not very hard. -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Mon Apr 14 10:56:58 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 14 Apr 2014 10:56:58 +0200 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: Hi! 2014-04-14 10:01 GMT+02:00 Danil Zagoskin : > > This sounds like a bug fixed in the latest version of the ssl > application (ssl-5.3.4 released in 17.0) > > Have you tried this version? > > I forgot to say I was using 17.0 to reproduce this crash, so it seems to > be still there. > server_hello in third connection (one that crashes) still > has server_version = {3,0} and cipher_suite = <<0,61>> which > is {rsa,aes_256_cbc,sha256} > I may provide more info if you tell what is needed. > It might be another bug in that case. If you could create a test case that fails in this way that I can run that would be the most desirable. > > > We will look into it, do you have a easy way to reproduce it? > > I'll try to find it. Should be not very hard. > > > Thank you Regards Ingela Erlang/OTP team - Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From bogdan@REDACTED Mon Apr 14 10:58:50 2014 From: bogdan@REDACTED (Bogdan B) Date: Mon, 14 Apr 2014 09:58:50 +0100 Subject: [erlang-questions] cowboy: dispatch on chrome/firefox vs android/iphone In-Reply-To: References: Message-ID: Browser sniffing is considered bad in general and very bad today with so many variations of browser headers. Maybe you can change the a bit the approach and first load a page that detects browser capabilities with JS (like a 'loading..' page) and makes a second call for the right template. On 13 April 2014 07:09, Barco You wrote: > No. I think you have to parse the HTTP Header by yourself and then return > corresponding body as "desktop.html" or "mobile.html" > > Barco > > > On Sat, Apr 12, 2014 at 8:48 AM, t x wrote: > >> Hi, >> >> Using cowboy, is there a easy way to, for: >> >> mysite.com/ serve >> >> * ~/static/desktop.html if browser = chrome/firefox >> * ~/static/mobile.html if browser = android/iphone ? >> >> (Sample code to steal would be ideal; though functions to lookup >> suffices too.) >> >> Thanks! >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Mon Apr 14 11:31:36 2014 From: z@REDACTED (Danil Zagoskin) Date: Mon, 14 Apr 2014 13:31:36 +0400 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: >It might be another bug in that case. If you could create a test case that fails in this way that I can run that would be the most desirable. I've spent nearly two days trying to reproduce that. Currently I'm stuck, so I've decided to share dump of handshake traffic. I used a self-signed certificate generated just for investigating this behavior. I can send it if you need. When I find a way to reproduce some parts of bad handshake sequense, I'll let you know. 2014-04-14 12:56 GMT+04:00 Ingela Andin : > Hi! > > 2014-04-14 10:01 GMT+02:00 Danil Zagoskin : > > > This sounds like a bug fixed in the latest version of the ssl >> application (ssl-5.3.4 released in 17.0) >> > Have you tried this version? >> >> I forgot to say I was using 17.0 to reproduce this crash, so it seems to >> be still there. >> server_hello in third connection (one that crashes) still >> has server_version = {3,0} and cipher_suite = <<0,61>> which >> is {rsa,aes_256_cbc,sha256} >> I may provide more info if you tell what is needed. >> > > It might be another bug in that case. If you could create a test case > that fails in this way that I can run that > would be the most desirable. > > > >> >> > We will look into it, do you have a easy way to reproduce it? >> >> I'll try to find it. Should be not very hard. >> >> >> > Thank you > > Regards Ingela Erlang/OTP team - Ericsson AB > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From egil@REDACTED Mon Apr 14 13:44:16 2014 From: egil@REDACTED (=?UTF-8?B?QmrDtnJuLUVnaWwgRGFobGJlcmc=?=) Date: Mon, 14 Apr 2014 13:44:16 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: <534AD69A.5090801@ninenines.eu> References: <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> <20140410182218.GI19145@ferdair.local> <5349303A.4030000@ninenines.eu> <20140412133945.GD22866@ferdmbp.local> <534954E5.9080209@ninenines.eu> <534AC71A.3040402@ninenines.eu> <534AD69A.5090801@ninenines.eu> Message-ID: <534BCA10.80006@erlang.org> On 2014-04-13 20:25, Lo?c Hoguin wrote: > You can't run Erlang without OTP today. (You *could* after you rewrite > half of it, and send a couple patches to OTP, but there's no > alternative today.) > > But you can run it without ssl, or diameter, or wx, or edoc... Most > applications could be separated from the Erlang repository without > much trouble. > > I don't use git submodules or rebar so I can't say how it is for them. > > Personally when I need to change the interface of a library I first > make that change, tag a new version, then go to the applications and > bump the dependency's version. If I need to make sure this change is > improving the bigger application while doing it, I just create a > symlink and do changes in both sides at the same time. The bump in the > other repository doesn't often happen immediately. I usually want user > feedback about a new Ranch version before I make Cowboy use it, for > example. > > Quick user feedback is very important. There are a lot of people who > would gladly run the bleeding edge ssl application (for example) > rather than the one from 3 months ago, and these people give early > feedback that allows the ssl application to get improved faster. It's > currently hard to use a bleeding edge version of an app that comes > with Erlang, you pretty much have to run master or go through hoops to > extract only the ssl application (and more hoops to keep it up to date > possibly). > > There's been hints from the OTP team of going in a similar direction > to that already. Or perhaps it was just Bjorn-Egil the rebel. We'll see! I'll address this point. We have had a rigorous and inconclusive debate on the matter of splitting the OTP repository. The OTP team is divided. Some people are strongly for it, namely those who work with integration, support applications or "non-core" application, as well as those applications with a different release cycle than the OTP core. Some people are strongly against it since they see a rise in complexity and thus pragmatically against it. Work on the compiler + beam becomes a bit more tedious if you change instructions etc. Also the argument, it works right now - don't fix working stuff. I won't argue the points since I'm solely in the "split otp repository" corner under one assumption - a package manager. At OTP I think we are at 30% for, 25% against, 45% abstains for a repo split. Far from a consensus at least. =) It boils down to a need for a package manager and how or what parts of OTP should be part of that. As long as we don't have a package manager that we (OTP) are behind, supports and uses, we probably won't see a repository split. // Bj?rn-Egil, aka The Rebel > > On 04/13/2014 08:02 PM, Max Lapshin wrote: >> "and will be reused in other apps" >> >> Separation of library into another repo brings new problem. Git >> submodules are a never-try-again hell, rebar has its weakness in >> managing submodules (yes, I know, pull-request or GTFO, but I haven't >> done it). >> >> So extracting library into separate repo is useful when you are going to >> reuse it into another project without other big app. >> >> Are you going to make erlang distribution without otp but with SSL? >> > From dszoboszlay@REDACTED Mon Apr 14 15:13:33 2014 From: dszoboszlay@REDACTED (=?utf-8?Q?D=C3=A1niel_Szoboszlay?=) Date: Mon, 14 Apr 2014 15:13:33 +0200 Subject: [erlang-questions] =?utf-8?b?5Zue5aSN77yaIGVqYWJiZXJkIHRyYW5zbGF0?= =?utf-8?q?e_crash?= In-Reply-To: <1397198506.90976.YahooMailNeo@web125703.mail.ne1.yahoo.com> References: <1397114648.17048.YahooMailNeo@web125706.mail.ne1.yahoo.com> <1397198506.90976.YahooMailNeo@web125703.mail.ne1.yahoo.com> Message-ID: <34813C80-CE14-4BA0-8296-5DD8CC93F0D8@gmail.com> Hi, I?m not really familiar with ejabberd in particular, but I can think of two possible ways to fix your problem: change the iolist_to_binary call to uncidoe:characters_to_binary, which will take care of utf8 encoding the unicode code points change the translation file (el.msg) to contain the translations as binaries instead of strings (<>) I?d prefer the first solution, btw. Regards, Daniel On 2014 Apr 11, at 8:41 , nickel chen wrote: > anyone information, please? i'm stucked at this problem. > nickel chen ? 2014?4?10?, ???, 3:24 ?? ??? > Hi all, I'm new to erlang and I'm learning the code of ejabberd 13.12, I already have ejabberd installed, then start it with > > sudo ejabberdctl start > > There is a crash message in /var/log/ejabberd.log > > 2014-04-10 14:37:56.520 [info] <0.7.0> Application ejabberd exited with reason: bad argument in call to erlang:iolist_to_binary([916,953,945,956,972,961,966,969,963,951,32,928,961,972,963,946,945,963,951,962]) in translate:'-load_file/2-fun-2-'/3 line 91 > > i added some debug info to the source code ` translate.erl` and recompile ejabberd. then start it again, below is the debug message: > > 2014-04-10 14:37:56.517 [info] <0.38.0>@translate:load_file:87 File is: <<"//lib/ejabberd/priv/msgs/el.msg">>, Orig is:"Access Configuration", Trans is: [916,953,945,956,972,961,966,969,963,951,32,928,961,972,963,946,945,963,951,962] > > well it's clear that there are unicode characters in I18N translation , when passed to the erlang:iolist_to_binary/1, it crashed with badarg, because iolist only accepts byte( ) binary( ) and other iolist( ) > > 9> erlang:iolist_to_binary([256]). > ** exception error: bad argument > in function iolist_to_binary/1 > called as iolist_to_binary([256]) > 10> erlang:iolist_to_binary([255]). > <<"?">> > 11> > > My question is simple, how to get around with this problem and get ejabberd launched? > > Thanks in advance! > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.goertzen@REDACTED Mon Apr 14 16:09:38 2014 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Mon, 14 Apr 2014 09:09:38 -0500 Subject: [erlang-questions] Store maps in ets/dets? In-Reply-To: References: <5346C7E2.2050209@erlang.org> Message-ID: Direct map support in ets, dets, and mnesia would indeed be nice. I am currently using a number of mnesia tables to pack maps into tuples with the key copied into the first tuple spot: #{key => 123, value1 => abc, value2 => 3.14, ...} ... becomes... {123, #{key => 123, value1 => abc, value2 => 3.14, ...}} Dan. On Thu, Apr 10, 2014 at 11:31 PM, Max Lapshin wrote: > I'm asking exactly about > > ets:insert(web_sessions, #{session_id => <<"1234">>,bytes => 0}). > > ets:update_counter(web_sessions, <<"1234">>, {bytes, 150}) > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Mon Apr 14 16:09:23 2014 From: rvirding@REDACTED (Robert Virding) Date: Mon, 14 Apr 2014 16:09:23 +0200 Subject: [erlang-questions] Store maps in ets/dets? In-Reply-To: References: <5346C7E2.2050209@erlang.org> Message-ID: Then it is a Jesper pointed out: yes, you can store maps in an ETS table, but at the top-most structure must be a tuple. So you will not be able to write as you have done. Robert On 11 April 2014 06:31, Max Lapshin wrote: > I'm asking exactly about > > ets:insert(web_sessions, #{session_id => <<"1234">>,bytes => 0}). > > ets:update_counter(web_sessions, <<"1234">>, {bytes, 150}) > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From txrev319@REDACTED Mon Apr 14 18:40:14 2014 From: txrev319@REDACTED (t x) Date: Mon, 14 Apr 2014 09:40:14 -0700 Subject: [erlang-questions] erlang autobuild In-Reply-To: <6625B037-F74D-4F13-A0B1-8409B00F06A7@gmail.com> References: <6625B037-F74D-4F13-A0B1-8409B00F06A7@gmail.com> Message-ID: Yes, this was exactly what I ended up using. :-) On Sun, Apr 13, 2014 at 9:48 PM, Dmitry Bushmelev wrote: > Hi, look at https://github.com/rustyio/sync. > > On 14 Apr 2014, at 08:02, t x wrote: > > Hi, > > In clojurescript, I can do something like: > > "lein autobuild" > > which basically means, any time src/**/*.cljs changes, recompile > everything. > > > > Is there a similar way to do something like the above in erlang ? > > I would like to do : > > "erlang-magic autobuild" > > so that any time I save a file in src/*.erl, it does: > > "make" (since I'm running erlang.mk) > _rel/bin/release/my_app stop > _rel/bin/release/my_app start > > ? > > Thanks! > > > Basically, I want a "file save" in Emacs to trigger: > * recompile > * kill old app > * start new app > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > From txrev319@REDACTED Mon Apr 14 18:41:00 2014 From: txrev319@REDACTED (t x) Date: Mon, 14 Apr 2014 09:41:00 -0700 Subject: [erlang-questions] cowboy: dispatch on chrome/firefox vs android/iphone In-Reply-To: References: Message-ID: Understood -- I asked the wrong question. The correct answer is "do this client side; don't do this server side." On Mon, Apr 14, 2014 at 1:58 AM, Bogdan B wrote: > Browser sniffing is considered bad in general and very bad today with so > many variations of browser headers. > Maybe you can change the a bit the approach and first load a page that > detects browser capabilities with JS (like a 'loading..' page) and makes a > second call for the right template. > > > > On 13 April 2014 07:09, Barco You wrote: >> >> No. I think you have to parse the HTTP Header by yourself and then return >> corresponding body as "desktop.html" or "mobile.html" >> >> Barco >> >> >> On Sat, Apr 12, 2014 at 8:48 AM, t x wrote: >>> >>> Hi, >>> >>> Using cowboy, is there a easy way to, for: >>> >>> mysite.com/ serve >>> >>> * ~/static/desktop.html if browser = chrome/firefox >>> * ~/static/mobile.html if browser = android/iphone ? >>> >>> (Sample code to steal would be ideal; though functions to lookup >>> suffices too.) >>> >>> Thanks! >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > From essen@REDACTED Mon Apr 14 18:46:31 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 14 Apr 2014 18:46:31 +0200 Subject: [erlang-questions] cowboy: dispatch on chrome/firefox vs android/iphone In-Reply-To: References: Message-ID: <534C10E7.1010603@ninenines.eu> The correct answer is *Don't do this*. *Seriously don't*. And if you *do* end up doing it, make sure you put a link to the desktop version so that I can use a version of your website that works properly and not the mobile one. Also lookup: graceful degradation, facilitated by frameworks like Bootstrap, jQuery mobile, etc. And doing it this way is also less work for you! On 04/14/2014 06:41 PM, t x wrote: > Understood -- I asked the wrong question. The correct answer is "do > this client side; don't do this server side." > > On Mon, Apr 14, 2014 at 1:58 AM, Bogdan B wrote: >> Browser sniffing is considered bad in general and very bad today with so >> many variations of browser headers. >> Maybe you can change the a bit the approach and first load a page that >> detects browser capabilities with JS (like a 'loading..' page) and makes a >> second call for the right template. >> >> >> >> On 13 April 2014 07:09, Barco You wrote: >>> >>> No. I think you have to parse the HTTP Header by yourself and then return >>> corresponding body as "desktop.html" or "mobile.html" >>> >>> Barco >>> >>> >>> On Sat, Apr 12, 2014 at 8:48 AM, t x wrote: >>>> >>>> Hi, >>>> >>>> Using cowboy, is there a easy way to, for: >>>> >>>> mysite.com/ serve >>>> >>>> * ~/static/desktop.html if browser = chrome/firefox >>>> * ~/static/mobile.html if browser = android/iphone ? >>>> >>>> (Sample code to steal would be ideal; though functions to lookup >>>> suffices too.) >>>> >>>> Thanks! >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From ates@REDACTED Mon Apr 14 21:54:50 2014 From: ates@REDACTED (Artem Teslenko) Date: Mon, 14 Apr 2014 22:54:50 +0300 Subject: [erlang-questions] SCTP support in Erlang from ESL Message-ID: <534C3D0A.7010705@ipv6.dp.ua> Hello, Can't make SCTP work on my system with esl-erlang installed: $ lsb_release -a LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch Distributor ID: RedHatEnterpriseServer Description: Red Hat Enterprise Linux Server release 6.5 (Santiago) Release: 6.5 Codename: Santiago $ rpm -qa |grep erlang esl-erlang-R16B03-4.x86_64 $ rpm -qa |grep sctp lksctp-tools-1.0.10-7.el6.x86_64 $ lsmod |grep sctp sctp 198775 2 $ erl Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false] Eshell V5.10.4 (abort with ^G) 1> gen_sctp:open(). {error,eprotonosupport} Is esl-erlang compiled without SCTP support or is something wrong with my system? Thanks. From chandrashekhar.mullaparthi@REDACTED Mon Apr 14 22:11:35 2014 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Mon, 14 Apr 2014 21:11:35 +0100 Subject: [erlang-questions] SCTP support in Erlang from ESL In-Reply-To: <534C3D0A.7010705@ipv6.dp.ua> References: <534C3D0A.7010705@ipv6.dp.ua> Message-ID: Do you have the lksctp-tools and lksctp-tools-devel packages installed? cheers Chandru On 14 April 2014 20:54, Artem Teslenko wrote: > Hello, > > Can't make SCTP work on my system with esl-erlang installed: > > $ lsb_release -a > LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4. > 0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing- > 4.0-amd64:printing-4.0-noarch > Distributor ID: RedHatEnterpriseServer > Description: Red Hat Enterprise Linux Server release 6.5 (Santiago) > Release: 6.5 > Codename: Santiago > > $ rpm -qa |grep erlang > esl-erlang-R16B03-4.x86_64 > > $ rpm -qa |grep sctp > lksctp-tools-1.0.10-7.el6.x86_64 > > $ lsmod |grep sctp > sctp 198775 2 > > $ erl > Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:2:2] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V5.10.4 (abort with ^G) > 1> gen_sctp:open(). > {error,eprotonosupport} > > Is esl-erlang compiled without SCTP support or is something wrong with my > system? > > Thanks. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ates@REDACTED Mon Apr 14 22:22:29 2014 From: ates@REDACTED (Artem Teslenko) Date: Mon, 14 Apr 2014 23:22:29 +0300 Subject: [erlang-questions] SCTP support in Erlang from ESL In-Reply-To: References: <534C3D0A.7010705@ipv6.dp.ua> Message-ID: <534C4385.50905@ipv6.dp.ua> Yes, both packages are installed: $ rpm -qa | grep sctp lksctp-tools-devel-1.0.10-7.el6.x86_64 lksctp-tools-1.0.10-7.el6.x86_64 On 04/14/2014 11:11 PM, Chandru wrote: > Do you have the lksctp-tools and lksctp-tools-devel packages installed? > > cheers > Chandru > > > On 14 April 2014 20:54, Artem Teslenko > wrote: > > Hello, > > Can't make SCTP work on my system with esl-erlang installed: > > $ lsb_release -a > LSB Version: > :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch > Distributor ID: RedHatEnterpriseServer > Description: Red Hat Enterprise Linux Server release 6.5 (Santiago) > Release: 6.5 > Codename: Santiago > > $ rpm -qa |grep erlang > esl-erlang-R16B03-4.x86_64 > > $ rpm -qa |grep sctp > lksctp-tools-1.0.10-7.el6.x86_64 > > $ lsmod |grep sctp > sctp 198775 2 > > $ erl > Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:2:2] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V5.10.4 (abort with ^G) > 1> gen_sctp:open(). > {error,eprotonosupport} > > Is esl-erlang compiled without SCTP support or is something wrong > with my system? > > Thanks. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandrashekhar.mullaparthi@REDACTED Mon Apr 14 22:26:45 2014 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Mon, 14 Apr 2014 21:26:45 +0100 Subject: [erlang-questions] SCTP support in Erlang from ESL In-Reply-To: <534C4385.50905@ipv6.dp.ua> References: <534C3D0A.7010705@ipv6.dp.ua> <534C4385.50905@ipv6.dp.ua> Message-ID: It is possible that the ESL build was done on a machine without SCTP support, or the --enable-sctp flags were not supplied. One option is to build from source. cheers Chandru On 14 April 2014 21:22, Artem Teslenko wrote: > Yes, both packages are installed: > > > $ rpm -qa | grep sctp > lksctp-tools-devel-1.0.10-7.el6.x86_64 > lksctp-tools-1.0.10-7.el6.x86_64 > > > > On 04/14/2014 11:11 PM, Chandru wrote: > > Do you have the lksctp-tools and lksctp-tools-devel packages installed? > > cheers > Chandru > > > On 14 April 2014 20:54, Artem Teslenko wrote: > >> Hello, >> >> Can't make SCTP work on my system with esl-erlang installed: >> >> $ lsb_release -a >> LSB Version: >> :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch >> Distributor ID: RedHatEnterpriseServer >> Description: Red Hat Enterprise Linux Server release 6.5 (Santiago) >> Release: 6.5 >> Codename: Santiago >> >> $ rpm -qa |grep erlang >> esl-erlang-R16B03-4.x86_64 >> >> $ rpm -qa |grep sctp >> lksctp-tools-1.0.10-7.el6.x86_64 >> >> $ lsmod |grep sctp >> sctp 198775 2 >> >> $ erl >> Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:2:2] >> [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V5.10.4 (abort with ^G) >> 1> gen_sctp:open(). >> {error,eprotonosupport} >> >> Is esl-erlang compiled without SCTP support or is something wrong with my >> system? >> >> Thanks. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.wobben@REDACTED Mon Apr 14 20:49:08 2014 From: r.wobben@REDACTED (Roelof Wobben) Date: Mon, 14 Apr 2014 20:49:08 +0200 Subject: [erlang-questions] two beginners questions Message-ID: <534C2DA4.4000701@home.nl> Hello, I have two beginners question. 1) I start learning by the tryerlang site. And I did succeed in the list part. But the last question is to display the HEAD and TAIL. How do I do that. 2) I like to use Sublimetext as a IDE. But how do I make a programm then run. Roelof From r.wobben@REDACTED Mon Apr 14 21:32:29 2014 From: r.wobben@REDACTED (Roelof Wobben) Date: Mon, 14 Apr 2014 21:32:29 +0200 Subject: [erlang-questions] good frfee book for a beginner Message-ID: <534C37CD.8080702@home.nl> Hello, What is the best first step to become a good erlang programmer. Is there a good free book with a lot of exercises or challenges which I can try. Roelof From puig@REDACTED Mon Apr 14 22:40:11 2014 From: puig@REDACTED (Juan Puig Martinez) Date: Mon, 14 Apr 2014 13:40:11 -0700 Subject: [erlang-questions] [ANN] Erlang Silicon Valley Meetup Message-ID: Hi all, Today the Erlang Silicon Valley Meetup group is hosting its first meetup: http://www.meetup.com/Erlang-SV/ Check it out, specially if are based in the Bay Area. -- *Juan Puig* -------------- next part -------------- An HTML attachment was scrubbed... URL: From cvi@REDACTED Mon Apr 14 22:47:26 2014 From: cvi@REDACTED (=?UTF-8?Q?Christoffer_Vikstr=C3=B6m?=) Date: Mon, 14 Apr 2014 22:47:26 +0200 Subject: [erlang-questions] good frfee book for a beginner In-Reply-To: <534C37CD.8080702@home.nl> References: <534C37CD.8080702@home.nl> Message-ID: Try http://learnyousomeerlang.com/. -cvi On Mon, Apr 14, 2014 at 9:32 PM, Roelof Wobben wrote: > Hello, > > What is the best first step to become a good erlang programmer. > Is there a good free book with a lot of exercises or challenges which I > can try. > > Roelof > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lee.sylvester@REDACTED Mon Apr 14 22:47:44 2014 From: lee.sylvester@REDACTED (Lee Sylvester) Date: Mon, 14 Apr 2014 21:47:44 +0100 Subject: [erlang-questions] good frfee book for a beginner In-Reply-To: <534C37CD.8080702@home.nl> References: <534C37CD.8080702@home.nl> Message-ID: <529041D4-8493-43F3-894D-0559F200ED02@gmail.com> "Learn You Some Erlang for Great Good" is arguably the best beginner book, but I would highly recommend reading the "Erlang / OTP in Action" book straight after for the ?correct? way to do things. The Learn You Some Erlang book has a free version on it?s website: http://learnyousomeerlang.com/ Lee On 14 Apr 2014, at 20:32, Roelof Wobben wrote: > Hello, > > What is the best first step to become a good erlang programmer. > Is there a good free book with a lot of exercises or challenges which I can try. > > Roelof > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From lee.sylvester@REDACTED Mon Apr 14 22:49:12 2014 From: lee.sylvester@REDACTED (Lee Sylvester) Date: Mon, 14 Apr 2014 21:49:12 +0100 Subject: [erlang-questions] good frfee book for a beginner In-Reply-To: <529041D4-8493-43F3-894D-0559F200ED02@gmail.com> References: <534C37CD.8080702@home.nl> <529041D4-8493-43F3-894D-0559F200ED02@gmail.com> Message-ID: One thing I would say is that the Learn You Some Erlang book is a little verbose. Keep with it, though, as it is very informative and easy going. Lee On 14 Apr 2014, at 21:47, Lee Sylvester wrote: > "Learn You Some Erlang for Great Good" is arguably the best beginner book, but I would highly recommend reading the "Erlang / OTP in Action" book straight after for the ?correct? way to do things. The Learn You Some Erlang book has a free version on it?s website: > > http://learnyousomeerlang.com/ > > Lee > > > On 14 Apr 2014, at 20:32, Roelof Wobben wrote: > >> Hello, >> >> What is the best first step to become a good erlang programmer. >> Is there a good free book with a lot of exercises or challenges which I can try. >> >> Roelof >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gumm@REDACTED Mon Apr 14 22:59:41 2014 From: gumm@REDACTED (Jesse Gumm) Date: Mon, 14 Apr 2014 15:59:41 -0500 Subject: [erlang-questions] erlang autobuild In-Reply-To: References: <6625B037-F74D-4F13-A0B1-8409B00F06A7@gmail.com> Message-ID: Sync is definitely a handy tool, but I should point out that it doesn't (per your original request) restart your app - it uses erlang's hot code reloading (which is usually better than restarting *anyway*). But if you were updating some initialization code or something like that that only runs during startup, you'd have to manually restart the vm, or you could look into the post-compile hooks if you *really* want it to auto-restart some processes after reloading. -- Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm On Apr 14, 2014 11:40 AM, "t x" wrote: > Yes, this was exactly what I ended up using. :-) > > On Sun, Apr 13, 2014 at 9:48 PM, Dmitry Bushmelev > wrote: > > Hi, look at https://github.com/rustyio/sync. > > > > On 14 Apr 2014, at 08:02, t x wrote: > > > > Hi, > > > > In clojurescript, I can do something like: > > > > "lein autobuild" > > > > which basically means, any time src/**/*.cljs changes, recompile > > everything. > > > > > > > > Is there a similar way to do something like the above in erlang ? > > > > I would like to do : > > > > "erlang-magic autobuild" > > > > so that any time I save a file in src/*.erl, it does: > > > > "make" (since I'm running erlang.mk) > > _rel/bin/release/my_app stop > > _rel/bin/release/my_app start > > > > ? > > > > Thanks! > > > > > > Basically, I want a "file save" in Emacs to trigger: > > * recompile > > * kill old app > > * start new app > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean@REDACTED Mon Apr 14 23:03:52 2014 From: sean@REDACTED (Sean Cribbs) Date: Mon, 14 Apr 2014 16:03:52 -0500 Subject: [erlang-questions] two beginners questions In-Reply-To: <534C2DA4.4000701@home.nl> References: <534C2DA4.4000701@home.nl> Message-ID: On Mon, Apr 14, 2014 at 1:49 PM, Roelof Wobben wrote: > Hello, > > I have two beginners question. > > 1) I start learning by the tryerlang site. And I did succeed in the list > part. But the last question is to display the HEAD and TAIL. How do I do > that. > > It gives you the answer, actually: [Head|Tail] = [a, b, c, d, e] Head is the head of the list and Tail is the tail, bound by the pattern-matching statement. Alternatively, you can use the built-in functions hd/1 and tl/1, e.g. if I have a list in the variable List, hd(List) gives the head and tl(List) gives the tail. 2) I like to use Sublimetext as a IDE. But how do I make a programm then > run. > > When you have compiled, either manually via erlc or with a build tool, run "erl" and call the function in the module you want to run. Nothing IDE-specific there, sorry. Suggested next resource: learnyousomeerlang.com -- Sean Cribbs Software Engineer Basho Technologies, Inc. http://basho.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ates@REDACTED Mon Apr 14 23:05:32 2014 From: ates@REDACTED (Artem Teslenko) Date: Tue, 15 Apr 2014 00:05:32 +0300 Subject: [erlang-questions] SCTP support in Erlang from ESL In-Reply-To: References: <534C3D0A.7010705@ipv6.dp.ua> <534C4385.50905@ipv6.dp.ua> Message-ID: <534C4D9C.10107@ipv6.dp.ua> Yes, looks like you right, but build from source is not an option in my case. :( On 04/14/2014 11:26 PM, Chandru wrote: > It is possible that the ESL build was done on a machine without SCTP > support, or the --enable-sctp flags were not supplied. One option is > to build from source. > > cheers > Chandru > > On 14 April 2014 21:22, Artem Teslenko > wrote: > > Yes, both packages are installed: > > > $ rpm -qa | grep sctp > lksctp-tools-devel-1.0.10-7.el6.x86_64 > lksctp-tools-1.0.10-7.el6.x86_64 > > > > On 04/14/2014 11:11 PM, Chandru wrote: >> Do you have the lksctp-tools and lksctp-tools-devel packages >> installed? >> >> cheers >> Chandru >> >> >> On 14 April 2014 20:54, Artem Teslenko > > wrote: >> >> Hello, >> >> Can't make SCTP work on my system with esl-erlang installed: >> >> $ lsb_release -a >> LSB Version: >> :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch >> Distributor ID: RedHatEnterpriseServer >> Description: Red Hat Enterprise Linux Server release 6.5 >> (Santiago) >> Release: 6.5 >> Codename: Santiago >> >> $ rpm -qa |grep erlang >> esl-erlang-R16B03-4.x86_64 >> >> $ rpm -qa |grep sctp >> lksctp-tools-1.0.10-7.el6.x86_64 >> >> $ lsmod |grep sctp >> sctp 198775 2 >> >> $ erl >> Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:2:2] >> [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V5.10.4 (abort with ^G) >> 1> gen_sctp:open(). >> {error,eprotonosupport} >> >> Is esl-erlang compiled without SCTP support or is something >> wrong with my system? >> >> Thanks. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mfidelman@REDACTED Mon Apr 14 23:07:14 2014 From: mfidelman@REDACTED (Miles Fidelman) Date: Mon, 14 Apr 2014 17:07:14 -0400 Subject: [erlang-questions] good frfee book for a beginner In-Reply-To: <529041D4-8493-43F3-894D-0559F200ED02@gmail.com> References: <534C37CD.8080702@home.nl> <529041D4-8493-43F3-894D-0559F200ED02@gmail.com> Message-ID: <534C4E02.4040609@meetinghouse.net> I'll echo that. Erlang/OTP in action really digs into the OTP part of the ecosystem - which is what does all the heavy lifting. Miles Fidelman Lee Sylvester wrote: > "Learn You Some Erlang for Great Good" is arguably the best beginner > book, but I would highly recommend reading the "Erlang / OTP in > Action" book straight after for the ?correct? way to do things. The > Learn You Some Erlang book has a free version on it?s website: > > http://learnyousomeerlang.com/ > > Lee > > > On 14 Apr 2014, at 20:32, Roelof Wobben > wrote: > >> Hello, >> >> What is the best first step to become a good erlang programmer. >> Is there a good free book with a lot of exercises or challenges which >> I can try. >> >> Roelof >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- In theory, there is no difference between theory and practice. In practice, there is. .... Yogi Berra From essen@REDACTED Mon Apr 14 23:26:42 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 14 Apr 2014 23:26:42 +0200 Subject: [erlang-questions] good frfee book for a beginner In-Reply-To: References: <534C37CD.8080702@home.nl> <529041D4-8493-43F3-894D-0559F200ED02@gmail.com> Message-ID: <534C5292.8060309@ninenines.eu> Fred is pretty verbose himself. :-) On 04/14/2014 10:49 PM, Lee Sylvester wrote: > One thing I would say is that the Learn You Some Erlang book is a little > verbose. Keep with it, though, as it is very informative and easy going. > > Lee > > > On 14 Apr 2014, at 21:47, Lee Sylvester > wrote: > >> "Learn You Some Erlang for Great Good" is arguably the best beginner >> book, but I would highly recommend reading the "Erlang / OTP in >> Action" book straight after for the ?correct? way to do things. The >> Learn You Some Erlang book has a free version on it?s website: >> >> http://learnyousomeerlang.com/ >> >> Lee >> >> >> On 14 Apr 2014, at 20:32, Roelof Wobben > > wrote: >> >>> Hello, >>> >>> What is the best first step to become a good erlang programmer. >>> Is there a good free book with a lot of exercises or challenges which >>> I can try. >>> >>> Roelof >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From txrev319@REDACTED Mon Apr 14 23:27:51 2014 From: txrev319@REDACTED (t x) Date: Mon, 14 Apr 2014 14:27:51 -0700 Subject: [erlang-questions] erlang autobuild In-Reply-To: References: <6625B037-F74D-4F13-A0B1-8409B00F06A7@gmail.com> Message-ID: Yeah, I ended up using sync:on_reload(...) [1] to call application:stop and application:start on reloads. [1] function name may be wrong, away from my dev machine at the moment On Mon, Apr 14, 2014 at 1:59 PM, Jesse Gumm wrote: > Sync is definitely a handy tool, but I should point out that it doesn't (per > your original request) restart your app - it uses erlang's hot code > reloading (which is usually better than restarting *anyway*). But if you > were updating some initialization code or something like that that only runs > during startup, you'd have to manually restart the vm, or you could look > into the post-compile hooks if you *really* want it to auto-restart some > processes after reloading. > > -- > Jesse Gumm > Owner, Sigma Star Systems > 414.940.4866 || sigma-star.com || @jessegumm > > On Apr 14, 2014 11:40 AM, "t x" wrote: >> >> Yes, this was exactly what I ended up using. :-) >> >> On Sun, Apr 13, 2014 at 9:48 PM, Dmitry Bushmelev >> wrote: >> > Hi, look at https://github.com/rustyio/sync. >> > >> > On 14 Apr 2014, at 08:02, t x wrote: >> > >> > Hi, >> > >> > In clojurescript, I can do something like: >> > >> > "lein autobuild" >> > >> > which basically means, any time src/**/*.cljs changes, recompile >> > everything. >> > >> > >> > >> > Is there a similar way to do something like the above in erlang ? >> > >> > I would like to do : >> > >> > "erlang-magic autobuild" >> > >> > so that any time I save a file in src/*.erl, it does: >> > >> > "make" (since I'm running erlang.mk) >> > _rel/bin/release/my_app stop >> > _rel/bin/release/my_app start >> > >> > ? >> > >> > Thanks! >> > >> > >> > Basically, I want a "file save" in Emacs to trigger: >> > * recompile >> > * kill old app >> > * start new app >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > >> > >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From k.petrauskas@REDACTED Tue Apr 15 06:57:47 2014 From: k.petrauskas@REDACTED (Karolis Petrauskas) Date: Tue, 15 Apr 2014 07:57:47 +0300 Subject: [erlang-questions] Unable to start mnesia DB. In-Reply-To: References: <51DFAC74.9060401@gmail.com> Message-ID: Hi, Recently this problem reappeared: my mnesia DB started to load very slowly. The main problem was single disc_copies table with ~500k small records. This time it was loading for 35 minutes. This table is of type "bag" and has one secondary index. Based on previous emails, I assumed that the problems are caused by the index. I dropped the index, altrough observed no notable improvement (in startup time). Then I changed table to disc_only_copies. The DB started to load fast (<1min) event with secondary index (I have recreated it). Another strange thing here is that the mnesia:foldl/3 for this table was very slow. I was just copying several fields from this table to another table. I have aborted this operation after waiting for several hours. The foldl operation completed in ~2 minutes after i changed the source table type from disc_copies to disc_only_copies. Currently I think the problem is related to uniqueness of the key in the table. For some time the application worked so, that each key had not more than 100 records per key (the table is of type "bag"). Recently the application started to generate more records (1k or event 10k) per key. Is it normal/expected behaviour of Mnesia, or should I try to create scripts for reproducing this problem and report it as a bug? The application is running on Erlang R16B02 on Debian OS. Karolis On Sun, Jul 14, 2013 at 10:59 PM, Karolis Petrauskas wrote: > Hi, > > Thanks for your response. I have 1 secondary index in the entire > DB. I will try to load the DB with the index dropped. > > Karolis > > On Fri, Jul 12, 2013 at 10:12 AM, Ignas Vy?niauskas wrote: >> On 07/09/2013 07:16 PM, Karolis Petrauskas wrote: >>> After the DB become available, I stopped the node by invoking >>> init:stop(). Then I repeated the test. It is still running, but >>> timings look the same (2 cores were busy for 2.5 hours, and after >>> that 1 core is loaded fully, expected for ~5.5 hours). For the second >>> start up attempt the DB has no DCL files, only DCD are left after >>> first load. >> >> A poke in the dark: do you maybe have lots of secondary indices? These >> will not be stored on disk and so will be recreated each time the tables >> are loaded, I've experienced very long mnesia startup times in such >> cases. Otherwise -- no idea. >> >> -- >> Ignas From lloyd@REDACTED Sun Apr 13 06:24:00 2014 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Sun, 13 Apr 2014 00:24:00 -0400 Subject: [erlang-questions] Erlang make out In-Reply-To: References: <1397281406.49314842@apps.rackspace.com> Message-ID: <6BB61D30-F46F-4959-9DB6-D4860EF970A1@writersglen.com> Point well taken, tx, but I really wasn't thinking so much about standards. However ill phrased, I I was wondering about the technical strengths and weakness of the various approaches, particularly in contrast to Erlang make. But do appreciate your response. All the best, Lloyd Sent from my iPad > On Apr 12, 2014, at 11:56 AM, t x wrote: > > https://xkcd.com/927/ :-) > >> On Sat, Apr 12, 2014 at 4:05 AM, Erik S?e S?rensen wrote: >> [Off-topic] Wellp, there's my next Erlang project name: yada - "yet another >> distributed application" ;-) >> >> Den 12/04/2014 08.25 skrev : >> >>> Hello, >>> >>> A heap of Googling and a recent thread on Erlang Questions suggests that >>> there is little unanimity on the best way to organize and make large >>> (multiple application) Erlang systems--- Erlang make, GNU make, Sinan, >>> Rebar, erlang.mk, erl.mk, yada, yada. Enough to give a noob a colossal >>> headache. >>> >>> Two questions: >>> >>> 1) Is this a matter of reinventing the wheel? Or are there sound technical >>> reasons for so many options? >>> >>> 2) Is there an emerging consensus? >>> >>> Thanks, >>> >>> LRP >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> From dangud@REDACTED Tue Apr 15 09:40:29 2014 From: dangud@REDACTED (Dan Gudmundsson) Date: Tue, 15 Apr 2014 09:40:29 +0200 Subject: [erlang-questions] Unable to start mnesia DB. In-Reply-To: References: <51DFAC74.9060401@gmail.com> Message-ID: That is how bag tables in ets are implemented, which is why index is slow if your secondary keys are equal, the same thing applies to ordinary bag-tables, if many primary keys are identical. /Dan On Tue, Apr 15, 2014 at 6:57 AM, Karolis Petrauskas wrote: > Hi, > > Recently this problem reappeared: my mnesia DB started to load very > slowly. The main problem was single disc_copies table with ~500k small > records. This time it was loading for 35 minutes. This table is of > type "bag" and has one secondary index. > > Based on previous emails, I assumed that the problems are caused by > the index. I dropped the index, altrough observed no notable > improvement (in startup time). Then I changed table to > disc_only_copies. The DB started to load fast (<1min) event with > secondary index (I have recreated it). > > Another strange thing here is that the mnesia:foldl/3 for this table > was very slow. I was just copying several fields from this table to > another table. I have aborted this operation after waiting for several > hours. The foldl operation completed in ~2 minutes after i changed the > source table type from disc_copies to disc_only_copies. > > Currently I think the problem is related to uniqueness of the key in > the table. For some time the application worked so, that each key had > not more than 100 records per key (the table is of type "bag"). > Recently the application started to generate more records (1k or event > 10k) per key. > > Is it normal/expected behaviour of Mnesia, or should I try to create > scripts for reproducing this problem and report it as a bug? > > The application is running on Erlang R16B02 on Debian OS. > > Karolis > > On Sun, Jul 14, 2013 at 10:59 PM, Karolis Petrauskas > wrote: > > Hi, > > > > Thanks for your response. I have 1 secondary index in the entire > > DB. I will try to load the DB with the index dropped. > > > > Karolis > > > > On Fri, Jul 12, 2013 at 10:12 AM, Ignas Vy?niauskas > wrote: > >> On 07/09/2013 07:16 PM, Karolis Petrauskas wrote: > >>> After the DB become available, I stopped the node by invoking > >>> init:stop(). Then I repeated the test. It is still running, but > >>> timings look the same (2 cores were busy for 2.5 hours, and after > >>> that 1 core is loaded fully, expected for ~5.5 hours). For the second > >>> start up attempt the DB has no DCL files, only DCD are left after > >>> first load. > >> > >> A poke in the dark: do you maybe have lots of secondary indices? These > >> will not be stored on disk and so will be recreated each time the tables > >> are loaded, I've experienced very long mnesia startup times in such > >> cases. Otherwise -- no idea. > >> > >> -- > >> Ignas > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan@REDACTED Tue Apr 15 09:52:33 2014 From: ivan@REDACTED (Ivan Uemlianin) Date: Tue, 15 Apr 2014 08:52:33 +0100 Subject: [erlang-questions] good frfee book for a beginner In-Reply-To: <534C37CD.8080702@home.nl> References: <534C37CD.8080702@home.nl> Message-ID: <534CE541.4020107@llaisdy.com> Dear Roelof For a solid foundation, the O'Reilly "Erlang Programming" by Cesarini & Thompson is the best. It is the only book with exercises. It is not free but it is worth the money. Joe Armstrong's "Programming Erlang" is also very good. Armstrong's style gives more of an impression of how fun and easy erlang can be. The other books mentioned are also good. Best wishes Ivan On 14/04/2014 20:32, Roelof Wobben wrote: > Hello, > > What is the best first step to become a good erlang programmer. > Is there a good free book with a lot of exercises or challenges which I > can try. > > Roelof > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- ============================================================ Ivan A. Uemlianin PhD Llaisdy Speech Technology Research and Development ivan@REDACTED www.llaisdy.com llaisdy.wordpress.com github.com/llaisdy www.linkedin.com/in/ivanuemlianin festina lente ============================================================ From eriksoe@REDACTED Tue Apr 15 13:18:11 2014 From: eriksoe@REDACTED (=?UTF-8?Q?Erik_S=C3=B8e_S=C3=B8rensen?=) Date: Tue, 15 Apr 2014 13:18:11 +0200 Subject: [erlang-questions] good frfee book for a beginner In-Reply-To: <534CE541.4020107@llaisdy.com> References: <534C37CD.8080702@home.nl> <534CE541.4020107@llaisdy.com> Message-ID: As source of additional exercises is Erlang Quest ( https://github.com/eriksoe/ErlangQuest). They're self-checking and vary in difficulty from easy to fairly challenging. Mostly sequential stuff, though. Den 15/04/2014 09.52 skrev "Ivan Uemlianin" : > Dear Roelof > > For a solid foundation, the O'Reilly "Erlang Programming" by Cesarini & > Thompson is the best. It is the only book with exercises. It is not free > but it is worth the money. > > Joe Armstrong's "Programming Erlang" is also very good. Armstrong's style > gives more of an impression of how fun and easy erlang can be. > > The other books mentioned are also good. > > Best wishes > > Ivan > > > On 14/04/2014 20:32, Roelof Wobben wrote: > >> Hello, >> >> What is the best first step to become a good erlang programmer. >> Is there a good free book with a lot of exercises or challenges which I >> can try. >> >> Roelof >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > -- > ============================================================ > Ivan A. Uemlianin PhD > Llaisdy > Speech Technology Research and Development > > ivan@REDACTED > www.llaisdy.com > llaisdy.wordpress.com > github.com/llaisdy > www.linkedin.com/in/ivanuemlianin > > festina lente > ============================================================ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.nijhof@REDACTED Tue Apr 15 13:46:18 2014 From: mark.nijhof@REDACTED (Mark Nijhof) Date: Tue, 15 Apr 2014 13:46:18 +0200 Subject: [erlang-questions] good frfee book for a beginner In-Reply-To: <534C37CD.8080702@home.nl> References: <534C37CD.8080702@home.nl> Message-ID: I am currently working on https://leanpub.com/functionalerlang which is geared towards getting up an running fast vs a complete guide (as there are already a few good ones of those), once I get a bit further I'll send it to you, would love to hear your feedback. -Mark On Apr 14, 2014 10:45 PM, "Roelof Wobben" wrote: > Hello, > > What is the best first step to become a good erlang programmer. > Is there a good free book with a lot of exercises or challenges which I > can try. > > Roelof > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From groovenino@REDACTED Tue Apr 15 13:42:10 2014 From: groovenino@REDACTED (Oscar Felipe) Date: Tue, 15 Apr 2014 13:42:10 +0200 Subject: [erlang-questions] xref: adding directories dinamically Message-ID: Hi All, I can successfully import the dependencies I need in my node importing them manually with -pa as following: erl -pa ebin deps/*/ebin /path/to/release/*/ebin Then I start xref and add a release without errors. Whereas when I start a node and try to add the path in this way : code:add_patha("ebin"), Libs = filelib:wildcard("/path/to/release/*/ebin"), Deps = filelib:wildcard("deps/*/ebin"), code:add_pathsa(Libs ++ Deps) This does not work, despite that file:get_cwd() gives the same result as when I load the libraries manually including the paths with -pa flag. After that I also tried to add the directories to xref without success: xref:start(xr), [xref:add_directory(xr,D) || D <- Libs ++ Deps]. What do I am missing to provide all the paths that xref needs to start? I really appreciate any help you can provide, [Oscar] -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Tue Apr 15 14:52:51 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 15 Apr 2014 14:52:51 +0200 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: Hello again! > sometimes badarg in erlang:size([22,3,1,0,158,1,0,0,154,3,1,83,74|...]) > at tls_record.erl:122. > Same symptom was recently reported on erlang-bugs and it turned out to be due to upgrading a gen_tcp socket in active mode. When upgrading a gen_tcp socket to an ssl socket it must be put in passive mode ({active, false}) before the client is allowed to start the handshake. Normaly if the upgrade is negotiated this is not a problem for the server to set the option before signaling to the client to go ahead with the handshake. If the upgrade is only performed on the server side instead of calling the ssl API ( some people may do that due to the previously lack of possibility to specify ssl options when calling ssl:ssl_accept with an "sslsocket", this is no longer the case in 17.0) the listen socket needs to be put in passive mode (listen options are inherited by the acceptsocket) to make sure that the it will work, otherwhise it will work sometimes and sometime result in the error above. Regards Ingela Erlang/OTP team - Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From sevenjp@REDACTED Tue Apr 15 14:56:54 2014 From: sevenjp@REDACTED (=?UTF-8?Q?Jo=C3=A3o_Neves?=) Date: Tue, 15 Apr 2014 14:56:54 +0200 Subject: [erlang-questions] xref: adding directories dinamically In-Reply-To: References: Message-ID: You might get some clues from what I do in iota here (scan/2 and get_applications/2 are probably the only functions you'll be interested in): https://github.com/jpgneves/iota/blob/master/src/iota_scanner.erl You might notice I'm adding the applications to xref *before* I even add the ebin directories to the code path. Unfortunately I don't have enough information to help you directly, but at a first glance I don't see anything obviously wrong (though I might be missing it, it's been a while since I played around with this). My code could probably get a nice dose of simplification, but at least it's known to work AFAIK. -- Jo?o Neves 2014-04-15 13:42 GMT+02:00 Oscar Felipe : > Hi All, > I can successfully import the dependencies I need in my node importing > them manually with -pa as following: > erl -pa ebin deps/*/ebin /path/to/release/*/ebin > > Then I start xref and add a release without errors. > > Whereas when I start a node and try to add the path in this way : > code:add_patha("ebin"), > Libs = filelib:wildcard("/path/to/release/*/ebin"), > Deps = filelib:wildcard("deps/*/ebin"), > code:add_pathsa(Libs ++ Deps) > > This does not work, despite that file:get_cwd() gives the same result as > when I load the libraries manually including the paths with -pa flag. > After that I also tried to add the directories to xref without success: > > xref:start(xr), > [xref:add_directory(xr,D) || D <- Libs ++ Deps]. > > What do I am missing to provide all the paths that xref needs to start? > I really appreciate any help you can provide, > > [Oscar] > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Tue Apr 15 15:12:05 2014 From: roger@REDACTED (Roger Lipscombe) Date: Tue, 15 Apr 2014 14:12:05 +0100 Subject: [erlang-questions] Erlang node using ranch stops accepting SSL connections Message-ID: I've got a problem where my Erlang node stops accepting SSL connections. I start it up, and it works fine for a couple of minutes, then it just stops accepting connections. By works fine, I mean: - It appears in "netstat -a | grep LISTEN" - "telnet localhost Port" works fine. After a couple of minutes, it simply stops accepting connections: - telnet gets connection refused; a simple Erlang ssl:connect gets {error, econnrefused}. - If I look in netstat, I no longer see the LISTEN entry. However, if I look in inet:i(), the socket is still shown as ACCEPT. This is unchanged from the working state. I'm using ranch 0.9.0; I think I've followed the instructions for supervising it correctly -- I call ranch:child_spec and add it to my supervisor. I _am_ creating the listen socket myself. If I enumerate processes, I still have plenty of processes sitting in ranch_acceptor:loop/3, in turn blocking in prim_inet:accept0/2. The owner process for the socket is still running. It's my supervisor, which is in turn supervising the ranch_listener_sup. I've verified this with sys:get_state(Pid). This is on Mac OS X (Mavericks), running Erlang R16B03 from Homebrew. The same code works fine on Ubuntu. Question: how do I go about figuring out who killed my socket? Regards, Roger. From wbin00@REDACTED Tue Apr 15 15:31:53 2014 From: wbin00@REDACTED (Bin Wang) Date: Tue, 15 Apr 2014 21:31:53 +0800 Subject: [erlang-questions] Does read-write lock has a better performance than actor model? Message-ID: In Erlang, we handle concurrency in such a way: a process receives messages in its mailbox. And handle them one by one, just one in the same time. But in some situation, the request just want to read the resource. So the read requests should be able to execute at the same time since they don't change or break anything. So dose this meas if we use a write lock in such situation, we will have a better performance? If so, does Erlang have a proper way to do that? Thanks. --- Bin Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: From wbin00@REDACTED Tue Apr 15 15:46:09 2014 From: wbin00@REDACTED (Bin Wang) Date: Tue, 15 Apr 2014 21:46:09 +0800 Subject: [erlang-questions] Does read-write lock has a better performance than actor model? In-Reply-To: References: Message-ID: I meas if there is a write, then give it a lock. If all the requests are read operations, then no lock is needed. That means multiple read operations could be doing at the same time while there is no write operations. However, in actor model, the requests are always handled one by one no matter they are reads or writes. So didn't it slow at some situations? (Read are more that write). --- Bin Wang 2014-04-15 21:37 GMT+08:00 Dmitry Kolesnikov : > Hello, > > No, this is not good. > > Any on-going ?write request? makes changes to the state. The read request > does not know when the state becomes consistent unless there is a lock on > the state. You cannot ensure safe reading while writes is going on. > Therefore, actor model has bigger advantage. > > - Dmitry > > On 15 Apr 2014, at 16:31, Bin Wang wrote: > > > In Erlang, we handle concurrency in such a way: a process receives > messages in its mailbox. And handle them one by one, just one in the same > time. > > > > But in some situation, the request just want to read the resource. So > the read requests should be able to execute at the same time since they > don't change or break anything. > > > > So dose this meas if we use a write lock in such situation, we will have > a better performance? If so, does Erlang have a proper way to do that? > > > > Thanks. > > > > --- > > Bin Wang > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From me@REDACTED Tue Apr 15 16:03:45 2014 From: me@REDACTED (Xiao Jia) Date: Tue, 15 Apr 2014 16:03:45 +0200 Subject: [erlang-questions] Does read-write lock has a better performance than actor model? In-Reply-To: References: Message-ID: I want to propose a possible solution, but I am not confident: We probably want to publish readable states to a process (or several processes with load balancing?) dedicated to serving read requests. The cost is that after each write operation, the state must be published again. If there are much more reads than writes, the read serving process's mailbox size will be much larger than the write serving process. If I remember it correctly, this helps the scheduler to give more priority to the read serving process, or to give less priority to readers because the mailbox is already full of requests. As I said, I am not confident about my proposal. Hope someone helps to correct me :-D On Tue, Apr 15, 2014 at 3:46 PM, Bin Wang wrote: > I meas if there is a write, then give it a lock. If all the requests are > read operations, then no lock is needed. That means multiple read > operations could be doing at the same time while there is no write > operations. > > However, in actor model, the requests are always handled one by one no > matter they are reads or writes. So didn't it slow at some situations? > (Read are more that write). > > --- > Bin Wang > > > 2014-04-15 21:37 GMT+08:00 Dmitry Kolesnikov : > >> Hello, >> >> No, this is not good. >> >> Any on-going "write request" makes changes to the state. The read request >> does not know when the state becomes consistent unless there is a lock on >> the state. You cannot ensure safe reading while writes is going on. >> Therefore, actor model has bigger advantage. >> >> - Dmitry >> >> >> On 15 Apr 2014, at 16:31, Bin Wang wrote: >> >> > In Erlang, we handle concurrency in such a way: a process receives >> messages in its mailbox. And handle them one by one, just one in the same >> time. >> > >> > But in some situation, the request just want to read the resource. So >> the read requests should be able to execute at the same time since they >> don't change or break anything. >> > >> > So dose this meas if we use a write lock in such situation, we will >> have a better performance? If so, does Erlang have a proper way to do that? >> > >> > Thanks. >> > >> > --- >> > Bin Wang >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Regards, Xiao Jia -------------- next part -------------- An HTML attachment was scrubbed... URL: From tristan.sloughter@REDACTED Tue Apr 15 16:07:59 2014 From: tristan.sloughter@REDACTED (Tristan Sloughter) Date: Tue, 15 Apr 2014 07:07:59 -0700 Subject: [erlang-questions] New .app option runtime_dependencies Message-ID: <1397570879.15737.106728677.1E7CD68C@webmail.messagingengine.com> 2 questions regarding the new runtime_dependencies option in 17.0 .app files. First, the docs leave a lot to the imagination, if we look at the new .app file for observer: ? cat lib/observer-2.0/ebin/observer.app {application, observer, [{description, "OBSERVER version 1"}, {vsn, "2.0"}, {modules, [....]}, {registered, []}, {applications, [kernel, stdlib]}, {env, []}, {runtime_dependencies, ["wx-1.2","stdlib-2.0","runtime_tools-1.8.14", "kernel-3.0","inets-5.10","et-1.5", "erts-6.0"]}]}. How is a runtime_dependencies app different from one in the 'applications' key's values? Are they only started if they are in 'applications' and if they only exist in runtime_dependencies they should simply be in the path or should they be loaded? Or is it only to specify required version? In which case... why another entry and why are there apps in runtime_dependencies that aren't listed in applications. Next, will the OTP team work with the community on the format (I know the type is subject to change, and think that is a good thing... a tuple like {wx, ">=1.2"} would make more sense in my opinion) and the actual use of this key's values? We are looking to see what to do for relx (https://github.com/erlware/relx) since currently the libs copied for a release that includes something like observer will not include necessary dependencies. Oh, one more thing, I don't understand what this sentence is saying, "In the case such optional dependencies exist, these are specified and documented in the corresponding "App" documentation of the specific application." (http://www.erlang.org/doc/man/app.html) -- Tristan Sloughter tristan.sloughter@REDACTED From mononcqc@REDACTED Tue Apr 15 16:19:07 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Tue, 15 Apr 2014 10:19:07 -0400 Subject: [erlang-questions] Does read-write lock has a better performance than actor model? In-Reply-To: References: Message-ID: <20140415141904.GN19145@ferdair.local> The usual pattern for that kind of thing is to use ETS tables in protected mode. The server writes to the table, but the interface functions read directly from it. There's an example on how to transform the message-based approach to the ETS-optimized one (when necessary) at http://learnyousomeerlang.com/ets#a-little-less-conversation Regards, Fred. On 04/15, Xiao Jia wrote: > I want to propose a possible solution, but I am not confident: > > We probably want to publish readable states to a process (or several > processes with load balancing?) dedicated to serving read requests. The > cost is that after each write operation, the state must be published again. > If there are much more reads than writes, the read serving process's > mailbox size will be much larger than the write serving process. If I > remember it correctly, this helps the scheduler to give more priority to > the read serving process, or to give less priority to readers because the > mailbox is already full of requests. > > As I said, I am not confident about my proposal. Hope someone helps to > correct me :-D > > > On Tue, Apr 15, 2014 at 3:46 PM, Bin Wang wrote: > > > I meas if there is a write, then give it a lock. If all the requests are > > read operations, then no lock is needed. That means multiple read > > operations could be doing at the same time while there is no write > > operations. > > > > However, in actor model, the requests are always handled one by one no > > matter they are reads or writes. So didn't it slow at some situations? > > (Read are more that write). > > > > --- > > Bin Wang > > > > > > 2014-04-15 21:37 GMT+08:00 Dmitry Kolesnikov : > > > >> Hello, > >> > >> No, this is not good. > >> > >> Any on-going "write request" makes changes to the state. The read request > >> does not know when the state becomes consistent unless there is a lock on > >> the state. You cannot ensure safe reading while writes is going on. > >> Therefore, actor model has bigger advantage. > >> > >> - Dmitry > >> > >> > >> On 15 Apr 2014, at 16:31, Bin Wang wrote: > >> > >> > In Erlang, we handle concurrency in such a way: a process receives > >> messages in its mailbox. And handle them one by one, just one in the same > >> time. > >> > > >> > But in some situation, the request just want to read the resource. So > >> the read requests should be able to execute at the same time since they > >> don't change or break anything. > >> > > >> > So dose this meas if we use a write lock in such situation, we will > >> have a better performance? If so, does Erlang have a proper way to do that? > >> > > >> > Thanks. > >> > > >> > --- > >> > Bin Wang > >> > _______________________________________________ > >> > erlang-questions mailing list > >> > erlang-questions@REDACTED > >> > http://erlang.org/mailman/listinfo/erlang-questions > >> > >> > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > -- > Regards, > Xiao Jia > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From wbin00@REDACTED Tue Apr 15 16:34:06 2014 From: wbin00@REDACTED (Bin Wang) Date: Tue, 15 Apr 2014 22:34:06 +0800 Subject: [erlang-questions] Does read-write lock has a better performance than actor model? In-Reply-To: References: Message-ID: By "resource" I meas the state in processes. Such as the State in gen_server or gen_fsm. I think Fred's method is good if performance really matters. Though it is a little tricky. 2014-04-15 22:28 GMT+08:00 Aidan Hobson Sayers : > I think you need to clarify what kind of resource you're talking about. > E.g. multiple read operations on a flat file doesn't need locks, but you > physically cannot read it in concurrently. You have to have some way of > coordinating, be it by locking or letting the kernel do it. > The details of the answer change depending on what specifically you're > trying to do. But in short, there's very likely a way to do what you want. > > > On 15 April 2014 14:46, Bin Wang wrote: > >> I meas if there is a write, then give it a lock. If all the requests are >> read operations, then no lock is needed. That means multiple read >> operations could be doing at the same time while there is no write >> operations. >> >> However, in actor model, the requests are always handled one by one no >> matter they are reads or writes. So didn't it slow at some situations? >> (Read are more that write). >> >> --- >> Bin Wang >> >> >> 2014-04-15 21:37 GMT+08:00 Dmitry Kolesnikov : >> >>> Hello, >>> >>> No, this is not good. >>> >>> Any on-going ?write request? makes changes to the state. The read >>> request does not know when the state becomes consistent unless there is a >>> lock on the state. You cannot ensure safe reading while writes is going on. >>> Therefore, actor model has bigger advantage. >>> >>> - Dmitry >>> >>> >>> On 15 Apr 2014, at 16:31, Bin Wang wrote: >>> >>> > In Erlang, we handle concurrency in such a way: a process receives >>> messages in its mailbox. And handle them one by one, just one in the same >>> time. >>> > >>> > But in some situation, the request just want to read the resource. So >>> the read requests should be able to execute at the same time since they >>> don't change or break anything. >>> > >>> > So dose this meas if we use a write lock in such situation, we will >>> have a better performance? If so, does Erlang have a proper way to do that? >>> > >>> > Thanks. >>> > >>> > --- >>> > Bin Wang >>> > _______________________________________________ >>> > erlang-questions mailing list >>> > erlang-questions@REDACTED >>> > http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Tue Apr 15 16:38:14 2014 From: roger@REDACTED (Roger Lipscombe) Date: Tue, 15 Apr 2014 15:38:14 +0100 Subject: [erlang-questions] Erlang node using ranch stops accepting SSL connections (SOLVED) Message-ID: I tracked it down. When setting up the listen socket, we set {keepalive, true}, AND we set a bunch of raw options corresponding to TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT. Now, I _think_ I've got the correct numbers for these on the Mac, but it appears that -- on the Mac -- these shouldn't be applied to the listening socket. On Linux, they're inherited by the connected socket, but don't appear to do anything to the listen socket. On Mac, they seem to do things to the listen socket as well. Or maybe not. Either way, we're now NOT setting any of the keepalive options if os:type() =/= {unix,linux} and the server now continues to accept connections. On 15 April 2014 14:12, Roger Lipscombe wrote: > I've got a problem where my Erlang node stops accepting SSL > connections. I start it up, and it works fine for a couple of minutes, > then it just stops accepting connections. > > By works fine, I mean: > - It appears in "netstat -a | grep LISTEN" > - "telnet localhost Port" works fine. > > After a couple of minutes, it simply stops accepting connections: > > - telnet gets connection refused; a simple Erlang ssl:connect gets > {error, econnrefused}. > - If I look in netstat, I no longer see the LISTEN entry. > > However, if I look in inet:i(), the socket is still shown as ACCEPT. > This is unchanged from the working state. > > I'm using ranch 0.9.0; I think I've followed the instructions for > supervising it correctly -- I call ranch:child_spec and add it to my > supervisor. I _am_ creating the listen socket myself. > > If I enumerate processes, I still have plenty of processes sitting in > ranch_acceptor:loop/3, in turn blocking in prim_inet:accept0/2. > > The owner process for the socket is still running. It's my supervisor, > which is in turn supervising the ranch_listener_sup. I've verified > this with sys:get_state(Pid). > > This is on Mac OS X (Mavericks), running Erlang R16B03 from Homebrew. > The same code works fine on Ubuntu. > > Question: how do I go about figuring out who killed my socket? > > Regards, > Roger. From kenneth.lundin@REDACTED Tue Apr 15 17:23:29 2014 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Tue, 15 Apr 2014 17:23:29 +0200 Subject: [erlang-questions] New .app option runtime_dependencies In-Reply-To: <1397570879.15737.106728677.1E7CD68C@webmail.messagingengine.com> References: <1397570879.15737.106728677.1E7CD68C@webmail.messagingengine.com> Message-ID: On Tue, Apr 15, 2014 at 4:07 PM, Tristan Sloughter < tristan.sloughter@REDACTED> wrote: > 2 questions regarding the new runtime_dependencies option in 17.0 .app > files. > > First, the docs leave a lot to the imagination, if we look at the new > .app file for observer: > The documentation is sparse (on purpose) because this is a format and data that is not really finished or ready for broad usage yet. It is uesd by the OTP team to keep track of version dependencies between applications in order to know if a certain version of an application can be installed and run together with other applications on a specific system. Note the big WARNING SIGNS, I would not recommend that you invest a lot of time building tools that use this information if you are not prepared that it can change any time during OTP 17.x. > > ? cat lib/observer-2.0/ebin/observer.app > {application, observer, > [{description, "OBSERVER version 1"}, > {vsn, "2.0"}, > {modules, [....]}, > {registered, []}, > {applications, [kernel, stdlib]}, > {env, []}, > {runtime_dependencies, > ["wx-1.2","stdlib-2.0","runtime_tools-1.8.14", > "kernel-3.0","inets-5.10","et-1.5", > "erts-6.0"]}]}. > > How is a runtime_dependencies app different from one in the > 'applications' key's values? what is stated under the 'applications' key is start dependencies to other applications (they must be started before this application). > Are they only started if they are in > 'applications' and if they only exist in runtime_dependencies they > should simply be in the path or should they be loaded? Or is it only to > specify required version? In which case... why another entry and why are > there apps in runtime_dependencies that aren't listed in applications. > the applications listed under the 'runtime_dependencies' are applications that are needed in order to run this particular application. I.e they will be called by this application. It is also specifying that a certain version or higher is needed of each application. Nothing will be loaded or started because of this list. Applications without processes don't need to be started but can still be called. If you try to make a release (a .rel file) where you include observer and forget some of the other applications you will have something incomplete which is likely to fail in runtime. Depending on if you are running in embedded or interactive mode you need the applications in the .rel file (ending up in the start script) or in the code path where they are loaded on demand. > > Next, will the OTP team work with the community on the format (I know > the type is subject to change, and think that is a good thing... a tuple > like {wx, ">=1.2"} would make more sense in my opinion) and the actual > use of this key's values? > Yes there is room for improvements. We have already discussed solutions like that and they might be added later on. > > We are looking to see what to do for relx > (https://github.com/erlware/relx) since currently the libs copied for a > release that includes something like observer will not include necessary > dependencies. > > Oh, one more thing, I don't understand what this sentence is saying, "In > the case such optional dependencies exist, these are specified and > documented in the corresponding "App" documentation of the specific > application." (http://www.erlang.org/doc/man/app.html) > Today the format does not allow to specify optional runtime_dependencies so these are listed under the runtime_dependencies key but should be commented in the documentation of the application. Example of an optional dependency is for example if application A is dependent on application B only if a certain option or configuration of application A is used. For example SNMP can use tables stored in Mnesia and is by this optionally dependent on Mnesia since SNMP can very well be used without tables stored in Mnesia and is thus not always dependent on Mnesia it depends on what the user is doing with SNMP. It would be good to have some format to express these kind of dependencies as well. Most of the runtime_dependencies we have in place are generated with xref and then manually inspected and occasionally a dependency is removed because it is just a debugging or test dependency or a dependency is added because it is a dynamic one (apply) that xref cannot find. There are still many open questions. -- > Tristan Sloughter > tristan.sloughter@REDACTED > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > /Regards Kenneth Erlang/OTP Ericsson -------------- next part -------------- An HTML attachment was scrubbed... URL: From tristan.sloughter@REDACTED Tue Apr 15 17:34:07 2014 From: tristan.sloughter@REDACTED (Tristan Sloughter) Date: Tue, 15 Apr 2014 08:34:07 -0700 Subject: [erlang-questions] New .app option runtime_dependencies In-Reply-To: References: <1397570879.15737.106728677.1E7CD68C@webmail.messagingengine.com> Message-ID: <1397576047.8724.106768589.5F3E6ADD@webmail.messagingengine.com> Right, relx generated shell scripts start the release in embedded mode, so we'll need to either lay the burden on the user to list deps of apps like observer or use runtime_dependencies. This isn't an issue with library deps listed in applications since they don't have starts. So having runtime_dependencies that aren't library apps but you can list as deps and know they will only be in the path (or loaded in the case of our relx generated releases that are run in embedded mode) is useful. This is something that can be useful, which is why I hope it is open to use cases and feedback outside of the OTP team's use. -- Tristan Sloughter tristan.sloughter@REDACTED On Tue, Apr 15, 2014, at 08:23 AM, Kenneth Lundin wrote: On Tue, Apr 15, 2014 at 4:07 PM, Tristan Sloughter <[1]tristan.sloughter@REDACTED> wrote: 2 questions regarding the new runtime_dependencies option in 17.0 .app files. First, the docs leave a lot to the imagination, if we look at the new .app file for observer: The documentation is sparse (on purpose) because this is a format and data that is not really finished or ready for broad usage yet. It is uesd by the OTP team to keep track of version dependencies between applications in order to know if a certain version of an application can be installed and run together with other applications on a specific system. Note the big WARNING SIGNS, I would not recommend that you invest a lot of time building tools that use this information if you are not prepared that it can change any time during OTP 17.x. ? cat lib/observer-2.0/ebin/observer.app {application, observer, [{description, "OBSERVER version 1"}, {vsn, "2.0"}, {modules, [....]}, {registered, []}, {applications, [kernel, stdlib]}, {env, []}, {runtime_dependencies, ["wx-1.2","stdlib-2.0","runtime_tools-1.8.14", "kernel-3.0","inets-5.10","et-1.5", "erts-6.0"]}]}. How is a runtime_dependencies app different from one in the 'applications' key's values? what is stated under the 'applications' key is start dependencies to other applications (they must be started before this application). Are they only started if they are in 'applications' and if they only exist in runtime_dependencies they should simply be in the path or should they be loaded? Or is it only to specify required version? In which case... why another entry and why are there apps in runtime_dependencies that aren't listed in applications. the applications listed under the 'runtime_dependencies' are applications that are needed in order to run this particular application. I.e they will be called by this application. It is also specifying that a certain version or higher is needed of each application. Nothing will be loaded or started because of this list. Applications without processes don't need to be started but can still be called. If you try to make a release (a .rel file) where you include observer and forget some of the other applications you will have something incomplete which is likely to fail in runtime. Depending on if you are running in embedded or interactive mode you need the applications in the .rel file (ending up in the start script) or in the code path where they are loaded on demand. Next, will the OTP team work with the community on the format (I know the type is subject to change, and think that is a good thing... a tuple like {wx, ">=1.2"} would make more sense in my opinion) and the actual use of this key's values? Yes there is room for improvements. We have already discussed solutions like that and they might be added later on. We are looking to see what to do for relx ([2]https://github.com/erlware/relx) since currently the libs copied for a release that includes something like observer will not include necessary dependencies. Oh, one more thing, I don't understand what this sentence is saying, "In the case such optional dependencies exist, these are specified and documented in the corresponding "App" documentation of the specific application." ([3]http://www.erlang.org/doc/man/app.html) Today the format does not allow to specify optional runtime_dependencies so these are listed under the runtime_dependencies key but should be commented in the documentation of the application. Example of an optional dependency is for example if application A is dependent on application B only if a certain option or configuration of application A is used. For example SNMP can use tables stored in Mnesia and is by this optionally dependent on Mnesia since SNMP can very well be used without tables stored in Mnesia and is thus not always dependent on Mnesia it depends on what the user is doing with SNMP. It would be good to have some format to express these kind of dependencies as well. Most of the runtime_dependencies we have in place are generated with xref and then manually inspected and occasionally a dependency is removed because it is just a debugging or test dependency or a dependency is added because it is a dynamic one (apply) that xref cannot find. There are still many open questions. -- Tristan Sloughter [4]tristan.sloughter@REDACTED _______________________________________________ erlang-questions mailing list [5]erlang-questions@REDACTED [6]http://erlang.org/mailman/listinfo/erlang-questions /Regards Kenneth Erlang/OTP Ericsson References 1. mailto:tristan.sloughter@REDACTED 2. https://github.com/erlware/relx 3. http://www.erlang.org/doc/man/app.html 4. mailto:tristan.sloughter@REDACTED 5. mailto:erlang-questions@REDACTED 6. http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Wed Apr 16 00:07:53 2014 From: z@REDACTED (Danil Zagoskin) Date: Wed, 16 Apr 2014 02:07:53 +0400 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: Hi, Ingela. I finally had some time for investigating this problem. I didn't see badarg in erlang:size again, but it definitely appeared in 17.0 with simple accept method described as minimal example at http://www.erlang.org/doc/apps/ssl/using_ssl.html (the difference was transport_accept and ssl_accept were run in separate process) Today I met some new crash: ** {{badmatch,{alert,2,20,{"ssl_cipher.erl",215}}}, [{tls_record,decode_cipher_text,2,[{file,"tls_record.erl"},{line,157}]}, {tls_connection,next_record,1,[{file,"tls_connection.erl"},{line,503}]}, {tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,475}]}, {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} That's because ssl_record:decipher/3 may return #alert{}, but tls_record:decode_cipher_text/2 isn't expecting that. As for {case_clause,{4}} in ssl_v3:mac_hash/3 I found that precondition for crash is easily reproducible: https://gist.github.com/stolen/10780653 Ordinary servers negotiate with sha hash or close socket while ssl in 17.0 negotiates with sha256 hash. I don't know the protocol good enough to perform further states, but I hope this helps. Unfortunately, I don't understand how this code should be tested ? most of functions require #state{} or #connection_states{} which require #ssl_options{} and other stuff, and at I have found no exported function creating #ssl_options{} without side-effects. 2014-04-15 16:52 GMT+04:00 Ingela Andin : > Hello again! > > >> sometimes badarg in erlang:size([22,3,1,0,158,1,0,0,154,3,1,83,74|...]) >> at tls_record.erl:122. >> > > Same symptom was recently reported on erlang-bugs and it turned out to be > due to upgrading a gen_tcp socket in active mode. When upgrading a gen_tcp > socket to an ssl socket it must be put in passive mode ({active, false}) > before the client > is allowed to start the handshake. Normaly if the upgrade is negotiated > this is not a problem for the server to set the option > before signaling to the client to go ahead with the handshake. If the > upgrade is only performed on the server side instead of calling the ssl API > ( some people may do that due to the previously lack of possibility to > specify ssl options when calling ssl:ssl_accept with an "sslsocket", this > is no longer the case in 17.0) the listen socket needs to be put in passive > mode (listen options are inherited by the acceptsocket) to make sure that > the it will work, otherwhise it will work sometimes and sometime result in > the error above. > > Regards Ingela Erlang/OTP team - Ericsson AB > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Wed Apr 16 00:37:07 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 16 Apr 2014 10:37:07 +1200 Subject: [erlang-questions] Does read-write lock has a better performance than actor model? In-Reply-To: References: Message-ID: Erlang aims for *correctness* first, performance later. The whole question about read/write locks strikes me as trying to apply inappropriate thinking in an Erlang context. The thing about read-write locks in a shared-memory language like C or Java is that if several threads have been granted read access to some data structure, they can access it DIRECTLY. But in Erlang there is no such thing as accessing data owned by some thread directly. If you want it, you have to send a message asking for it, and it has to send a message back with the information. You might as well send a request to do a "big" calculation, and the owning process can create a new process to do the calculation, passing it the data it needs. Any number of such handler processes can be active at once, which is *like* having a read lock, but they are working on independent copies of the data. (Logically independent anyway. In a shared-heap implementation it might be physically shared.) We could argue about this in the abstract until the dinotheriums come home. Such discussions are ALWAYS more illuminating in concrete cases. But always, bear in mind the model: each Erlang process might as well be on a different machine. Ask yourself, what good does a POSIX read lock do me for data held on another machine? From ahmad@REDACTED Wed Apr 16 04:54:49 2014 From: ahmad@REDACTED (Ahmad Baitalmal) Date: Tue, 15 Apr 2014 19:54:49 -0700 Subject: [erlang-questions] relx and observer pain Message-ID: I can run observer just fine from the plain erl shell. In my relx project console, however, I'm doing _rel/bin/tomato console then observer:start(). it just hangs there, no ui, nothing. It holds shell until I CTRL+C. I see the Erlang App start on my Doc (OSX Mavericks, R17.0) but nothing happens. I get stuck. debugger:start(). works just fine. Here is my relx.config {release, {tomato, "1"}, [tomato,observer,wx,debugger,compiler]}. Is there something i'm not including? Thx -- Ahmad -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangsiri@REDACTED Wed Apr 16 08:32:12 2014 From: erlangsiri@REDACTED (Siri Hansen) Date: Wed, 16 Apr 2014 08:32:12 +0200 Subject: [erlang-questions] relx and observer pain In-Reply-To: References: Message-ID: Don't know if this is the reason for the hanging, but observer also needs runtime_tools. /siri onsdagen den 16:e april 2014 skrev Ahmad Baitalmal : > I can run observer just fine from the plain erl shell. > > In my relx project console, however, I'm doing > > _rel/bin/tomato console > > then > observer:start(). > > it just hangs there, no ui, nothing. It holds shell until I CTRL+C. > I see the Erlang App start on my Doc (OSX Mavericks, R17.0) but nothing > happens. I get stuck. > > debugger:start(). > works just fine. > > Here is my relx.config > {release, {tomato, "1"}, [tomato,observer,wx,debugger,compiler]}. > > Is there something i'm not including? Thx > -- > Ahmad > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Wed Apr 16 11:34:29 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 16 Apr 2014 11:34:29 +0200 Subject: [erlang-questions] imap and pop3 clients libs Message-ID: Does anyone know a maintained erlang client lib for IMAP and POP3 server? I found for imap: https://code.google.com/p/erlmail/ https://github.com/boorad/erlimap for pop3: https://github.com/mallipeddi/erlpop https://code.google.com/p/erlmail/ All looks unmaintained... Maybe just because they don't need any updates, but then which one to use? - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans.bolinder@REDACTED Wed Apr 16 11:49:53 2014 From: hans.bolinder@REDACTED (Hans Bolinder) Date: Wed, 16 Apr 2014 09:49:53 +0000 Subject: [erlang-questions] Erlang 17 issue with dialyzer and nowarn_deprecated_type In-Reply-To: References: Message-ID: <56466BD70414EA48969B4064696CF28C037DAD37@ESESSMB207.ericsson.se> Hi, [Shayan Pooya:] > In order to make Disco compile with Erlang 17 without warnings, I > added nowarn_deprecated_type to silence the warnings. However, after > doing so, dialyzer fails with the following error: > > ddfs_master.erl:345: Attempt to test for inequality between a term of type 'false' and a term of opaque type 'false' | gb_set() This is a bug. There will be a fix in 17.1. You can try the patch below, or run Dialyzer with the "-Wno_opaque" option. Best regards, Hans Bolinder, Erlang/OTP team, Ericsson diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index 47b8dc7..6065b79 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -2985,16 +2985,19 @@ inf_union(U1, U2, Opaques) -> List = [A,B,F,I,L,N,T,M,Map], inf_union_collect(List, Opaque, InfFun, [], []) end, - O1 = OpaqueFun(U1, U2, fun(E, Opaque) -> t_inf(Opaque, E, Opaques) end), - O2 = OpaqueFun(U2, U1, fun(E, Opaque) -> t_inf(E, Opaque, Opaques) end), - Union = inf_union(U1, U2, 0, [], Opaques), - t_sup([O1, O2, Union]). + {O1, ThrowList1} = + OpaqueFun(U1, U2, fun(E, Opaque) -> t_inf(Opaque, E, Opaques) end), + {O2, ThrowList2} + = OpaqueFun(U2, U1, fun(E, Opaque) -> t_inf(E, Opaque, Opaques) end), + {Union, ThrowList3} = inf_union(U1, U2, 0, [], [], Opaques), + ThrowList = lists:merge3(ThrowList1, ThrowList2, ThrowList3), + case t_sup([O1, O2, Union]) of + ?none when ThrowList =/= [] -> throw(hd(ThrowList)); + Sup -> Sup + end. inf_union_collect([], _Opaque, _InfFun, InfList, ThrowList) -> - case t_sup(InfList) of - ?none when ThrowList =/= [] -> throw(hd(lists:flatten(ThrowList))); - Sup -> Sup - end; + {t_sup(InfList), lists:usort(ThrowList)}; inf_union_collect([?none|L], Opaque, InfFun, InfList, ThrowList) -> inf_union_collect(L, Opaque, InfFun, [?none|InfList], ThrowList); inf_union_collect([E|L], Opaque, InfFun, InfList, ThrowList) -> @@ -3005,19 +3008,21 @@ inf_union_collect([E|L], Opaque, InfFun, InfList, ThrowList) -> inf_union_collect(L, Opaque, InfFun, InfList, [N|ThrowList]) end. -inf_union([?none|Left1], [?none|Left2], N, Acc, Opaques) -> - inf_union(Left1, Left2, N, [?none|Acc], Opaques); -inf_union([T1|Left1], [T2|Left2], N, Acc, Opaques) -> - case t_inf(T1, T2, Opaques) of - ?none -> inf_union(Left1, Left2, N, [?none|Acc], Opaques); - T -> inf_union(Left1, Left2, N+1, [T|Acc], Opaques) +inf_union([?none|Left1], [?none|Left2], N, Acc, ThrowList, Opaques) -> + inf_union(Left1, Left2, N, [?none|Acc], ThrowList, Opaques); +inf_union([T1|Left1], [T2|Left2], N, Acc, ThrowList, Opaques) -> + try t_inf(T1, T2, Opaques) of + ?none -> inf_union(Left1, Left2, N, [?none|Acc], ThrowList, Opaques); + T -> inf_union(Left1, Left2, N+1, [T|Acc], ThrowList, Opaques) + catch throw:N when is_integer(N) -> + inf_union(Left1, Left2, N, [?none|Acc], [N|ThrowList], Opaques) end; -inf_union([], [], N, Acc, _Opaques) -> - if N =:= 0 -> ?none; +inf_union([], [], N, Acc, ThrowList, _Opaques) -> + if N =:= 0 -> {?none, ThrowList}; N =:= 1 -> [Type] = [T || T <- Acc, T =/= ?none], - Type; - N >= 2 -> ?union(lists:reverse(Acc)) + {Type, ThrowList}; + N >= 2 -> {?union(lists:reverse(Acc)), ThrowList} end. inf_bitstr(U1, B1, U2, B2) -> -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Wed Apr 16 11:51:25 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 16 Apr 2014 11:51:25 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: <53466491.2010301@ninenines.eu> <20140410120159.GC22866@ferdmbp.local> <20140410175204.GH19145@ferdair.local> <5346DE9A.20402@ninenines.eu> <5346DFE8.4090406@ninenines.eu> <20140410182218.GI19145@ferdair.local> <5349303A.4030000@ninenines.eu> <20140412133945.GD22866@ferdmbp.local> <534954E5.9080209@ninenines.eu> Message-ID: On Sun, Apr 13, 2014 at 10:45 AM, Mahesh Paolini-Subramanya < mahesh@REDACTED> wrote: > This is as much a discussion of Methodology? as of anything else - as > with all things Methodology?, there are two over-riding rules > 1) Any Methodology? can be made to work (*) > 2) All Methodology? fail at the edge. > > It's indeed about methodology (so much "o" in this word...). When I start a project and organize the source (because I am french and we loves squares since Descartes) I am trying to answer to the following questions: - will it be easy in to maintain this moving code target - do i need to make this application generic (mainly when I publish 2 different but related products) - how much devs are involved on this repo (ie will it be a paini to handle conflicts). which is generally adressed by making changes atomic to a module. or an app/ folder in erlang. My initial mail was an attempt to collect different patterns around to see how to improve what I do. Still working on it. Also would be good to find a common way to distribute libraries without diving in the "nodejs" way where you finished to upload the world composed of atomic modules just to run 5 lines of code... Some of these modules unusable alone. - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksoe@REDACTED Wed Apr 16 12:55:34 2014 From: eriksoe@REDACTED (=?UTF-8?Q?Erik_S=C3=B8e_S=C3=B8rensen?=) Date: Wed, 16 Apr 2014 12:55:34 +0200 Subject: [erlang-questions] imap and pop3 clients libs In-Reply-To: References: Message-ID: I've recently used erlpop (which I at the time determined looked like the best choice), and made some contributions then (TLS support), so perhaps my github branch of it is the most usable. As for imap clients, the one client I tried - can't at the moment tell which, but erlmail sounds familiar - wasn't standards compliant in its parsing, so it botched up handling the hello message from the server (to my great disappointment). I looked into fixing that, only to conclude that the IMAP standard itself is rather clumsy wrt. syntax. Given a boatload of spare time, I think the best way to get a decent IMAP client is to use abnfc on the RFC's syntax specification. And then perhaps couple that with the rest of erlmail. /Erik Den 16/04/2014 11.35 skrev "Benoit Chesneau" : > Does anyone know a maintained erlang client lib for IMAP and POP3 server? > > > I found for imap: > > https://code.google.com/p/erlmail/ > https://github.com/boorad/erlimap > > > for pop3: > > https://github.com/mallipeddi/erlpop > https://code.google.com/p/erlmail/ > > > All looks unmaintained... Maybe just because they don't need any updates, > but then which one to use? > > - benoit > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From snaky@REDACTED Wed Apr 16 14:03:14 2014 From: snaky@REDACTED (Yuri Lukyanov) Date: Wed, 16 Apr 2014 16:03:14 +0400 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: Message-ID: What a big and valid question! 34 messages for the moment and counting :) Well, I can add our story. In the beginning, we had a single repository for everything. And even without apps dir. It was a single monster with everything inside the src dir. At some point, it became obvious that it couldn't go on like this and we started separating the code into apps. 'apps' directory looked like a good fit. Then we came across Riak and its sources. The way they organised their code seemed so gorgeous. A tiny repository for each application! Super easy to think of as a separate unit of your system. Different teams work on different repositories. Independent testing. Ability to open certain parts of your project to the community. Superb! And we started a 'big move' to that world. At the beginning, everything was smooth. Later, we even created a project template that uses that every-app-is-a-repo structure (https://github.com/EchoTeam/rebar-templates). But what we ended up with is what Bj?rn-Egil Dahlberg said above. The team is divided. Some of us just couldn't stand the growing number of repositories. The tree of dependencies started to be so big that it was a nightmare to change anything inside. Imagine that you need to update, say, lager version. We heavily use lager in all deps. You will need to update the deps list of one application, then the deps list of the application which is dependant on the first one, then 10 application which depend on the latter, etc... At the moment, we are still having different repos for different apps. But some people are already thinking to put _everything_ in one single repository. Not only all deps, but all projects as well :) There is no one-size-fits-all solution. Right, "In the long run, everything fails". Just don't be too religious about things. If you think that either approach is _the_ best, perhaps you just don't have use cases that can help your approach fail or your project is not big/small enough. On Thu, Apr 10, 2014 at 11:18 AM, Benoit Chesneau wrote: > Hi all, > > I would like to rework the way I am building releases and find a good way to > handle the inclusion of dependencies in them. I am generally using the easy > path for now by mostly using rebar to get the dependencies but I wonder what > others are doing. > > How do you get the dependencies, build them and adding them to the release? > Are you using your own scripts? Using a makefile like some? In that case how > do you maintain the dependencies list and their upgrades? > > Any feedback is appreciated :) > > - benoit > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From ingela.andin@REDACTED Wed Apr 16 15:07:10 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Wed, 16 Apr 2014 15:07:10 +0200 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: Hi! 2014-04-16 0:07 GMT+02:00 Danil Zagoskin : > Hi, Ingela. > > I finally had some time for investigating this problem. > > I didn't see badarg in erlang:size again, but it definitely appeared in > 17.0 with simple accept method described as minimal example at > http://www.erlang.org/doc/apps/ssl/using_ssl.html ( > > the difference was transport_accept and ssl_accept were run in separate > process) > That should be ok, you are suppose to be able to do that. > Today I met some new crash: > ** {{badmatch,{alert,2,20,{"ssl_cipher.erl",215}}}, > > [{tls_record,decode_cipher_text,2,[{file,"tls_record.erl"},{line,157}]}, > > {tls_connection,next_record,1,[{file,"tls_connection.erl"},{line,503}]}, > > {tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,475}]}, > {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, > {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} > > That's because ssl_record:decipher/3 may return #alert{}, but > tls_record:decode_cipher_text/2 isn't expecting that. > > Hum, looks like a bug. We will look into that. > > As for {case_clause,{4}} in ssl_v3:mac_hash/3 I found that precondition > for crash is easily reproducible: https://gist.github.com/stolen/10780653 > Ordinary servers negotiate with sha hash or close socket while ssl in 17.0 > negotiates with sha256 hash. > I don't know the protocol good enough to perform further states, but I > hope this helps. > > Okej, the following patch should take care of that problem. diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl index 743753b..093d4af 100644 --- a/lib/ssl/src/ssl.erl +++ b/lib/ssl/src/ssl.erl @@ -953,8 +953,8 @@ handle_cipher_option(Value, Version) when is_list(Value) -> error:_-> throw({error, {options, {ciphers, Value}}}) end. -binary_cipher_suites(Version, []) -> %% Defaults to all supported suits - ssl_cipher:suites(Version); +binary_cipher_suites(Version, []) -> + []; binary_cipher_suites(Version, [{_,_,_,_}| _] = Ciphers0) -> %% Backwards compatibility Ciphers = [{KeyExchange, Cipher, Hash} || {KeyExchange, Cipher, Hash, _} <- Ciphers0], binary_cipher_suites(Version, Ciphers); diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl index 1108edc..93d4efd 100644 --- a/lib/ssl/src/ssl_handshake.erl +++ b/lib/ssl/src/ssl_handshake.erl @@ -1017,11 +1017,14 @@ decode_suites('3_bytes', Dec) -> %%-------------Cipeher suite handling -------------------------------- available_suites(UserSuites, Version) -> + VersionSupportedSuites = ssl_cipher:suites(Version), case UserSuites of [] -> - ssl_cipher:suites(Version); + VersionSupportedSuites; _ -> - UserSuites + lists:filtermap(fun(Suite) -> + lists:member(Suite, VersionSupportedSuites) + end, UserSuites) end. available_suites(ServerCert, UserSuites, Version, Curve) -> > Unfortunately, I don't understand how this code should be tested ? most of > functions require #state{} or #connection_states{} which require > #ssl_options{} and other stuff, and at I have found no exported function > creating #ssl_options{} without side-effects. > #ssl_options{] is an internal representation of the proplists input list and should not be a visible in the API, records are generally not a good API choice as they enforce compile time dependencies. Regards Ingela - Erlang/OTP team - Ericsson AB > > 2014-04-15 16:52 GMT+04:00 Ingela Andin : > > Hello again! >> >> >>> sometimes badarg in erlang:size([22,3,1,0,158,1,0,0,154,3,1,83,74|...]) >>> at tls_record.erl:122. >>> >> >> Same symptom was recently reported on erlang-bugs and it turned out to be >> due to upgrading a gen_tcp socket in active mode. When upgrading a gen_tcp >> socket to an ssl socket it must be put in passive mode ({active, false}) >> before the client >> is allowed to start the handshake. Normaly if the upgrade is negotiated >> this is not a problem for the server to set the option >> before signaling to the client to go ahead with the handshake. If the >> upgrade is only performed on the server side instead of calling the ssl API >> ( some people may do that due to the previously lack of possibility to >> specify ssl options when calling ssl:ssl_accept with an "sslsocket", this >> is no longer the case in 17.0) the listen socket needs to be put in passive >> mode (listen options are inherited by the acceptsocket) to make sure that >> the it will work, otherwhise it will work sometimes and sometime result in >> the error above. >> >> Regards Ingela Erlang/OTP team - Ericsson AB >> > > > > -- > Danil Zagoskin | z@REDACTED > -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Wed Apr 16 15:56:44 2014 From: z@REDACTED (Danil Zagoskin) Date: Wed, 16 Apr 2014 17:56:44 +0400 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: Thank you for the patch. I'll check it. (Style question: is lists:filtermap better than list comprehension?) > #ssl_options{] is an internal representation of the proplists input list and should not be a visible in the API, records are generally not a good API choice as they enforce compile time dependencies. Yes, I understand that. I wanted to start broken client to see how server would work with it. The option to do that could be using sys:replace_state, but as far as I understand the code, client_hello is sent immediately after starting a process, so it seems there is no way to send crafted hello and continue handshake with couple of lines instead of ssl:connect. Given that possibility it could be much easier to reproduce server crashes when working with buggy clients. For example, How do I write a test for badmatch in tls_record:decode_cipher_text? The function takes #connection_states{}, and creating that record relies on #ssl_options{} which cannot be created without opening a socket and calling gen_fsm:enter_loop. 2014-04-16 17:07 GMT+04:00 Ingela Andin : > Hi! > > 2014-04-16 0:07 GMT+02:00 Danil Zagoskin : > > Hi, Ingela. >> >> I finally had some time for investigating this problem. >> >> I didn't see badarg in erlang:size again, but it definitely appeared in >> 17.0 with simple accept method described as minimal example at >> http://www.erlang.org/doc/apps/ssl/using_ssl.html ( >> > > > >> the difference was transport_accept and ssl_accept were run in separate >> process) >> > > That should be ok, you are suppose to be able to do that. > > > >> Today I met some new crash: >> ** {{badmatch,{alert,2,20,{"ssl_cipher.erl",215}}}, >> >> [{tls_record,decode_cipher_text,2,[{file,"tls_record.erl"},{line,157}]}, >> >> {tls_connection,next_record,1,[{file,"tls_connection.erl"},{line,503}]}, >> >> {tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,475}]}, >> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, >> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} >> >> That's because ssl_record:decipher/3 may return #alert{}, but >> tls_record:decode_cipher_text/2 isn't expecting that. >> >> > Hum, looks like a bug. We will look into that. > > >> >> As for {case_clause,{4}} in ssl_v3:mac_hash/3 I found that precondition >> for crash is easily reproducible: https://gist.github.com/stolen/10780653 >> Ordinary servers negotiate with sha hash or close socket while ssl in >> 17.0 negotiates with sha256 hash. >> I don't know the protocol good enough to perform further states, but I >> hope this helps. >> >> > Okej, the following patch should take care of that problem. > > diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl > index 743753b..093d4af 100644 > --- a/lib/ssl/src/ssl.erl > +++ b/lib/ssl/src/ssl.erl > @@ -953,8 +953,8 @@ handle_cipher_option(Value, Version) when > is_list(Value) -> > error:_-> > throw({error, {options, {ciphers, Value}}}) > end. > -binary_cipher_suites(Version, []) -> %% Defaults to all supported suits > - ssl_cipher:suites(Version); > +binary_cipher_suites(Version, []) -> > + []; > binary_cipher_suites(Version, [{_,_,_,_}| _] = Ciphers0) -> %% Backwards > compatibility > Ciphers = [{KeyExchange, Cipher, Hash} || {KeyExchange, Cipher, Hash, > _} <- Ciphers0], > binary_cipher_suites(Version, Ciphers); > diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl > index 1108edc..93d4efd 100644 > --- a/lib/ssl/src/ssl_handshake.erl > +++ b/lib/ssl/src/ssl_handshake.erl > @@ -1017,11 +1017,14 @@ decode_suites('3_bytes', Dec) -> > %%-------------Cipeher suite handling -------------------------------- > > available_suites(UserSuites, Version) -> > + VersionSupportedSuites = ssl_cipher:suites(Version), > case UserSuites of > [] -> > - ssl_cipher:suites(Version); > + VersionSupportedSuites; > _ -> > - UserSuites > + lists:filtermap(fun(Suite) -> > + lists:member(Suite, VersionSupportedSuites) > + end, UserSuites) > end. > > available_suites(ServerCert, UserSuites, Version, Curve) -> > > > > >> Unfortunately, I don't understand how this code should be tested ? most >> of functions require #state{} or #connection_states{} which require >> #ssl_options{} and other stuff, and at I have found no exported function >> creating #ssl_options{} without side-effects. >> > > #ssl_options{] is an internal representation of the proplists input list > and should not be a visible in the API, records are generally not a good > API choice as they enforce compile time dependencies. > > > Regards Ingela - Erlang/OTP team - Ericsson AB > > > >> >> 2014-04-15 16:52 GMT+04:00 Ingela Andin : >> >> Hello again! >>> >>> >>>> sometimes badarg in >>>> erlang:size([22,3,1,0,158,1,0,0,154,3,1,83,74|...]) at tls_record.erl:122. >>>> >>> >>> Same symptom was recently reported on erlang-bugs and it turned out to >>> be due to upgrading a gen_tcp socket in active mode. When upgrading a >>> gen_tcp socket to an ssl socket it must be put in passive mode ({active, >>> false}) before the client >>> is allowed to start the handshake. Normaly if the upgrade is negotiated >>> this is not a problem for the server to set the option >>> before signaling to the client to go ahead with the handshake. If the >>> upgrade is only performed on the server side instead of calling the ssl API >>> ( some people may do that due to the previously lack of possibility to >>> specify ssl options when calling ssl:ssl_accept with an "sslsocket", this >>> is no longer the case in 17.0) the listen socket needs to be put in passive >>> mode (listen options are inherited by the acceptsocket) to make sure that >>> the it will work, otherwhise it will work sometimes and sometime result in >>> the error above. >>> >>> Regards Ingela Erlang/OTP team - Ericsson AB >>> >> >> >> >> -- >> Danil Zagoskin | z@REDACTED >> > > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From shayan@REDACTED Wed Apr 16 16:14:05 2014 From: shayan@REDACTED (Shayan Pooya) Date: Wed, 16 Apr 2014 10:14:05 -0400 Subject: [erlang-questions] Erlang 17 issue with dialyzer and nowarn_deprecated_type In-Reply-To: <56466BD70414EA48969B4064696CF28C037DAD37@ESESSMB207.ericsson.se> References: <56466BD70414EA48969B4064696CF28C037DAD37@ESESSMB207.ericsson.se> Message-ID: Thanks Hans, I worked around this issue in the code to let it work on both Erl 17 and the previous versions: https://github.com/discoproject/disco/commit/b4e1d4d723e0bd8ae1a61827d62c5643e8aa9e5d In the near future, I am going to use the method deployed by meck to remove this nowarn option: -ifdef(namespaced_types). -type disco_dict() :: dict:dict(). -type disco_gbtree() :: gb_trees:tree(). -type disco_gbtree(K, V) :: gb_trees:tree(K, V). -type disco_gbset() :: gb_sets:set(). -type disco_gbset(K) :: gb_sets:set(K). -type disco_queue() :: queue:queue(). -else. -type disco_dict() :: dict(). -type disco_gbtree() :: gb_tree(). -type disco_gbtree(_,_) :: gb_tree(). -type disco_gbset() :: gb_set(). -type disco_gbset(_) :: gb_set(). -type disco_queue() :: queue(). -endif. On Wed, Apr 16, 2014 at 5:49 AM, Hans Bolinder wrote: > Hi, > > [Shayan Pooya:] > > > In order to make Disco compile with Erlang 17 without warnings, I > > added nowarn_deprecated_type to silence the warnings. However, after > > doing so, dialyzer fails with the following error: > > > > ddfs_master.erl:345: Attempt to test for inequality between a term of > type 'false' and a term of opaque type 'false' | gb_set() > > This is a bug. There will be a fix in 17.1. You can > try the patch below, or run Dialyzer with the "-Wno_opaque" option. > > Best regards, > > Hans Bolinder, Erlang/OTP team, Ericsson > > diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl > index 47b8dc7..6065b79 100644 > --- a/lib/hipe/cerl/erl_types.erl > +++ b/lib/hipe/cerl/erl_types.erl > @@ -2985,16 +2985,19 @@ inf_union(U1, U2, Opaques) -> > List = [A,B,F,I,L,N,T,M,Map], > inf_union_collect(List, Opaque, InfFun, [], []) > end, > - O1 = OpaqueFun(U1, U2, fun(E, Opaque) -> t_inf(Opaque, E, Opaques) end), > - O2 = OpaqueFun(U2, U1, fun(E, Opaque) -> t_inf(E, Opaque, Opaques) end), > - Union = inf_union(U1, U2, 0, [], Opaques), > - t_sup([O1, O2, Union]). > + {O1, ThrowList1} = > + OpaqueFun(U1, U2, fun(E, Opaque) -> t_inf(Opaque, E, Opaques) end), > + {O2, ThrowList2} > + = OpaqueFun(U2, U1, fun(E, Opaque) -> t_inf(E, Opaque, Opaques) end), > + {Union, ThrowList3} = inf_union(U1, U2, 0, [], [], Opaques), > + ThrowList = lists:merge3(ThrowList1, ThrowList2, ThrowList3), > + case t_sup([O1, O2, Union]) of > + ?none when ThrowList =/= [] -> throw(hd(ThrowList)); > + Sup -> Sup > + end. > > inf_union_collect([], _Opaque, _InfFun, InfList, ThrowList) -> > - case t_sup(InfList) of > - ?none when ThrowList =/= [] -> throw(hd(lists:flatten(ThrowList))); > - Sup -> Sup > - end; > + {t_sup(InfList), lists:usort(ThrowList)}; > inf_union_collect([?none|L], Opaque, InfFun, InfList, ThrowList) -> > inf_union_collect(L, Opaque, InfFun, [?none|InfList], ThrowList); > inf_union_collect([E|L], Opaque, InfFun, InfList, ThrowList) -> > @@ -3005,19 +3008,21 @@ inf_union_collect([E|L], Opaque, InfFun, InfList, > ThrowList) -> > inf_union_collect(L, Opaque, InfFun, InfList, [N|ThrowList]) > end. > > -inf_union([?none|Left1], [?none|Left2], N, Acc, Opaques) -> > - inf_union(Left1, Left2, N, [?none|Acc], Opaques); > -inf_union([T1|Left1], [T2|Left2], N, Acc, Opaques) -> > - case t_inf(T1, T2, Opaques) of > - ?none -> inf_union(Left1, Left2, N, [?none|Acc], Opaques); > - T -> inf_union(Left1, Left2, N+1, [T|Acc], Opaques) > +inf_union([?none|Left1], [?none|Left2], N, Acc, ThrowList, Opaques) -> > + inf_union(Left1, Left2, N, [?none|Acc], ThrowList, Opaques); > +inf_union([T1|Left1], [T2|Left2], N, Acc, ThrowList, Opaques) -> > + try t_inf(T1, T2, Opaques) of > + ?none -> inf_union(Left1, Left2, N, [?none|Acc], ThrowList, Opaques); > + T -> inf_union(Left1, Left2, N+1, [T|Acc], ThrowList, Opaques) > + catch throw:N when is_integer(N) -> > + inf_union(Left1, Left2, N, [?none|Acc], [N|ThrowList], Opaques) > end; > -inf_union([], [], N, Acc, _Opaques) -> > - if N =:= 0 -> ?none; > +inf_union([], [], N, Acc, ThrowList, _Opaques) -> > + if N =:= 0 -> {?none, ThrowList}; > N =:= 1 -> > [Type] = [T || T <- Acc, T =/= ?none], > - Type; > - N >= 2 -> ?union(lists:reverse(Acc)) > + {Type, ThrowList}; > + N >= 2 -> {?union(lists:reverse(Acc)), ThrowList} > end. > > inf_bitstr(U1, B1, U2, B2) -> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Wed Apr 16 17:36:56 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Wed, 16 Apr 2014 17:36:56 +0200 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: Hi! 2014-04-16 15:56 GMT+02:00 Danil Zagoskin : > Thank you for the patch. I'll check it. > New patch, better tested ;), on branch ia/ssl/user-suites-match-negotiated-version at https://github.com/IngelaAndin/otp > > (Style question: is lists:filtermap better than list comprehension?) > I think just a matter of taste! > > #ssl_options{] is an internal representation of the proplists input > list and should not be a visible in the API, records are generally not a > good API choice as they enforce compile time dependencies. > > Yes, I understand that. I wanted to start broken client to see how server > would work with it. > The option to do that could be using sys:replace_state, but as far as I > understand the code, client_hello is sent immediately after starting a > process, so it seems there is no way to send crafted hello and continue > handshake with couple of lines instead of ssl:connect. > > Given that possibility it could be much easier to reproduce server crashes > when working with buggy clients. > For example, How do I write a test for badmatch in tls_record:decode_cipher_text? > The function takes #connection_states{}, and creating that record relies > on #ssl_options{} which cannot be created without opening a socket and > calling gen_fsm:enter_loop. > > Yes you have a good point. I do not have a good short answer. Testing error cases especially when the protocol sometimes tries to hide the real error reason due to security issues and shortcutting the API and creating raw protocol command is not trivial. Regards Ingela Erlang/OTP team - Ericsson AB > > 2014-04-16 17:07 GMT+04:00 Ingela Andin : > > Hi! >> >> 2014-04-16 0:07 GMT+02:00 Danil Zagoskin : >> >> Hi, Ingela. >>> >>> I finally had some time for investigating this problem. >>> >>> I didn't see badarg in erlang:size again, but it definitely appeared in >>> 17.0 with simple accept method described as minimal example at >>> http://www.erlang.org/doc/apps/ssl/using_ssl.html ( >>> >> >> >> >>> the difference was transport_accept and ssl_accept were run in separate >>> process) >>> >> >> That should be ok, you are suppose to be able to do that. >> >> >> >>> Today I met some new crash: >>> ** {{badmatch,{alert,2,20,{"ssl_cipher.erl",215}}}, >>> >>> [{tls_record,decode_cipher_text,2,[{file,"tls_record.erl"},{line,157}]}, >>> >>> {tls_connection,next_record,1,[{file,"tls_connection.erl"},{line,503}]}, >>> >>> {tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,475}]}, >>> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, >>> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} >>> >>> That's because ssl_record:decipher/3 may return #alert{}, but >>> tls_record:decode_cipher_text/2 isn't expecting that. >>> >>> >> Hum, looks like a bug. We will look into that. >> >> >>> >>> As for {case_clause,{4}} in ssl_v3:mac_hash/3 I found that precondition >>> for crash is easily reproducible: >>> https://gist.github.com/stolen/10780653 >>> Ordinary servers negotiate with sha hash or close socket while ssl in >>> 17.0 negotiates with sha256 hash. >>> I don't know the protocol good enough to perform further states, but I >>> hope this helps. >>> >>> >> Okej, the following patch should take care of that problem. >> >> diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl >> index 743753b..093d4af 100644 >> --- a/lib/ssl/src/ssl.erl >> +++ b/lib/ssl/src/ssl.erl >> @@ -953,8 +953,8 @@ handle_cipher_option(Value, Version) when >> is_list(Value) -> >> error:_-> >> throw({error, {options, {ciphers, Value}}}) >> end. >> -binary_cipher_suites(Version, []) -> %% Defaults to all supported suits >> - ssl_cipher:suites(Version); >> +binary_cipher_suites(Version, []) -> >> + []; >> binary_cipher_suites(Version, [{_,_,_,_}| _] = Ciphers0) -> %% Backwards >> compatibility >> Ciphers = [{KeyExchange, Cipher, Hash} || {KeyExchange, Cipher, >> Hash, _} <- Ciphers0], >> binary_cipher_suites(Version, Ciphers); >> diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl >> index 1108edc..93d4efd 100644 >> --- a/lib/ssl/src/ssl_handshake.erl >> +++ b/lib/ssl/src/ssl_handshake.erl >> @@ -1017,11 +1017,14 @@ decode_suites('3_bytes', Dec) -> >> %%-------------Cipeher suite handling -------------------------------- >> >> available_suites(UserSuites, Version) -> >> + VersionSupportedSuites = ssl_cipher:suites(Version), >> case UserSuites of >> [] -> >> - ssl_cipher:suites(Version); >> + VersionSupportedSuites; >> _ -> >> - UserSuites >> + lists:filtermap(fun(Suite) -> >> + lists:member(Suite, VersionSupportedSuites) >> + end, UserSuites) >> end. >> >> available_suites(ServerCert, UserSuites, Version, Curve) -> >> >> >> >> >>> Unfortunately, I don't understand how this code should be tested ? most >>> of functions require #state{} or #connection_states{} which require >>> #ssl_options{} and other stuff, and at I have found no exported function >>> creating #ssl_options{} without side-effects. >>> >> >> #ssl_options{] is an internal representation of the proplists input list >> and should not be a visible in the API, records are generally not a good >> API choice as they enforce compile time dependencies. >> >> >> Regards Ingela - Erlang/OTP team - Ericsson AB >> >> >> >>> >>> 2014-04-15 16:52 GMT+04:00 Ingela Andin : >>> >>> Hello again! >>>> >>>> >>>>> sometimes badarg in >>>>> erlang:size([22,3,1,0,158,1,0,0,154,3,1,83,74|...]) at tls_record.erl:122. >>>>> >>>> >>>> Same symptom was recently reported on erlang-bugs and it turned out to >>>> be due to upgrading a gen_tcp socket in active mode. When upgrading a >>>> gen_tcp socket to an ssl socket it must be put in passive mode ({active, >>>> false}) before the client >>>> is allowed to start the handshake. Normaly if the upgrade is >>>> negotiated this is not a problem for the server to set the option >>>> before signaling to the client to go ahead with the handshake. If the >>>> upgrade is only performed on the server side instead of calling the ssl API >>>> ( some people may do that due to the previously lack of possibility to >>>> specify ssl options when calling ssl:ssl_accept with an "sslsocket", this >>>> is no longer the case in 17.0) the listen socket needs to be put in passive >>>> mode (listen options are inherited by the acceptsocket) to make sure that >>>> the it will work, otherwhise it will work sometimes and sometime result in >>>> the error above. >>>> >>>> Regards Ingela Erlang/OTP team - Ericsson AB >>>> >>> >>> >>> >>> -- >>> Danil Zagoskin | z@REDACTED >>> >> >> > > > -- > Danil Zagoskin | z@REDACTED > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drormein@REDACTED Wed Apr 16 18:09:51 2014 From: drormein@REDACTED (Dror Mein) Date: Wed, 16 Apr 2014 09:09:51 -0700 (PDT) Subject: [erlang-questions] Difference in 'close' for gen_tcp recv vs. active In-Reply-To: <534AF19C.4060807@gmx.net> References: <1397403310.61269.YahooMailNeo@web164502.mail.gq1.yahoo.com> <534AF19C.4060807@gmx.net> Message-ID: <1397664591.69334.YahooMailNeo@web164501.mail.gq1.yahoo.com> thank you! it works On Sunday, April 13, 2014 11:20 PM, Jacob wrote: Hi On 13.04.2014 17:35, Dror Mein wrote: > I had the same problem, but I thought using {keepalive,true} or > {send_timeout,Time} would help. I see in wireshark that keep alive does > not pass through but I still don't get an {error, closed}. > Someone wrote that default timeout for keepalive is two hours. where can > it be configured? TCP keepalive configuration is OS dependant. What OS are you using? NOTE: The following applies to _Linux_ : With Linux you can either set it ? a) globally via sysctl net.ipv4.tcp_keepalive_* ? b) globally per /proc/sys/net/ipv4/tcp_keepalive_* ? c) per socket with setsockopt() and TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL ? d) per started (ELF) executable with the libkeepalive wrapper (see below). see tcp(7) for details. A helpful HOWTO can be found here: http://www.tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/ ad d): See the HOWTO above for details. I installed the libkeepalive0 package (Ubuntu 13.10), tried it with Erlang (erts-6.0) and according to strace it seems to work. I would avoid LD_PRELOAD hacks in production though. The command line was ? LD_PRELOAD=libkeepalive.so KEEPCNT=20 KEEPIDLE=180 KEEPINTVL=60 erl If you want to use strace to check what happens enter: ? LD_PRELOAD=libkeepalive.so KEEPCNT=20 KEEPIDLE=180 KEEPINTVL=60 strace -f -o keep.str -e trace=setsockopt erl and look into keep.str after using gen_tcp:connect/3. HTH, Jacob -------------- next part -------------- An HTML attachment was scrubbed... URL: From drormein@REDACTED Wed Apr 16 18:12:09 2014 From: drormein@REDACTED (Dror Mein) Date: Wed, 16 Apr 2014 09:12:09 -0700 (PDT) Subject: [erlang-questions] Difference in 'close' for gen_tcp recv vs. active In-Reply-To: <534AF19C.4060807@gmx.net> References: <1397403310.61269.YahooMailNeo@web164502.mail.gq1.yahoo.com> <534AF19C.4060807@gmx.net> Message-ID: <1397664729.87749.YahooMailNeo@web164502.mail.gq1.yahoo.com> Thank you! it works. I use linux. btw?for future reference: in setopts/getopts in the options: {raw,6,4,7200} is keep alive time {raw,6,5,75} is keep alive interval {raw,6,6,9} is keep alive probes On Sunday, April 13, 2014 11:20 PM, Jacob wrote: Hi On 13.04.2014 17:35, Dror Mein wrote: > I had the same problem, but I thought using {keepalive,true} or > {send_timeout,Time} would help. I see in wireshark that keep alive does > not pass through but I still don't get an {error, closed}. > Someone wrote that default timeout for keepalive is two hours. where can > it be configured? TCP keepalive configuration is OS dependant. What OS are you using? NOTE: The following applies to _Linux_ : With Linux you can either set it ? a) globally via sysctl net.ipv4.tcp_keepalive_* ? b) globally per /proc/sys/net/ipv4/tcp_keepalive_* ? c) per socket with setsockopt() and TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL ? d) per started (ELF) executable with the libkeepalive wrapper (see below). see tcp(7) for details. A helpful HOWTO can be found here: http://www.tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/ ad d): See the HOWTO above for details. I installed the libkeepalive0 package (Ubuntu 13.10), tried it with Erlang (erts-6.0) and according to strace it seems to work. I would avoid LD_PRELOAD hacks in production though. The command line was ? LD_PRELOAD=libkeepalive.so KEEPCNT=20 KEEPIDLE=180 KEEPINTVL=60 erl If you want to use strace to check what happens enter: ? LD_PRELOAD=libkeepalive.so KEEPCNT=20 KEEPIDLE=180 KEEPINTVL=60 strace -f -o keep.str -e trace=setsockopt erl and look into keep.str after using gen_tcp:connect/3. HTH, Jacob -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Thu Apr 17 04:08:43 2014 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Wed, 16 Apr 2014 22:08:43 -0400 Subject: [erlang-questions] Session management in Cowboy Message-ID: <2D6317F0-2AB6-46E8-ACE7-850658203DD3@writersglen.com> Hello, Sent from my iPad From lloyd@REDACTED Thu Apr 17 05:37:12 2014 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Wed, 16 Apr 2014 23:37:12 -0400 Subject: [erlang-questions] Secure sessions in Cowboy Message-ID: Hello, A few years ago Joe Armstrong kicked off a wonderful discussion of web authentication on erlang-questions. Thu Jul 7 21:29:23 CEST 2011. Fred H?bert contributed an outstanding Quick Guide. Thu Jul 7 22:04:58 CEST 2011. Now I'm near the scary point of having to write real code to manage secure sessions. I'd be much grateful if some kind soul could take a look at my outline below and point out, if any, the errors of my ways: CREATE CREDENTIALS 1. Log-in and session under SSL 2. Encrypt and store password - considering H?bert's erlpass for password management; DETS for credentials storage SESSION MANAGEMENT 1. Limit number of log-in attempts; resume after time delay 2. Time-limited cookies to manage sessions 3. Session state - store in process or ETS? 4. Append unique tokens to forms Are there better options for any step? Am I missing anything? Many thanks, LRP Sent from my iPad -------------- next part -------------- An HTML attachment was scrubbed... URL: From burrows.labs@REDACTED Thu Apr 17 06:32:14 2014 From: burrows.labs@REDACTED (Aaron Burrow) Date: Thu, 17 Apr 2014 00:32:14 -0400 Subject: [erlang-questions] simplest possible erlang/otp application Message-ID: I've been trying to wrap my head around building erlang applications and had difficulty finding the bare minimum that will run using erl> application:start(whatever). Well I've finally got something working and it may save others from similar searching. link: https://gist.github.com/burrows-labs/10952656 Aaron Burrow From z@REDACTED Thu Apr 17 08:52:29 2014 From: z@REDACTED (Danil Zagoskin) Date: Thu, 17 Apr 2014 10:52:29 +0400 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: Hi, Ingela! The patch works like a charm, thank you! It completely fixes the initial problem with buggy client. But there are some sad news, too: While playing with my dummy server ( https://github.com/stolen/ssldump/blob/master/src/ssldump.erl#L70) I accidentally reproduced badarg in erlang:size once more: =ERROR REPORT==== 17-Apr-2014::07:34:58 === ** State machine <0.58.0> terminating ** Last message in was {tcp,#Port<0.1498>, [22,3,1,0,173,1,0,0,169,3,3,83,79,75,226,78,81,8, 77,79,97,154,127,165,92,183,20,239,70,183,158, 193,222,139,77,116,13,128,12,66,120,63,110,0,0, 94,0,255,192,36,192,35,192,10,192,9,192,7,192,8, 192,40,192,39,192,20,192,19,192,17,192,18,192,38, 192,37,192,42,192,41,192,5,192,4,192,2,192,3,192, 15,192,14,192,12,192,13,0,61,0,60,0,47,0,5,0,4,0, 53,0,10,0,103,0,107,0,51,0,57,0,22,0,175,0,174,0, 141,0,140,0,138,0,139,0,177,0,176,0,44,0,59,1,0, 0,34,0,10,0,8,0,6,0,23,0,24,0,25,0,11,0,2,1,0,0, 13,0,12,0,10,5,1,4,1,2,1,4,3,2,3]} (meaningless state omitted) ** Reason for termination = ** {badarg,[{erlang,size, [[22,3,1,0,173,1,0,0,169,3,3,83,79,75,226,78,81,8,77,79, 97,154,127,165,92,183,20,239,70,183,158,193,222,139,77, 116,13,128,12,66,120,63,110,0,0,94,0,255,192,36,192,35, 192,10,192,9,192,7,192,8,192,40,192,39,192,20,192,19, 192,17,192,18,192,38,192,37,192,42,192,41,192,5,192,4, 192,2,192,3,192,15,192,14,192,12,192,13,0,61,0,60,0,47, 0,5,0,4,0,53,0,10,0,103,0,107,0,51,0,57,0,22,0,175,0, 174,0,141,0,140,0,138,0,139,0,177,0,176,0,44,0,59,1,0,0, 34,0,10,0,8,0,6,0,23,0,24,0,25,0,11,0,2,1,0,0,13,0,12,0, 10,5,1,4,1,2,1,4,3,2,3]], []}, {tls_record,get_tls_records_aux,2, [{file,"tls_record.erl"},{line,122}]}, {tls_connection,next_tls_record,2, [{file,"tls_connection.erl"},{line,484}]}, {tls_connection,handle_info,3, [{file,"tls_connection.erl"},{line,307}]}, {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} The client used was simple curl under mac os, and this crash did not reproduce. As you see, the packet received as list instead of binary is client_hello which is the first message ssl process gets. Maybe there is some race condition when changing mode on just transport_accepted socket. Also, the same server when working with the same curl may stall at this line: {ok, _} = ssl:recv(Socket, 0, 10000), process_info showed that the worker has {ssl,#sslsocket{}, Data} in its mailbox. I've tuned the server to reproduce this stall easier: https://github.com/stolen/ssldump/blob/b3eebc2fa85ca0bd8ed8470c400b972aa737bffc/src/ssldump.erl(master may change) The client is manually invoked curl which is manually interrupted after sufficiently large time of inactivity. The console log looks like this: stolen@REDACTED:~/ssldump$ ./dummyserver.sh 9999 ../cert/pipe.trololo Erlang/OTP 17 [erts-6.0] [source-07b8f44] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> Accepting SSL in <0.46.0> Socket state: connection, options: {socket_options,list,0,0,0,true} =ERROR REPORT==== 17-Apr-2014::09:08:01 === Error in process <0.46.0> with exit value: {{badmatch,{error,timeout}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} Accepting SSL in <0.47.0> Socket state: connection, options: {socket_options,binary,0,0,0,false} Accepting SSL in <0.48.0> Socket state: connection, options: {socket_options,binary,0,0,0,false} Accepting SSL in <0.51.0> Socket state: connection, options: {socket_options,list,0,0,0,true} =ERROR REPORT==== 17-Apr-2014::09:09:17 === Error in process <0.51.0> with exit value: {{badmatch,{error,closed}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} Accepting SSL in <0.53.0> Socket state: connection, options: {socket_options,binary,0,0,0,false} Accepting SSL in <0.55.0> Socket state: connection, options: {socket_options,binary,0,0,0,false} Accepting SSL in <0.57.0> Socket state: connection, options: {socket_options,list,0,0,0,true} =ERROR REPORT==== 17-Apr-2014::09:11:26 === Error in process <0.57.0> with exit value: {{badmatch,{error,closed}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} My interpretation: - Given pool size X, the first of each X requests fails. - First of failing requests catches timeout as expected, other ones just stall. - Failing requests have emulated options [{mode, list}, {active, true}] while working ones have the opposite [{mode, binary}, {active, false}]. After couple of further experiments I discovered that only every (X*N + 1)th acceptor inherits listening socket options, other ones always have [{mode, binary}, {active, false}]. And, apart from eventual option inheritance, shouldn't ssl:recv on active socket return {error, einval} like gen_tcp:recv does? 2014-04-16 19:36 GMT+04:00 Ingela Andin : > Hi! > > 2014-04-16 15:56 GMT+02:00 Danil Zagoskin : > > Thank you for the patch. I'll check it. >> > > > New patch, better tested ;), on branch > ia/ssl/user-suites-match-negotiated-version at > https://github.com/IngelaAndin/otp > > >> >> (Style question: is lists:filtermap better than list comprehension?) >> > > > I think just a matter of taste! > > >> > #ssl_options{] is an internal representation of the proplists input >> list and should not be a visible in the API, records are generally not a >> good API choice as they enforce compile time dependencies. >> >> Yes, I understand that. I wanted to start broken client to see how server >> would work with it. >> The option to do that could be using sys:replace_state, but as far as I >> understand the code, client_hello is sent immediately after starting a >> process, so it seems there is no way to send crafted hello and continue >> handshake with couple of lines instead of ssl:connect. >> >> Given that possibility it could be much easier to reproduce server >> crashes when working with buggy clients. >> For example, How do I write a test for badmatch in tls_record:decode_cipher_text? >> The function takes #connection_states{}, and creating that record relies >> on #ssl_options{} which cannot be created without opening a socket and >> calling gen_fsm:enter_loop. >> >> > Yes you have a good point. I do not have a good short answer. Testing > error cases especially when the protocol sometimes > tries to hide the real error reason due to security issues and > shortcutting the API and creating raw protocol command is not trivial. > > Regards Ingela Erlang/OTP team - Ericsson AB > > > > > >> >> 2014-04-16 17:07 GMT+04:00 Ingela Andin : >> >> Hi! >>> >>> 2014-04-16 0:07 GMT+02:00 Danil Zagoskin : >>> >>> Hi, Ingela. >>>> >>>> I finally had some time for investigating this problem. >>>> >>>> I didn't see badarg in erlang:size again, but it definitely appeared in >>>> 17.0 with simple accept method described as minimal example at >>>> http://www.erlang.org/doc/apps/ssl/using_ssl.html ( >>>> >>> >>> >>> >>>> the difference was transport_accept and ssl_accept were run in separate >>>> process) >>>> >>> >>> That should be ok, you are suppose to be able to do that. >>> >>> >>> >>>> Today I met some new crash: >>>> ** {{badmatch,{alert,2,20,{"ssl_cipher.erl",215}}}, >>>> >>>> [{tls_record,decode_cipher_text,2,[{file,"tls_record.erl"},{line,157}]}, >>>> >>>> {tls_connection,next_record,1,[{file,"tls_connection.erl"},{line,503}]}, >>>> >>>> {tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,475}]}, >>>> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, >>>> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} >>>> >>>> That's because ssl_record:decipher/3 may return #alert{}, but >>>> tls_record:decode_cipher_text/2 isn't expecting that. >>>> >>>> >>> Hum, looks like a bug. We will look into that. >>> >>> >>>> >>>> As for {case_clause,{4}} in ssl_v3:mac_hash/3 I found that precondition >>>> for crash is easily reproducible: >>>> https://gist.github.com/stolen/10780653 >>>> Ordinary servers negotiate with sha hash or close socket while ssl in >>>> 17.0 negotiates with sha256 hash. >>>> I don't know the protocol good enough to perform further states, but I >>>> hope this helps. >>>> >>>> >>> Okej, the following patch should take care of that problem. >>> >>> diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl >>> index 743753b..093d4af 100644 >>> --- a/lib/ssl/src/ssl.erl >>> +++ b/lib/ssl/src/ssl.erl >>> @@ -953,8 +953,8 @@ handle_cipher_option(Value, Version) when >>> is_list(Value) -> >>> error:_-> >>> throw({error, {options, {ciphers, Value}}}) >>> end. >>> -binary_cipher_suites(Version, []) -> %% Defaults to all supported suits >>> - ssl_cipher:suites(Version); >>> +binary_cipher_suites(Version, []) -> >>> + []; >>> binary_cipher_suites(Version, [{_,_,_,_}| _] = Ciphers0) -> %% >>> Backwards compatibility >>> Ciphers = [{KeyExchange, Cipher, Hash} || {KeyExchange, Cipher, >>> Hash, _} <- Ciphers0], >>> binary_cipher_suites(Version, Ciphers); >>> diff --git a/lib/ssl/src/ssl_handshake.erl >>> b/lib/ssl/src/ssl_handshake.erl >>> index 1108edc..93d4efd 100644 >>> --- a/lib/ssl/src/ssl_handshake.erl >>> +++ b/lib/ssl/src/ssl_handshake.erl >>> @@ -1017,11 +1017,14 @@ decode_suites('3_bytes', Dec) -> >>> %%-------------Cipeher suite handling -------------------------------- >>> >>> available_suites(UserSuites, Version) -> >>> + VersionSupportedSuites = ssl_cipher:suites(Version), >>> case UserSuites of >>> [] -> >>> - ssl_cipher:suites(Version); >>> + VersionSupportedSuites; >>> _ -> >>> - UserSuites >>> + lists:filtermap(fun(Suite) -> >>> + lists:member(Suite, VersionSupportedSuites) >>> + end, UserSuites) >>> end. >>> >>> available_suites(ServerCert, UserSuites, Version, Curve) -> >>> >>> >>> >>> >>>> Unfortunately, I don't understand how this code should be tested ? most >>>> of functions require #state{} or #connection_states{} which require >>>> #ssl_options{} and other stuff, and at I have found no exported function >>>> creating #ssl_options{} without side-effects. >>>> >>> >>> #ssl_options{] is an internal representation of the proplists input list >>> and should not be a visible in the API, records are generally not a good >>> API choice as they enforce compile time dependencies. >>> >>> >>> Regards Ingela - Erlang/OTP team - Ericsson AB >>> >>> >>> >>>> >>>> 2014-04-15 16:52 GMT+04:00 Ingela Andin : >>>> >>>> Hello again! >>>>> >>>>> >>>>>> sometimes badarg in >>>>>> erlang:size([22,3,1,0,158,1,0,0,154,3,1,83,74|...]) at tls_record.erl:122. >>>>>> >>>>> >>>>> Same symptom was recently reported on erlang-bugs and it turned out to >>>>> be due to upgrading a gen_tcp socket in active mode. When upgrading a >>>>> gen_tcp socket to an ssl socket it must be put in passive mode ({active, >>>>> false}) before the client >>>>> is allowed to start the handshake. Normaly if the upgrade is >>>>> negotiated this is not a problem for the server to set the option >>>>> before signaling to the client to go ahead with the handshake. If the >>>>> upgrade is only performed on the server side instead of calling the ssl API >>>>> ( some people may do that due to the previously lack of possibility to >>>>> specify ssl options when calling ssl:ssl_accept with an "sslsocket", this >>>>> is no longer the case in 17.0) the listen socket needs to be put in passive >>>>> mode (listen options are inherited by the acceptsocket) to make sure that >>>>> the it will work, otherwhise it will work sometimes and sometime result in >>>>> the error above. >>>>> >>>>> Regards Ingela Erlang/OTP team - Ericsson AB >>>>> >>>> >>>> >>>> >>>> -- >>>> Danil Zagoskin | z@REDACTED >>>> >>> >>> >> >> >> -- >> Danil Zagoskin | z@REDACTED >> > > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Thu Apr 17 08:57:30 2014 From: g@REDACTED (Garrett Smith) Date: Thu, 17 Apr 2014 08:57:30 +0200 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: Message-ID: On Wed, Apr 16, 2014 at 2:03 PM, Yuri Lukyanov wrote: > > Well, I can add our story. Thanks for this! > In the beginning, we had a single repository for everything. And even > without apps dir. It was a single monster with everything inside the > src dir. At some point, it became obvious that it couldn't go on like > this and we started separating the code into apps. 'apps' directory > looked like a good fit. > > Then we came across Riak and its sources. The way they organised their > code seemed so gorgeous. A tiny repository for each application! Super > easy to think of as a separate unit of your system. Different teams > work on different repositories. Independent testing. Ability to open > certain parts of your project to the community. Superb! > > And we started a 'big move' to that world. At the beginning, > everything was smooth. Later, we even created a project template that > uses that every-app-is-a-repo structure > (https://github.com/EchoTeam/rebar-templates). > > But what we ended up with is what Bj?rn-Egil Dahlberg said above. The > team is divided. Some of us just couldn't stand the growing number of > repositories. The tree of dependencies started to be so big that it > was a nightmare to change anything inside. Imagine that you need to > update, say, lager version. We heavily use lager in all deps. You will > need to update the deps list of one application, then the deps list of > the application which is dependant on the first one, then 10 > application which depend on the latter, etc... This is very interesting to me as I'm experimenting with the one-repo-per-app model, having done the apps-under-libdir thing. Have you experimented with tooling/automation to help manage the dependencies across the various applications. E.g. a centralized list of of company "standard" apps + versions that the various app/repos pulled from? In a case where I need to standardize on a version of something, as a matter of keeping things simple, I will tend to fork that repository to a location I can control and then refer to that from each deps list. I happen to use git (both in github and private locations) but any protocol supported by the build tool would work. When I need to "rev" that dependency (bug fixes, etc.) I can just selectively pull/merge the applicable commit or tag. Anyway, I'm not trying to solve your team's problems here :) I'm curious though about the specific pain points and am wondering if there are any good alternatives to address them, short of consolidating everything into a single repo. > At the moment, we are still having different repos for different apps. > But some people are already thinking to put _everything_ in one single > repository. Not only all deps, but all projects as well :) > > There is no one-size-fits-all solution. Right, "In the long run, > everything fails". > Just don't be too religious about things. If you think that either > approach is _the_ best, perhaps you just don't have use cases that can > help your approach fail or your project is not big/small enough. I don't see a religious debate emerging here -- I'm encouraged that there are options and support for different org structures and workflows. One of Erlang's most compelling features IMO is the app + release abstraction -- this is a remarkably enlightened application design. It mirrors what happens at the operating system level. And just as operating system ecosystems are supported by the one-repo-per-app model -- which works, clearly -- I suspect this model can be made to work well for Erlang projects. But I have limited experience with complex projects -- so specific data points like yours are very helpful. Thanks! Garrett From cvi@REDACTED Thu Apr 17 10:02:53 2014 From: cvi@REDACTED (=?UTF-8?Q?Christoffer_Vikstr=C3=B6m?=) Date: Thu, 17 Apr 2014 10:02:53 +0200 Subject: [erlang-questions] simplest possible erlang/otp application In-Reply-To: References: Message-ID: Actually the bare minimum you need is just a .app file that contains something like {application, bla, []}. ;-) -cvi On Thu, Apr 17, 2014 at 6:32 AM, Aaron Burrow wrote: > I've been trying to wrap my head around building erlang applications > and had difficulty finding the bare minimum that will run using > > erl> application:start(whatever). > > Well I've finally got something working and it may save others from > similar searching. > > link: https://gist.github.com/burrows-labs/10952656 > > Aaron Burrow > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Thu Apr 17 11:19:13 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Thu, 17 Apr 2014 11:19:13 +0200 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: Hi Danil! 2014-04-17 8:52 GMT+02:00 Danil Zagoskin : > Hi, Ingela! > > The patch works like a charm, thank you! It completely fixes the initial > problem with buggy client. > > One bug down! > > But there are some sad news, too: > > Well reproducible is always good, means we can haunt it down and fix it :) > While playing with my dummy server ( > https://github.com/stolen/ssldump/blob/master/src/ssldump.erl#L70) I > accidentally reproduced badarg in erlang:size once more: > > =ERROR REPORT==== 17-Apr-2014::07:34:58 === > ** State machine <0.58.0> terminating > ** Last message in was {tcp,#Port<0.1498>, > > [22,3,1,0,173,1,0,0,169,3,3,83,79,75,226,78,81,8, > 77,79,97,154,127,165,92,183,20,239,70,183,158, > > 193,222,139,77,116,13,128,12,66,120,63,110,0,0, > > 94,0,255,192,36,192,35,192,10,192,9,192,7,192,8, > > 192,40,192,39,192,20,192,19,192,17,192,18,192,38, > > 192,37,192,42,192,41,192,5,192,4,192,2,192,3,192, > > 15,192,14,192,12,192,13,0,61,0,60,0,47,0,5,0,4,0, > > 53,0,10,0,103,0,107,0,51,0,57,0,22,0,175,0,174,0, > > 141,0,140,0,138,0,139,0,177,0,176,0,44,0,59,1,0, > > 0,34,0,10,0,8,0,6,0,23,0,24,0,25,0,11,0,2,1,0,0, > 13,0,12,0,10,5,1,4,1,2,1,4,3,2,3]} > (meaningless state omitted) > ** Reason for termination = > ** {badarg,[{erlang,size, > > [[22,3,1,0,173,1,0,0,169,3,3,83,79,75,226,78,81,8,77,79, > > 97,154,127,165,92,183,20,239,70,183,158,193,222,139,77, > > 116,13,128,12,66,120,63,110,0,0,94,0,255,192,36,192,35, > 192,10,192,9,192,7,192,8,192,40,192,39,192,20,192,19, > > 192,17,192,18,192,38,192,37,192,42,192,41,192,5,192,4, > > 192,2,192,3,192,15,192,14,192,12,192,13,0,61,0,60,0,47, > 0,5,0,4,0,53,0,10,0,103,0,107,0,51,0,57,0,22,0,175,0, > > 174,0,141,0,140,0,138,0,139,0,177,0,176,0,44,0,59,1,0,0, > > 34,0,10,0,8,0,6,0,23,0,24,0,25,0,11,0,2,1,0,0,13,0,12,0, > 10,5,1,4,1,2,1,4,3,2,3]], > []}, > {tls_record,get_tls_records_aux,2, > [{file,"tls_record.erl"},{line,122}]}, > {tls_connection,next_tls_record,2, > [{file,"tls_connection.erl"},{line,484}]}, > {tls_connection,handle_info,3, > [{file,"tls_connection.erl"},{line,307}]}, > {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, > > {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} > > The client used was simple curl under mac os, and this crash did not > reproduce. > As you see, the packet received as list instead of binary is client_hello > which is the first message ssl process gets. > Maybe there is some race condition when changing mode on just > transport_accepted socket. > > > > Also, the same server when working with the same curl may stall at this > line: > {ok, _} = ssl:recv(Socket, 0, 10000), > process_info showed that the worker has {ssl,#sslsocket{}, Data} in its > mailbox. > > I've tuned the server to reproduce this stall easier: > https://github.com/stolen/ssldump/blob/b3eebc2fa85ca0bd8ed8470c400b972aa737bffc/src/ssldump.erl(master may change) > > The client is manually invoked curl which is manually interrupted after > sufficiently large time of inactivity. The console log looks like this: > > stolen@REDACTED:~/ssldump$ ./dummyserver.sh 9999 ../cert/pipe.trololo > Erlang/OTP 17 [erts-6.0] [source-07b8f44] [smp:2:2] [async-threads:10] > [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> Accepting SSL in <0.46.0> > Socket state: connection, options: {socket_options,list,0,0,0,true} > > =ERROR REPORT==== 17-Apr-2014::09:08:01 === > Error in process <0.46.0> with exit value: > {{badmatch,{error,timeout}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} > > Accepting SSL in <0.47.0> > Socket state: connection, options: {socket_options,binary,0,0,0,false} > Accepting SSL in <0.48.0> > Socket state: connection, options: {socket_options,binary,0,0,0,false} > Accepting SSL in <0.51.0> > Socket state: connection, options: {socket_options,list,0,0,0,true} > > =ERROR REPORT==== 17-Apr-2014::09:09:17 === > Error in process <0.51.0> with exit value: > {{badmatch,{error,closed}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} > > Accepting SSL in <0.53.0> > Socket state: connection, options: {socket_options,binary,0,0,0,false} > Accepting SSL in <0.55.0> > Socket state: connection, options: {socket_options,binary,0,0,0,false} > Accepting SSL in <0.57.0> > Socket state: connection, options: {socket_options,list,0,0,0,true} > > =ERROR REPORT==== 17-Apr-2014::09:11:26 === > Error in process <0.57.0> with exit value: > {{badmatch,{error,closed}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} > > > My interpretation: > - Given pool size X, the first of each X requests fails. > - First of failing requests catches timeout as expected, other ones just > stall. > - Failing requests have emulated options [{mode, list}, {active, true}] > while working ones have the opposite [{mode, binary}, {active, false}]. > > After couple of further experiments I discovered that only every (X*N + > 1)th acceptor inherits listening socket options, other ones always have > [{mode, binary}, {active, false}]. > > > Humm... I am not sure if this is what happens in your case but the following should fix a potential inheritance problem diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl index 743753b..7768bbb 100644 --- a/lib/ssl/src/ssl.erl +++ b/lib/ssl/src/ssl.erl @@ -187,6 +187,7 @@ transport_accept(#sslsocket{pid = {ListenSocket, {error, Reason} end; {error, Reason} -> + ok = ssl_socket:setopts(Transport, ListenSocket, SocketValues), {error, Reason} end. > And, apart from eventual option inheritance, shouldn't ssl:recv on active > socket return {error, einval} like gen_tcp:recv does? > > > I think it should. Regards Ingela Erlang/OTP Team Ericssson AB > 2014-04-16 19:36 GMT+04:00 Ingela Andin : > > Hi! >> >> 2014-04-16 15:56 GMT+02:00 Danil Zagoskin : >> >> Thank you for the patch. I'll check it. >>> >> >> >> New patch, better tested ;), on branch >> ia/ssl/user-suites-match-negotiated-version at >> https://github.com/IngelaAndin/otp >> >> >>> >>> (Style question: is lists:filtermap better than list comprehension?) >>> >> >> >> I think just a matter of taste! >> >> >>> > #ssl_options{] is an internal representation of the proplists input >>> list and should not be a visible in the API, records are generally not a >>> good API choice as they enforce compile time dependencies. >>> >>> Yes, I understand that. I wanted to start broken client to see how >>> server would work with it. >>> The option to do that could be using sys:replace_state, but as far as I >>> understand the code, client_hello is sent immediately after starting a >>> process, so it seems there is no way to send crafted hello and continue >>> handshake with couple of lines instead of ssl:connect. >>> >>> Given that possibility it could be much easier to reproduce server >>> crashes when working with buggy clients. >>> For example, How do I write a test for badmatch in tls_record:decode_cipher_text? >>> The function takes #connection_states{}, and creating that record >>> relies on #ssl_options{} which cannot be created without opening a >>> socket and calling gen_fsm:enter_loop. >>> >>> >> Yes you have a good point. I do not have a good short answer. Testing >> error cases especially when the protocol sometimes >> tries to hide the real error reason due to security issues and >> shortcutting the API and creating raw protocol command is not trivial. >> >> Regards Ingela Erlang/OTP team - Ericsson AB >> >> >> >> >> >>> >>> 2014-04-16 17:07 GMT+04:00 Ingela Andin : >>> >>> Hi! >>>> >>>> 2014-04-16 0:07 GMT+02:00 Danil Zagoskin : >>>> >>>> Hi, Ingela. >>>>> >>>>> I finally had some time for investigating this problem. >>>>> >>>>> I didn't see badarg in erlang:size again, but it definitely appeared >>>>> in 17.0 with simple accept method described as minimal example at >>>>> http://www.erlang.org/doc/apps/ssl/using_ssl.html ( >>>>> >>>> >>>> >>>> >>>>> the difference was transport_accept and ssl_accept were run in >>>>> separate process) >>>>> >>>> >>>> That should be ok, you are suppose to be able to do that. >>>> >>>> >>>> >>>>> Today I met some new crash: >>>>> ** {{badmatch,{alert,2,20,{"ssl_cipher.erl",215}}}, >>>>> >>>>> [{tls_record,decode_cipher_text,2,[{file,"tls_record.erl"},{line,157}]}, >>>>> >>>>> {tls_connection,next_record,1,[{file,"tls_connection.erl"},{line,503}]}, >>>>> >>>>> {tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,475}]}, >>>>> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, >>>>> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} >>>>> >>>>> That's because ssl_record:decipher/3 may return #alert{}, but >>>>> tls_record:decode_cipher_text/2 isn't expecting that. >>>>> >>>>> >>>> Hum, looks like a bug. We will look into that. >>>> >>>> >>>>> >>>>> As for {case_clause,{4}} in ssl_v3:mac_hash/3 I found that >>>>> precondition for crash is easily reproducible: >>>>> https://gist.github.com/stolen/10780653 >>>>> Ordinary servers negotiate with sha hash or close socket while ssl in >>>>> 17.0 negotiates with sha256 hash. >>>>> I don't know the protocol good enough to perform further states, but I >>>>> hope this helps. >>>>> >>>>> >>>> Okej, the following patch should take care of that problem. >>>> >>>> diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl >>>> index 743753b..093d4af 100644 >>>> --- a/lib/ssl/src/ssl.erl >>>> +++ b/lib/ssl/src/ssl.erl >>>> @@ -953,8 +953,8 @@ handle_cipher_option(Value, Version) when >>>> is_list(Value) -> >>>> error:_-> >>>> throw({error, {options, {ciphers, Value}}}) >>>> end. >>>> -binary_cipher_suites(Version, []) -> %% Defaults to all supported suits >>>> - ssl_cipher:suites(Version); >>>> +binary_cipher_suites(Version, []) -> >>>> + []; >>>> binary_cipher_suites(Version, [{_,_,_,_}| _] = Ciphers0) -> %% >>>> Backwards compatibility >>>> Ciphers = [{KeyExchange, Cipher, Hash} || {KeyExchange, Cipher, >>>> Hash, _} <- Ciphers0], >>>> binary_cipher_suites(Version, Ciphers); >>>> diff --git a/lib/ssl/src/ssl_handshake.erl >>>> b/lib/ssl/src/ssl_handshake.erl >>>> index 1108edc..93d4efd 100644 >>>> --- a/lib/ssl/src/ssl_handshake.erl >>>> +++ b/lib/ssl/src/ssl_handshake.erl >>>> @@ -1017,11 +1017,14 @@ decode_suites('3_bytes', Dec) -> >>>> %%-------------Cipeher suite handling -------------------------------- >>>> >>>> available_suites(UserSuites, Version) -> >>>> + VersionSupportedSuites = ssl_cipher:suites(Version), >>>> case UserSuites of >>>> [] -> >>>> - ssl_cipher:suites(Version); >>>> + VersionSupportedSuites; >>>> _ -> >>>> - UserSuites >>>> + lists:filtermap(fun(Suite) -> >>>> + lists:member(Suite, VersionSupportedSuites) >>>> + end, UserSuites) >>>> end. >>>> >>>> available_suites(ServerCert, UserSuites, Version, Curve) -> >>>> >>>> >>>> >>>> >>>>> Unfortunately, I don't understand how this code should be tested ? >>>>> most of functions require #state{} or #connection_states{} which require >>>>> #ssl_options{} and other stuff, and at I have found no exported function >>>>> creating #ssl_options{} without side-effects. >>>>> >>>> >>>> #ssl_options{] is an internal representation of the proplists input >>>> list and should not be a visible in the API, records are generally not a >>>> good API choice as they enforce compile time dependencies. >>>> >>>> >>>> Regards Ingela - Erlang/OTP team - Ericsson AB >>>> >>>> >>>> >>>>> >>>>> 2014-04-15 16:52 GMT+04:00 Ingela Andin : >>>>> >>>>> Hello again! >>>>>> >>>>>> >>>>>>> sometimes badarg in >>>>>>> erlang:size([22,3,1,0,158,1,0,0,154,3,1,83,74|...]) at tls_record.erl:122. >>>>>>> >>>>>> >>>>>> Same symptom was recently reported on erlang-bugs and it turned out >>>>>> to be due to upgrading a gen_tcp socket in active mode. When upgrading a >>>>>> gen_tcp socket to an ssl socket it must be put in passive mode ({active, >>>>>> false}) before the client >>>>>> is allowed to start the handshake. Normaly if the upgrade is >>>>>> negotiated this is not a problem for the server to set the option >>>>>> before signaling to the client to go ahead with the handshake. If >>>>>> the upgrade is only performed on the server side instead of calling the ssl >>>>>> API ( some people may do that due to the previously lack of possibility to >>>>>> specify ssl options when calling ssl:ssl_accept with an "sslsocket", this >>>>>> is no longer the case in 17.0) the listen socket needs to be put in passive >>>>>> mode (listen options are inherited by the acceptsocket) to make sure that >>>>>> the it will work, otherwhise it will work sometimes and sometime result in >>>>>> the error above. >>>>>> >>>>>> Regards Ingela Erlang/OTP team - Ericsson AB >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Danil Zagoskin | z@REDACTED >>>>> >>>> >>>> >>> >>> >>> -- >>> Danil Zagoskin | z@REDACTED >>> >> >> > > > -- > Danil Zagoskin | z@REDACTED > -------------- next part -------------- An HTML attachment was scrubbed... URL: From snaky@REDACTED Thu Apr 17 11:30:00 2014 From: snaky@REDACTED (Yuri Lukyanov) Date: Thu, 17 Apr 2014 13:30:00 +0400 Subject: [erlang-questions] how do you build your releases with/without rebar? In-Reply-To: References: Message-ID: On Thu, Apr 17, 2014 at 10:57 AM, Garrett Smith wrote: > On Wed, Apr 16, 2014 at 2:03 PM, Yuri Lukyanov wrote: >> >> Well, I can add our story. > > Thanks for this! > >> In the beginning, we had a single repository for everything. And even >> without apps dir. It was a single monster with everything inside the >> src dir. At some point, it became obvious that it couldn't go on like >> this and we started separating the code into apps. 'apps' directory >> looked like a good fit. >> >> Then we came across Riak and its sources. The way they organised their >> code seemed so gorgeous. A tiny repository for each application! Super >> easy to think of as a separate unit of your system. Different teams >> work on different repositories. Independent testing. Ability to open >> certain parts of your project to the community. Superb! >> >> And we started a 'big move' to that world. At the beginning, >> everything was smooth. Later, we even created a project template that >> uses that every-app-is-a-repo structure >> (https://github.com/EchoTeam/rebar-templates). >> >> But what we ended up with is what Bj?rn-Egil Dahlberg said above. The >> team is divided. Some of us just couldn't stand the growing number of >> repositories. The tree of dependencies started to be so big that it >> was a nightmare to change anything inside. Imagine that you need to >> update, say, lager version. We heavily use lager in all deps. You will >> need to update the deps list of one application, then the deps list of >> the application which is dependant on the first one, then 10 >> application which depend on the latter, etc... > > This is very interesting to me as I'm experimenting with the > one-repo-per-app model, having done the apps-under-libdir thing. > > Have you experimented with tooling/automation to help manage the > dependencies across the various applications. E.g. a centralized list > of of company "standard" apps + versions that the various app/repos > pulled from? We extensively use rebar_lock_deps_plugin: https://github.com/seth/rebar_lock_deps_plugin The main purpose of it is to fix all repos at exact commits in a single root rebar.config.lock. It helps to have repeatable builds at any point in time. And in fact, you don't even need to have other dep-specific rebar.config's. Though this would ruin one of the main purpose of separating your code into different repositories - having independent working self-sufficient pieces of code. > > In a case where I need to standardize on a version of something, as a > matter of keeping things simple, I will tend to fork that repository > to a location I can control and then refer to that from each deps > list. Yes, that could be one of the options. We are considering this approach too. But the thing is that you will need to fork the whole dependency tree of a particular project/library. Consider forking https://github.com/basho/riak_kv, as an example. There are 8 deps in it. Each dep, in turn, can have about the same number of deps, and so forth. You will end up forking several dozens of applications, and it's only for one nearest dependency that you wanted to attach to your project! And it's only a beginning. Now you need to change _all_ dependencies list (i.e. rebar.config's) in all deps to point to your locations. Well, you can say that you have to do this only once. But what if you want regularly update some of you deps? You will need merging from the original locations in which the authors will also update their code and rebar.config's. Considering the amount of deps you have now, you may have tons of conflicts in dependency management. Not mentioning, that you will still have to use something like rebar_lock_deps as you want to have a linear history of changes in your main project. So, I think, we all need a new tool for dependency management :) Rebar and erlang.mk, though doing very useful job at some point, do not scale well. This is a huge subject on its own and people talk about it from time to time. One of the most thorough words IMO on the subject is this blog post by hyperthunk: http://hyperthunk.wordpress.com/2012/05/28/does-erlangotp-need-a-new-package-management-solution/ Having a good dependency manager is not solely about Erlang. Having a single approach for all languages is long overdue :) They all have similar problems and all go their own ways. But I probably walked away from the main topic, sorry :) > I happen to use git (both in github and private locations) but > any protocol supported by the build tool would work. When I need to > "rev" that dependency (bug fixes, etc.) I can just selectively > pull/merge the applicable commit or tag. > > Anyway, I'm not trying to solve your team's problems here :) I'm > curious though about the specific pain points and am wondering if > there are any good alternatives to address them, short of > consolidating everything into a single repo. > >> At the moment, we are still having different repos for different apps. >> But some people are already thinking to put _everything_ in one single >> repository. Not only all deps, but all projects as well :) >> >> There is no one-size-fits-all solution. Right, "In the long run, >> everything fails". >> Just don't be too religious about things. If you think that either >> approach is _the_ best, perhaps you just don't have use cases that can >> help your approach fail or your project is not big/small enough. > > I don't see a religious debate emerging here -- I'm encouraged that > there are options and support for different org structures and > workflows. > > One of Erlang's most compelling features IMO is the app + release > abstraction -- this is a remarkably enlightened application design. It > mirrors what happens at the operating system level. And just as > operating system ecosystems are supported by the one-repo-per-app > model -- which works, clearly -- I suspect this model can be made to > work well for Erlang projects. But I have limited experience with > complex projects -- so specific data points like yours are very > helpful. > > Thanks! > > Garrett From ingela.andin@REDACTED Thu Apr 17 17:04:30 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Thu, 17 Apr 2014 17:04:30 +0200 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: Hi! I pushed some more patches to my gitrep on the branches: ia/ssl/recv/OTP-11878 (error handling of recv on an active socket) ia/ssl/decrypt-alert (correct decryption alert handling) Regards Ingela Erlang/OTP team - Ericsson AB 2014-04-17 11:19 GMT+02:00 Ingela Andin : > Hi Danil! > > > 2014-04-17 8:52 GMT+02:00 Danil Zagoskin : > > Hi, Ingela! >> >> The patch works like a charm, thank you! It completely fixes the initial >> problem with buggy client. >> >> > One bug down! > > > >> >> But there are some sad news, too: >> >> > Well reproducible is always good, means we can haunt it down and fix it :) > > > >> While playing with my dummy server ( >> https://github.com/stolen/ssldump/blob/master/src/ssldump.erl#L70) I >> accidentally reproduced badarg in erlang:size once more: >> >> =ERROR REPORT==== 17-Apr-2014::07:34:58 === >> ** State machine <0.58.0> terminating >> ** Last message in was {tcp,#Port<0.1498>, >> >> [22,3,1,0,173,1,0,0,169,3,3,83,79,75,226,78,81,8, >> >> 77,79,97,154,127,165,92,183,20,239,70,183,158, >> >> 193,222,139,77,116,13,128,12,66,120,63,110,0,0, >> >> 94,0,255,192,36,192,35,192,10,192,9,192,7,192,8, >> >> 192,40,192,39,192,20,192,19,192,17,192,18,192,38, >> >> 192,37,192,42,192,41,192,5,192,4,192,2,192,3,192, >> >> 15,192,14,192,12,192,13,0,61,0,60,0,47,0,5,0,4,0, >> >> 53,0,10,0,103,0,107,0,51,0,57,0,22,0,175,0,174,0, >> >> 141,0,140,0,138,0,139,0,177,0,176,0,44,0,59,1,0, >> >> 0,34,0,10,0,8,0,6,0,23,0,24,0,25,0,11,0,2,1,0,0, >> 13,0,12,0,10,5,1,4,1,2,1,4,3,2,3]} >> (meaningless state omitted) >> ** Reason for termination = >> ** {badarg,[{erlang,size, >> >> [[22,3,1,0,173,1,0,0,169,3,3,83,79,75,226,78,81,8,77,79, >> >> 97,154,127,165,92,183,20,239,70,183,158,193,222,139,77, >> >> 116,13,128,12,66,120,63,110,0,0,94,0,255,192,36,192,35, >> >> 192,10,192,9,192,7,192,8,192,40,192,39,192,20,192,19, >> >> 192,17,192,18,192,38,192,37,192,42,192,41,192,5,192,4, >> >> 192,2,192,3,192,15,192,14,192,12,192,13,0,61,0,60,0,47, >> >> 0,5,0,4,0,53,0,10,0,103,0,107,0,51,0,57,0,22,0,175,0, >> >> 174,0,141,0,140,0,138,0,139,0,177,0,176,0,44,0,59,1,0,0, >> >> 34,0,10,0,8,0,6,0,23,0,24,0,25,0,11,0,2,1,0,0,13,0,12,0, >> 10,5,1,4,1,2,1,4,3,2,3]], >> []}, >> {tls_record,get_tls_records_aux,2, >> [{file,"tls_record.erl"},{line,122}]}, >> {tls_connection,next_tls_record,2, >> [{file,"tls_connection.erl"},{line,484}]}, >> {tls_connection,handle_info,3, >> [{file,"tls_connection.erl"},{line,307}]}, >> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, >> >> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} >> >> The client used was simple curl under mac os, and this crash did not >> reproduce. >> As you see, the packet received as list instead of binary is client_hello >> which is the first message ssl process gets. >> Maybe there is some race condition when changing mode on just >> transport_accepted socket. >> >> >> >> Also, the same server when working with the same curl may stall at this >> line: >> {ok, _} = ssl:recv(Socket, 0, 10000), >> process_info showed that the worker has {ssl,#sslsocket{}, Data} in its >> mailbox. >> >> I've tuned the server to reproduce this stall easier: >> https://github.com/stolen/ssldump/blob/b3eebc2fa85ca0bd8ed8470c400b972aa737bffc/src/ssldump.erl(master may change) >> >> The client is manually invoked curl which is manually interrupted after >> sufficiently large time of inactivity. The console log looks like this: >> >> stolen@REDACTED:~/ssldump$ ./dummyserver.sh 9999 ../cert/pipe.trololo >> Erlang/OTP 17 [erts-6.0] [source-07b8f44] [smp:2:2] [async-threads:10] >> [hipe] [kernel-poll:false] >> >> Eshell V6.0 (abort with ^G) >> 1> Accepting SSL in <0.46.0> >> Socket state: connection, options: {socket_options,list,0,0,0,true} >> >> =ERROR REPORT==== 17-Apr-2014::09:08:01 === >> Error in process <0.46.0> with exit value: >> {{badmatch,{error,timeout}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} >> >> Accepting SSL in <0.47.0> >> Socket state: connection, options: {socket_options,binary,0,0,0,false} >> Accepting SSL in <0.48.0> >> Socket state: connection, options: {socket_options,binary,0,0,0,false} >> Accepting SSL in <0.51.0> >> Socket state: connection, options: {socket_options,list,0,0,0,true} >> >> =ERROR REPORT==== 17-Apr-2014::09:09:17 === >> Error in process <0.51.0> with exit value: >> {{badmatch,{error,closed}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} >> >> Accepting SSL in <0.53.0> >> Socket state: connection, options: {socket_options,binary,0,0,0,false} >> Accepting SSL in <0.55.0> >> Socket state: connection, options: {socket_options,binary,0,0,0,false} >> Accepting SSL in <0.57.0> >> Socket state: connection, options: {socket_options,list,0,0,0,true} >> >> =ERROR REPORT==== 17-Apr-2014::09:11:26 === >> Error in process <0.57.0> with exit value: >> {{badmatch,{error,closed}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} >> >> >> My interpretation: >> - Given pool size X, the first of each X requests fails. >> - First of failing requests catches timeout as expected, other ones >> just stall. >> - Failing requests have emulated options [{mode, list}, {active, true}] >> while working ones have the opposite [{mode, binary}, {active, false}]. >> >> After couple of further experiments I discovered that only every (X*N + >> 1)th acceptor inherits listening socket options, other ones always have >> [{mode, binary}, {active, false}]. >> >> >> > Humm... I am not sure if this is what happens in your case but the > following should fix a potential inheritance problem > > diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl > index 743753b..7768bbb 100644 > --- a/lib/ssl/src/ssl.erl > +++ b/lib/ssl/src/ssl.erl > @@ -187,6 +187,7 @@ transport_accept(#sslsocket{pid = {ListenSocket, > {error, Reason} > end; > {error, Reason} -> > + ok = ssl_socket:setopts(Transport, ListenSocket, SocketValues), > {error, Reason} > end. > > > > >> And, apart from eventual option inheritance, shouldn't ssl:recv on active >> socket return {error, einval} like gen_tcp:recv does? >> >> >> > I think it should. > > > Regards Ingela Erlang/OTP Team Ericssson AB > > > > > >> 2014-04-16 19:36 GMT+04:00 Ingela Andin : >> >> Hi! >>> >>> 2014-04-16 15:56 GMT+02:00 Danil Zagoskin : >>> >>> Thank you for the patch. I'll check it. >>>> >>> >>> >>> New patch, better tested ;), on branch >>> ia/ssl/user-suites-match-negotiated-version at >>> https://github.com/IngelaAndin/otp >>> >>> >>>> >>>> (Style question: is lists:filtermap better than list comprehension?) >>>> >>> >>> >>> I think just a matter of taste! >>> >>> >>>> > #ssl_options{] is an internal representation of the proplists input >>>> list and should not be a visible in the API, records are generally not a >>>> good API choice as they enforce compile time dependencies. >>>> >>>> Yes, I understand that. I wanted to start broken client to see how >>>> server would work with it. >>>> The option to do that could be using sys:replace_state, but as far as I >>>> understand the code, client_hello is sent immediately after starting a >>>> process, so it seems there is no way to send crafted hello and continue >>>> handshake with couple of lines instead of ssl:connect. >>>> >>>> Given that possibility it could be much easier to reproduce server >>>> crashes when working with buggy clients. >>>> For example, How do I write a test for badmatch in tls_record:decode_cipher_text? >>>> The function takes #connection_states{}, and creating that record >>>> relies on #ssl_options{} which cannot be created without opening a >>>> socket and calling gen_fsm:enter_loop. >>>> >>>> >>> Yes you have a good point. I do not have a good short answer. Testing >>> error cases especially when the protocol sometimes >>> tries to hide the real error reason due to security issues and >>> shortcutting the API and creating raw protocol command is not trivial. >>> >>> Regards Ingela Erlang/OTP team - Ericsson AB >>> >>> >>> >>> >>> >>>> >>>> 2014-04-16 17:07 GMT+04:00 Ingela Andin : >>>> >>>> Hi! >>>>> >>>>> 2014-04-16 0:07 GMT+02:00 Danil Zagoskin : >>>>> >>>>> Hi, Ingela. >>>>>> >>>>>> I finally had some time for investigating this problem. >>>>>> >>>>>> I didn't see badarg in erlang:size again, but it definitely appeared >>>>>> in 17.0 with simple accept method described as minimal example at >>>>>> http://www.erlang.org/doc/apps/ssl/using_ssl.html ( >>>>>> >>>>> >>>>> >>>>> >>>>>> the difference was transport_accept and ssl_accept were run in >>>>>> separate process) >>>>>> >>>>> >>>>> That should be ok, you are suppose to be able to do that. >>>>> >>>>> >>>>> >>>>>> Today I met some new crash: >>>>>> ** {{badmatch,{alert,2,20,{"ssl_cipher.erl",215}}}, >>>>>> >>>>>> [{tls_record,decode_cipher_text,2,[{file,"tls_record.erl"},{line,157}]}, >>>>>> >>>>>> {tls_connection,next_record,1,[{file,"tls_connection.erl"},{line,503}]}, >>>>>> >>>>>> {tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,475}]}, >>>>>> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, >>>>>> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} >>>>>> >>>>>> That's because ssl_record:decipher/3 may return #alert{}, but >>>>>> tls_record:decode_cipher_text/2 isn't expecting that. >>>>>> >>>>>> >>>>> Hum, looks like a bug. We will look into that. >>>>> >>>>> >>>>>> >>>>>> As for {case_clause,{4}} in ssl_v3:mac_hash/3 I found that >>>>>> precondition for crash is easily reproducible: >>>>>> https://gist.github.com/stolen/10780653 >>>>>> Ordinary servers negotiate with sha hash or close socket while ssl in >>>>>> 17.0 negotiates with sha256 hash. >>>>>> I don't know the protocol good enough to perform further states, but >>>>>> I hope this helps. >>>>>> >>>>>> >>>>> Okej, the following patch should take care of that problem. >>>>> >>>>> diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl >>>>> index 743753b..093d4af 100644 >>>>> --- a/lib/ssl/src/ssl.erl >>>>> +++ b/lib/ssl/src/ssl.erl >>>>> @@ -953,8 +953,8 @@ handle_cipher_option(Value, Version) when >>>>> is_list(Value) -> >>>>> error:_-> >>>>> throw({error, {options, {ciphers, Value}}}) >>>>> end. >>>>> -binary_cipher_suites(Version, []) -> %% Defaults to all supported >>>>> suits >>>>> - ssl_cipher:suites(Version); >>>>> +binary_cipher_suites(Version, []) -> >>>>> + []; >>>>> binary_cipher_suites(Version, [{_,_,_,_}| _] = Ciphers0) -> %% >>>>> Backwards compatibility >>>>> Ciphers = [{KeyExchange, Cipher, Hash} || {KeyExchange, Cipher, >>>>> Hash, _} <- Ciphers0], >>>>> binary_cipher_suites(Version, Ciphers); >>>>> diff --git a/lib/ssl/src/ssl_handshake.erl >>>>> b/lib/ssl/src/ssl_handshake.erl >>>>> index 1108edc..93d4efd 100644 >>>>> --- a/lib/ssl/src/ssl_handshake.erl >>>>> +++ b/lib/ssl/src/ssl_handshake.erl >>>>> @@ -1017,11 +1017,14 @@ decode_suites('3_bytes', Dec) -> >>>>> %%-------------Cipeher suite handling -------------------------------- >>>>> >>>>> available_suites(UserSuites, Version) -> >>>>> + VersionSupportedSuites = ssl_cipher:suites(Version), >>>>> case UserSuites of >>>>> [] -> >>>>> - ssl_cipher:suites(Version); >>>>> + VersionSupportedSuites; >>>>> _ -> >>>>> - UserSuites >>>>> + lists:filtermap(fun(Suite) -> >>>>> + lists:member(Suite, VersionSupportedSuites) >>>>> + end, UserSuites) >>>>> end. >>>>> >>>>> available_suites(ServerCert, UserSuites, Version, Curve) -> >>>>> >>>>> >>>>> >>>>> >>>>>> Unfortunately, I don't understand how this code should be tested ? >>>>>> most of functions require #state{} or #connection_states{} which require >>>>>> #ssl_options{} and other stuff, and at I have found no exported function >>>>>> creating #ssl_options{} without side-effects. >>>>>> >>>>> >>>>> #ssl_options{] is an internal representation of the proplists input >>>>> list and should not be a visible in the API, records are generally not a >>>>> good API choice as they enforce compile time dependencies. >>>>> >>>>> >>>>> Regards Ingela - Erlang/OTP team - Ericsson AB >>>>> >>>>> >>>>> >>>>>> >>>>>> 2014-04-15 16:52 GMT+04:00 Ingela Andin : >>>>>> >>>>>> Hello again! >>>>>>> >>>>>>> >>>>>>>> sometimes badarg in >>>>>>>> erlang:size([22,3,1,0,158,1,0,0,154,3,1,83,74|...]) at tls_record.erl:122. >>>>>>>> >>>>>>> >>>>>>> Same symptom was recently reported on erlang-bugs and it turned out >>>>>>> to be due to upgrading a gen_tcp socket in active mode. When upgrading a >>>>>>> gen_tcp socket to an ssl socket it must be put in passive mode ({active, >>>>>>> false}) before the client >>>>>>> is allowed to start the handshake. Normaly if the upgrade is >>>>>>> negotiated this is not a problem for the server to set the option >>>>>>> before signaling to the client to go ahead with the handshake. If >>>>>>> the upgrade is only performed on the server side instead of calling the ssl >>>>>>> API ( some people may do that due to the previously lack of possibility to >>>>>>> specify ssl options when calling ssl:ssl_accept with an "sslsocket", this >>>>>>> is no longer the case in 17.0) the listen socket needs to be put in passive >>>>>>> mode (listen options are inherited by the acceptsocket) to make sure that >>>>>>> the it will work, otherwhise it will work sometimes and sometime result in >>>>>>> the error above. >>>>>>> >>>>>>> Regards Ingela Erlang/OTP team - Ericsson AB >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Danil Zagoskin | z@REDACTED >>>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Danil Zagoskin | z@REDACTED >>>> >>> >>> >> >> >> -- >> Danil Zagoskin | z@REDACTED >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Thu Apr 17 17:07:56 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Thu, 17 Apr 2014 17:07:56 +0200 Subject: [erlang-questions] unicode + version < 17.0 Message-ID: Hi all, I have a library where the input to the function should be given as utf8. Inputs can be: "http://www.???.com/atomtests/iri/ ?.html" <<"http://www.???.com/atomtests/iri/ ?.html"/utf8>> or sometimes <<"http://www.???.com/atomtests/iri/ ?.html">> The library I am using should be compatible with the Erlang R15 to 17.0 versions and I wonder if there is a graceful way to handle inputs depending on the Erlang version >From a discussion on IRC, I found I can easily convert a string to unicode using the following function: UnicodeURL = case unicode:characters_to_binary(URL, InEnc) of URL1 when is_binary(URL1) -> URL1 _ -> unicode:characters_to_binary(list_to_binary(URL)) end It also works on R16B if I set the source code encoding with the file header `%% -*- coding: utf-8 -*-`. But how to handle it when the source code encoding is latin1? How to handle it in version < R16B? Is this possible? If not, can we disable functions depending of an Erlang version in a module? Any help is appreciated :) - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.valim@REDACTED Thu Apr 17 17:19:33 2014 From: jose.valim@REDACTED (=?UTF-8?Q?Jos=C3=A9_Valim?=) Date: Thu, 17 Apr 2014 17:19:33 +0200 Subject: [erlang-questions] unicode + version < 17.0 In-Reply-To: References: Message-ID: When you say input, do you mean the standard input? If so, you can set the IO device to be unicode explicitly: ok = io:setopts(standard_io, [binary,{encoding,utf8}]) ok = io:setopts(standard_error, [{unicode,true}]) This works if you are only reading and writing to standard io and standard error. If working with files, you must pass the unicode option when opening the file and if you want to have unicode filenames, you need to pass them as binaries (or be sure to start the VM with one of the +fnu flags). file:get_cwd, init:get_arguments and os:cmd may also have different behaviour depending on the OS before R17. For those cases, you need to do a proper translation using file:native_name_encoding() or alternatively just set the +fnu flag on boot as well. *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Lead Developer On Thu, Apr 17, 2014 at 5:07 PM, Benoit Chesneau wrote: > Hi all, > > I have a library where the input to the function should be given as utf8. > > Inputs can be: > > "http://www.???.com/atomtests/iri/ > ?.html" > > <<"http://www.???.com/atomtests/iri/ > ?.html"/utf8>> > > or sometimes <<"http://www.???.com/atomtests/iri/ > ?.html">> > > The library I am using should be compatible with the Erlang R15 to 17.0 > versions and I wonder if there is a graceful way to handle inputs > depending on the Erlang version > > From a discussion on IRC, I found I can easily convert a string to unicode > using the following function: > > UnicodeURL = case unicode:characters_to_binary(URL, InEnc) of > URL1 when is_binary(URL1) -> > URL1 > _ -> > unicode:characters_to_binary(list_to_binary(URL)) > end > > It also works on R16B if I set the source code encoding with the file > header `%% -*- coding: utf-8 -*-`. > > But how to handle it when the source code encoding is latin1? How to > handle it in version < R16B? Is this possible? > > If not, can we disable functions depending of an Erlang version in a > module? > > > Any help is appreciated :) > > - benoit > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Thu Apr 17 17:27:59 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Thu, 17 Apr 2014 17:27:59 +0200 Subject: [erlang-questions] unicode + version < 17.0 In-Reply-To: References: Message-ID: On Thu, Apr 17, 2014 at 5:19 PM, Jos? Valim wrote: > When you say input, do you mean the standard input? If so, you can set the > IO device to be unicode explicitly: > > ok = io:setopts(standard_io, [binary,{encoding,utf8}]) > ok = io:setopts(standard_error, [{unicode,true}]) > > This works if you are only reading and writing to standard io and standard > error. > > If working with files, you must pass the unicode option when opening the > file and if you want to have unicode filenames, you need to pass them as > binaries (or be sure to start the VM with one of the +fnu flags). > > file:get_cwd, init:get_arguments and os:cmd may also have different > behaviour depending on the OS before R17. For those cases, you need to do a > proper translation using file:native_name_encoding() or alternatively just > set the +fnu flag on boot as well. > > Sorry I mean input as argument to a function, so in the source code file I have Input = "http://www.???.com/atomtests/iri/ ?.html", myfunc(Input) - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.valim@REDACTED Thu Apr 17 17:52:09 2014 From: jose.valim@REDACTED (=?UTF-8?Q?Jos=C3=A9_Valim?=) Date: Thu, 17 Apr 2014 17:52:09 +0200 Subject: [erlang-questions] unicode + version < 17.0 In-Reply-To: References: Message-ID: Oops, talk about me going off-topic. :) There is definitely an issue with the third case, which will be a binary encoded in latin1 or utf-8 depending on the erlang version. The proposed solution will work as long as users give the InEnc explicitly as I don't believe there is a way to retrieve the encoding of the binary. I can't think of any alternative. I would also change the solution to fail on the second clause. I would rather be explicit the user is passing data in the wrong encoding/format than try to guess it (which may lead to bad guesses). -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Thu Apr 17 18:56:41 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 17 Apr 2014 20:56:41 +0400 Subject: [erlang-questions] process_info(Pid,binary) for ets Message-ID: ets:info(Table,memory) reports only words. How is it possible to dig inside ets binary storage size with something like process_info(Pid, binary)? -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Thu Apr 17 20:04:18 2014 From: z@REDACTED (Danil Zagoskin) Date: Thu, 17 Apr 2014 22:04:18 +0400 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: Hi! Thank you for the patches! Meanwhile we have deployed suite selection patch and now there is something new in crash logs: =CRASH REPORT==== 17-Apr-2014::20:32:24 === crasher: initial call: tls_connection:init/1 pid: <0.30376.19> registered_name: [] exception exit: {function_clause, [{tls_connection,handle_tls_handshake, [#Fun,abbreviated, #state{role = server, %% LOTS OF STUFF SKIPPED %% connection_states = #connection_states{ current_read = %% cipher_suite = <<0,0>> %% pending_read = %% cipher_suite = <<0,51>> %% } protocol_buffers = #protocol_buffers{ tls_packets = [], tls_handshake_buffer = <<92,64,37,228,209,208,235,232,47,69,57,232,90,106, ..... >> %% SKIPPED %%}, tls_handshake_history = { [ [20,<<0,0,12>>,<<111,40,244,7,137,224,16,109,197,110,249,152>>], [2,<<0,0,70>>,<<3,2,83,80,2,23,175,124,25,138,178,243,166,22, 150,239,220,170,215,108,54,169,67,79,124,183, 189,89,35,239,244,87,102,19,32,11,15,20,173,67, 209,70,180,252,109,228,108,60,203,91,126,77,12, 231,203,43,221,11,234,147,28,231,91,18,49,228, 70,0,51,0>>], <<1,0,0,141,3,2,83,80,4,31,206,23,107,223,241,244, 164,4,198,176,44,155,63,58,157,103,95,44,198,83, 237,110,165,99,242,190,122,83,32,11,15,20,173, 67,209,70,180,252,109,228,108,60,203,91,126,77, 12,231,203,43,221,11,234,147,28,231,91,18,49, 228,70,0,36,0,51,0,69,0,57,0,136,0,22,0,50,0,68, 0,56,0,135,0,19,0,102,0,47,0,65,0,53,0,132,0,10, 0,5,0,4,1,0,0,32,0,9,0,3,2,0,1,0,0,0,21,0,19,0, 0,16,119,101,98,100,97,118,46,121,97,110,100, 101,120,46,114,117>> ], [..........] }, %% LOTS OF STUFF SKIPPED %% }], [{file,"tls_connection.erl"},{line,735}]}, {tls_connection,next_state,4, [{file,"tls_connection.erl"},{line,458}]}, {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]}, {proc_lib,init_p_do_apply,3, [{file,"proc_lib.erl"},{line,239}]}]} in function gen_fsm:terminate/7 (gen_fsm.erl, line 622) Could that client work with other server implementation? tls_handshake_buffer seems like a garbage (but I'm not sure), so maybe here's no valid client lost. Should server tolerate such conditions? Should an alert be thrown when tls_handshake:get_tls_handshake returns {[], _}? Another question about crashes: Maybe tls_connection is a good place for format_status/2? It may be a good idea to hide secrets when printing state (otherwise a person which has access to error logs seems to be able to restore the private key or decipher dumped traffic). 2014-04-17 19:04 GMT+04:00 Ingela Andin : > Hi! > > I pushed some more patches to my gitrep on the branches: > > ia/ssl/recv/OTP-11878 (error handling of recv on an active socket) > > ia/ssl/decrypt-alert (correct decryption alert handling) > > Regards Ingela Erlang/OTP team - Ericsson AB > > > > > 2014-04-17 11:19 GMT+02:00 Ingela Andin : > > Hi Danil! >> >> >> 2014-04-17 8:52 GMT+02:00 Danil Zagoskin : >> >> Hi, Ingela! >>> >>> The patch works like a charm, thank you! It completely fixes the initial >>> problem with buggy client. >>> >>> >> One bug down! >> >> >> >>> >>> But there are some sad news, too: >>> >>> >> Well reproducible is always good, means we can haunt it down and fix it >> :) >> >> >> >>> While playing with my dummy server ( >>> https://github.com/stolen/ssldump/blob/master/src/ssldump.erl#L70) I >>> accidentally reproduced badarg in erlang:size once more: >>> >>> =ERROR REPORT==== 17-Apr-2014::07:34:58 === >>> ** State machine <0.58.0> terminating >>> ** Last message in was {tcp,#Port<0.1498>, >>> >>> [22,3,1,0,173,1,0,0,169,3,3,83,79,75,226,78,81,8, >>> >>> 77,79,97,154,127,165,92,183,20,239,70,183,158, >>> >>> 193,222,139,77,116,13,128,12,66,120,63,110,0,0, >>> >>> 94,0,255,192,36,192,35,192,10,192,9,192,7,192,8, >>> >>> 192,40,192,39,192,20,192,19,192,17,192,18,192,38, >>> >>> 192,37,192,42,192,41,192,5,192,4,192,2,192,3,192, >>> >>> 15,192,14,192,12,192,13,0,61,0,60,0,47,0,5,0,4,0, >>> >>> 53,0,10,0,103,0,107,0,51,0,57,0,22,0,175,0,174,0, >>> >>> 141,0,140,0,138,0,139,0,177,0,176,0,44,0,59,1,0, >>> >>> 0,34,0,10,0,8,0,6,0,23,0,24,0,25,0,11,0,2,1,0,0, >>> 13,0,12,0,10,5,1,4,1,2,1,4,3,2,3]} >>> (meaningless state omitted) >>> ** Reason for termination = >>> ** {badarg,[{erlang,size, >>> >>> [[22,3,1,0,173,1,0,0,169,3,3,83,79,75,226,78,81,8,77,79, >>> >>> 97,154,127,165,92,183,20,239,70,183,158,193,222,139,77, >>> >>> 116,13,128,12,66,120,63,110,0,0,94,0,255,192,36,192,35, >>> >>> 192,10,192,9,192,7,192,8,192,40,192,39,192,20,192,19, >>> >>> 192,17,192,18,192,38,192,37,192,42,192,41,192,5,192,4, >>> >>> 192,2,192,3,192,15,192,14,192,12,192,13,0,61,0,60,0,47, >>> >>> 0,5,0,4,0,53,0,10,0,103,0,107,0,51,0,57,0,22,0,175,0, >>> >>> 174,0,141,0,140,0,138,0,139,0,177,0,176,0,44,0,59,1,0,0, >>> >>> 34,0,10,0,8,0,6,0,23,0,24,0,25,0,11,0,2,1,0,0,13,0,12,0, >>> 10,5,1,4,1,2,1,4,3,2,3]], >>> []}, >>> {tls_record,get_tls_records_aux,2, >>> [{file,"tls_record.erl"},{line,122}]}, >>> {tls_connection,next_tls_record,2, >>> [{file,"tls_connection.erl"},{line,484}]}, >>> {tls_connection,handle_info,3, >>> [{file,"tls_connection.erl"},{line,307}]}, >>> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, >>> >>> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} >>> >>> The client used was simple curl under mac os, and this crash did not >>> reproduce. >>> As you see, the packet received as list instead of binary is >>> client_hello which is the first message ssl process gets. >>> Maybe there is some race condition when changing mode on just >>> transport_accepted socket. >>> >>> >>> >>> Also, the same server when working with the same curl may stall at this >>> line: >>> {ok, _} = ssl:recv(Socket, 0, 10000), >>> process_info showed that the worker has {ssl,#sslsocket{}, Data} in its >>> mailbox. >>> >>> I've tuned the server to reproduce this stall easier: >>> https://github.com/stolen/ssldump/blob/b3eebc2fa85ca0bd8ed8470c400b972aa737bffc/src/ssldump.erl(master may change) >>> >>> The client is manually invoked curl which is manually interrupted after >>> sufficiently large time of inactivity. The console log looks like this: >>> >>> stolen@REDACTED:~/ssldump$ ./dummyserver.sh 9999 ../cert/pipe.trololo >>> Erlang/OTP 17 [erts-6.0] [source-07b8f44] [smp:2:2] [async-threads:10] >>> [hipe] [kernel-poll:false] >>> >>> Eshell V6.0 (abort with ^G) >>> 1> Accepting SSL in <0.46.0> >>> Socket state: connection, options: {socket_options,list,0,0,0,true} >>> >>> =ERROR REPORT==== 17-Apr-2014::09:08:01 === >>> Error in process <0.46.0> with exit value: >>> {{badmatch,{error,timeout}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} >>> >>> Accepting SSL in <0.47.0> >>> Socket state: connection, options: {socket_options,binary,0,0,0,false} >>> Accepting SSL in <0.48.0> >>> Socket state: connection, options: {socket_options,binary,0,0,0,false} >>> Accepting SSL in <0.51.0> >>> Socket state: connection, options: {socket_options,list,0,0,0,true} >>> >>> =ERROR REPORT==== 17-Apr-2014::09:09:17 === >>> Error in process <0.51.0> with exit value: >>> {{badmatch,{error,closed}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} >>> >>> Accepting SSL in <0.53.0> >>> Socket state: connection, options: {socket_options,binary,0,0,0,false} >>> Accepting SSL in <0.55.0> >>> Socket state: connection, options: {socket_options,binary,0,0,0,false} >>> Accepting SSL in <0.57.0> >>> Socket state: connection, options: {socket_options,list,0,0,0,true} >>> >>> =ERROR REPORT==== 17-Apr-2014::09:11:26 === >>> Error in process <0.57.0> with exit value: >>> {{badmatch,{error,closed}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} >>> >>> >>> My interpretation: >>> - Given pool size X, the first of each X requests fails. >>> - First of failing requests catches timeout as expected, other ones >>> just stall. >>> - Failing requests have emulated options [{mode, list}, {active, >>> true}] while working ones have the opposite [{mode, binary}, {active, >>> false}]. >>> >>> After couple of further experiments I discovered that only every (X*N + >>> 1)th acceptor inherits listening socket options, other ones always have >>> [{mode, binary}, {active, false}]. >>> >>> >>> >> Humm... I am not sure if this is what happens in your case but the >> following should fix a potential inheritance problem >> >> diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl >> index 743753b..7768bbb 100644 >> --- a/lib/ssl/src/ssl.erl >> +++ b/lib/ssl/src/ssl.erl >> @@ -187,6 +187,7 @@ transport_accept(#sslsocket{pid = {ListenSocket, >> {error, Reason} >> end; >> {error, Reason} -> >> + ok = ssl_socket:setopts(Transport, ListenSocket, SocketValues), >> {error, Reason} >> end. >> >> >> >> >>> And, apart from eventual option inheritance, shouldn't ssl:recv on >>> active socket return {error, einval} like gen_tcp:recv does? >>> >>> >>> >> I think it should. >> >> >> Regards Ingela Erlang/OTP Team Ericssson AB >> >> >> >> >> >>> 2014-04-16 19:36 GMT+04:00 Ingela Andin : >>> >>> Hi! >>>> >>>> 2014-04-16 15:56 GMT+02:00 Danil Zagoskin : >>>> >>>> Thank you for the patch. I'll check it. >>>>> >>>> >>>> >>>> New patch, better tested ;), on branch >>>> ia/ssl/user-suites-match-negotiated-version at >>>> https://github.com/IngelaAndin/otp >>>> >>>> >>>>> >>>>> (Style question: is lists:filtermap better than list comprehension?) >>>>> >>>> >>>> >>>> I think just a matter of taste! >>>> >>>> >>>>> > #ssl_options{] is an internal representation of the proplists input >>>>> list and should not be a visible in the API, records are generally not a >>>>> good API choice as they enforce compile time dependencies. >>>>> >>>>> Yes, I understand that. I wanted to start broken client to see how >>>>> server would work with it. >>>>> The option to do that could be using sys:replace_state, but as far as >>>>> I understand the code, client_hello is sent immediately after starting a >>>>> process, so it seems there is no way to send crafted hello and continue >>>>> handshake with couple of lines instead of ssl:connect. >>>>> >>>>> Given that possibility it could be much easier to reproduce server >>>>> crashes when working with buggy clients. >>>>> For example, How do I write a test for badmatch in tls_record:decode_cipher_text? >>>>> The function takes #connection_states{}, and creating that record >>>>> relies on #ssl_options{} which cannot be created without opening a >>>>> socket and calling gen_fsm:enter_loop. >>>>> >>>>> >>>> Yes you have a good point. I do not have a good short answer. Testing >>>> error cases especially when the protocol sometimes >>>> tries to hide the real error reason due to security issues and >>>> shortcutting the API and creating raw protocol command is not trivial. >>>> >>>> Regards Ingela Erlang/OTP team - Ericsson AB >>>> >>>> >>>> >>>> >>>> >>>>> >>>>> 2014-04-16 17:07 GMT+04:00 Ingela Andin : >>>>> >>>>> Hi! >>>>>> >>>>>> 2014-04-16 0:07 GMT+02:00 Danil Zagoskin : >>>>>> >>>>>> Hi, Ingela. >>>>>>> >>>>>>> I finally had some time for investigating this problem. >>>>>>> >>>>>>> I didn't see badarg in erlang:size again, but it definitely appeared >>>>>>> in 17.0 with simple accept method described as minimal example at >>>>>>> http://www.erlang.org/doc/apps/ssl/using_ssl.html ( >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> the difference was transport_accept and ssl_accept were run in >>>>>>> separate process) >>>>>>> >>>>>> >>>>>> That should be ok, you are suppose to be able to do that. >>>>>> >>>>>> >>>>>> >>>>>>> Today I met some new crash: >>>>>>> ** {{badmatch,{alert,2,20,{"ssl_cipher.erl",215}}}, >>>>>>> >>>>>>> [{tls_record,decode_cipher_text,2,[{file,"tls_record.erl"},{line,157}]}, >>>>>>> >>>>>>> {tls_connection,next_record,1,[{file,"tls_connection.erl"},{line,503}]}, >>>>>>> >>>>>>> {tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,475}]}, >>>>>>> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, >>>>>>> >>>>>>> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} >>>>>>> >>>>>>> That's because ssl_record:decipher/3 may return #alert{}, but >>>>>>> tls_record:decode_cipher_text/2 isn't expecting that. >>>>>>> >>>>>>> >>>>>> Hum, looks like a bug. We will look into that. >>>>>> >>>>>> >>>>>>> >>>>>>> As for {case_clause,{4}} in ssl_v3:mac_hash/3 I found that >>>>>>> precondition for crash is easily reproducible: >>>>>>> https://gist.github.com/stolen/10780653 >>>>>>> Ordinary servers negotiate with sha hash or close socket while ssl >>>>>>> in 17.0 negotiates with sha256 hash. >>>>>>> I don't know the protocol good enough to perform further states, but >>>>>>> I hope this helps. >>>>>>> >>>>>>> >>>>>> Okej, the following patch should take care of that problem. >>>>>> >>>>>> diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl >>>>>> index 743753b..093d4af 100644 >>>>>> --- a/lib/ssl/src/ssl.erl >>>>>> +++ b/lib/ssl/src/ssl.erl >>>>>> @@ -953,8 +953,8 @@ handle_cipher_option(Value, Version) when >>>>>> is_list(Value) -> >>>>>> error:_-> >>>>>> throw({error, {options, {ciphers, Value}}}) >>>>>> end. >>>>>> -binary_cipher_suites(Version, []) -> %% Defaults to all supported >>>>>> suits >>>>>> - ssl_cipher:suites(Version); >>>>>> +binary_cipher_suites(Version, []) -> >>>>>> + []; >>>>>> binary_cipher_suites(Version, [{_,_,_,_}| _] = Ciphers0) -> %% >>>>>> Backwards compatibility >>>>>> Ciphers = [{KeyExchange, Cipher, Hash} || {KeyExchange, Cipher, >>>>>> Hash, _} <- Ciphers0], >>>>>> binary_cipher_suites(Version, Ciphers); >>>>>> diff --git a/lib/ssl/src/ssl_handshake.erl >>>>>> b/lib/ssl/src/ssl_handshake.erl >>>>>> index 1108edc..93d4efd 100644 >>>>>> --- a/lib/ssl/src/ssl_handshake.erl >>>>>> +++ b/lib/ssl/src/ssl_handshake.erl >>>>>> @@ -1017,11 +1017,14 @@ decode_suites('3_bytes', Dec) -> >>>>>> %%-------------Cipeher suite handling >>>>>> -------------------------------- >>>>>> >>>>>> available_suites(UserSuites, Version) -> >>>>>> + VersionSupportedSuites = ssl_cipher:suites(Version), >>>>>> case UserSuites of >>>>>> [] -> >>>>>> - ssl_cipher:suites(Version); >>>>>> + VersionSupportedSuites; >>>>>> _ -> >>>>>> - UserSuites >>>>>> + lists:filtermap(fun(Suite) -> >>>>>> + lists:member(Suite, VersionSupportedSuites) >>>>>> + end, UserSuites) >>>>>> end. >>>>>> >>>>>> available_suites(ServerCert, UserSuites, Version, Curve) -> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> Unfortunately, I don't understand how this code should be tested ? >>>>>>> most of functions require #state{} or #connection_states{} which require >>>>>>> #ssl_options{} and other stuff, and at I have found no exported function >>>>>>> creating #ssl_options{} without side-effects. >>>>>>> >>>>>> >>>>>> #ssl_options{] is an internal representation of the proplists input >>>>>> list and should not be a visible in the API, records are generally not a >>>>>> good API choice as they enforce compile time dependencies. >>>>>> >>>>>> >>>>>> Regards Ingela - Erlang/OTP team - Ericsson AB >>>>>> >>>>>> >>>>>> >>>>>>> >>>>>>> 2014-04-15 16:52 GMT+04:00 Ingela Andin : >>>>>>> >>>>>>> Hello again! >>>>>>>> >>>>>>>> >>>>>>>>> sometimes badarg in >>>>>>>>> erlang:size([22,3,1,0,158,1,0,0,154,3,1,83,74|...]) at tls_record.erl:122. >>>>>>>>> >>>>>>>> >>>>>>>> Same symptom was recently reported on erlang-bugs and it turned out >>>>>>>> to be due to upgrading a gen_tcp socket in active mode. When upgrading a >>>>>>>> gen_tcp socket to an ssl socket it must be put in passive mode ({active, >>>>>>>> false}) before the client >>>>>>>> is allowed to start the handshake. Normaly if the upgrade is >>>>>>>> negotiated this is not a problem for the server to set the option >>>>>>>> before signaling to the client to go ahead with the handshake. If >>>>>>>> the upgrade is only performed on the server side instead of calling the ssl >>>>>>>> API ( some people may do that due to the previously lack of possibility to >>>>>>>> specify ssl options when calling ssl:ssl_accept with an "sslsocket", this >>>>>>>> is no longer the case in 17.0) the listen socket needs to be put in passive >>>>>>>> mode (listen options are inherited by the acceptsocket) to make sure that >>>>>>>> the it will work, otherwhise it will work sometimes and sometime result in >>>>>>>> the error above. >>>>>>>> >>>>>>>> Regards Ingela Erlang/OTP team - Ericsson AB >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Danil Zagoskin | z@REDACTED >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Danil Zagoskin | z@REDACTED >>>>> >>>> >>>> >>> >>> >>> -- >>> Danil Zagoskin | z@REDACTED >>> >> >> > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Thu Apr 17 21:05:50 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Thu, 17 Apr 2014 21:05:50 +0200 Subject: [erlang-questions] unicode + version < 17.0 In-Reply-To: References: Message-ID: finally I chosed the easy way: https://github.com/benoitc/hackney_lib/commit/55de7ae0a1f5a0abd5836b52d7cea85951f3c3b8#diff-c8f112ac1af67f0503ac32dff7ae482fR264 On Thu, Apr 17, 2014 at 5:52 PM, Jos? Valim wrote: > Oops, talk about me going off-topic. :) > > There is definitely an issue with the third case, which will be a binary > encoded in latin1 or utf-8 depending on the erlang version. The proposed > solution will work as long as users give the InEnc explicitly as I don't > believe there is a way to retrieve the encoding of the binary. I can't > think of any alternative. > > I would also change the solution to fail on the second clause. I would > rather be explicit the user is passing data in the wrong encoding/format > than try to guess it (which may lead to bad guesses). > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nickelchen@REDACTED Fri Apr 18 10:43:34 2014 From: nickelchen@REDACTED (nickel chen) Date: Fri, 18 Apr 2014 01:43:34 -0700 (PDT) Subject: [erlang-questions] =?utf-8?b?5Zue5aSN77yaICDlm57lpI3vvJogZWphYmJl?= =?utf-8?q?rd_translate_crash?= In-Reply-To: <34813C80-CE14-4BA0-8296-5DD8CC93F0D8@gmail.com> References: <1397114648.17048.YahooMailNeo@web125706.mail.ne1.yahoo.com> <1397198506.90976.YahooMailNeo@web125703.mail.ne1.yahoo.com> <34813C80-CE14-4BA0-8296-5DD8CC93F0D8@gmail.com> Message-ID: <1397810614.65088.YahooMailNeo@web125704.mail.ne1.yahoo.com> It was confirmed to be a compability issue with R17. ? This is the related ejabberd github issue:?https://github.com/processone/ejabberd/issues/164 processone/ejabberd Maybe i'm missing something, I'm having problems with translate module. After compiling and installing ejabberd from source, I wanted to start it sudo ejabberdc... ? github.com ??? ??? Yahoo By now, it has been fixed by ejabberd team. processone/ejabberd processone/ejabberd ejabberd - Robust and scalable Jabber / XMPP Instant Messaging platform ? github.com ??? ??? Yahoo processone/ejabberd processone/ejabberd ejabberd - Robust and scalable Jabber / XMPP Instant Messaging platform ? github.com ??? ??? Yahoo D?niel Szoboszlay ? 2014?4?14?, ???, 9:13 ?? ??? Hi, I?m not really familiar with ejabberd in particular, but I can think of two possible ways to fix your problem: * change the iolist_to_binary call to uncidoe:characters_to_binary, which will take care of utf8 encoding the unicode code points * change the translation file (el.msg) to contain the translations as binaries instead of strings (<>) I?d prefer the first solution, btw. Regards, Daniel On 2014 Apr 11, at 8:41 , nickel chen wrote: anyone information, ?please? i'm stucked at this problem. >nickel chen ? 2014?4?10?, ???, 3:24 ?? ??? > >?Hi all, I'm new to erlang and I'm learning the code of ejabberd 13.12, I already have ejabberd installed, then start it with > > >sudo ejabberdctl start > > >There is a crash message in /var/log/ejabberd.log > > >2014-04-10 14:37:56.520 [info] <0.7.0> Application ejabberd exited with reason: bad argument in call to erlang:iolist_to_binary([916,953,945,956,972,961,966,969,963,951,32,928,961,972,963,946,945,963,951,962]) in translate:'-load_file/2-fun-2-'/3 line 91 > > >i added some debug info to the source code ` translate.erl` ?and recompile ejabberd. then start it again, below is the debug message: > > > >2014-04-10 14:37:56.517 [info] <0.38.0>@translate:load_file:87 File is: <<"//lib/ejabberd/priv/msgs/el.msg">>, Orig is:"Access Configuration", Trans is: [916,953,945,956,972,961,966,969,963,951,32,928,961,972,963,946,945,963,951,962] > > >well it's clear that there are unicode characters in I18N translation , when passed to?the?erlang:iolist_to_binary/1, it crashed with badarg, because iolist only accepts byte( ) binary( ) and other iolist( ) > > >9> erlang:iolist_to_binary([256]). >** exception error: bad argument >?? ? in function? iolist_to_binary/1 >? ? ? ? called as iolist_to_binary([256]) >10> erlang:iolist_to_binary([255]). ><<"?">> >11>? > > >My question is simple, how to get around with this problem and get ejabberd launched? > > >Thanks in advance! > >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From solomon.wzs@REDACTED Fri Apr 18 11:40:20 2014 From: solomon.wzs@REDACTED (Solomon) Date: Fri, 18 Apr 2014 17:40:20 +0800 Subject: [erlang-questions] the record volates the declared type when I analysis the code Message-ID: Hi. I declared a record like this: -record(kv, {key::string(), value::integer()}). and I create a mnesia table to save the record 'kv' I select the table like this: mnesia:dirty_select(table, [{#kv{key='_', value='$1'}, [{'>', '$1', 10}], ['_']}]). then I analysis the code: dialyzer --plt ./.depsolver_plt ./ebin/my.beam and I get the error: Record construction #kv{key::'_', value::'$1'} violates the declared type of field key::string() and value::integer() How should I fix the error? Thanks. From dszoboszlay@REDACTED Fri Apr 18 11:55:51 2014 From: dszoboszlay@REDACTED (=?iso-8859-1?Q?D=E1niel_Szoboszlay?=) Date: Fri, 18 Apr 2014 11:55:51 +0200 Subject: [erlang-questions] the record volates the declared type when I analysis the code In-Reply-To: References: Message-ID: Hi, I?d recommend you to decouple the type spec from the record the following way: -record(kv, {key, value}). -type kv() :: #kv{key::string(), value::integer()}. Bonus feature: you can export the kv/0 type from your module (if you need to), but you can?t do that when the types are embedded into the record declaration. Regards, Daniel On 2014 Apr 18, at 11:40 , Solomon wrote: > Hi. > > I declared a record like this: > -record(kv, {key::string(), value::integer()}). > > and I create a mnesia table to save the record 'kv' > > I select the table like this: > mnesia:dirty_select(table, [{#kv{key='_', value='$1'}, [{'>', '$1', > 10}], ['_']}]). > > then I analysis the code: > dialyzer --plt ./.depsolver_plt ./ebin/my.beam > > and I get the error: > Record construction #kv{key::'_', value::'$1'} violates the declared > type of field key::string() and value::integer() > > How should I fix the error? > > Thanks. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Fri Apr 18 12:00:04 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Fri, 18 Apr 2014 12:00:04 +0200 Subject: [erlang-questions] the record volates the declared type when I analysis the code In-Reply-To: References: Message-ID: <5350F7A4.9000405@ninenines.eu> You defined key to be a string() and value to be integer() and then pass a #kv{} record with key being an atom() and value being another atom(), so Dialyzer of course complains, your types are incorrect and/or incomplete. On 04/18/2014 11:40 AM, Solomon wrote: > Hi. > > I declared a record like this: > -record(kv, {key::string(), value::integer()}). > > and I create a mnesia table to save the record 'kv' > > I select the table like this: > mnesia:dirty_select(table, [{#kv{key='_', value='$1'}, [{'>', '$1', > 10}], ['_']}]). > > then I analysis the code: > dialyzer --plt ./.depsolver_plt ./ebin/my.beam > > and I get the error: > Record construction #kv{key::'_', value::'$1'} violates the declared > type of field key::string() and value::integer() > > How should I fix the error? > > Thanks. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From essen@REDACTED Fri Apr 18 12:00:58 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Fri, 18 Apr 2014 12:00:58 +0200 Subject: [erlang-questions] the record volates the declared type when I analysis the code In-Reply-To: References: Message-ID: <5350F7DA.8020707@ninenines.eu> On 04/18/2014 11:55 AM, D?niel Szoboszlay wrote: > Hi, > > I?d recommend you to decouple the type spec from the record the > following way: > > -record(kv, {key, value}). > -type kv() :: #kv{key::string(), value::integer()}. > > Bonus feature: you can export the kv/0 type from your module (if you > need to), but you can?t do that when the types are embedded into the > record declaration. I am not sure what you mean by that. I have been doing it for a long time and it works just fine, albeit I always use opaque for exported records. > Regards, > Daniel > > On 2014 Apr 18, at 11:40 , Solomon > wrote: > >> Hi. >> >> I declared a record like this: >> -record(kv, {key::string(), value::integer()}). >> >> and I create a mnesia table to save the record 'kv' >> >> I select the table like this: >> mnesia:dirty_select(table, [{#kv{key='_', value='$1'}, [{'>', '$1', >> 10}], ['_']}]). >> >> then I analysis the code: >> dialyzer --plt ./.depsolver_plt ./ebin/my.beam >> >> and I get the error: >> Record construction #kv{key::'_', value::'$1'} violates the declared >> type of field key::string() and value::integer() >> >> How should I fix the error? >> >> Thanks. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From dszoboszlay@REDACTED Fri Apr 18 12:17:10 2014 From: dszoboszlay@REDACTED (=?iso-8859-1?Q?D=E1niel_Szoboszlay?=) Date: Fri, 18 Apr 2014 12:17:10 +0200 Subject: [erlang-questions] the record volates the declared type when I analysis the code In-Reply-To: <5350F7DA.8020707@ninenines.eu> References: <5350F7DA.8020707@ninenines.eu> Message-ID: On 2014 Apr 18, at 12:00 , Lo?c Hoguin wrote: > On 04/18/2014 11:55 AM, D?niel Szoboszlay wrote: >> Hi, >> >> I?d recommend you to decouple the type spec from the record the >> following way: >> >> -record(kv, {key, value}). >> -type kv() :: #kv{key::string(), value::integer()}. >> >> Bonus feature: you can export the kv/0 type from your module (if you >> need to), but you can?t do that when the types are embedded into the >> record declaration. > > I am not sure what you mean by that. I have been doing it for a long time and it works just fine, albeit I always use opaque for exported records. Well, sometimes two modules need to use the same record (defined in a header of course). Then you can do something like: -module(foo). -include(?foorec.hrl?). -type foorec() :: #foorec{?}. -export_type([foorec/0]). ? -module(bar). -include(?foorec.hrl?). -spec bar(Foo :: foo:foorec()) -> ok. ? I like this pattern, because it?s easy to understand who is responsible for the foorec() type, the type spec will end up in the EDoc page and so on. Anyway, that?s not so important for the original question. What is important is that by separating record declarations from type specs you can clearly explain to Dialyzer via function specs when do you want to deal with a type-correct record and when do you just happen to handle tuples that look like your records (e.g. in match specs or by a random coincidence like in this other question). Regards, Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri Apr 18 12:51:22 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 18 Apr 2014 14:51:22 +0400 Subject: [erlang-questions] Possibly memory leak in R17 Message-ID: I've released next version of our streaming server erlyvideo on R17 and we see something, perhaps memory leak on production. (flussonic@REDACTED)4> erlang:memory(total). 2184313496 2GB is a very moderate consumption, so no problem here. top shows that beam.smp is using 6.6g of RES memory. No custom-made drivers are used on this machine and only one nif is used. Are there any ways to collect more info? -------------- next part -------------- An HTML attachment was scrubbed... URL: From define.null@REDACTED Fri Apr 18 14:27:55 2014 From: define.null@REDACTED (Defnull) Date: Fri, 18 Apr 2014 05:27:55 -0700 (PDT) Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: References: Message-ID: <35e752d0-6c56-47e7-8371-5039c1ac6b77@googlegroups.com> May be http://ferd.github.io/recon/recon_alloc.html will help to dig more into the problem ???????, 18 ?????? 2014 ?., 14:51:22 UTC+4 ???????????? Max Lapshin ???????: > > I've released next version of our streaming server erlyvideo on R17 and we > see something, perhaps memory leak on production. > > > (flus...@REDACTED )4> erlang:memory(total). > 2184313496 > > > 2GB is a very moderate consumption, so no problem here. > > top shows that beam.smp is using 6.6g of RES memory. > > No custom-made drivers are used on this machine and only one nif is used. > > > Are there any ways to collect more info? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri Apr 18 14:32:00 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 18 Apr 2014 16:32:00 +0400 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: <35e752d0-6c56-47e7-8371-5039c1ac6b77@googlegroups.com> References: <35e752d0-6c56-47e7-8371-5039c1ac6b77@googlegroups.com> Message-ID: recon_alloc:memory(allocated) shows the same output as erlang:memory(total): 2gb, while it is 8 gb already. recon_alloc:memory(usage) tells about 85% of utilization. -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri Apr 18 14:32:33 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 18 Apr 2014 16:32:33 +0400 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: References: <35e752d0-6c56-47e7-8371-5039c1ac6b77@googlegroups.com> Message-ID: When I revert to R16, memory don't leak. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Fri Apr 18 14:33:53 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Fri, 18 Apr 2014 08:33:53 -0400 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: References: Message-ID: <20140418123352.GA68518@ferdair.local> Try recon (https://github.com/ferd/recon), more specifically, the recon_alloc module (http://ferd.github.io/recon/recon_alloc.html) 1. Check `recon_alloc:memory(usage)' -- this is equivalent to the same function being called with `used' and `allocated' and dividing them. This will tell you if the memory that the VM knows about matches what the OS reports[1] If the `allocated' value for `recon_alloc:memory(usage)' matches what the OS sees, then your leak is at least not likely to be related to bad driver or ERTS code (it's been put inside the util_allocs they needed to put it in), which at least restricts the possible avenues. 2. Call `recon_alloc:memory(allocated_types)' to see which type of util allocator (eheap, binary, ets, etc.) is allocating the most memory. See if one looks like an obvious culprit when you compare the results with `erlang:memory()'. 3. Call `recon_alloc:fragmentation(current)' to see a list of under-used util allocators. The returned results are sorted by a weight system that is somewhat likely to return the most fragmented allocators first, based on their percentage of use and the total size of the carriers, for both sbcs and mbcs. If you see very low ratios, see if they differ when calling `recon_alloc:fragmentation(max)', which should show what the usage patterns were like under your max memory load. If there is a big difference, you may be having issues with memory fragmentation, and tweaking your options[2] may help Hopefully that will help. [1]: `recon:set_unit(byte | kilobyte | megabyte | gigabyte)' will let you change the unit reported by all functions of this module. [2]: These options are described at http://erlang.org/doc/man/erts_alloc.html And I tried to make a visual explanation as part of this blog post: https://blog.heroku.com/archives/2013/11/7/logplex-down-the-rabbit-hole Regards, Fred. On 04/18, Max Lapshin wrote: > I've released next version of our streaming server erlyvideo on R17 and we > see something, perhaps memory leak on production. > > > (flussonic@REDACTED)4> erlang:memory(total). > 2184313496 > > > 2GB is a very moderate consumption, so no problem here. > > top shows that beam.smp is using 6.6g of RES memory. > > No custom-made drivers are used on this machine and only one nif is used. > > > Are there any ways to collect more info? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From alcosholik@REDACTED Fri Apr 18 15:50:36 2014 From: alcosholik@REDACTED (Alexei Sholik) Date: Fri, 18 Apr 2014 16:50:36 +0300 Subject: [erlang-questions] Any reason not to have a string:replace? In-Reply-To: References: Message-ID: Because re is dog-slow compared to simple string operations. See https://github.com/elixir-lang/elixir/pull/1188#issuecomment-18932390 On Tue, Apr 8, 2014 at 7:10 PM, Sean Cribbs wrote: > Why not use re:replace/3,4? > > http://www.erlang.org/doc/man/re.html#replace-4 > > > On Tue, Apr 8, 2014 at 10:52 AM, David Welton wrote: > >> It would be convenient to have something like binary:replace, but for >> strings. >> >> I'd be happy to try to put together a pull request that does this, >> although I'd likely need some help with the finer points of what >> options to add. >> >> -- >> David N. Welton >> >> http://www.welton.it/davidw/ >> >> http://www.dedasys.com/ >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > > -- > Sean Cribbs > Software Engineer > Basho Technologies, Inc. > http://basho.com/ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Best regards Alexei Sholik -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri Apr 18 16:39:10 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 18 Apr 2014 18:39:10 +0400 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: <20140418123352.GA68518@ferdair.local> References: <20140418123352.GA68518@ferdair.local> Message-ID: (flussonic@REDACTED)1> recon_alloc:memory(usage). 0.8224381620880582 (flussonic@REDACTED)2> recon_alloc:memory(used). 2176478632 (flussonic@REDACTED)3> recon_alloc:memory(allocated). 2631460448 but Mem: 32913744k total, 32591876k used, 321868k free, 88520k buffers Swap: 33518588k total, 155604k used, 33362984k free, 19466032k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 888 root 20 0 18.2g 10g 4444 S 237 33.7 742:38.90 beam.smp 3318 root 20 0 0 0 0 S 8 0.0 39:31.82 flush-9:127 So beam.smp is eating 10g -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidnwelton@REDACTED Fri Apr 18 17:24:20 2014 From: davidnwelton@REDACTED (David Welton) Date: Fri, 18 Apr 2014 17:24:20 +0200 Subject: [erlang-questions] inet buffer size, sndbuf and rcvbuf Message-ID: Hi, In the inet man page ( http://www.erlang.org/doc/man/inet.html ) it states: > {buffer, Size} > Determines the size of the user-level software buffer used by the driver. Not to be confused with sndbuf and recbuf options which correspond to the kernel socket buffers. It is recommended to have val(buffer) >= max(val(sndbuf),val(recbuf)). In fact, the val(buffer) is automatically set to the above maximum when sndbuf or recbuf values are set. So is there a good reason not to do this when it greatly speeds up performance in some cases? {ok, [{recbuf, RecBufSize}, {sndbuf, SndBufSize}]} = inet:getopts(Sock, [recbuf, sndbuf]), inet:setopts(Sock, [{buffer, max(RecBufSize, SndBufSize)}]), Thanks -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From z@REDACTED Fri Apr 18 18:41:34 2014 From: z@REDACTED (Danil Zagoskin) Date: Fri, 18 Apr 2014 20:41:34 +0400 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: > exception exit: {function_clause, > [{tls_connection,handle_tls_handshake, A script to reproduce this crash and a patch to handle it gently (without leaking internal state full of secrets to user code) can be found at https://gist.github.com/stolen/11053230 2014-04-17 22:04 GMT+04:00 Danil Zagoskin : > Hi! > > Thank you for the patches! > > Meanwhile we have deployed suite selection patch and now there is > something new in crash logs: > =CRASH REPORT==== 17-Apr-2014::20:32:24 === > crasher: > initial call: tls_connection:init/1 > pid: <0.30376.19> > registered_name: [] > exception exit: {function_clause, > [{tls_connection,handle_tls_handshake, > [#Fun,abbreviated, > #state{role = server, > %% LOTS OF STUFF SKIPPED %% > connection_states = #connection_states{ > current_read = %% cipher_suite = > <<0,0>> %% > pending_read = %% cipher_suite > = <<0,51>> %% > } > protocol_buffers = #protocol_buffers{ > tls_packets = [], > tls_handshake_buffer = > <<92,64,37,228,209,208,235,232,47,69,57,232,90,106, ..... >> > %% SKIPPED %%}, > tls_handshake_history = { > [ > > [20,<<0,0,12>>,<<111,40,244,7,137,224,16,109,197,110,249,152>>], > > [2,<<0,0,70>>,<<3,2,83,80,2,23,175,124,25,138,178,243,166,22, > > 150,239,220,170,215,108,54,169,67,79,124,183, > > 189,89,35,239,244,87,102,19,32,11,15,20,173,67, > > 209,70,180,252,109,228,108,60,203,91,126,77,12, > > 231,203,43,221,11,234,147,28,231,91,18,49,228, > 70,0,51,0>>], > > <<1,0,0,141,3,2,83,80,4,31,206,23,107,223,241,244, > > 164,4,198,176,44,155,63,58,157,103,95,44,198,83, > > 237,110,165,99,242,190,122,83,32,11,15,20,173, > > 67,209,70,180,252,109,228,108,60,203,91,126,77, > > 12,231,203,43,221,11,234,147,28,231,91,18,49, > > 228,70,0,36,0,51,0,69,0,57,0,136,0,22,0,50,0,68, > > 0,56,0,135,0,19,0,102,0,47,0,65,0,53,0,132,0,10, > > 0,5,0,4,1,0,0,32,0,9,0,3,2,0,1,0,0,0,21,0,19,0, > > 0,16,119,101,98,100,97,118,46,121,97,110,100, > > 101,120,46,114,117>> > ], > [..........] > }, > %% LOTS OF STUFF SKIPPED %% > }], > [{file,"tls_connection.erl"},{line,735}]}, > {tls_connection,next_state,4, > [{file,"tls_connection.erl"},{line,458}]}, > > {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]}, > {proc_lib,init_p_do_apply,3, > [{file,"proc_lib.erl"},{line,239}]}]} > in function gen_fsm:terminate/7 (gen_fsm.erl, line 622) > > Could that client work with other server implementation? > tls_handshake_buffer seems like a garbage (but I'm not sure), so maybe > here's no valid client lost. > > Should server tolerate such conditions? Should an alert be thrown > when tls_handshake:get_tls_handshake returns {[], _}? > > > Another question about crashes: > Maybe tls_connection is a good place for format_status/2? It may be a good > idea to hide secrets when printing state (otherwise a person which has > access to error logs seems to be able to restore the private key or > decipher dumped traffic). > > > > 2014-04-17 19:04 GMT+04:00 Ingela Andin : > > Hi! >> >> I pushed some more patches to my gitrep on the branches: >> >> ia/ssl/recv/OTP-11878 (error handling of recv on an active socket) >> >> ia/ssl/decrypt-alert (correct decryption alert handling) >> >> Regards Ingela Erlang/OTP team - Ericsson AB >> >> >> >> >> 2014-04-17 11:19 GMT+02:00 Ingela Andin : >> >> Hi Danil! >>> >>> >>> 2014-04-17 8:52 GMT+02:00 Danil Zagoskin : >>> >>> Hi, Ingela! >>>> >>>> The patch works like a charm, thank you! It completely fixes the >>>> initial problem with buggy client. >>>> >>>> >>> One bug down! >>> >>> >>> >>>> >>>> But there are some sad news, too: >>>> >>>> >>> Well reproducible is always good, means we can haunt it down and fix it >>> :) >>> >>> >>> >>>> While playing with my dummy server ( >>>> https://github.com/stolen/ssldump/blob/master/src/ssldump.erl#L70) I >>>> accidentally reproduced badarg in erlang:size once more: >>>> >>>> =ERROR REPORT==== 17-Apr-2014::07:34:58 === >>>> ** State machine <0.58.0> terminating >>>> ** Last message in was {tcp,#Port<0.1498>, >>>> >>>> [22,3,1,0,173,1,0,0,169,3,3,83,79,75,226,78,81,8, >>>> >>>> 77,79,97,154,127,165,92,183,20,239,70,183,158, >>>> >>>> 193,222,139,77,116,13,128,12,66,120,63,110,0,0, >>>> >>>> 94,0,255,192,36,192,35,192,10,192,9,192,7,192,8, >>>> >>>> 192,40,192,39,192,20,192,19,192,17,192,18,192,38, >>>> >>>> 192,37,192,42,192,41,192,5,192,4,192,2,192,3,192, >>>> >>>> 15,192,14,192,12,192,13,0,61,0,60,0,47,0,5,0,4,0, >>>> >>>> 53,0,10,0,103,0,107,0,51,0,57,0,22,0,175,0,174,0, >>>> >>>> 141,0,140,0,138,0,139,0,177,0,176,0,44,0,59,1,0, >>>> >>>> 0,34,0,10,0,8,0,6,0,23,0,24,0,25,0,11,0,2,1,0,0, >>>> 13,0,12,0,10,5,1,4,1,2,1,4,3,2,3]} >>>> (meaningless state omitted) >>>> ** Reason for termination = >>>> ** {badarg,[{erlang,size, >>>> >>>> [[22,3,1,0,173,1,0,0,169,3,3,83,79,75,226,78,81,8,77,79, >>>> >>>> 97,154,127,165,92,183,20,239,70,183,158,193,222,139,77, >>>> >>>> 116,13,128,12,66,120,63,110,0,0,94,0,255,192,36,192,35, >>>> >>>> 192,10,192,9,192,7,192,8,192,40,192,39,192,20,192,19, >>>> >>>> 192,17,192,18,192,38,192,37,192,42,192,41,192,5,192,4, >>>> >>>> 192,2,192,3,192,15,192,14,192,12,192,13,0,61,0,60,0,47, >>>> >>>> 0,5,0,4,0,53,0,10,0,103,0,107,0,51,0,57,0,22,0,175,0, >>>> >>>> 174,0,141,0,140,0,138,0,139,0,177,0,176,0,44,0,59,1,0,0, >>>> >>>> 34,0,10,0,8,0,6,0,23,0,24,0,25,0,11,0,2,1,0,0,13,0,12,0, >>>> 10,5,1,4,1,2,1,4,3,2,3]], >>>> []}, >>>> {tls_record,get_tls_records_aux,2, >>>> [{file,"tls_record.erl"},{line,122}]}, >>>> {tls_connection,next_tls_record,2, >>>> [{file,"tls_connection.erl"},{line,484}]}, >>>> {tls_connection,handle_info,3, >>>> [{file,"tls_connection.erl"},{line,307}]}, >>>> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, >>>> >>>> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} >>>> >>>> The client used was simple curl under mac os, and this crash did not >>>> reproduce. >>>> As you see, the packet received as list instead of binary is >>>> client_hello which is the first message ssl process gets. >>>> Maybe there is some race condition when changing mode on just >>>> transport_accepted socket. >>>> >>>> >>>> >>>> Also, the same server when working with the same curl may stall at this >>>> line: >>>> {ok, _} = ssl:recv(Socket, 0, 10000), >>>> process_info showed that the worker has {ssl,#sslsocket{}, Data} in its >>>> mailbox. >>>> >>>> I've tuned the server to reproduce this stall easier: >>>> https://github.com/stolen/ssldump/blob/b3eebc2fa85ca0bd8ed8470c400b972aa737bffc/src/ssldump.erl(master may change) >>>> >>>> The client is manually invoked curl which is manually interrupted after >>>> sufficiently large time of inactivity. The console log looks like this: >>>> >>>> stolen@REDACTED:~/ssldump$ ./dummyserver.sh 9999 ../cert/pipe.trololo >>>> Erlang/OTP 17 [erts-6.0] [source-07b8f44] [smp:2:2] [async-threads:10] >>>> [hipe] [kernel-poll:false] >>>> >>>> Eshell V6.0 (abort with ^G) >>>> 1> Accepting SSL in <0.46.0> >>>> Socket state: connection, options: {socket_options,list,0,0,0,true} >>>> >>>> =ERROR REPORT==== 17-Apr-2014::09:08:01 === >>>> Error in process <0.46.0> with exit value: >>>> {{badmatch,{error,timeout}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} >>>> >>>> Accepting SSL in <0.47.0> >>>> Socket state: connection, options: {socket_options,binary,0,0,0,false} >>>> Accepting SSL in <0.48.0> >>>> Socket state: connection, options: {socket_options,binary,0,0,0,false} >>>> Accepting SSL in <0.51.0> >>>> Socket state: connection, options: {socket_options,list,0,0,0,true} >>>> >>>> =ERROR REPORT==== 17-Apr-2014::09:09:17 === >>>> Error in process <0.51.0> with exit value: >>>> {{badmatch,{error,closed}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} >>>> >>>> Accepting SSL in <0.53.0> >>>> Socket state: connection, options: {socket_options,binary,0,0,0,false} >>>> Accepting SSL in <0.55.0> >>>> Socket state: connection, options: {socket_options,binary,0,0,0,false} >>>> Accepting SSL in <0.57.0> >>>> Socket state: connection, options: {socket_options,list,0,0,0,true} >>>> >>>> =ERROR REPORT==== 17-Apr-2014::09:11:26 === >>>> Error in process <0.57.0> with exit value: >>>> {{badmatch,{error,closed}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} >>>> >>>> >>>> My interpretation: >>>> - Given pool size X, the first of each X requests fails. >>>> - First of failing requests catches timeout as expected, other ones >>>> just stall. >>>> - Failing requests have emulated options [{mode, list}, {active, >>>> true}] while working ones have the opposite [{mode, binary}, {active, >>>> false}]. >>>> >>>> After couple of further experiments I discovered that only every (X*N + >>>> 1)th acceptor inherits listening socket options, other ones always have >>>> [{mode, binary}, {active, false}]. >>>> >>>> >>>> >>> Humm... I am not sure if this is what happens in your case but the >>> following should fix a potential inheritance problem >>> >>> diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl >>> index 743753b..7768bbb 100644 >>> --- a/lib/ssl/src/ssl.erl >>> +++ b/lib/ssl/src/ssl.erl >>> @@ -187,6 +187,7 @@ transport_accept(#sslsocket{pid = {ListenSocket, >>> {error, Reason} >>> end; >>> {error, Reason} -> >>> + ok = ssl_socket:setopts(Transport, ListenSocket, SocketValues), >>> {error, Reason} >>> end. >>> >>> >>> >>> >>>> And, apart from eventual option inheritance, shouldn't ssl:recv on >>>> active socket return {error, einval} like gen_tcp:recv does? >>>> >>>> >>>> >>> I think it should. >>> >>> >>> Regards Ingela Erlang/OTP Team Ericssson AB >>> >>> >>> >>> >>> >>>> 2014-04-16 19:36 GMT+04:00 Ingela Andin : >>>> >>>> Hi! >>>>> >>>>> 2014-04-16 15:56 GMT+02:00 Danil Zagoskin : >>>>> >>>>> Thank you for the patch. I'll check it. >>>>>> >>>>> >>>>> >>>>> New patch, better tested ;), on branch >>>>> ia/ssl/user-suites-match-negotiated-version at >>>>> https://github.com/IngelaAndin/otp >>>>> >>>>> >>>>>> >>>>>> (Style question: is lists:filtermap better than list comprehension?) >>>>>> >>>>> >>>>> >>>>> I think just a matter of taste! >>>>> >>>>> >>>>>> > #ssl_options{] is an internal representation of the proplists >>>>>> input list and should not be a visible in the API, records are generally >>>>>> not a good API choice as they enforce compile time dependencies. >>>>>> >>>>>> Yes, I understand that. I wanted to start broken client to see how >>>>>> server would work with it. >>>>>> The option to do that could be using sys:replace_state, but as far as >>>>>> I understand the code, client_hello is sent immediately after starting a >>>>>> process, so it seems there is no way to send crafted hello and continue >>>>>> handshake with couple of lines instead of ssl:connect. >>>>>> >>>>>> Given that possibility it could be much easier to reproduce server >>>>>> crashes when working with buggy clients. >>>>>> For example, How do I write a test for badmatch in tls_record:decode_cipher_text? >>>>>> The function takes #connection_states{}, and creating that record >>>>>> relies on #ssl_options{} which cannot be created without opening a >>>>>> socket and calling gen_fsm:enter_loop. >>>>>> >>>>>> >>>>> Yes you have a good point. I do not have a good short answer. >>>>> Testing error cases especially when the protocol sometimes >>>>> tries to hide the real error reason due to security issues and >>>>> shortcutting the API and creating raw protocol command is not trivial. >>>>> >>>>> Regards Ingela Erlang/OTP team - Ericsson AB >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>> >>>>>> 2014-04-16 17:07 GMT+04:00 Ingela Andin : >>>>>> >>>>>> Hi! >>>>>>> >>>>>>> 2014-04-16 0:07 GMT+02:00 Danil Zagoskin : >>>>>>> >>>>>>> Hi, Ingela. >>>>>>>> >>>>>>>> I finally had some time for investigating this problem. >>>>>>>> >>>>>>>> I didn't see badarg in erlang:size again, but it definitely >>>>>>>> appeared in 17.0 with simple accept method described as minimal example at >>>>>>>> http://www.erlang.org/doc/apps/ssl/using_ssl.html ( >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>> the difference was transport_accept and ssl_accept were run in >>>>>>>> separate process) >>>>>>>> >>>>>>> >>>>>>> That should be ok, you are suppose to be able to do that. >>>>>>> >>>>>>> >>>>>>> >>>>>>>> Today I met some new crash: >>>>>>>> ** {{badmatch,{alert,2,20,{"ssl_cipher.erl",215}}}, >>>>>>>> >>>>>>>> [{tls_record,decode_cipher_text,2,[{file,"tls_record.erl"},{line,157}]}, >>>>>>>> >>>>>>>> {tls_connection,next_record,1,[{file,"tls_connection.erl"},{line,503}]}, >>>>>>>> >>>>>>>> {tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,475}]}, >>>>>>>> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, >>>>>>>> >>>>>>>> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} >>>>>>>> >>>>>>>> That's because ssl_record:decipher/3 may return #alert{}, but >>>>>>>> tls_record:decode_cipher_text/2 isn't expecting that. >>>>>>>> >>>>>>>> >>>>>>> Hum, looks like a bug. We will look into that. >>>>>>> >>>>>>> >>>>>>>> >>>>>>>> As for {case_clause,{4}} in ssl_v3:mac_hash/3 I found that >>>>>>>> precondition for crash is easily reproducible: >>>>>>>> https://gist.github.com/stolen/10780653 >>>>>>>> Ordinary servers negotiate with sha hash or close socket while ssl >>>>>>>> in 17.0 negotiates with sha256 hash. >>>>>>>> I don't know the protocol good enough to perform further states, >>>>>>>> but I hope this helps. >>>>>>>> >>>>>>>> >>>>>>> Okej, the following patch should take care of that problem. >>>>>>> >>>>>>> diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl >>>>>>> index 743753b..093d4af 100644 >>>>>>> --- a/lib/ssl/src/ssl.erl >>>>>>> +++ b/lib/ssl/src/ssl.erl >>>>>>> @@ -953,8 +953,8 @@ handle_cipher_option(Value, Version) when >>>>>>> is_list(Value) -> >>>>>>> error:_-> >>>>>>> throw({error, {options, {ciphers, Value}}}) >>>>>>> end. >>>>>>> -binary_cipher_suites(Version, []) -> %% Defaults to all supported >>>>>>> suits >>>>>>> - ssl_cipher:suites(Version); >>>>>>> +binary_cipher_suites(Version, []) -> >>>>>>> + []; >>>>>>> binary_cipher_suites(Version, [{_,_,_,_}| _] = Ciphers0) -> %% >>>>>>> Backwards compatibility >>>>>>> Ciphers = [{KeyExchange, Cipher, Hash} || {KeyExchange, Cipher, >>>>>>> Hash, _} <- Ciphers0], >>>>>>> binary_cipher_suites(Version, Ciphers); >>>>>>> diff --git a/lib/ssl/src/ssl_handshake.erl >>>>>>> b/lib/ssl/src/ssl_handshake.erl >>>>>>> index 1108edc..93d4efd 100644 >>>>>>> --- a/lib/ssl/src/ssl_handshake.erl >>>>>>> +++ b/lib/ssl/src/ssl_handshake.erl >>>>>>> @@ -1017,11 +1017,14 @@ decode_suites('3_bytes', Dec) -> >>>>>>> %%-------------Cipeher suite handling >>>>>>> -------------------------------- >>>>>>> >>>>>>> available_suites(UserSuites, Version) -> >>>>>>> + VersionSupportedSuites = ssl_cipher:suites(Version), >>>>>>> case UserSuites of >>>>>>> [] -> >>>>>>> - ssl_cipher:suites(Version); >>>>>>> + VersionSupportedSuites; >>>>>>> _ -> >>>>>>> - UserSuites >>>>>>> + lists:filtermap(fun(Suite) -> >>>>>>> + lists:member(Suite, VersionSupportedSuites) >>>>>>> + end, UserSuites) >>>>>>> end. >>>>>>> >>>>>>> available_suites(ServerCert, UserSuites, Version, Curve) -> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>> Unfortunately, I don't understand how this code should be tested ? >>>>>>>> most of functions require #state{} or #connection_states{} which require >>>>>>>> #ssl_options{} and other stuff, and at I have found no exported function >>>>>>>> creating #ssl_options{} without side-effects. >>>>>>>> >>>>>>> >>>>>>> #ssl_options{] is an internal representation of the proplists input >>>>>>> list and should not be a visible in the API, records are generally not a >>>>>>> good API choice as they enforce compile time dependencies. >>>>>>> >>>>>>> >>>>>>> Regards Ingela - Erlang/OTP team - Ericsson AB >>>>>>> >>>>>>> >>>>>>> >>>>>>>> >>>>>>>> 2014-04-15 16:52 GMT+04:00 Ingela Andin : >>>>>>>> >>>>>>>> Hello again! >>>>>>>>> >>>>>>>>> >>>>>>>>>> sometimes badarg in >>>>>>>>>> erlang:size([22,3,1,0,158,1,0,0,154,3,1,83,74|...]) at tls_record.erl:122. >>>>>>>>>> >>>>>>>>> >>>>>>>>> Same symptom was recently reported on erlang-bugs and it turned >>>>>>>>> out to be due to upgrading a gen_tcp socket in active mode. When upgrading >>>>>>>>> a gen_tcp socket to an ssl socket it must be put in passive mode ({active, >>>>>>>>> false}) before the client >>>>>>>>> is allowed to start the handshake. Normaly if the upgrade is >>>>>>>>> negotiated this is not a problem for the server to set the option >>>>>>>>> before signaling to the client to go ahead with the handshake. If >>>>>>>>> the upgrade is only performed on the server side instead of calling the ssl >>>>>>>>> API ( some people may do that due to the previously lack of possibility to >>>>>>>>> specify ssl options when calling ssl:ssl_accept with an "sslsocket", this >>>>>>>>> is no longer the case in 17.0) the listen socket needs to be put in passive >>>>>>>>> mode (listen options are inherited by the acceptsocket) to make sure that >>>>>>>>> the it will work, otherwhise it will work sometimes and sometime result in >>>>>>>>> the error above. >>>>>>>>> >>>>>>>>> Regards Ingela Erlang/OTP team - Ericsson AB >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Danil Zagoskin | z@REDACTED >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Danil Zagoskin | z@REDACTED >>>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Danil Zagoskin | z@REDACTED >>>> >>> >>> >> > > > -- > Danil Zagoskin | z@REDACTED > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From ransomr@REDACTED Sat Apr 19 02:48:19 2014 From: ransomr@REDACTED (Ransom Richardson) Date: Sat, 19 Apr 2014 00:48:19 +0000 Subject: [erlang-questions] HTTPC doesn't do HTTPS validation Message-ID: <3251a0223f05492fad565ccd05f88dee@BL2PR08MB002.namprd08.prod.outlook.com> I set up a local test server, that has a cert signed by my own self-signed CA cert. Also the CN in the cert is not local host. As expected, curl doesn't like this: talko@REDACTED:~/dev/httpcbench$ curl https://localhost:8443/delay curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed talko@REDACTED:~/dev/httpcbench$ curl --cacert priv/ssl/rootCA.pem https://localhost:8443/delay curl: (51) SSL: certificate subject name 'httpcbench server' does not match target host name 'localhost' However httpc doesn't complain, despite not having the CA cert: 3> httpc:request("https://localhost:8443/delay"). {ok,{{"HTTP/1.1",200,"OK"}, [{"connection","keep-alive"}, {"date","Sat, 19 Apr 2014 00:31:56 GMT"}, {"server","Cowboy"}, {"content-length","0"}], []}} And even if I tell it to verify the peer, it doesn't complain that the host name doesn't match the cert: 6> httpc:request(get, {"https://localhost:8443/delay", []}, [{ssl, [{verify, verify_peer}, {cacertfile, "./priv/ssl/rootCA.pem"}]}], []). {ok,{{"HTTP/1.1",200,"OK"}, [{"connection","keep-alive"}, {"date","Sat, 19 Apr 2014 00:36:09 GMT"}, {"server","Cowboy"}, {"content-length","0"}], []}} I actually noticed this when trying to test hackney, which has the same behavior as httpc. Does anyone know if any of the many other http clients out there do any HTTPS validation? thanks, Ransom ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Sat Apr 19 05:06:29 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sat, 19 Apr 2014 05:06:29 +0200 Subject: [erlang-questions] HTTPC doesn't do HTTPS validation In-Reply-To: <3251a0223f05492fad565ccd05f88dee@BL2PR08MB002.namprd08.prod.outlook.com> References: <3251a0223f05492fad565ccd05f88dee@BL2PR08MB002.namprd08.prod.outlook.com> Message-ID: On Sat, Apr 19, 2014 at 2:48 AM, Ransom Richardson wrote: > I set up a local test server, that has a cert signed by my own > self-signed CA cert. Also the CN in the cert is not local host. As > expected, curl doesn't like this: > > > talko@REDACTED:~/dev/httpcbench$ curl https://localhost:8443/delay > curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: > error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify > failed > > talko@REDACTED:~/dev/httpcbench$ curl --cacert priv/ssl/rootCA.pem > https://localhost:8443/delay > curl: (51) SSL: certificate subject name 'httpcbench server' does not > match target host name 'localhost' > > However httpc doesn't complain, despite not having the CA cert: > > 3> httpc:request("https://localhost:8443/delay"). > {ok,{{"HTTP/1.1",200,"OK"}, > [{"connection","keep-alive"}, > {"date","Sat, 19 Apr 2014 00:31:56 GMT"}, > {"server","Cowboy"}, > {"content-length","0"}], > []}} > > And even if I tell it to verify the peer, it doesn't complain that the > host name doesn't match the cert: > > 6> httpc:request(get, {"https://localhost:8443/delay", []}, [{ssl, > [{verify, verify_peer}, {cacertfile, "./priv/ssl/rootCA.pem"}]}], []). > {ok,{{"HTTP/1.1",200,"OK"}, > [{"connection","keep-alive"}, > {"date","Sat, 19 Apr 2014 00:36:09 GMT"}, > {"server","Cowboy"}, > {"content-length","0"}], > []}} > > I actually noticed this when trying to test hackney, which has the same > behavior as httpc. > > Does anyone know if any of the many other http clients out there do any > HTTPS validation? > > > I don't know for httpc but hackney doesn't pass any default option to the ssl socket when you connect in HTTPS. Except if you pass the insecure option to the request (which provides the same feature you find in curl). - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From ransomr@REDACTED Sat Apr 19 06:02:47 2014 From: ransomr@REDACTED (Ransom Richardson) Date: Sat, 19 Apr 2014 04:02:47 +0000 Subject: [erlang-questions] HTTPC doesn't do HTTPS validation In-Reply-To: References: <3251a0223f05492fad565ccd05f88dee@BL2PR08MB002.namprd08.prod.outlook.com>, Message-ID: What I am seeing is that it is insecure by default (both httpc and hackney). I also don't see a way to make it secure. Is there an option that I can pass that will cause it to validate that the cert matches the host? Is there an easier way to turn on validation than passing [{validate, validate_peer}, {cacertfile, ...}] on every request? It never even occurred to me that an http client would be insecure by default when connecting over https. thanks, Ransom ________________________________ From: Benoit Chesneau Sent: Friday, April 18, 2014 11:06 PM To: Ransom Richardson Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] HTTPC doesn't do HTTPS validation On Sat, Apr 19, 2014 at 2:48 AM, Ransom Richardson > wrote: I set up a local test server, that has a cert signed by my own self-signed CA cert. Also the CN in the cert is not local host. As expected, curl doesn't like this: talko@REDACTED:~/dev/httpcbench$ curl https://localhost:8443/delay curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed talko@REDACTED:~/dev/httpcbench$ curl --cacert priv/ssl/rootCA.pem https://localhost:8443/delay curl: (51) SSL: certificate subject name 'httpcbench server' does not match target host name 'localhost' However httpc doesn't complain, despite not having the CA cert: 3> httpc:request("https://localhost:8443/delay"). {ok,{{"HTTP/1.1",200,"OK"}, [{"connection","keep-alive"}, {"date","Sat, 19 Apr 2014 00:31:56 GMT"}, {"server","Cowboy"}, {"content-length","0"}], []}} And even if I tell it to verify the peer, it doesn't complain that the host name doesn't match the cert: 6> httpc:request(get, {"https://localhost:8443/delay", []}, [{ssl, [{verify, verify_peer}, {cacertfile, "./priv/ssl/rootCA.pem"}]}], []). {ok,{{"HTTP/1.1",200,"OK"}, [{"connection","keep-alive"}, {"date","Sat, 19 Apr 2014 00:36:09 GMT"}, {"server","Cowboy"}, {"content-length","0"}], []}} I actually noticed this when trying to test hackney, which has the same behavior as httpc. Does anyone know if any of the many other http clients out there do any HTTPS validation? I don't know for httpc but hackney doesn't pass any default option to the ssl socket when you connect in HTTPS. Except if you pass the insecure option to the request (which provides the same feature you find in curl). - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Sat Apr 19 06:08:47 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sat, 19 Apr 2014 06:08:47 +0200 Subject: [erlang-questions] HTTPC doesn't do HTTPS validation In-Reply-To: References: <3251a0223f05492fad565ccd05f88dee@BL2PR08MB002.namprd08.prod.outlook.com> Message-ID: On Sat, Apr 19, 2014 at 6:02 AM, Ransom Richardson wrote: > What I am seeing is that it is insecure by default (both httpc and > hackney). I also don't see a way to make it secure. > There is no such default in hackney: https://github.com/benoitc/hackney/blob/master/src/hackney_connect.erl#L201 > > Is there an option that I can pass that will cause it to validate that > the cert matches the host? > Using the validate_fun function probably. > Is there an easier way to turn on validation than passing [{validate, > validate_peer}, {cacertfile, ...}] on every request? > > > It never even occurred to me that an http client would be insecure by > default when connecting over https. > it isn't. A lot were. - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From ransomr@REDACTED Sat Apr 19 06:17:43 2014 From: ransomr@REDACTED (Ransom Richardson) Date: Sat, 19 Apr 2014 04:17:43 +0000 Subject: [erlang-questions] HTTPC doesn't do HTTPS validation In-Reply-To: References: <3251a0223f05492fad565ccd05f88dee@BL2PR08MB002.namprd08.prod.outlook.com> , Message-ID: <8fcd78e1f87b4f4eb4f0e206fa226293@BL2PR08MB002.namprd08.prod.outlook.com> But as I reported in this issue https://github.com/benoitc/hackney/issues/101 I tested against a server with an invalid cert, and hackney did not catch the error. httpc also returned ok. 1> hackney:get(<<"https://localhost:8443/delay">>, [], <<>>, []). {ok,200, [{<<"connection">>,<<"keep-alive">>}, {<<"server">>,<<"Cowboy">>}, {<<"date">>,<<"Sat, 19 Apr 2014 00:00:26 GMT">>}, {<<"content-length">>,<<"0">>}], #Ref<0.0.0.111>} The same happens if I pass validate_peer and the rootCA file as ssl_options. curl correctly rejects the server: talko@REDACTED:~/dev/httpcbench$ curl https://localhost:8443/delay curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed talko@REDACTED:~/dev/httpcbench$ curl --cacert priv/ssl/rootCA.pem https://localhost:8443/delay curl: (51) SSL: certificate subject name 'httpcbench server' does not match target host name 'localhost' This is using Erlang 17.0. Is it possible that the ssl default changed? Or am I doing something wrong? The server I'm testing against is in this repo: https://github.com/talko/httpcbench. It's a work in progress, but if you pull, make and run_server you should see the same issue. thanks, Ransom ________________________________ From: Benoit Chesneau Sent: Saturday, April 19, 2014 12:08 AM To: Ransom Richardson Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] HTTPC doesn't do HTTPS validation On Sat, Apr 19, 2014 at 6:02 AM, Ransom Richardson > wrote: What I am seeing is that it is insecure by default (both httpc and hackney). I also don't see a way to make it secure. There is no such default in hackney: https://github.com/benoitc/hackney/blob/master/src/hackney_connect.erl#L201 Is there an option that I can pass that will cause it to validate that the cert matches the host? Using the validate_fun function probably. Is there an easier way to turn on validation than passing [{validate, validate_peer}, {cacertfile, ...}] on every request? It never even occurred to me that an http client would be insecure by default when connecting over https. it isn't. A lot were. - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Sat Apr 19 06:31:09 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sat, 19 Apr 2014 06:31:09 +0200 Subject: [erlang-questions] HTTPC doesn't do HTTPS validation In-Reply-To: <8fcd78e1f87b4f4eb4f0e206fa226293@BL2PR08MB002.namprd08.prod.outlook.com> References: <3251a0223f05492fad565ccd05f88dee@BL2PR08MB002.namprd08.prod.outlook.com> <8fcd78e1f87b4f4eb4f0e206fa226293@BL2PR08MB002.namprd08.prod.outlook.com> Message-ID: On Sat, Apr 19, 2014 at 6:17 AM, Ransom Richardson wrote: > But as I reported in this issue > https://github.com/benoitc/hackney/issues/101 I tested against a server > with an invalid cert, and hackney did not catch the error. httpc also > returned ok. > > > 1> hackney:get(<<"https://localhost:8443/delay">>, [], <<>>, []). > {ok,200, > [{<<"connection">>,<<"keep-alive">>}, > {<<"server">>,<<"Cowboy">>}, > {<<"date">>,<<"Sat, 19 Apr 2014 00:00:26 GMT">>}, > {<<"content-length">>,<<"0">>}], > #Ref<0.0.0.111>} > > The same happens if I pass validate_peer and the rootCA file as > ssl_options. > > > curl correctly rejects the server: > > > talko@REDACTED:~/dev/httpcbench$ curl https://localhost:8443/delay > curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: > error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed > > talko@REDACTED:~/dev/httpcbench$ curl --cacert priv/ssl/rootCA.pem https://localhost:8443/delay > curl: (51) SSL: certificate subject name 'httpcbench server' does not match target host name 'localhost' > > > This is using Erlang 17.0. Is it possible that the ssl default changed? > > > Or am I doing something wrong? > > > The server I'm testing against is in this repo: > https://github.com/talko/httpcbench. It's a work in progress, but if you > pull, make and run_server you should see the same issue. > > > thanks, > > Ransom > > > hrm looks like the default is verify_none: https://github.com/erlang/otp/blob/maint/lib/ssl/src/ssl.erl#L594 But it's early in the morning and I need more cafe, so... - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlsson.richard@REDACTED Sat Apr 19 13:39:26 2014 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Sat, 19 Apr 2014 13:39:26 +0200 Subject: [erlang-questions] erl_syntax[_lib] error handling In-Reply-To: References: Message-ID: <5352606E.7080108@gmail.com> On 2014-02-24 21:21 , Tuncer Ayaz wrote: > erl_syntax and erl_syntax_lib seem to favor throwing exceptions over > returning error terms. I found this hard to use due to the missing > documenation of what exceptions can be thrown by each function. Only > erl_syntax_lib:analyze_application/1 documents one exception it might > throw, and the documentation for other funs just states the following: > "An exception is thrown if..." > > The only way to handle erl_syntax[_lib] errors I've seen so far is to > catch all exceptions, but that can filter/suppress any kind of > exception. > > What's the recommended way to handle erl_syntax[_lib] errors? Hi Tuncer. erl_syntax does not try to be systematic about what kind of exception gets generated when the input is bad; that would probably make the code grow by 50% In general, it will be a function_clause, case_clause or badmatch, but there's no good way of separating these from an actual bug in erl_syntax. The intended way to use erl_syntax with unknown input is to use the type/1 function (throws badarg error if it's not a valid AST) and predicates like is_atom/1 to test the input before trying to deconstruct it. /Richard From n.oxyde@REDACTED Sat Apr 19 13:51:43 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sat, 19 Apr 2014 13:51:43 +0200 Subject: [erlang-questions] erl_syntax[_lib] error handling In-Reply-To: <5352606E.7080108@gmail.com> References: <5352606E.7080108@gmail.com> Message-ID: <29E2AD0F-BDA1-435A-B296-965E7D36A9CF@gmail.com> I think the defensive programming in syntax_tools should be removed entirely. How revert/1 manages to sometimes return custom nodes as is but sometimes crash and sometimes return the actual reverted node drives me insane. -- Anthony Ramine Le 19 avr. 2014 ? 13:39, Richard Carlsson a ?crit : > On 2014-02-24 21:21 , Tuncer Ayaz wrote: >> erl_syntax and erl_syntax_lib seem to favor throwing exceptions over >> returning error terms. I found this hard to use due to the missing >> documenation of what exceptions can be thrown by each function. Only >> erl_syntax_lib:analyze_application/1 documents one exception it might >> throw, and the documentation for other funs just states the following: >> "An exception is thrown if..." >> >> The only way to handle erl_syntax[_lib] errors I've seen so far is to >> catch all exceptions, but that can filter/suppress any kind of >> exception. >> >> What's the recommended way to handle erl_syntax[_lib] errors? > > Hi Tuncer. erl_syntax does not try to be systematic about what kind of exception gets generated when the input is bad; that would probably make the code grow by 50% In general, it will be a function_clause, case_clause or badmatch, but there's no good way of separating these from an actual bug in erl_syntax. The intended way to use erl_syntax with unknown input is to use the type/1 function (throws badarg error if it's not a valid AST) and predicates like is_atom/1 to test the input before trying to deconstruct it. > > /Richard > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From carlsson.richard@REDACTED Sat Apr 19 13:57:09 2014 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Sat, 19 Apr 2014 13:57:09 +0200 Subject: [erlang-questions] erl_syntax[_lib] error handling In-Reply-To: <29E2AD0F-BDA1-435A-B296-965E7D36A9CF@gmail.com> References: <5352606E.7080108@gmail.com> <29E2AD0F-BDA1-435A-B296-965E7D36A9CF@gmail.com> Message-ID: <53526495.5040707@gmail.com> On 2014-04-19 13:51 , Anthony Ramine wrote: > I think the defensive programming in syntax_tools should be removed entirely. You might have misunderstood - my point was that there isn't any defensive programming in there. Hence, if you feed it invalid input, you can't be sure what the resulting exception will be, if any. > How revert/1 manages to sometimes return custom nodes as is but sometimes crash and sometimes return the actual reverted node drives me insane. That's a different issue. When I originally wrote erl_syntax, it seemed best to pass through anything that couldn't be handled, since the format was more or less undocumented in those days. That could probably be changed now. /Richard From n.oxyde@REDACTED Sat Apr 19 14:53:39 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sat, 19 Apr 2014 14:53:39 +0200 Subject: [erlang-questions] erl_syntax[_lib] error handling In-Reply-To: <53526495.5040707@gmail.com> References: <5352606E.7080108@gmail.com> <29E2AD0F-BDA1-435A-B296-965E7D36A9CF@gmail.com> <53526495.5040707@gmail.com> Message-ID: The defensive programming I was talking about was that revert/1 tries to not crash on weird input, sorry if that was not clear. -- Anthony Ramine Le 19 avr. 2014 ? 13:57, Richard Carlsson a ?crit : > On 2014-04-19 13:51 , Anthony Ramine wrote: >> I think the defensive programming in syntax_tools should be removed entirely. > > You might have misunderstood - my point was that there isn't any defensive programming in there. Hence, if you feed it invalid input, you can't be sure what the resulting exception will be, if any. > >> How revert/1 manages to sometimes return custom nodes as is but sometimes crash and sometimes return the actual reverted node drives me insane. > > That's a different issue. When I originally wrote erl_syntax, it seemed best to pass through anything that couldn't be handled, since the format was more or less undocumented in those days. That could probably be changed now. > > /Richard > From tuncer.ayaz@REDACTED Sat Apr 19 16:27:08 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sat, 19 Apr 2014 16:27:08 +0200 Subject: [erlang-questions] erl_syntax[_lib] error handling In-Reply-To: <5352606E.7080108@gmail.com> References: <5352606E.7080108@gmail.com> Message-ID: On Sat, Apr 19, 2014 at 1:39 PM, Richard Carlsson wrote: > On 2014-02-24 21:21 , Tuncer Ayaz wrote: > > > > erl_syntax and erl_syntax_lib seem to favor throwing exceptions > > over returning error terms. I found this hard to use due to the > > missing documenation of what exceptions can be thrown by each > > function. Only erl_syntax_lib:analyze_application/1 documents one > > exception it might throw, and the documentation for other funs > > just states the following: "An exception is thrown if..." > > > > The only way to handle erl_syntax[_lib] errors I've seen so far is > > to catch all exceptions, but that can filter/suppress any kind of > > exception. > > > > What's the recommended way to handle erl_syntax[_lib] errors? > > > Hi Tuncer. erl_syntax does not try to be systematic about what kind > of exception gets generated when the input is bad; that would > probably make the code grow by 50% In general, it will be a > function_clause, case_clause or badmatch, but there's no good way of > separating these from an actual bug in erl_syntax. The intended way > to use erl_syntax with unknown input is to use the type/1 function > (throws badarg error if it's not a valid AST) and predicates like > is_atom/1 to test the input before trying to deconstruct it. I see. We'll eventually have to revisit rebar_erlc_compiler's use[1] of erl_syntax[_lib], so I've been looking for ways to parse differently or not suppress all exceptions. [1] https://github.com/rebar/rebar/blob/8edaa08b/src/rebar_erlc_compiler.erl#L653-L661 From jesper.louis.andersen@REDACTED Sat Apr 19 22:30:07 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sat, 19 Apr 2014 22:30:07 +0200 Subject: [erlang-questions] [ANN] Fuse release 1.0.0 Message-ID: Fuse is an application which implements the so-called circuit-breaker pattern for Erlang. The goal is to "do it right?" by having ample amounts of documentation, proper EDoc, a tutorial, proper instrumentation, alarm_handlers, event hookup points, and a CT test suite with good base coverage. A circuit breaker is used to guard against cascading subsystem failure in a larger project. If a subsystem fails, the circuit breaker opens. Rather than calling the failing subsystem, we just return immediately with information about the circuit breaker being open. The consequences are: * No resource buildup due to timeouts * Low latency in responses * The ability to act differently when we know the system is not merely slow, but failing. After a while, the circuit automatically heals. Because fuse will be critical infrastructure it comes with full Quviq Quickcheck models which tests all possible concurrent interleavings through the PULSE scheduler. Thomas Arts has been helpful with lots of small hints on how to make this work out. The only thing you have to trust is that erlang:send_after/3 works as intended. As part of the development, millions of sequential and parallel invocations were run. While this does not guarantee no bugs, the bar has been set considerably higher than in most other projects. More is in the projects README.md file: https://github.com/jlouis/fuse As well as all the background information and such. Issues and Patches are very welcome! -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Sun Apr 20 01:52:35 2014 From: z@REDACTED (Danil Zagoskin) Date: Sun, 20 Apr 2014 03:52:35 +0400 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: Hello again! function_clause in tls_connection:handle_tls_handshake is fixed in this PR: https://github.com/erlang/otp/pull/339 One more crash (badarg in crypto:sign) is fixed in that PR: https://github.com/erlang/otp/pull/340 For other ssl users: these two patches with two Ingela's patches: - https://github.com/IngelaAndin/otp/commit/7f0e683bc483b70f05fa806539bd5c540943dfd0 - https://github.com/IngelaAndin/otp/commit/26082cdd64823ecf92c47188f5a161e5ff2f8660 seem to fix most of ssl server crashes in OTP 17.0. 2014-04-18 20:41 GMT+04:00 Danil Zagoskin : > > exception exit: {function_clause, > > [{tls_connection,handle_tls_handshake, > > A script to reproduce this crash and a patch to handle it gently (without > leaking internal state full of secrets to user code) can be found at > https://gist.github.com/stolen/11053230 > > > 2014-04-17 22:04 GMT+04:00 Danil Zagoskin : > >> Hi! >> >> Thank you for the patches! >> >> Meanwhile we have deployed suite selection patch and now there is >> something new in crash logs: >> =CRASH REPORT==== 17-Apr-2014::20:32:24 === >> crasher: >> initial call: tls_connection:init/1 >> pid: <0.30376.19> >> registered_name: [] >> exception exit: {function_clause, >> [{tls_connection,handle_tls_handshake, >> [#Fun,abbreviated, >> #state{role = server, >> %% LOTS OF STUFF SKIPPED %% >> connection_states = #connection_states{ >> current_read = %% cipher_suite = >> <<0,0>> %% >> pending_read = %% cipher_suite >> = <<0,51>> %% >> } >> protocol_buffers = #protocol_buffers{ >> tls_packets = [], >> tls_handshake_buffer = >> <<92,64,37,228,209,208,235,232,47,69,57,232,90,106, ..... >> >> %% SKIPPED %%}, >> tls_handshake_history = { >> [ >> >> [20,<<0,0,12>>,<<111,40,244,7,137,224,16,109,197,110,249,152>>], >> >> [2,<<0,0,70>>,<<3,2,83,80,2,23,175,124,25,138,178,243,166,22, >> >> 150,239,220,170,215,108,54,169,67,79,124,183, >> >> 189,89,35,239,244,87,102,19,32,11,15,20,173,67, >> >> 209,70,180,252,109,228,108,60,203,91,126,77,12, >> >> 231,203,43,221,11,234,147,28,231,91,18,49,228, >> 70,0,51,0>>], >> >> <<1,0,0,141,3,2,83,80,4,31,206,23,107,223,241,244, >> >> 164,4,198,176,44,155,63,58,157,103,95,44,198,83, >> >> 237,110,165,99,242,190,122,83,32,11,15,20,173, >> >> 67,209,70,180,252,109,228,108,60,203,91,126,77, >> >> 12,231,203,43,221,11,234,147,28,231,91,18,49, >> >> 228,70,0,36,0,51,0,69,0,57,0,136,0,22,0,50,0,68, >> >> 0,56,0,135,0,19,0,102,0,47,0,65,0,53,0,132,0,10, >> >> 0,5,0,4,1,0,0,32,0,9,0,3,2,0,1,0,0,0,21,0,19,0, >> >> 0,16,119,101,98,100,97,118,46,121,97,110,100, >> >> 101,120,46,114,117>> >> ], >> [..........] >> }, >> %% LOTS OF STUFF SKIPPED %% >> }], >> [{file,"tls_connection.erl"},{line,735}]}, >> {tls_connection,next_state,4, >> [{file,"tls_connection.erl"},{line,458}]}, >> >> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]}, >> {proc_lib,init_p_do_apply,3, >> [{file,"proc_lib.erl"},{line,239}]}]} >> in function gen_fsm:terminate/7 (gen_fsm.erl, line 622) >> >> Could that client work with other server implementation? >> tls_handshake_buffer seems like a garbage (but I'm not sure), so maybe >> here's no valid client lost. >> >> Should server tolerate such conditions? Should an alert be thrown >> when tls_handshake:get_tls_handshake returns {[], _}? >> >> >> Another question about crashes: >> Maybe tls_connection is a good place for format_status/2? It may be a >> good idea to hide secrets when printing state (otherwise a person which has >> access to error logs seems to be able to restore the private key or >> decipher dumped traffic). >> >> >> >> 2014-04-17 19:04 GMT+04:00 Ingela Andin : >> >> Hi! >>> >>> I pushed some more patches to my gitrep on the branches: >>> >>> ia/ssl/recv/OTP-11878 (error handling of recv on an active socket) >>> >>> ia/ssl/decrypt-alert (correct decryption alert handling) >>> >>> Regards Ingela Erlang/OTP team - Ericsson AB >>> >>> >>> >>> >>> 2014-04-17 11:19 GMT+02:00 Ingela Andin : >>> >>> Hi Danil! >>>> >>>> >>>> 2014-04-17 8:52 GMT+02:00 Danil Zagoskin : >>>> >>>> Hi, Ingela! >>>>> >>>>> The patch works like a charm, thank you! It completely fixes the >>>>> initial problem with buggy client. >>>>> >>>>> >>>> One bug down! >>>> >>>> >>>> >>>>> >>>>> But there are some sad news, too: >>>>> >>>>> >>>> Well reproducible is always good, means we can haunt it down and fix it >>>> :) >>>> >>>> >>>> >>>>> While playing with my dummy server ( >>>>> https://github.com/stolen/ssldump/blob/master/src/ssldump.erl#L70) I >>>>> accidentally reproduced badarg in erlang:size once more: >>>>> >>>>> =ERROR REPORT==== 17-Apr-2014::07:34:58 === >>>>> ** State machine <0.58.0> terminating >>>>> ** Last message in was {tcp,#Port<0.1498>, >>>>> >>>>> [22,3,1,0,173,1,0,0,169,3,3,83,79,75,226,78,81,8, >>>>> >>>>> 77,79,97,154,127,165,92,183,20,239,70,183,158, >>>>> >>>>> 193,222,139,77,116,13,128,12,66,120,63,110,0,0, >>>>> >>>>> 94,0,255,192,36,192,35,192,10,192,9,192,7,192,8, >>>>> >>>>> 192,40,192,39,192,20,192,19,192,17,192,18,192,38, >>>>> >>>>> 192,37,192,42,192,41,192,5,192,4,192,2,192,3,192, >>>>> >>>>> 15,192,14,192,12,192,13,0,61,0,60,0,47,0,5,0,4,0, >>>>> >>>>> 53,0,10,0,103,0,107,0,51,0,57,0,22,0,175,0,174,0, >>>>> >>>>> 141,0,140,0,138,0,139,0,177,0,176,0,44,0,59,1,0, >>>>> >>>>> 0,34,0,10,0,8,0,6,0,23,0,24,0,25,0,11,0,2,1,0,0, >>>>> 13,0,12,0,10,5,1,4,1,2,1,4,3,2,3]} >>>>> (meaningless state omitted) >>>>> ** Reason for termination = >>>>> ** {badarg,[{erlang,size, >>>>> >>>>> [[22,3,1,0,173,1,0,0,169,3,3,83,79,75,226,78,81,8,77,79, >>>>> >>>>> 97,154,127,165,92,183,20,239,70,183,158,193,222,139,77, >>>>> >>>>> 116,13,128,12,66,120,63,110,0,0,94,0,255,192,36,192,35, >>>>> >>>>> 192,10,192,9,192,7,192,8,192,40,192,39,192,20,192,19, >>>>> >>>>> 192,17,192,18,192,38,192,37,192,42,192,41,192,5,192,4, >>>>> >>>>> 192,2,192,3,192,15,192,14,192,12,192,13,0,61,0,60,0,47, >>>>> >>>>> 0,5,0,4,0,53,0,10,0,103,0,107,0,51,0,57,0,22,0,175,0, >>>>> >>>>> 174,0,141,0,140,0,138,0,139,0,177,0,176,0,44,0,59,1,0,0, >>>>> >>>>> 34,0,10,0,8,0,6,0,23,0,24,0,25,0,11,0,2,1,0,0,13,0,12,0, >>>>> 10,5,1,4,1,2,1,4,3,2,3]], >>>>> []}, >>>>> {tls_record,get_tls_records_aux,2, >>>>> [{file,"tls_record.erl"},{line,122}]}, >>>>> {tls_connection,next_tls_record,2, >>>>> [{file,"tls_connection.erl"},{line,484}]}, >>>>> {tls_connection,handle_info,3, >>>>> [{file,"tls_connection.erl"},{line,307}]}, >>>>> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, >>>>> >>>>> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} >>>>> >>>>> The client used was simple curl under mac os, and this crash did not >>>>> reproduce. >>>>> As you see, the packet received as list instead of binary is >>>>> client_hello which is the first message ssl process gets. >>>>> Maybe there is some race condition when changing mode on just >>>>> transport_accepted socket. >>>>> >>>>> >>>>> >>>>> Also, the same server when working with the same curl may stall at >>>>> this line: >>>>> {ok, _} = ssl:recv(Socket, 0, 10000), >>>>> process_info showed that the worker has {ssl,#sslsocket{}, Data} in >>>>> its mailbox. >>>>> >>>>> I've tuned the server to reproduce this stall easier: >>>>> https://github.com/stolen/ssldump/blob/b3eebc2fa85ca0bd8ed8470c400b972aa737bffc/src/ssldump.erl(master may change) >>>>> >>>>> The client is manually invoked curl which is manually interrupted >>>>> after sufficiently large time of inactivity. The console log looks like >>>>> this: >>>>> >>>>> stolen@REDACTED:~/ssldump$ ./dummyserver.sh 9999 ../cert/pipe.trololo >>>>> Erlang/OTP 17 [erts-6.0] [source-07b8f44] [smp:2:2] [async-threads:10] >>>>> [hipe] [kernel-poll:false] >>>>> >>>>> Eshell V6.0 (abort with ^G) >>>>> 1> Accepting SSL in <0.46.0> >>>>> Socket state: connection, options: {socket_options,list,0,0,0,true} >>>>> >>>>> =ERROR REPORT==== 17-Apr-2014::09:08:01 === >>>>> Error in process <0.46.0> with exit value: >>>>> {{badmatch,{error,timeout}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} >>>>> >>>>> Accepting SSL in <0.47.0> >>>>> Socket state: connection, options: {socket_options,binary,0,0,0,false} >>>>> Accepting SSL in <0.48.0> >>>>> Socket state: connection, options: {socket_options,binary,0,0,0,false} >>>>> Accepting SSL in <0.51.0> >>>>> Socket state: connection, options: {socket_options,list,0,0,0,true} >>>>> >>>>> =ERROR REPORT==== 17-Apr-2014::09:09:17 === >>>>> Error in process <0.51.0> with exit value: >>>>> {{badmatch,{error,closed}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} >>>>> >>>>> Accepting SSL in <0.53.0> >>>>> Socket state: connection, options: {socket_options,binary,0,0,0,false} >>>>> Accepting SSL in <0.55.0> >>>>> Socket state: connection, options: {socket_options,binary,0,0,0,false} >>>>> Accepting SSL in <0.57.0> >>>>> Socket state: connection, options: {socket_options,list,0,0,0,true} >>>>> >>>>> =ERROR REPORT==== 17-Apr-2014::09:11:26 === >>>>> Error in process <0.57.0> with exit value: >>>>> {{badmatch,{error,closed}},[{ssldump,ssl_acceptor,1,[{file,"src/ssldump.erl"},{line,98}]}]} >>>>> >>>>> >>>>> My interpretation: >>>>> - Given pool size X, the first of each X requests fails. >>>>> - First of failing requests catches timeout as expected, other ones >>>>> just stall. >>>>> - Failing requests have emulated options [{mode, list}, {active, >>>>> true}] while working ones have the opposite [{mode, binary}, {active, >>>>> false}]. >>>>> >>>>> After couple of further experiments I discovered that only every (X*N >>>>> + 1)th acceptor inherits listening socket options, other ones always have >>>>> [{mode, binary}, {active, false}]. >>>>> >>>>> >>>>> >>>> Humm... I am not sure if this is what happens in your case but the >>>> following should fix a potential inheritance problem >>>> >>>> diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl >>>> index 743753b..7768bbb 100644 >>>> --- a/lib/ssl/src/ssl.erl >>>> +++ b/lib/ssl/src/ssl.erl >>>> @@ -187,6 +187,7 @@ transport_accept(#sslsocket{pid = {ListenSocket, >>>> {error, Reason} >>>> end; >>>> {error, Reason} -> >>>> + ok = ssl_socket:setopts(Transport, ListenSocket, SocketValues), >>>> {error, Reason} >>>> end. >>>> >>>> >>>> >>>> >>>>> And, apart from eventual option inheritance, shouldn't ssl:recv on >>>>> active socket return {error, einval} like gen_tcp:recv does? >>>>> >>>>> >>>>> >>>> I think it should. >>>> >>>> >>>> Regards Ingela Erlang/OTP Team Ericssson AB >>>> >>>> >>>> >>>> >>>> >>>>> 2014-04-16 19:36 GMT+04:00 Ingela Andin : >>>>> >>>>> Hi! >>>>>> >>>>>> 2014-04-16 15:56 GMT+02:00 Danil Zagoskin : >>>>>> >>>>>> Thank you for the patch. I'll check it. >>>>>>> >>>>>> >>>>>> >>>>>> New patch, better tested ;), on branch >>>>>> ia/ssl/user-suites-match-negotiated-version at >>>>>> https://github.com/IngelaAndin/otp >>>>>> >>>>>> >>>>>>> >>>>>>> (Style question: is lists:filtermap better than list comprehension?) >>>>>>> >>>>>> >>>>>> >>>>>> I think just a matter of taste! >>>>>> >>>>>> >>>>>>> > #ssl_options{] is an internal representation of the proplists >>>>>>> input list and should not be a visible in the API, records are generally >>>>>>> not a good API choice as they enforce compile time dependencies. >>>>>>> >>>>>>> Yes, I understand that. I wanted to start broken client to see how >>>>>>> server would work with it. >>>>>>> The option to do that could be using sys:replace_state, but as far >>>>>>> as I understand the code, client_hello is sent immediately after starting a >>>>>>> process, so it seems there is no way to send crafted hello and continue >>>>>>> handshake with couple of lines instead of ssl:connect. >>>>>>> >>>>>>> Given that possibility it could be much easier to reproduce server >>>>>>> crashes when working with buggy clients. >>>>>>> For example, How do I write a test for badmatch in tls_record:decode_cipher_text? >>>>>>> The function takes #connection_states{}, and creating that record >>>>>>> relies on #ssl_options{} which cannot be created without opening a >>>>>>> socket and calling gen_fsm:enter_loop. >>>>>>> >>>>>>> >>>>>> Yes you have a good point. I do not have a good short answer. >>>>>> Testing error cases especially when the protocol sometimes >>>>>> tries to hide the real error reason due to security issues and >>>>>> shortcutting the API and creating raw protocol command is not trivial. >>>>>> >>>>>> Regards Ingela Erlang/OTP team - Ericsson AB >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> >>>>>>> 2014-04-16 17:07 GMT+04:00 Ingela Andin : >>>>>>> >>>>>>> Hi! >>>>>>>> >>>>>>>> 2014-04-16 0:07 GMT+02:00 Danil Zagoskin : >>>>>>>> >>>>>>>> Hi, Ingela. >>>>>>>>> >>>>>>>>> I finally had some time for investigating this problem. >>>>>>>>> >>>>>>>>> I didn't see badarg in erlang:size again, but it definitely >>>>>>>>> appeared in 17.0 with simple accept method described as minimal example at >>>>>>>>> http://www.erlang.org/doc/apps/ssl/using_ssl.html ( >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>> the difference was transport_accept and ssl_accept were run in >>>>>>>>> separate process) >>>>>>>>> >>>>>>>> >>>>>>>> That should be ok, you are suppose to be able to do that. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>> Today I met some new crash: >>>>>>>>> ** {{badmatch,{alert,2,20,{"ssl_cipher.erl",215}}}, >>>>>>>>> >>>>>>>>> [{tls_record,decode_cipher_text,2,[{file,"tls_record.erl"},{line,157}]}, >>>>>>>>> >>>>>>>>> {tls_connection,next_record,1,[{file,"tls_connection.erl"},{line,503}]}, >>>>>>>>> >>>>>>>>> {tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,475}]}, >>>>>>>>> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}, >>>>>>>>> >>>>>>>>> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} >>>>>>>>> >>>>>>>>> That's because ssl_record:decipher/3 may return #alert{}, but >>>>>>>>> tls_record:decode_cipher_text/2 isn't expecting that. >>>>>>>>> >>>>>>>>> >>>>>>>> Hum, looks like a bug. We will look into that. >>>>>>>> >>>>>>>> >>>>>>>>> >>>>>>>>> As for {case_clause,{4}} in ssl_v3:mac_hash/3 I found that >>>>>>>>> precondition for crash is easily reproducible: >>>>>>>>> https://gist.github.com/stolen/10780653 >>>>>>>>> Ordinary servers negotiate with sha hash or close socket while ssl >>>>>>>>> in 17.0 negotiates with sha256 hash. >>>>>>>>> I don't know the protocol good enough to perform further states, >>>>>>>>> but I hope this helps. >>>>>>>>> >>>>>>>>> >>>>>>>> Okej, the following patch should take care of that problem. >>>>>>>> >>>>>>>> diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl >>>>>>>> index 743753b..093d4af 100644 >>>>>>>> --- a/lib/ssl/src/ssl.erl >>>>>>>> +++ b/lib/ssl/src/ssl.erl >>>>>>>> @@ -953,8 +953,8 @@ handle_cipher_option(Value, Version) when >>>>>>>> is_list(Value) -> >>>>>>>> error:_-> >>>>>>>> throw({error, {options, {ciphers, Value}}}) >>>>>>>> end. >>>>>>>> -binary_cipher_suites(Version, []) -> %% Defaults to all supported >>>>>>>> suits >>>>>>>> - ssl_cipher:suites(Version); >>>>>>>> +binary_cipher_suites(Version, []) -> >>>>>>>> + []; >>>>>>>> binary_cipher_suites(Version, [{_,_,_,_}| _] = Ciphers0) -> %% >>>>>>>> Backwards compatibility >>>>>>>> Ciphers = [{KeyExchange, Cipher, Hash} || {KeyExchange, >>>>>>>> Cipher, Hash, _} <- Ciphers0], >>>>>>>> binary_cipher_suites(Version, Ciphers); >>>>>>>> diff --git a/lib/ssl/src/ssl_handshake.erl >>>>>>>> b/lib/ssl/src/ssl_handshake.erl >>>>>>>> index 1108edc..93d4efd 100644 >>>>>>>> --- a/lib/ssl/src/ssl_handshake.erl >>>>>>>> +++ b/lib/ssl/src/ssl_handshake.erl >>>>>>>> @@ -1017,11 +1017,14 @@ decode_suites('3_bytes', Dec) -> >>>>>>>> %%-------------Cipeher suite handling >>>>>>>> -------------------------------- >>>>>>>> >>>>>>>> available_suites(UserSuites, Version) -> >>>>>>>> + VersionSupportedSuites = ssl_cipher:suites(Version), >>>>>>>> case UserSuites of >>>>>>>> [] -> >>>>>>>> - ssl_cipher:suites(Version); >>>>>>>> + VersionSupportedSuites; >>>>>>>> _ -> >>>>>>>> - UserSuites >>>>>>>> + lists:filtermap(fun(Suite) -> >>>>>>>> + lists:member(Suite, VersionSupportedSuites) >>>>>>>> + end, UserSuites) >>>>>>>> end. >>>>>>>> >>>>>>>> available_suites(ServerCert, UserSuites, Version, Curve) -> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>> Unfortunately, I don't understand how this code should be tested ? >>>>>>>>> most of functions require #state{} or #connection_states{} which require >>>>>>>>> #ssl_options{} and other stuff, and at I have found no exported function >>>>>>>>> creating #ssl_options{} without side-effects. >>>>>>>>> >>>>>>>> >>>>>>>> #ssl_options{] is an internal representation of the proplists input >>>>>>>> list and should not be a visible in the API, records are generally not a >>>>>>>> good API choice as they enforce compile time dependencies. >>>>>>>> >>>>>>>> >>>>>>>> Regards Ingela - Erlang/OTP team - Ericsson AB >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>> >>>>>>>>> 2014-04-15 16:52 GMT+04:00 Ingela Andin : >>>>>>>>> >>>>>>>>> Hello again! >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> sometimes badarg in >>>>>>>>>>> erlang:size([22,3,1,0,158,1,0,0,154,3,1,83,74|...]) at tls_record.erl:122. >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Same symptom was recently reported on erlang-bugs and it turned >>>>>>>>>> out to be due to upgrading a gen_tcp socket in active mode. When upgrading >>>>>>>>>> a gen_tcp socket to an ssl socket it must be put in passive mode ({active, >>>>>>>>>> false}) before the client >>>>>>>>>> is allowed to start the handshake. Normaly if the upgrade is >>>>>>>>>> negotiated this is not a problem for the server to set the option >>>>>>>>>> before signaling to the client to go ahead with the handshake. >>>>>>>>>> If the upgrade is only performed on the server side instead of calling the >>>>>>>>>> ssl API ( some people may do that due to the previously lack of possibility >>>>>>>>>> to specify ssl options when calling ssl:ssl_accept with an "sslsocket", >>>>>>>>>> this is no longer the case in 17.0) the listen socket needs to be put in >>>>>>>>>> passive mode (listen options are inherited by the acceptsocket) to make >>>>>>>>>> sure that the it will work, otherwhise it will work sometimes and sometime >>>>>>>>>> result in the error above. >>>>>>>>>> >>>>>>>>>> Regards Ingela Erlang/OTP team - Ericsson AB >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> Danil Zagoskin | z@REDACTED >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Danil Zagoskin | z@REDACTED >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Danil Zagoskin | z@REDACTED >>>>> >>>> >>>> >>> >> >> >> -- >> Danil Zagoskin | z@REDACTED >> > > > > -- > Danil Zagoskin | z@REDACTED > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From yasoho@REDACTED Sun Apr 20 07:01:05 2014 From: yasoho@REDACTED (yasoho@REDACTED) Date: Sun, 20 Apr 2014 13:01:05 +0800 Subject: [erlang-questions] Help: ct_telnet_client memory overflow Message-ID: <201404201300024160307@gmail.com> Hi, dear I use ct_telnet_client.erl, found that when a telnet command returning message reaches 10MB, the Erlang process consumes memory up to 4~5GB, when the greater will memory overflow,. Can anybody help me, what is the cause? thanks a lot! B.R yasoho@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Sun Apr 20 23:51:44 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Sun, 20 Apr 2014 23:51:44 +0200 Subject: [erlang-questions] error_logger events sent by emulator Message-ID: <53544170.2080406@ninenines.eu> Hello, I am playing with error_logger handlers at the moment. I notice that I receive events like this one: {error, <0.68.0>, {emulator,"~s~n", ["Error in process <0.649.0> on node 'ct@REDACTED' with exit value: {[{reason,function_clause},{mfa,{rest_resource_etags,generate_etag,2}},{stacktrace,[{cowboy_http,quoted_string,[<<17 bytes>>,#Fun],[{file,\"src/cowboy_http.erl\"},{line,653}]},{cowboy_http,nonempty_list,2,[{file,\"src/cowboy_http.erl\"},{... \n"]}} I remember reading about these from a previous discussion but I can't find it right now. If I recall they are messages sent directly from the C code, and again if I recall there was suggestions about removing this type of error entirely and/or replacing with Erlang code instead of making the C code aware of the error_logger. Is there any plans to change this in the future? If not, can you provide details on what exactly triggers these sort of events? It's hard to decide what events to ignore without knowing that. Thanks! -- Lo?c Hoguin http://ninenines.eu From bchesneau@REDACTED Mon Apr 21 12:10:45 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Mon, 21 Apr 2014 12:10:45 +0200 Subject: [erlang-questions] Erlang/OTP 17.0 and android Message-ID: Is there any doc somewhere about the recent cross-platform android build addition? How to use a builded Erlang on this platform? - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Mon Apr 21 12:59:26 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 21 Apr 2014 13:59:26 +0300 Subject: [erlang-questions] Erlang/OTP 17.0 and android In-Reply-To: References: Message-ID: Hello, There is a HOW TO docs. They covers build procedure and release preparation. However, there is not any silver bullet for deployment into device. If you are looking OTP deployment to high-end device then you might need to root it. I managed to deploy it into device using RnD mode and adb tool. What is your target device? Best Regards, Dmitry >-|-|-(*> > On 21 Apr 2014, at 13:10, Benoit Chesneau wrote: > > Is there any doc somewhere about the recent cross-platform android build addition? How to use a builded Erlang on this platform? > > - benoit > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From erlang@REDACTED Mon Apr 21 15:36:30 2014 From: erlang@REDACTED (Erik Reitsma) Date: Mon, 21 Apr 2014 15:36:30 +0200 Subject: [erlang-questions] Erlang/OTP 17.0 and android In-Reply-To: References: Message-ID: <53551EDE.1060104@ernovation.com> Hi all, I will update my Erlang4Android (https://code.google.com/p/erlang4android/) to 17.0 soon (this week, I hope). I have it working on my own device, I just need to add the interface to the Android functions from Scripting Layer for Android (SL4A). I want to use the $handle_undefined_function instead of hacking the error handler as I did with the R16 version. Most of the work I did for Erlang4Android is included in the official release of 17.0, but not all (which I found out when I tried to run the build without modifications). I see no need to root the device (for installing Erlang) if you use my installer. Regards, *Erik. On 04/21/2014 12:59 PM, Dmitry Kolesnikov wrote: > Hello, > > There is a HOW TO docs. They covers build procedure and release preparation. However, there is not any silver bullet for deployment into device. If you are looking OTP deployment to high-end device then you might need to root it. I managed to deploy it into device using RnD mode and adb tool. What is your target device? > > Best Regards, > Dmitry >> -|-|-(*> >> On 21 Apr 2014, at 13:10, Benoit Chesneau wrote: >> >> Is there any doc somewhere about the recent cross-platform android build addition? How to use a builded Erlang on this platform? >> >> - benoit >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From erlang@REDACTED Mon Apr 21 16:17:58 2014 From: erlang@REDACTED (Erik Reitsma) Date: Mon, 21 Apr 2014 16:17:58 +0200 Subject: [erlang-questions] Erlang/OTP 17.0 and android In-Reply-To: References: <53551EDE.1060104@ernovation.com> Message-ID: <53552896.30905@ernovation.com> I will make a new zip archive for 17.0 that is downloaded by the updated Erlang4Android app, as I did for R16. You could use the same zip file and extract it in your own app's private directory. Make sure the proper files are executable (e.g. by making all files executable). With 17.0 I could build for Android from source without modifications. Note that the scripts refer to /bin/sh, while on Android sh is in /system/bin, so I had to fix that. *Erik. On 04/21/2014 04:02 PM, Josh Adams wrote: > So I've written an app that spawns an erlang node on the device for > the purpose of remotely controlling a RaspberryPi device via Erlang > distribution. Would there be any way to use Erlang4Android as a > dependency of another app? I did end up using your compiled Erlang > distribution, because I cross-compiled for my device successfully but > it was missing some of the erlang binaries inexplicably - so I punted :) > > > On Mon, Apr 21, 2014 at 8:36 AM, Erik Reitsma > wrote: > > Hi all, > > I will update my Erlang4Android > (https://code.google.com/p/erlang4android/) to 17.0 soon (this > week, I hope). I have it working on my own device, I just need to > add the interface to the Android functions from Scripting Layer > for Android (SL4A). I want to use the $handle_undefined_function > instead of hacking the error handler as I did with the R16 version. > Most of the work I did for Erlang4Android is included in the > official release of 17.0, but not all (which I found out when I > tried to run the build without modifications). > > I see no need to root the device (for installing Erlang) if you > use my installer. > > Regards, > *Erik. > > > On 04/21/2014 12:59 PM, Dmitry Kolesnikov wrote: > > Hello, > > There is a HOW TO docs. They covers build procedure and > release preparation. However, there is not any silver bullet > for deployment into device. If you are looking OTP deployment > to high-end device then you might need to root it. I managed > to deploy it into device using RnD mode and adb tool. What is > your target device? > > Best Regards, > Dmitry > > -|-|-(*> > On 21 Apr 2014, at 13:10, Benoit Chesneau > > wrote: > > Is there any doc somewhere about the recent cross-platform > android build addition? How to use a builded Erlang on > this platform? > > - benoit > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -- > Josh Adams From josh.rubyist@REDACTED Mon Apr 21 16:02:06 2014 From: josh.rubyist@REDACTED (Josh Adams) Date: Mon, 21 Apr 2014 09:02:06 -0500 Subject: [erlang-questions] Erlang/OTP 17.0 and android In-Reply-To: <53551EDE.1060104@ernovation.com> References: <53551EDE.1060104@ernovation.com> Message-ID: So I've written an app that spawns an erlang node on the device for the purpose of remotely controlling a RaspberryPi device via Erlang distribution. Would there be any way to use Erlang4Android as a dependency of another app? I did end up using your compiled Erlang distribution, because I cross-compiled for my device successfully but it was missing some of the erlang binaries inexplicably - so I punted :) On Mon, Apr 21, 2014 at 8:36 AM, Erik Reitsma wrote: > Hi all, > > I will update my Erlang4Android (https://code.google.com/p/erlang4android/) > to 17.0 soon (this week, I hope). I have it working on my own device, I > just need to add the interface to the Android functions from Scripting > Layer for Android (SL4A). I want to use the $handle_undefined_function > instead of hacking the error handler as I did with the R16 version. > Most of the work I did for Erlang4Android is included in the official > release of 17.0, but not all (which I found out when I tried to run the > build without modifications). > > I see no need to root the device (for installing Erlang) if you use my > installer. > > Regards, > *Erik. > > > On 04/21/2014 12:59 PM, Dmitry Kolesnikov wrote: > >> Hello, >> >> There is a HOW TO docs. They covers build procedure and release >> preparation. However, there is not any silver bullet for deployment into >> device. If you are looking OTP deployment to high-end device then you might >> need to root it. I managed to deploy it into device using RnD mode and adb >> tool. What is your target device? >> >> Best Regards, >> Dmitry >> >>> -|-|-(*> >>> On 21 Apr 2014, at 13:10, Benoit Chesneau wrote: >>> >>> Is there any doc somewhere about the recent cross-platform android build >>> addition? How to use a builded Erlang on this platform? >>> >>> - benoit >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Josh Adams -------------- next part -------------- An HTML attachment was scrubbed... URL: From vances@REDACTED Mon Apr 21 18:01:33 2014 From: vances@REDACTED (Vance Shipley) Date: Mon, 21 Apr 2014 21:31:33 +0530 Subject: [erlang-questions] mnesia table-specific options Message-ID: <20140421160133.GA263@foil.motivity.ca> On Mon Dec 20 14:56:11 CET 2010, Ulf Wiger wrote: } Some time ago, I introduced an 'external_copies' type in mnesia, } and this was used (with some modifications) by mnesiaex to provide } a TokyoCabinet back-end to mnesia. Thesis projects at Klarna have } played around with CouchDB backends etc. } } I think that conceptually, it would seem good to keep the } ram_copies, disc_copies and disc_only_copies, regardless of } back-end, since they address higher-level access characteristics } (e.g. TokyoCabinet is, strictly speaking, also disc_only.) } } A form of behaviour option could then be added that gives } additional options - e.g. tuning parameters to InnoDB, dets, ets, } or whatever back-end is being used. } } Taking it one step further, it should be possible to specify a } default behaviour for each copy type, and override per-table. Has there been any progress on this concept? I have been looking at alternative data structures for application specific use cases such as treaps and range trees. I'd like to be able to use these without having to reinvent mnesia's distribution and transactions. -- -Vance From ulf@REDACTED Mon Apr 21 18:47:14 2014 From: ulf@REDACTED (Ulf Wiger) Date: Mon, 21 Apr 2014 18:47:14 +0200 Subject: [erlang-questions] mnesia table-specific options In-Reply-To: <20140421160133.GA263@foil.motivity.ca> References: <20140421160133.GA263@foil.motivity.ca> Message-ID: <98ED47F6-9977-4EBA-A328-6E5829DADC56@feuerlabs.com> It?s still progressing, although I can?t give any insights into when it might see the light of day. BR, Ulf On 21 Apr 2014, at 18:01, Vance Shipley wrote: > On Mon Dec 20 14:56:11 CET 2010, Ulf Wiger wrote: > } Some time ago, I introduced an 'external_copies' type in mnesia, > } and this was used (with some modifications) by mnesiaex to provide > } a TokyoCabinet back-end to mnesia. Thesis projects at Klarna have > } played around with CouchDB backends etc. > } > } I think that conceptually, it would seem good to keep the > } ram_copies, disc_copies and disc_only_copies, regardless of > } back-end, since they address higher-level access characteristics > } (e.g. TokyoCabinet is, strictly speaking, also disc_only.) > } > } A form of behaviour option could then be added that gives > } additional options - e.g. tuning parameters to InnoDB, dets, ets, > } or whatever back-end is being used. > } > } Taking it one step further, it should be possible to specify a > } default behaviour for each copy type, and override per-table. > > Has there been any progress on this concept? > > I have been looking at alternative data structures for application > specific use cases such as treaps and range trees. I'd like to be > able to use these without having to reinvent mnesia's distribution > and transactions. > > -- > -Vance > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com From ch@REDACTED Mon Apr 21 20:40:25 2014 From: ch@REDACTED (Charles Zilm) Date: Mon, 21 Apr 2014 14:40:25 -0400 Subject: [erlang-questions] Mnesia ets usage oddities. Message-ID: All, I'm currently debugging a system that uses mnesia as a data cache layer to store the state of client processes. Each client process represents a single TCP connection to the application, there may be thousands of connections. When a connection is lost the client process is alerted and the mnesia cache is updated. Similarly when a new connection is made a client process is spawned and the mnesia cache is updated to reflect the new connection. Testing has shown that losing thousands of connections at once can cause the application to crash due to ets table exhaustion. This makes perfect sense, thousands of transactions being spawned in short order is likely to exhaust the pool. What does not make sense is that the transactions spawned by the client processes never trigger the system_limit error. That is always triggered by a separate timer triggered transaction that just happens to run while the client process transactions are processing. Tracing calls to ets:new and printing out length(ets:all()) after each call revealed that prior to crash our system reports using more ets tables than is should be allowed to. So a few questions, 1) How does ets determine if it can create a new table? length(ets:all()) returning 1800 when the system limit is 1400 is confusing. 2) Why could it be that only the timer triggered transaction crashes due to ets table exhaustion? With the number of terminating connections I'd expect to see a number of client processes terminating for this same reason. Log verification shows all client processes terminated with the expected reason. Any insights would be most appreciated. Thanks, Charles -------------- next part -------------- An HTML attachment was scrubbed... URL: From ransomr@REDACTED Mon Apr 21 20:58:24 2014 From: ransomr@REDACTED (Ransom Richardson) Date: Mon, 21 Apr 2014 18:58:24 +0000 Subject: [erlang-questions] HTTPC doesn't do HTTPS validation In-Reply-To: References: <3251a0223f05492fad565ccd05f88dee@BL2PR08MB002.namprd08.prod.outlook.com> <8fcd78e1f87b4f4eb4f0e206fa226293@BL2PR08MB002.namprd08.prod.outlook.com>, Message-ID: ?verify_none does seem like the default. Also, even if I pass verify_peer, nothing checks if the host name in the certificate matches the host that I am connecting to. So a server can present any validly signed certificate for a different site. Ransom ________________________________ From: Benoit Chesneau Sent: Saturday, April 19, 2014 12:31 AM To: Ransom Richardson Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] HTTPC doesn't do HTTPS validation On Sat, Apr 19, 2014 at 6:17 AM, Ransom Richardson > wrote: But as I reported in this issue https://github.com/benoitc/hackney/issues/101 I tested against a server with an invalid cert, and hackney did not catch the error. httpc also returned ok. 1> hackney:get(<<"https://localhost:8443/delay">>, [], <<>>, []). {ok,200, [{<<"connection">>,<<"keep-alive">>}, {<<"server">>,<<"Cowboy">>}, {<<"date">>,<<"Sat, 19 Apr 2014 00:00:26 GMT">>}, {<<"content-length">>,<<"0">>}], #Ref<0.0.0.111>} The same happens if I pass validate_peer and the rootCA file as ssl_options. curl correctly rejects the server: talko@REDACTED:~/dev/httpcbench$ curl https://localhost:8443/delay curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed talko@REDACTED:~/dev/httpcbench$ curl --cacert priv/ssl/rootCA.pem https://localhost:8443/delay curl: (51) SSL: certificate subject name 'httpcbench server' does not match target host name 'localhost' This is using Erlang 17.0. Is it possible that the ssl default changed? Or am I doing something wrong? The server I'm testing against is in this repo: https://github.com/talko/httpcbench. It's a work in progress, but if you pull, make and run_server you should see the same issue. thanks, Ransom hrm looks like the default is verify_none: https://github.com/erlang/otp/blob/maint/lib/ssl/src/ssl.erl#L594 But it's early in the morning and I need more cafe, so... - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From alcosholik@REDACTED Mon Apr 21 22:55:30 2014 From: alcosholik@REDACTED (Alexei Sholik) Date: Mon, 21 Apr 2014 23:55:30 +0300 Subject: [erlang-questions] HTTPC doesn't do HTTPS validation In-Reply-To: References: <3251a0223f05492fad565ccd05f88dee@BL2PR08MB002.namprd08.prod.outlook.com> <8fcd78e1f87b4f4eb4f0e206fa226293@BL2PR08MB002.namprd08.prod.outlook.com> Message-ID: Ransom, if you look at the code closely, you'll see that it uses UserVerifyFun (undefined by default) for the verification. There is also fail_if_no_peer_cert option which is set to false by default. https://github.com/erlang/otp/blob/maint/lib/ssl/src/ssl.erl#L589 On Mon, Apr 21, 2014 at 9:58 PM, Ransom Richardson wrote: > ?verify_none does seem like the default. > > > Also, even if I pass verify_peer, nothing checks if the host name in the > certificate matches the host that I am connecting to. So a server can > present any validly signed certificate for a different site. > > > Ransom > > > ------------------------------ > *From:* Benoit Chesneau > *Sent:* Saturday, April 19, 2014 12:31 AM > > *To:* Ransom Richardson > *Cc:* erlang-questions@REDACTED > *Subject:* Re: [erlang-questions] HTTPC doesn't do HTTPS validation > > > > > On Sat, Apr 19, 2014 at 6:17 AM, Ransom Richardson wrote: > >> But as I reported in this issue >> https://github.com/benoitc/hackney/issues/101 I tested against a server >> with an invalid cert, and hackney did not catch the error. httpc also >> returned ok. >> >> >> 1> hackney:get(<<"https://localhost:8443/delay">>, [], <<>>, []). >> {ok,200, >> [{<<"connection">>,<<"keep-alive">>}, >> {<<"server">>,<<"Cowboy">>}, >> {<<"date">>,<<"Sat, 19 Apr 2014 00:00:26 GMT">>}, >> {<<"content-length">>,<<"0">>}], >> #Ref<0.0.0.111>} >> >> The same happens if I pass validate_peer and the rootCA file as >> ssl_options. >> >> >> curl correctly rejects the server: >> >> >> talko@REDACTED:~/dev/httpcbench$ curl https://localhost:8443/delay >> curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: >> error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed >> >> talko@REDACTED:~/dev/httpcbench$ curl --cacert priv/ssl/rootCA.pem https://localhost:8443/delay >> curl: (51) SSL: certificate subject name 'httpcbench server' does not match target host name 'localhost' >> >> >> This is using Erlang 17.0. Is it possible that the ssl default changed? >> >> >> Or am I doing something wrong? >> >> >> The server I'm testing against is in this repo: >> https://github.com/talko/httpcbench. It's a work in progress, but if you >> pull, make and run_server you should see the same issue. >> >> >> thanks, >> >> Ransom >> >> >> > hrm looks like the default is verify_none: > > https://github.com/erlang/otp/blob/maint/lib/ssl/src/ssl.erl#L594 > > But it's early in the morning and I need more cafe, so... > > - benoit > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Best regards Alexei Sholik -------------- next part -------------- An HTML attachment was scrubbed... URL: From ransomr@REDACTED Mon Apr 21 23:56:20 2014 From: ransomr@REDACTED (Ransom Richardson) Date: Mon, 21 Apr 2014 21:56:20 +0000 Subject: [erlang-questions] HTTPC doesn't do HTTPS validation In-Reply-To: References: <3251a0223f05492fad565ccd05f88dee@BL2PR08MB002.namprd08.prod.outlook.com> <8fcd78e1f87b4f4eb4f0e206fa226293@BL2PR08MB002.namprd08.prod.outlook.com> , Message-ID: Thanks, it looks like that would work, and I also don't see an easier way. But I'm still shocked that to make a https request in Erlang that verifies that the server cert matches the URL, I need to define my own verify function. And I need to pass a bunch of ssl options on each request - presumably one of which is platform dependent (the list of root CA certs). All to do something that curl does by default. For the record, I've tested httpc, lhttpc, ibrowse and hackney, and none of them actually verify the server has a certificate for the URL they are connecting to. ? ________________________________ From: Alexei Sholik Sent: Monday, April 21, 2014 4:55 PM To: Ransom Richardson Cc: Benoit Chesneau; erlang-questions@REDACTED Subject: Re: [erlang-questions] HTTPC doesn't do HTTPS validation Ransom, if you look at the code closely, you'll see that it uses UserVerifyFun (undefined by default) for the verification. There is also fail_if_no_peer_cert option which is set to false by default. https://github.com/erlang/otp/blob/maint/lib/ssl/src/ssl.erl#L589 On Mon, Apr 21, 2014 at 9:58 PM, Ransom Richardson > wrote: ?verify_none does seem like the default. Also, even if I pass verify_peer, nothing checks if the host name in the certificate matches the host that I am connecting to. So a server can present any validly signed certificate for a different site. Ransom ________________________________ From: Benoit Chesneau > Sent: Saturday, April 19, 2014 12:31 AM To: Ransom Richardson Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] HTTPC doesn't do HTTPS validation On Sat, Apr 19, 2014 at 6:17 AM, Ransom Richardson > wrote: But as I reported in this issue https://github.com/benoitc/hackney/issues/101 I tested against a server with an invalid cert, and hackney did not catch the error. httpc also returned ok. 1> hackney:get(<<"https://localhost:8443/delay">>, [], <<>>, []). {ok,200, [{<<"connection">>,<<"keep-alive">>}, {<<"server">>,<<"Cowboy">>}, {<<"date">>,<<"Sat, 19 Apr 2014 00:00:26 GMT">>}, {<<"content-length">>,<<"0">>}], #Ref<0.0.0.111>} The same happens if I pass validate_peer and the rootCA file as ssl_options. curl correctly rejects the server: talko@REDACTED:~/dev/httpcbench$ curl https://localhost:8443/delay curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed talko@REDACTED:~/dev/httpcbench$ curl --cacert priv/ssl/rootCA.pem https://localhost:8443/delay curl: (51) SSL: certificate subject name 'httpcbench server' does not match target host name 'localhost' This is using Erlang 17.0. Is it possible that the ssl default changed? Or am I doing something wrong? The server I'm testing against is in this repo: https://github.com/talko/httpcbench. It's a work in progress, but if you pull, make and run_server you should see the same issue. thanks, Ransom hrm looks like the default is verify_none: https://github.com/erlang/otp/blob/maint/lib/ssl/src/ssl.erl#L594 But it's early in the morning and I need more cafe, so... - benoit _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -- Best regards Alexei Sholik -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Tue Apr 22 00:07:46 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 22 Apr 2014 00:07:46 +0200 Subject: [erlang-questions] HTTPC doesn't do HTTPS validation In-Reply-To: References: <3251a0223f05492fad565ccd05f88dee@BL2PR08MB002.namprd08.prod.outlook.com> <8fcd78e1f87b4f4eb4f0e206fa226293@BL2PR08MB002.namprd08.prod.outlook.com> , Message-ID: <535596B2.8020505@ninenines.eu> You're partly wrong about curl, curl only can check the CA certs if they are installed. It just happens that if they are installed curl is generally configured to find them automatically (by the OS' package maintainers usually). If they are not installed, then curl rejects pretty much everything, which is neither better nor worse than accepting everything (I wouldn't want either to do things differently than they do now though). I agree though that there should be a simple option to do the usual stuff, aka "what browsers and command-line clients do", that would take care of 99% of use cases without needing to spend an hour setting the thing up. Just set the verify_it_properly option, pass the CA certs, done. On 04/21/2014 11:56 PM, Ransom Richardson wrote: > Thanks, it looks like that would work, and I also don't see an easier way. > > > But I'm still shocked that to make a https request in Erlang that > verifies that the server cert matches the URL, I need to define my own > verify function. And I need to pass a bunch of ssl options on each > request - presumably one of which is platform dependent (the list of > root CA certs). All to do something that curl does by default. > > > For the record, I've tested httpc, lhttpc, ibrowse and hackney, and none > of them actually verify the server has a certificate for the URL they > are connecting to. > > ? > > ------------------------------------------------------------------------ > *From:* Alexei Sholik > *Sent:* Monday, April 21, 2014 4:55 PM > *To:* Ransom Richardson > *Cc:* Benoit Chesneau; erlang-questions@REDACTED > *Subject:* Re: [erlang-questions] HTTPC doesn't do HTTPS validation > Ransom, if you look at the code closely, you'll see that it uses > UserVerifyFun (undefined by default) for the verification. > > There is also fail_if_no_peer_cert option which is set to false by default. > > https://github.com/erlang/otp/blob/maint/lib/ssl/src/ssl.erl#L589 > > > On Mon, Apr 21, 2014 at 9:58 PM, Ransom Richardson > wrote: > > ?verify_none does seem like the default. > > > Also, even if I pass verify_peer, nothing checks if the host name in > the certificate matches the host that I am connecting to. So a > server can present any validly signed certificate for a different site. > > > Ransom > > > ------------------------------------------------------------------------ > *From:* Benoit Chesneau > > *Sent:* Saturday, April 19, 2014 12:31 AM > > *To:* Ransom Richardson > *Cc:* erlang-questions@REDACTED > *Subject:* Re: [erlang-questions] HTTPC doesn't do HTTPS validation > > > > On Sat, Apr 19, 2014 at 6:17 AM, Ransom Richardson > > wrote: > > But as I reported in this issue > https://github.com/benoitc/hackney/issues/101 I tested against a > server with an invalid cert, and hackney did not catch the > error. httpc also returned ok. > > > |1> hackney:get(<<"https://localhost:8443/delay">>, [], <<>>, []). > {ok,200, > [{<<"connection">>,<<"keep-alive">>}, > {<<"server">>,<<"Cowboy">>}, > {<<"date">>,<<"Sat, 19 Apr 2014 00:00:26 GMT">>}, > {<<"content-length">>,<<"0">>}], > #Ref<0.0.0.111>}| > > The same happens if I pass validate_peer and the rootCA file as > ssl_options. > > > curl correctly rejects the server: > > > |talko@REDACTED:~/dev/httpcbench$ curlhttps://localhost:8443/delay > curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: > error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed > > talko@REDACTED:~/dev/httpcbench$ curl --cacert priv/ssl/rootCA.pemhttps://localhost:8443/delay > curl: (51) SSL: certificate subject name 'httpcbench server' does not match target host name 'localhost'| > > > This is using Erlang 17.0. Is it possible that the ssl default > changed? > > > Or am I doing something wrong? > > > The server I'm testing against is in this repo: > https://github.com/talko/httpcbench. It's a work in progress, > but if you pull, make and run_server you should see the same issue. > > > thanks, > > Ransom > > > > hrm looks like the default is verify_none: > > https://github.com/erlang/otp/blob/maint/lib/ssl/src/ssl.erl#L594 > > But it's early in the morning and I need more cafe, so... > > - benoit > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -- > Best regards > Alexei Sholik > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From lukas@REDACTED Tue Apr 22 09:34:59 2014 From: lukas@REDACTED (Lukas Larsson) Date: Tue, 22 Apr 2014 09:34:59 +0200 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: References: <20140418123352.GA68518@ferdair.local> Message-ID: Hello Max, We are not currently aware of any memory leak being introduced in 17.0, but if there is one we are of course very interested in finding out where it is. Would it be possible for you to take a recon_alloc snapshot of a system behaving badly and send/upload that for me to look at? Lukas On Fri, Apr 18, 2014 at 4:39 PM, Max Lapshin wrote: > (flussonic@REDACTED)1> recon_alloc:memory(usage). > 0.8224381620880582 > (flussonic@REDACTED)2> recon_alloc:memory(used). > 2176478632 > (flussonic@REDACTED)3> recon_alloc:memory(allocated). > 2631460448 > > > but > > Mem: 32913744k total, 32591876k used, 321868k free, 88520k buffers > Swap: 33518588k total, 155604k used, 33362984k free, 19466032k cached > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND > > > 888 root 20 0 18.2g 10g 4444 S 237 33.7 742:38.90 > beam.smp > > 3318 root 20 0 0 0 0 S 8 0.0 > 39:31.82 flush-9:127 > > > > So beam.smp is eating 10g > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From peppe@REDACTED Tue Apr 22 09:53:06 2014 From: peppe@REDACTED (Peter Andersson) Date: Tue, 22 Apr 2014 09:53:06 +0200 Subject: [erlang-questions] Help: ct_telnet_client memory overflow In-Reply-To: <201404201300024160307@gmail.com> References: <201404201300024160307@gmail.com> Message-ID: <53561FE2.1050306@erlang.org> Hi, Can you please tell me which Common Test version (or OTP version) you're running? (The CT telnet client got modified a bit from v1.7 to v1.8). Best regards, Peter Ericsson AB, Erlang/OTP yasoho@REDACTED wrote: > > Hi, dear > > > I use ct_telnet_client.erl, found that when a telnet command returning > message reaches 10MB, the Erlang process consumes memory up to > 4~5GB, when the greater will memory overflow,. > > > Can anybody help me, what is the cause? thanks a lot! > > > B.R > ------------------------------------------------------------------------ > yasoho@REDACTED > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From sverker.eriksson@REDACTED Tue Apr 22 14:13:18 2014 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Tue, 22 Apr 2014 14:13:18 +0200 Subject: [erlang-questions] Mnesia ets usage oddities. In-Reply-To: References: Message-ID: <53565CDE.2030304@erix.ericsson.se> The default maximum number of ets tables is 2053. I don't know the rationale behind this magic number but is has been like this at least since R13B03 where my git history ends. This is also the minimum limit, i.e you can not force a lower limit than this. So, the documentation is wrong or at least misleading when it says "approximately 1400 tables". /Sverker, Erlang/OTP On 04/21/2014 08:40 PM, Charles Zilm wrote: > All, > > I'm currently debugging a system that uses mnesia as a data cache layer to > store the state of client processes. Each client process represents a > single TCP connection to the application, there may be thousands of > connections. When a connection is lost the client process is alerted and > the mnesia cache is updated. Similarly when a new connection is made a > client process is spawned and the mnesia cache is updated to reflect the > new connection. > > Testing has shown that losing thousands of connections at once can cause > the application to crash due to ets table exhaustion. This makes perfect > sense, thousands of transactions being spawned in short order is likely to > exhaust the pool. What does not make sense is that the transactions spawned > by the client processes never trigger the system_limit error. That is > always triggered by a separate timer triggered transaction that just > happens to run while the client process transactions are processing. > > Tracing calls to ets:new and printing out length(ets:all()) after each call > revealed that prior to crash our system reports using more ets tables than > is should be allowed to. > > So a few questions, > > 1) How does ets determine if it can create a new table? length(ets:all()) > returning 1800 when the system limit is 1400 is confusing. > > 2) Why could it be that only the timer triggered transaction crashes due to > ets table exhaustion? With the number of terminating connections I'd expect > to see a number of client processes terminating for this same reason. Log > verification shows all client processes terminated with the expected reason. > > Any insights would be most appreciated. > > Thanks, > > Charles > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From yasoho@REDACTED Tue Apr 22 15:09:58 2014 From: yasoho@REDACTED (yasoho@REDACTED) Date: Tue, 22 Apr 2014 21:09:58 +0800 Subject: [erlang-questions] 14. Re: Help: ct_telnet_client memory overflow (Peter Andersson) References: Message-ID: <2014042221085277930011@gmail.com> Hi, Peter Andersson The first, thank you very much for your response! I use the Erlang version is Erlang5.10.4/common_test-1.7.4. The v1.8 version is released? I will use the v1.8 try,if have any question I will ask you for help. Thanks again! B.R ------------------------------------------------------------------------ yasoho@REDACTED ------------------------------ Message: 14 Date: Tue, 22 Apr 2014 09:53:06 +0200 From: Peter Andersson To: "yasoho@REDACTED" Cc: erlang-questions Subject: Re: [erlang-questions] Help: ct_telnet_client memory overflow Message-ID: <53561FE2.1050306@REDACTED> Content-Type: text/plain; charset="ISO-8859-1" Hi, Can you please tell me which Common Test version (or OTP version) you're running? (The CT telnet client got modified a bit from v1.7 to v1.8). Best regards, Peter Ericsson AB, Erlang/OTP yasoho@REDACTED wrote: > > Hi, dear > > > I use ct_telnet_client.erl, found that when a telnet command returning > message reaches 10MB, the Erlang process consumes memory up to > 4~5GB, when the greater will memory overflow,. > > > Can anybody help me, what is the cause? thanks a lot! > > > B.R > ------------------------------------------------------------------------ > yasoho@REDACTED > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > ------------------------------ _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions End of erlang-questions Digest, Vol 162, Issue 2 ************************************************ -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Tue Apr 22 17:42:29 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 22 Apr 2014 19:42:29 +0400 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: References: <20140418123352.GA68518@ferdair.local> Message-ID: Lukas, I'm very sorry, but this problem is not reproduced anymore. If I catch this problem again, I can give you root shell on this machine. Is it ok? -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Tue Apr 22 17:53:50 2014 From: lukas@REDACTED (Lukas Larsson) Date: Tue, 22 Apr 2014 17:53:50 +0200 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: References: <20140418123352.GA68518@ferdair.local> Message-ID: Yes that will also work. If I do not respond fast enough please take note of the values that top gives you (both res and virt) and save a recon_alloc snaphot. Lukas On Tue, Apr 22, 2014 at 5:42 PM, Max Lapshin wrote: > Lukas, I'm very sorry, but this problem is not reproduced anymore. > > If I catch this problem again, I can give you root shell on this machine. > Is it ok? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cobus.carstens@REDACTED Tue Apr 22 20:42:43 2014 From: cobus.carstens@REDACTED (Cobus Carstens) Date: Tue, 22 Apr 2014 20:42:43 +0200 Subject: [erlang-questions] gb_trees utility functions Message-ID: Hi all I wrote 4 utility functions[1] that allows searching a gb_tree for: - the smallest key greater than the specified one - the smallest key greater or equal to the specified one - the greatest key smaller than the specified one - the greatest key smaller or equal to the specified one. This is nothing special, but my question (mostly directed to the OTP people) is: Would this be something that I can contribute to the gb_trees module (or maybe a gb_trees_utils module)? Would a pull-request suffice? [1] For those interested, the implementation can be found at: https://github.com/cobusc/erlang_gb_trees_utils Regards, Cobus From icy.ocean@REDACTED Wed Apr 23 05:12:51 2014 From: icy.ocean@REDACTED (James Wang) Date: Wed, 23 Apr 2014 11:12:51 +0800 Subject: [erlang-questions] strange crypto error in R16B03 Message-ID: Hi all, We are running R16B03 nodes (SuSE10SP1 maintained by our cloud vendor) which uses ibrowse to initiate https requests to remote services. We restart the nodes every week and they worked fine until recently. Ever since the last 2 restarts we have been experiencing a number of failures on our servers, logs show the error is caused by crypto:generate_key/3 (dh) returning a single atom 'error'. We observe the error may start to show up at arbitrary points in time, and once it starts to fail, all subsequent calls to crypto:generate_key/3 on that node returns 'error'. The only solution we found is to restart the node, on some occasions more than once. I'm not familiar when the details of crypto, and counldn't find any solution/explanation for this error after some googling. Can anyone shed some light on how to deal with this problem? PS the OpenSSL version installed is: 0.9.8a -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz@REDACTED Wed Apr 23 09:15:28 2014 From: aschultz@REDACTED (Andreas Schultz) Date: Wed, 23 Apr 2014 07:15:28 +0000 (UTC) Subject: [erlang-questions] strange crypto error in R16B03 In-Reply-To: References: Message-ID: <1918016863.759025.1398237328180.JavaMail.zimbra@tpip.net> Hi, ----- Original Message ----- > Hi all, > > We are running R16B03 nodes (SuSE10SP1 maintained by our cloud vendor) which > uses ibrowse to initiate https requests to remote services. We restart the > nodes every week and they worked fine until recently. > > Ever since the last 2 restarts we have been experiencing a number of failures > on our servers, logs show the error is caused by crypto:generate_key/3 (dh) > returning a single atom 'error'. > > We observe the error may start to show up at arbitrary points in time, and > once it starts to fail, all subsequent calls to crypto:generate_key/3 on > that node returns 'error'. The only solution we found is to restart the > node, on some occasions more than once. > > I'm not familiar when the details of crypto, and counldn't find any > solution/explanation for this error after some googling. Can anyone shed > some light on how to deal with this problem? Off the top my head I would say your box has exhausted /dev/random. Check /proc/sys/kernel/random/entropy_avail for the amount available. OpenSSL has an internal entropy pool, but reseeds it from /dev/random from time to time. If it can't do that, it might fail in the way you see. Andreas > > PS the OpenSSL version installed is: 0.9.8a > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- -- Dipl. Inform. Andreas Schultz email: as@REDACTED phone: +49-391-819099-224 mobil: +49-170-2226073 ------------------- enabling your networks ------------------- Travelping GmbH phone: +49-391-819099229 Roentgenstr. 13 fax: +49-391-819099299 D-39108 Magdeburg email: info@REDACTED GERMANY web: http://www.travelping.com Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 -------------------------------------------------------------- From yasoho@REDACTED Wed Apr 23 11:07:52 2014 From: yasoho@REDACTED (yasoho@REDACTED) Date: Wed, 23 Apr 2014 17:07:52 +0800 Subject: [erlang-questions] Help: ct_telnet_client memory overflow References: <201404201300024160307@gmail.com>, <53561FE2.1050306@erlang.org> Message-ID: <201404231706500961033@gmail.com> Hi, Peter Our performance analysis discover the cause of the problem is not tail recursion function loop(State, Sock, Acc)) to ct_telnet_client; Can you give me a advice How to modifiy it? thanks! B.R yasoho@REDACTED From: Peter Andersson Date: 2014-04-22 15:53 To: yasoho@REDACTED CC: erlang-questions Subject: Re: [erlang-questions] Help: ct_telnet_client memory overflow Hi, Can you please tell me which Common Test version (or OTP version) you're running? (The CT telnet client got modified a bit from v1.7 to v1.8). Best regards, Peter Ericsson AB, Erlang/OTP yasoho@REDACTED wrote: > > Hi, dear > > > I use ct_telnet_client.erl, found that when a telnet command returning > message reaches 10MB, the Erlang process consumes memory up to > 4~5GB, when the greater will memory overflow,. > > > Can anybody help me, what is the cause? thanks a lot! > > > B.R > ------------------------------------------------------------------------ > yasoho@REDACTED > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christoph@REDACTED Sun Apr 20 16:36:38 2014 From: christoph@REDACTED (Christoph Egger) Date: Sun, 20 Apr 2014 16:36:38 +0200 Subject: [erlang-questions] "Internal Error" compiling RFC 5912 asn1 modules Message-ID: <87vbu4xe2x.fsf@mitoraj.siccegge.de> Hi all! I'm trying to compile the OCSP module from either RFC5912 or RFC6960 definitions which seems to fail for me: > Internal error: error:{case_clause, > {type,[], > {'Externaltypereference',62, > 'AlgorithmInformation-2009', > 'DIGEST-ALGORITHM'}, > [],[],no}} > [{asn1ct_check,check_class,2,[{file,"asn1ct_check.erl"},{line,575}]}, > {asn1ct_check,check_type,3,[{file,"asn1ct_check.erl"},{line,3262}]}, > {asn1ct_check,check_each_component2,4, > [{file,"asn1ct_check.erl"},{line,5734}]}, > {asn1ct_check,check_sequence,3,[{file,"asn1ct_check.erl"},{line,5174}]}, > {asn1ct_check,check_type,3,[{file,"asn1ct_check.erl"},{line,3202}]}, > {asn1ct_check,check_type,3,[{file,"asn1ct_check.erl"},{line,3253}]}, > {asn1ct_check,check_each_component2,4, > [{file,"asn1ct_check.erl"},{line,5734}]}, > {asn1ct_check,check_sequence,3,[{file,"asn1ct_check.erl"},{line,5174}]}] Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false] but also with R16B3.1 Is that a erlang bug or some broken parts of the asn.1? doesn't seem to mention anything in the rfc errata at least. if it's the later how would I debug this? Thanks Christoph From richard.youngkin@REDACTED Wed Apr 23 18:34:44 2014 From: richard.youngkin@REDACTED (Youngkin, Rich) Date: Wed, 23 Apr 2014 10:34:44 -0600 Subject: [erlang-questions] Supervision Tree examples Message-ID: Hi all, Just in case someone finds this useful and/or wants to contribute... I've created a simple application that demonstrates various supervisor behaviors, some good and some supervision abuses. Here's the github link. Comments welcome. Cheers, Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From peppe@REDACTED Wed Apr 23 22:23:41 2014 From: peppe@REDACTED (Peter Andersson) Date: Wed, 23 Apr 2014 22:23:41 +0200 Subject: [erlang-questions] Help: ct_telnet_client memory overflow In-Reply-To: <201404231706500961033@gmail.com> References: <201404201300024160307@gmail.com>, <53561FE2.1050306@erlang.org> <201404231706500961033@gmail.com> Message-ID: Hi, Could you give me some more info? Do you mean that the problem is that loop/3 is not tail recursive? Reading the code I can't see that's the case. Or do you mean you're sure the problem must be something other than the loop/3 function? In any event, please share the results of your performance analysis. Do you see that loop/3 causes large stack usage? Or does the telnet client process heap grow very large? Has ct_telnet_client worked ok for you before (ie pre v1.8), and started failing since v1.8 (OTP 17.0)? Reading the code I only see two scenarios where received strings get buffered and not properly flushed. One is if the user doesn't read data often enough (compared to the rate of data sent from the server). Second is if the process that requests data from the telnet client crashes before the get_data request has been processed. Here's something to try: Read about the new telnet logging feature in the ct_telnet ref manual (http://www.erlang.org/doc/man/ct_telnet.html). Install the ct_conn_log hook (log type raw) and run your tests. Check the raw telnet log file during execution to see what and how much is received from the server. This might reveal if something weird is going on in the ct_telnet logging system. I will check the code again and run some extensive profiling tests to see what I can find. Please get back to me with more info ASAP. Best regards, Peter Ericsson AB, Erlang/OTP On Wed, 23 Apr 2014, yasoho@REDACTED wrote: > Hi, Peter > Our performance analysis discover the cause of the problem is not tail recursion function loop(State, Sock, Acc)) to ct_telnet_client; > Can you give me a advice How to modifiy it? thanks! > > B.R > > > yasoho@REDACTED > > From: Peter Andersson > Date: 2014-04-22 15:53 > To: yasoho@REDACTED > CC: erlang-questions > Subject: Re: [erlang-questions] Help: ct_telnet_client memory overflow > > Hi, > > Can you please tell me which Common Test version (or OTP version) you're > running? (The CT telnet client got modified a bit from v1.7 to v1.8). > > Best regards, > Peter > > Ericsson AB, Erlang/OTP > > yasoho@REDACTED wrote: >> >> Hi, dear >> >> >> I use ct_telnet_client.erl, found that when a telnet command returning >> message reaches 10MB, the Erlang process consumes memory up to >> 4~5GB, when the greater will memory overflow,. >> >> >> Can anybody help me, what is the cause? thanks a lot! >> >> >> B.R >> ------------------------------------------------------------------------ >> yasoho@REDACTED >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > From ingela.andin@REDACTED Wed Apr 23 22:35:04 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Wed, 23 Apr 2014 22:35:04 +0200 Subject: [erlang-questions] Errors in SSL handshake (weird client) In-Reply-To: References: Message-ID: Hi! Thank you for the pull requests we are working on including them, probably with some own additions to 340. More info will come on the pull requests later. 2014-04-20 1:52 GMT+02:00 Danil Zagoskin : > Hello again! > > function_clause in tls_connection:handle_tls_handshake is fixed in this > PR: https://github.com/erlang/otp/pull/339 > > One more crash (badarg in crypto:sign) is fixed in that PR: > https://github.com/erlang/otp/pull/340 > > For other ssl users: these two patches with two Ingela's patches: > - > https://github.com/IngelaAndin/otp/commit/7f0e683bc483b70f05fa806539bd5c540943dfd0 > - > https://github.com/IngelaAndin/otp/commit/26082cdd64823ecf92c47188f5a161e5ff2f8660 > seem to fix most of ssl server crashes in OTP 17.0. > > >> [...] > >>> Could that client work with other server implementation? >>> tls_handshake_buffer seems like a garbage (but I'm not sure), so maybe >>> here's no valid client lost. >>> >>> Should server tolerate such conditions? Should an alert be thrown >>> when tls_handshake:get_tls_handshake returns {[], _}? >>> >>> In general we do program for the correct case, but yes we want to make the server fault tolerant and we do use "try" and sometimes "catch all clauses" to stop gracefully and send alerts. [...] Another question about crashes: >>> Maybe tls_connection is a good place for format_status/2? It may be a >>> good idea to hide secrets when printing state (otherwise a person which has >>> access to error logs seems to be able to restore the private key or >>> decipher dumped traffic). >>> >>> Point taken I will create a ticket for this. [...] >>>>>> >>>>>> >>>>>> My interpretation: >>>>>> - Given pool size X, the first of each X requests fails. >>>>>> - First of failing requests catches timeout as expected, other ones >>>>>> just stall. >>>>>> - Failing requests have emulated options [{mode, list}, {active, >>>>>> true}] while working ones have the opposite [{mode, binary}, {active, >>>>>> false}]. >>>>>> >>>>>> After couple of further experiments I discovered that only every (X*N >>>>>> + 1)th acceptor inherits listening socket options, other ones always have >>>>>> [{mode, binary}, {active, false}]. >>>>>> >>>>>> Humm .... this has to do with inheritance of socket options from listen socket to accept socket and the fact that some socket options need to be emulated, and how its is implemented. The current implementation will not work for a pool of listen sockets. I have not had time solve this problem yet but it is on the todo list. Regards Ingela Erlang/OTP team - Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.elsgaard@REDACTED Thu Apr 24 01:52:56 2014 From: thomas.elsgaard@REDACTED (Thomas Elsgaard) Date: Wed, 23 Apr 2014 21:52:56 -0200 Subject: [erlang-questions] Webmachine 202 Accepted on POST ? Message-ID: Hi I need webmachine to return "202 Accepted" on POST request. I can easily do that with: {halt,202} but is there any other and "more correct way to do it ? Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean@REDACTED Thu Apr 24 05:26:25 2014 From: sean@REDACTED (Sean Cribbs) Date: Wed, 23 Apr 2014 22:26:25 -0500 Subject: [erlang-questions] Webmachine 202 Accepted on POST ? In-Reply-To: References: Message-ID: Hi Thomas, The only other time webmachine (of the Basho flavor, I know of a revised version in the works) returns 202, and that's when a DELETE request has been accepted but is incomplete (see decision M20). On Wed, Apr 23, 2014 at 6:52 PM, Thomas Elsgaard wrote: > Hi > > I need webmachine to return "202 Accepted" on POST request. I can easily > do that with: {halt,202} but is there any other and "more correct way to do > it ? > > Thomas > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Sean Cribbs Software Engineer Basho Technologies, Inc. http://basho.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn@REDACTED Thu Apr 24 08:02:10 2014 From: bjorn@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Thu, 24 Apr 2014 08:02:10 +0200 Subject: [erlang-questions] "Internal Error" compiling RFC 5912 asn1 modules In-Reply-To: <87vbu4xe2x.fsf@mitoraj.siccegge.de> References: <87vbu4xe2x.fsf@mitoraj.siccegge.de> Message-ID: On Sun, Apr 20, 2014 at 4:36 PM, Christoph Egger wrote: > Hi all! > > I'm trying to compile the OCSP module from either RFC5912 or RFC6960 > definitions which seems to fail for me: > >> Internal error: error:{case_clause, >> {type,[], >> {'Externaltypereference',62, >> 'AlgorithmInformation-2009', >> 'DIGEST-ALGORITHM'}, >> [],[],no}} >> [{asn1ct_check,check_class,2,[{file,"asn1ct_check.erl"},{line,575}]}, >> {asn1ct_check,check_type,3,[{file,"asn1ct_check.erl"},{line,3262}]}, >> {asn1ct_check,check_each_component2,4, >> [{file,"asn1ct_check.erl"},{line,5734}]}, >> {asn1ct_check,check_sequence,3,[{file,"asn1ct_check.erl"},{line,5174}]}, >> {asn1ct_check,check_type,3,[{file,"asn1ct_check.erl"},{line,3202}]}, >> {asn1ct_check,check_type,3,[{file,"asn1ct_check.erl"},{line,3253}]}, >> {asn1ct_check,check_each_component2,4, >> [{file,"asn1ct_check.erl"},{line,5734}]}, >> {asn1ct_check,check_sequence,3,[{file,"asn1ct_check.erl"},{line,5174}]}] > > Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false] > but also with R16B3.1 > > Is that a erlang bug or some broken parts of the asn.1? doesn't seem to > mention anything in the rfc errata at least. if it's the later how would > I debug this? It is a bug in the asn1 application in Erlang/OTP. I will try to fix it in the next maintenance release. Thanks for reporting this bug. /Bjorn From ingela.andin@REDACTED Thu Apr 24 10:39:53 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Thu, 24 Apr 2014 10:39:53 +0200 Subject: [erlang-questions] HTTPC doesn't do HTTPS validation In-Reply-To: <535596B2.8020505@ninenines.eu> References: <3251a0223f05492fad565ccd05f88dee@BL2PR08MB002.namprd08.prod.outlook.com> <8fcd78e1f87b4f4eb4f0e206fa226293@BL2PR08MB002.namprd08.prod.outlook.com> <535596B2.8020505@ninenines.eu> Message-ID: Hi! Here is my contribution to this discussion. 2014-04-22 0:07 GMT+02:00 Lo?c Hoguin : > You're partly wrong about curl, curl only can check the CA certs if they > are installed. It just happens that if they are installed curl is generally > configured to find them automatically (by the OS' package maintainers > usually). If they are not installed, then curl rejects pretty much > everything, which is neither better nor worse than accepting everything (I > wouldn't want either to do things differently than they do now though). > > I agree though that there should be a simple option to do the usual stuff, > aka "what browsers and command-line clients do", that would take care of > 99% of use cases without needing to spend an hour setting the thing up. > Just set the verify_it_properly option, pass the CA certs, done. > > httpc is not a full browser/command line client. It could be argued some such extensions/additions to httpc could be nice, suggestions and contributions are welcome. At the moment httpc only forwards raw ssl options to the ssl application. > On 04/21/2014 11:56 PM, Ransom Richardson wrote: > >> Thanks, it looks like that would work, and I also don't see an easier way. >> >> >> But I'm still shocked that to make a https request in Erlang that >> verifies that the server cert matches the URL, I need to define my own >> verify function. And I need to pass a bunch of ssl options on each >> request - presumably one of which is platform dependent (the list of >> root CA certs). All to do something that curl does by default. >> >> >> For the record, I've tested httpc, lhttpc, ibrowse and hackney, and none >> of them actually verify the server has a certificate for the URL they >> are connecting to. >> >> ? >> >> ------------------------------------------------------------------------ >> *From:* Alexei Sholik >> *Sent:* Monday, April 21, 2014 4:55 PM >> *To:* Ransom Richardson >> *Cc:* Benoit Chesneau; erlang-questions@REDACTED >> *Subject:* Re: [erlang-questions] HTTPC doesn't do HTTPS validation >> >> Ransom, if you look at the code closely, you'll see that it uses >> UserVerifyFun (undefined by default) for the verification. >> > Yes and if you look even closer at the code you will see that if the option is verify_peer and there is no user defined verify_fun the verify_fun will be the default verify_fun of the public_key application that looks like fun(_,{bad_cert, _} = Reason, _) -> {fail, Reason}; (_,{extension, _}, UserState) -> {unknown, UserState}; (_, valid, UserState) -> {valid, UserState}; (_, valid_peer, UserState) -> {valid, UserState} end e.i no certificate path evaluation errors are allowed. Certificate path validation is defined in RFC 5280. Currently so called policies are not supported, and CRL-validation is implemented in public_key but no automatic integration in ssl is done yet, you can however use it by supplying information in your own verify_fun. If there is a path validation error covered by RFC 5280 not handled by public_key you are welcome to suggest patches or file error reports. > >> There is also fail_if_no_peer_cert option which is set to false by >> default. >> >> https://github.com/erlang/otp/blob/maint/lib/ssl/src/ssl.erl#L589 >> > This is a server side option and configures the servers behavior for servers that request client certificates. > >> >> On Mon, Apr 21, 2014 at 9:58 PM, Ransom Richardson > > wrote: >> >> ?verify_none does seem like the default. >> >> Yes verify_none is the default, there is always a trade off between interoperability and security and you should concern yourself with understanding and configuring ssl for the safety requirements that you have. > Also, even if I pass verify_peer, nothing checks if the host name in >> the certificate matches the host that I am connecting to. So a >> server can present any validly signed certificate for a different >> site. >> >> >> Ransom >> >> >> ------------------------------------------------------------ >> ------------ >> *From:* Benoit Chesneau > > >> *Sent:* Saturday, April 19, 2014 12:31 AM >> >> *To:* Ransom Richardson >> *Cc:* erlang-questions@REDACTED > > >> *Subject:* Re: [erlang-questions] HTTPC doesn't do HTTPS validation >> >> >> >> >> On Sat, Apr 19, 2014 at 6:17 AM, Ransom Richardson >> > wrote: >> >> But as I reported in this issue >> https://github.com/benoitc/hackney/issues/101 I tested against a >> server with an invalid cert, and hackney did not catch the >> error. httpc also returned ok. >> >> >> |1> hackney:get(<<"https://localhost:8443/delay">>, [], <<>>, >> []). >> {ok,200, >> [{<<"connection">>,<<"keep-alive">>}, >> {<<"server">>,<<"Cowboy">>}, >> {<<"date">>,<<"Sat, 19 Apr 2014 00:00:26 GMT">>}, >> {<<"content-length">>,<<"0">>}], >> #Ref<0.0.0.111>}| >> >> The same happens if I pass validate_peer and the rootCA file as >> ssl_options. >> >> >> curl correctly rejects the server: >> >> >> |talko@REDACTED:~/dev/httpcbench$ curlhttps://localhost:8443/delay >> >> curl: (60) SSL certificate problem, verify that the CA cert is >> OK. Details: >> error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate >> verify failed >> >> talko@REDACTED:~/dev/httpcbench$ curl --cacert >> priv/ssl/rootCA.pemhttps://localhost:8443/delay >> >> curl: (51) SSL: certificate subject name 'httpcbench server' does >> not match target host name 'localhost'| >> >> >> This is using Erlang 17.0. Is it possible that the ssl default >> changed? >> >> >> Or am I doing something wrong? >> > > If you use openssl s_client that would be a more equal comparison for the ssl application, will it be rejected then? Regards Ingela Erlang/OTP team - Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From masse@REDACTED Thu Apr 24 10:56:43 2014 From: masse@REDACTED (mats cronqvist) Date: Thu, 24 Apr 2014 10:56:43 +0200 Subject: [erlang-questions] Fwd: erlang:trace/3 and cpu_timestamp In-Reply-To: References: Message-ID: tracing with high-resolution timers doesn't seem to work un my linux boxes (centos6, in this case); 247> erlang:trace(all,true,[call,cpu_timestamp]). ** exception error: bad argument in function erlang:trace/3 called as erlang:trace(all,true,[call,cpu_timestamp]) Seemingly, this is because this check in aclocal.m4; case $host_os in linux*) AC_MSG_RESULT([no; not stable]) LIBRT=$xrtlib ;; Indeed, commenting out the above and rebuilding beam works; 1> erlang:trace(all,true,[call,cpu_timestamp]). 24 Is there any reason not to enable this? mats -------------- next part -------------- An HTML attachment was scrubbed... URL: From solomon.wzs@REDACTED Thu Apr 24 11:15:54 2014 From: solomon.wzs@REDACTED (Solomon) Date: Thu, 24 Apr 2014 17:15:54 +0800 Subject: [erlang-questions] Download remote file with ssh_sftp was too slow Message-ID: Hi, I call ssh_sftp:read(ChannelPid, Handle, Len) to download remote file, but it was slow. I try to set Len bigger, but it seem to be limited by kernel.msgmnb. Is there any method to speed up? Regards, Solomon From lukas@REDACTED Thu Apr 24 16:17:47 2014 From: lukas@REDACTED (Lukas Larsson) Date: Thu, 24 Apr 2014 16:17:47 +0200 Subject: [erlang-questions] Fwd: erlang:trace/3 and cpu_timestamp In-Reply-To: References: Message-ID: Hello, The cpu_timestamp functionality needs the timestamp to be monotonic across cpus which the linux version of clock_gettime(CLOCK_PROCESS_CPUTIME_ID,_) isn't. This is why it is disabled on Linux. Lukas On Thu, Apr 24, 2014 at 10:56 AM, mats cronqvist wrote: > > tracing with high-resolution timers doesn't seem to work un my linux > boxes (centos6, in this case); > > 247> erlang:trace(all,true,[call,cpu_timestamp]). > ** exception error: bad argument > in function erlang:trace/3 > called as erlang:trace(all,true,[call,cpu_timestamp]) > > Seemingly, this is because this check in aclocal.m4; > > case $host_os in > linux*) > AC_MSG_RESULT([no; not stable]) > LIBRT=$xrtlib > ;; > > Indeed, commenting out the above and rebuilding beam works; > > 1> erlang:trace(all,true,[call,cpu_timestamp]). > 24 > > Is there any reason not to enable this? > > mats > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Thu Apr 24 18:04:20 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Thu, 24 Apr 2014 18:04:20 +0200 Subject: [erlang-questions] common_test test case documentation In-Reply-To: References: <531F596E.3030405@ninenines.eu> <531F59D5.8080208@ninenines.eu> Message-ID: <53593604.1030302@ninenines.eu> Hm that's weird. Using ct:comment/1,2 works but doesn't always print the comment in the comment column when the test fails. Any idea why? It doesn't seem related to how long the test takes. It is however related to running tests in parallel. I'm guessing the test_server:comment/1 function being async has to do with it. Would be awesome if it could be synchronous. :-) On 03/20/2014 04:24 PM, Siri Hansen wrote: > There is also ct:comment/1,2 which could be called at the beginning of > the test case. Note that subsequent calls to this function, or the > return value {comment,""}, will overwrite previous calls. And it does > not necessarily look very nice when a test fails... > /siri > > > 2014-03-11 19:45 GMT+01:00 Lo?c Hoguin >: > > And of course I made a mistake in one example. Sorry. > > > On 03/11/2014 07:43 PM, Lo?c Hoguin wrote: > > testcase3() -> ?TEST_HERE, {comment, "docs here"}. > > > The above should read: > > testcase3(Config) -> ?TEST_HERE, {comment, "docs here"}. > > > -- > Lo?c Hoguin > http://ninenines.eu > _________________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/__listinfo/erlang-questions > > > -- Lo?c Hoguin http://ninenines.eu From marc@REDACTED Thu Apr 24 21:31:18 2014 From: marc@REDACTED (Marc Worrell) Date: Thu, 24 Apr 2014 21:31:18 +0200 Subject: [erlang-questions] Zotonic release 0.10.0 Message-ID: Zotonic is the Erlang CMS and web framework. If you need a website with content, then Zotonic will make you happy. Today we released version 0.10.0 There are many enhancements and fixes in this release. Most notably are: - Better media and video support - Better control over redirects, with a nice admin screen. - MQTT (by means of emqtt) integration - sendfile support - Statistics available in the admin - Extra template filters, tags and options. Zotonic has been translated in: Chinese (ZH), Russian, Turkish, Dutch, Polish, Portugese, French and German. For more information and download links see: http://zotonic.com/blog/1075/version-0-10-0-released-and-beyond Many thanks to all the people who have worked hard to make this release and Zotonic possible! Need help? Want to talk? Meet us as at #zotonic on Freenode. Regards, Marc Worrell From gumm@REDACTED Thu Apr 24 22:21:03 2014 From: gumm@REDACTED (Jesse Gumm) Date: Thu, 24 Apr 2014 15:21:03 -0500 Subject: [erlang-questions] Zotonic release 0.10.0 In-Reply-To: References: Message-ID: Congrats Marc and the Zotonic Team! -- Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm On Apr 24, 2014 2:31 PM, "Marc Worrell" wrote: > Zotonic is the Erlang CMS and web framework. > If you need a website with content, then Zotonic will make you happy. > > Today we released version 0.10.0 > > There are many enhancements and fixes in this release. > > Most notably are: > > - Better media and video support > - Better control over redirects, with a nice admin screen. > - MQTT (by means of emqtt) integration > - sendfile support > - Statistics available in the admin > - Extra template filters, tags and options. > > Zotonic has been translated in: Chinese (ZH), Russian, Turkish, Dutch, > Polish, Portugese, French and German. > > For more information and download links see: > http://zotonic.com/blog/1075/version-0-10-0-released-and-beyond > > Many thanks to all the people who have worked hard to make this release > and Zotonic possible! > > Need help? Want to talk? > Meet us as at #zotonic on Freenode. > > > Regards, > > Marc Worrell > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Mark.Geib@REDACTED Thu Apr 24 23:09:44 2014 From: Mark.Geib@REDACTED (Geib, Mark) Date: Thu, 24 Apr 2014 21:09:44 +0000 Subject: [erlang-questions] running multiple instance of app release Message-ID: I recently decided to change the way I build erlang applications for delivery to my internal customers. Prior to this change my deliverable was basically the ebin, maybe the include, directory for my application that would be located in /usr/lib/me/lib/myapps/.... To run the application I would export ERL_LIBS as /usr/lib/me/ the start the node with -sname -config, etc. and off it went. In this way I can run the application many times with different -sname args. Now I am building releases with rebar. However, one thing I don't understand is how I can run more than one instance of the application on the same host. It appears that the generated script for starting/stopping the application does not support command line options/arguments. Without being able to set the node name how can run the same app more than once. Releases are very attractive for my group, but what we need is to able to do something like: /opt/me/myapp/bin/myapp start -sname node01 -config node01 and then /opt/me/myapp/bin/myapp start -sname node02 -config node02 Thanks, Mark Geib Principal Engineer Cheyenne Software Engineering mark.geib@REDACTED / 35-215 ?We, the unwilling, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little, we are now qualified to do anything with nothing.? ? Mother Teresa -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 203 bytes Desc: Message signed with OpenPGP using GPGMail URL: From a.shneyderman@REDACTED Thu Apr 24 23:31:34 2014 From: a.shneyderman@REDACTED (Alex Shneyderman) Date: Thu, 24 Apr 2014 17:31:34 -0400 Subject: [erlang-questions] running multiple instance of app release In-Reply-To: References: Message-ID: have a look at the two links below for inspiration: https://github.com/rustyio/BashoBanjo https://github.com/rzezeski/try-try-try/tree/master/2011 their technique is to provide per instance/node parameter files and generate separate releases for each node (specifying parameter files to rebar on command line and specifying output directory). They both use riak-core but you could copy their use of rebar without the need for riak-core. Cheers, Alex. On Thu, Apr 24, 2014 at 5:09 PM, Geib, Mark wrote: > I recently decided to change the way I build erlang applications for delivery to my internal customers. Prior to this change my deliverable was basically the ebin, maybe the include, directory for my application that would be located in /usr/lib/me/lib/myapps/.... To run the application I would export ERL_LIBS as /usr/lib/me/ the start the node with -sname -config, etc. and off it went. In this way I can run the application many times with different -sname args. > > Now I am building releases with rebar. However, one thing I don't understand is how I can run more than one instance of the application on the same host. It appears that the generated script for starting/stopping the application does not support command line options/arguments. Without being able to set the node name how can run the same app more than once. > > Releases are very attractive for my group, but what we need is to able to do something like: > /opt/me/myapp/bin/myapp start -sname node01 -config node01 > and then > /opt/me/myapp/bin/myapp start -sname node02 -config node02 > > Thanks, > > Mark Geib > Principal Engineer > Cheyenne Software Engineering > mark.geib@REDACTED / 35-215 > > > ?We, the unwilling, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little, we are now qualified to do anything with nothing.? > ? Mother Teresa > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From lloyd@REDACTED Fri Apr 25 00:52:51 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Thu, 24 Apr 2014 18:52:51 -0400 (EDT) Subject: [erlang-questions] Code organization for virtual websites based on Cowboy Message-ID: <1398379971.998421301@apps.rackspace.com> Hello, Suppose we have n virtual websites served out of a single Cowboy server. I get, I think, this: Routes = [Host1, Host2, ... HostN]. Host1 = {HostMatch, PathsList}. Host2 = {HostMatch, Constraints, PathsList}. But two questions trouble me: 1) What is the best directory structure to organize handlers and site-specific code to keep site code and resources separated and and easy to maintain? 2) Can these sites be developed and tested through localhost, or is a more elaborate set-up involving, say more than one box on a local network with local DNS server? Many thanks, LRP ********************************************* My books: THE GOSPEL OF ASHES http://thegospelofashes.com Strength is not enough. Do they have the courage and the cunning? Can they survive long enough to save the lives of millions? FREEIN' PANCHO http://freeinpancho.com A community of misfits help a troubled boy find his way AYA TAKEO http://ayatakeo.com Star-crossed love, war and power in an alternative universe Available through Amazon or by request from your favorite bookstore ********************************************** From dmkolesnikov@REDACTED Fri Apr 25 07:31:38 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Fri, 25 Apr 2014 08:31:38 +0300 Subject: [erlang-questions] running multiple instance of app release In-Reply-To: References: Message-ID: Hello, The technique is called variable overlay. Here is nice tutorial. http://cartesianfaith.com/2011/09/08/overlay-variables-and-rebar/ In practice, you are running independent release assembled from same code base. Best Regards, Dmitry >-|-|-(*> > On 25 Apr 2014, at 00:31, Alex Shneyderman wrote: > > have a look at the two links below for inspiration: > > https://github.com/rustyio/BashoBanjo > https://github.com/rzezeski/try-try-try/tree/master/2011 > > their technique is to provide per instance/node parameter files and > generate separate releases for each node (specifying parameter files > to rebar on command line and specifying output directory). They both > use riak-core but you could copy their use of rebar without the need > for riak-core. > > Cheers, > Alex. > > >> On Thu, Apr 24, 2014 at 5:09 PM, Geib, Mark wrote: >> I recently decided to change the way I build erlang applications for delivery to my internal customers. Prior to this change my deliverable was basically the ebin, maybe the include, directory for my application that would be located in /usr/lib/me/lib/myapps/.... To run the application I would export ERL_LIBS as /usr/lib/me/ the start the node with -sname -config, etc. and off it went. In this way I can run the application many times with different -sname args. >> >> Now I am building releases with rebar. However, one thing I don't understand is how I can run more than one instance of the application on the same host. It appears that the generated script for starting/stopping the application does not support command line options/arguments. Without being able to set the node name how can run the same app more than once. >> >> Releases are very attractive for my group, but what we need is to able to do something like: >> /opt/me/myapp/bin/myapp start -sname node01 -config node01 >> and then >> /opt/me/myapp/bin/myapp start -sname node02 -config node02 >> >> Thanks, >> >> Mark Geib >> Principal Engineer >> Cheyenne Software Engineering >> mark.geib@REDACTED / 35-215 >> >> >> ?We, the unwilling, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little, we are now qualified to do anything with nothing.? >> ? Mother Teresa >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From gfborn@REDACTED Fri Apr 25 11:16:05 2014 From: gfborn@REDACTED (Grigory Fateyev) Date: Fri, 25 Apr 2014 13:16:05 +0400 Subject: [erlang-questions] Zotonic release 0.10.0 In-Reply-To: References: Message-ID: <20140425131605.6426fbc7@greg.com> Hello Marc Worrell! On Thu, 24 Apr 2014 21:31:18 +0200 you wrote: > Zotonic is the Erlang CMS and web framework. > If you need a website with content, then Zotonic will make you happy. > > Today we released version 0.10.0 [...] Marc, congrats! -- Best regards! gfborn [at] gmail [dot] com From dmkolesnikov@REDACTED Fri Apr 25 11:28:46 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Fri, 25 Apr 2014 12:28:46 +0300 Subject: [erlang-questions] ssh remote user authorized_keys Message-ID: <45325F1C-AAA5-45EF-A50A-7CDD4A291CE2@gmail.com> Hello, I?ve notice that Erlang SSH daemon do not expand the user_dir with the name of remote user, who tries to log-in. Thus a single instance of authorised_keys exist on the server for all users. Same time, there is undocumented user_dir_fun config option that takes a function which map remote user to its ?home? folder. The question is where is the bug? At documentation: http://www.erlang.org/doc/man/ssh.html user_dir_fun is not defined At ssh_file.erl: ? CLIP ? ssh_dir({remoteuser, User}, Opts) -> case proplists:get_value(user_dir_fun, Opts) of undefined -> case proplists:get_value(user_dir, Opts) of undefined -> default_user_dir(); Dir -> Dir end; FUN -> FUN(User) end; ? CLIP ? Best Regards, Dmitry -------------- next part -------------- An HTML attachment was scrubbed... URL: From masse@REDACTED Fri Apr 25 12:35:17 2014 From: masse@REDACTED (mats cronqvist) Date: Fri, 25 Apr 2014 12:35:17 +0200 Subject: [erlang-questions] Fwd: erlang:trace/3 and cpu_timestamp In-Reply-To: References: Message-ID: man clock_gettime says; "The CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID clocks are realized on many platforms using timers from the CPUs (TSC on i386, AR.ITC on Itanium). These registers may differ between CPUs and as a consequence these clocks may return bogus results if a process is migrated to another CPU." Assuming that this is what you refer to, it seems wrong to disable cpu_timestamp on Linux. E.g., what if I run on a single-core machine? Or if my hardware is modern enough to support cross-core synchronized TSC? Also, that man page seems to be from 2007. It doesn't seem inconceivable that the kernel has grown features since then. So, OTP has disabled cpu_timestamp on all Linux machines, because it might give bad data on some hardware/kernel combinations. I would be happier if I could decide myself if I want to trust the data or not. On Thu, Apr 24, 2014 at 4:17 PM, Lukas Larsson wrote: > Hello, > > The cpu_timestamp functionality needs the timestamp to be monotonic across > cpus which the linux version of clock_gettime(CLOCK_PROCESS_CPUTIME_ID,_) > isn't. This is why it is disabled on Linux. > > Lukas > > > On Thu, Apr 24, 2014 at 10:56 AM, mats cronqvist wrote: > >> >> tracing with high-resolution timers doesn't seem to work un my linux >> boxes (centos6, in this case); >> >> 247> erlang:trace(all,true,[call,cpu_timestamp]). >> ** exception error: bad argument >> in function erlang:trace/3 >> called as erlang:trace(all,true,[call,cpu_timestamp]) >> >> Seemingly, this is because this check in aclocal.m4; >> >> case $host_os in >> linux*) >> AC_MSG_RESULT([no; not stable]) >> LIBRT=$xrtlib >> ;; >> >> Indeed, commenting out the above and rebuilding beam works; >> >> 1> erlang:trace(all,true,[call,cpu_timestamp]). >> 24 >> >> Is there any reason not to enable this? >> >> mats >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Mark.Geib@REDACTED Fri Apr 25 17:27:57 2014 From: Mark.Geib@REDACTED (Geib, Mark) Date: Fri, 25 Apr 2014 15:27:57 +0000 Subject: [erlang-questions] running multiple instance of app release In-Reply-To: References: Message-ID: <101AA4A0-93D5-4EF6-8B62-BEAFD4D0A28F@echostar.com> Thanks for the responses. This is not quite what I am trying to achieve. I do not know at build time how many, etc. nodes or release are required. I want to build a release in a way that the users of the release can run multiple, 1 or 1000, instances of that release. As an example, say I write a replacement for the tcpdump utility. I need to produce a release that could be installed on a linux box and then any number of users on the box could run my new utility, all at the same time in separate erlang nodes. The method that rabbitmq uses to delivery their broker does this, but it depends on erlang being installed on the host, etc. I am trying to achieve the same but with a release so that the users of the application do not need to install erlang, and any other libs my application uses. The approach taken by rabbitmq is not so bad on systems with good package management, like debian, since I can handle the external dependencies within the debian package. It's just not as clean as erlang releases. Thanks again, Mark Geib Principal Engineer Cheyenne Software Engineering mark.geib@REDACTED / 35-215 ?We, the unwilling, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little, we are now qualified to do anything with nothing.? ? Mother Teresa On Apr 24, 2014, at 11:31 PM, Dmitry Kolesnikov wrote: > Hello, > > The technique is called variable overlay. Here is nice tutorial. > http://cartesianfaith.com/2011/09/08/overlay-variables-and-rebar/ > > In practice, you are running independent release assembled from same code base. > > Best Regards, > Dmitry >> -|-|-(*> > >> On 25 Apr 2014, at 00:31, Alex Shneyderman wrote: >> >> have a look at the two links below for inspiration: >> >> https://github.com/rustyio/BashoBanjo >> https://github.com/rzezeski/try-try-try/tree/master/2011 >> >> their technique is to provide per instance/node parameter files and >> generate separate releases for each node (specifying parameter files >> to rebar on command line and specifying output directory). They both >> use riak-core but you could copy their use of rebar without the need >> for riak-core. >> >> Cheers, >> Alex. >> >> >>> On Thu, Apr 24, 2014 at 5:09 PM, Geib, Mark wrote: >>> I recently decided to change the way I build erlang applications for delivery to my internal customers. Prior to this change my deliverable was basically the ebin, maybe the include, directory for my application that would be located in /usr/lib/me/lib/myapps/.... To run the application I would export ERL_LIBS as /usr/lib/me/ the start the node with -sname -config, etc. and off it went. In this way I can run the application many times with different -sname args. >>> >>> Now I am building releases with rebar. However, one thing I don't understand is how I can run more than one instance of the application on the same host. It appears that the generated script for starting/stopping the application does not support command line options/arguments. Without being able to set the node name how can run the same app more than once. >>> >>> Releases are very attractive for my group, but what we need is to able to do something like: >>> /opt/me/myapp/bin/myapp start -sname node01 -config node01 >>> and then >>> /opt/me/myapp/bin/myapp start -sname node02 -config node02 >>> >>> Thanks, >>> >>> Mark Geib >>> Principal Engineer >>> Cheyenne Software Engineering >>> mark.geib@REDACTED / 35-215 >>> >>> >>> ?We, the unwilling, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little, we are now qualified to do anything with nothing.? >>> ? Mother Teresa >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 203 bytes Desc: Message signed with OpenPGP using GPGMail URL: From essen@REDACTED Fri Apr 25 19:46:59 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Fri, 25 Apr 2014 19:46:59 +0200 Subject: [erlang-questions] error_logger events sent by emulator In-Reply-To: <53544170.2080406@ninenines.eu> References: <53544170.2080406@ninenines.eu> Message-ID: <535A9F93.6010505@ninenines.eu> Me again. Putting aside how it's sent by the C code, and seeing as I need to handle the messages coming from the emulator for my purposes, I hit an issue. The emulator's error events are sent as a *string*. Not only a string, but a string which, to my knowledge, can't be parsed with anything that comes with OTP. In particular I need to figure out the number of arguments of the last call in the stacktrace, and when it comes as a list of arguments I get things like this: "[<<17 bytes>>,#Fun]" If you have tips on how to get 2 from that format, please enlighten me. Note that it should work not only in this case but also any other cases including if it had arguments as lists or tuples. Not only is it hard to programmatically figure out what's going on, but it's also inconsistent with all the other error reports that error_logger handlers receive. Can anything be done about this, and how can I help? I'm willing to send a patch to get proper Erlang terms instead of a string, but this is happening in the C code so I'll need some directions. Thanks. On 04/20/2014 11:51 PM, Lo?c Hoguin wrote: > Hello, > > I am playing with error_logger handlers at the moment. I notice that I > receive events like this one: > > {error, <0.68.0>, {emulator,"~s~n", > ["Error in process <0.649.0> on node > 'ct@REDACTED' with exit value: > {[{reason,function_clause},{mfa,{rest_resource_etags,generate_etag,2}},{stacktrace,[{cowboy_http,quoted_string,[<<17 > bytes>>,#Fun],[{file,\"src/cowboy_http.erl\"},{line,653}]},{cowboy_http,nonempty_list,2,[{file,\"src/cowboy_http.erl\"},{... > \n"]}} > > I remember reading about these from a previous discussion but I can't > find it right now. If I recall they are messages sent directly from the > C code, and again if I recall there was suggestions about removing this > type of error entirely and/or replacing with Erlang code instead of > making the C code aware of the error_logger. > > Is there any plans to change this in the future? If not, can you provide > details on what exactly triggers these sort of events? It's hard to > decide what events to ignore without knowing that. > > Thanks! > -- Lo?c Hoguin http://ninenines.eu From lloyd@REDACTED Fri Apr 25 19:53:38 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Fri, 25 Apr 2014 13:53:38 -0400 (EDT) Subject: [erlang-questions] Cowboy static file handler example Message-ID: <1398448418.230923311@apps.rackspace.com> Hello, The Cowboy static file handler example contains two demos: plain text file and HTML5 video. The plain text file demo works fine on my system; HTML5 video demo returns a blank screen. In effort to understand why, I created a plain-vanilla HTML file with a single headline tag. This also returned a blank screen. Evidently the server can't find the *.html file in the priv dir: lloyd@REDACTED:~$ curl -i http://localhost:8080/test.html HTTP/1.1 404 Not Found connection: keep-alive server: Cowboy date: Fri, 25 Apr 2014 17:48:57 GMT content-length: 0 content-type: text/html -rw-rw-r-- 1 lloyd lloyd 383631 Apr 25 13:23 small.mp4 -rw-rw-r-- 1 lloyd lloyd 872453 Apr 25 13:24 small.ogv -rw-rw-r-- 1 lloyd lloyd 84 Apr 25 13:48 test.html -rw-rw-r-- 1 lloyd lloyd 52 Apr 25 12:52 test.txt -rw-rw-r-- 1 lloyd lloyd 19753 Apr 25 13:17 tree.jpg -rw-rw-r-- 1 lloyd lloyd 106622 Apr 25 13:16 tree.png -rw-rw-r-- 1 lloyd lloyd 315 Apr 25 13:24 video.html If I list the priv dir, test.html shows up, as does test.txt. But the server finds test.txt, but not test.html. Am I doing something wrong? Or is there a problem with the Cowboy example code? Thanks, LRP ********************************************* My books: THE GOSPEL OF ASHES http://thegospelofashes.com Strength is not enough. Do they have the courage and the cunning? Can they survive long enough to save the lives of millions? FREEIN' PANCHO http://freeinpancho.com A community of misfits help a troubled boy find his way AYA TAKEO http://ayatakeo.com Star-crossed love, war and power in an alternative universe Available through Amazon or by request from your favorite bookstore ********************************************** From mayamatakeshi@REDACTED Sat Apr 26 16:38:33 2014 From: mayamatakeshi@REDACTED (mayamatakeshi) Date: Sat, 26 Apr 2014 23:38:33 +0900 Subject: [erlang-questions] Linking enif_* functions to an executable file Message-ID: Hello, I am having trouble to debug a NIF library that I wrote (and somehow I cannot make gcc to stop when a crash happens in it). So I would like to test the NIF in an executable like this: static ERL_NIF_TERM nif_myfunc(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) { ... do something with enif and native functions ... } void main() { ErlNifEnv *env = enif_alloc_env(); nif_myfunc(env, 0, 0); } But it seems enif_alloc_env is not present in any lib*.a or *.so that gets generated when I build erlang. I tried to link to the beam (renamed as libbeam.a)) but i got the linker to segfault. So I might need to extract these definitions or extract them from the beam source code and add it to my app, but it looks too much trouble. So, is there a simple way I can do this? Regards, Takeshi -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.goertzen@REDACTED Sat Apr 26 17:04:52 2014 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Sat, 26 Apr 2014 10:04:52 -0500 Subject: [erlang-questions] Linking enif_* functions to an executable file In-Reply-To: References: Message-ID: The NIF API is made to be used in the presence of a running emulator, so I don't think this approach will ever work. Some suggestions: 1. Debug with printf(). 2. Take your approach above but rip out all the NIF APIs to see if *that* works. Dan. On Sat, Apr 26, 2014 at 9:38 AM, mayamatakeshi wrote: > Hello, > I am having trouble to debug a NIF library that I wrote (and somehow I > cannot make gcc to stop when a crash happens in it). > So I would like to test the NIF in an executable like this: > > static ERL_NIF_TERM nif_myfunc(ErlNifEnv *env, int argc, const > ERL_NIF_TERM argv[]) { > ... do something with enif and native functions ... > } > > void main() { > ErlNifEnv *env = enif_alloc_env(); > nif_myfunc(env, 0, 0); > } > > But it seems enif_alloc_env is not present in any lib*.a or *.so that gets > generated when I build erlang. > I tried to link to the beam (renamed as libbeam.a)) but i got the linker > to segfault. So I might need to extract these definitions or extract them > from the beam source code and add it to my app, but it looks too much > trouble. > > So, is there a simple way I can do this? > > Regards, > Takeshi > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.santos@REDACTED Sat Apr 26 17:05:07 2014 From: michael.santos@REDACTED (Michael Santos) Date: Sat, 26 Apr 2014 11:05:07 -0400 Subject: [erlang-questions] Linking enif_* functions to an executable file In-Reply-To: References: Message-ID: <20140426150507.GA13996@ioctl> On Sat, Apr 26, 2014 at 11:38:33PM +0900, mayamatakeshi wrote: > Hello, > I am having trouble to debug a NIF library that I wrote (and somehow I > cannot make gcc to stop when a crash happens in it). Might be simpler to use gdb: http://blog.dizzyd.com/blog/2009/12/18/running-erl-in-a-debugger/ There is also the cerl script in the otp source which will run beam under gdb. > So I would like to test the NIF in an executable like this: > > static ERL_NIF_TERM nif_myfunc(ErlNifEnv *env, int argc, const ERL_NIF_TERM > argv[]) { > ... do something with enif and native functions ... > } > > void main() { > ErlNifEnv *env = enif_alloc_env(); > nif_myfunc(env, 0, 0); > } > > But it seems enif_alloc_env is not present in any lib*.a or *.so that gets > generated when I build erlang. > I tried to link to the beam (renamed as libbeam.a)) but i got the linker to > segfault. So I might need to extract these definitions or extract them from > the beam source code and add it to my app, but it looks too much trouble. > > So, is there a simple way I can do this? > > Regards, > Takeshi > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From james@REDACTED Sat Apr 26 17:50:52 2014 From: james@REDACTED (james) Date: Sat, 26 Apr 2014 16:50:52 +0100 Subject: [erlang-questions] Linking enif_* functions to an executable file In-Reply-To: References: Message-ID: <535BD5DC.1030909@mansionfamily.plus.com> Have you tried valgrind on Linux? From mayamatakeshi@REDACTED Sun Apr 27 06:00:29 2014 From: mayamatakeshi@REDACTED (mayamatakeshi) Date: Sun, 27 Apr 2014 13:00:29 +0900 Subject: [erlang-questions] Linking enif_* functions to an executable file In-Reply-To: <535BD5DC.1030909@mansionfamily.plus.com> References: <535BD5DC.1030909@mansionfamily.plus.com> Message-ID: All, thanks for the suggestions. I tried valgrind and still could not make gdb to stop on the segfault. I believe this is an issue with old gdb as this is a machine running CentOS 3.9 (required by a proprietary library that will not work with most recent distros). I am trying to install a more recent version of gdb but they keep failing to build. Til I solve this, I will recourse to debug with printf. Regards, Takeshi. On Sun, Apr 27, 2014 at 12:50 AM, james wrote: > Have you tried valgrind on Linux? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahmad@REDACTED Sun Apr 27 19:28:04 2014 From: ahmad@REDACTED (Ahmad Baitalmal) Date: Sun, 27 Apr 2014 10:28:04 -0700 Subject: [erlang-questions] bug: Can't have variables in keys? Message-ID: On 02/22/2014 10:02 PM, Charles Irvine wrote: > I suppose that this is a known bug?.. > > 9> X = x. > x > 10> #{X => y}. > # 1: illegal use of variable ?X? in map I got around this by using maps:from_list 1> A = "Variable". "Variable" 2> MyMap = maps:from_list([{A,"Value"}]). #{"Variable" => "Value"} I'm hoping this gets fixed soon. We use it for JSON<->Maps a lot. _____ Ahmad BitBuilder.com From ahmad@REDACTED Sun Apr 27 19:32:32 2014 From: ahmad@REDACTED (Ahmad Baitalmal) Date: Sun, 27 Apr 2014 10:32:32 -0700 Subject: [erlang-questions] Cowboy static file handler example In-Reply-To: <1398448418.230923311@apps.rackspace.com> References: <1398448418.230923311@apps.rackspace.com> Message-ID: Could you please post your cowboy route config. ______________ Ahmad Baitalmal CEO & Co-Founder BitBuilder.com 650.539.9401 On Apr 25, 2014, at 10:53 AM, lloyd@REDACTED wrote: > Hello, > > The Cowboy static file handler example contains two demos: plain text file and HTML5 video. The plain text file demo works fine on my system; HTML5 video demo returns a blank screen. > > In effort to understand why, I created a plain-vanilla HTML file with a single headline tag. This also returned a blank screen. > > Evidently the server can't find the *.html file in the priv dir: > > lloyd@REDACTED:~$ curl -i http://localhost:8080/test.html > HTTP/1.1 404 Not Found > connection: keep-alive > server: Cowboy > date: Fri, 25 Apr 2014 17:48:57 GMT > content-length: 0 > content-type: text/html > > -rw-rw-r-- 1 lloyd lloyd 383631 Apr 25 13:23 small.mp4 > -rw-rw-r-- 1 lloyd lloyd 872453 Apr 25 13:24 small.ogv > -rw-rw-r-- 1 lloyd lloyd 84 Apr 25 13:48 test.html > -rw-rw-r-- 1 lloyd lloyd 52 Apr 25 12:52 test.txt > -rw-rw-r-- 1 lloyd lloyd 19753 Apr 25 13:17 tree.jpg > -rw-rw-r-- 1 lloyd lloyd 106622 Apr 25 13:16 tree.png > -rw-rw-r-- 1 lloyd lloyd 315 Apr 25 13:24 video.html > > If I list the priv dir, test.html shows up, as does test.txt. But the server finds test.txt, but not test.html. > > Am I doing something wrong? Or is there a problem with the Cowboy example code? > > Thanks, > > LRP > > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From lloyd@REDACTED Sun Apr 27 19:53:54 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sun, 27 Apr 2014 13:53:54 -0400 (EDT) Subject: [erlang-questions] Cowboy static file handler example In-Reply-To: References: <1398448418.230923311@apps.rackspace.com> Message-ID: <1398621234.727627242@apps.rackspace.com> Hi Ahmad, I'm using the route config show in static_world_app:start/2; e.g.: start(_Type, _Args) -> Dispatch = cowboy_router:compile([ {'_', [ {"/[...]", cowboy_static, {priv_dir, static_world, "", [{mimetypes, cow_mimetypes, all}]}} ]} ]), {ok, _} = cowboy:start_http(http, 100, [{port, 8080}], [ {env, [{dispatch, Dispatch}]} ]), static_world_sup:start_link(). Many thanks for your help. Lloyd -----Original Message----- From: "Ahmad Baitalmal" Sent: Sunday, April 27, 2014 1:32pm To: lloyd@REDACTED Cc: "Erlang Questions" Subject: Re: [erlang-questions] Cowboy static file handler example Could you please post your cowboy route config. ______________ Ahmad Baitalmal CEO & Co-Founder BitBuilder.com 650.539.9401 On Apr 25, 2014, at 10:53 AM, lloyd@REDACTED wrote: > Hello, > > The Cowboy static file handler example contains two demos: plain text file and HTML5 video. The plain text file demo works fine on my system; HTML5 video demo returns a blank screen. > > In effort to understand why, I created a plain-vanilla HTML file with a single headline tag. This also returned a blank screen. > > Evidently the server can't find the *.html file in the priv dir: > > lloyd@REDACTED:~$ curl -i http://localhost:8080/test.html > HTTP/1.1 404 Not Found > connection: keep-alive > server: Cowboy > date: Fri, 25 Apr 2014 17:48:57 GMT > content-length: 0 > content-type: text/html > > -rw-rw-r-- 1 lloyd lloyd 383631 Apr 25 13:23 small.mp4 > -rw-rw-r-- 1 lloyd lloyd 872453 Apr 25 13:24 small.ogv > -rw-rw-r-- 1 lloyd lloyd 84 Apr 25 13:48 test.html > -rw-rw-r-- 1 lloyd lloyd 52 Apr 25 12:52 test.txt > -rw-rw-r-- 1 lloyd lloyd 19753 Apr 25 13:17 tree.jpg > -rw-rw-r-- 1 lloyd lloyd 106622 Apr 25 13:16 tree.png > -rw-rw-r-- 1 lloyd lloyd 315 Apr 25 13:24 video.html > > If I list the priv dir, test.html shows up, as does test.txt. But the server finds test.txt, but not test.html. > > Am I doing something wrong? Or is there a problem with the Cowboy example code? > > Thanks, > > LRP > > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From essen@REDACTED Sun Apr 27 19:54:23 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Sun, 27 Apr 2014 19:54:23 +0200 Subject: [erlang-questions] Cowboy static file handler example In-Reply-To: <1398448418.230923311@apps.rackspace.com> References: <1398448418.230923311@apps.rackspace.com> Message-ID: <535D444F.3020908@ninenines.eu> What's your browser, and did you try a different browser? On 04/25/2014 07:53 PM, lloyd@REDACTED wrote: > Hello, > > The Cowboy static file handler example contains two demos: plain text file and HTML5 video. The plain text file demo works fine on my system; HTML5 video demo returns a blank screen. > > In effort to understand why, I created a plain-vanilla HTML file with a single headline tag. This also returned a blank screen. > > Evidently the server can't find the *.html file in the priv dir: > > lloyd@REDACTED:~$ curl -i http://localhost:8080/test.html > HTTP/1.1 404 Not Found > connection: keep-alive > server: Cowboy > date: Fri, 25 Apr 2014 17:48:57 GMT > content-length: 0 > content-type: text/html > > -rw-rw-r-- 1 lloyd lloyd 383631 Apr 25 13:23 small.mp4 > -rw-rw-r-- 1 lloyd lloyd 872453 Apr 25 13:24 small.ogv > -rw-rw-r-- 1 lloyd lloyd 84 Apr 25 13:48 test.html > -rw-rw-r-- 1 lloyd lloyd 52 Apr 25 12:52 test.txt > -rw-rw-r-- 1 lloyd lloyd 19753 Apr 25 13:17 tree.jpg > -rw-rw-r-- 1 lloyd lloyd 106622 Apr 25 13:16 tree.png > -rw-rw-r-- 1 lloyd lloyd 315 Apr 25 13:24 video.html > > If I list the priv dir, test.html shows up, as does test.txt. But the server finds test.txt, but not test.html. > > Am I doing something wrong? Or is there a problem with the Cowboy example code? > > Thanks, > > LRP > > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From essen@REDACTED Sun Apr 27 19:59:33 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Sun, 27 Apr 2014 19:59:33 +0200 Subject: [erlang-questions] Code organization for virtual websites based on Cowboy In-Reply-To: <1398379971.998421301@apps.rackspace.com> References: <1398379971.998421301@apps.rackspace.com> Message-ID: <535D4585.4060806@ninenines.eu> Hi, Sorry for the late reply, I had to think a little about it. I would have a single application for all handlers. I would create two folders under src, one per host. For example: src/www src/chat Static files I would probably want to have a specific host for them so I wouldn't need to separate (I could create extra folders for the host-specific stuff, but there's no reason to separate jquery and others). On initialization I would have the file src/my_app.erl call a predefined function for each host to get their routing rules, for example www_routes:get() ++ chat_routes:get(). I would make sure that I only have handlers or helpers in this application. I would make separate applications for different parts of the system, for example an application for managing sessions, an application for chat communication, an application for www business logic, etc. and I would call these applications from the handlers. Does this answer your question? On 04/25/2014 12:52 AM, lloyd@REDACTED wrote: > Hello, > > Suppose we have n virtual websites served out of a single Cowboy server. > > I get, I think, this: > > Routes = [Host1, Host2, ... HostN]. > Host1 = {HostMatch, PathsList}. > Host2 = {HostMatch, Constraints, PathsList}. > > But two questions trouble me: > > 1) What is the best directory structure to organize handlers and site-specific code to keep site code and resources separated and and easy to maintain? > > 2) Can these sites be developed and tested through localhost, or is a more elaborate set-up involving, say more than one box on a local network with local DNS server? > > Many thanks, > > LRP > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From lloyd@REDACTED Sun Apr 27 21:19:50 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sun, 27 Apr 2014 15:19:50 -0400 (EDT) Subject: [erlang-questions] Cowboy static file handler example In-Reply-To: <535D444F.3020908@ninenines.eu> References: <1398448418.230923311@apps.rackspace.com> <535D444F.3020908@ninenines.eu> Message-ID: <1398626390.081716826@apps.rackspace.com> Hi Lo?c, Browser is Firefox 28.0. I'm just now updating Ubuntu from 12.10 to 13.10. Will re-visit this when update is finished. Many thanks, Lloyd -----Original Message----- From: "Lo?c Hoguin" Sent: Sunday, April 27, 2014 1:54pm To: lloyd@REDACTED, "erlang-questions@REDACTED" Subject: Re: [erlang-questions] Cowboy static file handler example What's your browser, and did you try a different browser? On 04/25/2014 07:53 PM, lloyd@REDACTED wrote: > Hello, > > The Cowboy static file handler example contains two demos: plain text file and HTML5 video. The plain text file demo works fine on my system; HTML5 video demo returns a blank screen. > > In effort to understand why, I created a plain-vanilla HTML file with a single headline tag. This also returned a blank screen. > > Evidently the server can't find the *.html file in the priv dir: > > lloyd@REDACTED:~$ curl -i http://localhost:8080/test.html > HTTP/1.1 404 Not Found > connection: keep-alive > server: Cowboy > date: Fri, 25 Apr 2014 17:48:57 GMT > content-length: 0 > content-type: text/html > > -rw-rw-r-- 1 lloyd lloyd 383631 Apr 25 13:23 small.mp4 > -rw-rw-r-- 1 lloyd lloyd 872453 Apr 25 13:24 small.ogv > -rw-rw-r-- 1 lloyd lloyd 84 Apr 25 13:48 test.html > -rw-rw-r-- 1 lloyd lloyd 52 Apr 25 12:52 test.txt > -rw-rw-r-- 1 lloyd lloyd 19753 Apr 25 13:17 tree.jpg > -rw-rw-r-- 1 lloyd lloyd 106622 Apr 25 13:16 tree.png > -rw-rw-r-- 1 lloyd lloyd 315 Apr 25 13:24 video.html > > If I list the priv dir, test.html shows up, as does test.txt. But the server finds test.txt, but not test.html. > > Am I doing something wrong? Or is there a problem with the Cowboy example code? > > Thanks, > > LRP > > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From lloyd@REDACTED Sun Apr 27 21:23:39 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sun, 27 Apr 2014 15:23:39 -0400 (EDT) Subject: [erlang-questions] Code organization for virtual websites based on Cowboy In-Reply-To: <535D4585.4060806@ninenines.eu> References: <1398379971.998421301@apps.rackspace.com> <535D4585.4060806@ninenines.eu> Message-ID: <1398626619.67939109@apps.rackspace.com> Hi, Sounds promising. I'll have to experiment. This would be a great tutorial. It'll be a awhile before I can clear the deck to give it a try. But if I can achieve success, I'll consider writing up the tutorial. Many thanks. And thanks again for your great work with Cowboy and other Open Source apps. Best wishes, Lloyd -----Original Message----- From: "Lo?c Hoguin" Sent: Sunday, April 27, 2014 1:59pm To: lloyd@REDACTED, "erlang-questions@REDACTED" Subject: Re: [erlang-questions] Code organization for virtual websites based on Cowboy Hi, Sorry for the late reply, I had to think a little about it. I would have a single application for all handlers. I would create two folders under src, one per host. For example: src/www src/chat Static files I would probably want to have a specific host for them so I wouldn't need to separate (I could create extra folders for the host-specific stuff, but there's no reason to separate jquery and others). On initialization I would have the file src/my_app.erl call a predefined function for each host to get their routing rules, for example www_routes:get() ++ chat_routes:get(). I would make sure that I only have handlers or helpers in this application. I would make separate applications for different parts of the system, for example an application for managing sessions, an application for chat communication, an application for www business logic, etc. and I would call these applications from the handlers. Does this answer your question? On 04/25/2014 12:52 AM, lloyd@REDACTED wrote: > Hello, > > Suppose we have n virtual websites served out of a single Cowboy server. > > I get, I think, this: > > Routes = [Host1, Host2, ... HostN]. > Host1 = {HostMatch, PathsList}. > Host2 = {HostMatch, Constraints, PathsList}. > > But two questions trouble me: > > 1) What is the best directory structure to organize handlers and site-specific code to keep site code and resources separated and and easy to maintain? > > 2) Can these sites be developed and tested through localhost, or is a more elaborate set-up involving, say more than one box on a local network with local DNS server? > > Many thanks, > > LRP > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From matthias@REDACTED Mon Apr 28 00:03:48 2014 From: matthias@REDACTED (Matthias Lang) Date: Mon, 28 Apr 2014 00:03:48 +0200 Subject: [erlang-questions] error_logger events sent by emulator In-Reply-To: <535A9F93.6010505@ninenines.eu> References: <53544170.2080406@ninenines.eu> <535A9F93.6010505@ninenines.eu> Message-ID: <20140427220348.GA12152@corelatus.se> Hi, Lo?c wrote: >I am playing with error_logger handlers at the moment. I notice that I >receive events like this one: >{error, <0.68.0>, {emulator,"~s~n", > ["Error in process <0.649.0> on node >'ct@REDACTED' with exit value: >I remember reading about these from a previous discussion but I can't >find it right now. If I recall they are messages sent directly from the >C code, and again if I recall there was suggestions about removing this >type of error entirely and/or replacing with Erlang code instead of >making the C code aware of the error_logger. I think the earlier discussion you remember starts here (my mail): http://erlang.org/pipermail/erlang-questions/2013-October/075867.html My biased summary of the thread: - Everyone agreed the behaviour was unfortunate/nobody was a fan of it. - I thought it was so pointless that it might be possible to ditch the emulator code entirely, i.e. just don't report those errors. Others thought that might be a bad idea, though nobody gave a concrete example which showed why. - Anthony Ramine suggested a way to improve the current situation without tossing the code. It didn't feel satisfying, but it might be the least worst approach. I ended up dealing with the problem by avoiding it---I wrapped spawn() so that the errors I was seeing never made it to that emulator code. proc_lib:spawn() does the same thing. But it looks like your problem is more general than mine was. Matt From lloyd@REDACTED Mon Apr 28 05:10:39 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sun, 27 Apr 2014 23:10:39 -0400 (EDT) Subject: [erlang-questions] Error while upgrading Erlang 17.0 from 16B Message-ID: <1398654639.57314333@apps.rackspace.com> Hello, I suppose we all have those days when our computers defy our intentions, hopes, and ambitions. Here's my third in as many days: Following the "Installation Using Repository" instructions on https://www.erlang-solutions.com/downloads/download-erlang-otp, the system returned a very long error message while trying to upgrade Erlang 16B to 17.0 on Ubuntu 13.10: Breaks existing package 'erlang-appmon' that conflict: 'erlang-appmon.' But the '/tmp/esl-erlang_17.0.1-ubuntu-saucy_amb64.eeb' provides it via... Is there a generous wise person in the house who can tell me if I'm doing something stupid again, or if there's something I don't know, or if there's a problem with the Erlang-Solutions package and, mostly, how can I get past this problem? Many thanks, LRP ********************************************* My books: THE GOSPEL OF ASHES http://thegospelofashes.com Strength is not enough. Do they have the courage and the cunning? Can they survive long enough to save the lives of millions? FREEIN' PANCHO http://freeinpancho.com A community of misfits help a troubled boy find his way AYA TAKEO http://ayatakeo.com Star-crossed love, war and power in an alternative universe Available through Amazon or by request from your favorite bookstore ********************************************** From essen@REDACTED Mon Apr 28 12:00:32 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 28 Apr 2014 12:00:32 +0200 Subject: [erlang-questions] Error while upgrading Erlang 17.0 from 16B In-Reply-To: <1398654639.57314333@apps.rackspace.com> References: <1398654639.57314333@apps.rackspace.com> Message-ID: <535E26C0.8060107@ninenines.eu> I don't know Ubuntu, but appmon was removed in R17. I'd suggest removing all Erlang packages you got and then installing R17 again. On 04/28/2014 05:10 AM, lloyd@REDACTED wrote: > Hello, > > I suppose we all have those days when our computers defy our intentions, hopes, and ambitions. Here's my third in as many days: > > Following the "Installation Using Repository" instructions on https://www.erlang-solutions.com/downloads/download-erlang-otp, the system returned a very long error message while trying to upgrade Erlang 16B to 17.0 on Ubuntu 13.10: > > Breaks existing package 'erlang-appmon' that conflict: 'erlang-appmon.' But the '/tmp/esl-erlang_17.0.1-ubuntu-saucy_amb64.eeb' provides it via... > > Is there a generous wise person in the house who can tell me if I'm doing something stupid again, or if there's something I don't know, or if there's a problem with the Erlang-Solutions package and, mostly, how can I get past this problem? > > Many thanks, > > LRP > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From lukas@REDACTED Mon Apr 28 14:27:51 2014 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 28 Apr 2014 14:27:51 +0200 Subject: [erlang-questions] Fwd: erlang:trace/3 and cpu_timestamp In-Reply-To: References: Message-ID: On Fri, Apr 25, 2014 at 12:35 PM, mats cronqvist wrote: > man clock_gettime says; > "The CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID clocks are > realized on many platforms using timers from the CPUs (TSC on i386, > AR.ITC on Itanium). These registers may differ between CPUs and as a > consequence these clocks may return bogus results if a process is migrated > to another CPU." > > Assuming that this is what you refer to, it seems wrong to disable > cpu_timestamp on Linux. E.g., what if I run on a single-core machine? Or if > my hardware is modern enough to support cross-core synchronized TSC? > That is indeed the feature that I'm talking about. The monotonic version of it is what is used in the normal timestamp mechanism. And as you mention if you do happen to run on a single core system you should be able to use the timestamp without any issues. > > So, OTP has disabled cpu_timestamp on all Linux machines, because it > might give bad data on some hardware/kernel combinations. I would be > happier if I could decide myself if I want to trust the data or not. > Indeed, I can think of no reason why we would not allow people that know their OS/hw gives monotonic cpu timestamps to use this. In fact if you cross compile it is possible to do this already. I'll see if I can find some time and have a look at what can be done to help users use this functionality if they want it. I'll probably just to add a configure switch that circumvents the check that you found. As always if someone feels like making a patch for it that would be much appreciated. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From sverker.eriksson@REDACTED Mon Apr 28 14:51:32 2014 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Mon, 28 Apr 2014 14:51:32 +0200 Subject: [erlang-questions] Linking enif_* functions to an executable file In-Reply-To: References: <535BD5DC.1030909@mansionfamily.plus.com> Message-ID: <535E4ED4.2080708@erix.ericsson.se> On 04/27/2014 06:00 AM, mayamatakeshi wrote: > All, thanks for the suggestions. > I tried valgrind and still could not make gdb to stop on the segfault. > I believe this is an issue with old gdb as this is a machine running CentOS > 3.9 (required by a proprietary library that will not work with most recent > distros). I am trying to install a more recent version of gdb but they keep > failing to build. > Til I solve this, I will recourse to debug with printf. > Regards, > Takeshi. > > I also recommend to use a debug emulator during NIF development. A lot of runtime assertions for earlier error detection and no compiler optimizations for nicer core dumps. cd $ERL_TOP/erts/emulator make TYPE=debug smp plain $ERL_TOP/bin/cerl -debug /Sverker, Erlang/OTP From essen@REDACTED Mon Apr 28 16:09:32 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 28 Apr 2014 16:09:32 +0200 Subject: [erlang-questions] error_logger events sent by emulator In-Reply-To: <20140427220348.GA12152@corelatus.se> References: <53544170.2080406@ninenines.eu> <535A9F93.6010505@ninenines.eu> <20140427220348.GA12152@corelatus.se> Message-ID: <535E611C.9040001@ninenines.eu> Hey, thanks for the pointers. On 04/28/2014 12:03 AM, Matthias Lang wrote: > I think the earlier discussion you remember starts here (my mail): > > http://erlang.org/pipermail/erlang-questions/2013-October/075867.html > > My biased summary of the thread: > > - Everyone agreed the behaviour was unfortunate/nobody was a fan of it. > > - I thought it was so pointless that it might be possible to ditch > the emulator code entirely, i.e. just don't report those errors. > Others thought that might be a bad idea, though nobody gave a > concrete example which showed why. After a little thinking I got to this point: I'm OK with the C code sending these errors. There are a lot of other errors sent by the emulator, and it doesn't seem like all of them could be moved to the Erlang side anyway. So the VM has to know where to send errors. It's very useful for newcomers too, start the shell, spawn a process, it crashes, you get an error printed. Under no circumstances should this feedback ever be removed (at least not by default). I'm not OK with how this particular error is sent. What the code basically does is: * Detect process crash * Extract stacktrace etc. as Erlang terms * Format Erlang terms as short string * Send string to error_logger Note that the stacktrace may contain arguments depending on how the process crashed. Also note that if the error isn't catched there is two string formattings going on as the error received is {emulator, "~s~n", Msg} and this results in another formatting call when printing it. What I would like to happen: * Detect process crash * Extract stacktrace etc. as Erlang terms * Make sure the stacktrace contains no arguments, only arity * Make sure the stacktrace is below a certain size (for example last 5 calls by default, perhaps configurable through process flags) * Send error as Erlang term to error_logger The error received would be similar to {emulator, "Error in process ~p on node ~p with exit value: ~p~n", [Pid, Node, Stacktrace]} which makes it easy to extract information or format as desired. Basically the same as what we get now, except pre-formatting. Not sending arguments and limiting the stacktrace also ensures that we don't flood the VM needlessly. In fact it's potentially better than what we have today because we might not need to create an Erlang term for the whole stacktrace and then print a short portion of it when formatting, we can just take the last N calls. If the stacktrace is huge, we potentially save a lot of resources. I don't see it being backward incompatible as I'm probably the only crazy person who went ahead and parsed that awful string to extract information. > I ended up dealing with the problem by avoiding it---I wrapped spawn() > so that the errors I was seeing never made it to that emulator code. > proc_lib:spawn() does the same thing. But it looks like your problem > is more general than mine was. Well I could solve it exactly the way you did to be perfectly honest. I didn't think of that, so I ended up parsing the string for the info I needed (and so far it works OK). But I feel it'd be better with a proper OTP patch. I'm willing to write said patch if that seems interesting to others. So yeah, if any of what I just wrote makes sense to you, please tell me and I'll do a first try at a patch. -- Lo?c Hoguin http://ninenines.eu From drormein@REDACTED Mon Apr 28 16:28:43 2014 From: drormein@REDACTED (Dror Mein) Date: Mon, 28 Apr 2014 07:28:43 -0700 (PDT) Subject: [erlang-questions] how to reattach to an arleady existing node? Message-ID: <1398695323.74472.YahooMailNeo@web164502.mail.gq1.yahoo.com> Hi all, I'm running an Erlang application on a remote shell. I'm running it via: ./bin/myapp start ./bin/myapp attach The local computer has crashed, so the terminal that ran those two commands is dead.? I restarted the computer and when I went back to the remote shell and tried to reattach to the already running application, I received the following error message: "Another to_erl process already attached to pipe /tmp//opt/mydir/myapp/erlang.pipe.1." Is there a way to reattach to the running application without killing it (ie ./bin/myapp stop) thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From drormein@REDACTED Mon Apr 28 16:45:43 2014 From: drormein@REDACTED (Dror Mein) Date: Mon, 28 Apr 2014 07:45:43 -0700 (PDT) Subject: [erlang-questions] how to reattach to an arleady existing node? In-Reply-To: <1398695323.74472.YahooMailNeo@web164502.mail.gq1.yahoo.com> References: <1398695323.74472.YahooMailNeo@web164502.mail.gq1.yahoo.com> Message-ID: <1398696343.95340.YahooMailNeo@web164501.mail.gq1.yahoo.com> hi again, not sure what happened, but somehow it now works... oh well. On Monday, April 28, 2014 5:28 PM, Dror Mein wrote: Hi all, I'm running an Erlang application on a remote shell. I'm running it via: ./bin/myapp start ./bin/myapp attach The local computer has crashed, so the terminal that ran those two commands is dead.? I restarted the computer and when I went back to the remote shell and tried to reattach to the already running application, I received the following error message: "Another to_erl process already attached to pipe /tmp//opt/mydir/myapp/erlang.pipe.1." Is there a way to reattach to the running application without killing it (ie ./bin/myapp stop) thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From anthonym@REDACTED Mon Apr 28 19:58:47 2014 From: anthonym@REDACTED (ANTHONY MOLINARO) Date: Mon, 28 Apr 2014 10:58:47 -0700 Subject: [erlang-questions] Linking enif_* functions to an executable file In-Reply-To: <535E4ED4.2080708@erix.ericsson.se> References: <535BD5DC.1030909@mansionfamily.plus.com> <535E4ED4.2080708@erix.ericsson.se> Message-ID: This reminds me of an enhancement I'd love to see. Right now, there's some sort of naming convention around beam as I list the contents of the erts bin directory and see both a beam and a beam.smp executable. IIRC when you compile a different type, sometimes you get another executable, sometimes you get the same executables with the given features enabled. Also, cerl is not currently installed. What if there was a cleaner way to create these, and have some or all of them installed, then switch easily. So for instance, instead of TYPE=debug, what if you could do % ./configure --enable-debug-support and then when you built it would create 2 executables beam.debug beam Then erl could have an argument that allowed you to enable debug, like % erl -type debug Then suppose this was extended for all TYPE targets (and of course, flavor would work as it does now, resulting in a second set of executables with .smp in their name). This would allow you to have several different beam executables installed on a system and switch between them when you need to (for instance if I want to check lock usage with the lcnt vm, I currently need to rebuild, or spend some time up front building several packages, one for each type, whereas if I felt I might need it I could enable when I build the initial package). Anyway, just an idea, not sure how many others might want this sort of setup, -Anthony On Apr 28, 2014, at 5:51 AM, Sverker Eriksson wrote: > On 04/27/2014 06:00 AM, mayamatakeshi wrote: >> All, thanks for the suggestions. >> I tried valgrind and still could not make gdb to stop on the segfault. >> I believe this is an issue with old gdb as this is a machine running CentOS >> 3.9 (required by a proprietary library that will not work with most recent >> distros). I am trying to install a more recent version of gdb but they keep >> failing to build. >> Til I solve this, I will recourse to debug with printf. >> Regards, >> Takeshi. >> >> > I also recommend to use a debug emulator during NIF development. > A lot of runtime assertions for earlier error detection and no compiler optimizations for nicer core dumps. > > > cd $ERL_TOP/erts/emulator > make TYPE=debug smp plain > > $ERL_TOP/bin/cerl -debug > > > > /Sverker, Erlang/OTP > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From Mark.Geib@REDACTED Mon Apr 28 21:30:09 2014 From: Mark.Geib@REDACTED (Geib, Mark) Date: Mon, 28 Apr 2014 19:30:09 +0000 Subject: [erlang-questions] running multiple instance of app release In-Reply-To: References: Message-ID: <3BA4D5DF-2DC6-4D39-BE96-576CA5AC477E@echostar.com> After some arm wrestling I discovered the "real" problem, operator error. As it turns out the release works just as I wanted. I am able to start the release with "-sname nodeName -config nodeConfig" with no issue at all. Sorry for the noise. Mark Geib Principal Engineer Cheyenne Software Engineering mark.geib@REDACTED / 35-215 ?We, the unwilling, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little, we are now qualified to do anything with nothing.? ? Mother Teresa On Apr 24, 2014, at 3:31 PM, Alex Shneyderman wrote: > have a look at the two links below for inspiration: > > https://github.com/rustyio/BashoBanjo > https://github.com/rzezeski/try-try-try/tree/master/2011 > > their technique is to provide per instance/node parameter files and > generate separate releases for each node (specifying parameter files > to rebar on command line and specifying output directory). They both > use riak-core but you could copy their use of rebar without the need > for riak-core. > > Cheers, > Alex. > > > On Thu, Apr 24, 2014 at 5:09 PM, Geib, Mark wrote: >> I recently decided to change the way I build erlang applications for delivery to my internal customers. Prior to this change my deliverable was basically the ebin, maybe the include, directory for my application that would be located in /usr/lib/me/lib/myapps/.... To run the application I would export ERL_LIBS as /usr/lib/me/ the start the node with -sname -config, etc. and off it went. In this way I can run the application many times with different -sname args. >> >> Now I am building releases with rebar. However, one thing I don't understand is how I can run more than one instance of the application on the same host. It appears that the generated script for starting/stopping the application does not support command line options/arguments. Without being able to set the node name how can run the same app more than once. >> >> Releases are very attractive for my group, but what we need is to able to do something like: >> /opt/me/myapp/bin/myapp start -sname node01 -config node01 >> and then >> /opt/me/myapp/bin/myapp start -sname node02 -config node02 >> >> Thanks, >> >> Mark Geib >> Principal Engineer >> Cheyenne Software Engineering >> mark.geib@REDACTED / 35-215 >> >> >> ?We, the unwilling, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little, we are now qualified to do anything with nothing.? >> ? Mother Teresa >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 203 bytes Desc: Message signed with OpenPGP using GPGMail URL: From dbarker@REDACTED Mon Apr 28 21:43:07 2014 From: dbarker@REDACTED (Deryk Barker) Date: Mon, 28 Apr 2014 12:43:07 -0700 Subject: [erlang-questions] Error while upgrading Erlang 17.0 from 16B In-Reply-To: <1398654639.57314333@apps.rackspace.com> References: <1398654639.57314333@apps.rackspace.com> Message-ID: <535EAF4B.1010400@camosun.bc.ca> On 14-04-27 08:10 PM, lloyd@REDACTED wrote: > Hello, > > I suppose we all have those days when our computers defy our intentions, hopes, and ambitions. Here's my third in as many days: > > Following the "Installation Using Repository" instructions on https://www.erlang-solutions.com/downloads/download-erlang-otp, the system returned a very long error message while trying to upgrade Erlang 16B to 17.0 on Ubuntu 13.10: > > Breaks existing package 'erlang-appmon' that conflict: 'erlang-appmon.' But the '/tmp/esl-erlang_17.0.1-ubuntu-saucy_amb64.eeb' provides it via... > > Is there a generous wise person in the house who can tell me if I'm doing something stupid again, or if there's something I don't know, or if there's a problem with the Erlang-Solutions package and, mostly, how can I get past this problem? > I claim no great expertise, but I needed to replace the erlang on my laptop because it was suffering from the "debugger crashes when I move the mouse" problem - a bit of a drawabck for demo'ing stuff in class to my students. I failed to upgrade to 17.0 (I'm running Mint BTW, an ubuntu derivative, as you doubtless know). So, in something approached desperation... dpkg -r erlang which removed that but left all its dependencies, which required apt-get autoremove to get rid of them, then I could do: dpkg -i esl_erlang_whatever.deb and install the new version. I downloaded the debian package BTW. Hope this helps even slightly... deryk ------- Deryk Barker, Computer Science Dept. Camosun College, Victoria, BC, Canada From paul.sherwood@REDACTED Tue Apr 29 08:12:01 2014 From: paul.sherwood@REDACTED (Paul Sherwood) Date: Tue, 29 Apr 2014 07:12:01 +0100 Subject: [erlang-questions] Building erlang from git on a vanilla linux system... Message-ID: Hi folks, I'm trying to build erlang from source on a Baserock system, which as far as possible has 'normal' gcc, autotools etc. Config happens fine, but the build fails at SMTP as follows, both with default autotools and using ./otp_build autoconf script. Any ideas how to fix this, please? br Paul === Entering application snmp make[3]: Entering directory `/erlang.build/lib/snmp/src/compile' YECC snmpc_mib_gram.erl ERLC ../../ebin/snmpc.beam ERLC ../../ebin/snmpc_lib.beam ERLC ../../ebin/snmpc_mib_to_hrl.beam ERLC ../../ebin/snmpc_misc.beam ERLC ../../ebin/snmpc_tok.beam VSN ../../bin/snmpc ERLC ../../ebin/snmpc_mib_gram.beam make[3]: Leaving directory `/erlang.build/lib/snmp/src/compile' make[3]: Entering directory `/erlang.build/lib/snmp/mibs' make[3]: *** No rule to make target `opt'. Stop. make[3]: Leaving directory `/erlang.build/lib/snmp/mibs' make[2]: *** [opt] Error 2 make[2]: Leaving directory `/erlang.build/lib/snmp' make[1]: *** [opt] Error 2 make[1]: Leaving directory `/erlang.build/lib' make: *** [tertiary_bootstrap_build] Error 2 From ingela.andin@REDACTED Tue Apr 29 11:08:26 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 29 Apr 2014 11:08:26 +0200 Subject: [erlang-questions] ssh remote user authorized_keys In-Reply-To: <45325F1C-AAA5-45EF-A50A-7CDD4A291CE2@gmail.com> References: <45325F1C-AAA5-45EF-A50A-7CDD4A291CE2@gmail.com> Message-ID: Hi! Will have to look into this and see what we can do to improve the situation. I have created a ticket to handle the issue. Regards Ingela Erlang/OTP Team - Ericsson AB 2014-04-25 11:28 GMT+02:00 Dmitry Kolesnikov : > Hello, > > I?ve notice that Erlang SSH daemon do not expand the user_dir with the > name of remote user, who tries to log-in. Thus a single instance of > authorised_keys exist on the server for all users. Same time, there is > undocumented user_dir_fun config option that takes a function which map > remote user to its ?home? folder. > > The question is where is the bug? > > At documentation: http://www.erlang.org/doc/man/ssh.html user_dir_fun is > not defined > > At ssh_file.erl: > > ? CLIP ? > > ssh_dir({remoteuser, User}, Opts) -> > case proplists:get_value(user_dir_fun, Opts) of > undefined -> > case proplists:get_value(user_dir, Opts) of > undefined -> > default_user_dir(); > Dir -> > Dir > end; > FUN -> > FUN(User) > end; > > ? CLIP ? > > Best Regards, > Dmitry > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Tue Apr 29 11:19:41 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Tue, 29 Apr 2014 11:19:41 +0200 Subject: [erlang-questions] 17.0.1 Message-ID: It's been a few days since Rickard tagged 17.0.1 and there's no announcement so far. Is the tag temporary and mutable, or is there just a delay? From andra.dinu@REDACTED Tue Apr 29 11:50:56 2014 From: andra.dinu@REDACTED (Andra Dinu) Date: Tue, 29 Apr 2014 11:50:56 +0200 (CEST) Subject: [erlang-questions] Vote for the Erlang User of the Year In-Reply-To: <1626599267.355358.1398764997908.JavaMail.zimbra@erlang-solutions.com> Message-ID: <500834445.355365.1398765056890.JavaMail.zimbra@erlang-solutions.com> The search for the Erlang User of the Year is ON! The Erlang User who has made outstanding contributions widely recognised by the community in 2013 is hiding among us! Help us find and reward this user at the EUC 2014. Name your favourite and give a short explanation on why your nominee deserves to take the trophy home this year in this Google doc: http://goo.gl/Qpbqiz. We?re accepting nominations until 9 May. The Programme Committee will read through the nominations and make the final decision. Thanks, Andra -- Andra Dinu Community & Social ERLANG SOLUTIONS LTD New Loom House 101 Back Church Lane London, E1 1LU United Kingdom Tel +44(0)2076550344 Mob +44(0)7983484387 www.erlang-solutions.com From micael.karlberg@REDACTED Tue Apr 29 13:16:05 2014 From: micael.karlberg@REDACTED (Micael Karlberg) Date: Tue, 29 Apr 2014 13:16:05 +0200 Subject: [erlang-questions] Building erlang from git on a vanilla linux system... In-Reply-To: References: Message-ID: <535F89F5.2050000@erix.ericsson.se> Hi, Make claims there is no 'opt' target, which is a bit strange. What does the makefile in the mibs dir look like? Regards, /BMK On 04/29/2014 08:12 AM, Paul Sherwood wrote: > Hi folks, > > I'm trying to build erlang from source on a Baserock system, which as far as possible has 'normal' > gcc, autotools etc. > > Config happens fine, but the build fails at SMTP as follows, both with default autotools and using > ./otp_build autoconf script. > > Any ideas how to fix this, please? > > br > Paul > > === Entering application snmp > make[3]: Entering directory `/erlang.build/lib/snmp/src/compile' > YECC snmpc_mib_gram.erl > ERLC ../../ebin/snmpc.beam > ERLC ../../ebin/snmpc_lib.beam > ERLC ../../ebin/snmpc_mib_to_hrl.beam > ERLC ../../ebin/snmpc_misc.beam > ERLC ../../ebin/snmpc_tok.beam > VSN ../../bin/snmpc > ERLC ../../ebin/snmpc_mib_gram.beam > make[3]: Leaving directory `/erlang.build/lib/snmp/src/compile' > make[3]: Entering directory `/erlang.build/lib/snmp/mibs' > make[3]: *** No rule to make target `opt'. Stop. > make[3]: Leaving directory `/erlang.build/lib/snmp/mibs' > make[2]: *** [opt] Error 2 > make[2]: Leaving directory `/erlang.build/lib/snmp' > make[1]: *** [opt] Error 2 > make[1]: Leaving directory `/erlang.build/lib' > make: *** [tertiary_bootstrap_build] Error 2 > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > From angeljalvarezmiguel@REDACTED Tue Apr 29 13:26:57 2014 From: angeljalvarezmiguel@REDACTED (Angel Alvarez (GMAIL)) Date: Tue, 29 Apr 2014 13:26:57 +0200 Subject: [erlang-questions] silly rebar eunit TEST macro problem Message-ID: <5341F24B-4FA5-476B-B2C9-04F2404E25EF@gmail.com> Hi Guys, Ive been away for a while and back to erlang programming. Currently I'm setting up tests for a project but I I can't make rebar run my tests? There is a module where I have: -module(udp_driver_srv). -ifdef(TEST). -compile(export_all). -else. %% ------------------------------------------------------------------ %% API Function Exports %% ------------------------------------------------------------------ -export([start_link/1, option_specs/0, check_valid_port/1]). %% ------------------------------------------------------------------ %% gen_server Function Exports %% ------------------------------------------------------------------ -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). -endif. later I have a few tests (one right now) -ifdef(TEST). -include_lib("eunit/include/eunit.hrl"). pool_new_void_test() -> Pool = pool_new(), ?assertEqual(empty,Pool). -endif. But it doesn't run when I run "rebar eunit": ? ... Compiled src/servers/middleman_srv.erl Compiled src/dhcp_server.erl Compiled src/script_utils/getopt.erl ======================== EUnit ======================== module 'udp_driver_srv' module 'network_sup' module 'module_tools' module 'middleman_sup' module 'middleman_srv' module 'getoptex' module 'getopt' module 'fsm_sup' module 'ets_master_srv' module 'dora_fsm' module 'dhcp_server_sup' module 'dhcp_server_app' module 'dhcp_server' module 'dhcp_console_srv' module 'addr_pool_sup' module 'addr_pool_srv' There were no tests to run. After trying to figure out what's going on, I guess the TEST macro isn't honored by rebar eunit anymore or I'm missing something very stupid out. I recall from other setups that this used to work like a charm but? ?Anyone can give a clue about this? Thanks in advance Angel Alvarez (GMAIL) angeljalvarezmiguel@REDACTED From paul.sherwood@REDACTED Tue Apr 29 13:33:16 2014 From: paul.sherwood@REDACTED (Paul Sherwood) Date: Tue, 29 Apr 2014 12:33:16 +0100 Subject: [erlang-questions] Building erlang from git on a vanilla linux system... In-Reply-To: <535F89F5.2050000@erix.ericsson.se> References: <535F89F5.2050000@erix.ericsson.se> Message-ID: <535F8DFC.6080109@codethink.co.uk> Hi Micael On 29/04/2014 12:16, Micael Karlberg wrote: > Make claims there is no 'opt' target, which is a bit strange. > What does the makefile in the mibs dir look like? Actually it turned out that I had *not* used the ./otp_build script as I thought. My system was missing the autotools magic that the ./otp_build script applies. I was helped on irc by nox, and as a result all is well now - I have successfully built erlang/otp :-) thank you Paul > > Regards, > /BMK > > On 04/29/2014 08:12 AM, Paul Sherwood wrote: >> Hi folks, >> >> I'm trying to build erlang from source on a Baserock system, which as >> far as possible has 'normal' >> gcc, autotools etc. >> >> Config happens fine, but the build fails at SMTP as follows, both with >> default autotools and using >> ./otp_build autoconf script. >> >> Any ideas how to fix this, please? >> >> br >> Paul >> >> === Entering application snmp >> make[3]: Entering directory `/erlang.build/lib/snmp/src/compile' >> YECC snmpc_mib_gram.erl >> ERLC ../../ebin/snmpc.beam >> ERLC ../../ebin/snmpc_lib.beam >> ERLC ../../ebin/snmpc_mib_to_hrl.beam >> ERLC ../../ebin/snmpc_misc.beam >> ERLC ../../ebin/snmpc_tok.beam >> VSN ../../bin/snmpc >> ERLC ../../ebin/snmpc_mib_gram.beam >> make[3]: Leaving directory `/erlang.build/lib/snmp/src/compile' >> make[3]: Entering directory `/erlang.build/lib/snmp/mibs' >> make[3]: *** No rule to make target `opt'. Stop. >> make[3]: Leaving directory `/erlang.build/lib/snmp/mibs' >> make[2]: *** [opt] Error 2 >> make[2]: Leaving directory `/erlang.build/lib/snmp' >> make[1]: *** [opt] Error 2 >> make[1]: Leaving directory `/erlang.build/lib' >> make: *** [tertiary_bootstrap_build] Error 2 >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> -- Paul Sherwood Codethink Ltd. Tel: +44 788 798 4900 302 Ducie House, Ducie Street, http://www.codethink.co.uk/ Manchester, M1 2JW, United Kingdom. Codethink provides advanced software design, development, integration & test services: from embedded systems to high performance apps to cloud. From tuncer.ayaz@REDACTED Tue Apr 29 13:58:40 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Tue, 29 Apr 2014 13:58:40 +0200 Subject: [erlang-questions] silly rebar eunit TEST macro problem In-Reply-To: <5341F24B-4FA5-476B-B2C9-04F2404E25EF@gmail.com> References: <5341F24B-4FA5-476B-B2C9-04F2404E25EF@gmail.com> Message-ID: On 4/29/14, Angel Alvarez (GMAIL) wrote: > Hi Guys, > > Ive been away for a while and back to erlang programming. > > Currently I'm setting up tests for a project but I I can't make > rebar run my tests? > > There is a module where I have: [...] > After trying to figure out what's going on, I guess the TEST macro > isn't honored by rebar eunit anymore or I'm missing something very > stupid out. I recall from other setups that this used to work like a > charm but? > > Anyone can give a clue about this? If you're using rebar from git master, then you may be affected by a regression I've introduced while fixing a bug. Your options are: 1. fall back to the 2.2.0 release (https://github.com/rebar/rebar/releases) 2. merge https://github.com/rebar/rebar/pull/251 locally 3. wait for #251 merge to master From max.lapshin@REDACTED Tue Apr 29 14:05:16 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 29 Apr 2014 16:05:16 +0400 Subject: [erlang-questions] maps and lager: how to handle new type gracefully? Message-ID: Hi, I've got problem with using maps: https://github.com/basho/lager/issues/218 Right now lager (and especially version 2.0.2) cannot print maps. It leads to severe problems in my case, but it is another story. If map support will be added to lager master, it means that R16 users will not be able to use it. Maybe I've missed some thread, but is it possible to write something like: format(...) -> ...; -ifdef(R17) format(#{key => Value}) -> ...; -endif. format(Else) -> ... Is there any preprocessor directive that will help to distinguish 17+ from R16- ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Tue Apr 29 14:09:57 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 29 Apr 2014 14:09:57 +0200 Subject: [erlang-questions] maps and lager: how to handle new type gracefully? In-Reply-To: References: Message-ID: <535F9695.7070304@ninenines.eu> If you use the fully qualified erlang:is_map(Var) and map:to_list(Var) you can easily handle maps in a backward compatible way. On 04/29/2014 02:05 PM, Max Lapshin wrote: > Hi, I've got problem with using maps: > https://github.com/basho/lager/issues/218 > > Right now lager (and especially version 2.0.2) cannot print maps. It > leads to severe problems in my case, but it is another story. > > > If map support will be added to lager master, it means that R16 users > will not be able to use it. > > Maybe I've missed some thread, but is it possible to write something like: > > format(...) -> > ...; > > -ifdef(R17) > format(#{key => Value}) -> > ...; > > -endif. > > format(Else) -> > ... > > Is there any preprocessor directive that will help to distinguish 17+ > from R16- ? > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From max.lapshin@REDACTED Tue Apr 29 14:17:53 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 29 Apr 2014 16:17:53 +0400 Subject: [erlang-questions] maps and lager: how to handle new type gracefully? In-Reply-To: <535F9695.7070304@ninenines.eu> References: <535F9695.7070304@ninenines.eu> Message-ID: On Tue, Apr 29, 2014 at 4:09 PM, Lo?c Hoguin wrote: > If you use the fully qualified erlang:is_map(Var) and map:to_list(Var) you > can easily handle maps in a backward compatible way. > > But erlang:is_map(Var) will fail on R16 with undef -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Tue Apr 29 14:20:43 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 29 Apr 2014 14:20:43 +0200 Subject: [erlang-questions] maps and lager: how to handle new type gracefully? In-Reply-To: References: <535F9695.7070304@ninenines.eu> Message-ID: <535F991B.6020501@ninenines.eu> erlang:function_exported(erlang, is_map, 1) can tell you if it exists before you try to call it. On 04/29/2014 02:17 PM, Max Lapshin wrote: > > > > On Tue, Apr 29, 2014 at 4:09 PM, Lo?c Hoguin > wrote: > > If you use the fully qualified erlang:is_map(Var) and > map:to_list(Var) you can easily handle maps in a backward compatible > way. > > > But erlang:is_map(Var) will fail on R16 with undef -- Lo?c Hoguin http://ninenines.eu From max.lapshin@REDACTED Tue Apr 29 14:21:23 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 29 Apr 2014 16:21:23 +0400 Subject: [erlang-questions] maps and lager: how to handle new type gracefully? In-Reply-To: <535F991B.6020501@ninenines.eu> References: <535F9695.7070304@ninenines.eu> <535F991B.6020501@ninenines.eu> Message-ID: huh, rather complicated, but ok, it will work. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias@REDACTED Tue Apr 29 14:37:25 2014 From: matthias@REDACTED (Matthias Lang) Date: Tue, 29 Apr 2014 14:37:25 +0200 Subject: [erlang-questions] error_logger events sent by emulator In-Reply-To: <535E611C.9040001@ninenines.eu> References: <53544170.2080406@ninenines.eu> <535A9F93.6010505@ninenines.eu> <20140427220348.GA12152@corelatus.se> <535E611C.9040001@ninenines.eu> Message-ID: <20140429123725.GA9594@corelatus.se> Your suggested patch would remove the ugliest part of the current behaviour, so if you have the time and energy, why not. On Monday, April 28, Lo?c Hoguin wrote: > * Detect process crash > * Extract stacktrace etc. as Erlang terms > * Make sure the stacktrace contains no arguments, only arity > * Make sure the stacktrace is below a certain size (for example last 5 > calls by default, perhaps configurable through process flags) > * Send error as Erlang term to error_logger [...] > Well I could solve it exactly the way you did to be perfectly honest. I > didn't think of that, so I ended up parsing the string for the info I needed > (and so far it works OK). But I feel it'd be better with a proper OTP patch. That illustrates another problem: the presence of the "VM hack" makes it harder to discover the straightforward way. (Aside: the defaults are wrong on spawn(), it should really link/monitor by default. If it did that, it would be perfectly obvious why the shell prints error messages. But it's probably a few decades too late to change that.) Matthias From kenneth@REDACTED Tue Apr 29 15:02:26 2014 From: kenneth@REDACTED (Kenneth Lundin) Date: Tue, 29 Apr 2014 15:02:26 +0200 Subject: [erlang-questions] 17.0.1 In-Reply-To: References: Message-ID: The next tag we plan to announce will be 17.1 in mid to late June. Tags before that are intended for customers with support agreements and they will not be announced in any special way. The commit comments can of course be used as a source of information. Occasionally we might decide to announce a tag between the planned drops but only if it is regarded as a very important bugfix/feature for the whole community. /Kenneth, Erlang/OTP Ericsson On Tue, Apr 29, 2014 at 11:19 AM, Tuncer Ayaz wrote: > It's been a few days since Rickard tagged 17.0.1 and there's no > announcement so far. Is the tag temporary and mutable, or is there > just a delay? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Tue Apr 29 15:08:00 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Tue, 29 Apr 2014 15:08:00 +0200 Subject: [erlang-questions] 17.0.1 In-Reply-To: References: Message-ID: On 4/29/14, Kenneth Lundin wrote: > The next tag we plan to announce will be 17.1 in mid to late June. > Tags before that are intended for customers with support agreements > and they will not be announced in any special way. The commit > comments can of course be used as a source of information. > > Occasionally we might decide to announce a tag between the planned > drops but only if it is regarded as a very important bugfix/feature > for the whole community. Thanks, that's an entirely satisfactory answer :). > On Tue, Apr 29, 2014 at 11:19 AM, Tuncer Ayaz wrote: > > > It's been a few days since Rickard tagged 17.0.1 and there's no > > announcement so far. Is the tag temporary and mutable, or is there > > just a delay? From max.lapshin@REDACTED Tue Apr 29 15:48:14 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 29 Apr 2014 17:48:14 +0400 Subject: [erlang-questions] Erlang, WSDL, SOAP. Message-ID: Hi. I'm writing Onvif implementation in Erlang and I experience pain (no, wrong, it is PAIN) with handling all that nice XML, XPath, SOAP, WSDL stuff with ad-hoc self-written implementations. I have a very serious feeling that it is possible to write a generator of boiler plate code that will translate funcall to SOAP XML packet and back. I've looked at this: https://github.com/campanja/detergent and haven't found there authorization and exact routing code. Am I the only one who is suffering from this? Right now I need working soap client and later soap server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.elsgaard@REDACTED Tue Apr 29 16:09:48 2014 From: thomas.elsgaard@REDACTED (Thomas Elsgaard) Date: Tue, 29 Apr 2014 12:09:48 -0200 Subject: [erlang-questions] Erlang, WSDL, SOAP. In-Reply-To: References: Message-ID: +1 On Tue, Apr 29, 2014 at 11:48 AM, Max Lapshin wrote: > > Hi. > > I'm writing Onvif implementation in Erlang and I experience pain (no, > wrong, it is PAIN) with handling all that nice XML, XPath, SOAP, WSDL > stuff with ad-hoc self-written implementations. > > > I have a very serious feeling that it is possible to write a generator of > boiler plate code that will translate funcall to SOAP XML packet and back. > > I've looked at this: https://github.com/campanja/detergent and haven't > found there authorization and exact routing code. > > Am I the only one who is suffering from this? > > Right now I need working soap client and later soap server. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From angeljalvarezmiguel@REDACTED Tue Apr 29 16:35:41 2014 From: angeljalvarezmiguel@REDACTED (Angel Alvarez (GMAIL)) Date: Tue, 29 Apr 2014 16:35:41 +0200 Subject: [erlang-questions] silly rebar eunit TEST macro problem In-Reply-To: References: <5341F24B-4FA5-476B-B2C9-04F2404E25EF@gmail.com> Message-ID: <0FCF6FC6-C53B-4A68-B151-012248F026A3@gmail.com> El 29/04/2014, a las 13:58, Tuncer Ayaz escribi?: > On 4/29/14, Angel Alvarez (GMAIL) wrote: >> Hi Guys, >> >> Ive been away for a while and back to erlang programming. >> >> Currently I'm setting up tests for a project but I I can't make >> rebar run my tests? >> >> There is a module where I have: > > [...] > >> After trying to figure out what's going on, I guess the TEST macro >> isn't honored by rebar eunit anymore or I'm missing something very >> stupid out. I recall from other setups that this used to work like a >> charm but? >> >> Anyone can give a clue about this? > > If you're using rebar from git master, then you may be affected by a > regression I've introduced while fixing a bug. Your options are: > > 1. fall back to the 2.2.0 release (https://github.com/rebar/rebar/releases) > 2. merge https://github.com/rebar/rebar/pull/251 locally > 3. wait for #251 merge to master Thanks Tuncer, I'm gonna switch to 2.2.0 until master gets updated. Thanks a lot!! /Angel Angel Alvarez angeljalvarezmiguel at gmail.com From schneider@REDACTED Tue Apr 29 16:48:53 2014 From: schneider@REDACTED (Schneider) Date: Tue, 29 Apr 2014 16:48:53 +0200 Subject: [erlang-questions] Newbie: Compile error with records Message-ID: <002c01cf63ba$2466fdb0$6d34f910$@nl> Hi list, I am trying to create a bunch of records in an include file, but I just can't get it to work. What is wrong about this hrl file -record(data_ids, {data_id, mnem, descr}). #data_ids{data_id=1, mnem="ONE", descr="Number one."}. The compiler gives the error: src/data_ids.hrl:5: syntax error before: '#' Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From cvi@REDACTED Tue Apr 29 17:00:19 2014 From: cvi@REDACTED (=?UTF-8?Q?Christoffer_Vikstr=C3=B6m?=) Date: Tue, 29 Apr 2014 17:00:19 +0200 Subject: [erlang-questions] Erlang, WSDL, SOAP. In-Reply-To: References: Message-ID: Been using erlsom+detergent for a couple of years now. A heavily modified version of detergent that is. We also experienced lots of pain, especially with more complicated WSDLs. Our use case was Google's AdWords API, which we got to work with detergent, with a lot of adhoc-solutions for different clashes between the services. When we also tried to implement BING Ads Soap API with detergent we got completely stuck, we couldn't get it to work at all, which is a shame. In the end we wrote our own tool called ews (erlang web services) which is about to enter production soon:ish. It handles all services i have thrown at it so far (around 30:ish). We do plan to opensource it at a time when we feel it is getting stable and feature complete. Generating well-spec:ed functions for all service operations is not yet implemented, but is on our todo-list. Since we are stuck with soap for the foreseeable future, I don't see us stop supporting this tool, and hopefully it can be something others might want to consider when working with SOAP. On Tue, Apr 29, 2014 at 4:09 PM, Thomas Elsgaard wrote: > +1 > > > On Tue, Apr 29, 2014 at 11:48 AM, Max Lapshin wrote: > >> >> Hi. >> >> I'm writing Onvif implementation in Erlang and I experience pain (no, >> wrong, it is PAIN) with handling all that nice XML, XPath, SOAP, WSDL >> stuff with ad-hoc self-written implementations. >> >> >> I have a very serious feeling that it is possible to write a generator of >> boiler plate code that will translate funcall to SOAP XML packet and back. >> >> I've looked at this: https://github.com/campanja/detergent and haven't >> found there authorization and exact routing code. >> >> Am I the only one who is suffering from this? >> >> Right now I need working soap client and later soap server. >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luca.favatella@REDACTED Tue Apr 29 17:02:18 2014 From: luca.favatella@REDACTED (Luca Favatella) Date: Tue, 29 Apr 2014 16:02:18 +0100 Subject: [erlang-questions] maps and lager: how to handle new type gracefully? Message-ID: <535FBEFA.5060705@erlang-solutions.com> Lo?c Hoguin wrote: > erlang:function_exported(erlang, is_map, 1) can tell you if it exists before you try to call it. Max Lapshin wrote: > huh, rather complicated, but ok, it will work. Hi, I think it doesn't because is_map is a BIF, thus function_exported returns false even if the is_map function is there. From http://www.erlang.org/doc/man/erlang.html#function_exported-3: "Returns false for any BIF (functions implemented in C rather than in Erlang)." Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.0 (abort with ^G) 1> erlang:function_exported(erlang, is_map, 1). false 2> erlang:is_map(1). false Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:4:4] [async-threads:0] [kernel-poll:false] Eshell V5.9.3.1 (abort with ^G) 1> erlang:function_exported(erlang, is_map, 1). false 2> erlang:function_exported(erlang, is_list, 1). false 3> erlang:is_list(1). false Regards Luca From rtrlists@REDACTED Tue Apr 29 17:06:37 2014 From: rtrlists@REDACTED (Robert Raschke) Date: Tue, 29 Apr 2014 16:06:37 +0100 Subject: [erlang-questions] Erlang, WSDL, SOAP. In-Reply-To: References: Message-ID: You can probably do it for one particular client (and/or server) platform (essentially MS or Java). But if you want multi platform compatibility (mixed MS & Java) you run into issues of how SOAP is interpreted. Working to get that sorted will allow you to descend to a new level of hell, I dare say :-( Unfortunately, I cannot remember the details, I've successfully purged them from my memory. But generated server and client stubs in MS and Java didn't obey the same rules. Admittedly, this is now some time ago, so maybe things have improved? If you're dealing with either servers or clients with generated stubs on a variety of platforms, you'll need to figure out how they work in quite a bit of detail. Robby On Apr 29, 2014 2:48 PM, "Max Lapshin" wrote: > > Hi. > > I'm writing Onvif implementation in Erlang and I experience pain (no, > wrong, it is PAIN) with handling all that nice XML, XPath, SOAP, WSDL > stuff with ad-hoc self-written implementations. > > > I have a very serious feeling that it is possible to write a generator of > boiler plate code that will translate funcall to SOAP XML packet and back. > > I've looked at this: https://github.com/campanja/detergent and haven't > found there authorization and exact routing code. > > Am I the only one who is suffering from this? > > Right now I need working soap client and later soap server. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Tue Apr 29 17:06:47 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 29 Apr 2014 19:06:47 +0400 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: References: <20140418123352.GA68518@ferdair.local> Message-ID: Lukas, problem is again there. (flussonic@REDACTED)1> erlang:memory(). [{total,2295857360}, {processes,164269840}, {processes_used,163867072}, {system,2131587520}, {atom,561761}, {atom_used,550307}, {binary,2012401800}, {code,17217440}, {ets,83339584}] (flussonic@REDACTED)2> recon_alloc:memory(usage). 0.8362507252559286 (flussonic@REDACTED)3> recon_alloc:memory(allocated). 2444449376 (flussonic@REDACTED)4> recon_alloc:memory(used). 2012719800 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 7625 root 20 0 18.7g 11g 4424 S 254 35.2 1287:03 beam.smp Internal memory is ~2G, but allocated is 11G. I can give you root access to this machine if you ping me with private email. -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Tue Apr 29 17:07:44 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 29 Apr 2014 19:07:44 +0400 Subject: [erlang-questions] Erlang, WSDL, SOAP. In-Reply-To: References: Message-ID: So, ad-hoc solution may be better? -------------- next part -------------- An HTML attachment was scrubbed... URL: From john@REDACTED Tue Apr 29 17:14:22 2014 From: john@REDACTED (John Kemp) Date: Tue, 29 Apr 2014 11:14:22 -0400 Subject: [erlang-questions] Erlang, WSDL, SOAP. In-Reply-To: References: Message-ID: <535FC1CE.30103@jkemp.net> Hi, On 04/29/2014 09:48 AM, Max Lapshin wrote: > > Hi. > > I'm writing Onvif implementation in Erlang and I experience pain (no, > wrong, it is PAIN) with handling all that nice XML, XPath, SOAP, WSDL > stuff with ad-hoc self-written implementations. > > > I have a very serious feeling that it is possible to write a generator > of boiler plate code that will translate funcall to SOAP XML packet and > back. It is. And I would say that you are likely much better off writing that generation code yourself (as long as your code generates the correct XML for the recipient). Two things to be aware of are XML namespaces, and clock skew if you are supplying timestamps. For parsing SOAP, I've found that there is so much extra stuff in SOAP messages that you may or may not need (and the SOAP language depends on who's making the XML -- MSFT or Sun ;), it's usually been best for me to use a generic SAX parser implementation, with customized parsers for the specific bits that I need, and to essentially ignore the stuff I don't need. If you need XML encryption/signature or WS-Security support however, it will be very painful to write your own :) - johnk > > I've looked at this: https://github.com/campanja/detergent and haven't > found there authorization and exact routing code. > > Am I the only one who is suffering from this? > > Right now I need working soap client and later soap server. > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From essen@REDACTED Tue Apr 29 17:14:56 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 29 Apr 2014 17:14:56 +0200 Subject: [erlang-questions] maps and lager: how to handle new type gracefully? In-Reply-To: <535FBEFA.5060705@erlang-solutions.com> References: <535FBEFA.5060705@erlang-solutions.com> Message-ID: <535FC1F0.802@ninenines.eu> On 04/29/2014 05:02 PM, Luca Favatella wrote: > Lo?c Hoguin wrote: > > erlang:function_exported(erlang, is_map, 1) can tell you if it exists > before you try to call it. > > Max Lapshin wrote: > > huh, rather complicated, but ok, it will work. > > Hi, > > I think it doesn't because is_map is a BIF, thus function_exported > returns false even if the is_map function is there. > > From http://www.erlang.org/doc/man/erlang.html#function_exported-3: > "Returns false for any BIF (functions implemented in C rather than in > Erlang)." > > > Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10] > [hipe] [kernel-poll:false] > > Eshell V6.0 (abort with ^G) > 1> erlang:function_exported(erlang, is_map, 1). > false > 2> erlang:is_map(1). > false > > > Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:4:4] > [async-threads:0] [kernel-poll:false] > > Eshell V5.9.3.1 (abort with ^G) > 1> erlang:function_exported(erlang, is_map, 1). > false > 2> erlang:function_exported(erlang, is_list, 1). > false > 3> erlang:is_list(1). > false Nice find. Then second best thing: check if the maps module exists. :-) -- Lo?c Hoguin http://ninenines.eu From rtrlists@REDACTED Tue Apr 29 17:16:42 2014 From: rtrlists@REDACTED (Robert Raschke) Date: Tue, 29 Apr 2014 16:16:42 +0100 Subject: [erlang-questions] Erlang, WSDL, SOAP. In-Reply-To: References: Message-ID: Personally, I'd take the practical approach and learn from a series of implementations that work and pull out commonly required code either into a library or small, specific to your requirements, generator. Going more generic depends on whether you want to move from supporting your interfaces to supporting a SOAP/WSDL stub generator. Even if that's only internal support, it's a decision I would take a little bit of time understanding :-) Which you're doing right now :-) Robby On Apr 29, 2014 4:07 PM, "Max Lapshin" wrote: > So, ad-hoc solution may be better? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Tue Apr 29 17:17:13 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 29 Apr 2014 19:17:13 +0400 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: References: <20140418123352.GA68518@ferdair.local> Message-ID: (flussonic@REDACTED)3> recon_alloc:snapshot_get(). {[{total,2201115696}, {processes,140618848}, {processes_used,140254568}, {system,2060496848}, {atom,561761}, {atom_used,551696}, {binary,1939374344}, {code,17258778}, {ets,85224424}], [{{sys_alloc,0}, [{options,[{e,true},{m,libc},{tt,131072},{tp,0}]}]}, {{mseg_alloc,0}, [{memkind,[{name,"all memory"}, {status,[{cached_segments,0}, {cache_hits,79}, {segments,19,20,20}, {segments_size,35913728,36175872,36175872}, {segments_watermark,19}]}, {calls,[{mseg_alloc,0,104}, {mseg_dealloc,0,85}, {mseg_realloc,0,0}, {mseg_create_resize,0,0}, {mseg_create,0,25}, {mseg_destroy,0,7}, {mseg_recreate,0,0}, {mseg_clear_cache,0,0}, {mseg_check_cache,0,6}]}]}, {options,[{amcbf,4194304},{rmcbf,20},{mcs,10},{scs,0}]}, {version,"0.9"}]}, ..... (flussonic@REDACTED)6> ets:foldl(fun(T,Sum) -> erlang:external_size(T) + Sum end, 0, live_streams_attrs). 1749128853 (flussonic@REDACTED)9> lists:sum([ ets:foldl(fun(T,Sum) -> erlang:external_size(T) + Sum end, 0, T) || T <- ets:all(), is_atom(T)]). 1758913413 So, it looks like only 2G are really used. Where could leak the rest? Is it possible that data is leaking or accumulating somewhere in network buffers? Version on R16 doesn't have such problems. -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Tue Apr 29 17:19:27 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 29 Apr 2014 17:19:27 +0200 Subject: [erlang-questions] Newbie: Compile error with records In-Reply-To: <002c01cf63ba$2466fdb0$6d34f910$@nl> References: <002c01cf63ba$2466fdb0$6d34f910$@nl> Message-ID: <535FC2FF.20800@ninenines.eu> What are you trying to do? You can't create records outside a function. This would work on the other hand: f() -> #data_ids{data_id=1, mnem="ONE", descr="Number one."}. On 04/29/2014 04:48 PM, Schneider wrote: > Hi list, > > I am trying to create a bunch of records in an include file, but I just > can?t get it to work. > > What is wrong about this hrl file > > -record(data_ids, {data_id, mnem, descr}). > > #data_ids{data_id=1, mnem="ONE", descr="Number one."}. > > The compiler gives the error: > > src/data_ids.hrl:5: syntax error before: '#' > > Thanks > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From ahammel87@REDACTED Tue Apr 29 17:20:40 2014 From: ahammel87@REDACTED (Alex Hammel) Date: Tue, 29 Apr 2014 08:20:40 -0700 Subject: [erlang-questions] Newbie: Compile error with records In-Reply-To: <002c01cf63ba$2466fdb0$6d34f910$@nl> References: <002c01cf63ba$2466fdb0$6d34f910$@nl> Message-ID: I don't think it's legal to construct record instances at the top level. (Even if it was, how would you refer to them?) You'll need to wrap the record construction in a function or a macro. On Tue, Apr 29, 2014 at 7:48 AM, Schneider wrote: > Hi list, > > > > I am trying to create a bunch of records in an include file, but I just > can?t get it to work. > > What is wrong about this hrl file > > > > -record(data_ids, {data_id, mnem, descr}). > > > > #data_ids{data_id=1, mnem="ONE", descr="Number one."}. > > > > The compiler gives the error: > > src/data_ids.hrl:5: syntax error before: '#' > > > > Thanks > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From schneider@REDACTED Tue Apr 29 17:24:30 2014 From: schneider@REDACTED (Schneider) Date: Tue, 29 Apr 2014 17:24:30 +0200 Subject: [erlang-questions] Newbie: Compile error with records In-Reply-To: References: <002c01cf63ba$2466fdb0$6d34f910$@nl> Message-ID: <004001cf63bf$1e21d1f0$5a6575d0$@nl> Works now using a function. Thanks. Van: Alex Hammel [mailto:ahammel87@REDACTED] Verzonden: dinsdag 29 april 2014 17:21 Aan: Schneider CC: erlang-questions@REDACTED Onderwerp: Re: [erlang-questions] Newbie: Compile error with records I don't think it's legal to construct record instances at the top level. (Even if it was, how would you refer to them?) You'll need to wrap the record construction in a function or a macro. On Tue, Apr 29, 2014 at 7:48 AM, Schneider wrote: Hi list, I am trying to create a bunch of records in an include file, but I just can?t get it to work. What is wrong about this hrl file -record(data_ids, {data_id, mnem, descr}). #data_ids{data_id=1, mnem="ONE", descr="Number one."}. The compiler gives the error: src/data_ids.hrl:5: syntax error before: '#' Thanks _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Tue Apr 29 17:26:27 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 29 Apr 2014 19:26:27 +0400 Subject: [erlang-questions] Erlang, WSDL, SOAP. In-Reply-To: References: Message-ID: I've added ws-security and my code is around one screen. Perhaps I haven't seen real hell? -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Tue Apr 29 17:27:12 2014 From: g@REDACTED (Garrett Smith) Date: Tue, 29 Apr 2014 10:27:12 -0500 Subject: [erlang-questions] Erlang, WSDL, SOAP. In-Reply-To: References: Message-ID: I have PTSD from my experience with SOAP/WSDL. I'm even having problems typing these words. If I had to tackle this problem in Erlang, I'd start looking for a Java implementation. I worked with Axis: http://axis.apache.org/axis/java/user-guide.html It was a surreal exercise in mental torture, but it worked, finally. As much as this sort of thing can. This could be wrapped using the Erlang Java interface and made available as a node. Personally, I would not attempt this in pure Erlang unless there's a clear line of sight to something working. On Tue, Apr 29, 2014 at 10:00 AM, Christoffer Vikstr?m wrote: > Been using erlsom+detergent for a couple of years now. A heavily modified > version of detergent that is. We also experienced lots of pain, especially > with more complicated WSDLs. > > Our use case was Google's AdWords API, which we got to work with detergent, > with a lot of adhoc-solutions for different clashes between the services. > When we also tried to implement BING Ads Soap API with detergent we got > completely stuck, we couldn't get it to work at all, which is a shame. > > In the end we wrote our own tool called ews (erlang web services) which is > about to enter production soon:ish. It handles all services i have thrown at > it so far (around 30:ish). We do plan to opensource it at a time when we > feel it is getting stable and feature complete. > > Generating well-spec:ed functions for all service operations is not yet > implemented, but is on our todo-list. Since we are stuck with soap for the > foreseeable future, I don't see us stop supporting this tool, and hopefully > it can be something others might want to consider when working with SOAP. > > > > On Tue, Apr 29, 2014 at 4:09 PM, Thomas Elsgaard > wrote: >> >> +1 >> >> >> On Tue, Apr 29, 2014 at 11:48 AM, Max Lapshin >> wrote: >>> >>> >>> Hi. >>> >>> I'm writing Onvif implementation in Erlang and I experience pain (no, >>> wrong, it is PAIN) with handling all that nice XML, XPath, SOAP, WSDL stuff >>> with ad-hoc self-written implementations. >>> >>> >>> I have a very serious feeling that it is possible to write a generator of >>> boiler plate code that will translate funcall to SOAP XML packet and back. >>> >>> I've looked at this: https://github.com/campanja/detergent and haven't >>> found there authorization and exact routing code. >>> >>> Am I the only one who is suffering from this? >>> >>> Right now I need working soap client and later soap server. >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From lukas@REDACTED Tue Apr 29 19:27:41 2014 From: lukas@REDACTED (Lukas Larsson) Date: Tue, 29 Apr 2014 19:27:41 +0200 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: References: <20140418123352.GA68518@ferdair.local> Message-ID: Hello, In the allocator snapshot you sent me it's possible to see that the apparent memory leak has to do with memory fragmentation. About a week ago I sent a patch to upstream recon to include the mbcs pool in the calculation of total used memory. With this patch (that is now part of the master branch for recon) we can see that the utilization of the binary allocators is very low. 34> recon_alloc:fragmentation(current). [{{binary_alloc,10}, [{sbcs_usage,0.9663911159624771}, {mbcs_usage,0.00851128256381634}, {sbcs_block_size,12975432}, {sbcs_carriers_size,13426688}, {mbcs_block_size,8594792}, {mbcs_carriers_size,1009811616}]}, {{binary_alloc,21}, [{sbcs_usage,0.9576609472490074}, {mbcs_usage,0.02275766909139376}, {sbcs_block_size,69155072}, {sbcs_carriers_size,72212480}, {mbcs_block_size,21489512}, {mbcs_carriers_size,944275616}]}, {{binary_alloc,4}, [{sbcs_usage,0.9769352091165413}, {mbcs_usage,0.013649233045825031}, {sbcs_block_size,26610152}, {sbcs_carriers_size,27238400}, {mbcs_block_size,12115776}, {mbcs_carriers_size,887652512}]}, {{binary_alloc,8}, [{sbcs_usage,0.9620084547199639}, {mbcs_usage,0.01384863563143117}, {sbcs_block_size,26172048}, {sbcs_carriers_size,27205632}, {mbcs_block_size,10651864}, {mbcs_carriers_size,769163424}]}, {{binary_alloc,20}, [{sbcs_usage,0.9607166148513436}, {mbcs_usage,0.022427188875552406}, {sbcs_block_size,34412408}, {sbcs_carriers_size,35819520}, {mbcs_block_size,15121920}, {mbcs_carriers_size,674267296}]},...] So you have a "classic" memory fragmentation problem. The reason why you are seeing it in 17.0 and not in R16 is probably because we have changed the default allocation strategy from "best fit" to "address order first fit carrier best fit". To fix this I would first try to change the allocation strategy for binaries to "address order first fit carrier address order best fit" (+MBas aoffcaobf) and see if that helps. If that does not work you could always disable the mbcs pool (+MBacul 0), which would make the allocators run very similar to how they worked in R16. But you loose the nice mbcs pool :( One thing to keep in mind here is that maybe you don't have to fix it at all? The memory is not lost, it just not used at the moment and cannot be released to the OS because some binaries are still present in them. So unless you crash with out of memory I would not change anything. Lukas On Tue, Apr 29, 2014 at 5:17 PM, Max Lapshin wrote: > (flussonic@REDACTED)3> recon_alloc:snapshot_get(). > {[{total,2201115696}, > {processes,140618848}, > {processes_used,140254568}, > {system,2060496848}, > {atom,561761}, > {atom_used,551696}, > {binary,1939374344}, > {code,17258778}, > {ets,85224424}], > [{{sys_alloc,0}, > [{options,[{e,true},{m,libc},{tt,131072},{tp,0}]}]}, > {{mseg_alloc,0}, > [{memkind,[{name,"all memory"}, > {status,[{cached_segments,0}, > {cache_hits,79}, > {segments,19,20,20}, > {segments_size,35913728,36175872,36175872}, > {segments_watermark,19}]}, > {calls,[{mseg_alloc,0,104}, > {mseg_dealloc,0,85}, > {mseg_realloc,0,0}, > {mseg_create_resize,0,0}, > {mseg_create,0,25}, > {mseg_destroy,0,7}, > {mseg_recreate,0,0}, > {mseg_clear_cache,0,0}, > {mseg_check_cache,0,6}]}]}, > {options,[{amcbf,4194304},{rmcbf,20},{mcs,10},{scs,0}]}, > {version,"0.9"}]}, > > ..... > > > > (flussonic@REDACTED)6> ets:foldl(fun(T,Sum) -> erlang:external_size(T) + > Sum end, 0, live_streams_attrs). > 1749128853 > > (flussonic@REDACTED)9> lists:sum([ ets:foldl(fun(T,Sum) -> > erlang:external_size(T) + Sum end, 0, T) || T <- ets:all(), is_atom(T)]). > 1758913413 > > > So, it looks like only 2G are really used. Where could leak the rest? Is > it possible that data is leaking or accumulating somewhere in network > buffers? > > Version on R16 doesn't have such problems. > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Tue Apr 29 19:47:53 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 29 Apr 2014 21:47:53 +0400 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: References: <20140418123352.GA68518@ferdair.local> Message-ID: Server becomes working very unstable when memory utilisation grows. When it is around 2-3G, everything works fine. Then something happens (perhaps in the evening, clients reconnect more often, more binaries are allocated) and RES grows to 11, 20 and more G. After this erlyvideo becomes unstable. I'll try to use option (+MBas aoffcaobf) and update recon. Is there any good explanation for what MBacul/mbcs is doing? What are the benefits? -------------- next part -------------- An HTML attachment was scrubbed... URL: From peppe@REDACTED Tue Apr 29 21:15:28 2014 From: peppe@REDACTED (Peter Andersson) Date: Tue, 29 Apr 2014 21:15:28 +0200 Subject: [erlang-questions] common_test test case documentation In-Reply-To: <53593604.1030302@ninenines.eu> References: <531F596E.3030405@ninenines.eu> <531F59D5.8080208@ninenines.eu> <53593604.1030302@ninenines.eu> Message-ID: <535FFA50.4030905@erlang.org> Hi Lo?c, Bug found. Will have it fixed shortly. Best regards, Peter Ericsson AB, Erlang/OTP Lo?c Hoguin wrote: > Hm that's weird. Using ct:comment/1,2 works but doesn't always print the > comment in the comment column when the test fails. Any idea why? It > doesn't seem related to how long the test takes. It is however related > to running tests in parallel. I'm guessing the test_server:comment/1 > function being async has to do with it. Would be awesome if it could be > synchronous. :-) > > On 03/20/2014 04:24 PM, Siri Hansen wrote: > > There is also ct:comment/1,2 which could be called at the beginning of > > the test case. Note that subsequent calls to this function, or the > > return value {comment,""}, will overwrite previous calls. And it does > > not necessarily look very nice when a test fails... > > /siri > > > > > > 2014-03-11 19:45 GMT+01:00 Lo?c Hoguin > >: > > > > And of course I made a mistake in one example. Sorry. > > > > > > On 03/11/2014 07:43 PM, Lo?c Hoguin wrote: > > > > testcase3() -> ?TEST_HERE, {comment, "docs here"}. > > > > > > The above should read: > > > > testcase3(Config) -> ?TEST_HERE, {comment, "docs here"}. > > > > > > -- > > Lo?c Hoguin > > http://ninenines.eu > > _________________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/__listinfo/erlang-questions > > > > > > > > From essen@REDACTED Tue Apr 29 21:16:25 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 29 Apr 2014 21:16:25 +0200 Subject: [erlang-questions] common_test test case documentation In-Reply-To: <535FFA50.4030905@erlang.org> References: <531F596E.3030405@ninenines.eu> <531F59D5.8080208@ninenines.eu> <53593604.1030302@ninenines.eu> <535FFA50.4030905@erlang.org> Message-ID: <535FFA89.5070209@ninenines.eu> Great news, thanks! On 04/29/2014 09:15 PM, Peter Andersson wrote: > > Hi Lo?c, > > Bug found. Will have it fixed shortly. > > Best regards, > Peter > > Ericsson AB, Erlang/OTP > > Lo?c Hoguin wrote: >> Hm that's weird. Using ct:comment/1,2 works but doesn't always print the >> comment in the comment column when the test fails. Any idea why? It >> doesn't seem related to how long the test takes. It is however related >> to running tests in parallel. I'm guessing the test_server:comment/1 >> function being async has to do with it. Would be awesome if it could be >> synchronous. :-) >> >> On 03/20/2014 04:24 PM, Siri Hansen wrote: >>> There is also ct:comment/1,2 which could be called at the beginning of >>> the test case. Note that subsequent calls to this function, or the >>> return value {comment,""}, will overwrite previous calls. And it does >>> not necessarily look very nice when a test fails... >>> /siri >>> >>> >>> 2014-03-11 19:45 GMT+01:00 Lo?c Hoguin >> >: >>> >>> And of course I made a mistake in one example. Sorry. >>> >>> >>> On 03/11/2014 07:43 PM, Lo?c Hoguin wrote: >>> >>> testcase3() -> ?TEST_HERE, {comment, "docs here"}. >>> >>> >>> The above should read: >>> >>> testcase3(Config) -> ?TEST_HERE, {comment, "docs here"}. >>> >>> >>> -- >>> Lo?c Hoguin >>> http://ninenines.eu >>> _________________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/__listinfo/erlang-questions >>> >>> >>> >> >> > -- Lo?c Hoguin http://ninenines.eu From max.lapshin@REDACTED Wed Apr 30 05:58:11 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 30 Apr 2014 07:58:11 +0400 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: References: <20140418123352.GA68518@ferdair.local> Message-ID: Yes, after updating recon it shows: (flussonic@REDACTED)3> recon_alloc:memory(usage). 0.2914236432009168 will restart system with +MBas aoffcaobf -------------- next part -------------- An HTML attachment was scrubbed... URL: From alisdairsullivan@REDACTED Wed Apr 30 07:55:13 2014 From: alisdairsullivan@REDACTED (alisdair sullivan) Date: Tue, 29 Apr 2014 22:55:13 -0700 Subject: [erlang-questions] maps and lager: how to handle new type gracefully? In-Reply-To: References: <535F9695.7070304@ninenines.eu> <535F991B.6020501@ninenines.eu> Message-ID: On Apr 29, 2014, at 5:21 AM, Max Lapshin wrote: > huh, rather complicated, but ok, it will work. > > Thanks. > i handled this problem in jsx by adding a `rebar.config.script` with the following contents: case os:getenv("JSX_NOMAPS") or proplists:get_value(jsx_nomaps, CONFIG, false) of false -> try file:script("config/maps") of {ok, true} -> [{erl_opts, [{d, maps_support}]}] ++ CONFIG; _ -> CONFIG catch _:_ -> CONFIG end; _ -> CONFIG end. `config/maps` is just maps:keys(#{0 => false, 1 => true}) == [0,1]. if you use more features of maps you can test for them also with a more complicated expression then all map related code in jsx itself goes inside ifdefs guarded by `maps_support` From lukas@REDACTED Wed Apr 30 09:36:12 2014 From: lukas@REDACTED (Lukas Larsson) Date: Wed, 30 Apr 2014 09:36:12 +0200 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: References: <20140418123352.GA68518@ferdair.local> Message-ID: On Tue, Apr 29, 2014 at 7:47 PM, Max Lapshin wrote: > Is there any good explanation for what MBacul/mbcs is doing? What are the > benefits? > > http://www.erlang.org/doc/man/erts_alloc.html the acul section has some info. https://github.com/erlang/otp/blob/maint/erts/emulator/internal_doc/CarrierMigration.mdhas more details about the actual implementation and the reasoning behind it. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Wed Apr 30 09:52:12 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Wed, 30 Apr 2014 09:52:12 +0200 Subject: [erlang-questions] maps and lager: how to handle new type gracefully? In-Reply-To: References: <535F9695.7070304@ninenines.eu> <535F991B.6020501@ninenines.eu> Message-ID: Maybe we should finally remove the 'Not Yet Implemented' compile error triggered by epp when trying to use '-if' instead of '-ifdef'. Regards, -- Anthony Ramine Le 30 avr. 2014 ? 07:55, alisdair sullivan a ?crit : > > On Apr 29, 2014, at 5:21 AM, Max Lapshin wrote: > >> huh, rather complicated, but ok, it will work. >> >> Thanks. >> > > i handled this problem in jsx by adding a `rebar.config.script` with the following contents: > > case os:getenv("JSX_NOMAPS") or proplists:get_value(jsx_nomaps, CONFIG, false) of > false -> > try file:script("config/maps") of > {ok, true} -> [{erl_opts, [{d, maps_support}]}] ++ CONFIG; > _ -> CONFIG > catch _:_ -> CONFIG > end; > _ -> CONFIG > end. > > `config/maps` is just > > maps:keys(#{0 => false, 1 => true}) == [0,1]. > > if you use more features of maps you can test for them also with a more complicated expression > > then all map related code in jsx itself goes inside ifdefs guarded by `maps_support` > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From max.lapshin@REDACTED Wed Apr 30 10:48:00 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 30 Apr 2014 12:48:00 +0400 Subject: [erlang-questions] maps and lager: how to handle new type gracefully? In-Reply-To: References: <535F9695.7070304@ninenines.eu> <535F991B.6020501@ninenines.eu> Message-ID: It will influence future changes. Right now I think it would be good to find some R16 code that will allow to throw away R17-specific lines from source. -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.youngkin@REDACTED Wed Apr 30 20:59:50 2014 From: richard.youngkin@REDACTED (Youngkin, Rich) Date: Wed, 30 Apr 2014 12:59:50 -0600 Subject: [erlang-questions] Supervision trees and child startup ordering Message-ID: Hi, I'm using a supervision tree to manage multiple sets of gen_servers. I've got a situation where gen_servers in one supervision tree (e.g., Tree-B) are clients of gen_servers in another supervision tree (e.g., Tree-A). I'd like Tree-A and all of it's children to complete their initialization processing before starting any of the children in Tree-B. Root Supervisor | ---------------------------------- | | Supervisor-A Supervisor-B | | ----------------- ------------- | | | | | 1 2 3 4 5 So given this diagram, A and its children 1,2 and 3 start and complete initialization before B and children 4 and 5 are started and complete initialization. Furthermore, initialization in this case means that in module:init/1 the child casts itself a message to complete initialization. E.g., ... init([]) -> gen_server:cast(?MODULE, complete_initialization), {ok, []}. ... During Child 4's initialization it calls a function on Child 1 (which has an init/1 implementation as described above). In reading http://www.erlang.org/doc/man/supervisor.html#start_link-2 I understand that Supervisor-A and all it's children will be started and available before Supervisor-B and its children are started. It's also my understanding that when a child casts itself a message in its init/1 function that that message is guaranteed to be the first message in its mailbox. Is my understanding of this correct and if so, is this a reasonable way to do what I'm trying to accomplish? Thanks, Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Wed Apr 30 21:12:14 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 30 Apr 2014 15:12:14 -0400 Subject: [erlang-questions] Supervision trees and child startup ordering In-Reply-To: References: Message-ID: <20140430191213.GE84891@ferdair.local> Answers inline On 04/30, Youngkin, Rich wrote: > Hi, > > I'm using a supervision tree to manage multiple sets of gen_servers. I've > got a situation where gen_servers in one supervision tree (e.g., Tree-B) > are clients of gen_servers in another supervision tree (e.g., Tree-A). I'd > like Tree-A and all of it's children to complete their initialization > processing before starting any of the children in Tree-B. > > [...] > > So given this diagram, A and its children 1,2 and 3 start and complete > initialization before B and children 4 and 5 are started and complete > initialization. Furthermore, initialization in this case means that in > module:init/1 the child casts itself a message to complete initialization. I recommand in this case that Root Supervisor adopts a 'rest_for_one' strategy that will ensure that if Supervisor-A fails at any point during run-time, Supervisor-B and its children are killed before the whole structure is restarted. Otherwise, you may run into the issue of having Supervisor-B's children run without A being present. > During Child 4's initialization it calls a function on Child 1 (which has > an init/1 implementation as described above). > > In reading http://www.erlang.org/doc/man/supervisor.html#start_link-2 I > understand that Supervisor-A and all it's children will be started and > available before Supervisor-B and its children are started. It's also my > understanding that when a child casts itself a message in its init/1 > function that that message is guaranteed to be the first message in its > mailbox. Is my understanding of this correct and if so, is this a > reasonable way to do what I'm trying to accomplish? > Two things. 1. The message is guaranteed to be the first one in the mailbox *iff* the process hasn't been registered before, or given its pid to anyone who could send it a message. Usually, that's fine when using OTP. 2. The init scheme you're going for will turn your boot sequence into an asynchronous one -- it's possible children of B will be spawned while children of A are still doing the handling of the initial message in their handle function. The latter may be a valid choice if the resource started asynchronously isn't always guaranteed to be available. Meaning that in this case, you're guaranteeing that the client will be up, but not the connection. This is actually a very sane model for external resources, but you just have to be aware you're implementing it :) See http://ferd.ca/it-s-about-the-guarantees.html for more details on this. Regards, Fred.