From ok@REDACTED Fri Jan 1 11:48:59 2016 From: ok@REDACTED (ok@REDACTED) Date: Fri, 1 Jan 2016 23:48:59 +1300 Subject: [erlang-questions] Question about reverse list of recursion functions In-Reply-To: <8A49AC37-9D94-401A-8C38-B12B714165C5@gmail.com> References: <8A49AC37-9D94-401A-8C38-B12B714165C5@gmail.com> Message-ID: For what it's worth, I have now benchmarked my code and Andrey Koleshko's. My code takes 75% of the time of his. (Yay! Code golf! Wow! /sarc) Yawn. My version of quicksort is *still* beaten by lists:sort/1. This just underscores Joe Armstrong's point (at least I think it was his): for most practical purposes a difference of this order isn't worth bothering about. I think this is one difference between programmers and software engineers. I *still* think like a programmer. I *still* worry about things like calling reverse/1. And yet I *KNOW* the slogan "FIRST make it right, THEN make it fast (IF you need to)." A real software engineer would feel in his or her very bones that the time you need to reduce is the time from concept to testing (so that you can make sure that what you have built is actually solving the right problem). Maybe when I grow up I'll be a real software engineer. Sigh. But even a real software engineer would concede that - using reverse/1 is more complex than not using it - code that is more complex is more likely wrong (for example, using reverse/1 when you shouldn't, or not using it when you should). I suspect that a real software engineer would like %% list-based quick-sort taking the first element as pivot. %% TODO: profile to see if this needs tuning. qs([H|T]) -> qs([X || X<-T, X < H]) ++ [H] ++ qs([X || X<-T, X >= H]); qs([]) -> []. even if it is nearly twice as fast as my code, because it is so hard to get this version wrong. (Fusing the two list comprehensions into a single traversal is not beyond the state of the art in functional language compilers. Which is not to say the Erlang compiler does it.) From jesper.louis.andersen@REDACTED Fri Jan 1 16:14:03 2016 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Fri, 1 Jan 2016 16:14:03 +0100 Subject: [erlang-questions] Question about reverse list of recursion functions In-Reply-To: References: <76D6D62B-869B-4FD9-910B-6582AC5E4404@gmail.com> Message-ID: On Mon, Dec 28, 2015 at 7:31 PM, Joe Armstrong wrote: > As an additional exercise you should measure and compare with lists:sort > This is a sneak-peak on this years christmas-hacking project, eministat, which is a benchmarking tool for Erlang. It's ASCII art does require you to use a fixed width font when viewing the output however. The results are: * lists:sort/1 (#) is significantly faster than everything else. * sortl (x) and sortx (%) has no provable difference * sortf (+) and sortfl (*) are significantly slower than sortl (x) I'll write a more complete announcement when things are cleaned up a bit more later on. 15> qsort_eministat:t(). x sortl + sortf * sortfl % sortx # lists:sort/1 +--------------------------------------------------------------------------+ |## ###x *** +++ +++| |## ##xx ** ++ +++| |## x#xx ** ++ ++ | |## x#x ** ++ + | |## x#x ** ++ + | |## x#x ** ++ + | |## x#x ** ++ + | |## x# ** ++ + | |## # * + + | |## # * + + | |# # * + + | |# # * + + | |# # * + + | |# # * + + | |# # * + + | |# # * + + | |# # * + + | |# # * + | |# # * + | |# # * | |# # * | |# # * | |# # * | |# # * | |# # * | |# # * | |# # * | |# # * | |# # * | |# # * | |# # * | |# # * | |# % * | |# % * | |# % * | |# % * | |# % * | |# % * | |# % * | |# % * | | |A| | | MA| | | A| | | |A | |A| | +--------------------------------------------------------------------------+ Dataset: x N=50 CI=95.0000 Statistic Value [ Bias] (Bootstrapped LB?UB) Min: 47.0000 1st Qu. 48.0000 Median: 48.0000 3rd Qu. 48.0000 Max: 50.0000 Average: 48.1000 [ -2.66000e-4] ( 47.9000 ? 48.3000) Std. Dev: 0.735402 [ -1.34737e-2] ( 0.580288 ? 0.932191) Outliers: 8/10 = 18 (?=48.0997, ?=0.721928) Outlier variance: 1.96000e-2 (slight) ------ Dataset: + N=50 CI=95.0000 Statistic Value [ Bias] (Bootstrapped LB?UB) Min: 74.0000 1st Qu. 76.0000 Median: 76.0000 3rd Qu. 77.0000 Max: 79.0000 Average: 76.4200 [ -6.32000e-4] ( 76.1200 ? 76.6800) Std. Dev: 1.03194 [ -1.54531e-2] ( 0.852607 ? 1.29363) Outliers: 1/2 = 3 (?=76.4194, ?=1.01649) Outlier variance: 1.96000e-2 (slight) Difference at 95.0% confidence 28.3200 ? 0.355542 58.8773% ? 0.739172% (Student's t, pooled s = 0.896023) ------ Dataset: * N=50 CI=95.0000 Statistic Value [ Bias] (Bootstrapped LB?UB) Min: 65.0000 1st Qu. 66.0000 Median: 66.0000 3rd Qu. 66.0000 Max: 67.0000 Average: 66.1400 [ -2.14000e-4] ( 66.0200 ? 66.2400) Std. Dev: 0.404566 [ -8.32260e-3] ( 0.303046 ? 0.520596) Outliers: 1/8 = 9 (?=66.1398, ?=0.396243) Outlier variance: 1.96000e-2 (slight) Difference at 95.0% confidence 18.0400 ? 0.235502 37.5052% ? 0.489608% (Student's t, pooled s = 0.593502) ------ Dataset: % N=50 CI=95.0000 Statistic Value [ Bias] (Bootstrapped LB?UB) Min: 47.0000 1st Qu. 48.0000 Median: 48.0000 3rd Qu. 48.0000 Max: 49.0000 Average: 47.9800 [ -2.34000e-4] ( 47.8800 ? 48.0200) Std. Dev: 0.246610 [ -1.61201e-2] ( 0.00000e+0 ? 0.377424) Outliers: 2/1 = 3 (?=47.9798, ?=0.230490) Outlier variance: 1.96000e-2 (slight) No difference proven at 95.0% confidence ------ Dataset: # N=50 CI=95.0000 Statistic Value [ Bias] (Bootstrapped LB?UB) Min: 20.0000 1st Qu. 20.0000 Median: 20.0000 3rd Qu. 20.0000 Max: 21.0000 Average: 20.2000 [ -5.00000e-5] ( 20.1000 ? 20.3000) Std. Dev: 0.404061 [ -6.49526e-3] ( 0.303046 ? 0.462910) Outliers: 0/10 = 10 (?=20.1999, ?=0.397566) Outlier variance: 7.50015e-2 (slight) Difference at 95.0% confidence -27.9000 ? 0.235433 -58.0042% ? 0.489467% (Student's t, pooled s = 0.593330) ------ ok -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Sat Jan 2 16:12:05 2016 From: t@REDACTED (Tristan Sloughter) Date: Sat, 02 Jan 2016 09:12:05 -0600 Subject: [erlang-questions] Relx And Rebar3 In-Reply-To: References: Message-ID: <1451747525.108632.481027610.242147D0@webmail.messagingengine.com> On Wed, Dec 30, 2015, at 08:45 AM, Onorio Catenacci wrote: > Since it looks as if Rebar3 will call Relx should I fork Relx and > submit my pull requests there? Yes. Rebar3 uses relx, as does exrm actually. -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Sat Jan 2 21:52:55 2016 From: donpedrothird@REDACTED (John Doe) Date: Sat, 2 Jan 2016 23:52:55 +0300 Subject: [erlang-questions] Mnesia select, field starts with Message-ID: Hi, Is there a way to do select queries from a mnesia table with a 'startswith' guard on a binary field, without qlc? And the second question. Assume we have an ordered_set table with a secondary index. When there are two guard tests in a guard, one for key field, another for index field, will mnesia use both indexes, or just the the primary one? I know that mnesia is aware about secondary indexes when it does selects, but does it use indexes always, or just when the guard tests only one field, the one with secondary index? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbutler88@REDACTED Sun Jan 3 19:30:10 2016 From: jonbutler88@REDACTED (Jon Butler) Date: Sun, 3 Jan 2016 18:30:10 +0000 Subject: [erlang-questions] Weird issue with global names Message-ID: Hi All, Disclaimer - I'm new to erlang, this may be a "stupid" question. I have at least read the docs :) I'm seeing some (possibly) odd behavior trying to use global names between two instances of the erlang shell on the same node. The code I am currently testing is 99% rebar boilerplate at the moment, so I won't bore you with lines of template code unless it's asked for. My setup is that I have an application with a supervisor, and a number of gen_servers that run under that supervisor. I have modified one of the gen_servers to register globally (using the {global, Name} method), and can confirm in the init method that the chosen name is present in the output of global:registered_names(). I then run a second application on the same node that calls net_kernel:connect to the previous node, which returns successfully. However, I am not able to see the globally registered name I just setup in the output of global:registered_names() on this node. I also notice that if I do not provide the "-noshell" argument when starting the first application, running global:registered_names() in the shell gives an empty list even though the application ran and registered the name successfully. Simple examples of global name registration between two shells (not running applications) on the same node work fine. Am I missing something? Thanks, Jon -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Sun Jan 3 20:43:51 2016 From: zxq9@REDACTED (zxq9) Date: Mon, 04 Jan 2016 04:43:51 +0900 Subject: [erlang-questions] Weird issue with global names In-Reply-To: References: Message-ID: <2876121.13WADT7PFG@changa> On 2016?1?3? ??? 18:30:10 Jon Butler wrote: > I then run a second application on the same node that calls > net_kernel:connect to the previous node, which returns successfully. > However, I am not able to see the globally registered name I just setup in > the output of global:registered_names() on this node. There are some details about how global makes introductions among nodes that have been added to the cluster. You're probably looking for this: http://www.erlang.org/doc/man/global.html#sync-0 Keep playing around with it and things will make sense. -Craig From zdenek@REDACTED Sun Jan 3 21:08:08 2016 From: zdenek@REDACTED (Zdenek Sejcek) Date: Sun, 3 Jan 2016 21:08:08 +0100 Subject: [erlang-questions] SSH daemon, raw mode for shell function Message-ID: Hi guys, I am trying to build application where users can remotely connect to using SSH. Following code snippet works perfectly fine: start() -> ssh:daemon(1122, [ {system_dir, "/tmp/ssh_daemon"}, {shell, fun dispatch/2 }, % {?MODULE, dispatch, []} {pwdfun, fun passwordfn/2}, {parallel_login, true} ]). What I need is to turn on raw mode, which simply means keys wont?t be interpretted on client side (e.g. shell command line), but everything will be send to server first. It enables applications like vi, emacs, mc to offer complex TUI. Some people suggested ncurses as solution, but I still don?t know how erlang implements ssh server under the hood so I can?t apply such a complicated solution right now. So my question is: how to turn on raw mode? Or please share some under-cover details that might help me to better understand how ssh daemon works. Thank you. Zdenek Sejcek From mars.leezm@REDACTED Mon Jan 4 14:45:20 2016 From: mars.leezm@REDACTED (Zhongmiao Li) Date: Mon, 4 Jan 2016 13:45:20 +0000 Subject: [erlang-questions] Asynchronous operations slow down the system Message-ID: <461806BD-9D58-46E3-8D5C-41019DDC4F5B@gmail.com> Hi all, I am experiencing a problem that in my program, executing some background operations seems to slow down other operations running in foreground?. I am implementing a transactional datastore on top of Erlang. A transaction reads bunches of data (read phase) and then enters a commit phase that write data to the data store. To provide fault tolerance, in the commit phase, written data is synchronously replicated to a few Erlang nodes, running in different physical machines. Client is notified after the replication is finished. Since replication is slow, I make replication asynchronous: client is notified as soon as the data is written to its local node and the replication process just continues running. Ideally, this should improve throughput, as now the client doesn?t wait replication to finish and can execute more operations. However, I benchmarked with 1 thread as client and I don?t see difference in the throughput between synchronous mode and asynchronous mode. After checking more carefully of the metrics, I found that the commit phase of asynchronous mode is faster than before, but somehow the read phase becomes slower. The following are the average executing time for read and commit in microsecond of these two modes: Synchronous: Read 8381 Commit 4529 Asynchronous: Read 10874 Commit 1287 Machines are not overloaded yet, because each machine has 2 CPUs and the CPU utilization for datastore is only about 75%. And read and replication is totally decoupled: client only accesses a data storage fsm to read; replication is handled by individual replication fsms, so data storage fsm won?t be bothered (and possibly slowed down) during replication. I can only guess that it might be related with scheduling or asynchronous threads, but I couldn?t solve it so far?. Any suggestions and help are really appreciated! Thank you in advance! Thank you, Li -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles@REDACTED Mon Jan 4 19:10:34 2016 From: charles@REDACTED (Charles Weitzer) Date: Mon, 4 Jan 2016 18:10:34 +0000 Subject: [erlang-questions] Senior Software Engineer Needed for Machine Learning Group Message-ID: The Voleon Group is a quantitative hedge fund located in Berkeley, California. We would like to hire a senior software engineer as soon as possible. Voleon's founders previously worked together at one of the most successful quantitative hedge funds in the world. Our CEO has a PhD in Computer Science from Stanford and has been CEO and founder of a successful Internet infrastructure startup. Our Chief Investment Officer has a PhD in Statistics from Berkeley. Voleon's team includes PhD's from leading departments in statistics, computer science, and mathematics. We have made several unpublished advances in the field of machine learning and in other areas as well. Here is our formal job description: ********************************************************** * Senior Software Engineer * Technology-driven investment firm employing cutting-edge statistical machine learning techniques seeks an exceptionally capable software engineer. You will architect and implement new production trading systems, machine learning infrastructure, data integration pipelines, and large-scale storage systems. The firm researches and deploys systematic trading strategies designed to generate attractive returns without being dependent on the performance of the overall market. Join a team of under 30 people that includes a Berkeley statistics professor as well as over ten PhD's from Berkeley, Chicago, CMU, Princeton, Stanford, and UCLA, led by the founder and CEO of a successful Internet infrastructure technology firm. The firm's offices are walking distance from BART and the UC Berkeley campus in downtown Berkeley, California. We have a casual and collegial office environment, weekly catered lunches, and competitive benefits packages. We seek candidates with a proven track record of writing correct, well-designed software, solving hard problems, and delivering complex projects on time. You should preferably have experience designing and implementing fault-tolerant distributed systems. Experience with building large-scale data infrastructure, stream processing systems, or latency-sensitive programs is a bonus. We are growing rapidly. Willingness to take initiative and a gritty determination to productize are essential. Required experience: - experience with functional programming languages such as Erlang, Haskell, etc. - developing with C/C++/Python/Go in a Linux environment with a focus on performance, concurrency, and correctness. - working in TCP/IP networking, multi-threading, and server development. - working with common Internet protocols (IP, TCP/UDP, SSL/TLS, HTTP, SNMP, etc.). - architecting and designing highly available systems. - architecting and designing large-scale data management infrastructure. - working in large codebases and building modular, manageable code. Preferred experience: - debugging and performance profiling, including the use of tools such as strace, valgrind, gdb, tcpdump, etc. - working with build and test automation tools. - working with well-defined change management processes. - diagnosing RDBMS performance problems, exploiting indexing, using EXPLAIN PLAN, optimizing at the code layer, etc. - working with messaging queues (RabbitMQ, Redis, etc.) as well as distributed caching systems. Interest in financial applications is essential, but experience in finance is not a primary factor in our hiring. Benefits and compensation are highly competitive. ********************************************************** The above job description is just a starting point in terms of possible duties and seniority. We can be very flexible for the right person. If you are interested, please apply with your full and complete CV: http://voleon.com/apply/ The Voleon Group is an Equal Opportunity employer. Applicants are considered without regard to race, color, religion, creed, national origin, age, sex, gender, marital status, sexual orientation and identity, genetic information, veteran status, citizenship, or any other factors prohibited by local, state, or federal law. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andre@REDACTED Tue Jan 5 17:23:26 2016 From: andre@REDACTED (=?utf-8?Q?Andr=C3=A9_Cruz?=) Date: Tue, 5 Jan 2016 16:23:26 +0000 Subject: [erlang-questions] Strange interaction between Docker and Erlangs ports (exit_status lost) In-Reply-To: References: <1A27991C-1789-405C-86BE-997E75C511EA@cabine.org> Message-ID: <1D35AFCE-D748-4B82-AD81-EE80F1EC2442@cabine.org> On 17 Dec 2015, at 20:16, Lukas Larsson wrote: > > > On Thu, Dec 17, 2015 at 8:59 PM, Alexey Lebedeff > wrote: > So the assumption about no extra SIGCHLD is wrong and needs to be fixed. Are you willing to do this? Or I could give it a try. > > > It may actually already be fixed in master. I just did a complete rewrite of the spawn driver to be released in 19.0 and if i remember correctly it should not have this problem. I can confirm that R19 does not have this problem. Is there a timeframe on when we can expect R19 to be released? Thank you, Andr? -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas.larsson@REDACTED Tue Jan 5 17:42:55 2016 From: lukas.larsson@REDACTED (Lukas Larsson) Date: Tue, 5 Jan 2016 17:42:55 +0100 Subject: [erlang-questions] Strange interaction between Docker and Erlangs ports (exit_status lost) In-Reply-To: <1D35AFCE-D748-4B82-AD81-EE80F1EC2442@cabine.org> References: <1A27991C-1789-405C-86BE-997E75C511EA@cabine.org> <1D35AFCE-D748-4B82-AD81-EE80F1EC2442@cabine.org> Message-ID: On Tue, Jan 5, 2016 at 5:23 PM, Andr? Cruz wrote: > > I can confirm that R19 does not have this problem. > Great! Is there a timeframe on when we can expect R19 to be released? > > 19.0 is currently planned to be released Q2 2016. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From pavananms@REDACTED Tue Jan 5 18:45:59 2016 From: pavananms@REDACTED (Pavanan M S) Date: Tue, 5 Jan 2016 23:15:59 +0530 Subject: [erlang-questions] REST API Message-ID: HI, What is the basic idea behind a REST API ? I am trying to develop a calendar service having event notifications.etc. What is the actual importance of REST API in this context ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From fernando.benavides@REDACTED Tue Jan 5 19:33:02 2016 From: fernando.benavides@REDACTED (Brujo Benavides) Date: Tue, 5 Jan 2016 15:33:02 -0300 Subject: [erlang-questions] Dialyzer, behaviours, plts and what not Message-ID: <5F64426A-D384-4B56-81D0-E8C7E6E01CB6@inakanetworks.com> So, my friend Harenson was dialyzing some code where we?ve implemented egithub_webhook behaviour from egithub , and he found this warning: Callback info about the egithub_webhook behaviour is not available Being a big fan of dialyzer myself, I immediately jumped in and tried to fix our code to avoid that warning. But this time, it turns out, it seems like we actually found a bug in dialyzer. We reduced the issue to its smallest possible expression and uploaded it here . I?m pretty sure for most of you it will be just a curiosity, but just in case it actually helps someone, remember: Don?t define a callback and add a not exported function with the same name and arity to the same module in your libraries. At least, don?t do it until ERL-72 is fixed ;) Cheers! Fernando ?Brujo? Benavides about.me/elbrujohalcon -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Tue Jan 5 20:22:30 2016 From: mononcqc@REDACTED (Fred Hebert) Date: Tue, 5 Jan 2016 14:22:30 -0500 Subject: [erlang-questions] Dialyzer, behaviours, plts and what not In-Reply-To: <5F64426A-D384-4B56-81D0-E8C7E6E01CB6@inakanetworks.com> References: <5F64426A-D384-4B56-81D0-E8C7E6E01CB6@inakanetworks.com> Message-ID: <20160105192229.GF3450@fhebert-ltm2.internal.salesforce.com> On 01/05, Brujo Benavides wrote: >We reduced the issue to its smallest possible expression and uploaded >it here . > Interestingly enough, I can't replicate the bug after adapting the repository to work in rebar3. Here's 100% of the procedure to replicate the fix: ? dialyzeit ? master ? mkdir apps ? dialyzeit ? master ? mv first_app apps/ ? dialyzeit ? master* ? mv second_app apps/ ? dialyzeit ? master* ? rebar3 dialyzer ===> Verifying dependencies... ===> Compiling first ===> Compiling second ===> Dialyzer starting, this may take a while... ===> Updating plt... ===> Resolving files... ===> Checking 157 files in "/private/tmp/dialyzeit/_build/default/rebar3_18.2_plt"... ===> Doing success typing analysis... ===> Resolving files... ===> Analyzing 4 files with "/private/tmp/dialyzeit/_build/default/rebar3_18.2_plt"... _build/default/lib/first/src/good_child.erl 12: The inferred return type of bad/0 ('not_bad') has nothing in common with 'bad', which is the expected return type for the callback of bad_behaviour behaviour _build/default/lib/second/src/bad_child.erl 13: The inferred return type of bad/0 ('not_bad') has nothing in common with 'bad', which is the expected return type for the callback of bad_behaviour behaviour ===> Warnings written to /private/tmp/dialyzeit/_build/default/18.2.dialyzer_warnings ===> Warnings occured running dialyzer: 2 This would make me think the issue is in the environment configuration and/or project structure more than anything else. Regards, Fred. From fernando.benavides@REDACTED Tue Jan 5 20:26:56 2016 From: fernando.benavides@REDACTED (Brujo Benavides) Date: Tue, 5 Jan 2016 16:26:56 -0300 Subject: [erlang-questions] Dialyzer, behaviours, plts and what not In-Reply-To: <20160105192229.GF3450@fhebert-ltm2.internal.salesforce.com> References: <5F64426A-D384-4B56-81D0-E8C7E6E01CB6@inakanetworks.com> <20160105192229.GF3450@fhebert-ltm2.internal.salesforce.com> Message-ID: <848EADE9-4E95-464D-AEF8-28DE89FD9EE5@inakanetworks.com> Fred: In your example, dialyzer is analysing both apps _at the same time_ ;) In the original, first_app was a dependency for second_app, therefore bad_behaviour was in the pit but not in the path when dialyzer analysed second_app. To actually make it work with rebar3 and replicate the issue you will need to split the app into 2 repos, I presume. Cheers! > On Jan 5, 2016, at 16:22, Fred Hebert wrote: > > On 01/05, Brujo Benavides wrote: >> We reduced the issue to its smallest possible expression and uploaded it here . >> > > Interestingly enough, I can't replicate the bug after adapting the repository to work in rebar3. Here's 100% of the procedure to replicate the fix: > > ? dialyzeit ? master ? mkdir apps > ? dialyzeit ? master ? mv first_app apps/ > ? dialyzeit ? master* ? mv second_app apps/ > ? dialyzeit ? master* ? rebar3 dialyzer > ===> Verifying dependencies... > ===> Compiling first > ===> Compiling second > ===> Dialyzer starting, this may take a while... > ===> Updating plt... > ===> Resolving files... > ===> Checking 157 files in "/private/tmp/dialyzeit/_build/default/rebar3_18.2_plt"... > ===> Doing success typing analysis... > ===> Resolving files... > ===> Analyzing 4 files with "/private/tmp/dialyzeit/_build/default/rebar3_18.2_plt"... > > _build/default/lib/first/src/good_child.erl > 12: The inferred return type of bad/0 ('not_bad') has nothing in common with 'bad', which is the expected return type for the callback of bad_behaviour behaviour > > _build/default/lib/second/src/bad_child.erl > 13: The inferred return type of bad/0 ('not_bad') has nothing in common with 'bad', which is the expected return type for the callback of bad_behaviour behaviour > ===> Warnings written to /private/tmp/dialyzeit/_build/default/18.2.dialyzer_warnings > ===> Warnings occured running dialyzer: 2 > > This would make me think the issue is in the environment configuration and/or project structure more than anything else. > > Regards, > Fred. From rainer.hansen@REDACTED Tue Jan 5 21:13:22 2016 From: rainer.hansen@REDACTED (Rainer Hansen) Date: Tue, 05 Jan 2016 21:13:22 +0100 Subject: [erlang-questions] REST API References: Message-ID: <87vb77aiot.fsf@gmx.net> Pavanan M S writes: > HI, > What is the basic idea behind a REST API ? I am trying to develop a > calendar service having event notifications.etc. What is the actual > importance of REST API in this context ? REST APIs have nothing to do with Erlang or any other programming languages directly because it is an architectural style. Roy T. Fielding is the inventor of REST. He has given a good introduction to it last year, here you can find his slides: http://roy.gbiv.com/talks/201511_Fielding_REST_CF.pdf Without knowing more details about your calendar service it is difficult to answer your questions. REST introduces a number of design constraints (see page 23 of the presentation mentioned above) to achieve certain properties (see page 24). Does your calendar service fit into those constraints? Are the properties REST tries to achieve important for your service? The REST architecture style is not that easy to grap. Hence, many call REST what they do but it has nothing to do with it. A good book on that topic is RESTful Web APIs by Leonard Richardson and Mike Amundsen, http://restfulwebapis.com/ Rainer From juan.carizza@REDACTED Tue Jan 5 19:54:43 2016 From: juan.carizza@REDACTED (Juan Carizza) Date: Tue, 05 Jan 2016 18:54:43 +0000 Subject: [erlang-questions] REST API In-Reply-To: References: Message-ID: Its just an specification to built an API through HTTP (generlaly) which complies some requirements (stateless, cacheable, system layered, etc). You can interact with the API over http, so you can consume data from javascript, curl, python, C. So this is cool if you will have many devices consuming data from server. El mar., 5 ene. 2016 a las 15:02, Pavanan M S () escribi?: > HI, > What is the basic idea behind a REST API ? I am trying to develop a > calendar service having event notifications.etc. What is the actual > importance of REST API in this context ? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From singhabhishek.bit@REDACTED Wed Jan 6 06:55:14 2016 From: singhabhishek.bit@REDACTED (Abhishek Singh) Date: Wed, 6 Jan 2016 11:25:14 +0530 Subject: [erlang-questions] Error from on_load function of NIF module Message-ID: <032C3D09-B693-4E5F-95EC-46BDAA807F95@gmail.com> Hi, I?m trying to get NIF implementation of unicode collation integrated into a database. Erlang module trying to load NIF: https://gist.github.com/abhi-bit/3aea4ff78ffb52820260 During on_load function call, I?m seeing below error: The on_load function for module merger returned {error, {bad_lib, "Failed to find library init function: 'dlsym(0x7fa288718b30, _nif_init): symbol not found'?}} Any suggestion why that could be happening here? NIF C code lives under https://github.com/abhi-bit/merger for reference. /Abhi From bchesneau@REDACTED Wed Jan 6 10:18:28 2016 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 06 Jan 2016 09:18:28 +0000 Subject: [erlang-questions] Error from on_load function of NIF module In-Reply-To: <032C3D09-B693-4E5F-95EC-46BDAA807F95@gmail.com> References: <032C3D09-B693-4E5F-95EC-46BDAA807F95@gmail.com> Message-ID: not sure about your error but you may want to try https://github.com/refuge/ucol_nif with does collation using icu - beno?t On Wed, Jan 6, 2016 at 9:38 AM Abhishek Singh wrote: > Hi, > > I?m trying to get NIF implementation of unicode collation integrated into > a database. Erlang module trying to load NIF: > https://gist.github.com/abhi-bit/3aea4ff78ffb52820260 > > During on_load function call, I?m seeing below error: > > The on_load function for module merger returned {error, {bad_lib, "Failed > to find library init function: 'dlsym(0x7fa288718b30, _nif_init): symbol > not found'?}} > > Any suggestion why that could be happening here? NIF C code lives under > https://github.com/abhi-bit/merger for reference. > > /Abhi > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor.clark@REDACTED Wed Jan 6 19:19:35 2016 From: igor.clark@REDACTED (Igor Clark) Date: Wed, 6 Jan 2016 18:19:35 +0000 Subject: [erlang-questions] Error from on_load function of NIF module In-Reply-To: <032C3D09-B693-4E5F-95EC-46BDAA807F95@gmail.com> References: <032C3D09-B693-4E5F-95EC-46BDAA807F95@gmail.com> Message-ID: <568D5AB7.4070404@gmail.com> Hi Abhishek, I'm fairly new to writing NIFs, so forgive me if you've already tried everything here, but this type of error is very familiar from when I first tried building NIFs with external C/C++ library dependencies on OSX. Eventually I gave up writing my own Makefile and just let rebar do everything, and the errors went away :-D Anyway, I tried to build your "merger" project just now, and neither "make" nor "make all" seemed to be building the ucol collate_json.o file by default. Trying to run "make utf" against OSX's default icu libs afterwards didn't work either ("fatal error: 'unicode/ucol.h' file not found"). So I brew-installed & force-linked the homebrew icu4c lib, at which point "make utf" worked, and then merger:new/0 worked straight away: > $ erl -pa ./ebin > Erlang/OTP 18 [erts-7.1] [source] [64-bit] [smp:8:8] > [async-threads:10] [hipe] [kernel-poll:false] [dtrace] > > Eshell V7.1 (abort with ^G) > 1> merger:new(). > {ok,<<>>} Of course there may be other subsequent errors on trying to do anything more with it, but it looks at least like the NIF is loading OK for me, on both OSX 10.9.5 and 10.10.5. So I think it might be something to do with your environment there. Like I said, you may well know way more about this than I do, but if this was me, here are some things I'd look into: - try a more recent erlang version, from your Makefile it seems you have erts-5.10.4.0.0.1 and erl_interface-3.7.15 whereas my Homebrew erlang install has 7.1 and 3.8 respectively. - try using icu4c from homebrew, the UTF stuff in this project wouldn't build for me with the default OSX icu libs. - tweak the targets using "deps" in the Makefile; I get "make: Circular deps <- deps dependency dropped." when running "make" on it. - most of all, try getting rebar to do all the C compilation for you. For my NIFs, at least, I just tell it about external lib deps with CFLAGS/CXXFLAGS/LDFLAGS, and it orders everything correctly along with the flat-namespace stuff without me having to think about it. YMMV. BTW if anyone knows explicitly why the error is happening, rather than just "try to fix it with rebar magic", I'd love to know that too ;-) Cheers, Igor On 06/01/2016 05:55, Abhishek Singh wrote: > Hi, > > I?m trying to get NIF implementation of unicode collation integrated into a database. Erlang module trying to load NIF: https://gist.github.com/abhi-bit/3aea4ff78ffb52820260 > > During on_load function call, I?m seeing below error: > > The on_load function for module merger returned {error, {bad_lib, "Failed to find library init function: 'dlsym(0x7fa288718b30, _nif_init): symbol not found'?}} > > Any suggestion why that could be happening here? NIF C code lives under https://github.com/abhi-bit/merger for reference. > > /Abhi > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From bchesneau@REDACTED Wed Jan 6 20:42:10 2016 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 06 Jan 2016 19:42:10 +0000 Subject: [erlang-questions] [ANN] leveldb_manager: a helper to eleveldb for in-flight backups In-Reply-To: References: Message-ID: I'm trying to understand how to use the lib. Can 1 process open the database, while many others can read/write to it? - beno?t On Fri, Jul 10, 2015 at 2:33 PM Richard Carlsson wrote: > In order to be able to snapshot and back up a leveldb instance without > stopping the Erlang node (or shutting down eleveldb), we have written a > manager application that lets you temporarily stop leveldb traffic and > perform the snapshot (a very quick operation): > > https://github.com/klarna/leveldb_manager > > We would prefer if this made it into the eleveldb distribution itself, in > some shape, but for now the cleanest solution was to make it a separate > application with its own supervision. > > /Richard > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikpelinux@REDACTED Thu Jan 7 09:29:58 2016 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Thu, 7 Jan 2016 09:29:58 +0100 Subject: [erlang-questions] [ANN] leveldb_manager: a helper to eleveldb for in-flight backups In-Reply-To: References: Message-ID: <22158.8710.103460.574582@gargle.gargle.HOWL> Benoit Chesneau writes: > I'm trying to understand how to use the lib. Can 1 process open the > database, while many others can read/write to it? Some process must open or create the specific leveldb table first, which creates a supervised manager process for the table. Then any number of processes may read/write it via the registered name of that manager. The API is essentially the same as for plain eleveldb. > > - beno?t > > On Fri, Jul 10, 2015 at 2:33 PM Richard Carlsson > wrote: > > > In order to be able to snapshot and back up a leveldb instance without > > stopping the Erlang node (or shutting down eleveldb), we have written a > > manager application that lets you temporarily stop leveldb traffic and > > perform the snapshot (a very quick operation): > > > > https://github.com/klarna/leveldb_manager > > > > We would prefer if this made it into the eleveldb distribution itself, in > > some shape, but for now the cleanest solution was to make it a separate > > application with its own supervision. > > > > /Richard > > _______________________________________________ > > 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 sverker.eriksson@REDACTED Thu Jan 7 16:13:12 2016 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Thu, 7 Jan 2016 16:13:12 +0100 Subject: [erlang-questions] Error from on_load function of NIF module In-Reply-To: <032C3D09-B693-4E5F-95EC-46BDAA807F95@gmail.com> References: <032C3D09-B693-4E5F-95EC-46BDAA807F95@gmail.com> Message-ID: <568E8088.9000105@ericsson.com> On 01/06/2016 06:55 AM, Abhishek Singh wrote: > Hi, > > I?m trying to get NIF implementation of unicode collation integrated into a database. Erlang module trying to load NIF: https://gist.github.com/abhi-bit/3aea4ff78ffb52820260 > > During on_load function call, I?m seeing below error: > > The on_load function for module merger returned {error, {bad_lib, "Failed to find library init function: 'dlsym(0x7fa288718b30, _nif_init): symbol not found'?}} > > Any suggestion why that could be happening here? NIF C code lives under https://github.com/abhi-bit/merger for reference. > > /Abhi > > This error means that the library .so file succeeded to load but it did not contain a "nif_init" or "_nif_init" function that is created by the ERL_NIF_INIT macro. Use nm command to inspect symbols in your .so file. nm merger.so | grep nif_init # anything called nif_init ? nm merger.so | grep merger_nif # anything from merger.c ? /Sverker, Erlang/OTP From aronisstav@REDACTED Thu Jan 7 16:29:27 2016 From: aronisstav@REDACTED (Stavros Aronis) Date: Thu, 07 Jan 2016 15:29:27 +0000 Subject: [erlang-questions] Dialyzer, behaviours, plts and what not In-Reply-To: <5F64426A-D384-4B56-81D0-E8C7E6E01CB6@inakanetworks.com> References: <5F64426A-D384-4B56-81D0-E8C7E6E01CB6@inakanetworks.com> Message-ID: Hi Brujo! Thanks for the report! I have just created a pull request for a patch: https://github.com/erlang/otp/pull/934 Stavros On Tue, Jan 5, 2016 at 7:33 PM Brujo Benavides < fernando.benavides@REDACTED> wrote: > So, my friend Harenson was dialyzing some > code where we?ve implemented egithub_webhook behaviour from egithub > , and he found this warning: > > Callback info about the egithub_webhook behaviour is not available > > > Being a big fan of dialyzer myself, I immediately jumped in and tried to *fix > *our code to avoid that warning. > But this time, it turns out, it seems like we actually found a bug in > dialyzer. > We reduced the issue to its smallest possible expression and uploaded it > here . > > I?m pretty sure for most of you it will be just a curiosity, but just in > case it actually helps someone, remember: > > *Don?t define a callback and add a not exported function with the same > name and arity to the same module in your libraries.* > > At least, don?t do it until ERL-72 is > fixed ;) > > Cheers! > > *Fernando ?Brujo? Benavides* > about.me/elbrujohalcon > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From singhabhishek.bit@REDACTED Thu Jan 7 16:50:52 2016 From: singhabhishek.bit@REDACTED (Abhishek Singh) Date: Thu, 07 Jan 2016 15:50:52 +0000 Subject: [erlang-questions] Error from on_load function of NIF module In-Reply-To: <568E8088.9000105@ericsson.com> References: <032C3D09-B693-4E5F-95EC-46BDAA807F95@gmail.com> <568E8088.9000105@ericsson.com> Message-ID: I was able to overcome this error by copying macro statements from below link: https://github.com/couchbase/couchdb/blob/master/src/couchdb/priv/couch_ejson_compare/couch_ejson_compare.c#L486-L493 Not sure what exactly it does, would be useful if somebody could throw some light on it. On Thu, Jan 7, 2016 at 8:43 PM Sverker Eriksson < sverker.eriksson@REDACTED> wrote: > > > On 01/06/2016 06:55 AM, Abhishek Singh wrote: > > Hi, > > > > I?m trying to get NIF implementation of unicode collation integrated > into a database. Erlang module trying to load NIF: > https://gist.github.com/abhi-bit/3aea4ff78ffb52820260 > > > > During on_load function call, I?m seeing below error: > > > > The on_load function for module merger returned {error, {bad_lib, > "Failed to find library init function: 'dlsym(0x7fa288718b30, _nif_init): > symbol not found'?}} > > > > Any suggestion why that could be happening here? NIF C code lives under > https://github.com/abhi-bit/merger for reference. > > > > /Abhi > > > > > > This error means that the library .so file succeeded to load > but it did not contain a "nif_init" or "_nif_init" function > that is created by the ERL_NIF_INIT macro. > > Use nm command to inspect symbols in your .so file. > > nm merger.so | grep nif_init # anything called nif_init ? > > nm merger.so | grep merger_nif # anything from merger.c ? > > > /Sverker, Erlang/OTP > > > -- Thanks, Abhishek Singh -------------- next part -------------- An HTML attachment was scrubbed... URL: From sverker.eriksson@REDACTED Thu Jan 7 18:29:33 2016 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Thu, 7 Jan 2016 18:29:33 +0100 Subject: [erlang-questions] Error from on_load function of NIF module In-Reply-To: References: <032C3D09-B693-4E5F-95EC-46BDAA807F95@gmail.com> <568E8088.9000105@ericsson.com> Message-ID: <568EA07D.3050004@ericsson.com> On 01/07/2016 04:50 PM, Abhishek Singh wrote: > I was able to overcome this error by copying macro statements from > below link: > > https://github.com/couchbase/couchdb/blob/master/src/couchdb/priv/couch_ejson_compare/couch_ejson_compare.c#L486-L493 > #ifndef _MSC_VER #if defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550) __global #elif defined __GNUC__ __attribute__ ((visibility("default"))) #endif #endif ERL_NIF_INIT(...) > Not sure what exactly it does, would be useful if somebody could throw > some light on it. > My guess is the .so file is linked with option -fvisibility=hidden which according to the gcc man page "...can very substantially improve linking and load times of shared object libraries, produce more optimized code, provide near-perfect API export and prevent symbol clashes". That is, all symbols are made hidden by default and the above macro cludge makes an exception for the "nif_init" function that needs to be visible. I will see if I can incorporate that into the ERL_NIF_INIT macro. /Sverker, Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From pavananms@REDACTED Thu Jan 7 19:40:26 2016 From: pavananms@REDACTED (Pavanan M S) Date: Fri, 8 Jan 2016 00:10:26 +0530 Subject: [erlang-questions] erlang.mk Message-ID: Hi all, I have been trying to learn cowboy using this link - http://ninenines.eu/docs/en/cowboy/1.0/guide/getting_started/ They have given a makefile (erlang.mk) to set up bootstrapping . Apparently, a makefile defined themselves. I have 2 questions, 1. What is actually meant by bootstrapping in this context, and 2. How to do this without the help of erlang.mk ( I will be thankful if you give me links to other tutorials like this.) -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Thu Jan 7 21:03:31 2016 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Thu, 7 Jan 2016 21:03:31 +0100 Subject: [erlang-questions] erlang.mk In-Reply-To: References: Message-ID: <568EC493.2020805@ninenines.eu> On 01/07/2016 07:40 PM, Pavanan M S wrote: > Hi all, > > I have been trying to learn cowboy using this link - > http://ninenines.eu/docs/en/cowboy/1.0/guide/getting_started/ > They have given a makefile (erlang.mk ) > to set up bootstrapping . Apparently, a makefile defined themselves. > I have 2 questions, > 1. What is actually meant by bootstrapping in this context, and > 2. How to do this without the help of erlang.mk > > > ( I will be thankful if you give me links to other tutorials > like this.) This is a general Erlang.mk getting started: http://erlang.mk/guide/getting_started.html Bootstrapping as in creating all the files to get your project up and running. You can always create all files manually, use another tool or copy one of the examples to get started. -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From ameretat.reith@REDACTED Fri Jan 8 09:18:11 2016 From: ameretat.reith@REDACTED (Ameretat Reith) Date: Fri, 8 Jan 2016 11:48:11 +0330 Subject: [erlang-questions] Dependent module load before supervisor update Message-ID: <20160108114811.1d27e233@gmail.com> I have appup instructions like this: ` [ {load_module, child_sup}, {update, parent_sup, supervisor}, {update, child_sup, supervisor} ] I'm intending to update two supervisor states but one of them (parent_sup) needs upgraded code (a function changed) from child_sup module (child_spec:spec) during its init invocation. So I want upgrade child_sup function interfaces before supervisor upgrade of parent_sup and postpone child_spec init call (supervisor upgrade) to after parent_sup fully upgraded. Now the problem is, in above instructions, I cannot use `load_module, child_sup` or `load, {child_sup,...,..,}` getting error "Multiply defined module: child_sup" and If without doing this, parent_sup won't upgrade since It depend on upgraded interface functions from child_sup. So, Is there a way to control supervisor state upgrade and its module loading during release upgrade? From bchesneau@REDACTED Fri Jan 8 11:19:37 2016 From: bchesneau@REDACTED (Benoit Chesneau) Date: Fri, 08 Jan 2016 10:19:37 +0000 Subject: [erlang-questions] [ANN] leveldb_manager: a helper to eleveldb for in-flight backups In-Reply-To: <22158.8710.103460.574582@gargle.gargle.HOWL> References: <22158.8710.103460.574582@gargle.gargle.HOWL> Message-ID: On Thu, Jan 7, 2016 at 9:30 AM Mikael Pettersson wrote: > Benoit Chesneau writes: > > I'm trying to understand how to use the lib. Can 1 process open the > > database, while many others can read/write to it? > > Some process must open or create the specific leveldb table first, which > creates a supervised manager process for the table. Then any number of > processes may read/write it via the registered name of that manager. > > The API is essentially the same as for plain eleveldb. > OK I see thanks! - beno?t > > > > > - beno?t > > > > On Fri, Jul 10, 2015 at 2:33 PM Richard Carlsson < > carlsson.richard@REDACTED> > > wrote: > > > > > In order to be able to snapshot and back up a leveldb instance without > > > stopping the Erlang node (or shutting down eleveldb), we have written > a > > > manager application that lets you temporarily stop leveldb traffic and > > > perform the snapshot (a very quick operation): > > > > > > https://github.com/klarna/leveldb_manager > > > > > > We would prefer if this made it into the eleveldb distribution > itself, in > > > some shape, but for now the cleanest solution was to make it a > separate > > > application with its own supervision. > > > > > > /Richard > > > _______________________________________________ > > > 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 ingela.andin@REDACTED Fri Jan 8 12:02:23 2016 From: ingela.andin@REDACTED (Ingela Andin) Date: Fri, 8 Jan 2016 12:02:23 +0100 Subject: [erlang-questions] SSH daemon, raw mode for shell function In-Reply-To: References: Message-ID: Hi! This does not seem to be documented, but looking at the code you should be able to include gen_tcp/inet options in the ssh:daemon options list and they will be pass on to gen_tcp/inet if not explicitly disallowed. Have not tried the raw option. Regards Ingela Erlang/OTP Team - Ericsson AB 2016-01-03 21:08 GMT+01:00 Zdenek Sejcek : > Hi guys, > > I am trying to build application where users can remotely connect to using > SSH. Following code snippet works perfectly fine: > > start() -> > ssh:daemon(1122, > [ > {system_dir, "/tmp/ssh_daemon"}, > {shell, fun dispatch/2 }, % {?MODULE, dispatch, []} > {pwdfun, fun passwordfn/2}, > {parallel_login, true} > ]). > > What I need is to turn on raw mode, which simply means keys wont?t be > interpretted on client side (e.g. shell command line), but everything will > be send to server first. It enables applications like vi, emacs, mc to > offer complex TUI. Some people suggested ncurses as solution, but I still > don?t know how erlang implements ssh server under the hood so I can?t apply > such a complicated solution right now. > > So my question is: how to turn on raw mode? Or please share some > under-cover details that might help me to better understand how ssh daemon > works. > > Thank you. > Zdenek Sejcek > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rik.ribbers@REDACTED Fri Jan 8 14:51:51 2016 From: rik.ribbers@REDACTED (Rik Ribbers) Date: Fri, 8 Jan 2016 13:51:51 +0000 Subject: [erlang-questions] slow mnesia query Message-ID: <1A83AFB9-088C-41AD-904A-18CBDA3CC347@sidn.nl> Hello, Being relatively new to Erlang I got a mnesia database with a record that contains a key and a value. The key is a string (list) and the value another string. I want to search for all records where the key contains parts of a provided substring (a list) . The code is below: handle_get(PartialKey1, MaxResults) -> PartialKey2 = string:to_lower(PartialKey1), F = fun() -> C = qlc:cursor( qlc:q( [{R, Key, Value} || {R, Key, Value} <- mnesia:table(retro), (string:str(Key, PartialKey2) > 0), (string:len(Value) > 0)] ) ), R = qlc:next_answers(C, MaxResults), ok = qlc:delete_cursor(C), R end, Result = mnesia:async_dirty(F), Result. The code is working it does what is should do, however it does not perform very well? I guess this does have to do with the string:str comparison that needs to go over all records every time. This shouldn?t be that hard to optimise for performance, however I don?t have any idea how? Any help is appreciated Gr, Rik -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4409 bytes Desc: not available URL: From jesper.louis.andersen@REDACTED Fri Jan 8 15:48:25 2016 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Fri, 8 Jan 2016 15:48:25 +0100 Subject: [erlang-questions] slow mnesia query In-Reply-To: <1A83AFB9-088C-41AD-904A-18CBDA3CC347@sidn.nl> References: <1A83AFB9-088C-41AD-904A-18CBDA3CC347@sidn.nl> Message-ID: On Fri, Jan 8, 2016 at 2:51 PM, Rik Ribbers wrote: > The code is working it does what is should do, however it does not perform > very well? I guess this does have to do with the string:str comparison that > needs to go over all records every time. This shouldn?t be that hard to > optimise for performance, however I don?t have any idea how? One prerequisite is that you need an ordered_set table. A standard table hashes the keys, so it is forced to visit all entries since it cannot use the index as a constraint. For an ordered_set table on a string, the lexicographic ordering of the string contents are indexed, so there the prefix is a possible match. To get this to work, however, you would have to coerce qlc and mnesia that the index is available, so it is only half the battle won. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Fri Jan 8 16:44:54 2016 From: ingela.andin@REDACTED (Ingela Andin) Date: Fri, 8 Jan 2016 16:44:54 +0100 Subject: [erlang-questions] SSH daemon, raw mode for shell function In-Reply-To: References: Message-ID: Hi again! Humm ... realised you probably where not talking about raw socket options, which when I think about it we should not allow to be set on the ssh socket. Maybe you could elaborate a little on your use case? Regards Ingela Erlang/OTP Team - Ericsson AB 2016-01-03 21:08 GMT+01:00 Zdenek Sejcek : > Hi guys, > > I am trying to build application where users can remotely connect to using > SSH. Following code snippet works perfectly fine: > > start() -> > ssh:daemon(1122, > [ > {system_dir, "/tmp/ssh_daemon"}, > {shell, fun dispatch/2 }, % {?MODULE, dispatch, []} > {pwdfun, fun passwordfn/2}, > {parallel_login, true} > ]). > > What I need is to turn on raw mode, which simply means keys wont?t be > interpretted on client side (e.g. shell command line), but everything will > be send to server first. It enables applications like vi, emacs, mc to > offer complex TUI. Some people suggested ncurses as solution, but I still > don?t know how erlang implements ssh server under the hood so I can?t apply > such a complicated solution right now. > > So my question is: how to turn on raw mode? Or please share some > under-cover details that might help me to better understand how ssh daemon > works. > > Thank you. > Zdenek Sejcek > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Fri Jan 8 18:28:50 2016 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Fri, 08 Jan 2016 18:28:50 +0100 Subject: [erlang-questions] slow mnesia query In-Reply-To: Message-ID: Hello ? native Erlang soundex / metaphone library would be nice to index some string key. Unfortunately I m not sure it does exists... Le?8 janv. 2016 3:48 PM, Jesper Louis Andersen a ?crit?: > > > On Fri, Jan 8, 2016 at 2:51 PM, Rik Ribbers wrote: >> >> The code is working it does what is should do, however it does not perform very well? I guess this does have to do with the string:str comparison that needs to go over all records every time. This shouldn?t be that hard to optimise for performance, however I don?t have any idea how? > > > One prerequisite is that you need an ordered_set table. A standard table hashes the keys, so it is forced to visit all entries since it cannot use the index as a constraint. For an ordered_set table on a string, the lexicographic ordering of the string contents are indexed, so there the prefix is a possible match. > > To get this to work, however, you would have to coerce qlc and mnesia that the index is available, so it is only half the battle won. > > > -- > J. From erlang@REDACTED Fri Jan 8 18:36:58 2016 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 8 Jan 2016 18:36:58 +0100 Subject: [erlang-questions] Towards a Mac Music machine Message-ID: I want to make a music application on my macbook The plan is: Graphics etc. in swift (so I can hit coreaudio, coremidi and graphics) High level Logic etc in Erlang Interface through sockets Package everything in a Mac bundle (for distribution) I've managed to make some windows and midi things in swift These are described here: http://joearms.github.io/2016/01/04/fun-with-swift.html http://joearms.github.io/2016/01/06/fun_with_swift_and_midi.html And I have some (unpublished) code to read a midi keyboard. To connect Swift and Erlang I'll use sockets - I found some code at https://github.com/cezarywojcik/Swift-Server Which I can tweak Now I want to built a Mac bundle containing a complete Erlang system Bundles are described here: https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html I know this was done in Wings-3D - but wondered if anybody had experience with this. Anybody who is interested in helping please contact me off-list. Cheers /Joe From ruben.caro.estevez@REDACTED Fri Jan 8 18:39:50 2016 From: ruben.caro.estevez@REDACTED (=?UTF-8?Q?Rub=C3=A9n_Caro?=) Date: Fri, 8 Jan 2016 18:39:50 +0100 Subject: [erlang-questions] SSH ssh_connection.exec/4 too much data too fast? Message-ID: Hi fellow erlangers, I have a question regarding ssh. If I run something like 'while sleep 0.01; do echo hello; done;' using 'ssh_connection.exec/4' I get its virtually infinite output as a sequence of 'data' messages (*{ssh_cm, ssh_connection_ref(), {data, ssh_channel_id(), ssh_data_type_code(), Data :: binary()}}*). No other message (exit_signal, exit_status, etc.) is expected from an infinite output like this. Everything works as expected. If I run something like 'while sleep 0.000001; do echo hello; done;' or something like 'while true; do echo hello; done;' then I get only a few messages, but then I stop receiving messages on my process' mailbox. I do not receive any other message either (exit_signal, exit_status, etc.) . Complete silence. I see the remote process is still using CPU (I guess producing output) on the remote machine _after_ my process stops receiving data messages. After a few seconds it stops using CPU (I guess stops producing output). Then everything is stalled. My erlang process not receiving messages, and the remote process waiting. This is all being done from an Elixir library, but I've reproduced from pure Erlang, so no problem from there. You can see it all in https://github.com/rubencaro/sshex/issues/4. Maybe you can explain these symptoms from your knowledge. Can you help me? Many thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Sat Jan 9 07:12:19 2016 From: donpedrothird@REDACTED (John Doe) Date: Sat, 9 Jan 2016 09:12:19 +0300 Subject: [erlang-questions] enif_get_resource and reference counting Message-ID: Hi, Does successful call of enif_get_resource increase reference counter on a resource, like enif_keep_resource does? Or It is neccessary to do enif_get_resource(...); enif_keep_resource(...); ...some job... enif_release_resource(...); And if it does not increment the counter, can the resource become destroyed in the another thread between calls to enif_get_resource and enif_keep_resource? I'm afraid of race condition there. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stamarit@REDACTED Sat Jan 9 13:01:14 2016 From: stamarit@REDACTED (Salvador Tamarit) Date: Sat, 9 Jan 2016 13:01:14 +0100 Subject: [erlang-questions] CfP: Workshop on Program Transformation for Programmability in Heterogeneous Architectures (Co-located with CGO16); Deadline Jan 15 Message-ID: [Apologies if you receive multiple copies of this announcement.] ********************************************************************************* PROHA 2016, CALL FOR PAPERS First Workshop on Program Transformation for Programmability in Heterogeneous Architectures http://goo.gl/RzGbzY Barcelona, 12th March 2016, in conjunction with the CGO'16 Conference ********************************************************************************* Important Dates: Paper submission deadline: 15 January 2016 23:59 (UTC) Author notification: 5 February 2016 Final manuscript due: 26 February 2016 Scope: Developing and maintaining high-performance applications and libraries for heterogeneous architectures is a difficult task, usually requiring code transformations performed by an expert. Tools assisting in and, if possible, automating such transformations are of course of great interest. However, such tools require significant knowledge and reasoning capabilities. For example, the former could be a machine-understandable descriptions of what a piece of code is expected to do, while the latter could be a set of transformations and a corresponding logical context in which they are applicable, respectively. Furthermore, strategies to identify the sequence of transformations leading to the best resulting code need to be elaborated. This workshop will focus on techniques and foundations which make it possible to perform source code transformations, which preserve the intended semantics of the original code and improve efficiency, portability or maintainability. The topics of interest for the workshop include, but are not limited to: * Program annotations to capture algorithmic properties and intended code semantics. * Programming paradigms able to express underlying (mathematical) properties of code. * Usage of dynamic and static mechanisms to infer relevant code properties. * Transformations which preserve intended semantics. * Strategies to apply transformations. * Heuristics to guide program transformation and techniques to synthesize / learn these heuristics. * Tools Submission Guidelines: Submissions are to be written in English and not exceed 10 pages, including bibliography. Submissions should be written in ACM double-column format using a 10-point type. Authors should follow the information for formatting ACM SIGPLAN conference papers, which can be found at http://www.sigplan.org/Resources/Author . Authors should submit their papers in pdf format using the EasyChair submission website https://easychair.org/conferences/?conf=proha2016 . Publication: The proceedings will be made publicly available through ArXiV. Workshop Organizers: - Manuel Carro, IMDEA Software Institute and Technical University of Madrid - Colin W. Glass, University of Stuttgart - Jan Kuper, University of Twente - Julio Mari?o, Technical University of Madrid - Lutz Schubert, University of Ulm - Guillermo Vigueras, IMDEA Software Institute - Salvador Tamarit, Technical University of Madrid If you have any questions, please contact the program chair at manuel.carro@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.goertzen@REDACTED Sat Jan 9 22:20:16 2016 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Sat, 09 Jan 2016 21:20:16 +0000 Subject: [erlang-questions] enif_get_resource and reference counting In-Reply-To: References: Message-ID: enif_get_resource() does not increase the reference count. You can think of the term representing the resource as counting as a reference, so as long as the term and its environment are alive then the resource will not be destroyed. In the example you have above you can skip the keep()/release() because the resource term w/environment keeps it alive. On Sat, Jan 9, 2016 at 12:12 AM John Doe wrote: > Hi, > Does successful call of enif_get_resource increase reference counter on a > resource, like enif_keep_resource does? > Or It is neccessary to do > enif_get_resource(...); > enif_keep_resource(...); > ...some job... > enif_release_resource(...); > > And if it does not increment the counter, can the resource become > destroyed in the another thread between calls to enif_get_resource and > enif_keep_resource? > I'm afraid of race condition there. > _______________________________________________ > 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 Jan 9 22:41:33 2016 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sat, 09 Jan 2016 21:41:33 +0000 Subject: [erlang-questions] mnesia + leveldb Message-ID: I am reading the slides of the talk given at Erlang Factory: http://www.erlang-factory.com/static/upload/media/143415340626199euc2015mnesialeveldb.pdf And right now I am not sure how the data are store din leveldb: does it use one instance of LevelDB / table or 1 instance in which all tables are shared? - beno?t -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark@REDACTED Sun Jan 10 04:59:43 2016 From: mark@REDACTED (Mark Steele) Date: Sat, 9 Jan 2016 22:59:43 -0500 Subject: [erlang-questions] Troubleshooting TLS distribution Message-ID: Hi all, I've been having a stubborn problem with getting TLS distribution working and could use a hand. I'm running a test CA and have a cert that works fine when using it for erlang cowboy serving TLS traffic, however using the same cert for TLS distribution is not working. I've tried several different certs that I've generated (some generated with the dogtag CA, others with a testca using openssl), and none seem to be working. I'm following the steps in the documentation, and have tried with versions 17/18 with identical results. For v17, my .rel file: {release,{"start_clean",[]}, {erts,"6.4"}, [{kernel,"3.2"}, {stdlib,"2.4"}, {sasl,"2.4.1"}, {crypto,"3.5"}, {asn1,"3.0.4"}, {public_key,"0.23"}, {ssl,"6.0"} ]}. Here's what my session looks like. erl -boot start_clean -proto_dist inet_tls -ssl_dist_op server_certfile /tmp/server.pem server_keyfile /tmp/server.key client_certfile /tmp/server.pem client_keyfile /tmp/server.key -name test1@REDACTED Erlang/OTP 17 [erts-6.4] [source-2e19e2f] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] =PROGRESS REPORT==== 9-Jan-2016::21:58:24 === supervisor: {local,sasl_safe_sup} started: [{pid,<0.48.0>}, {name,alarm_handler}, {mfargs,{alarm_handler,start_link,[]}}, {restart_type,permanent}, {shutdown,2000}, {child_type,worker}] =PROGRESS REPORT==== 9-Jan-2016::21:58:24 === supervisor: {local,sasl_safe_sup} started: [{pid,<0.49.0>}, {name,overload}, {mfargs,{overload,start_link,[]}}, {restart_type,permanent}, {shutdown,2000}, {child_type,worker}] =PROGRESS REPORT==== 9-Jan-2016::21:58:24 === supervisor: {local,sasl_sup} started: [{pid,<0.47.0>}, {name,sasl_safe_sup}, {mfargs, {supervisor,start_link, [{local,sasl_safe_sup},sasl,safe]}}, {restart_type,permanent}, {shutdown,infinity}, {child_type,supervisor}] =PROGRESS REPORT==== 9-Jan-2016::21:58:24 === supervisor: {local,sasl_sup} started: [{pid,<0.50.0>}, {name,release_handler}, {mfargs,{release_handler,start_link,[]}}, {restart_type,permanent}, {shutdown,2000}, {child_type,worker}] =PROGRESS REPORT==== 9-Jan-2016::21:58:24 === application: sasl started_at: 'test1@REDACTED' =PROGRESS REPORT==== 9-Jan-2016::21:58:24 === application: crypto started_at: 'test1@REDACTED' =PROGRESS REPORT==== 9-Jan-2016::21:58:24 === application: asn1 started_at: 'test1@REDACTED' =PROGRESS REPORT==== 9-Jan-2016::21:58:24 === application: public_key started_at: 'test1@REDACTED' =PROGRESS REPORT==== 9-Jan-2016::21:58:24 === supervisor: {local,ssl_sup} started: [{pid,<0.59.0>}, {name,ssl_manager}, {mfargs,{ssl_manager,start_link,[[]]}}, {restart_type,permanent}, {shutdown,4000}, {child_type,worker}] =PROGRESS REPORT==== 9-Jan-2016::21:58:24 === supervisor: {local,ssl_sup} started: [{pid,<0.60.0>}, {name,tls_connection}, {mfargs,{tls_connection_sup,start_link,[]}}, {restart_type,permanent}, {shutdown,4000}, {child_type,supervisor}] =PROGRESS REPORT==== 9-Jan-2016::21:58:24 === supervisor: {local,ssl_sup} started: [{pid,<0.61.0>}, {name,ssl_socket}, {mfargs,{ssl_listen_tracker_sup,start_link,[]}}, {restart_type,permanent}, {shutdown,4000}, {child_type,supervisor}] =PROGRESS REPORT==== 9-Jan-2016::21:58:24 === application: ssl started_at: 'test1@REDACTED' Eshell V6.4 (abort with ^G) (test1@REDACTED)1> net_adm:ping('test2@REDACTED'). =PROGRESS REPORT==== 9-Jan-2016::21:58:37 === supervisor: {local,inet_gethost_native_sup} started: [{pid,<0.68.0>},{mfa,{inet_gethost_native,init,[[]]}}] =PROGRESS REPORT==== 9-Jan-2016::21:58:37 === supervisor: {local,kernel_safe_sup} started: [{pid,<0.67.0>}, {name,inet_gethost_native_sup}, {mfargs,{inet_gethost_native,start_link,[]}}, {restart_type,temporary}, {shutdown,1000}, {child_type,worker}] =ERROR REPORT==== 9-Jan-2016::21:58:37 === SSL: certify: ssl_alert.erl:92:Fatal error: internal error pang (test1@REDACTED)2> >From the other shell: erl -boot start_clean -proto_dist inet_tls -ssl_dist_op server_certfile /tmp/server.pem server_keyfile /tmp/server.key client_certfile /tmp/server.pem client_keyfile /tmp/server.key -name test2@REDACTED Erlang/OTP 17 [erts-6.4] [source-2e19e2f] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] =PROGRESS REPORT==== 9-Jan-2016::21:58:12 === supervisor: {local,sasl_safe_sup} started: [{pid,<0.48.0>}, {name,alarm_handler}, {mfargs,{alarm_handler,start_link,[]}}, {restart_type,permanent}, {shutdown,2000}, {child_type,worker}] =PROGRESS REPORT==== 9-Jan-2016::21:58:12 === supervisor: {local,sasl_safe_sup} started: [{pid,<0.49.0>}, {name,overload}, {mfargs,{overload,start_link,[]}}, {restart_type,permanent}, {shutdown,2000}, {child_type,worker}] =PROGRESS REPORT==== 9-Jan-2016::21:58:12 === supervisor: {local,sasl_sup} started: [{pid,<0.47.0>}, {name,sasl_safe_sup}, {mfargs, {supervisor,start_link, [{local,sasl_safe_sup},sasl,safe]}}, {restart_type,permanent}, {shutdown,infinity}, {child_type,supervisor}] =PROGRESS REPORT==== 9-Jan-2016::21:58:12 === supervisor: {local,sasl_sup} started: [{pid,<0.50.0>}, {name,release_handler}, {mfargs,{release_handler,start_link,[]}}, {restart_type,permanent}, {shutdown,2000}, {child_type,worker}] =PROGRESS REPORT==== 9-Jan-2016::21:58:12 === application: sasl started_at: 'test2@REDACTED' =PROGRESS REPORT==== 9-Jan-2016::21:58:12 === application: crypto started_at: 'test2@REDACTED' =PROGRESS REPORT==== 9-Jan-2016::21:58:12 === application: asn1 started_at: 'test2@REDACTED' =PROGRESS REPORT==== 9-Jan-2016::21:58:12 === application: public_key started_at: 'test2@REDACTED' =PROGRESS REPORT==== 9-Jan-2016::21:58:12 === supervisor: {local,ssl_sup} started: [{pid,<0.59.0>}, {name,ssl_manager}, {mfargs,{ssl_manager,start_link,[[]]}}, {restart_type,permanent}, {shutdown,4000}, {child_type,worker}] =PROGRESS REPORT==== 9-Jan-2016::21:58:12 === supervisor: {local,ssl_sup} started: [{pid,<0.60.0>}, {name,tls_connection}, {mfargs,{tls_connection_sup,start_link,[]}}, {restart_type,permanent}, {shutdown,4000}, {child_type,supervisor}] =PROGRESS REPORT==== 9-Jan-2016::21:58:12 === supervisor: {local,ssl_sup} started: [{pid,<0.61.0>}, {name,ssl_socket}, {mfargs,{ssl_listen_tracker_sup,start_link,[]}}, {restart_type,permanent}, {shutdown,4000}, {child_type,supervisor}] =PROGRESS REPORT==== 9-Jan-2016::21:58:12 === application: ssl started_at: 'test2@REDACTED' Eshell V6.4 (abort with ^G) (test2@REDACTED)1> =ERROR REPORT==== 9-Jan-2016::21:58:37 === SSL: hello: ssl_handshake.erl:167:Fatal error: internal error The errors are the same between v17 and v18 (same error message). The cert: -----BEGIN CERTIFICATE----- MIIE7jCCA9agAwIBAgIBBzANBgkqhkiG9w0BAQsFADBPMSwwKgYDVQQKDCNjb250 cm9sLWFsdC1kZWwub3JnIFNlY3VyaXR5IERvbWFpbjEfMB0GA1UEAwwWQ0EgU2ln bmluZyBDZXJ0aWZpY2F0ZTAeFw0xNTA5MzAwMTQ1MzBaFw0xNzA5MTkwMTQ1MzBa MIGFMQswCQYDVQQGEwJDQTEQMA4GA1UECAwHT250YXJpbzEQMA4GA1UEBwwHVG9y b250bzEcMBoGA1UECgwTQ29udHJvbC1hbHQtZGVsLm9yZzERMA8GA1UECwwIU2Vj dXJpdHkxITAfBgNVBAMMGGRldjEuY29udHJvbC1hbHQtZGVsLm9yZzCCAiIwDQYJ KoZIhvcNAQEBBQADggIPADCCAgoCggIBAMRWGZVic7I8GxviniEkDkgyd8yQFgtT Cg9o7JFuZ8Mfr8hvvVpBvxT2lYCU4e/x3314ATB0avDy6ZFQtRNHgF9r88+dPTxp muMOTJV8iJCW1eelFS6HpO+78kZDZ3CAwbUd7Sn92FsCg9m2O0Ad4NIQjCE9lRb7 qDkg99u82SBBSIQs0f62fSlqttlgjXbNYtGHnuiTPPFIgBFAEAffTjgxggwDFKO9 0b1hSsA4m9s1E7kQDSQ+lNb0Acx/2px1lpUpAilhy3oHKcD6iaIz9eC0awC/7bkb nGAf+oSoMQxANivMHhRUJqzgXplbvxGbmCRVaznSSkLIAlhKmjBM26IOIi7DbN42 kD9Auzo007gnrdELVgoLXSty/lNmQkU3RxBRYIKxm9EKF96B4/kwDUNcxTA3h2OR rKgxhfxoqTQ3thBuSkdPiEzRiHdisbDccoRUnERxOIaH25Ui56X82xJPGVD69pkJ E8h8dwze8eEU7M2woGXBsC3RjEgJc8hAaTYxULv6U/ayJl5ubgvZm8taBPcP9B6t xX5tiPHA0wvLJZAW0yHsLrK+lYeJVWDllgnUgYrBuBktSRTSonvNX6rz4ay2GuJM FKPb4miRn0MR+si+S8qBRWGsd72C8Hff5JU1UlZhS8XZgmWM24oYAjHRwGlirrqS KE2/xTmqXPIpAgMBAAGjgZ0wgZowHwYDVR0jBBgwFoAU+hEBZGlQeoMP90iO3cdq EzWfY7UwSAYIKwYBBQUHAQEEPDA6MDgGCCsGAQUFBzABhixodHRwOi8vZGV2MS5j b250cm9sLWFsdC1kZWwub3JnOjgwODAvY2Evb2NzcDAOBgNVHQ8BAf8EBAMCBPAw HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBCwUAA4IB AQAY/D3vEcUH1lzuDOmcBkREdwPRaoK5Md6K1wRZpWNrgH31Hr0e4xssGqkh9pTR GdEi/9KSjk6gLLm2ZvzvZ9xynAO45xOuAHQoO5iU0lCj/HA+Qorf8DdFIC7ExtPg +q8D83q4pZaICOlMt8Po42YJnM2P/A9actneou1CvETEHsiGxNYG7H5Md7jG3/ss hr4RmmHr8x9n3tPFry3+iWbCGuj+gHeQaf75Y/Sk9UZYqOgFWOTANF8M/dgiGT6t dC+RNIDO4FGJqd/y8EYPEwgTtxBj/pOPvNQsbNf9WEe2RAV+Lw4A9XSk+hMCTzjd mqNOAQclbr/xGsLHVa77m+lZ -----END CERTIFICATE----- Key (just using for internal testing no security concern in sharing this): -----BEGIN RSA PRIVATE KEY----- MIIJKgIBAAKCAgEAxFYZlWJzsjwbG+KeISQOSDJ3zJAWC1MKD2jskW5nwx+vyG+9 WkG/FPaVgJTh7/HffXgBMHRq8PLpkVC1E0eAX2vzz509PGma4w5MlXyIkJbV56UV Loek77vyRkNncIDBtR3tKf3YWwKD2bY7QB3g0hCMIT2VFvuoOSD327zZIEFIhCzR /rZ9KWq22WCNds1i0Yee6JM88UiAEUAQB99OODGCDAMUo73RvWFKwDib2zUTuRAN JD6U1vQBzH/anHWWlSkCKWHLegcpwPqJojP14LRrAL/tuRucYB/6hKgxDEA2K8we FFQmrOBemVu/EZuYJFVrOdJKQsgCWEqaMEzbog4iLsNs3jaQP0C7OjTTuCet0QtW CgtdK3L+U2ZCRTdHEFFggrGb0QoX3oHj+TANQ1zFMDeHY5GsqDGF/GipNDe2EG5K R0+ITNGId2KxsNxyhFScRHE4hofblSLnpfzbEk8ZUPr2mQkTyHx3DN7x4RTszbCg ZcGwLdGMSAlzyEBpNjFQu/pT9rImXm5uC9mby1oE9w/0Hq3Ffm2I8cDTC8slkBbT Iewusr6Vh4lVYOWWCdSBisG4GS1JFNKie81fqvPhrLYa4kwUo9viaJGfQxH6yL5L yoFFYax3vYLwd9/klTVSVmFLxdmCZYzbihgCMdHAaWKuupIoTb/FOapc8ikCAwEA AQKCAgEAuKM/6/xqUXO1CsRTcVc3Fy5e+0GFeaDeFR/XWe06J4XlCdoLeJXb3RsH /aQF1mDgjF4OwEK7T10hykbcAwV69EHRR63XqLinsGACJZK320H+Z5oYEWn+8nUN ooZBAMwVXv6Fyreuf+gdluCJWALBKsvk/F2tl6+SxCb88OjoSC0cxTBhS+jSS+DP lB3464C7LdEc4BuXdFF6Hr7gVIbsSGxGoIVFI7efRzn30k1qRPvlUGSH903jK0LN bkPOktUCh8PJBKGzeU7DNXhnduLmmCsTdeEI7svIg52POrHxblP0nbuXjgaVWH6o eBCP3z80FPc/n2Dj9WmiyuVdm46r/FURMgmnP/UtY7qHEqxZy2ZHYCHpdohEDXm5 aGWK61dU7c8XbAcm/3t4nwnW/IplT+p1x9175lZqNy19TrZthwenYm/lVyP7yd0+ nezsYoeXa29mrIrsmBX/2uuQaa8okzmktjYNHh5y/o4tGvHS+VQcqWV8ZUgmQ6S8 cVneUgIGrppJwRcT9Tni4kCUHxESI6Kjf7QvWEA/O0YpTh8QP9/9BPrHDCqyDdLo cKA+Gl+w4RQQaTVZMBUil2gdFnsNiSPRLcygL2ZT421lvIQN6laZVImEBGWvZBog zdU3rh071ZnVepbzycJzIUjfmit3ewZaOazBre9q3wBoceTBgwECggEBAOQpLg4F PEY8ZX5EDJZJzdCExrW5MKp+o+wGmCGjUVaeOiS0nsx0HTtJNvuLVZ8mVkO1gl/g pD9JGiV1foO4gFQzOQJesK6WM9JsLLkgwkAhy+uSHTTGAOoVYM2kRExW0JjQEugL lVuTfnIOAIaxwvpJb4cq2SEw6FqwLit6PT+wjbadGkOCDhz6VvffK2PriOo9df42 ioejvBOjXA8nbJ60sCdQl/c7FKWGCXIeRxbwjTNXU9N491TBJI4+aseyE+K87JsW iWIxDUIj9lvGsljRKwZ/lGOO7qkKTttcr97UUwV+nXRQwvkBNBgOyfIQiFOGHN5B 6Aknu4r+0FpPHfsCggEBANxK2cj4vTOpWKnUspbpHnGqedBjl8a09/wsOa1ptx/t ZqO+hN1d58S8/8WoGO1FuGWZLEzejpkIURJ+CC4PjNsT0CW1EBO1S+7b+rsRiFBP tf1NByE6SP60dMA3EJyAynm1gTgfCNBBKma9acpegm181PtQBZA7szV2uc7BzQ/F e2qEdwtEstOLFN+acS+RvDxxfxwttbZiHC5p4wR8LKntqgFFXicztxDcK+lMH8w1 CPhrWw93VX3Nqxr34IouPL5b+JrTczRPNhjGg1Dq+yv9CtTwCpyRMQvp8XzBObHv nYtciwRygGRfSJm/UC9w1m2oWtfqt79lQ1bFZ6mxaysCggEBAJOZ5FZjoquZVNtL cI0lL8VusBJNvKL/jFIbrf1M50jO0bR/OJ/xmhuJcM1oRTrRFUt2N+KItBjQ1N5Y 1UCncjWGcaIL2ecH+nxtSL126NOOSZqbCtPiKCNHMzm1xA1SuF2zdhexrqzwjQOB 9WstwoIiUckyugbT2e0ZPrUXvlnegL8bgSsdDr5GYU63jB12+Tr4CcYsSJAZJ4nY y6xuB8HgCHlWlQj2qpOuU5wE5F59vgrxuqP7BJ5K2LhAvtlzZZPwPmzSNoxUSUx5 cV3L/AKjRl9M15VUmSa4KW2V15yi5RaP45Kk0I0/7xCFOLWlZlwKTdCm+FI75wKz d9yEhFMCggEBAIMKv5yuYpY9sbFtBkOBLwv8lfPhmqKoei/2+uRuU3HZncngBldM ihddOmUQxqs2YyeEw3aCmZ7s9JUkhacotuiHU7VqjMK8gQv4raDkIAtuL1sbnBcm /c8N97lzyBzg/BEEaHbC91IywY9WM30fVUTeEi/g/T48VTGDi6ozXNF57x2A6PO6 DQqL3IHa9GOQtMHb3focMtDocc0mTdYYK9V1vEB/TC/Tsp2D61cfYnbuQYTND+EW YrOwSY2EUHzCXn36Zdtr10cRq6N3Sxwye/FB2FSs6hMSx3NH2dAVfUWcvUHubf/a QQf0KlLTHFbsL5IRqOByDpX7HeCbEzw9fvsCggEAGX3QAjCGkfpZeMxx9HYlUVeV Ntbc1eHiCzeLs4dLUnAmPx5FaEV8njmyIiylC95wYQ9YfmUb2BoQku1jhlDGk/NN XqEi0BqyAihN3dFJeG2WLPT5Ve4PNaYdJwe5Qvn58+Jee15lkeznAMg5GUxHpU5O MmrJi3LA/JFPSOnXBWVPW4gzH4ZRaiJQqJKoCH228uA/ve/NFvGa0vOHmYA2nYhh +GwkQ+K/XqvqT1pH/yM+2NfKMbtbgd6azwTrRfcfzqhO6UV/ef2FaYc9xjJDre6B x6M2+vVZ7094C7shX49/n0JGmOd6l5fshPCVXk+5YG8uEMYQr3LEOhH61cphLg== -----END RSA PRIVATE KEY----- CA cert: -----BEGIN CERTIFICATE----- MIIDyDCCArCgAwIBAgIBATANBgkqhkiG9w0BAQsFADBPMSwwKgYDVQQKDCNjb250 cm9sLWFsdC1kZWwub3JnIFNlY3VyaXR5IERvbWFpbjEfMB0GA1UEAwwWQ0EgU2ln bmluZyBDZXJ0aWZpY2F0ZTAeFw0xNTA5MjkwMjQ4MTlaFw0zNTA5MjkwMjQ4MTla ME8xLDAqBgNVBAoMI2NvbnRyb2wtYWx0LWRlbC5vcmcgU2VjdXJpdHkgRG9tYWlu MR8wHQYDVQQDDBZDQSBTaWduaW5nIENlcnRpZmljYXRlMIIBIjANBgkqhkiG9w0B AQEFAAOCAQ8AMIIBCgKCAQEAxf3rfwJvl6vJ58OnTEkSYzxkGpuZB9A6ybPM0gMV s/4ME+gbdgxa8oq92pc9TRo1kmUrrrKKMHfK8xVmLx0DSvMgoLscMmuxwWybD43n QpThnM+bzQmiPiUuulIMpeSCzOVX+3Ry3pasVTVWBxKublVOL9degZko0T/UyKWj l1om4V1N8miE4wHNqQq0+0jT9bPF+E0ts6hKMQ3g3lA1N1UnAtYFWAhsYDe3ELvR TzVMkLT/UaIqv6//V8SmpPFJh1E0Hly+/mmyGv9vIaZmwu1CdpMHfU9r+1aoP0ln Qzee2BFYC95Z/N7KVZGlBaF3DiBfu9y8GLv1xa06Zb0qCwIDAQABo4GuMIGrMB8G A1UdIwQYMBaAFPoRAWRpUHqDD/dIjt3HahM1n2O1MA8GA1UdEwEB/wQFMAMBAf8w DgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBT6EQFkaVB6gw/3SI7dx2oTNZ9jtTBI BggrBgEFBQcBAQQ8MDowOAYIKwYBBQUHMAGGLGh0dHA6Ly9kZXYxLmNvbnRyb2wt YWx0LWRlbC5vcmc6ODA4MC9jYS9vY3NwMA0GCSqGSIb3DQEBCwUAA4IBAQAfvDWt shNfLp+5iFqTm2DqnSzND+oh+BR5CLw0/N/2vEaxY6pBXwormVdfIwqoWTsmkXb3 uJ5rjvbTlHt2lnT3wz0Amy/UgW55tHUr/g+4dCtoVedLX8IQmX1201DIpabPcVB+ 0j9eiJ1GisM30heKf0M5JtMTtZpGkUTsPXgsyEW8dgHwQO1alR8HnG3ZAeM2zbPT /BzLgptDt4mJlYtLrtrqhzEcfWWFthdWxTqyR5Rj9ncsPR2+evQraMNfoPQCbLFj 9VupHLt5w3ml/xu5D3bV+3WRJZC73bj6cJ55DySuWnl5LD5HRxv2KeCZMw/gn6dy TkemFdOW2XcVSI5K -----END CERTIFICATE----- Testing with the openssl command line appears to work just fine: openssl s_server -cert cert.pem -key key_clear.pem -CAfile cacert.pem -Verify 1 -www verify depth is 1, must return a certificate Using default temp DH parameters Using default temp ECDH parameters ACCEPT depth=1 O = control-alt-del.org Security Domain, CN = CA Signing Certificate verify return:1 depth=0 C = CA, ST = Ontario, L = Toronto, O = Control-alt-del.org, OU = Security, CN = dev1.control-alt-del.org verify return:1 ACCEPT openssl s_client -cert cert.pem -key key_clear.pem -CAfile cacert.pem -connect localhost:4433 CONNECTED(00000003) depth=1 O = control-alt-del.org Security Domain, CN = CA Signing Certificate verify return:1 depth=0 C = CA, ST = Ontario, L = Toronto, O = Control-alt-del.org, OU = Security, CN = dev1.control-alt-del.org verify return:1 --- Certificate chain 0 s:/C=CA/ST=Ontario/L=Toronto/O=Control-alt-del.org/OU=Security/CN= dev1.control-alt-del.org i:/O=control-alt-del.org Security Domain/CN=CA Signing Certificate 1 s:/O=control-alt-del.org Security Domain/CN=CA Signing Certificate i:/O=control-alt-del.org Security Domain/CN=CA Signing Certificate --- Server certificate -----BEGIN CERTIFICATE----- MIIE7jCCA9agAwIBAgIBBzANBgkqhkiG9w0BAQsFADBPMSwwKgYDVQQKDCNjb250 cm9sLWFsdC1kZWwub3JnIFNlY3VyaXR5IERvbWFpbjEfMB0GA1UEAwwWQ0EgU2ln bmluZyBDZXJ0aWZpY2F0ZTAeFw0xNTA5MzAwMTQ1MzBaFw0xNzA5MTkwMTQ1MzBa MIGFMQswCQYDVQQGEwJDQTEQMA4GA1UECAwHT250YXJpbzEQMA4GA1UEBwwHVG9y b250bzEcMBoGA1UECgwTQ29udHJvbC1hbHQtZGVsLm9yZzERMA8GA1UECwwIU2Vj dXJpdHkxITAfBgNVBAMMGGRldjEuY29udHJvbC1hbHQtZGVsLm9yZzCCAiIwDQYJ KoZIhvcNAQEBBQADggIPADCCAgoCggIBAMRWGZVic7I8GxviniEkDkgyd8yQFgtT Cg9o7JFuZ8Mfr8hvvVpBvxT2lYCU4e/x3314ATB0avDy6ZFQtRNHgF9r88+dPTxp muMOTJV8iJCW1eelFS6HpO+78kZDZ3CAwbUd7Sn92FsCg9m2O0Ad4NIQjCE9lRb7 qDkg99u82SBBSIQs0f62fSlqttlgjXbNYtGHnuiTPPFIgBFAEAffTjgxggwDFKO9 0b1hSsA4m9s1E7kQDSQ+lNb0Acx/2px1lpUpAilhy3oHKcD6iaIz9eC0awC/7bkb nGAf+oSoMQxANivMHhRUJqzgXplbvxGbmCRVaznSSkLIAlhKmjBM26IOIi7DbN42 kD9Auzo007gnrdELVgoLXSty/lNmQkU3RxBRYIKxm9EKF96B4/kwDUNcxTA3h2OR rKgxhfxoqTQ3thBuSkdPiEzRiHdisbDccoRUnERxOIaH25Ui56X82xJPGVD69pkJ E8h8dwze8eEU7M2woGXBsC3RjEgJc8hAaTYxULv6U/ayJl5ubgvZm8taBPcP9B6t xX5tiPHA0wvLJZAW0yHsLrK+lYeJVWDllgnUgYrBuBktSRTSonvNX6rz4ay2GuJM FKPb4miRn0MR+si+S8qBRWGsd72C8Hff5JU1UlZhS8XZgmWM24oYAjHRwGlirrqS KE2/xTmqXPIpAgMBAAGjgZ0wgZowHwYDVR0jBBgwFoAU+hEBZGlQeoMP90iO3cdq EzWfY7UwSAYIKwYBBQUHAQEEPDA6MDgGCCsGAQUFBzABhixodHRwOi8vZGV2MS5j b250cm9sLWFsdC1kZWwub3JnOjgwODAvY2Evb2NzcDAOBgNVHQ8BAf8EBAMCBPAw HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBCwUAA4IB AQAY/D3vEcUH1lzuDOmcBkREdwPRaoK5Md6K1wRZpWNrgH31Hr0e4xssGqkh9pTR GdEi/9KSjk6gLLm2ZvzvZ9xynAO45xOuAHQoO5iU0lCj/HA+Qorf8DdFIC7ExtPg +q8D83q4pZaICOlMt8Po42YJnM2P/A9actneou1CvETEHsiGxNYG7H5Md7jG3/ss hr4RmmHr8x9n3tPFry3+iWbCGuj+gHeQaf75Y/Sk9UZYqOgFWOTANF8M/dgiGT6t dC+RNIDO4FGJqd/y8EYPEwgTtxBj/pOPvNQsbNf9WEe2RAV+Lw4A9XSk+hMCTzjd mqNOAQclbr/xGsLHVa77m+lZ -----END CERTIFICATE----- subject=/C=CA/ST=Ontario/L=Toronto/O=Control-alt-del.org/OU=Security/CN= dev1.control-alt-del.org issuer=/O=control-alt-del.org Security Domain/CN=CA Signing Certificate --- Acceptable client certificate CA names /O=control-alt-del.org Security Domain/CN=CA Signing Certificate Server Temp Key: ECDH, prime256v1, 256 bits --- SSL handshake has read 4547 bytes and written 3156 bytes --- New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384 Server public key is 4096 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE SSL-Session: Protocol : TLSv1.2 Cipher : ECDHE-RSA-AES256-GCM-SHA384 Session-ID: AAF2D6ACAF687FD0079806B7F19BDC1F9FFF1A6AE4F5FFEAE39184A33160923B Session-ID-ctx: Master-Key: 155BE3B00A85F909004AB1F8F7F8FC337DE87BF296CBF90EC68F0517D25AC075EA52DCC5EACCCD2D0706B6982210ADE8 Key-Arg : None Krb5 Principal: None PSK identity: None PSK identity hint: None TLS session ticket lifetime hint: 300 (seconds) TLS session ticket: 0000 - 9c f2 94 4d a2 11 1e 10-44 a7 55 ae 4b 2b e6 c1 ...M....D.U.K+.. 0010 - 4d e2 85 24 61 7c 9c 79-05 85 d3 28 cc f8 7a d1 M..$a|.y...(..z. 0020 - 48 52 c3 56 02 86 61 f4-1e 09 42 d5 0a c9 f4 76 HR.V..a...B....v 0030 - 78 73 0e 89 e6 0f 16 e3-8e b5 f2 53 65 45 45 8f xs.........SeEE. 0040 - 43 40 a2 61 84 a1 bd af-54 4c 3f 6b c2 5c e7 66 C@ .a....TL?k.\.f 0050 - 56 95 5b c6 6d cc 0e 57-3a 92 50 85 3c f4 b5 94 V.[.m..W:.P.<... 0060 - 46 84 06 6b 25 d4 ca a0-17 f6 40 1d 46 3d 68 26 F..k%.....@ .F=h& 0070 - f0 32 62 ff 1f e5 84 f6-c7 42 58 a3 2e df d1 a7 .2b......BX..... 0080 - 2c fd 8c 4f 69 49 d1 67-a2 5e 23 4b 83 0b d1 0d ,..OiI.g.^#K.... 0090 - 8e 2a 0e f0 0a 35 cc 4c-5a 7e 41 08 e2 04 36 a8 .*...5.LZ~A...6. 00a0 - f6 41 10 c9 6b 67 c0 df-0a 9e c5 e1 df 9e 2f f1 .A..kg......../. 00b0 - 5b 2b a0 b5 f1 44 2c b5-d4 b8 ac 4d 71 4d e1 38 [+...D,....MqM.8 00c0 - b0 db b9 30 11 48 d9 71-b1 c8 ed 59 e8 74 0e 5b ...0.H.q...Y.t.[ 00d0 - 8c fb 77 45 c1 d1 77 01-a4 13 41 9a 73 8c 86 4b ..wE..w...A.s..K 00e0 - e1 04 ed 1b 09 1d ca 1d-fd 7a 54 02 c9 46 3c 3a .........zT..F<: 00f0 - 92 af 83 f9 98 37 23 cb-95 ed 21 98 22 45 0c ca .....7#...!."E.. 0100 - c9 dc 27 82 c1 02 56 d2-f2 41 d0 a6 84 25 df 6c ..'...V..A...%.l 0110 - bc 3d 24 7e bb a6 58 2c-a0 54 40 f0 73 dc 19 cf .=$~..X,.T@ .s... 0120 - a3 2e f8 ea bd e1 85 5b-d1 7c 0c a4 9d 57 40 d3 .......[.|...W@ . 0130 - 06 b5 1c bd 1b 5f 19 ae-c3 9f ee e7 97 4c 3b 4c ....._.......L;L 0140 - 2d 31 fc 85 be b4 2e 0a-9a 75 63 60 b0 fe 02 67 -1.......uc`...g 0150 - 7e 81 5e 5e b4 7c 15 c5-95 13 5f d9 8d de 03 54 ~.^^.|...._....T 0160 - cc 02 6b 70 e2 91 5e eb-d5 ea 79 12 ca d8 90 44 ..kp..^...y....D 0170 - e6 27 1e 5d 5a 6d 0f 2a-f7 bf 7e ff 5b 62 4e 23 .'.]Zm.*..~.[bN# 0180 - 42 9d 4e 69 83 89 d6 6f-11 cf bd ab fb 9d ab 8b B.Ni...o........ 0190 - 44 88 bf e9 b7 d0 41 9a-33 a9 ab 2c d4 84 82 1c D.....A.3..,.... 01a0 - c5 2f 24 bb 0f 01 cd ad-af 18 57 bc 6d e2 ec cb ./$.......W.m... 01b0 - 7a 3b db 1c 8b 4d fe 38-6d 10 12 ad a4 e1 f7 da z;...M.8m....... 01c0 - 0a 61 cb da d9 89 85 2f-6b e6 ec 31 27 e3 04 96 .a...../k..1'... 01d0 - 0d ad 65 2e 17 10 c9 ff-36 64 2c 9a b2 5c fe f1 ..e.....6d,..\.. 01e0 - 28 79 1d e7 f3 e9 92 f4-57 ea bd 27 e0 9c 7b bd (y......W..'..{. 01f0 - c3 6a 08 f1 d4 70 19 81-43 9a 5b 9a 99 d0 ff 04 .j...p..C.[..... 0200 - 3e d5 fe 36 df c6 71 cc-93 08 af ab f7 8d b0 30 >..6..q........0 0210 - 39 d8 0b 26 a9 01 be c1-d9 1e d5 96 ae 4c 44 0b 9..&.........LD. 0220 - 18 99 ee ab 20 ba 8c fc-9b 1e 49 9e c6 cd ce b9 .... .....I..... 0230 - b9 23 5e 50 f2 8c e7 e8-21 ff cb 00 ea 4b fb 68 .#^P....!....K.h 0240 - 20 75 3d 61 f7 d5 c1 77-f1 65 bb bf 8e ae c6 94 u=a...w.e...... 0250 - 6d cb 8d 50 02 7d 4d cb-32 f3 2a ce 2b e3 2a 5a m..P.}M.2.*.+.*Z 0260 - 15 1b 54 3c ba a2 5c 3f-02 f8 1b e3 af 4f fa f9 ..T<..\?.....O.. 0270 - 5a 30 af 0e 01 af d6 f1-a6 8d eb b2 2b 04 59 88 Z0..........+.Y. 0280 - 83 60 03 dd e5 b8 60 b2-f7 9f 7a e6 e7 ee b2 a1 .`....`...z..... 0290 - 97 89 21 36 f3 e0 ae 27-39 1b 0b af 65 e8 0d 0e ..!6...'9...e... 02a0 - 4b 23 f4 7a 9f e8 7b 18-d9 2c 69 da 2e 6e 9e 21 K#.z..{..,i..n.! 02b0 - 6b ef a0 2e a8 ae 9e 96-1b 77 f1 ca 1c df a7 cc k........w...... 02c0 - 34 ee 34 7c 8f de 2c ab-06 29 75 8e 0c 6e d3 84 4.4|..,..)u..n.. 02d0 - 35 9f 85 69 99 84 7b 74-c4 09 40 57 61 1f ea 14 5..i..{t..@REDACTED .. 02e0 - ab a2 4c 5e f8 f1 a1 cb-d9 b8 ce 56 19 12 27 eb ..L^.......V..'. 02f0 - 99 97 cb fe 6c a0 00 01-10 db d3 ab 38 1d de da ....l.......8... 0300 - ed 4b fe c0 8a 80 ef 76-9d 62 d6 ff 9a 98 78 04 .K.....v.b....x. 0310 - e6 14 66 42 1c 6e 4e c4-90 09 03 93 3b e5 87 fa ..fB.nN.....;... 0320 - 54 cc 0f 34 68 ce b8 f8-68 ad 62 f7 07 7f 1f 62 T..4h...h.b....b 0330 - 6b 63 ec b2 b9 40 a2 20-8f 10 d4 18 b9 e5 71 90 kc...@REDACTED ......q. 0340 - f6 4c 31 e5 e0 68 3d 68-c1 18 2f 2a 48 4a 34 7f .L1..h=h../*HJ4. 0350 - ff 08 3f 5a d0 72 dc 79-aa 86 c3 47 bd 07 15 ad ..?Z.r.y...G.... 0360 - d9 91 58 bf f4 c2 bc e4-7b dc 21 ff 6e 35 46 b0 ..X.....{.!.n5F. 0370 - fe 16 e1 43 1b a8 c3 33-cb 03 2e 9a 86 85 71 7a ...C...3......qz 0380 - af be 31 c2 6e 01 97 5c-74 9c ec 11 cc e9 94 3d ..1.n..\t......= 0390 - c5 92 ee 45 ba 0d 41 a4-c3 55 9f dc cd d5 30 f7 ...E..A..U....0. 03a0 - ba 78 41 3e b9 48 02 64-e8 cc 51 c9 20 00 13 1f .xA>.H.d..Q. ... 03b0 - 17 b9 24 83 c0 ab 84 dd-8b e2 eb 84 6b e9 78 17 ..$.........k.x. 03c0 - 0c 9d 78 17 a1 58 e6 09-9b ee 0e 3e 39 be 17 e1 ..x..X.....>9... 03d0 - f2 d9 da c4 8f 45 07 91-6a 3c d4 ca 7b dc 6b 24 .....E..j<..{.k$ 03e0 - b2 03 92 1a ea 96 4f 85-67 4b a7 17 2b 61 c4 2a ......O.gK..+a.* 03f0 - c4 87 32 fd b1 41 36 6e-e0 f3 cc 92 00 5b 54 19 ..2..A6n.....[T. 0400 - 72 3a 73 dd 2e b4 6f 22-42 4f 27 42 f5 ec f5 0f r:s...o"BO'B.... 0410 - b4 0a 16 58 60 55 81 18-ea 10 9b 0a 67 80 34 1f ...X`U......g.4. 0420 - b1 e1 69 40 e1 b5 a2 c6-d5 49 7c b9 e8 9e 1a 48 ..i@ .....I|....H 0430 - 0b 43 36 30 28 24 fa c3-33 b2 80 94 16 6f 87 66 .C60($..3....o.f 0440 - ae dc 74 44 f6 9a 65 95-11 ab 05 e9 2b b5 cc 23 ..tD..e.....+..# 0450 - 0a 84 56 d0 b3 14 ce d1-2f 24 e6 6c da 7c 25 bd ..V...../$.l.|%. 0460 - f0 7d 64 07 69 f5 20 a4-d1 1e 3f 1c 83 41 2f 23 .}d.i. ...?..A/# 0470 - 09 fd 8b 38 43 d7 8a 0d-b9 58 ba 41 7b 66 9d 5c ...8C....X.A{f.\ 0480 - 2e 25 6a 13 8a 68 6c d0-09 61 73 9c 38 87 9e 5d .%j..hl..as.8..] 0490 - 17 b6 da 9c 31 ec 0b f8-f4 3b 62 1e a5 7a fb ee ....1....;b..z.. 04a0 - 7d 3e 72 f6 4d 1d 76 fa-cf 6f f2 b5 82 62 e1 af }>r.M.v..o...b.. 04b0 - d4 c4 a3 d6 48 c9 22 13-d4 26 bc ba 2b 76 ab 0a ....H."..&..+v.. 04c0 - 89 e6 ca fb 26 84 0e 95-89 26 d3 7a ea d9 6d 97 ....&....&.z..m. 04d0 - 50 86 cd 13 b4 70 ad f2-fe 79 4a 05 f7 69 a4 b8 P....p...yJ..i.. 04e0 - 9e 87 ba 2d e9 6f 01 ce-dc 09 28 b3 09 ff 64 a0 ...-.o....(...d. 04f0 - 5d 64 19 66 cb 7d 5b f0-2b a2 c3 b2 de 09 ef f0 ]d.f.}[.+....... 0500 - 7c 60 fa a8 cb e6 b5 fa-31 d5 0a a4 81 72 f0 a2 |`......1....r.. 0510 - 73 31 48 15 91 6b 66 32-6e 90 86 2c f9 00 45 7b s1H..kf2n..,..E{ 0520 - e0 47 3c 6e 48 d4 20 09-b8 00 c4 08 a6 d8 1c c7 .G From mikpelinux@REDACTED Sun Jan 10 10:42:23 2016 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Sun, 10 Jan 2016 10:42:23 +0100 Subject: [erlang-questions] mnesia + leveldb In-Reply-To: References: Message-ID: <22162.10111.745028.404091@gargle.gargle.HOWL> Benoit Chesneau writes: > I am reading the slides of the talk given at Erlang Factory: > > http://www.erlang-factory.com/static/upload/media/143415340626199euc2015mnesialeveldb.pdf > > And right now I am not sure how the data are store din leveldb: does it use > one instance of LevelDB / table or 1 instance in which all tables are > shared? There's one LevelDB instance per mnesia table. From donpedrothird@REDACTED Sun Jan 10 11:09:36 2016 From: donpedrothird@REDACTED (John Doe) Date: Sun, 10 Jan 2016 13:09:36 +0300 Subject: [erlang-questions] enif_get_resource and reference counting In-Reply-To: References: Message-ID: Thank you! Thought so, but was not 100% sure. 2016-01-10 0:20 GMT+03:00 Daniel Goertzen : > enif_get_resource() does not increase the reference count. You can think > of the term representing the resource as counting as a reference, so as > long as the term and its environment are alive then the resource will not > be destroyed. In the example you have above you can skip the > keep()/release() because the resource term w/environment keeps it alive. > > On Sat, Jan 9, 2016 at 12:12 AM John Doe wrote: > >> Hi, >> Does successful call of enif_get_resource increase reference counter on a >> resource, like enif_keep_resource does? >> Or It is neccessary to do >> enif_get_resource(...); >> enif_keep_resource(...); >> ...some job... >> enif_release_resource(...); >> >> And if it does not increment the counter, can the resource become >> destroyed in the another thread between calls to enif_get_resource and >> enif_keep_resource? >> I'm afraid of race condition there. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.molteni@REDACTED Sun Jan 10 22:07:00 2016 From: marco.molteni@REDACTED (Marco Molteni) Date: Sun, 10 Jan 2016 22:07:00 +0100 Subject: [erlang-questions] Troubleshooting TLS distribution In-Reply-To: References: Message-ID: On 10 Jan 2016, at 04:59, Mark Steele wrote: [..] > So my guess at this point is that either TLS distribution is broken, or there's something that it doesn't like about my certificate. > > Is it doing some weird hostname checking against the CN (or is there some rule for CN naming that needs to be followed?). Although I am not familiar with the Erlang TLS transport, it looks like it is enforcing RFC6125 (Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS)) [1] Normally when a system enforces RFC6125, one can provide a custom verify() function to override. ***WARNING***: Unless you really understand what you are doing, just slap the hostname in the CN and sleep safely :-) marco.m [1] https://tools.ietf.org/html/rfc6125 From pavananms@REDACTED Mon Jan 11 06:53:16 2016 From: pavananms@REDACTED (Pavanan M S) Date: Mon, 11 Jan 2016 11:23:16 +0530 Subject: [erlang-questions] Failed to run make.. Message-ID: Hi all, While trying to run make in a project I encountered this message first;- ===> Plugin rebar_gdb_plugin not available. It will not be used. Then it crashed showing this message;- ===> Compiling /home/pavanan/pine/_build/default/lib/pine/src/pine_tools.erl failed /home/pavanan/pine/_build/default/lib/pine/src/pine_tools.erl:339: illegal guard expression Looking at the code I found that the guard expression consists of a function *is_map(). * That function didn't work in my erl console (returns function not found.). 1. Are these errors related? and 2. How can I make this work. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vimal7370@REDACTED Mon Jan 11 08:30:09 2016 From: vimal7370@REDACTED (Vimal Kumar) Date: Mon, 11 Jan 2016 13:00:09 +0530 Subject: [erlang-questions] Failed to run make.. In-Reply-To: References: Message-ID: Hi, If erlang:is_map/1 is not available then you should try upgrading erlang to the latest version. On Mon, Jan 11, 2016 at 11:23 AM, Pavanan M S wrote: > Hi all, > > While trying to run make in a project I encountered this > message first;- > > ===> Plugin rebar_gdb_plugin not available. It will not be > used. > > Then it crashed showing this message;- > > ===> Compiling > /home/pavanan/pine/_build/default/lib/pine/src/pine_tools.erl failed > /home/pavanan/pine/_build/default/lib/pine/src/pine_tools.erl:339: illegal > guard expression > > Looking at the code I found that the guard expression consists > of a function > *is_map(). * > That function didn't work in my erl console (returns function > not found.). > > 1. Are these errors related? and > 2. How can I make this work. > > _______________________________________________ > 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 Mon Jan 11 08:34:22 2016 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 11 Jan 2016 10:34:22 +0300 Subject: [erlang-questions] Architecture question: logging inside library Message-ID: Hi. As we know, it is good when library doesn't have any hardcoded dependencies at all. I don't understand what is a good way to remove lager (or any other logging library) from library dependencies. For example, we have an mpegts decoder/encoder library. This library takes binary and unpacks it to list of frames or packs back: mpegts_decoder:decode(Binary, mpegts_decoder:init(Options)) -> {ok, Frames, State} There are calls to lager in some places of code that are used for indicating some statuses: dump_psi(Decoder, NewPMT), lager:info("PMT: ~p", [Descriptors]), ... What is the proper way to refuse from adding logger as a dependency for such pure library? Pass a callback into initialisation options? -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergej.jurecko@REDACTED Mon Jan 11 08:45:07 2016 From: sergej.jurecko@REDACTED (=?UTF-8?Q?Sergej_Jure=C4=8Dko?=) Date: Mon, 11 Jan 2016 08:45:07 +0100 Subject: [erlang-questions] Architecture question: logging inside library In-Reply-To: References: Message-ID: You either do not log anything or use error_logger. Sergej On Mon, Jan 11, 2016 at 8:34 AM, Max Lapshin wrote: > Hi. > > As we know, it is good when library doesn't have any hardcoded > dependencies at all. > > I don't understand what is a good way to remove lager (or any other > logging library) from library dependencies. > > > For example, we have an mpegts decoder/encoder library. This library takes > binary and unpacks it to list of frames or packs back: > > mpegts_decoder:decode(Binary, mpegts_decoder:init(Options)) -> {ok, > Frames, State} > > > There are calls to lager in some places of code that are used for > indicating some statuses: > > dump_psi(Decoder, NewPMT), > lager:info("PMT: ~p", [Descriptors]), > ... > > > What is the proper way to refuse from adding logger as a dependency for > such pure library? > Pass a callback into initialisation options? > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tobias.Schlager@REDACTED Mon Jan 11 09:15:14 2016 From: Tobias.Schlager@REDACTED (Tobias Schlager) Date: Mon, 11 Jan 2016 08:15:14 +0000 Subject: [erlang-questions] Architecture question: logging inside library In-Reply-To: References: Message-ID: <12F2115FD1CCEE4294943B2608A18FA301A273F5B9@MAIL01.win.lbaum.eu> +1 for Sergej's suggestion If it isn't high-volume logging use the error_logger. Regards Tobias -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Mon Jan 11 09:39:50 2016 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 11 Jan 2016 10:39:50 +0200 Subject: [erlang-questions] Architecture question: logging inside library In-Reply-To: References: Message-ID: Hello, I am using macro to wrap logger library. This gives me a freedom to config desired library and behavior at build time. -ifndef(EMERGENCY). -define(EMERGENCY(Fmt, Args), lager:emergency(Fmt, Args)). -endif. -ifndef(ALERT). -define(ALERT(Fmt, Args), lager:alert(Fmt, Args)). -endif. -ifndef(CRITICAL). -define(CRITICAL(Fmt, Args), lager:critical(Fmt, Args)). -endif. -ifndef(ERROR). -define(ERROR(Fmt, Args), lager:error(Fmt, Args)). -endif. -ifndef(WARNING). -define(WARNING(Fmt, Args), lager:warning(Fmt, Args)). -endif. -ifndef(NOTICE). -define(NOTICE(Fmt, Args), lager:notice(Fmt, Args)). -endif. -ifndef(INFO). -define(INFO(Fmt, Args), lager:info(Fmt, Args)). -endif. -ifdef(CONFIG_DEBUG). -define(DEBUG(Str, Args), lager:debug(Str, Args)). -else. -define(DEBUG(Str, Args), ok). -endif. Best Regards, Dmitry > On Jan 11, 2016, at 9:34 AM, Max Lapshin wrote: > > Hi. > > As we know, it is good when library doesn't have any hardcoded dependencies at all. > > I don't understand what is a good way to remove lager (or any other logging library) from library dependencies. > > > For example, we have an mpegts decoder/encoder library. This library takes binary and unpacks it to list of frames or packs back: > > mpegts_decoder:decode(Binary, mpegts_decoder:init(Options)) -> {ok, Frames, State} > > > There are calls to lager in some places of code that are used for indicating some statuses: > > dump_psi(Decoder, NewPMT), > lager:info("PMT: ~p", [Descriptors]), > ... > > > What is the proper way to refuse from adding logger as a dependency for such pure library? > Pass a callback into initialisation options? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From mrtndimitrov@REDACTED Mon Jan 11 10:37:27 2016 From: mrtndimitrov@REDACTED (Martin Koroudjiev) Date: Mon, 11 Jan 2016 11:37:27 +0200 Subject: [erlang-questions] Exometer example Message-ID: <569377D7.3020302@gmail.com> Hello, I would love to use Exometer for monitoring the VM state. I passed thru the documentation and am looking for a full example. Do you know any accessible from the Internet? Thank you, Martin From cian@REDACTED Mon Jan 11 10:41:33 2016 From: cian@REDACTED (Cian Synnott) Date: Mon, 11 Jan 2016 09:41:33 +0000 Subject: [erlang-questions] Exometer example In-Reply-To: <569377D7.3020302@gmail.com> References: <569377D7.3020302@gmail.com> Message-ID: Hi Martin, This might get you started quickly: https://github.com/emauton/basic_metrics which has evolved a little since I wrote http://emauton.org/2015/01/14/getting-basic-erlang-vm-metrics-into-hosted-graphite/ and is based on Brian Troutwine's writeups: http://tech.adroll.com/blog/erlang/2014/01/22/monitoring-with-exometer-at-adroll.html Cian From mrtndimitrov@REDACTED Mon Jan 11 11:02:52 2016 From: mrtndimitrov@REDACTED (Martin Koroudjiev) Date: Mon, 11 Jan 2016 12:02:52 +0200 Subject: [erlang-questions] Exometer example In-Reply-To: References: <569377D7.3020302@gmail.com> Message-ID: <56937DCC.7020004@gmail.com> Thank you, Cian! On 1/11/2016 11:41 AM, Cian Synnott wrote: > Hi Martin, > > This might get you started quickly: > https://github.com/emauton/basic_metrics > > which has evolved a little since I wrote > http://emauton.org/2015/01/14/getting-basic-erlang-vm-metrics-into-hosted-graphite/ > > and is based on Brian Troutwine's writeups: > http://tech.adroll.com/blog/erlang/2014/01/22/monitoring-with-exometer-at-adroll.html > > Cian From magnus@REDACTED Mon Jan 11 12:24:12 2016 From: magnus@REDACTED (Magnus Henoch) Date: Mon, 11 Jan 2016 11:24:12 +0000 Subject: [erlang-questions] Troubleshooting TLS distribution In-Reply-To: References: Message-ID: On Sun, Jan 10, 2016 at 3:59 AM, Mark Steele wrote: > Here's what my session looks like. > > erl -boot start_clean -proto_dist inet_tls -ssl_dist_op server_certfile > /tmp/server.pem server_keyfile /tmp/server.key client_certfile > /tmp/server.pem client_keyfile /tmp/server.key -name test1@REDACTED > That should be -ssl_dist_opt. Let's have a look at the error messages: =ERROR REPORT==== 9-Jan-2016::21:58:37 === SSL: certify: ssl_alert.erl:92:Fatal error: internal error Looking at line 92 of ssl_alert.erl, we see that this is an internal error alert that we received from the peer. It doesn't really tell us what happened. =ERROR REPORT==== 9-Jan-2016::21:58:37 === SSL: hello: ssl_handshake.erl:167:Fatal error: internal error This on the other hand points to the function where the server tries to establish its own certificate chain. I suspect that it's not finding anything because it didn't get the server_certfile option - and if I remember correctly you need to specify server_cacertfile as well, pointing to the CA certificate. Regards, Magnus -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandrashekhar.mullaparthi@REDACTED Mon Jan 11 14:07:00 2016 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Mon, 11 Jan 2016 13:07:00 +0000 Subject: [erlang-questions] Architecture question: logging inside library In-Reply-To: References: Message-ID: Have a log function such as this inside your library code. log_msg(Fmt, Args) -> log_msg(application:get_env(my_library, logging_mf), Fmt, Args). log_msg({ok, {Mod, Fun}}, Fmt, Args) when is_atom(Mod), is_atom(Fun) -> catch apply(Mod, Fun, [Fmt, Args]); log_msg(_, _, _) -> ok. That way, the user can control how the messages get logged. cheers, Chandru On 11 January 2016 at 07:34, Max Lapshin wrote: > Hi. > > As we know, it is good when library doesn't have any hardcoded > dependencies at all. > > I don't understand what is a good way to remove lager (or any other > logging library) from library dependencies. > > > For example, we have an mpegts decoder/encoder library. This library takes > binary and unpacks it to list of frames or packs back: > > mpegts_decoder:decode(Binary, mpegts_decoder:init(Options)) -> {ok, > Frames, State} > > > There are calls to lager in some places of code that are used for > indicating some statuses: > > dump_psi(Decoder, NewPMT), > lager:info("PMT: ~p", [Descriptors]), > ... > > > What is the proper way to refuse from adding logger as a dependency for > such pure library? > Pass a callback into initialisation options? > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cvi@REDACTED Mon Jan 11 14:29:18 2016 From: cvi@REDACTED (=?UTF-8?Q?Christoffer_Vikstr=C3=B6m?=) Date: Mon, 11 Jan 2016 13:29:18 +0000 Subject: [erlang-questions] Architecture question: logging inside library In-Reply-To: References: Message-ID: I would suggest using a hook system, where you can register hooks (funs) at important points in the code. That way you can provide means to do both logging and instrumentation. Something like: library:add_hook(pre_request, fun(Request) -> leg:dbg("request: ~p~n", [Request]), folsom_metrics:notify(requests, {inc, 1}) end). Be careful with any performance impacts this might have though. -cvik On Mon, Jan 11, 2016 at 2:07 PM Chandru < chandrashekhar.mullaparthi@REDACTED> wrote: > Have a log function such as this inside your library code. > > log_msg(Fmt, Args) -> > log_msg(application:get_env(my_library, logging_mf), Fmt, Args). > > log_msg({ok, {Mod, Fun}}, Fmt, Args) when is_atom(Mod), is_atom(Fun) -> > catch apply(Mod, Fun, [Fmt, Args]); > log_msg(_, _, _) -> > ok. > > That way, the user can control how the messages get logged. > > cheers, > Chandru > > > On 11 January 2016 at 07:34, Max Lapshin wrote: > >> Hi. >> >> As we know, it is good when library doesn't have any hardcoded >> dependencies at all. >> >> I don't understand what is a good way to remove lager (or any other >> logging library) from library dependencies. >> >> >> For example, we have an mpegts decoder/encoder library. This library >> takes binary and unpacks it to list of frames or packs back: >> >> mpegts_decoder:decode(Binary, mpegts_decoder:init(Options)) -> {ok, >> Frames, State} >> >> >> There are calls to lager in some places of code that are used for >> indicating some statuses: >> >> dump_psi(Decoder, NewPMT), >> lager:info("PMT: ~p", [Descriptors]), >> ... >> >> >> What is the proper way to refuse from adding logger as a dependency for >> such pure library? >> Pass a callback into initialisation options? >> >> >> >> _______________________________________________ >> 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 Mon Jan 11 14:37:35 2016 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 11 Jan 2016 14:37:35 +0100 Subject: [erlang-questions] Architecture question: logging inside library In-Reply-To: References: Message-ID: <5693B01F.3090303@ninenines.eu> Two suggestions: * Remove all log calls that give you the same information (or less) than what you could get by tracing. * After this is done, if some log calls remain, convert them to use error_logger. I suspect most of your log calls are not very useful if you use tracing regularly (worse, they add noise). Your example at least seems to fall in that category. On 01/11/2016 08:34 AM, Max Lapshin wrote: > Hi. > > As we know, it is good when library doesn't have any hardcoded > dependencies at all. > > I don't understand what is a good way to remove lager (or any other > logging library) from library dependencies. > > > For example, we have an mpegts decoder/encoder library. This library > takes binary and unpacks it to list of frames or packs back: > > mpegts_decoder:decode(Binary, mpegts_decoder:init(Options)) -> {ok, > Frames, State} > > > There are calls to lager in some places of code that are used for > indicating some statuses: > > dump_psi(Decoder, NewPMT), > lager:info("PMT: ~p", [Descriptors]), > ... > > > What is the proper way to refuse from adding logger as a dependency for > such pure library? > Pass a callback into initialisation options? > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From mikpelinux@REDACTED Mon Jan 11 14:39:34 2016 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Mon, 11 Jan 2016 14:39:34 +0100 Subject: [erlang-questions] Architecture question: logging inside library In-Reply-To: References: Message-ID: <22163.45206.139631.269034@gargle.gargle.HOWL> Max Lapshin writes: > Hi. > > As we know, it is good when library doesn't have any hardcoded dependencies > at all. > > I don't understand what is a good way to remove lager (or any other logging > library) from library dependencies. > > > For example, we have an mpegts decoder/encoder library. This library takes > binary and unpacks it to list of frames or packs back: > > mpegts_decoder:decode(Binary, mpegts_decoder:init(Options)) -> {ok, > Frames, State} > > > There are calls to lager in some places of code that are used for > indicating some statuses: > > dump_psi(Decoder, NewPMT), > lager:info("PMT: ~p", [Descriptors]), > ... > > > What is the proper way to refuse from adding logger as a dependency for > such pure library? > Pass a callback into initialisation options? That's what I would do. From desired.mta@REDACTED Mon Jan 11 15:18:42 2016 From: desired.mta@REDACTED (=?UTF-8?Q?Motiejus_Jak=C5=A1tys?=) Date: Mon, 11 Jan 2016 15:18:42 +0100 Subject: [erlang-questions] Architecture question: logging inside library In-Reply-To: References: Message-ID: On Mon, Jan 11, 2016 at 8:34 AM, Max Lapshin wrote: > Hi. > > As we know, it is good when library doesn't have any hardcoded > dependencies at all. > > I don't understand what is a good way to remove lager (or any other > logging library) from library dependencies. > > I did something similar in spapi-router, but for reporting metrics rather than logging: https://github.com/spilgames/spapi-router#configuration Example metrics module on top of statsd: https://github.com/spilgames/spapi-router/blob/master/src/spapi_router_callback_example.erl The application can specify the module, which implements the necessary behavior, to do the actual work. -- Motiejus Jak?tys -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik.x.nord@REDACTED Mon Jan 11 15:55:59 2016 From: henrik.x.nord@REDACTED (Henrik Nord X) Date: Mon, 11 Jan 2016 15:55:59 +0100 Subject: [erlang-questions] Patch package OTP 18.2.2 released Message-ID: <5693C27F.1050702@ericsson.com> Patch Package: OTP 18.2.2 Git Tag: OTP-18.2.2 Date: 2016-01-11 Trouble Report Id: OTP-13225 Seq num: System: OTP Release: 18 Application: ssh-4.2.1 Predecessor: OTP 18.2.1 Check out the git tag OTP-18.2.2, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- ssh-4.2.1 ------------------------------------------------------- --------------------------------------------------------------------- The ssh-4.2.1 application can be applied independently of other applications on a full OTP 18 installation. --- Fixed Bugs and Malfunctions --- OTP-13225 Application(s): ssh The authentication method 'keyboard-interactive' failed in the Erlang client when the server after successful authentication continued by asking for zero more passwords. Full runtime dependencies of ssh-4.2.1: crypto-3.3, erts-6.0, kernel-3.0, public_key-0.22, stdlib-2.3 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From unix1@REDACTED Mon Jan 11 17:33:56 2016 From: unix1@REDACTED (Unix One) Date: Mon, 11 Jan 2016 16:33:56 +0000 Subject: [erlang-questions] Architecture question: logging inside library In-Reply-To: References: Message-ID: On 01/10/2016 11:34 PM, Max Lapshin wrote: > > What is the proper way to refuse from adding logger as a dependency for > such pure library? > Pass a callback into initialisation options? What is a use case for logging? Logging is a side effect. If you want to have a pure library, you should always return the result and let the caller handle it - consume, forward, log, etc. I would advise to not hack an unrelated, side-effect dependency into a pure library by any means. From mrallen1@REDACTED Mon Jan 11 17:51:00 2016 From: mrallen1@REDACTED (Mark Allen) Date: Mon, 11 Jan 2016 16:51:00 +0000 (UTC) Subject: [erlang-questions] Architecture question: logging inside library In-Reply-To: References: Message-ID: <1096303253.3458500.1452531061015.JavaMail.yahoo@mail.yahoo.com> Macros is the approach we've used in some places (basho_bench) for example. ?But a lot of these other suggestions are good. :) On Monday, January 11, 2016 2:40 AM, Dmitry Kolesnikov wrote: Hello, I am using macro to wrap logger library. This gives me a freedom to config desired library and behavior at build time.? -ifndef(EMERGENCY). -define(EMERGENCY(Fmt, Args), lager:emergency(Fmt, Args)). -endif. -ifndef(ALERT). -define(ALERT(Fmt, Args), lager:alert(Fmt, Args)). -endif. -ifndef(CRITICAL). -define(CRITICAL(Fmt, Args), lager:critical(Fmt, Args)). -endif. -ifndef(ERROR). -define(ERROR(Fmt, Args), lager:error(Fmt, Args)). -endif. -ifndef(WARNING). -define(WARNING(Fmt, Args), lager:warning(Fmt, Args)). -endif. -ifndef(NOTICE). -define(NOTICE(Fmt, Args), lager:notice(Fmt, Args)). -endif. -ifndef(INFO). -define(INFO(Fmt, Args), lager:info(Fmt, Args)). -endif. -ifdef(CONFIG_DEBUG). ? -define(DEBUG(Str, Args), lager:debug(Str, Args)). -else. ? -define(DEBUG(Str, Args), ok). -endif. Best Regards, Dmitry > On Jan 11, 2016, at 9:34 AM, Max Lapshin wrote: > > Hi. > > As we know, it is good when library doesn't have any hardcoded dependencies at all. > > I don't understand what is a good way to remove lager (or any other logging library) from library dependencies. > > > For example, we have an mpegts decoder/encoder library. This library takes binary and unpacks it to list of frames or packs back: > > mpegts_decoder:decode(Binary,? mpegts_decoder:init(Options)) ->? {ok, Frames, State} > > > There are calls to lager in some places of code that are used for indicating some statuses: > > dump_psi(Decoder, NewPMT), > lager:info("PMT: ~p", [Descriptors]), > ... > > > What is the proper way to refuse from adding logger as a dependency for such pure library? > Pass a callback into? initialisation options? > > > _______________________________________________ > 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 wojtek@REDACTED Mon Jan 11 18:52:30 2016 From: wojtek@REDACTED (=?UTF-8?Q?Wojtek_Narczy=c5=84ski?=) Date: Mon, 11 Jan 2016 18:52:30 +0100 Subject: [erlang-questions] Question about Erlang and Ada In-Reply-To: References: <566C1F77.1050701@power.com.pl> <566EA482.3080807@power.com.pl> Message-ID: <5693EBDE.4030203@power.com.pl> W dniu 2015-12-15 o 10:49, Richard Carlsson pisze: > > I still insist that there is need for both: "let it crash" and > "correct by construction". You wouldn't want to let your > fly-by-wire system controller crash during landing, one meter > above the runway. But you also wouldn't want to build a correct > feature poor in-flight entertainment system. > > > If restarting is fast enough (e.g. sub-millisecond), then yes, I do > want the fly-by-wire system controller to crash and get back to a > clean state, rather than make a poor guess at what to do to fix the > problem, or lock up. > I don't think we fundamentally disagree. AFAIR, they have supervision in the form of hardware watchdogs. Flying an airliner by beam.smp is completely out of question. But I would not recommend Erlang even for a small uav autopilot project. Would you? The largest correct by construction effort is probably CompCert. Fascinating achievement. -- Wojtek Narczynski -------------- next part -------------- An HTML attachment was scrubbed... URL: From wojtek@REDACTED Mon Jan 11 19:03:09 2016 From: wojtek@REDACTED (=?UTF-8?Q?Wojtek_Narczy=c5=84ski?=) Date: Mon, 11 Jan 2016 19:03:09 +0100 Subject: [erlang-questions] Question about Erlang and Ada In-Reply-To: References: <6EFFEA51-5D68-477E-99C4-7DB7AF8B19AE@cs.otago.ac.nz> Message-ID: <5693EE5D.5080109@power.com.pl> W dniu 2015-12-15 o 01:45, Martin pisze: > Maybe four... must be a way to squeeze in my beloved Prolog without making it unstable. I have seen a movie of Prolog driving a huge machinge sorting parcels. Unfortunately, I can't find it now. -- Wojtek From max.lapshin@REDACTED Mon Jan 11 19:03:47 2016 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 11 Jan 2016 21:03:47 +0300 Subject: [erlang-questions] Architecture question: logging inside library In-Reply-To: <1096303253.3458500.1452531061015.JavaMail.yahoo@mail.yahoo.com> References: <1096303253.3458500.1452531061015.JavaMail.yahoo@mail.yahoo.com> Message-ID: Ok, for example in case of mpegts library, we need to raise upper, up to sysadmin (user, not a programmer, he cannot use error_logger output) information about status of bitstream like "there are too much errors" or "here is a known list of audio channels". This is why I against of error_logger: it's output is for erlang programmers, not for sysadmins. application:get_env ? isn't it too bad? Or it is just a ets:lookup? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Mon Jan 11 19:38:03 2016 From: bchesneau@REDACTED (Benoit Chesneau) Date: Mon, 11 Jan 2016 18:38:03 +0000 Subject: [erlang-questions] Architecture question: logging inside library In-Reply-To: References: <1096303253.3458500.1452531061015.JavaMail.yahoo@mail.yahoo.com> Message-ID: On Mon, Jan 11, 2016 at 7:03 PM Max Lapshin wrote: > Ok, for example in case of mpegts library, we need to raise upper, up to > sysadmin (user, not a programmer, he cannot use error_logger output) > information about status of bitstream like "there are too much errors" or > "here is a known list of audio channels". > mmm why not using alarm here then? http://www.erlang.org/doc/man/alarm_handler.html or depending on another alarm lib for such purpose or generate an event an let the user do what they want with it. - beno?t -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Mon Jan 11 21:03:47 2016 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Mon, 11 Jan 2016 21:03:47 +0100 Subject: [erlang-questions] Failed to run make.. In-Reply-To: Message-ID: Hi You can use crownedgrouse/geas plugin on code to know what Erlang version is needed. My last commit allow to work on source files instead Beam files. You simply have to set GEAS_USE_SRC=1 as environment variable. Still working on feature. Regards Le?11 janv. 2016 8:30 AM, Vimal Kumar a ?crit?: > > Hi, > > If erlang:is_map/1 is not available then you should try upgrading erlang to the latest version. > > > On Mon, Jan 11, 2016 at 11:23 AM, Pavanan M S wrote: >> >> Hi all, >> ???????? >> ?????????? While trying to run make in a project I encountered this message first;- >> ??????????????? >> ?????????????? ===> Plugin rebar_gdb_plugin not available. It will not be used. >> ? >> ?????????? Then it crashed showing this message;- >> >> ?????????? ===> Compiling /home/pavanan/pine/_build/default/lib/pine/src/pine_tools.erl failed >> /home/pavanan/pine/_build/default/lib/pine/src/pine_tools.erl:339: illegal guard expression >> >> ????????? Looking at the code I found that the guard expression consists of a function is_map(). >> ????????? That function didn't work in my erl console (returns function not found.). >> ????????? >> ????????? 1. Are these errors related? and >> ????????? 2. How can I make this work. >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > From carlsson.richard@REDACTED Mon Jan 11 21:24:09 2016 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Mon, 11 Jan 2016 21:24:09 +0100 Subject: [erlang-questions] Question about Erlang and Ada In-Reply-To: <5693EBDE.4030203@power.com.pl> References: <566C1F77.1050701@power.com.pl> <566EA482.3080807@power.com.pl> <5693EBDE.4030203@power.com.pl> Message-ID: 2016-01-11 18:52 GMT+01:00 Wojtek Narczy?ski : > > Flying an airliner by beam.smp is completely out of question. But I would > not recommend Erlang even for a small uav autopilot project. Would you? > Sure I would. https://www.youtube.com/watch?v=96UzSHyp0F8 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrtndimitrov@REDACTED Mon Jan 11 22:42:25 2016 From: mrtndimitrov@REDACTED (Martin Koroudjiev) Date: Mon, 11 Jan 2016 23:42:25 +0200 Subject: [erlang-questions] Exometer example In-Reply-To: References: <569377D7.3020302@gmail.com> Message-ID: <569421C1.8070606@gmail.com> Hello, I am facing a compile problem with Exometer that I can't seem to resolve. I compile only the mandatory dependencies by setting EXOMETER_PACKAGES=minimal. I get the following error: Thank you for your time! Martin On 1/11/2016 11:41 AM, Cian Synnott wrote: > Hi Martin, > > This might get you started quickly: > https://github.com/emauton/basic_metrics > > which has evolved a little since I wrote > http://emauton.org/2015/01/14/getting-basic-erlang-vm-metrics-into-hosted-graphite/ > > and is based on Brian Troutwine's writeups: > http://tech.adroll.com/blog/erlang/2014/01/22/monitoring-with-exometer-at-adroll.html > > Cian -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hihjjeec.png Type: image/png Size: 40183 bytes Desc: not available URL: From chandrashekhar.mullaparthi@REDACTED Mon Jan 11 23:15:28 2016 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Mon, 11 Jan 2016 22:15:28 +0000 Subject: [erlang-questions] Architecture question: logging inside library In-Reply-To: References: <1096303253.3458500.1452531061015.JavaMail.yahoo@mail.yahoo.com> Message-ID: On 11 January 2016 at 18:03, Max Lapshin wrote: > Ok, for example in case of mpegts library, we need to raise upper, up to > sysadmin (user, not a programmer, he cannot use error_logger output) > information about status of bitstream like "there are too much errors" or > "here is a known list of audio channels". > > > This is why I against of error_logger: it's output is for erlang > programmers, not for sysadmins. > > application:get_env ? isn't it too bad? Or it is just a ets:lookup? > > get_env(AppName, Key) -> case ets:lookup(ac_tab, {env, AppName, Key}) of [{_, Val}] -> {ok, Val}; _ -> undefined end. Chandru -------------- next part -------------- An HTML attachment was scrubbed... URL: From seancribbs@REDACTED Tue Jan 12 04:00:33 2016 From: seancribbs@REDACTED (Sean Cribbs) Date: Mon, 11 Jan 2016 21:00:33 -0600 Subject: [erlang-questions] Architecture question: logging inside library In-Reply-To: References: Message-ID: You may need lager at compile-time, but there's no reason you have to start it (i.e. don't include it in your 'applications' in the .app). If you use the parse_transform as your snippet suggests, it will simply not do anything if the sink is not running (see https://github.com/basho/lager/blob/master/src/lager_transform.erl#L189-L191 ). On Mon, Jan 11, 2016 at 1:34 AM, Max Lapshin wrote: > Hi. > > As we know, it is good when library doesn't have any hardcoded > dependencies at all. > > I don't understand what is a good way to remove lager (or any other > logging library) from library dependencies. > > > For example, we have an mpegts decoder/encoder library. This library takes > binary and unpacks it to list of frames or packs back: > > mpegts_decoder:decode(Binary, mpegts_decoder:init(Options)) -> {ok, > Frames, State} > > > There are calls to lager in some places of code that are used for > indicating some statuses: > > dump_psi(Decoder, NewPMT), > lager:info("PMT: ~p", [Descriptors]), > ... > > > What is the proper way to refuse from adding logger as a dependency for > such pure library? > Pass a callback into initialisation options? > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Maxim.Minin@REDACTED Tue Jan 12 13:50:50 2016 From: Maxim.Minin@REDACTED (Minin Maxim) Date: Tue, 12 Jan 2016 13:50:50 +0100 Subject: [erlang-questions] orddict - is it an expected behavior? Message-ID: Hi All, is it an expected behavior? 1> orddict:merge(fun(_, _X, Y) -> Y end, orddict:from_list([{1,a},{2,b}]), [{1,c},{1,f}]). [{1,c},{1,f},{2,b}] Here returns merge function an invalid orddict. I know, if the second argument is a valid orddict, all is fine: 2> orddict:merge(fun(_, _X, Y) -> Y end, orddict:from_list([{1,a},{2,b}]), orddict:from_list([{1,c},{1,f}])). [{1,f},{2,b}] I would expect, that merge function either generates an exception or returns a proper orddict, but here is that not the case. Am I wrong? Thanks Maxim From kostis@REDACTED Tue Jan 12 13:58:10 2016 From: kostis@REDACTED (Kostis Sagonas) Date: Tue, 12 Jan 2016 13:58:10 +0100 Subject: [erlang-questions] orddict - is it an expected behavior? In-Reply-To: References: Message-ID: <5694F862.2040905@cs.ntua.gr> On 01/12/2016 01:50 PM, Minin Maxim wrote: > Hi All, > > is it an expected behavior? > > 1> orddict:merge(fun(_, _X, Y) -> Y end, orddict:from_list([{1,a},{2,b}]), [{1,c},{1,f}]). > [{1,c},{1,f},{2,b}] > > Here returns merge function an invalid orddict. > > I know, if the second argument is a valid orddict, all is fine: > > 2> orddict:merge(fun(_, _X, Y) -> Y end, orddict:from_list([{1,a},{2,b}]), orddict:from_list([{1,c},{1,f}])). > [{1,f},{2,b}] > > I would expect, that merge function either generates an exception or returns a proper orddict, but here is that not the case. Am I wrong? Yes, you are. If you violate the preconditions of a function (as expressed by the properties that are expected by its arguments), you cannot expect that its postcondition (its return) is what the documentation promises. Kostis From zxq9@REDACTED Tue Jan 12 14:02:42 2016 From: zxq9@REDACTED (zxq9) Date: Tue, 12 Jan 2016 22:02:42 +0900 Subject: [erlang-questions] orddict - is it an expected behavior? In-Reply-To: References: Message-ID: <1765772.q4z77IGM1B@changa> On 2016?1?12? ??? 13:50:50 Minin Maxim wrote: > Hi All, > > is it an expected behavior? > > 1> orddict:merge(fun(_, _X, Y) -> Y end, orddict:from_list([{1,a},{2,b}]), [{1,c},{1,f}]). > [{1,c},{1,f},{2,b}] It probably should crash there, IMO. There are other places in the stdlib where you can drop invalid data grenades by passing wrong types, too. I guess there isn't a super convenient way to check this, though -- so maybe it is a tradeoff made in the interest of performance. OTOH, it is a little hard to blame the stdlib for throwing bad data around when the programmer is the one who pitched the first foul ball. I would rather see a crash there, but if this function has a typespec Dialyzer would almost certainly catch the mistake at check time -- which is the whole point of having it. -Craig From jesper.louis.andersen@REDACTED Tue Jan 12 14:13:23 2016 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Tue, 12 Jan 2016 14:13:23 +0100 Subject: [erlang-questions] orddict - is it an expected behavior? In-Reply-To: <1765772.q4z77IGM1B@changa> References: <1765772.q4z77IGM1B@changa> Message-ID: On Tue, Jan 12, 2016 at 2:02 PM, zxq9 wrote: > It probably should crash there, IMO. There are other places in the stdlib > where you can drop invalid data grenades by passing wrong types, too. I > guess there isn't a super convenient way to check this, though -- so maybe > it is a tradeoff made in the interest of performance. It is an instance of positive/negative testing or type I/II errors: * Positive polarity: if we supply valid preconditions to a function, its postcondition is valid * Negative polarity: if we supply invalid preconditions to a function, it rejects the input They are duals, and in a "perfect" function, they coincide: Any input is either accepted or rejected based on the input according to the specification. There is no risk of valid input being rejected or invalid input being accepted. What Kostis says is arguably true: most of the specifications in Erlang's stdlib only concerns itself with the positive variant, and makes no claims about the negative variant. This is often true in many programming languages. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From matwey.kornilov@REDACTED Tue Jan 12 14:46:14 2016 From: matwey.kornilov@REDACTED (Matwey V. Kornilov) Date: Tue, 12 Jan 2016 16:46:14 +0300 Subject: [erlang-questions] Match the records Message-ID: Hello, I have the record definition with a lot of fields, so it is pretty long record. -record(myrec, {f0, f1, f2, f3, .....}). Let X and Y be two records of this type. I can not understand how should I do the following pattern matching. I want all fields of X and Y be the same, except f0, and f0 should be bound to new variable F. As there are a lot of fields I don't want to explicitly enumerate them in my code in order DRY. In other words I need a short form of: #myrec{f0 = F, f1 = X#myrec.f1, ...} = Y. From vladdu55@REDACTED Tue Jan 12 14:52:40 2016 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 12 Jan 2016 14:52:40 +0100 Subject: [erlang-questions] Match the records In-Reply-To: References: Message-ID: Hi! X#myrec{f0 = F} = Y. regards, Vlad On Tue, Jan 12, 2016 at 2:46 PM, Matwey V. Kornilov < matwey.kornilov@REDACTED> wrote: > > Hello, > > I have the record definition with a lot of fields, so it is pretty long > record. > > -record(myrec, {f0, f1, f2, f3, .....}). > > Let X and Y be two records of this type. > I can not understand how should I do the following pattern matching. > > I want all fields of X and Y be the same, except f0, and f0 should be > bound to new variable F. As there are a lot of fields I don't want to > explicitly enumerate them in my code in order DRY. > > In other words I need a short form of: > #myrec{f0 = F, f1 = X#myrec.f1, ...} = Y. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matwey.kornilov@REDACTED Tue Jan 12 14:54:20 2016 From: matwey.kornilov@REDACTED (Matwey V. Kornilov) Date: Tue, 12 Jan 2016 16:54:20 +0300 Subject: [erlang-questions] Match the records In-Reply-To: References: Message-ID: Many thanks! 12.01.2016 16:52, Vlad Dumitrescu ?????: > Hi! > > X#myrec{f0 = F} = Y. > > regards, > Vlad > > > On Tue, Jan 12, 2016 at 2:46 PM, Matwey V. Kornilov > > wrote: > > > Hello, > > I have the record definition with a lot of fields, so it is pretty > long record. > > -record(myrec, {f0, f1, f2, f3, .....}). > > Let X and Y be two records of this type. > I can not understand how should I do the following pattern matching. > > I want all fields of X and Y be the same, except f0, and f0 should > be bound to new variable F. As there are a lot of fields I don't > want to explicitly enumerate them in my code in order DRY. > > In other words I need a short form of: > #myrec{f0 = F, f1 = X#myrec.f1, ...} = Y. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > From pawel@REDACTED Tue Jan 12 16:04:58 2016 From: pawel@REDACTED (Pawel Kraszewski) Date: Tue, 12 Jan 2016 16:04:58 +0100 Subject: [erlang-questions] ssl session cache Message-ID: Hello! I'm struggling with SSL session cache. I've already upgraded to 18.2.1 (fixed some of my problems), yet one thing bothers me: lib/ssl-7.2/src/ssl_manager.erl line 242/243 SessionLifeTime = proplists:get_value(session_lifetime, Opts, ?'24H_in_sec'), Its OK. Line 251/252 Timer = erlang:send_after(SessionLifeTime * 1000 + 5000, self(), validate_sessions), It's OK. Gives initial addidtional 5s backoff. And than suddenly line 383/384 Timer = erlang:send_after(?SESSION_VALIDATION_INTERVAL, self(), validate_sessions), >From this time on SessionLifeTime "reload" is ignored and forced to 60s. I have potentially thousands of short-span SSL connections (simple JSON queries via SSL) and session cache grows quickly - even with session lifetime set to 10s. What gives? -- Pawe? Kraszewski http://www.kraszewscy.net From ingela.andin@REDACTED Tue Jan 12 17:31:39 2016 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 12 Jan 2016 17:31:39 +0100 Subject: [erlang-questions] ssl session cache In-Reply-To: References: Message-ID: Hi! We have a backlog item to make sure only one poller validator is started. The code now works as if the previous validator will always finish in 60 s. Maybe that is what is causing your problems. Regards Ingela Erlang/OTP - Team Ericsson AB 2016-01-12 16:04 GMT+01:00 Pawel Kraszewski : > Hello! > > I'm struggling with SSL session cache. I've already upgraded to 18.2.1 > (fixed some of my problems), yet one thing bothers me: > > lib/ssl-7.2/src/ssl_manager.erl line 242/243 > > SessionLifeTime = proplists:get_value(session_lifetime, Opts, > ?'24H_in_sec'), > > Its OK. > > Line 251/252 > > Timer = erlang:send_after(SessionLifeTime * 1000 + 5000, self(), > validate_sessions), > > It's OK. Gives initial addidtional 5s backoff. > > And than suddenly line 383/384 > > Timer = erlang:send_after(?SESSION_VALIDATION_INTERVAL, self(), > validate_sessions), > > From this time on SessionLifeTime "reload" is ignored and forced to 60s. > > I have potentially thousands of short-span SSL connections (simple > JSON queries via SSL) and session cache grows quickly - even with > session lifetime set to 10s. > > What gives? > -- > Pawe? Kraszewski > http://www.kraszewscy.net > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cian@REDACTED Tue Jan 12 17:56:11 2016 From: cian@REDACTED (Cian Synnott) Date: Tue, 12 Jan 2016 16:56:11 +0000 Subject: [erlang-questions] Exometer example In-Reply-To: <569421C1.8070606@gmail.com> References: <569377D7.3020302@gmail.com> <569421C1.8070606@gmail.com> Message-ID: I'm afraid I'm having trouble reproducing this - have you had any further luck? Cian -------------- next part -------------- An HTML attachment was scrubbed... URL: From wojtek@REDACTED Tue Jan 12 18:00:03 2016 From: wojtek@REDACTED (=?UTF-8?Q?Wojtek_Narczy=c5=84ski?=) Date: Tue, 12 Jan 2016 18:00:03 +0100 Subject: [erlang-questions] Question about Erlang and Ada In-Reply-To: References: <566C1F77.1050701@power.com.pl> <566EA482.3080807@power.com.pl> <5693EBDE.4030203@power.com.pl> Message-ID: <56953113.5080505@power.com.pl> On 11.01.2016 21:24, Richard Carlsson wrote: > 2016-01-11 18:52 GMT+01:00 Wojtek Narczy?ski >: > > > Flying an airliner by beam.smp is completely out of question. But > I would not recommend Erlang even for a small uav autopilot > project. Would you? > > > Sure I would. https://www.youtube.com/watch?v=96UzSHyp0F8 > If the whole thing is in erlang, which I seriously doubt, I wonder how quaternion arithmetics has been handled, without the ability to use operator notation. Anyway, it is cool. -- Wojtek -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrtndimitrov@REDACTED Wed Jan 13 00:06:39 2016 From: mrtndimitrov@REDACTED (Martin Koroudjiev) Date: Wed, 13 Jan 2016 01:06:39 +0200 Subject: [erlang-questions] Exometer example In-Reply-To: References: <569377D7.3020302@gmail.com> <569421C1.8070606@gmail.com> Message-ID: <569586FF.4080406@gmail.com> Hi, sorry I forgot to write back - on the test machine I was using the snmp Erlang lib wasn't installed. I managed to compile it. Thank you. Regards, Martin On 1/12/2016 6:56 PM, Cian Synnott wrote: > I'm afraid I'm having trouble reproducing this - have you had any > further luck? > > Cian From z@REDACTED Wed Jan 13 14:41:49 2016 From: z@REDACTED (Danil Zagoskin) Date: Wed, 13 Jan 2016 16:41:49 +0300 Subject: [erlang-questions] ssl session cache In-Reply-To: References: Message-ID: Hi Pawel! In 18.2 you should have session cache size limited by 1000 by default ? see https://github.com/erlang/otp/commit/42b8a29dbae1d626f32bc16dd81a129caf741138 Actually I have hit the trouble of many concurrent invalidators on 17.1, but the number of sessions was about 350000. Also 18.2 has performance improvements, so you have to keep even more sessions to die of invalidators. Try the following: - Check if tables 'server_ssl_otp_session_cache' and 'client_ssl_otp_session_cache' owned by ssl_manager in 'ets:i()' output have more entries than configured limit. - If limiting works well, set the limit to e.g. 50000. This should be sufficient for invalidator to finish its work in 60 seconds. - Maybe you have other problem. Check ssl_manager's message_queue. It may be full of invalidation messages from closing sockets (in my tests closing 400000 sockets simultaneusly blocks the manager for several minutes). You can distinguish this from invalidator's effects by setting large lifetime to prevent invalidator from running. On Tue, Jan 12, 2016 at 6:04 PM, Pawel Kraszewski wrote: > Hello! > > I'm struggling with SSL session cache. I've already upgraded to 18.2.1 > (fixed some of my problems), yet one thing bothers me: > > lib/ssl-7.2/src/ssl_manager.erl line 242/243 > > SessionLifeTime = proplists:get_value(session_lifetime, Opts, > ?'24H_in_sec'), > > Its OK. > > Line 251/252 > > Timer = erlang:send_after(SessionLifeTime * 1000 + 5000, self(), > validate_sessions), > > It's OK. Gives initial addidtional 5s backoff. > > And than suddenly line 383/384 > > Timer = erlang:send_after(?SESSION_VALIDATION_INTERVAL, self(), > validate_sessions), > > From this time on SessionLifeTime "reload" is ignored and forced to 60s. > > I have potentially thousands of short-span SSL connections (simple > JSON queries via SSL) and session cache grows quickly - even with > session lifetime set to 10s. > > What gives? > -- > Pawe? Kraszewski > http://www.kraszewscy.net > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Wed Jan 13 15:44:37 2016 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 13 Jan 2016 15:44:37 +0100 Subject: [erlang-questions] clarify: Where does the file go when I do file:write_file("/tmp/zfile", <<"z">>, [raw] ). on a slave? Message-ID: <569662D5.5060707@ericsson.com> Greetings, Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 5.10.4.1 (R16B I think). I have started a slave with slave:start/5 (not documented but I need the fifth argument). Since the slave is up and running I suggest that my experience is the same as would happen with slave:start/3. I start a shell in the slave and connect to it. There I do: file:write_file( "/tmp/zfile", <<"z">>, [raw] ). The file is not present on the slave, nor on the master(*). Where is it? Bonus points for an explanation of how I can write a file on the slave, from the erlang shell on the same slave. bengt (*) If I do file:write_file( "/tmp/zfile", <<"z">> ). the file is on the master, as explained by the slave module documentation. From bengt.kleberg@REDACTED Wed Jan 13 15:51:36 2016 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 13 Jan 2016 15:51:36 +0100 Subject: [erlang-questions] clarify: Where does the file go when I do file:write_file("/tmp/zfile", <<"z">>, [raw] ). on a slave? In-Reply-To: <569662D5.5060707@ericsson.com> References: <569662D5.5060707@ericsson.com> Message-ID: <56966478.3040105@ericsson.com> Solved. Sorry for the confusion. I used ls("/tmp"). to check for the file on the slave. And it gave me the /tmp contents on the master, of course. So the file:write_file/3, with [raw], will create the file on the slave. bengt On 01/13/2016 03:44 PM, Bengt Kleberg wrote: > Greetings, > > Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 5.10.4.1 > (R16B I think). > > I have started a slave with slave:start/5 (not documented but I need > the fifth argument). Since the slave is up and running I suggest that > my experience is the same as would happen with slave:start/3. > > I start a shell in the slave and connect to it. There I do: > file:write_file( "/tmp/zfile", <<"z">>, [raw] ). > > The file is not present on the slave, nor on the master(*). > Where is it? > > > Bonus points for an explanation of how I can write a file on the > slave, from the erlang shell on the same slave. > > > bengt > (*) > If I do > file:write_file( "/tmp/zfile", <<"z">> ). > the file is on the master, as explained by the slave module > documentation. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From lheadley@REDACTED Wed Jan 13 20:16:27 2016 From: lheadley@REDACTED (Lyn Headley) Date: Wed, 13 Jan 2016 11:16:27 -0800 Subject: [erlang-questions] Is priv a good place to store data? Message-ID: Hi, I am building an app which will need to store some data in files. I am wondering if others use the priv directory for this, or whether they use another place, perhaps somewhere outside of the application tree entirely. I am thinking I will just add a .gitignore for priv/mydata, so git does not notice the directory, but wondered if others do things differently. Any issues regarding source control or releases that I should be aware of? On a related note -- is priv/my_mnesia a good place to put the mnesia directory? -Lyn From jesper.louis.andersen@REDACTED Wed Jan 13 20:38:16 2016 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 13 Jan 2016 20:38:16 +0100 Subject: [erlang-questions] Is priv a good place to store data? In-Reply-To: References: Message-ID: On Wed, Jan 13, 2016 at 8:16 PM, Lyn Headley wrote: > I am building an app which will need to store some data in files. I am > wondering if others use the priv directory for this, or whether they > use another place, perhaps somewhere outside of the application tree > entirely. > >From experience: keep the static artifact away from the dynamic data whenever you can. It makes software upgrades much simpler since you can install another artifact next to the one you already have, move a symbolic link, and run it against the data, kept separate. It simplifies partitioning, it simplifies backup, and you can lock down writing to the tree for the user running your release. So my usual solution is: use priv for read-only data the given application is using, and use the application configuration environment to pick up the storage area for dynamic data. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlsson.richard@REDACTED Thu Jan 14 00:03:45 2016 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Thu, 14 Jan 2016 00:03:45 +0100 Subject: [erlang-questions] Is priv a good place to store data? In-Reply-To: References: Message-ID: The priv directory was never intended for dynamic data, only for static files that are shipped with the release. Although some people put dynamic data under priv (and I've done it myself back before I knew the proper ways of OTP), it's a mistake that tends to come back and bite you one way or another, screwing up release handling, making backups more complicated, etc. Preferably, you should be able to wipe out the entire directory where all your apps are installed, reinstall the code, and restart the system, without losing any live data or configuration files. /Richard 2016-01-13 20:38 GMT+01:00 Jesper Louis Andersen < jesper.louis.andersen@REDACTED>: > > On Wed, Jan 13, 2016 at 8:16 PM, Lyn Headley wrote: > >> I am building an app which will need to store some data in files. I am >> wondering if others use the priv directory for this, or whether they >> use another place, perhaps somewhere outside of the application tree >> entirely. >> > > From experience: keep the static artifact away from the dynamic data > whenever you can. It makes software upgrades much simpler since you can > install another artifact next to the one you already have, move a symbolic > link, and run it against the data, kept separate. It simplifies > partitioning, it simplifies backup, and you can lock down writing to the > tree for the user running your release. > > So my usual solution is: use priv for read-only data the given application > is using, and use the application configuration environment to pick up the > storage area for dynamic data. > > > -- > J. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay@REDACTED Thu Jan 14 18:24:21 2016 From: jay@REDACTED (Jay Nelson) Date: Thu, 14 Jan 2016 09:24:21 -0800 Subject: [erlang-questions] Architecture question: logging inside library Message-ID: <4F64CD5A-5C29-43BC-BDB3-72643F61D502@duomark.com> The OTP gen_event behaviour is often overlooked by the OSS community when specifying erlang system architectures. It allows you to dynamically install handlers for notifications, and is especially useful as an organizing construct when side-effects may vary in different situations. At unit testing time you can replace handlers with collectors and verify that data is flowing properly. As earlier posters commented, try to avoid side-effects and use tracing when you temporarily want to watch values (don?t leave tracing on all the time in production for logging), but if you have specific places you want to periodically spy on, you can use gen_event:notify/2 and not care whether a callback is installed or not. Your callback can later be installed dynamically and it can even forward to other nodes, or you can use distributed erlang to notify a gen_event running on another node. Tips: - Keep your event handlers short. - Pass on any computation to another process. - Use meaningful semantic names where notify happens. When providing a library, you allow the integrator to do late binding on the logging utility. The dependency is bundled with the handler manager, not the base library. jay From mark@REDACTED Fri Jan 15 22:49:47 2016 From: mark@REDACTED (Mark Steele) Date: Fri, 15 Jan 2016 16:49:47 -0500 Subject: [erlang-questions] Escript with TLS distribution Message-ID: Hi all, I'm trying to setup an escript that can leverage TLS distribution. Is such a thing even possible? I've tried this line in the file header (line breaks for readability): %%! +P 256000 -env ERL_MAX_ETS_TABLES 256000 -env ERL_CRASH_DUMP /dev/null -env ERL_FULLSWEEP_AFTER 0 -env ERL_MAX_PORTS 65536 +A 64 +K true +W w -smp auto -boot /tmp/start_clean -proto_dist inet_tls -ssl_dist_opt client_cacertfile var/lib/cinched/cacert.pem client_keyfile /var/lib/cinched/key.pem client_certfile /var/lib/cinched/client.pem server_cacertfile /etc/cinched/cacert.pem server_keyfile /var/lib/cinched/key.pem server_certfile /var/lib/cinched/cert.pem -name cinched -setcookie foobar -config /etc/cinched/sys.config -s public_key -s asn1 -s ssl -s crypto Unfortunately, it doesn't look like it applies the boot settings {error_logger,{{2016,1,15},{16,38,26}},"Protocol: ~tp: not supported~n",["inet_tls"]} {error_logger,{{2016,1,15},{16,38,26}},crash_report,[[{initial_call,{net_kernel,init,['Argument__1']}},{pid,<0.21.0>},{registered_name,[]},{error_info,{exit,{error,badarg},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,322}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}},{ancestors,[net_sup,kernel_sup,<0.10.0>]},{messages,[]},{links,[<0.18.0>]},{dictionary,[{longnames,true}]},{trap_exit,true},{status,running},{heap_size,987},{stack_size,27},{reductions,223}],[]]} {error_logger,{{2016,1,15},{16,38,26}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},{offender,[{pid,undefined},{name,net_kernel},{mfargs,{net_kernel,start_link,[[cinched,longnames]]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]} {error_logger,{{2016,1,15},{16,38,26}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}},{offender,[{pid,undefined},{name,net_sup},{mfargs,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]} {error_logger,{{2016,1,15},{16,38,26}},crash_report,[[{initial_call,{application_master,init,['Argument__1','Argument__2','Argument__3','Argument__4']}},{pid,<0.9.0>},{registered_name,[]},{error_info,{exit,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,133}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}},{ancestors,[<0.8.0>]},{messages,[{'EXIT',<0.10.0>,normal}]},{links,[<0.8.0>,<0.7.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,376},{stack_size,27},{reductions,164}],[]]} {error_logger,{{2016,1,15},{16,38,26}},std_info,[{application,kernel},{exited,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}}},{type,permanent}]} {"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}}}"} The /tmp/start_clean.rel file: {release,{"start_clean",[]}, {erts,"6.4"}, [{kernel,"3.2"}, {stdlib,"2.4"}, {sasl,"2.4.1"}, {crypto,"3.5"}, {asn1,"3.0.4"}, {public_key,"0.23"}, {ssl,"6.0"} ]}. Anyone have a clue-stick or working example of an escript that can talk TLS? I've also tried specifying TLS options as part of the ERL_FLAGsin the environment prior to kicking off the escript (and removing TLS options from the script header), with the same results. Mark Steele CISSP, GPEN, GCIA, CSM mark@REDACTED LinkedIn: https://ca.linkedin.com/in/markrsteele Github: https://github.com/marksteele Personal: http://www.control-alt-del.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From ka.gemayel@REDACTED Fri Jan 15 22:16:03 2016 From: ka.gemayel@REDACTED (Karim Gemayel) Date: Fri, 15 Jan 2016 22:16:03 +0100 Subject: [erlang-questions] TCP Fast Open for gen_tcp Message-ID: Hello, I'm wondering if there's any plan to implement the TCP Fast Open extension [1] in gen_tcp. TFO seems to substantially reduce the latency of mobile device initial TCP connection and quite useful for queries to webservices. TFO is not yet widely implemented, apparently mainly available on Linux 3.7+, Chrome/Chromium (via chrome://flags/#enable-tcp-fast-open ) [2], Nginx [3] and in Wireshark with the 'tcp.options.tfo*' filters [4]. After experimenting, so far got only one full TFO connection. [1] https://tools.ietf.org/html/rfc7413 [2] https://bradleyf.id.au/nix/shaving-your-rtt-wth-tfo/ [3] http://www.supertcp.com/enabling-tcp-fast-open-nginx-centos-7/ [4] https://www.wireshark.org/lists/wireshark-bugs/201212/msg00683.html Cheers, -- Karim Gemayel From ruben.caro.estevez@REDACTED Sat Jan 16 12:08:02 2016 From: ruben.caro.estevez@REDACTED (=?UTF-8?Q?Rub=C3=A9n_Caro?=) Date: Sat, 16 Jan 2016 12:08:02 +0100 Subject: [erlang-questions] ssh_connection.exec/4 response length limit Message-ID: Hello, When I run this: ----------------------------- ssh:start(). {ok, Conn} = ssh:connect("myip", 22, [ {user,"myuser"} ], 5000). {ok, Channel} = ssh_connection:session_channel(Conn, 5000). L = fun Loop(N) -> receive {ssh_cm,_,{_,_,_,Data}} -> Loop(N + byte_size(Data)) after 5000 -> io:format("~p~n",[N]) end end. ssh_connection:exec(Conn, Channel, "yes", 5000). L(0). ----------------------------- I get the magic number 65536. A 'flush().' only says 'ok'. So no more messages on my inbox. This happens running any command that generates a long enough output, not only 'yes'. Anything like 'while true; do echo; done;' or 'cat longenough.txt' would hit a similar limit. Why is that? Can I go past this limit? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony@REDACTED Sat Jan 16 15:42:37 2016 From: tony@REDACTED (Tony Rogvall) Date: Sat, 16 Jan 2016 15:42:37 +0100 Subject: [erlang-questions] ssh_connection.exec/4 response length limit In-Reply-To: References: Message-ID: <788B5089-8E13-420C-B3DF-F58631B97575@rogvall.se> You must adjust the window: Add ssh_connection:adjust_window(Conn,Channel,Sz) > On 16 jan 2016, at 12:08, Rub?n Caro wrote: > > Hello, > > When I run this: > > ----------------------------- > ssh:start(). > {ok, Conn} = ssh:connect("myip", 22, [ {user,"myuser"} ], 5000). > {ok, Channel} = ssh_connection:session_channel(Conn, 5000). > > L = fun Loop(N) -> > receive > {ssh_cm,_,{_,_,_,Data}} -> ssh_connection:adjust_window(Conn,Channel,byte_size(Data)) > Loop(N + byte_size(Data)) > after > 5000 -> io:format("~p~n",[N]) > end > end. > > ssh_connection:exec(Conn, Channel, "yes", 5000). > > L(0). This will loop for a very long time /Tony > ----------------------------- > > I get the magic number 65536. A 'flush().' only says 'ok'. So no more messages on my inbox. > > This happens running any command that generates a long enough output, not only 'yes'. Anything like 'while true; do echo; done;' or 'cat longenough.txt' would hit a similar limit. > > Why is that? Can I go past this limit? > > Thanks. > _______________________________________________ > 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: 801 bytes Desc: Message signed with OpenPGP using GPGMail URL: From donpedrothird@REDACTED Sat Jan 16 17:18:44 2016 From: donpedrothird@REDACTED (John Doe) Date: Sat, 16 Jan 2016 19:18:44 +0300 Subject: [erlang-questions] dirty NIFs - Lock check assertion "!erts_smp_lc_runq_is_locked(rq)" failed Message-ID: Hello, I'm getting the following error in a dirty NIF library which keeps segfaulting: beam/erl_process.c:3313: Lock check assertion "!erts_smp_lc_runq_is_locked(rq)" failed! Currently these locks are locked by the dirty io scheduler 2 thread: 'run_queue:-1[mutex](beam/erl_process.h:2134)' The library is using enif_rwlock_ functions for synchronization. What could be the possible reason for this error? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Sat Jan 16 17:25:53 2016 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sat, 16 Jan 2016 17:25:53 +0100 Subject: [erlang-questions] [ANN] Eministat 0.10.1 - benchmark statistics for Erlang Message-ID: Hi Erlangers, https://github.com/jlouis/eministat I'm happy to announce a beta of eministat, which is a minimal statistics application for benchmark measurement. Given two benchmarks runs, with several samples in each, eministat can analyse these statistically through the student's t-test. This allows you to put the test cases in relation to each other and figure out if one of the tests are significantly different from the other. The advantage is that when you have variance in your tests, then this tool is far better at figuring out what to make of the numbers. The tool is inspired by the ministat(1) application by Poul-Henning Kamp, and Bryan O'Sullivan's criterion Haskell benchmarking tool, and mixes ideas from both. A dedicated tool like R is better at extensive stats, but eministat is a fast quick way of doing the initial work in Erlang itself. The end goal of this tool is to solve the computational part of benchmarking and not so much the sampling part itself. It serves as a way to end arguments about "Is method X faster than Y?" by paying attention to the statistics in the field. Hopefully this improves all Erlangers attitude toward performance testing and benchmarking. Finally, if you have stats-knowledge, and want to cross-check me, I would be grateful. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruben.caro.estevez@REDACTED Sat Jan 16 17:08:17 2016 From: ruben.caro.estevez@REDACTED (=?UTF-8?Q?Rub=C3=A9n_Caro?=) Date: Sat, 16 Jan 2016 17:08:17 +0100 Subject: [erlang-questions] ssh_connection.exec/4 response length limit In-Reply-To: <788B5089-8E13-420C-B3DF-F58631B97575@rogvall.se> References: <788B5089-8E13-420C-B3DF-F58631B97575@rogvall.se> Message-ID: Of course it worked! Many thanks ( see https://github.com/rubencaro/sshex/issues/4 ). 2016-01-16 15:42 GMT+01:00 Tony Rogvall : > You must adjust the window: > > Add > ssh_connection:adjust_window(Conn,Channel,Sz) > > > On 16 jan 2016, at 12:08, Rub?n Caro > wrote: > > > > Hello, > > > > When I run this: > > > > ----------------------------- > > ssh:start(). > > {ok, Conn} = ssh:connect("myip", 22, [ {user,"myuser"} ], 5000). > > {ok, Channel} = ssh_connection:session_channel(Conn, 5000). > > > > L = fun Loop(N) -> > > receive > > {ssh_cm,_,{_,_,_,Data}} -> > > ssh_connection:adjust_window(Conn,Channel,byte_size(Data)) > > > Loop(N + byte_size(Data)) > > after > > 5000 -> io:format("~p~n",[N]) > > end > > end. > > > > ssh_connection:exec(Conn, Channel, "yes", 5000). > > > > L(0). > > This will loop for a very long time > > /Tony > > > ----------------------------- > > > > I get the magic number 65536. A 'flush().' only says 'ok'. So no more > messages on my inbox. > > > > This happens running any command that generates a long enough output, > not only 'yes'. Anything like 'while true; do echo; done;' or 'cat > longenough.txt' would hit a similar limit. > > > > Why is that? Can I go past this limit? > > > > Thanks. > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Sat Jan 16 18:25:13 2016 From: vinoski@REDACTED (Steve Vinoski) Date: Sat, 16 Jan 2016 12:25:13 -0500 Subject: [erlang-questions] dirty NIFs - Lock check assertion "!erts_smp_lc_runq_is_locked(rq)" failed In-Reply-To: References: Message-ID: On Sat, Jan 16, 2016 at 11:18 AM, John Doe wrote: > Hello, > I'm getting the following error in a dirty NIF library which keeps > segfaulting: > > beam/erl_process.c:3313: Lock check assertion > "!erts_smp_lc_runq_is_locked(rq)" failed! > Currently these locks are locked by the dirty io scheduler 2 thread: > 'run_queue:-1[mutex](beam/erl_process.h:2134)' > > The library is using enif_rwlock_ functions for synchronization. > What could be the possible reason for this error? > You'll need to supply more details. Most importantly, what version of Erlang are you using? And second, if you can supply a pointer to your code or you can post it in a pastebin, that would be helpful (or feel free to point me to it in a private reply if you don't want to share it publicly), but if not, the more detail you can share about what your code is doing, the better. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Sat Jan 16 18:40:48 2016 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sat, 16 Jan 2016 18:40:48 +0100 Subject: [erlang-questions] [ANN] Eministat 0.10.1 - benchmark statistics for Erlang In-Reply-To: References: Message-ID: On 16 January 2016 at 17:25, Jesper Louis Andersen wrote: > Hi Erlangers, > > https://github.com/jlouis/eministat Thanks for sharing. So, what happened to ecriterion? From donpedrothird@REDACTED Sat Jan 16 19:11:44 2016 From: donpedrothird@REDACTED (John Doe) Date: Sat, 16 Jan 2016 21:11:44 +0300 Subject: [erlang-questions] dirty NIFs - Lock check assertion "!erts_smp_lc_runq_is_locked(rq)" failed In-Reply-To: References: Message-ID: I'm using 18.2 About the code, i'll try to make a smallish demo to demonstrate it, and send you the link. I just though maybe there's some obvious thing which I should have not doing with rwlocks in dirty nifs. 2016-01-16 20:25 GMT+03:00 Steve Vinoski : > > > On Sat, Jan 16, 2016 at 11:18 AM, John Doe > wrote: > >> Hello, >> I'm getting the following error in a dirty NIF library which keeps >> segfaulting: >> >> beam/erl_process.c:3313: Lock check assertion >> "!erts_smp_lc_runq_is_locked(rq)" failed! >> Currently these locks are locked by the dirty io scheduler 2 thread: >> 'run_queue:-1[mutex](beam/erl_process.h:2134)' >> >> The library is using enif_rwlock_ functions for synchronization. >> What could be the possible reason for this error? >> > > You'll need to supply more details. Most importantly, what version of > Erlang are you using? And second, if you can supply a pointer to your code > or you can post it in a pastebin, that would be helpful (or feel free to > point me to it in a private reply if you don't want to share it publicly), > but if not, the more detail you can share about what your code is doing, > the better. > > --steve > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stamarit@REDACTED Sat Jan 16 21:24:26 2016 From: stamarit@REDACTED (Salvador Tamarit) Date: Sat, 16 Jan 2016 21:24:26 +0100 Subject: [erlang-questions] CfP: Workshop on Program Transformation for Programmability in Heterogeneous Architectures (Co-located with CGO16); Deadline Jan 22 [Extended] Message-ID: [Apologies if you receive multiple copies of this announcement.] ********************************************************************************* PROHA 2016, CALL FOR PAPERS -- Deadline extension First Workshop on Program Transformation for Programmability in Heterogeneous Architectures http://goo.gl/RzGbzY Barcelona, 12th March 2016, in conjunction with the CGO'16 Conference ********************************************************************************* Important Dates: Paper submission deadline: 22 January 2016 23:59 (UTC) [Extended] Author notification: 5 February 2016 Final manuscript due: 26 February 2016 Scope: Developing and maintaining high-performance applications and libraries for heterogeneous architectures is a difficult task, usually requiring code transformations performed by an expert. Tools assisting in and, if possible, automating such transformations are of course of great interest. However, such tools require significant knowledge and reasoning capabilities. For example, the former could be a machine-understandable descriptions of what a piece of code is expected to do, while the latter could be a set of transformations and a corresponding logical context in which they are applicable, respectively. Furthermore, strategies to identify the sequence of transformations leading to the best resulting code need to be elaborated. This workshop will focus on techniques and foundations which make it possible to perform source code transformations, which preserve the intended semantics of the original code and improve efficiency, portability or maintainability. The topics of interest for the workshop include, but are not limited to: * Program annotations to capture algorithmic properties and intended code semantics. * Programming paradigms able to express underlying (mathematical) properties of code. * Usage of dynamic and static mechanisms to infer relevant code properties. * Transformations which preserve intended semantics. * Strategies to apply transformations. * Heuristics to guide program transformation and techniques to synthesize / learn these heuristics. * Tools Submission Guidelines: Submissions are to be written in English and not exceed 10 pages, including bibliography. Submissions should be written in ACM double-column format using a 10-point type. Authors should follow the information for formatting ACM SIGPLAN conference papers, which can be found at http://www.sigplan.org/Resources/Author . Authors should submit their papers in pdf format using the EasyChair submission website https://easychair.org/conferences/?conf=proha2016 . Publication: The proceedings will be made publicly available through ArXiV. Workshop Organizers: - Manuel Carro, IMDEA Software Institute and Technical University of Madrid - Colin W. Glass, University of Stuttgart - Jan Kuper, University of Twente - Julio Mari?o, Technical University of Madrid - Lutz Schubert, University of Ulm - Guillermo Vigueras, IMDEA Software Institute - Salvador Tamarit, Technical University of Madrid If you have any questions, please contact the program chair at manuel.carro@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From fhunleth@REDACTED Sun Jan 17 02:38:35 2016 From: fhunleth@REDACTED (Frank Hunleth) Date: Sat, 16 Jan 2016 20:38:35 -0500 Subject: [erlang-questions] Erlang on 64-bit ARM? Message-ID: I was wondering if anyone uses Erlang on a 64-bit ARM platform (aarch64)? The Buildroot project's CI servers are throwing linker errors such as the following: LD /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/bin/aarch64-buildroot-linux-gnu/child_setup AR /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/erts/emulator/pcre/obj/aarch64-buildroot-linux-gnu/opt/libepcre.a LD /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/bin/aarch64-buildroot-linux-gnu/beam ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): In function `AO_double_compare_and_swap': ethr_atomics.c:(.text+0x20): undefined reference to `__atomic_compare_exchange_16' ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): In function `AO_double_load': ethr_atomics.c:(.text+0x3c): undefined reference to `__atomic_load_16' ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): In function `ethr_dw_atomic_cmpxchg_acqb': ethr_atomics.c:(.text+0x5e8): undefined reference to `__atomic_load_16' See http://autobuild.buildroot.net/results/0cd/0cd22eb74fa29e5a85bf897762e16ab3daf33962/build-end.log for all of the error messages. I was able to reproduce the same errors on the 18.2.1 release as well. Possibly confounding the situation is that Buildroot crosscompiles Erlang. However, Erlang builds fine on all other platforms supported by Buildroot, and my attempt at reading the atomic intrinsics code was leading me down the path that aarch64 may not be supported. Could somewhere verify whether this is the case? Thanks, Frank From mikpelinux@REDACTED Sun Jan 17 12:14:12 2016 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Sun, 17 Jan 2016 12:14:12 +0100 Subject: [erlang-questions] Erlang on 64-bit ARM? In-Reply-To: References: Message-ID: <22171.30596.759924.986429@gargle.gargle.HOWL> Frank Hunleth writes: > I was wondering if anyone uses Erlang on a 64-bit ARM platform > (aarch64)? The Buildroot project's CI servers are throwing linker > errors such as the following: > > LD /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/bin/aarch64-buildroot-linux-gnu/child_setup > AR /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/erts/emulator/pcre/obj/aarch64-buildroot-linux-gnu/opt/libepcre.a > LD /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/bin/aarch64-buildroot-linux-gnu/beam > ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): > In function `AO_double_compare_and_swap': > ethr_atomics.c:(.text+0x20): undefined reference to > `__atomic_compare_exchange_16' > ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): > In function `AO_double_load': > ethr_atomics.c:(.text+0x3c): undefined reference to `__atomic_load_16' > ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): > In function `ethr_dw_atomic_cmpxchg_acqb': > ethr_atomics.c:(.text+0x5e8): undefined reference to `__atomic_load_16' > > See http://autobuild.buildroot.net/results/0cd/0cd22eb74fa29e5a85bf897762e16ab3daf33962/build-end.log > for all of the error messages. > > I was able to reproduce the same errors on the 18.2.1 release as well. > Possibly confounding the situation is that Buildroot crosscompiles > Erlang. However, Erlang builds fine on all other platforms supported > by Buildroot, and my attempt at reading the atomic intrinsics code was > leading me down the path that aarch64 may not be supported. Could > somewhere verify whether this is the case? OTP 18.2.1 builds fine using an aarch64-unknown-linux cross toolchain built using binutils-2.25.1, gcc-5.3.0, linux-3.19 kernel headers, and glibc-2.22, all unmodified upstream sources. However, if I also build and install libatomic_ops in that cross toolchain and add --with-libatomic_ops to OTP's ./configure, then I do get the same error as you cite above. Looks like some issue in OTP's interface to that library. I've never looked into libatomics_ops myself, since I prefer to implement atomics by hand or by using gcc's builtins. Workaround for now is to not use libatomic_ops. You may also want to file a bug in the bug tracker. From eric.pailleau@REDACTED Sun Jan 17 12:29:00 2016 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Sun, 17 Jan 2016 12:29:00 +0100 Subject: [erlang-questions] Erlang on 64-bit ARM? In-Reply-To: Message-ID: Hi, I can see debian packages arm64 for Erlang. My raspberry pi2 is armv71, run Erlang, but it is 32 bits. Regards Le?17 janv. 2016 2:38 AM, Frank Hunleth a ?crit?: > > I was wondering if anyone uses Erlang on a 64-bit ARM platform > (aarch64)? The Buildroot project's CI servers are throwing linker > errors such as the following: > > LD /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/bin/aarch64-buildroot-linux-gnu/child_setup > AR /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/erts/emulator/pcre/obj/aarch64-buildroot-linux-gnu/opt/libepcre.a > LD /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/bin/aarch64-buildroot-linux-gnu/beam > ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): > In function `AO_double_compare_and_swap': > ethr_atomics.c:(.text+0x20): undefined reference to > `__atomic_compare_exchange_16' > ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): > In function `AO_double_load': > ethr_atomics.c:(.text+0x3c): undefined reference to `__atomic_load_16' > ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): > In function `ethr_dw_atomic_cmpxchg_acqb': > ethr_atomics.c:(.text+0x5e8): undefined reference to `__atomic_load_16' > > See http://autobuild.buildroot.net/results/0cd/0cd22eb74fa29e5a85bf897762e16ab3daf33962/build-end.log > for all of the error messages. > > I was able to reproduce the same errors on the 18.2.1 release as well. > Possibly confounding the situation is that Buildroot crosscompiles > Erlang. However, Erlang builds fine on all other platforms supported > by Buildroot, and my attempt at reading the atomic intrinsics code was > leading me down the path that aarch64 may not be supported. Could > somewhere verify whether this is the case? > > Thanks, > Frank > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From fhunleth@REDACTED Sun Jan 17 17:19:06 2016 From: fhunleth@REDACTED (Frank Hunleth) Date: Sun, 17 Jan 2016 11:19:06 -0500 Subject: [erlang-questions] Erlang on 64-bit ARM? In-Reply-To: <22171.30596.759924.986429@gargle.gargle.HOWL> References: <22171.30596.759924.986429@gargle.gargle.HOWL> Message-ID: On Sun, Jan 17, 2016 at 6:14 AM, Mikael Pettersson wrote: > Frank Hunleth writes: > > I was wondering if anyone uses Erlang on a 64-bit ARM platform > > (aarch64)? The Buildroot project's CI servers are throwing linker > > errors such as the following: > > > > LD /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/bin/aarch64-buildroot-linux-gnu/child_setup > > AR /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/erts/emulator/pcre/obj/aarch64-buildroot-linux-gnu/opt/libepcre.a > > LD /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/bin/aarch64-buildroot-linux-gnu/beam > > ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): > > In function `AO_double_compare_and_swap': > > ethr_atomics.c:(.text+0x20): undefined reference to > > `__atomic_compare_exchange_16' > > ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): > > In function `AO_double_load': > > ethr_atomics.c:(.text+0x3c): undefined reference to `__atomic_load_16' > > ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): > > In function `ethr_dw_atomic_cmpxchg_acqb': > > ethr_atomics.c:(.text+0x5e8): undefined reference to `__atomic_load_16' > > > > See http://autobuild.buildroot.net/results/0cd/0cd22eb74fa29e5a85bf897762e16ab3daf33962/build-end.log > > for all of the error messages. > > > > I was able to reproduce the same errors on the 18.2.1 release as well. > > Possibly confounding the situation is that Buildroot crosscompiles > > Erlang. However, Erlang builds fine on all other platforms supported > > by Buildroot, and my attempt at reading the atomic intrinsics code was > > leading me down the path that aarch64 may not be supported. Could > > somewhere verify whether this is the case? > > OTP 18.2.1 builds fine using an aarch64-unknown-linux cross toolchain built > using binutils-2.25.1, gcc-5.3.0, linux-3.19 kernel headers, and glibc-2.22, > all unmodified upstream sources. > > However, if I also build and install libatomic_ops in that cross toolchain > and add --with-libatomic_ops to OTP's ./configure, then I do get the same > error as you cite above. > > Looks like some issue in OTP's interface to that library. I've never looked > into libatomics_ops myself, since I prefer to implement atomics by hand or by > using gcc's builtins. > > Workaround for now is to not use libatomic_ops. You may also want to file a > bug in the bug tracker. Thanks. I was able to build Erlang without libatomic_ops just like you said. I've filed a bug, ERL-78, to track the issue. Regards, Frank From matwey.kornilov@REDACTED Sun Jan 17 17:40:59 2016 From: matwey.kornilov@REDACTED (Matwey V. Kornilov) Date: Sun, 17 Jan 2016 19:40:59 +0300 Subject: [erlang-questions] HiPE on s390 Message-ID: Hello, Is HiPE supported on s390? I see the warning: "configure: WARNING: HiPE is not supported in 64-bit builds" but everything goes well until [ 5637s] === Entering application hipe [ 5637s] make[3]: Entering directory '/home/abuild/rpmbuild/BUILD/otp-OTP-18.2.2/lib/hipe/misc' [ 5638s] ERLC ../ebin/hipe_consttab.beam [ 5638s] ERLC ../ebin/hipe_gensym.beam [ 5639s] /bin/sh: line 1: 4916 Segmentation fault erlc -W +debug_info +warn_exported_vars +warn_missing_spec +warn_untyped_record -o../ebin hipe_gensym.erl [ 5639s] /bin/sh: line 1: 4917 Segmentation fault erlc -W +debug_info +warn_exported_vars +warn_missing_spec +warn_untyped_record -o../ebin hipe_consttab.erl [ 5639s] /home/abuild/rpmbuild/BUILD/otp-OTP-18.2.2/make/s390x-ibm-linux-gnu/otp.mk:123: recipe for target '../ebin/hipe_gensym.beam' failed [ 5639s] make[3]: *** [../ebin/hipe_gensym.beam] Error 139 From mikpelinux@REDACTED Sun Jan 17 18:00:14 2016 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Sun, 17 Jan 2016 18:00:14 +0100 Subject: [erlang-questions] HiPE on s390 In-Reply-To: References: Message-ID: <22171.51358.203937.124422@gargle.gargle.HOWL> Matwey V. Kornilov writes: > Hello, > > Is HiPE supported on s390? Sorry, HiPE has no s390/s390x support, and I know of no-one planning to add that support. > I see the warning: > > "configure: WARNING: HiPE is not supported in 64-bit builds" > > but everything goes well until > > [ 5637s] === Entering application hipe > [ 5637s] make[3]: Entering directory > '/home/abuild/rpmbuild/BUILD/otp-OTP-18.2.2/lib/hipe/misc' > [ 5638s] ERLC ../ebin/hipe_consttab.beam > [ 5638s] ERLC ../ebin/hipe_gensym.beam > [ 5639s] /bin/sh: line 1: 4916 Segmentation fault erlc -W > +debug_info +warn_exported_vars +warn_missing_spec +warn_untyped_record > -o../ebin hipe_gensym.erl > [ 5639s] /bin/sh: line 1: 4917 Segmentation fault erlc -W > +debug_info +warn_exported_vars +warn_missing_spec +warn_untyped_record > -o../ebin hipe_consttab.erl > [ 5639s] > /home/abuild/rpmbuild/BUILD/otp-OTP-18.2.2/make/s390x-ibm-linux-gnu/otp.mk:123: > recipe for target '../ebin/hipe_gensym.beam' failed > [ 5639s] make[3]: *** [../ebin/hipe_gensym.beam] Error 139 I'm surprised you got this far, and the SEGV is arguably a bug. Building without --enable-hipe should give you a working Erlang/OTP. From scdelta1249@REDACTED Sun Jan 17 23:33:16 2016 From: scdelta1249@REDACTED (scdelta1249) Date: Sun, 17 Jan 2016 17:33:16 -0500 Subject: [erlang-questions] Maximize Client TCP Sockets Message-ID: I have an application where I need to make 10s of millions of short-lived plain TCP (gen_tcp) or HTTP/HTTPS (httpc/gun/hackney) requests to different servers. The parameters for the requests are stored in a database. My plan is for a controlling gen_server on each node in the cluster to: * grab a group of requests from the database * spawn a process for each request * the spawned process connects, makes the request, processes the response and shuts down the connection What is the best strategy to maximize the number of concurrent clients? My current plan is to maintain a list of pending requests in the controlling process (gen_server). As processes complete, they remove themselves from the list. If they error out on initialization I'd implement some sort of back-off timer, pushing the unexecuted requests back into the database if they couldn't execute after a predefined time limit. Is there a better way to maximize the number of TCP client connections per node in Erlang? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Mon Jan 18 10:19:26 2016 From: z@REDACTED (Danil Zagoskin) Date: Mon, 18 Jan 2016 12:19:26 +0300 Subject: [erlang-questions] Maximize Client TCP Sockets In-Reply-To: References: Message-ID: Hi! What is your current problem with lots of connections? Just in case, here are problems I've hit: - (emfile) max ports beam option: erl +Q 2000000 (check with 'erlang:system_info(port_limit)') - (emfile) ulimit (OS/shell feature): check 'ulimit -n'. Make it large enough (use google). Check 'max_fds' field in 'erlang:system_info(check_io)' - (eaddrnotavail) local TCP ports exausted: on Linux, check 'sysctl net.ipv4.ip_local_port_range'. Increase it. Use '{reuseaddr, true}' option and manually distribute local ports (one local port is OK to use with different remote {Addr, Port}s). More info on a problem with local TCP ports exausted: - Try TCP_TW_REUSE option http://stackoverflow.com/questions/6426253/tcp-tw-reuse-vs-tcp-tw-recycle-which-to-use-or-both - Use multiple addresses on your network interface (it's easy with IPv6). Use round-robin or random local address for every new connection. And if you use HTTP(S) to connect to a limited number of servers, it's better to use keep-alive connections. With them you don't spend time on TCP handshake and use much fewer local ports. On Mon, Jan 18, 2016 at 1:33 AM, scdelta1249 wrote: > I have an application where I need to make 10s of millions of short-lived > plain TCP (gen_tcp) or HTTP/HTTPS (httpc/gun/hackney) requests to different > servers. The parameters for the requests are stored in a database. My plan > is for a controlling gen_server on each node in the cluster to: > > * grab a group of requests from the database > * spawn a process for each request > * the spawned process connects, makes the request, processes the response > and shuts down the connection > > What is the best strategy to maximize the number of concurrent clients? My > current plan is to maintain a list of pending requests in the controlling > process (gen_server). As processes complete, they remove themselves from > the list. If they error out on initialization I'd implement some sort of > back-off timer, pushing the unexecuted requests back into the database if > they couldn't execute after a predefined time limit. > > Is there a better way to maximize the number of TCP client connections per > node in Erlang? > > Thanks. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickard@REDACTED Mon Jan 18 10:55:47 2016 From: rickard@REDACTED (Rickard Green) Date: Mon, 18 Jan 2016 10:55:47 +0100 Subject: [erlang-questions] Erlang on 64-bit ARM? In-Reply-To: References: Message-ID: On Sun, Jan 17, 2016 at 2:38 AM, Frank Hunleth wrote: > I was wondering if anyone uses Erlang on a 64-bit ARM platform > (aarch64)? The Buildroot project's CI servers are throwing linker > errors such as the following: > > LD /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/bin/aarch64-buildroot-linux-gnu/child_setup > AR /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/erts/emulator/pcre/obj/aarch64-buildroot-linux-gnu/opt/libepcre.a > LD /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/bin/aarch64-buildroot-linux-gnu/beam > ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): > In function `AO_double_compare_and_swap': > ethr_atomics.c:(.text+0x20): undefined reference to > `__atomic_compare_exchange_16' > ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): > In function `AO_double_load': > ethr_atomics.c:(.text+0x3c): undefined reference to `__atomic_load_16' > ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): > In function `ethr_dw_atomic_cmpxchg_acqb': > ethr_atomics.c:(.text+0x5e8): undefined reference to `__atomic_load_16' > > See http://autobuild.buildroot.net/results/0cd/0cd22eb74fa29e5a85bf897762e16ab3daf33962/build-end.log > for all of the error messages. > > I was able to reproduce the same errors on the 18.2.1 release as well. > Possibly confounding the situation is that Buildroot crosscompiles > Erlang. However, Erlang builds fine on all other platforms supported > by Buildroot, and my attempt at reading the atomic intrinsics code was > leading me down the path that aarch64 may not be supported. Could > somewhere verify whether this is the case? > > Thanks, > Frank > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions We unfortunately currently do not have an aarch64 machine here at OTP, so we have not tried to build on this arch. If you have a reasonably new gcc (at least 4.7 depending on arch) supporting the __atomic_* builtins these will be detected and used automatically when building OTP 18. If this is the case, you don't need libatomic_ops. If your gcc only supports __sync_* builtins, you want to use libatomic_ops instead. This since the __sync_* builtins issue unnecessary memory barriers. What does "erlang:system_info(ethread_info)" return if you build without libatomic_ops? Regards, Rickard -- Rickard Green, Erlang/OTP, Ericsson AB From fhunleth@REDACTED Mon Jan 18 22:32:18 2016 From: fhunleth@REDACTED (Frank Hunleth) Date: Mon, 18 Jan 2016 16:32:18 -0500 Subject: [erlang-questions] Erlang on 64-bit ARM? In-Reply-To: References: Message-ID: On Mon, Jan 18, 2016 at 4:55 AM, Rickard Green wrote: > On Sun, Jan 17, 2016 at 2:38 AM, Frank Hunleth > wrote: >> I was wondering if anyone uses Erlang on a 64-bit ARM platform >> (aarch64)? The Buildroot project's CI servers are throwing linker >> errors such as the following: >> >> LD /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/bin/aarch64-buildroot-linux-gnu/child_setup >> AR /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/erts/emulator/pcre/obj/aarch64-buildroot-linux-gnu/opt/libepcre.a >> LD /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/bin/aarch64-buildroot-linux-gnu/beam >> ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): >> In function `AO_double_compare_and_swap': >> ethr_atomics.c:(.text+0x20): undefined reference to >> `__atomic_compare_exchange_16' >> ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): >> In function `AO_double_load': >> ethr_atomics.c:(.text+0x3c): undefined reference to `__atomic_load_16' >> ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): >> In function `ethr_dw_atomic_cmpxchg_acqb': >> ethr_atomics.c:(.text+0x5e8): undefined reference to `__atomic_load_16' >> >> See http://autobuild.buildroot.net/results/0cd/0cd22eb74fa29e5a85bf897762e16ab3daf33962/build-end.log >> for all of the error messages. >> >> I was able to reproduce the same errors on the 18.2.1 release as well. >> Possibly confounding the situation is that Buildroot crosscompiles >> Erlang. However, Erlang builds fine on all other platforms supported >> by Buildroot, and my attempt at reading the atomic intrinsics code was >> leading me down the path that aarch64 may not be supported. Could >> somewhere verify whether this is the case? >> >> Thanks, >> Frank >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > We unfortunately currently do not have an aarch64 machine here at OTP, > so we have not tried to build on this arch. Same here. I'm using qemu to investigate this issue for Buildroot. > If you have a reasonably new gcc (at least 4.7 depending on arch) > supporting the __atomic_* builtins these will be detected and used > automatically when building OTP 18. If this is the case, you don't > need libatomic_ops. If your gcc only supports __sync_* builtins, you > want to use libatomic_ops instead. This since the __sync_* builtins > issue unnecessary memory barriers. Ok. I think there may be some confusion in Buildroot when libatomic_ops is necessary. The result is that --with-libatomic_ops was passed to ./configure on all platforms. It sounds like that logic is incorrect, and it would be better to not use libatomic_ops unless a platform/gcc version only works if it is available. Is this true? > > What does "erlang:system_info(ethread_info)" return if you build > without libatomic_ops? 1> erlang:system_info(ethread_info). [{"32-bit native atomics","gcc_atomic_and_sync_builtins", ["ethr_native_atomic32_or_retold()", "ethr_native_atomic32_and_retold()", "ethr_native_atomic32_read()", "ethr_native_atomic32_add_return()", "ethr_native_atomic32_set()", "ethr_native_atomic32_cmpxchg()"]}, {"64-bit native atomics","gcc_atomic_and_sync_builtins", ["ethr_native_atomic64_or_retold()", "ethr_native_atomic64_and_retold()", "ethr_native_atomic64_read()", "ethr_native_atomic64_add_return()", "ethr_native_atomic64_set()", "ethr_native_atomic64_cmpxchg()"]}, {"Double word native atomics","no",[]}, {"Native spinlocks","pthread"}, {"Native rw-spinlocks","native-atomics"}] Thanks, Frank > > Regards, > Rickard > -- > Rickard Green, Erlang/OTP, Ericsson AB From bengt.kleberg@REDACTED Tue Jan 19 09:22:48 2016 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 19 Jan 2016 09:22:48 +0100 Subject: [erlang-questions] clarify: EUnit ?assertError vs try/catch Message-ID: <569DF258.6040202@ericsson.com> Greetings, How should I use EUnit ?assertError to replace try/catch? I have erl -version Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 5.10.4.1 (I think it is R16B03) This EUnit test case pass: try apython( [{python_init, MFA}] ), erlang:throw( fail ) catch error:{badmatch, _} -> ok end When I try ?assertError( badmatch, apython([{python_init, MFA}]) ) it fails with: **error:{assertException_failed, [{module,ise_scheduler_gen_server_tests}, {line,424}, {expression,"apython ( [ { python_init , MFA } ] )"}, {pattern,"{ error , badmatch , [...] }"}, {unexpected_exception, {error, {badmatch, {error, {function_clause, [{ise_scheduler_gen_server,...},{...}|...]}}}, [{ise_scheduler_gen_server_tests,apython,2,[{file,...},{...}]}, {ise_scheduler_gen_server_tests,'-python_fail_test_/0-fun-0-', 0, [{...}|...]}, From samuelrivas@REDACTED Tue Jan 19 09:41:51 2016 From: samuelrivas@REDACTED (Samuel) Date: Tue, 19 Jan 2016 09:41:51 +0100 Subject: [erlang-questions] clarify: EUnit ?assertError vs try/catch In-Reply-To: <569DF258.6040202@ericsson.com> References: <569DF258.6040202@ericsson.com> Message-ID: Note that the error you are getting is not badmatch, but {badmatch, Stuff} (stuff being the right side of the failed match). In your first example the tests passes because you match against {badmatch, _}, but in the second you expect just the atom badmatch. If you do ?assertError({badmatch, _}, ...) it should work. On 19 January 2016 at 09:22, Bengt Kleberg wrote: > Greetings, > > How should I use EUnit ?assertError to replace try/catch? > I have erl -version > Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 5.10.4.1 > (I think it is R16B03) > > > This EUnit test case pass: > try > apython( [{python_init, MFA}] ), > erlang:throw( fail ) > > catch error:{badmatch, _} -> ok > > end > > > When I try > ?assertError( badmatch, apython([{python_init, MFA}]) ) > > it fails with: > **error:{assertException_failed, > [{module,ise_scheduler_gen_server_tests}, > {line,424}, > {expression,"apython ( [ { python_init , MFA } ] )"}, > {pattern,"{ error , badmatch , [...] }"}, > {unexpected_exception, > {error, > {badmatch, > {error, > {function_clause, > [{ise_scheduler_gen_server,...},{...}|...]}}}, > [{ise_scheduler_gen_server_tests,apython,2,[{file,...},{...}]}, > {ise_scheduler_gen_server_tests,'-python_fail_test_/0-fun-0-', > 0, > [{...}|...]}, > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Samuel From bengt.kleberg@REDACTED Tue Jan 19 09:47:56 2016 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 19 Jan 2016 09:47:56 +0100 Subject: [erlang-questions] clarify: EUnit ?assertError vs try/catch In-Reply-To: References: <569DF258.6040202@ericsson.com> Message-ID: <569DF83C.3060207@ericsson.com> Thank you. {badmatch, _} worked. On 01/19/2016 09:41 AM, Samuel wrote: > Note that the error you are getting is not badmatch, but {badmatch, > Stuff} (stuff being the right side of the failed match). In your first > example the tests passes because you match against {badmatch, _}, but > in the second you expect just the atom badmatch. If you do > ?assertError({badmatch, _}, ...) it should work. > > On 19 January 2016 at 09:22, Bengt Kleberg wrote: >> Greetings, >> >> How should I use EUnit ?assertError to replace try/catch? >> I have erl -version >> Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 5.10.4.1 >> (I think it is R16B03) >> >> >> This EUnit test case pass: >> try >> apython( [{python_init, MFA}] ), >> erlang:throw( fail ) >> >> catch error:{badmatch, _} -> ok >> >> end >> >> >> When I try >> ?assertError( badmatch, apython([{python_init, MFA}]) ) >> >> it fails with: >> **error:{assertException_failed, >> [{module,ise_scheduler_gen_server_tests}, >> {line,424}, >> {expression,"apython ( [ { python_init , MFA } ] )"}, >> {pattern,"{ error , badmatch , [...] }"}, >> {unexpected_exception, >> {error, >> {badmatch, >> {error, >> {function_clause, >> [{ise_scheduler_gen_server,...},{...}|...]}}}, >> [{ise_scheduler_gen_server_tests,apython,2,[{file,...},{...}]}, >> {ise_scheduler_gen_server_tests,'-python_fail_test_/0-fun-0-', >> 0, >> [{...}|...]}, >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > From rickard@REDACTED Tue Jan 19 10:41:17 2016 From: rickard@REDACTED (Rickard Green) Date: Tue, 19 Jan 2016 10:41:17 +0100 Subject: [erlang-questions] Erlang on 64-bit ARM? In-Reply-To: References: Message-ID: On Mon, Jan 18, 2016 at 10:32 PM, Frank Hunleth wrote: > On Mon, Jan 18, 2016 at 4:55 AM, Rickard Green wrote: >> On Sun, Jan 17, 2016 at 2:38 AM, Frank Hunleth >> wrote: >>> I was wondering if anyone uses Erlang on a 64-bit ARM platform >>> (aarch64)? The Buildroot project's CI servers are throwing linker >>> errors such as the following: >>> >>> LD /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/bin/aarch64-buildroot-linux-gnu/child_setup >>> AR /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/erts/emulator/pcre/obj/aarch64-buildroot-linux-gnu/opt/libepcre.a >>> LD /home/buildroot/autobuild/run/instance-0/output/build/erlang-17.5/bin/aarch64-buildroot-linux-gnu/beam >>> ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): >>> In function `AO_double_compare_and_swap': >>> ethr_atomics.c:(.text+0x20): undefined reference to >>> `__atomic_compare_exchange_16' >>> ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): >>> In function `AO_double_load': >>> ethr_atomics.c:(.text+0x3c): undefined reference to `__atomic_load_16' >>> ../lib/internal/aarch64-buildroot-linux-gnu/libethread.a(ethr_atomics.o): >>> In function `ethr_dw_atomic_cmpxchg_acqb': >>> ethr_atomics.c:(.text+0x5e8): undefined reference to `__atomic_load_16' >>> >>> See http://autobuild.buildroot.net/results/0cd/0cd22eb74fa29e5a85bf897762e16ab3daf33962/build-end.log >>> for all of the error messages. >>> >>> I was able to reproduce the same errors on the 18.2.1 release as well. >>> Possibly confounding the situation is that Buildroot crosscompiles >>> Erlang. However, Erlang builds fine on all other platforms supported >>> by Buildroot, and my attempt at reading the atomic intrinsics code was >>> leading me down the path that aarch64 may not be supported. Could >>> somewhere verify whether this is the case? >>> >>> Thanks, >>> Frank >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> We unfortunately currently do not have an aarch64 machine here at OTP, >> so we have not tried to build on this arch. > > Same here. I'm using qemu to investigate this issue for Buildroot. > >> If you have a reasonably new gcc (at least 4.7 depending on arch) >> supporting the __atomic_* builtins these will be detected and used >> automatically when building OTP 18. If this is the case, you don't >> need libatomic_ops. If your gcc only supports __sync_* builtins, you >> want to use libatomic_ops instead. This since the __sync_* builtins >> issue unnecessary memory barriers. > > Ok. I think there may be some confusion in Buildroot when > libatomic_ops is necessary. The result is that --with-libatomic_ops > was passed to ./configure on all platforms. It sounds like that logic > is incorrect, and it would be better to not use libatomic_ops unless a > platform/gcc version only works if it is available. Is this true? > Yes, I think so. >> >> What does "erlang:system_info(ethread_info)" return if you build >> without libatomic_ops? > > 1> erlang:system_info(ethread_info). > [{"32-bit native atomics","gcc_atomic_and_sync_builtins", > ["ethr_native_atomic32_or_retold()", > "ethr_native_atomic32_and_retold()", > "ethr_native_atomic32_read()", > "ethr_native_atomic32_add_return()", > "ethr_native_atomic32_set()", > "ethr_native_atomic32_cmpxchg()"]}, > {"64-bit native atomics","gcc_atomic_and_sync_builtins", > ["ethr_native_atomic64_or_retold()", > "ethr_native_atomic64_and_retold()", > "ethr_native_atomic64_read()", > "ethr_native_atomic64_add_return()", > "ethr_native_atomic64_set()", > "ethr_native_atomic64_cmpxchg()"]}, > {"Double word native atomics","no",[]}, > {"Native spinlocks","pthread"}, > {"Native rw-spinlocks","native-atomics"}] > It is using the __atomic_* builtins, so no need for libatomic_ops. Regards, Rickard > Thanks, > Frank >> >> Regards, >> Rickard >> -- >> Rickard Green, Erlang/OTP, Ericsson AB -- Rickard Green, Erlang/OTP, Ericsson AB From ingela.andin@REDACTED Tue Jan 19 18:06:40 2016 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 19 Jan 2016 18:06:40 +0100 Subject: [erlang-questions] Unorded certificate chains Message-ID: Hi! Anyone interested in testing the following branch for support of unordered cert chains? https://github.com/IngelaAndin/otp/tree/ia/ssl/unorded-cert-chain/OTP-12983 I am currently looking into the best way to test this in our automated tests and it might take some time to get a good setup and I am curios .... Regards Ingela Erlang/OTP Team Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From jamesnorton@REDACTED Wed Jan 20 04:24:57 2016 From: jamesnorton@REDACTED (James Norton) Date: Tue, 19 Jan 2016 22:24:57 -0500 Subject: [erlang-questions] Getting variable bindings using the int debug module Message-ID: I asked this on the Elixir Google Group, but have had no response. It's actually more Erlang oriented, so I'm reposting here. I have been experimenting with using the int module for debugging Elixir/Erlang, but I can't figure out how to examine bound variables. I attach a REPL process (meta process) to another process and use the functions in the int module to set breakpoints, step, and resume code, and that all works. I know there is the get_binding function, but the documentation says this is meant to be called from a conditional breakpoint condition function. In any case I don't know how to get the bindings to pass to this function. Looking at the source code in int.erl I see there are other functions that can be called from a meta process, including the various meta functions. My attempt at calling meta(Meta, bindings, Stack) after reaching a breakpoint in the process being debugged locks up the meta process. My call looked like this (Elixir): :int.meta(meta, :bindings, :nostack) Which is essentially int%meta(Meta, bindings, nostack) in Erlang (taken from the Erlang graphical debugger source code). I tried looking at the source code for the Erlang graphical debugger, but I can't quite follow it. Can someone explain to me how to get the bindings after reaching a break point and after stepping code? Thanks, James -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Wed Jan 20 11:04:12 2016 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 20 Jan 2016 13:04:12 +0300 Subject: [erlang-questions] Generate RSA private key (writing letsencrypt client) Message-ID: Hi. I cannot find a way to generate RSA private (and public) key from erlang. I've looked through public_key sources and have found Yuri's cutkey: https://github.com/yrashk/cutkey/blob/master/src/cutkey.erl I haven't found any code in public_key sources that does something like cutkey does. But I don't want to add extra dependency, maybe something has changed and it is possible to generate RSAPrivateKey. I'm writing client for letsencrypt and want fully automate all things without calling openssl via command line. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.gough@REDACTED Wed Jan 20 13:55:26 2016 From: ryan.gough@REDACTED (Ryan Gough) Date: Wed, 20 Jan 2016 12:55:26 +0000 Subject: [erlang-questions] Erlang/Elixir meetup in Manchester, UK Message-ID: Hello, We have an idea to start a regular Erlang / Elixir meetup in Manchester, UK, with a tentative "0th" meeting on Tuesday 26th Jan in order to do some planning etc. If you are interested, follow https://twitter.com/beamupmanc for details! Thanks, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Wed Jan 20 13:59:31 2016 From: serge@REDACTED (Serge Aleynikov) Date: Wed, 20 Jan 2016 07:59:31 -0500 Subject: [erlang-questions] Generate RSA private key (writing letsencrypt client) In-Reply-To: References: Message-ID: I faced the same issue and had to resort to the RSA_generate_key call in C. On Wed, Jan 20, 2016 at 5:04 AM, Max Lapshin wrote: > > Hi. I cannot find a way to generate RSA private (and public) key from > erlang. > > I've looked through public_key sources and have found Yuri's cutkey: > https://github.com/yrashk/cutkey/blob/master/src/cutkey.erl > > I haven't found any code in public_key sources that does something like > cutkey does. > > But I don't want to add extra dependency, maybe something has changed and > it is > possible to generate RSAPrivateKey. > > I'm writing client for letsencrypt and want fully automate all things > without calling openssl via command line. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz@REDACTED Wed Jan 20 14:34:26 2016 From: aschultz@REDACTED (Andreas Schultz) Date: Wed, 20 Jan 2016 14:34:26 +0100 Subject: [erlang-questions] Generate RSA private key (writing letsencrypt client) In-Reply-To: References: Message-ID: <569F8CE2.9090000@tpip.net> Hi, otp/lib/ssl/test/erl_make_certs.erl has the complete code in Erlang to generate RSA, DSA and EC certificates including their private keys. I'm not sure whether the generate primes and keys are safe for real certificates. You should check that before (re)using the code. Andreas On 01/20/2016 01:59 PM, Serge Aleynikov wrote: > I faced the same issue and had to resort to the RSA_generate_key call in C. > > On Wed, Jan 20, 2016 at 5:04 AM, Max Lapshin > wrote: > > > Hi. I cannot find a way to generate RSA private (and public) key from erlang. > > I've looked through public_key sources and have found Yuri's cutkey: > https://github.com/yrashk/cutkey/blob/master/src/cutkey.erl > > I haven't found any code in public_key sources that does something like cutkey does. > > But I don't want to add extra dependency, maybe something has changed and it is > possible to generate RSAPrivateKey. > > I'm writing client for letsencrypt and want fully automate all things without calling openssl via command line. > > _______________________________________________ > 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 tuncer.ayaz@REDACTED Wed Jan 20 17:01:26 2016 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Wed, 20 Jan 2016 17:01:26 +0100 Subject: [erlang-questions] HiPE on s390 In-Reply-To: References: Message-ID: On 17 January 2016 at 17:40, Matwey V. Kornilov wrote: > Hello, > > Is HiPE supported on s390? > I see the warning: > > "configure: WARNING: HiPE is not supported in 64-bit builds" > > but everything goes well until > > [ 5637s] === Entering application hipe > [ 5637s] make[3]: Entering directory > '/home/abuild/rpmbuild/BUILD/otp-OTP-18.2.2/lib/hipe/misc' > [ 5638s] ERLC ../ebin/hipe_consttab.beam > [ 5638s] ERLC ../ebin/hipe_gensym.beam > [ 5639s] /bin/sh: line 1: 4916 Segmentation fault erlc -W > +debug_info +warn_exported_vars +warn_missing_spec +warn_untyped_record > -o../ebin hipe_gensym.erl > [ 5639s] /bin/sh: line 1: 4917 Segmentation fault erlc -W > +debug_info +warn_exported_vars +warn_missing_spec +warn_untyped_record > -o../ebin hipe_consttab.erl > [ 5639s] > /home/abuild/rpmbuild/BUILD/otp-OTP-18.2.2/make/s390x-ibm-linux-gnu/otp.mk:123: > recipe for target '../ebin/hipe_gensym.beam' failed > [ 5639s] make[3]: *** [../ebin/hipe_gensym.beam] Error 139 I don't know how stable/complete it is, but you could try the ErLLVM backend, assuming it's all hooked up. IIRC, LLVM supports s390 since the 3.3 release. From jesper.louis.andersen@REDACTED Wed Jan 20 17:10:25 2016 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 20 Jan 2016 17:10:25 +0100 Subject: [erlang-questions] [ANN] Eministat 0.10.1 - benchmark statistics for Erlang In-Reply-To: References: Message-ID: On Sat, Jan 16, 2016 at 6:40 PM, Tuncer Ayaz wrote: So, what happened to ecriterion? > ecriterion was an earlier attempt. eministat fully replaces it and I have deleted the ecriterion repo. If you ever used ecritertion, you should definitely move to eministat :) -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Wed Jan 20 18:02:49 2016 From: ingela.andin@REDACTED (Ingela Andin) Date: Wed, 20 Jan 2016 18:02:49 +0100 Subject: [erlang-questions] Generate RSA private key (writing letsencrypt client) In-Reply-To: <569F8CE2.9090000@tpip.net> References: <569F8CE2.9090000@tpip.net> Message-ID: Hi! 2016-01-20 14:34 GMT+01:00 Andreas Schultz : > Hi, > > otp/lib/ssl/test/erl_make_certs.erl has the complete code in Erlang > to generate RSA, DSA and EC certificates including their private keys. > > I'm not sure whether the generate primes and keys are safe for real > certificates. You should check that before (re)using the code. > > That code was only written for testing purposes and should not be relied on for cryptographic safety The public_key application generates EC and DH keys using the crypto application, this function could easily be extende to generate RSA and DSA keys too if the crypto application is extended to call the approriate functions in the openSSL cryptolib. This is acctually the long term plan, but not the top priority. So PR anyone? Regards Ingela Erlang/OTP team - Ericsson AB > Andreas > > On 01/20/2016 01:59 PM, Serge Aleynikov wrote: > >> I faced the same issue and had to resort to the RSA_generate_key call in >> C. >> >> On Wed, Jan 20, 2016 at 5:04 AM, Max Lapshin > > wrote: >> >> >> Hi. I cannot find a way to generate RSA private (and public) key >> from erlang. >> >> I've looked through public_key sources and have found Yuri's cutkey: >> https://github.com/yrashk/cutkey/blob/master/src/cutkey.erl >> >> I haven't found any code in public_key sources that does something >> like cutkey does. >> >> But I don't want to add extra dependency, maybe something has changed >> and it is >> possible to generate RSAPrivateKey. >> >> I'm writing client for letsencrypt and want fully automate all things >> without calling openssl via command line. >> >> _______________________________________________ >> 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 kostis@REDACTED Thu Jan 21 10:40:57 2016 From: kostis@REDACTED (Kostis Sagonas) Date: Thu, 21 Jan 2016 10:40:57 +0100 Subject: [erlang-questions] HiPE on s390 In-Reply-To: References: Message-ID: <56A0A7A9.3060800@cs.ntua.gr> On 01/20/2016 05:01 PM, Tuncer Ayaz wrote: > On 17 January 2016 at 17:40, Matwey V. Kornilov wrote: >> > >> >Is HiPE supported on s390? >> >I see the warning: >> > >> >"configure: WARNING: HiPE is not supported in 64-bit builds" >> > >> >but everything goes well until ... >> > > I don't know how stable/complete it is, but you could try the ErLLVM > backend, assuming it's all hooked up. IIRC, LLVM supports s390 since > the 3.3 release. The ErLLVM backend of HiPE, which for the last two years or so is part of Erlang/OTP, currently works only for x86 and x86_64 architectures running Linux/Unix. It requires LLVM version 3.5 or 3.6 -- we need to provide a small fix in order to work for later LLVM releases because the format of instructions was changed. As Mikael wrote, we have no plans to support HiPE on the s390. Kostis From mrtndimitrov@REDACTED Thu Jan 21 15:56:13 2016 From: mrtndimitrov@REDACTED (Martin Koroudjiev) Date: Thu, 21 Jan 2016 16:56:13 +0200 Subject: [erlang-questions] Integrating lager into our app Message-ID: <56A0F18D.8010205@gmail.com> Hello, I am trying to include lager into our application but I am having problems. I include the lager ebin directory on startup with: -pa "../lib/lager-2.0.3/ebin" Then I start lager with: lager:start(). I define a constant as: -define(dbg(Fmt), lager:debug(Fmt)). But when I try to use it in the code: ?dbg("Hello"). it says: ** exception error: undefined function lager:debug/1 I've checked lager's help page on github and saw that a parse_transform must be set to lager_transform. Why is this needed? And how to actually do it? I compile my source files with erlc and pass the transform option with +"{parse_transform, lager_transform}" but then the code doesn't compile because lager_transform module is not present at that time. Thank you, Martin From mrtndimitrov@REDACTED Thu Jan 21 16:04:05 2016 From: mrtndimitrov@REDACTED (Martin Koroudjiev) Date: Thu, 21 Jan 2016 17:04:05 +0200 Subject: [erlang-questions] Integrating lager into our app Message-ID: <56A0F365.2010004@gmail.com> Hello, I am trying to include lager into our application but I am having problems. I include the lager ebin directory on startup with: -pa "../lib/lager-2.0.3/ebin" Then I start lager with: lager:start(). I define a constant as: -define(dbg(Fmt), lager:debug(Fmt)). But when I try to use it in the code: ?dbg("Hello"). it says: ** exception error: undefined function lager:debug/1 I've checked lager's help page on github and saw that a parse_transform must be set to lager_transform. Why is this needed? And how to actually do it? I compile my source files with erlc and pass the transform option with +"{parse_transform, lager_transform}" but then the code doesn't compile because lager_transform module is not present at that time. Thank you, Martin From roger@REDACTED Thu Jan 21 16:12:00 2016 From: roger@REDACTED (Roger Lipscombe) Date: Thu, 21 Jan 2016 15:12:00 +0000 Subject: [erlang-questions] Integrating lager into our app In-Reply-To: <56A0F365.2010004@gmail.com> References: <56A0F365.2010004@gmail.com> Message-ID: You have to run the compiler with -pa ../lib/lager-2.0.3/ebin as well, so that it knows where to find the parse transform. On 21 January 2016 at 15:04, Martin Koroudjiev wrote: > Hello, > > I am trying to include lager into our application but I am having > problems. I include the lager ebin directory on startup with: -pa > "../lib/lager-2.0.3/ebin" > Then I start lager with: lager:start(). > I define a constant as: -define(dbg(Fmt), lager:debug(Fmt)). > But when I try to use it in the code: > ?dbg("Hello"). > it says: ** exception error: undefined function lager:debug/1 > > I've checked lager's help page on github and saw that a parse_transform > must be set to lager_transform. Why is this needed? > > And how to actually do it? I compile my source files with erlc and pass > the transform option with +"{parse_transform, lager_transform}" but then > the code doesn't compile because lager_transform module is not present > at that time. > > Thank you, > Martin > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From seancribbs@REDACTED Thu Jan 21 16:12:25 2016 From: seancribbs@REDACTED (Sean Cribbs) Date: Thu, 21 Jan 2016 09:12:25 -0600 Subject: [erlang-questions] Integrating lager into our app In-Reply-To: <56A0F18D.8010205@gmail.com> References: <56A0F18D.8010205@gmail.com> Message-ID: What the message is telling you is that lager:debug() is not a function. Indeed, if you read the source of the lager module, it is not. The parse_transform is needed to inject code into the spot where you call lager:debug() and replace it with real calls. It is designed this way so as to provide an unsurprising interface to the developer (logging at specific severity levels), and so that it can filter out unconsumable log messages at the callsite rather than filtering them out in the gen_event that receives the log messages. Essentially, the code injection transforms the function name ('debug' in this case) into the severity level, adds some metadata to the message (line, module, pid, etc), and then does a few checks to verify that the message is loggable. For instance, it will check whether the log sink process is running, and that there exists at least one output handler that is consuming that severity or lower, or that there is an existing trace that matches. Only *then* will it log the message. I would recommend using rebar3 or similar tools that can apply the parse_transform across all of your code, instead of calling erlc directly. On Thu, Jan 21, 2016 at 8:56 AM, Martin Koroudjiev wrote: > Hello, > > I am trying to include lager into our application but I am having > problems. I include the lager ebin directory on startup with: -pa > "../lib/lager-2.0.3/ebin" > Then I start lager with: lager:start(). > I define a constant as: -define(dbg(Fmt), lager:debug(Fmt)). > But when I try to use it in the code: > ?dbg("Hello"). > it says: ** exception error: undefined function lager:debug/1 > > I've checked lager's help page on github and saw that a parse_transform > must be set to lager_transform. Why is this needed? > > And how to actually do it? I compile my source files with erlc and pass > the transform option with +"{parse_transform, lager_transform}" but then > the code doesn't compile because lager_transform module is not present > at that time. > > Thank you, > Martin > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrtndimitrov@REDACTED Thu Jan 21 16:40:46 2016 From: mrtndimitrov@REDACTED (Martin Koroudjiev) Date: Thu, 21 Jan 2016 17:40:46 +0200 Subject: [erlang-questions] Integrating lager into our app In-Reply-To: References: <56A0F18D.8010205@gmail.com> Message-ID: <56A0FBFE.9070002@gmail.com> Thank you very much for the explanation. Regards, Martin On 1/21/2016 5:12 PM, Sean Cribbs wrote: > What the message is telling you is that lager:debug() is not a > function. Indeed, if you read the source of the lager module, it is not. > > The parse_transform is needed to inject code into the spot where you > call lager:debug() and replace it with real calls. It is designed this > way so as to provide an unsurprising interface to the developer > (logging at specific severity levels), and so that it can filter out > unconsumable log messages at the callsite rather than filtering them > out in the gen_event that receives the log messages. Essentially, the > code injection transforms the function name ('debug' in this case) > into the severity level, adds some metadata to the message (line, > module, pid, etc), and then does a few checks to verify that the > message is loggable. For instance, it will check whether the log sink > process is running, and that there exists at least one output handler > that is consuming that severity or lower, or that there is an existing > trace that matches. Only *then* will it log the message. > > I would recommend using rebar3 or similar tools that can apply the > parse_transform across all of your code, instead of calling erlc directly. > > > > On Thu, Jan 21, 2016 at 8:56 AM, Martin Koroudjiev > > wrote: > > Hello, > > I am trying to include lager into our application but I am having > problems. I include the lager ebin directory on startup with: -pa > "../lib/lager-2.0.3/ebin" > Then I start lager with: lager:start(). > I define a constant as: -define(dbg(Fmt), lager:debug(Fmt)). > But when I try to use it in the code: > ?dbg("Hello"). > it says: ** exception error: undefined function lager:debug/1 > > I've checked lager's help page on github and saw that a > parse_transform > must be set to lager_transform. Why is this needed? > > And how to actually do it? I compile my source files with erlc and > pass > the transform option with +"{parse_transform, lager_transform}" > but then > the code doesn't compile because lager_transform module is not present > at that time. > > Thank you, > Martin > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrtndimitrov@REDACTED Thu Jan 21 16:41:33 2016 From: mrtndimitrov@REDACTED (Martin Koroudjiev) Date: Thu, 21 Jan 2016 17:41:33 +0200 Subject: [erlang-questions] Integrating lager into our app In-Reply-To: References: <56A0F365.2010004@gmail.com> Message-ID: <56A0FC2D.4040708@gmail.com> That made it work. Thank you very much! Regards, Martin On 1/21/2016 5:12 PM, Roger Lipscombe wrote: > You have to run the compiler with -pa ../lib/lager-2.0.3/ebin as well, > so that it knows where to find the parse transform. > > On 21 January 2016 at 15:04, Martin Koroudjiev wrote: >> Hello, >> >> I am trying to include lager into our application but I am having >> problems. I include the lager ebin directory on startup with: -pa >> "../lib/lager-2.0.3/ebin" >> Then I start lager with: lager:start(). >> I define a constant as: -define(dbg(Fmt), lager:debug(Fmt)). >> But when I try to use it in the code: >> ?dbg("Hello"). >> it says: ** exception error: undefined function lager:debug/1 >> >> I've checked lager's help page on github and saw that a parse_transform >> must be set to lager_transform. Why is this needed? >> >> And how to actually do it? I compile my source files with erlc and pass >> the transform option with +"{parse_transform, lager_transform}" but then >> the code doesn't compile because lager_transform module is not present >> at that time. >> >> Thank you, >> Martin >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From tuncer.ayaz@REDACTED Thu Jan 21 17:18:07 2016 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Thu, 21 Jan 2016 17:18:07 +0100 Subject: [erlang-questions] HiPE on s390 In-Reply-To: <56A0A7A9.3060800@cs.ntua.gr> References: <56A0A7A9.3060800@cs.ntua.gr> Message-ID: On 21 January 2016 at 10:40, Kostis Sagonas wrote: > The ErLLVM backend of HiPE, which for the last two years or so is > part of Erlang/OTP, currently works only for x86 and x86_64 > architectures running Linux/Unix. It requires LLVM version 3.5 or > 3.6 -- we need to provide a small fix in order to work for later > LLVM releases because the format of instructions was changed. If all that's needed are llc and opt, then it might make sense to build+use the supported version as part of otp, in order to not be confronted with an incompatible LLVM install in $PATH. From mrtndimitrov@REDACTED Thu Jan 21 20:00:20 2016 From: mrtndimitrov@REDACTED (Martin Koroudjiev) Date: Thu, 21 Jan 2016 21:00:20 +0200 Subject: [erlang-questions] What is the compile option equivalent to -pa switch? Message-ID: <56A12AC4.6010909@gmail.com> Hello, I am trying to compile an app with rebar that depends on lager. lager is placed in a lib folder. If I do erlc -pa "../lager/ebin" all is good. But can't make it work with rebar. Is there an option equivalent to -pa that I can pass to the compile module? I tried rebar's lib_dirs option but doesn't seem to work. Thank you, Martin From max.lapshin@REDACTED Thu Jan 21 21:20:54 2016 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 21 Jan 2016 23:20:54 +0300 Subject: [erlang-questions] Generate RSA private key (writing letsencrypt client) In-Reply-To: References: <569F8CE2.9090000@tpip.net> Message-ID: I will try to make PR =) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark@REDACTED Fri Jan 22 17:43:23 2016 From: mark@REDACTED (Mark Steele) Date: Fri, 22 Jan 2016 11:43:23 -0500 Subject: [erlang-questions] Erlang TLS distribution... again... Message-ID: Hello list, Once again I'm banging my head against TLS distribution in Erlang. This time around, everything is almost working. My problem is now getting the certificate validation to work. As soon as I add ' server_verify verify_peer ' to my ssl options on the server-side, the connection is failing. Server: SSL: certify: ssl_connection.erl:398:Fatal error: handshake failure Client: SSL: cipher: ssl_alert.erl:92:Fatal error: handshake failure The client and server certs are the same. I can use the same certs with Cowboy/Ranch or plain ssl sockets (with the verify_peer option) and it works flawlessly, so it would appear that it's something specific to TLS distribution that's wonky. Running on Erlang/OTP 17 [erts-6.4] Any help would be appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrtndimitrov@REDACTED Fri Jan 22 17:54:26 2016 From: mrtndimitrov@REDACTED (Martin Koroudjiev) Date: Fri, 22 Jan 2016 18:54:26 +0200 Subject: [erlang-questions] When does lager logs into crash.log? Message-ID: <56A25EC2.8090702@gmail.com> Hello, I've set lager with the following options: {crash_log, "../logs/crash.log"}, {error_logger_redirect, true}, and had a function with deliberate error: dummy = application:get_env(myapp, test). This results in badmatch. But there is no entry in crash.log. I had configured another log file warning.log that gets populated with a one-liner but I would like to see the detailed report in crash.log. What am I missing? Do I understand correctly that crash.log should contain detailed report of all crashes? I also tried with lager:critical() and crash.log doesn't get populated. Thank you, Martin From magnus@REDACTED Fri Jan 22 18:28:42 2016 From: magnus@REDACTED (Magnus Henoch) Date: Fri, 22 Jan 2016 17:28:42 +0000 Subject: [erlang-questions] Erlang TLS distribution... again... In-Reply-To: References: Message-ID: If I read the source code correctly, this error occurs when the server expects the client to present a certificate, but the client doesn't present one. What options do you use when starting the client? Regards, Magnus On Fri, Jan 22, 2016 at 4:43 PM, Mark Steele wrote: > Hello list, > > Once again I'm banging my head against TLS distribution in Erlang. > > This time around, everything is almost working. > > My problem is now getting the certificate validation to work. > > As soon as I add ' server_verify verify_peer ' to my ssl options on the > server-side, the connection is failing. > > Server: > > SSL: certify: ssl_connection.erl:398:Fatal error: handshake failure > > Client: > > SSL: cipher: ssl_alert.erl:92:Fatal error: handshake failure > > > The client and server certs are the same. > > I can use the same certs with Cowboy/Ranch or plain ssl sockets (with the > verify_peer option) and it works flawlessly, so it would appear that it's > something specific to TLS distribution that's wonky. > > Running on Erlang/OTP 17 [erts-6.4] > > Any help would be appreciated. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark@REDACTED Fri Jan 22 18:51:04 2016 From: mark@REDACTED (Mark Steele) Date: Fri, 22 Jan 2016 12:51:04 -0500 Subject: [erlang-questions] Erlang TLS distribution... again... In-Reply-To: References: Message-ID: The server start-up command: /root/cinched/rel/cinched/bin/erl +P 256000 -env ERL_MAX_ETS_TABLES 256000 -env ERL_CRASH_DUMP /dev/null -env ERL_FULLSWEEP_AFTER 0 -env ERL_MAX_PORTS 65536 +A 64 +K true +W w -smp auto +Mlpm all -proto_dist inet_tls -ssl_dist_opt client_cacertfile /var/lib/cinched/cacert.pem client_keyfile /var/lib/cinched/key.pem client_certfile /var/lib/cinched/client.pem server_cacertfile /var/lib/cinched/cacert.pem server_keyfile /var/lib/cinched/key.pem server_certfile /var/lib/cinched/cert.pem server_fail_if_no_peer_cert true server_depth 1 client_depth 1 server_verify verify_peer -name cinched@REDACTED -config /var/lib/cinched/sys.config -setup verify_directories false The client start-up command: /root/cinched/rel/cinched/bin/erl -env ERL_CRASH_DUMP /dev/null +K true +W w -smp disable +Mlpm all -proto_dist inet_tls -ssl_dist_opt client_cacertfile /var/lib/cinched/cacert.pem client_keyfile /var/lib/cinched/k.pem client_certfile /var/lib/cinched/client.pem server_cacertfile /var/lib/cinched/cacert.pem server_keyfile /var/lib/cinched/key.pem server_certfile /var/lib/cinched/cert.pem -name rpc@REDACTED -boot /root/cinched/rel/cinched/bin/start_clean -extra --target cinched@REDACTED --module cinched_console --function status -u root The default boot file and start_clean both start the same apps (crypto,asn1,public_key,ssl). Cheers, Mark On Fri, Jan 22, 2016 at 12:28 PM, Magnus Henoch wrote: > If I read the source code correctly, this error occurs when the server > expects the client to present a certificate, but the client doesn't present > one. What options do you use when starting the client? > > Regards, > Magnus > > > On Fri, Jan 22, 2016 at 4:43 PM, Mark Steele > wrote: > >> Hello list, >> >> Once again I'm banging my head against TLS distribution in Erlang. >> >> This time around, everything is almost working. >> >> My problem is now getting the certificate validation to work. >> >> As soon as I add ' server_verify verify_peer ' to my ssl options on the >> server-side, the connection is failing. >> >> Server: >> >> SSL: certify: ssl_connection.erl:398:Fatal error: handshake failure >> >> Client: >> >> SSL: cipher: ssl_alert.erl:92:Fatal error: handshake failure >> >> >> The client and server certs are the same. >> >> I can use the same certs with Cowboy/Ranch or plain ssl sockets (with the >> verify_peer option) and it works flawlessly, so it would appear that it's >> something specific to TLS distribution that's wonky. >> >> Running on Erlang/OTP 17 [erts-6.4] >> >> Any help would be appreciated. >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathaniel@REDACTED Fri Jan 22 18:55:08 2016 From: nathaniel@REDACTED (Nathaniel Waisbrot) Date: Fri, 22 Jan 2016 12:55:08 -0500 Subject: [erlang-questions] When does lager logs into crash.log? In-Reply-To: <56A25EC2.8090702@gmail.com> References: <56A25EC2.8090702@gmail.com> Message-ID: > dummy = application:get_env(myapp, test). > > This results in badmatch. But there is no entry in crash.log. I had > configured another log file warning.log that gets populated with a > one-liner but I would like to see the detailed report in crash.log. The crash.log comes from things that use the error_logger (http://erlang.org/doc/man/error_logger.html ). Typically, this is OTP applications crashing. Try putting that badmatch inside of a gen_server's handle_cast/3 method and you should see lager's handling (and if you disable crash logging in lager you can see what the default error_logger does with it). -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: Message signed with OpenPGP using GPGMail URL: From mrtndimitrov@REDACTED Fri Jan 22 22:11:01 2016 From: mrtndimitrov@REDACTED (Martin Koroudjiev) Date: Fri, 22 Jan 2016 23:11:01 +0200 Subject: [erlang-questions] When does lager logs into crash.log? In-Reply-To: References: <56A25EC2.8090702@gmail.com> Message-ID: <56A29AE5.9020707@gmail.com> Hello, from what I read about the error_logger "Error, warning and info events are sent to the error logger from the Erlang runtime system and the different Erlang/OTP applications." So, I guess, errors in non-supervised code are also sent to the error_logger. But not to lager's crash file. Actually this badmatch error is not reported anywhere. How can I make lager report it? Regards, Martin On 1/22/2016 7:55 PM, Nathaniel Waisbrot wrote: >> dummy = application:get_env(myapp, test). >> >> This results in badmatch. But there is no entry in crash.log. I had >> configured another log file warning.log that gets populated with a >> one-liner but I would like to see the detailed report in crash.log. > > > The crash.log comes from things that use the error_logger > (http://erlang.org/doc/man/error_logger.html). Typically, this is OTP > applications crashing. > > Try putting that badmatch inside of a gen_server's handle_cast/3 > method and you should see lager's handling (and if you disable crash > logging in lager you can see what the default error_logger does with it). > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anders.nygren@REDACTED Sat Jan 23 00:04:51 2016 From: anders.nygren@REDACTED (Anders Nygren) Date: Fri, 22 Jan 2016 17:04:51 -0600 Subject: [erlang-questions] When does lager logs into crash.log? In-Reply-To: <56A29AE5.9020707@gmail.com> References: <56A25EC2.8090702@gmail.com> <56A29AE5.9020707@gmail.com> Message-ID: I don't know about the lager part, but, if I remember right, to get the crash reports SASL needs to be started On Fri, Jan 22, 2016 at 3:11 PM, Martin Koroudjiev wrote: > Hello, > > from what I read about the error_logger "Error, warning and info events > are sent to the error logger from the Erlang runtime system and the > different Erlang/OTP applications." So, I guess, errors in non-supervised > code are also sent to the error_logger. But not to lager's crash file. > Actually this badmatch error is not reported anywhere. How can I make lager > report it? > > Regards, > Martin > > > On 1/22/2016 7:55 PM, Nathaniel Waisbrot wrote: > > dummy = application:get_env(myapp, test). > > This results in badmatch. But there is no entry in crash.log. I had > configured another log file warning.log that gets populated with a > one-liner but I would like to see the detailed report in crash.log. > > > > The crash.log comes from things that use the error_logger ( > http://erlang.org/doc/man/error_logger.html). Typically, this is OTP > applications crashing. > > Try putting that badmatch inside of a gen_server's handle_cast/3 method > and you should see lager's handling (and if you disable crash logging in > lager you can see what the default error_logger does with it). > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pguyot@REDACTED Sat Jan 23 17:28:08 2016 From: pguyot@REDACTED (Paul Guyot) Date: Sat, 23 Jan 2016 17:28:08 +0100 Subject: [erlang-questions] Erlang TLS distribution... again... In-Reply-To: References: Message-ID: <2EBD9ABA-F392-4A56-9770-C2D4424D01A9@kallisys.net> > Date: Fri, 22 Jan 2016 12:51:04 -0500 > From: Mark Steele > Subject: Re: [erlang-questions] Erlang TLS distribution... again... > > The server start-up command: > > /root/cinched/rel/cinched/bin/erl +P 256000 -env ERL_MAX_ETS_TABLES 256000 > -env ERL_CRASH_DUMP /dev/null -env ERL_FULLSWEEP_AFTER 0 -env ERL_MAX_PORTS > 65536 +A 64 +K true +W w -smp auto +Mlpm all -proto_dist inet_tls > -ssl_dist_opt client_cacertfile /var/lib/cinched/cacert.pem client_keyfile > /var/lib/cinched/key.pem client_certfile /var/lib/cinched/client.pem > server_cacertfile /var/lib/cinched/cacert.pem server_keyfile > /var/lib/cinched/key.pem server_certfile /var/lib/cinched/cert.pem > server_fail_if_no_peer_cert true server_depth 1 client_depth 1 > server_verify verify_peer -name cinched@REDACTED -config > /var/lib/cinched/sys.config -setup verify_directories false > > The client start-up command: > > /root/cinched/rel/cinched/bin/erl -env ERL_CRASH_DUMP /dev/null +K true +W > w -smp disable +Mlpm all -proto_dist inet_tls -ssl_dist_opt > client_cacertfile /var/lib/cinched/cacert.pem client_keyfile > /var/lib/cinched/k.pem client_certfile /var/lib/cinched/client.pem > server_cacertfile /var/lib/cinched/cacert.pem server_keyfile > /var/lib/cinched/key.pem server_certfile /var/lib/cinched/cert.pem -name > rpc@REDACTED -boot /root/cinched/rel/cinched/bin/start_clean -extra > --target cinched@REDACTED --module cinched_console --function status -u > root > > The default boot file and start_clean both start the same apps > (crypto,asn1,public_key,ssl). If it works without verify_peer then the boot files are correct. You could have exactly the same ssl_dist_opt options for both clients and server as client will consider client_ settings and server will consider server_ settings. Is the following a typo : server : > client_keyfile /var/lib/cinched/key.pem client : > client_keyfile /var/lib/cinched/k.pem ? Also, you might need to set server_depth and client_depth to 2. You currently set it to 1 for server (and therefore client_depth is just not used, but this is the default anyway). You can also add "client_verify verify_peer" for the client to make sure that the server's certificate is indeed signed by the CA certificate. Paul From vasdeveloper@REDACTED Sat Jan 23 21:23:16 2016 From: vasdeveloper@REDACTED (Theepan) Date: Sun, 24 Jan 2016 01:53:16 +0530 Subject: [erlang-questions] Adding binary data to a list Message-ID: Team, If I add the same binary data to different lists, will it be copied? I know for a fact that binary data are referenced, but not sure in list making case. Thanks, Theepan -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasdeveloper@REDACTED Sat Jan 23 21:32:38 2016 From: vasdeveloper@REDACTED (Theepan) Date: Sun, 24 Jan 2016 02:02:38 +0530 Subject: [erlang-questions] COWBOY Message-ID: Team, The following is the code fragment to read the body of a multipart data (as per the documentation), when it is the contents of a uploaded file. stream_file(Req) -> case cowboy_req:part_body(Req) of {ok, Body, Req2} -> {ok, Body, Req2}; {more, Body, Req2} -> stream_file(Req2) end. The question is, when the {more, Body, Req2} case clause is reached, should the 'Body' need to get concatenated like <>, OR when looped, the library collects the next pieces of chunks into the 'Body' automatically? Thanks, Theepan -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Sat Jan 23 22:01:16 2016 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Sat, 23 Jan 2016 22:01:16 +0100 Subject: [erlang-questions] COWBOY In-Reply-To: References: Message-ID: <56A3EA1C.8000109@ninenines.eu> Nothing automatic. It's like this so you can process on the fly and avoid having a gigabyte file in memory. On 01/23/2016 09:32 PM, Theepan wrote: > Team, > > The following is the code fragment to read the body of a multipart data > (as per the documentation), when it is the contents of a uploaded file. > > stream_file(Req) -> > case cowboy_req:part_body(Req) of > {ok, Body, Req2} -> > {ok, Body, Req2}; > {more, Body, Req2} -> > stream_file(Req2) > end. > > The question is, when the {more, Body, Req2} case clause is reached, > should the 'Body' need to get concatenated like < Body/binary>>, OR when looped, the library collects the next pieces of > chunks into the 'Body' automatically? > > Thanks, > Theepan > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From vasdeveloper@REDACTED Sun Jan 24 13:44:09 2016 From: vasdeveloper@REDACTED (Theepan) Date: Sun, 24 Jan 2016 18:14:09 +0530 Subject: [erlang-questions] COWBOY In-Reply-To: <56A3EA1C.8000109@ninenines.eu> References: <56A3EA1C.8000109@ninenines.eu> Message-ID: That makes sense. Thanks. Regards, Theepan On Sun, Jan 24, 2016 at 2:31 AM, Lo?c Hoguin wrote: > Nothing automatic. > > It's like this so you can process on the fly and avoid having a gigabyte > file in memory. > > > On 01/23/2016 09:32 PM, Theepan wrote: > >> Team, >> >> The following is the code fragment to read the body of a multipart data >> (as per the documentation), when it is the contents of a uploaded file. >> >> stream_file(Req) -> >> case cowboy_req:part_body(Req) of >> {ok, Body, Req2} -> >> {ok, Body, Req2}; >> {more, Body, Req2} -> >> stream_file(Req2) >> end. >> >> The question is, when the {more, Body, Req2} case clause is reached, >> should the 'Body' need to get concatenated like <> Body/binary>>, OR when looped, the library collects the next pieces of >> chunks into the 'Body' automatically? >> >> Thanks, >> Theepan >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Mon Jan 25 00:38:37 2016 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 25 Jan 2016 12:38:37 +1300 Subject: [erlang-questions] Adding binary data to a list In-Reply-To: References: Message-ID: <64BFE48A-29F9-43E3-8292-4467CA3AAC26@cs.otago.ac.nz> On 24/01/2016, at 9:23 am, Theepan wrote: > If I add the same binary data to different lists, will it be copied? I know for a fact that binary data are referenced, but not sure in list making case. Suppose you have this code: X = ...any arbitrary Erlang term... P = ...any list you like... Q = ...any other list you like... P1 = [X|P], Q1 = Q ++ [X] X is not copied, no matter what it is, no matter how small, no matter how big. Making P1 copies nothing, just creates one new pair. Making Q1 copies the spine of Q, but not the elements of Q, and not X. You are probably thinking about the fact that large binaries are *not* copied when they are sent to another process, and that they are reference counted for that purpose. From pavananms@REDACTED Mon Jan 25 13:45:58 2016 From: pavananms@REDACTED (Pavanan M S) Date: Mon, 25 Jan 2016 18:15:58 +0530 Subject: [erlang-questions] Building epqsql driver. Message-ID: Hi all, I have downloaded and built the one of the *epgsql *repositories from github ( https://github.com/semiocast/pgsql ). Although I ran rebar3 compile . No relaease is found. I also tried other methods. How can I run this application? -------------- next part -------------- An HTML attachment was scrubbed... URL: From zkessin@REDACTED Mon Jan 25 15:09:39 2016 From: zkessin@REDACTED (Zachary Kessin) Date: Mon, 25 Jan 2016 16:09:39 +0200 Subject: [erlang-questions] possible dialyzer bug Message-ID: I have a strange dialyzer problem, I have this code case convert_map_to_record(MapId, UserId, ClientId, Terms) of {ok, MapRecord} -> %.... {true, ReqData1, MapRecord}; {error, Error} -> lager:error("Error ~p", [Error]), {{error, 405}, ReqData, State} end and dialyzer is saying this _build/default/lib/frontend/src/wm_map.erl 100: The pattern {'ok', MapRecord} can never match the type {'error',_} With what is line 100 being the line with the red background, what is strange is that that the error case is covered in the case statement Zach -- Zach Kessin Your CRM Link Twitter: @zkessin Skype: zachkessin ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From fernando.benavides@REDACTED Mon Jan 25 15:14:26 2016 From: fernando.benavides@REDACTED (Brujo Benavides) Date: Mon, 25 Jan 2016 11:14:26 -0300 Subject: [erlang-questions] possible dialyzer bug In-Reply-To: References: Message-ID: <4D798250-F29F-4A85-917E-CDEE4A82514F@inakanetworks.com> Zach: Dialyzer is basically telling you that, with the parameters you?re using MapId, UserId, ClientId, Terms), the function convert_map_to_record/4 can never return {ok, _}. Without the code preceding the function call and the code for convert_map_to_record/4, it?ll be hard to tell you exactly what?s going on. Cheers! > On Jan 25, 2016, at 11:09, Zachary Kessin wrote: > > I have a strange dialyzer problem, I have this code > > case convert_map_to_record(MapId, UserId, ClientId, Terms) of > {ok, MapRecord} -> > %.... > {true, ReqData1, MapRecord}; > {error, Error} -> > lager:error("Error ~p", [Error]), > {{error, 405}, ReqData, State} > end > > and dialyzer is saying this > > _build/default/lib/frontend/src/wm_map.erl > 100: The pattern {'ok', MapRecord} can never match the type {'error',_} > > With what is line 100 being the line with the red background, what is strange is that that the error case is covered in the case statement > > Zach > -- > Zach Kessin > Your CRM Link > Twitter: @zkessin > Skype: zachkessin > ? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From kostis@REDACTED Mon Jan 25 15:14:59 2016 From: kostis@REDACTED (Kostis Sagonas) Date: Mon, 25 Jan 2016 15:14:59 +0100 Subject: [erlang-questions] possible dialyzer bug In-Reply-To: References: Message-ID: <56A62DE3.2080002@cs.ntua.gr> On 01/25/2016 03:09 PM, Zachary Kessin wrote: > I have a strange dialyzer problem, I have this code > > case convert_map_to_record(MapId, UserId, ClientId, > Terms) of > {ok, MapRecord} -> > %.... > {true, ReqData1, MapRecord}; > {error, Error} -> > lager:error("Error ~p", [Error]), > {{error, 405}, ReqData, State} > end > > and dialyzer is saying this > > _build/default/lib/frontend/src/wm_map.erl > 100: The pattern {'ok', MapRecord} can never match the type {'error',_} > > With what is line 100 being the line with the red background, what is > strange is that that the error case is covered in the case statement Yes, what dialyzer tells you is that it has somehow inferred that your convert_map_to_record/4 function only returns {'error',_}, so the {'ok',_} pattern will never match. Most likely, your convert_map_to_record/4 function does not do what you think it does... For more info, please submit a complete module that illustrates the problem. Kostis From jesper.louis.andersen@REDACTED Mon Jan 25 16:06:38 2016 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 25 Jan 2016 16:06:38 +0100 Subject: [erlang-questions] possible dialyzer bug In-Reply-To: References: Message-ID: On Mon, Jan 25, 2016 at 3:09 PM, Zachary Kessin wrote: > I have a strange dialyzer problem, I have this code > You would have to supply the convert_map_to_record function as well. Usually the case is that the dialyzer has figured out, one way or the other, that there is only a single possible outcome of convert_map_to_record: {error, _}. Hence it reports that {ok, MR} can never match, which is true. This commonly happens when you have a planned extension later in the code base, and have provided scaffolding for the extension, yet the underlying code is not able to touch that newly formed code path yet because it doesn't return the correct type of value. Another common case is where there is another error somewhere in your code and the dialyzer has figured out that with the current constraints, convert_map_to_record can only succeed without crashing by returning {error, _}. This can happen if the record spec is not precise enough, for instance. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Mon Jan 25 16:47:17 2016 From: t@REDACTED (Tristan Sloughter) Date: Mon, 25 Jan 2016 09:47:17 -0600 Subject: [erlang-questions] SCTP Accept Message-ID: <1453736837.4121000.501928130.4DB74430@webmail.messagingengine.com> I'm basically reviving this old thread: http://erlang.org/pipermail/erlang-questions/2009-September/046558.html As far as I can tell an 'acccept' is necessary. It exists at the lower level to provide a socket for communicating with the client that made the association. Without this you can't spawn a process per client on the server side, unless I'm missing something? Has this simply not mattered because sctp is not supported in most cloud networks and such, so it isn't used? Meaning it makes sense for me to add an accept interface? Or is it actually not needed somehow and associations can be handled in a similar way to what I described without a new socket? -- Tristan Sloughter t@REDACTED From ferenc.holzhauser@REDACTED Mon Jan 25 16:55:34 2016 From: ferenc.holzhauser@REDACTED (Ferenc Holzhauser) Date: Mon, 25 Jan 2016 16:55:34 +0100 Subject: [erlang-questions] SCTP Accept In-Reply-To: <1453736837.4121000.501928130.4DB74430@webmail.messagingengine.com> References: <1453736837.4121000.501928130.4DB74430@webmail.messagingengine.com> Message-ID: Hi, If I understand the question correctly, you could use peeloff in SCTP for spawning processes for different connections. Regards, Ferenc On 25 January 2016 at 16:47, Tristan Sloughter wrote: > I'm basically reviving this old thread: > http://erlang.org/pipermail/erlang-questions/2009-September/046558.html > > As far as I can tell an 'acccept' is necessary. It exists at the lower > level to provide a socket for communicating with the client that made > the association. Without this you can't spawn a process per client on > the server side, unless I'm missing something? > > Has this simply not mattered because sctp is not supported in most cloud > networks and such, so it isn't used? Meaning it makes sense for me to > add an accept interface? Or is it actually not needed somehow and > associations can be handled in a similar way to what I described without > a new socket? > > -- > Tristan Sloughter > t@REDACTED > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Mon Jan 25 16:58:41 2016 From: t@REDACTED (Tristan Sloughter) Date: Mon, 25 Jan 2016 09:58:41 -0600 Subject: [erlang-questions] SCTP Accept In-Reply-To: References: <1453736837.4121000.501928130.4DB74430@webmail.messagingengine.com> Message-ID: <1453737521.4124333.501942722.24C23DA5@webmail.messagingengine.com> doh, I think you are right! I wonder if that is basically what sctp accept does, instead of requiring the extra step? -- Tristan Sloughter t@REDACTED On Mon, Jan 25, 2016, at 09:55 AM, Ferenc Holzhauser wrote: > Hi, > > If I understand the question correctly, you could use peeloff in SCTP for spawning processes for different connections. > > Regards, > Ferenc > > On 25 January 2016 at 16:47, Tristan Sloughter wrote: >> I'm basically reviving this old thread: >> http://erlang.org/pipermail/erlang-questions/2009-September/046558.html >> >> As far as I can tell an 'acccept' is necessary. It exists at the lower >> level to provide a socket for communicating with the client that made >> the association. Without this you can't spawn a process per client on >> the server side, unless I'm missing something? >> >> Has this simply not mattered because sctp is not supported in most cloud >> networks and such, so it isn't used? Meaning it makes sense for me to >> add an accept interface? Or is it actually not needed somehow and >> associations can be handled in a similar way to what I described without >> a new socket? >> >> -- >> ? Tristan Sloughter >> t@REDACTED >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From ferenc.holzhauser@REDACTED Mon Jan 25 17:14:56 2016 From: ferenc.holzhauser@REDACTED (Ferenc Holzhauser) Date: Mon, 25 Jan 2016 17:14:56 +0100 Subject: [erlang-questions] SCTP Accept In-Reply-To: <1453737521.4124333.501942722.24C23DA5@webmail.messagingengine.com> References: <1453736837.4121000.501928130.4DB74430@webmail.messagingengine.com> <1453737521.4124333.501942722.24C23DA5@webmail.messagingengine.com> Message-ID: It's been a while, but I think I just used : open, listen, wait for the connection SCTP message then from there peeloff the association into a new socket which was then handed off to a new process. I don't think I used accept. Regards, Ferenc On 25 January 2016 at 16:58, Tristan Sloughter wrote: > doh, I think you are right! I wonder if that is basically what sctp accept > does, instead of requiring the extra step? > > -- > Tristan Sloughter > t@REDACTED > > > > On Mon, Jan 25, 2016, at 09:55 AM, Ferenc Holzhauser wrote: > > Hi, > > If I understand the question correctly, you could use peeloff in SCTP for > spawning processes for different connections. > > Regards, > Ferenc > > On 25 January 2016 at 16:47, Tristan Sloughter wrote: > > I'm basically reviving this old thread: > http://erlang.org/pipermail/erlang-questions/2009-September/046558.html > > As far as I can tell an 'acccept' is necessary. It exists at the lower > level to provide a socket for communicating with the client that made > the association. Without this you can't spawn a process per client on > the server side, unless I'm missing something? > > Has this simply not mattered because sctp is not supported in most cloud > networks and such, so it isn't used? Meaning it makes sense for me to > add an accept interface? Or is it actually not needed somehow and > associations can be handled in a similar way to what I described without > a new socket? > > -- > Tristan Sloughter > t@REDACTED > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Mon Jan 25 17:17:34 2016 From: t@REDACTED (Tristan Sloughter) Date: Mon, 25 Jan 2016 10:17:34 -0600 Subject: [erlang-questions] SCTP Accept In-Reply-To: References: <1453736837.4121000.501928130.4DB74430@webmail.messagingengine.com> <1453737521.4124333.501942722.24C23DA5@webmail.messagingengine.com> Message-ID: <1453738654.4128814.501964010.7FBF9163@webmail.messagingengine.com> Do you mean in Erlang? There is no accept in gen_sctp and prim_inet accept does not accept an SCTP socket. In C I see accept and peeloff both exist. But what I've done for Erlang after you pointed out peeloff is the same as you, if #sctp_assoc_change{} is the message received, peeloff a new 1-1 socket for it. -- Tristan Sloughter t@REDACTED On Mon, Jan 25, 2016, at 10:14 AM, Ferenc Holzhauser wrote: > > It's been a while, but I think I just used : open, listen, wait for the connection SCTP message then from there peeloff the association into a new socket which was then handed off to a new process. I don't think I used accept. > > Regards, > Ferenc > > On 25 January 2016 at 16:58, Tristan Sloughter wrote: >> __ >> doh, I think you are right! I wonder if that is basically what sctp accept does, instead of requiring the extra step? >> >> -- >> Tristan Sloughter >> t@REDACTED >> >> >> >> On Mon, Jan 25, 2016, at 09:55 AM, Ferenc Holzhauser wrote: >>> Hi, >>> >>> If I understand the question correctly, you could use peeloff in SCTP for spawning processes for different connections. >>> >>> Regards, >>> Ferenc >>> >>> On 25 January 2016 at 16:47, Tristan Sloughter wrote: >>>> I'm basically reviving this old thread: >>>> http://erlang.org/pipermail/erlang-questions/2009-September/046558.html >>>> >>>> As far as I can tell an 'acccept' is necessary. It exists at the lower >>>> level to provide a socket for communicating with the client that made >>>> the association. Without this you can't spawn a process per client on >>>> the server side, unless I'm missing something? >>>> >>>> Has this simply not mattered because sctp is not supported in most cloud >>>> networks and such, so it isn't used? Meaning it makes sense for me to >>>> add an accept interface? Or is it actually not needed somehow and >>>> associations can be handled in a similar way to what I described without >>>> a new socket? >>>> >>>> -- >>>> ? Tristan Sloughter >>>> t@REDACTED >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From ferenc.holzhauser@REDACTED Mon Jan 25 17:19:58 2016 From: ferenc.holzhauser@REDACTED (Ferenc Holzhauser) Date: Mon, 25 Jan 2016 17:19:58 +0100 Subject: [erlang-questions] SCTP Accept In-Reply-To: <1453738654.4128814.501964010.7FBF9163@webmail.messagingengine.com> References: <1453736837.4121000.501928130.4DB74430@webmail.messagingengine.com> <1453737521.4124333.501942722.24C23DA5@webmail.messagingengine.com> <1453738654.4128814.501964010.7FBF9163@webmail.messagingengine.com> Message-ID: Probably that's the reason why I didn't use accept then :-) As I mentioned, it's been a while... Regards, Ferenc On 25 January 2016 at 17:17, Tristan Sloughter wrote: > Do you mean in Erlang? There is no accept in gen_sctp and prim_inet accept > does not accept an SCTP socket. > > In C I see accept and peeloff both exist. But what I've done for Erlang > after you pointed out peeloff is the same as you, if #sctp_assoc_change{} > is the message received, peeloff a new 1-1 socket for it. > > -- > Tristan Sloughter > t@REDACTED > > > > On Mon, Jan 25, 2016, at 10:14 AM, Ferenc Holzhauser wrote: > > > It's been a while, but I think I just used : open, listen, wait for the > connection SCTP message then from there peeloff the association into a new > socket which was then handed off to a new process. I don't think I used > accept. > > Regards, > Ferenc > > On 25 January 2016 at 16:58, Tristan Sloughter wrote: > > > doh, I think you are right! I wonder if that is basically what sctp accept > does, instead of requiring the extra step? > > -- > Tristan Sloughter > t@REDACTED > > > > On Mon, Jan 25, 2016, at 09:55 AM, Ferenc Holzhauser wrote: > > Hi, > > If I understand the question correctly, you could use peeloff in SCTP for > spawning processes for different connections. > > Regards, > Ferenc > > On 25 January 2016 at 16:47, Tristan Sloughter wrote: > > I'm basically reviving this old thread: > http://erlang.org/pipermail/erlang-questions/2009-September/046558.html > > As far as I can tell an 'acccept' is necessary. It exists at the lower > level to provide a socket for communicating with the client that made > the association. Without this you can't spawn a process per client on > the server side, unless I'm missing something? > > Has this simply not mattered because sctp is not supported in most cloud > networks and such, so it isn't used? Meaning it makes sense for me to > add an accept interface? Or is it actually not needed somehow and > associations can be handled in a similar way to what I described without > a new socket? > > -- > Tristan Sloughter > t@REDACTED > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasdeveloper@REDACTED Mon Jan 25 17:33:27 2016 From: vasdeveloper@REDACTED (Theepan) Date: Mon, 25 Jan 2016 22:03:27 +0530 Subject: [erlang-questions] Adding binary data to a list In-Reply-To: <64BFE48A-29F9-43E3-8292-4467CA3AAC26@cs.otago.ac.nz> References: <64BFE48A-29F9-43E3-8292-4467CA3AAC26@cs.otago.ac.nz> Message-ID: Thanks Richard, for the clarification. Yes - I was referring to interprocess communication.. Regards, Theepan On Mon, Jan 25, 2016 at 5:08 AM, Richard A. O'Keefe wrote: > > On 24/01/2016, at 9:23 am, Theepan wrote: > > If I add the same binary data to different lists, will it be copied? I > know for a fact that binary data are referenced, but not sure in list > making case. > > Suppose you have this code: > > X = ...any arbitrary Erlang term... > P = ...any list you like... > Q = ...any other list you like... > P1 = [X|P], > Q1 = Q ++ [X] > > X is not copied, no matter what it is, no matter how small, > no matter how big. Making P1 copies nothing, just creates > one new pair. Making Q1 copies the spine of Q, but not the > elements of Q, and not X. > > You are probably thinking about the fact that > large binaries are *not* copied when they are > sent to another process, and that they are > reference counted for that purpose. > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Mon Jan 25 18:42:03 2016 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 25 Jan 2016 12:42:03 -0500 Subject: [erlang-questions] SCTP Accept In-Reply-To: <1453736837.4121000.501928130.4DB74430@webmail.messagingengine.com> References: <1453736837.4121000.501928130.4DB74430@webmail.messagingengine.com> Message-ID: SCTP sockets support one-to-one and one-to-many associations. The one-to-many don't require an accept - the association notifications events at the server come via the #sctp_assoc_change{} event. From there you could either route the client-originated messages to association-specific Erlang pid, or you could peel-off the association into a separate file one-to-one socket that is more "traditional" for "TCP"-like style of use. Serge On Mon, Jan 25, 2016 at 10:47 AM, Tristan Sloughter wrote: > I'm basically reviving this old thread: > http://erlang.org/pipermail/erlang-questions/2009-September/046558.html > > As far as I can tell an 'acccept' is necessary. It exists at the lower > level to provide a socket for communicating with the client that made > the association. Without this you can't spawn a process per client on > the server side, unless I'm missing something? > > Has this simply not mattered because sctp is not supported in most cloud > networks and such, so it isn't used? Meaning it makes sense for me to > add an accept interface? Or is it actually not needed somehow and > associations can be handled in a similar way to what I described without > a new socket? > > -- > Tristan Sloughter > t@REDACTED > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elixmoon@REDACTED Mon Jan 25 19:57:48 2016 From: elixmoon@REDACTED (Dmitry Aleksandrov) Date: Mon, 25 Jan 2016 19:57:48 +0100 Subject: [erlang-questions] erlang SSL client verification for self-signed certificates Message-ID: Hallo! I have a question, I try to check client certificate verification using selfsigned server certificates. I'll try to use it: ssl:connect("localhost", 8443, [binary, {verify, verify_peer}, {cacertfile, "cert.pem"}], 60000) > {:error, {:tls_alert, 'bad certificate'}} After tracing, I got: public_key.pkix_path_validation/3 -> {error, {bad_cert, selfsigned_peer}} If I try to exclude this error, by rewriting verification fun, which allow this fun to be a valid, than all certificates are accepted. Is it possible somehow to verify server self-signed certificate? -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Tue Jan 26 02:46:07 2016 From: t@REDACTED (Tristan Sloughter) Date: Mon, 25 Jan 2016 19:46:07 -0600 Subject: [erlang-questions] erlang:setnode/3 and sctp Message-ID: <1453772767.58432.502474538.0EB62D89@webmail.messagingengine.com> So the reason I was figuring out SCTP in my last email was I thought it'd be interesting to play around with creating a SCTP Erlang distribution option. The problem I've been stuck on and completely lost in is the use of erlang:setnode/3 in dist_util. I discovered that do_setnode/1 in dist_util is failing on setnode with: {badarg,[{erlang,setnode,[bong@REDACTED,#Port<0.755>,{229373,5,'',''}],[]}, {dist_util,do_setnode,1, [{file,"src/dist_util.erl"},{line,415}]}, {dist_util,connection,1, [{file,"src/dist_util.erl"},{line,347}]}]} The only thing I can speculate is that there is something it doesn't like about the Port or some setup I'm missing that leads up to this call because there are multiple places it could be throwing that badarg and what is going on in dist.c is not clear to me aside from the very basics :) https://github.com/erlang/otp/blob/maint/erts/emulator/beam/dist.c#L2699-L2866 If anyone has experience and knows what setnode is doing and why it might be failing it would be much appreciated :) The non-working code is up here https://github.com/tsloughter/sctp_dist -- Tristan Sloughter t@REDACTED From vinoski@REDACTED Tue Jan 26 04:08:13 2016 From: vinoski@REDACTED (Steve Vinoski) Date: Mon, 25 Jan 2016 22:08:13 -0500 Subject: [erlang-questions] erlang:setnode/3 and sctp In-Reply-To: <1453772767.58432.502474538.0EB62D89@webmail.messagingengine.com> References: <1453772767.58432.502474538.0EB62D89@webmail.messagingengine.com> Message-ID: On Mon, Jan 25, 2016 at 8:46 PM, Tristan Sloughter wrote: > So the reason I was figuring out SCTP in my last email was I thought > it'd be interesting to play around with creating a SCTP Erlang > distribution option. > > The problem I've been stuck on and completely lost in is the use of > erlang:setnode/3 in dist_util. I discovered that do_setnode/1 in > dist_util is failing on setnode with: > > {badarg,[{erlang,setnode,[bong@REDACTED,#Port<0.755>,{229373,5,'',''}],[]}, > {dist_util,do_setnode,1, > [{file,"src/dist_util.erl"},{line,415}]}, > {dist_util,connection,1, > [{file,"src/dist_util.erl"},{line,347}]}]} > > The only thing I can speculate is that there is something it doesn't > like about the Port or some setup I'm missing that leads up to this call > because there are multiple places it could be throwing that badarg and > what is going on in dist.c is not clear to me aside from the very basics > :) > > https://github.com/erlang/otp/blob/maint/erts/emulator/beam/dist.c#L2699-L2866 > > If anyone has experience and knows what setnode is doing and why it > might be failing it would be much appreciated :) > > The non-working code is up here https://github.com/tsloughter/sctp_dist One of the sources of a badarg in that function is if the port driver doesn't set the ERL_DRV_FLAG_SOFT_BUSY flag (see http://erlang.org/doc/man/driver_entry.html#driver_flags). The SCTP driver doesn't set this, so in the link to the code you sent, I'm guessing it fails here: https://github.com/erlang/otp/blob/maint/erts/emulator/beam/dist.c#L2772 --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Tue Jan 26 04:20:47 2016 From: t@REDACTED (Tristan Sloughter) Date: Mon, 25 Jan 2016 21:20:47 -0600 Subject: [erlang-questions] erlang:setnode/3 and sctp In-Reply-To: References: <1453772767.58432.502474538.0EB62D89@webmail.messagingengine.com> Message-ID: <1453778447.76432.502530754.22F48E55@webmail.messagingengine.com> > One of the sources of a badarg in that function is if the port driver doesn't set the ERL_DRV_FLAG_SOFT_BUSY flag (see http://erlang.org/doc/man/driver_entry.html#driver_flags). The SCTP driver doesn't set this, so in the link to the code you sent, I'm guessing it fails here:?https://github.com/erlang/otp/blob/maint/erts/emulator/beam/dist.c#L2772 Ah, thanks! But crap... this means SCTP (at least with the provided driver) can't be used for distribution? A custom driver is required? Assuming there isn't something about SCTP itself that makes this problematic? -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Tue Jan 26 05:41:04 2016 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 25 Jan 2016 23:41:04 -0500 Subject: [erlang-questions] erlang:setnode/3 and sctp In-Reply-To: <1453778447.76432.502530754.22F48E55@webmail.messagingengine.com> References: <1453772767.58432.502474538.0EB62D89@webmail.messagingengine.com> <1453778447.76432.502530754.22F48E55@webmail.messagingengine.com> Message-ID: If memory serves me right, this flag was introduced to erts well after we implemented the SCTP driver back in 2008 (I believe it was erts R11B at that time), so you might have uncovered a regression bug. On Mon, Jan 25, 2016 at 10:20 PM, Tristan Sloughter wrote: > One of the sources of a badarg in that function is if the port driver > doesn't set the ERL_DRV_FLAG_SOFT_BUSY flag (see > http://erlang.org/doc/man/driver_entry.html#driver_flags). The SCTP > driver doesn't set this, so in the link to the code you sent, I'm guessing > it fails here: > https://github.com/erlang/otp/blob/maint/erts/emulator/beam/dist.c#L2772 > > > Ah, thanks! > > But crap... this means SCTP (at least with the provided driver) can't be > used for distribution? A custom driver is required? Assuming there isn't > something about SCTP itself that makes this problematic? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Tue Jan 26 05:42:04 2016 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 25 Jan 2016 23:42:04 -0500 Subject: [erlang-questions] erlang:setnode/3 and sctp In-Reply-To: References: <1453772767.58432.502474538.0EB62D89@webmail.messagingengine.com> <1453778447.76432.502530754.22F48E55@webmail.messagingengine.com> Message-ID: Actually it was 2006. On Mon, Jan 25, 2016 at 11:41 PM, Serge Aleynikov wrote: > If memory serves me right, this flag was introduced to erts well after we > implemented the SCTP driver back in 2008 (I believe it was erts R11B at > that time), so you might have uncovered a regression bug. > > On Mon, Jan 25, 2016 at 10:20 PM, Tristan Sloughter > wrote: > >> One of the sources of a badarg in that function is if the port driver >> doesn't set the ERL_DRV_FLAG_SOFT_BUSY flag (see >> http://erlang.org/doc/man/driver_entry.html#driver_flags). The SCTP >> driver doesn't set this, so in the link to the code you sent, I'm guessing >> it fails here: >> https://github.com/erlang/otp/blob/maint/erts/emulator/beam/dist.c#L2772 >> >> >> Ah, thanks! >> >> But crap... this means SCTP (at least with the provided driver) can't be >> used for distribution? A custom driver is required? Assuming there isn't >> something about SCTP itself that makes this problematic? >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz@REDACTED Tue Jan 26 10:14:10 2016 From: aschultz@REDACTED (Andreas Schultz) Date: Tue, 26 Jan 2016 10:14:10 +0100 (CET) Subject: [erlang-questions] Crash in diameter_sctp:peeloff/3 Message-ID: <2065168259.232719.1453799650681.JavaMail.zimbra@tpip.net> Hi, It seems that is possible to get an DIAMETER sctp socket into a situation where diameter_sctp:peeloff/3 will crash with: 2016-01-25 15:07:34 =ERROR REPORT==== ** Generic server <0.339.0> terminating ** Last message in was {sctp,#Port<0.4624>,{8193,1784,4825,22,656,3071,65066,34054},52556,{[],{sctp_assoc_change,comm_up,0,10,10,152}}} ** When Server state == {listener,#Ref<0.0.1.4007>,#Port<0.4624>,1,{0,{[],[]}},#Ref<0.0.1.4505>,[]} ** Reason for termination == ** {{badmatch,{error,einval}},[{diameter_sctp,peeloff,3,[{file,"transport/diameter_sctp.erl"},{line,749}]},{diameter_sctp,l,2,[{file,"transport/diameter_sctp.erl"},{line,452}]},{diameter_sctp,handle_info,2,[{file,"transport/diameter_sctp.erl"},{line,396}]},{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,615}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,681}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} 2016-01-25 15:07:34 =CRASH REPORT==== crasher: initial call: diameter_sctp:init/1 pid: <0.339.0> registered_name: [] exception exit: {{{badmatch,{error,einval}},[{diameter_sctp,peeloff,3,[{file,"transport/diameter_sctp.erl"},{line,749}]},{diameter_sctp,l,2,[{file,"transport/diameter_sctp.erl"},{line,452}]},{diameter_sctp,handle_info,2,[{file,"transport/diameter_sctp.erl"},{line,396}]},{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,615}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,681}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]},[{gen_server,terminate,7,[{file,"gen_server.erl"},{line,826}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} ancestors: [diameter_sctp_listener_sup,diameter_transport_sup,diameter_sup,<0.221.0>] messages: [] links: [<0.290.0>] dictionary: [] trap_exit: false status: running heap_size: 75113 stack_size: 27 reductions: 2935 neighbours: This most likely happens when the incoming connection is terminated very quickly after it has been established. I looked at the code and the possible error returns of get_sctp:peeloff/2 are not handled. To me, this looks like a valid socket shutdown that should be handled gracefully instead of crashing? Andreas From aschultz@REDACTED Tue Jan 26 10:49:21 2016 From: aschultz@REDACTED (Andreas Schultz) Date: Tue, 26 Jan 2016 10:49:21 +0100 (CET) Subject: [erlang-questions] DIAMETER: sharing connections between applications Message-ID: <655316269.233271.1453801761948.JavaMail.zimbra@tpip.net> Hi, I have a problem where a transport connection between client should be shared by multiple DIAMETER application. It does work when the transport is added once, but when I add the a transport for the same destination twice with different application restrictions, the connection will not be established and the error event will contain bogus error reasons. The following example is a bit contrived, but reflects the real use case as close as possible. start() -> SvcName = ?MODULE, SvcOpts = [{'Origin-Host', <<"host.local">>}, {'Origin-Realm', <<"realm.local">>}, {'Origin-State-Id', diameter:origin_state_id()}, {'Host-IP-Address', [{127,0,0,1}]}, {'Vendor-Id', 1234}, {'Product-Name', "Client"}, {'Auth-Application-Id', [1, 4]}, {string_decode, false}, {application, [{alias, nas}, {dictionary, rfc4005_nas}, {module, nas_cb}]}, {application, [{alias, cc}, {dictionary, rfc4006_cc}, {module, cc_cb}]}], diameter:subscribe(SvcName), ok = diameter:start_service(SvcName, SvcOpts), TransportOpts = [{transport_module, diameter_sctp}, {transport_config, [{raddr, {127,0,0,1}}, {rport, 1234}]}], {ok, _} = diameter:add_transport(SvcName, {connect, [{applications, [1]} | TransportOpts]}), {ok, _} = diameter:add_transport(SvcName, {connect, [{applications, [4]} | TransportOpts]}), ok. This sample will fail to establish the connections if the remote side supports only one of the applications and report an diameter event: #diameter_event{ info = {closed,#Ref<0.0.8.1>, {'CEA', #diameter_base_CEA{ ... }, #diameter_service{ ... }, diameter_gen_base_rfc3588, {app_not_configured,4}}, ... } The value for 'app_not_configured' is bogus and contains either 1 or 4 in this example and has no relation to what the other side supports. The sample works when I'm call the add_transport only once without application restriction. According to the documentation, the 'applications' options will restrict the transport to the specified id. So why does it acct like are 'require' when used with multiple add_transport? Andreas From dmitry.a.russ@REDACTED Tue Jan 26 10:40:53 2016 From: dmitry.a.russ@REDACTED (Dmitry Russ) Date: Tue, 26 Jan 2016 10:40:53 +0100 Subject: [erlang-questions] SSL client verification for self-signed certificates Message-ID: Hi, I try to check client certificate verification using selfsigned server certificates. I try to use it: ssl:connect("localhost", 8443, [binary, {verify, verify_peer}, {cacertfile, "cert.pem"}], 60000) > {:error, {:tls_alert, 'bad certificate'}} After tracing, I got: public_key.pkix_path_validation/3 -> {error, {bad_cert, selfsigned_peer}} If I try to exclude this error, by rewriting verify fun, which allow for this error to be a valid certificate, than all selfsigned certificates simply accepted, it doesn't check it anymore. Is it possible somehow to verify server self-signed certificate? -------------- next part -------------- An HTML attachment was scrubbed... URL: From umberto.corponi@REDACTED Tue Jan 26 15:54:41 2016 From: umberto.corponi@REDACTED (Umberto Corponi) Date: Tue, 26 Jan 2016 15:54:41 +0100 Subject: [erlang-questions] DIAMETER: sharing connections between applications In-Reply-To: <655316269.233271.1453801761948.JavaMail.zimbra@tpip.net> References: <655316269.233271.1453801761948.JavaMail.zimbra@tpip.net> Message-ID: <56A788B1.8010106@athonet.com> I think this service_opt() may be what you are looking for: *{restrict_connections, false | node | nodes | [node()] | evaluable()}* The degree to which the service allows multiple transport connections to the same peer, as identified by its Origin-Host at capabilities exchange. Defaults to nodes. In any case the same transport connection can support seamlessly more than one application. The correct callback will be invoked depending on the application-id of the messages, so if it is not required for some other reason, one transport connection should be enough. If separated transport connections are still a requirement in your case, may i ask you why? Just curious... Regards, Umberto On 01/26/2016 10:49 AM, Andreas Schultz wrote: > Hi, > > I have a problem where a transport connection between client > should be shared by multiple DIAMETER application. It does work > when the transport is added once, but when I add the a transport > for the same destination twice with different application restrictions, > the connection will not be established and the error event will > contain bogus error reasons. > > The following example is a bit contrived, but reflects the real > use case as close as possible. > > start() -> > SvcName = ?MODULE, > SvcOpts = [{'Origin-Host', <<"host.local">>}, > {'Origin-Realm', <<"realm.local">>}, > {'Origin-State-Id', diameter:origin_state_id()}, > {'Host-IP-Address', [{127,0,0,1}]}, > {'Vendor-Id', 1234}, > {'Product-Name', "Client"}, > {'Auth-Application-Id', [1, 4]}, > {string_decode, false}, > {application, [{alias, nas}, > {dictionary, rfc4005_nas}, > {module, nas_cb}]}, > {application, [{alias, cc}, > {dictionary, rfc4006_cc}, > {module, cc_cb}]}], > > diameter:subscribe(SvcName), > > ok = diameter:start_service(SvcName, SvcOpts), > > TransportOpts = [{transport_module, diameter_sctp}, > {transport_config, [{raddr, {127,0,0,1}}, > {rport, 1234}]}], > > {ok, _} = diameter:add_transport(SvcName, {connect, [{applications, [1]} | TransportOpts]}), > {ok, _} = diameter:add_transport(SvcName, {connect, [{applications, [4]} | TransportOpts]}), > > ok. > > This sample will fail to establish the connections if the remote side > supports only one of the applications and report an diameter event: > > #diameter_event{ > info = > {closed,#Ref<0.0.8.1>, > {'CEA', > #diameter_base_CEA{ ... }, > #diameter_service{ ... }, > diameter_gen_base_rfc3588, > {app_not_configured,4}}, > ... > } > > The value for 'app_not_configured' is bogus and contains either 1 or 4 in > this example and has no relation to what the other side supports. > > The sample works when I'm call the add_transport only once without application > restriction. > > According to the documentation, the 'applications' options will restrict the > transport to the specified id. So why does it acct like are 'require' > when used with multiple add_transport? > > Andreas > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Umberto Corponi Athonet From zandra.hird@REDACTED Tue Jan 26 17:07:29 2016 From: zandra.hird@REDACTED (Zandra Hird) Date: Tue, 26 Jan 2016 17:07:29 +0100 Subject: [erlang-questions] OTP 17.5.6.8 Released Message-ID: <56A799C1.3080203@ericsson.com> Patch Package: OTP 17.5.6.8 Git Tag: OTP-17.5.6.8 Date: 2016-01-26 Trouble Report Id: OTP-13164 Seq num: System: OTP Release: 17 Application: diameter-1.9.2.3 Predecessor: OTP 17.5.6.7 Check out the git tag OTP-17.5.6.8, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- diameter-1.9.2.3 ------------------------------------------------ --------------------------------------------------------------------- The diameter-1.9.2.3 application can be applied independently of other applications on a full OTP 17 installation. --- Fixed Bugs and Malfunctions --- OTP-13164 Application(s): diameter Make peer handling more efficient. Inefficient lookup and manipulation of peer lists could result in poor performance when many outgoing requests were sent simultaneously, or when many peers connected simultaneously. Filtering peer lists on realm/host is now also more efficient in many cases. Full runtime dependencies of diameter-1.9.2.3: erts-6.0, kernel-3.0, ssl-5.3.4, stdlib-2.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From t@REDACTED Tue Jan 26 17:09:07 2016 From: t@REDACTED (Tristan Sloughter) Date: Tue, 26 Jan 2016 10:09:07 -0600 Subject: [erlang-questions] erlang:setnode/3 and sctp In-Reply-To: References: <1453772767.58432.502474538.0EB62D89@webmail.messagingengine.com> <1453778447.76432.502530754.22F48E55@webmail.messagingengine.com> Message-ID: <1453824547.80384.503049042.1C179BD9@webmail.messagingengine.com> Aah, ok. Thanks, I'll take a look if I can understand what it'd take to add this. -- Tristan Sloughter t@REDACTED On Mon, Jan 25, 2016, at 10:42 PM, Serge Aleynikov wrote: > Actually it was 2006. > > On Mon, Jan 25, 2016 at 11:41 PM, Serge Aleynikov wrote: >> If memory serves me right, this flag was introduced to erts well after we implemented the SCTP driver back in 2008 (I believe it was erts R11B at that time), so you might have uncovered a regression bug. >> >> On Mon, Jan 25, 2016 at 10:20 PM, Tristan Sloughter wrote: >>> __ >>>> One of the sources of a badarg in that function is if the port driver doesn't set the ERL_DRV_FLAG_SOFT_BUSY flag (see http://erlang.org/doc/man/driver_entry.html#driver_flags). The SCTP driver doesn't set this, so in the link to the code you sent, I'm guessing it fails here:?https://github.com/erlang/otp/blob/maint/erts/emulator/beam/dist.c#L2772 >>> >>> Ah, thanks! >>> >>> But crap... this means SCTP (at least with the provided driver) can't be used for distribution? A custom driver is required? Assuming there isn't something about SCTP itself that makes this problematic? >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From msilvestre@REDACTED Tue Jan 26 16:56:41 2016 From: msilvestre@REDACTED (Miguel Silvestre) Date: Tue, 26 Jan 2016 15:56:41 +0000 Subject: [erlang-questions] Programing Erlang - second editon Chapter 25 Message-ID: Hello all, This is my first post to this mailing list. I haven't found any answer for this. So if this is already on the mailing list I'm sorry for that. I'm reading the Programming Erlang book sercond edition from Joe Armstrong. And when running the Makefile described on chapter 25.2: all: test -d deps || rebar get-deps rebar compile @erl -noshell -pa './deps/bitcask/ebin' -pa './ebin' -s bertie start I get the following error: $ make test -d deps || rebar get-deps ==> bertie (get-deps) Pulling bitcask from {git,"git://github.com/basho/bitcask.git","master"} Cloning into 'bitcask'... ==> bitcask (get-deps) Pulling meck from {git,"git://github.com/eproxus/meck"} Cloning into 'meck'... ==> meck (get-deps) rebar compile ==> meck (compile) Compiled src/meck_ret_spec.erl Compiled src/meck_util.erl Compiled src/meck_proc.erl Compiled src/meck_matcher.erl Compiled src/meck_history.erl Compiled src/meck_expect.erl Compiled src/meck_cover.erl Compiled src/meck_code.erl Compiled src/meck_code_gen.erl Compiled src/meck_args_matcher.erl Compiled src/meck.erl ==> bitcask (compile) Compiled src/bitcask_sup.erl Compiled src/bitcask_time.erl /Users/miguel.silvestre/IdeaProjects/learningErlang/src/book/bertie/deps/bitcask/src/bitcask_merge_delete.erl:46: type queue() undefined Compiling /Users/miguel.silvestre/IdeaProjects/learningErlang/src/book/bertie/deps/bitcask/src/bitcask_merge_delete.erl failed: ERROR: compile failed while processing /Users/miguel.silvestre/IdeaProjects/learningErlang/src/book/bertie/deps/bitcask: rebar_abort make: *** [all] Error 1 Thank you for your support! PS. I'm on a OSX system. -- Miguel Silvestre -------------- next part -------------- An HTML attachment was scrubbed... URL: From kostis@REDACTED Tue Jan 26 20:27:59 2016 From: kostis@REDACTED (Kostis Sagonas) Date: Tue, 26 Jan 2016 20:27:59 +0100 Subject: [erlang-questions] Programing Erlang - second editon Chapter 25 In-Reply-To: References: Message-ID: <56A7C8BF.6090708@cs.ntua.gr> On 01/26/2016 04:56 PM, Miguel Silvestre wrote: > Compiled src/bitcask_time.erl > /Users/miguel.silvestre/IdeaProjects/learningErlang/src/book/bertie/deps/bitcask/src/bitcask_merge_delete.erl:46: > type queue() undefined You need to notify the bitcask people that their code base does not compile with your Erlang/OTP version (18.x, I presume). Kostis From eric.pailleau@REDACTED Wed Jan 27 00:58:57 2016 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Wed, 27 Jan 2016 00:58:57 +0100 Subject: [erlang-questions] [ANN] geas 2.0.5 Message-ID: <56A80841.7070104@wanadoo.fr> Hi list , I hereby announcing a new release of Geas. A tool to detect aggregated informations of Erlang project, and especially to detect the runnable official Erlang release window for project and its dependancies. https://github.com/crownedgrouse/geas New features : - Geas can now use source code instead of beam files. This allow to know what Erlang versions can compile a whole project. - rebar3 plugin now available in addition to rebar2 and erlang.mk plugins. - User can declare available local releases. - User can exclude release(s) from computed. Thanks to Pierre Fenoll for some ideas coming from its requirements. Enjoy ! From b@REDACTED Wed Jan 27 06:23:09 2016 From: b@REDACTED (Benjamin Black) Date: Tue, 26 Jan 2016 21:23:09 -0800 Subject: [erlang-questions] errors with EC cert generation Message-ID: I'm attempting to generate CSRs and certificates using the public_key library. I've run into trouble when using elliptic curves instead of RSA and the problem shows up even in the erl_make_certs.erl code included in the public_key tests. Things work fine with RSA: > erl_make_certs:make_cert([{key, rsa}]). {<<48,130,2,136,48,130,1,241,160,3,2,1,2,2,6,0,220,55,12, 84,65,48,13,6,9,42,134,72,...>>, {'RSAPrivateKey',<<48,130,2,92,2,1,0,2,129,129,0,136,253, 122,221,72,60,185,68,243,119,187,161, 131,7,...>>, not_encrypted}} But fail with EC: > erl_make_certs:make_cert([{key, ec}]). ** exception error: no match of right hand side value {error,{asn1,badarg}} in function public_key:der_encode/2 (public_key.erl, line 253) in call from public_key:pkix_sign/2 (public_key.erl, line 529) in call from erl_make_certs:make_cert/1 The error is caused by the call to make_tbs/2. As far as I can tell, the problem is in the attempt to der_encode/2 the subject. The exact problem appears to be in encoding subject AttributeTypeAndValue with values of the form {printableString, Value}. What I can't determine is why this encoding succeeds for RSA but fails for EC. Can anyone shed any light? b -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gustav.Spellauge@REDACTED Wed Jan 27 12:41:08 2016 From: Gustav.Spellauge@REDACTED (Gustav Spellauge) Date: Wed, 27 Jan 2016 12:41:08 +0100 Subject: [erlang-questions] Erlang/OTP 17.0 on android Message-ID: <56A8ACD4.1060704@softing.com> good morning, please allow me to ask a (maybe superfluous) question. i installed http://erlang.ernovation.com/files/Erlang4Android17.0.apk on my android device (SM-G901F) running cyanogenmod 12-20150418-UNOFFICIAL-kccat6xx, android version 5.0.2. when starting by typing ./data/data/com.ernovation.erlangforandroid/files/erlang/bin/erl into a command shell, the response is: error: only position independent executables (PIE) are supported. Eshell V6.0 (abort with ^G) 1> and the system seems to be running. question: what about the pie related error message? can it be safely ignored? if no, what can i do to get rid of it (and the underlying problem of course)? thanks in advance for your answer. g. From jesper.louis.andersen@REDACTED Wed Jan 27 13:54:22 2016 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 27 Jan 2016 13:54:22 +0100 Subject: [erlang-questions] Programing Erlang - second editon Chapter 25 In-Reply-To: <56A7C8BF.6090708@cs.ntua.gr> References: <56A7C8BF.6090708@cs.ntua.gr> Message-ID: On Tue, Jan 26, 2016 at 8:27 PM, Kostis Sagonas wrote: > You need to notify the bitcask people that their code base does not > compile with your Erlang/OTP version (18.x, I presume). There is a bit more history to this story. Basho, maintaining Bitcask, usually runs on a slower upgrade schedule and may not have moved their software to release 18.x yet. Hence the repository isn't yet upgraded to run the newest version of Erlang, and you get the above error. It would be worthwhile to provide a 18.x-ready version of Bitcask anyway, though, because eventually they will need to upgrade :) -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Wed Jan 27 14:49:48 2016 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 27 Jan 2016 08:49:48 -0500 Subject: [erlang-questions] Programing Erlang - second editon Chapter 25 In-Reply-To: References: <56A7C8BF.6090708@cs.ntua.gr> Message-ID: <20160127134947.GO28491@fhebert-ltm2.internal.salesforce.com> On 01/27, Jesper Louis Andersen wrote: >It would be worthwhile to provide a 18.x-ready version of Bitcask >anyway, >though, because eventually they will need to upgrade :) We got bitcask to work with 18.x at Heroku using rebar3 with the following entries in our rebar.config file: {deps, [ {bitcask, {git, "https://github.com/basho/bitcask.git", {branch, "develop"}}}, ... ]}. {overrides, [ {override, bitcask, [ {erl_opts, [ warnings_as_errors, debug_info, {platform_define, "^[0-9]+", namespaced_types}, {parse_transform, lager_transform} ]}, {deps, [lager]}, {plugins, [pc]}, {artifacts, ["priv/bitcask.so"]}, {provider_hooks, [ {post, [{compile, {pc, compile}}, {clean, {pc, clean}}]} ]} ]} ]}. It's quite a mouthful, but with these modifications we've been able to run it fine on 18.x until upstream support is in. Regards, Fred. From erlang@REDACTED Wed Jan 27 16:27:13 2016 From: erlang@REDACTED (Joe Armstrong) Date: Wed, 27 Jan 2016 16:27:13 +0100 Subject: [erlang-questions] UDP questions Message-ID: Hello, I have a simple UDP client/server The server is on a fixed port 4567 - I open it like this {ok, Socket} = gen_udp:open(4567, [binary]), then wait for registrations receive {udp, Socket, _Ip, _Port, <<"register">>) -> Clients do this: {ok, Socket} = gen_udp:open(0, [binary]), gen_udp:send(Socket, "localhost", 44567, <<"register">>), ... I'm testing on "localhost" After registration the processes send binaries to each other This works fine for small binaries but gen_udp:send fails with {error,emsgsize} for large binaries So I have a few questions: 1) Can I find out the max binary size that can be sent/received? 2) Can I increase the max size? 3) Is there a guaranteed minimum packet length that will not be fragemented? 3) Can received packets be fragmented - TCP has a {packet,N} option and some built-in defragmentation, what's the story for UDP? I think I know the answers to these but I'm not really sure - could somebody who really knows enlighten me? Thanks /Joe From paulperegud@REDACTED Wed Jan 27 16:43:37 2016 From: paulperegud@REDACTED (Paul Peregud) Date: Wed, 27 Jan 2016 16:43:37 +0100 Subject: [erlang-questions] UDP questions In-Reply-To: References: Message-ID: This boils down to UDP being datagram protocol. It can't fragment packets by design, since it does not assume that it is operating on stream of data. Also, every packet is treated as something that can be dropped. So it may get dropped by anyone: network router, network adapter, kernel, or BEAM. On both sending and receiving side. As for reasons for dropping - packet is too big to fit into single ethernet frame, buffer (of any device or program) being full, connection being congested. In general UDP user needs to take care of all those things by himself. On bright side - UDP is cheaper and is better in some circumstances than TCP. I'm not aware though of any libraries that simplify UDP - but I'm not an expert at all. On Wed, Jan 27, 2016 at 4:27 PM, Joe Armstrong wrote: > Hello, > > I have a simple UDP client/server > > The server is on a fixed port 4567 - I open it like this > > {ok, Socket} = gen_udp:open(4567, [binary]), > > then wait for registrations > receive > {udp, Socket, _Ip, _Port, <<"register">>) -> > > > Clients do this: > > {ok, Socket} = gen_udp:open(0, [binary]), > gen_udp:send(Socket, "localhost", 44567, <<"register">>), > ... > > I'm testing on "localhost" > > After registration the processes send binaries to each other > > This works fine for small binaries but gen_udp:send fails with > {error,emsgsize} for large binaries > > So I have a few questions: > > 1) Can I find out the max binary size that can be sent/received? > 2) Can I increase the max size? > 3) Is there a guaranteed minimum packet length that will not be fragemented? > 3) Can received packets be fragmented - TCP has a {packet,N} > option and some built-in defragmentation, what's the story for > UDP? > > I think I know the answers to these but I'm not really sure - could somebody > who really knows enlighten me? > > Thanks > > /Joe > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Best regards, Paul Peregud +48602112091 From trapexit@REDACTED Wed Jan 27 16:50:06 2016 From: trapexit@REDACTED (Antonio SJ Musumeci) Date: Wed, 27 Jan 2016 10:50:06 -0500 Subject: [erlang-questions] UDP questions In-Reply-To: References: Message-ID: I think in practice, given what Paul mentioned, it can't really be explicitly known or queried. Perhaps a simple handshake between the client and server could be done which tries to establish a practical msg size? On Wed, Jan 27, 2016 at 10:43 AM, Paul Peregud wrote: > This boils down to UDP being datagram protocol. It can't fragment > packets by design, since it does not assume that it is operating on > stream of data. Also, every packet is treated as something that can be > dropped. > > So it may get dropped by anyone: network router, network adapter, > kernel, or BEAM. On both sending and receiving side. As for reasons > for dropping - packet is too big to fit into single ethernet frame, > buffer (of any device or program) being full, connection being > congested. In general UDP user needs to take care of all those things > by himself. > > On bright side - UDP is cheaper and is better in some circumstances > than TCP. I'm not aware though of any libraries that simplify UDP - > but I'm not an expert at all. > > On Wed, Jan 27, 2016 at 4:27 PM, Joe Armstrong wrote: > > Hello, > > > > I have a simple UDP client/server > > > > The server is on a fixed port 4567 - I open it like this > > > > {ok, Socket} = gen_udp:open(4567, [binary]), > > > > then wait for registrations > > receive > > {udp, Socket, _Ip, _Port, <<"register">>) -> > > > > > > Clients do this: > > > > {ok, Socket} = gen_udp:open(0, [binary]), > > gen_udp:send(Socket, "localhost", 44567, <<"register">>), > > ... > > > > I'm testing on "localhost" > > > > After registration the processes send binaries to each other > > > > This works fine for small binaries but gen_udp:send fails with > > {error,emsgsize} for large binaries > > > > So I have a few questions: > > > > 1) Can I find out the max binary size that can be sent/received? > > 2) Can I increase the max size? > > 3) Is there a guaranteed minimum packet length that will not be > fragemented? > > 3) Can received packets be fragmented - TCP has a {packet,N} > > option and some built-in defragmentation, what's the story for > > UDP? > > > > I think I know the answers to these but I'm not really sure - could > somebody > > who really knows enlighten me? > > > > Thanks > > > > /Joe > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > Best regards, > Paul Peregud > +48602112091 > _______________________________________________ > 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 Wed Jan 27 16:51:53 2016 From: zxq9@REDACTED (zxq9) Date: Thu, 28 Jan 2016 00:51:53 +0900 Subject: [erlang-questions] UDP questions In-Reply-To: References: Message-ID: <4769522.odjhG9rTdS@changa> Hi Joe. tl;dr: Problems with UDP boil down to limitations of the protocol. On 2016?1?27? ??? 16:27:13 Joe Armstrong wrote: > Hello, > > I have a simple UDP client/server > > The server is on a fixed port 4567 - I open it like this > > {ok, Socket} = gen_udp:open(4567, [binary]), > > then wait for registrations > receive > {udp, Socket, _Ip, _Port, <<"register">>) -> > > > Clients do this: > > {ok, Socket} = gen_udp:open(0, [binary]), > gen_udp:send(Socket, "localhost", 44567, <<"register">>), > ... > > I'm testing on "localhost" > > After registration the processes send binaries to each other > > This works fine for small binaries but gen_udp:send fails with > {error,emsgsize} for large binaries > > So I have a few questions: > > 1) Can I find out the max binary size that can be sent/received? > 2) Can I increase the max size? > 3) Is there a guaranteed minimum packet length that will not be fragemented? > 3) Can received packets be fragmented - TCP has a {packet,N} > option and some built-in defragmentation, what's the story for > UDP? > > I think I know the answers to these but I'm not really sure - could somebody > who really knows enlighten me? The max datagram size is supposed to be discoverable with GET_MAXSIZES() as per RFC 1122 4.1.4 ( https://tools.ietf.org/html/rfc1122#page-79 ) but in practice I've never seen anyone actually query this. Discovery, at least in the game server world, tends to happen using ICMP because the question is almost never "what is the max datagram size only to localhost". Generally speaking you've got 512 - 8 bytes of safe space to use in IPv4 UDP -- though over the localhost... I'm not really sure what the limit would be; but you should be able to configure the local interface to be some almost arbitrarily large jumboframe size. 512 - 8 is a guideline based on MTU based fragmentation. I'm assuming you want the code to not care whether its all localhost or if the system is extended across the network. ? As far as breaking larger things up into several pieces, you either wind up reinventing TCP streams in chunks, or reinventing SCTP sequential packet mode. UDP will never guarantee the ordering or receipt of any given message. I've never lost a UDP packet to localhost, but I'm pretty sure you could create a system load that would cause this to happen. I think really the ideal protocol is SCTP. Each association in sequential packet mode is like a UDP datagram, but ordered and guaranteed to be received (deals with the fragmentation and ordering problem for you), and any association can be "peeled off" into a stream socket connection when you need a stream of bytes (like for transferring a large binary blob). Also, a single connection can be one-to-many, and each connection can have several channels -- thus also solving the problem of needing several bands. But only geeks even know about SCTP and its not supported everywhere, so that might put a dent in the plan; I assume this is in the context of the blog posts you just put up about stitching together program components over UDP sockets. You're either going to need multiple channels (UDP for your control messages and TCP connections for large transfer), or a multi-channel connection protocol like SCTP to fully accomplish what you're trying to do. This approach, incidentally, is my preferred way of thinking about system design -- and it makes me so sad that people think HTTP is the only protocol that exists! (And JSON and XML are the only serialization formats!) People just don't remember how to program sockets today -- and we don't make it better by ignoring the problem since it is so simple in Erlang, but can suck so hard and confusing in many other languages. Its pretty obvious why more programs don't support things like IPv6... nobody wants to touch the networking code if they can avoid it. (Much easier to just make an "API" over HTTP and pray that one day the web will be magically secure, bandwidth will be infinite and FavoriteWebServer will support feature X that you really wish you could use -- in other words, easier to stick one's head in the sand.) -Craig From ruel@REDACTED Wed Jan 27 16:58:09 2016 From: ruel@REDACTED (Pagayon, Ruel) Date: Wed, 27 Jan 2016 23:58:09 +0800 Subject: [erlang-questions] UDP questions In-Reply-To: References: Message-ID: >> 1) Can I find out the max binary size that can be sent/received? I believe you're getting that error because you exceeded the default value of the receive buffer, which is 8192 bytes. It's on the gen_udp doc. >> 2) Can I increase the max size? You can set the option {recbuf, ...} to change the max size. >> 3) Is there a guaranteed minimum packet length that will not be fragemented? >> 3) Can received packets be fragmented - TCP has a {packet,N} >> option and some built-in defragmentation, what's the story for >> UDP? In the network layer in general, both TCP and UDP can be sent through an interface, disassembled, and re-assembled at its destination. This can happen if the packet size exceeds the interface's MTU (e.g. 1500). In the application layer, with the {packet, N} option is viable in TCP because it's reliable and it has flow control. UDP can drop packets along the way and can be received out of order. Cheers, Ruel -------------- next part -------------- An HTML attachment was scrubbed... URL: From mallen@REDACTED Wed Jan 27 23:32:12 2016 From: mallen@REDACTED (Mark Allen) Date: Wed, 27 Jan 2016 16:32:12 -0600 Subject: [erlang-questions] [ANN] 3 new lager releases Message-ID: I'm proud to announce 3 new lager releases today: 3.1.0 - introduces a new API to force rotations of a handler, sink or all. Introduces a new "rotate" message for 3rd party backends - hence the new minor version number. 3.0.3 - About 6 community contributed PRs and a couple bug fixes from issues written by me. We wanted to make sure we tagged and released all the non-breaking changes in a final 3.0.x release before we merged the new minor release. 2.2.1 - A fix related to Unicode byte values and a backport of a fix to remove backends properly when stopping traces. Huge thanks to my work colleagues John Daily and Brian Sparrow for reviewing and working on these PRs with me. We have gotten a lot of great contributions from Erlangers around lager and its great to be able to give back. Thank you so much! I also started a change log at the bottom of the lager readme, if you want more details. Each change is pegged to its pull request id if you want all the gory details. Mark Allen -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Thu Jan 28 02:24:39 2016 From: serge@REDACTED (Serge Aleynikov) Date: Wed, 27 Jan 2016 20:24:39 -0500 Subject: [erlang-questions] UDP questions In-Reply-To: References: Message-ID: In addition to what others have said, the max UDP binary size that can be sent/received is: 64k - (sizeof(IPHeader) + sizeof(UDPHeader)) = 65535- (20 + 8) = 65507. This is the UDP protocol's limitation. I would say if you use UDP, the {packet, N} option makes little sense, since each udp message is delivered as a whole (UDP is message oriented vs. TCP that is byte-oriented). I see between your 3rd and 4th questions there's some confusion. UDP fragmentation may happen at the network layer (IP) when sending a large datagram (> MTU size), but it's defragmented by the network stack, and delivered to the transport layer (UDP) and consequently the user space as a whole message (preserving message boundaries). Regards, Serge On Wed, Jan 27, 2016 at 10:27 AM, Joe Armstrong wrote: > Hello, > > I have a simple UDP client/server > > The server is on a fixed port 4567 - I open it like this > > {ok, Socket} = gen_udp:open(4567, [binary]), > > then wait for registrations > receive > {udp, Socket, _Ip, _Port, <<"register">>) -> > > > Clients do this: > > {ok, Socket} = gen_udp:open(0, [binary]), > gen_udp:send(Socket, "localhost", 44567, <<"register">>), > ... > > I'm testing on "localhost" > > After registration the processes send binaries to each other > > This works fine for small binaries but gen_udp:send fails with > {error,emsgsize} for large binaries > > So I have a few questions: > > 1) Can I find out the max binary size that can be sent/received? > 2) Can I increase the max size? > 3) Is there a guaranteed minimum packet length that will not be > fragemented? > 3) Can received packets be fragmented - TCP has a {packet,N} > option and some built-in defragmentation, what's the story for > UDP? > > I think I know the answers to these but I'm not really sure - could > somebody > who really knows enlighten me? > > Thanks > > /Joe > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From felixgallo@REDACTED Thu Jan 28 02:59:10 2016 From: felixgallo@REDACTED (Felix Gallo) Date: Wed, 27 Jan 2016 17:59:10 -0800 Subject: [erlang-questions] UDP questions In-Reply-To: References: Message-ID: I've used OSC pretty heavily with Erlang recently, and: 1) use wired connections where possible; wireless connections experience significantly higher packet loss, and at least two different models of wireless router displayed unusual behavior in which a steady train of UDP packets would get increasingly geometrically delayed for no apparent reason. 2) consult musician forums about wireless router brand / model / firmware combinations that seem to work with the specific tools you want to use, if you are going to use something like an iPad with TouchOSC or Lemur etc. as a manual controller. 3) use OSC bundles where possible; not all languages have libraries which are good at that particular section of the spec, but properly implemented bundles can significantly improve sync and a feeling of snappiness in non-musical applications, such as higher level control. 4) Limit your packet sizes to 1500 bytes or lower on a LAN. For single messages this is usually pretty easy unless you're trying to send data instead of commands, which I don't recommend. You can breach the limit if you pack a bunch of commands into a bundle, but if your application layer is smart, it can fill up an outgoing packet to 500 bytes or whatever, and then save off any further messages for the next packet. With good switches, good PHYs (e.g. Intel), good OS with well-tuned buffers or good defaults, you should be able to run at 100Mb line rate. In the real world, sometimes you don't get to pick all of those things, so having your OSC code be tunable (or self-tunable) down in packet size and packet rate is a good practice. 5) OSC is super awesome because there's a bunch of controllers, libraries, real time graphical monitors, etc., for it, and it's pretty familiar in the entertainment space, but it's also pretty verbose and hefty on the wire. Cap'n Proto, protobufs and thrift are nearby cousins that deserve a look or two if you're really pushing OSC out of its comfort envelope. F. On Wed, Jan 27, 2016 at 5:24 PM, Serge Aleynikov wrote: > In addition to what others have said, the max UDP binary size that can be > sent/received is: > 64k - (sizeof(IPHeader) + sizeof(UDPHeader)) = 65535- (20 + 8) = 65507. > This is the UDP protocol's limitation. I would say if you use UDP, the > {packet, N} option makes little sense, since each udp message is delivered > as a whole (UDP is message oriented vs. TCP that is byte-oriented). > > I see between your 3rd and 4th questions there's some confusion. UDP > fragmentation may happen at the network layer (IP) when sending a large > datagram (> MTU size), but it's defragmented by the network stack, and > delivered to the transport layer (UDP) and consequently the user space as a > whole message (preserving message boundaries). > > Regards, > > Serge > > On Wed, Jan 27, 2016 at 10:27 AM, Joe Armstrong wrote: > >> Hello, >> >> I have a simple UDP client/server >> >> The server is on a fixed port 4567 - I open it like this >> >> {ok, Socket} = gen_udp:open(4567, [binary]), >> >> then wait for registrations >> receive >> {udp, Socket, _Ip, _Port, <<"register">>) -> >> >> >> Clients do this: >> >> {ok, Socket} = gen_udp:open(0, [binary]), >> gen_udp:send(Socket, "localhost", 44567, <<"register">>), >> ... >> >> I'm testing on "localhost" >> >> After registration the processes send binaries to each other >> >> This works fine for small binaries but gen_udp:send fails with >> {error,emsgsize} for large binaries >> >> So I have a few questions: >> >> 1) Can I find out the max binary size that can be sent/received? >> 2) Can I increase the max size? >> 3) Is there a guaranteed minimum packet length that will not be >> fragemented? >> 3) Can received packets be fragmented - TCP has a {packet,N} >> option and some built-in defragmentation, what's the story for >> UDP? >> >> I think I know the answers to these but I'm not really sure - could >> somebody >> who really knows enlighten me? >> >> Thanks >> >> /Joe >> _______________________________________________ >> 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 lheadley@REDACTED Thu Jan 28 02:00:57 2016 From: lheadley@REDACTED (Lyn Headley) Date: Wed, 27 Jan 2016 17:00:57 -0800 Subject: [erlang-questions] Recommendations for secure websocket + fallbacks Message-ID: I am developing a web app that will use client-side js code that I am writing to issue cross-origin requests from a domain not under my control to a web server under my control; and am evaluating whether to use websockets, long-polling, or another method. I need to consider things like browser compatibility (the more browsers supported, the better) and security (requests / packets must be secure, so https or wss I think). My ideal solution will support low latency messaging and high scalability, but will also support most browsers, and be easy to install and configure. One tactic for example would be to prefer websockets, but fall back to long-polling, which is what I understand socket.io does. I would be interested to hear any experiences you might have in this domain, and any recommendations you might have for erlang libraries, servers, etc. Has anyone done this? What stack did you deploy? What were the issues you encountered? I have a slight bias in favor of yaws, because I have already gotten it running, but am open to other web servers if it turns out to be too hard to make yaws do what I want. Thanks, Lyn From the.artiegold@REDACTED Thu Jan 28 02:34:02 2016 From: the.artiegold@REDACTED (Artie Gold) Date: Wed, 27 Jan 2016 19:34:02 -0600 Subject: [erlang-questions] UDP questions In-Reply-To: References: Message-ID: <7653C261-FDB5-4128-99A4-36E7EB681609@gmail.com> If, of course, it arrives at all. Larger messages, spanning several MTUs are more likely to be dropped. Sent from my iPhone > On Jan 27, 2016, at 7:24 PM, Serge Aleynikov wrote: > > In addition to what others have said, the max UDP binary size that can be sent/received is: > 64k - (sizeof(IPHeader) + sizeof(UDPHeader)) = 65535- (20 + 8) = 65507. This is the UDP protocol's limitation. I would say if you use UDP, the {packet, N} option makes little sense, since each udp message is delivered as a whole (UDP is message oriented vs. TCP that is byte-oriented). > > I see between your 3rd and 4th questions there's some confusion. UDP fragmentation may happen at the network layer (IP) when sending a large datagram (> MTU size), but it's defragmented by the network stack, and delivered to the transport layer (UDP) and consequently the user space as a whole message (preserving message boundaries). > > Regards, > > Serge > >> On Wed, Jan 27, 2016 at 10:27 AM, Joe Armstrong wrote: >> Hello, >> >> I have a simple UDP client/server >> >> The server is on a fixed port 4567 - I open it like this >> >> {ok, Socket} = gen_udp:open(4567, [binary]), >> >> then wait for registrations >> receive >> {udp, Socket, _Ip, _Port, <<"register">>) -> >> >> >> Clients do this: >> >> {ok, Socket} = gen_udp:open(0, [binary]), >> gen_udp:send(Socket, "localhost", 44567, <<"register">>), >> ... >> >> I'm testing on "localhost" >> >> After registration the processes send binaries to each other >> >> This works fine for small binaries but gen_udp:send fails with >> {error,emsgsize} for large binaries >> >> So I have a few questions: >> >> 1) Can I find out the max binary size that can be sent/received? >> 2) Can I increase the max size? >> 3) Is there a guaranteed minimum packet length that will not be fragemented? >> 3) Can received packets be fragmented - TCP has a {packet,N} >> option and some built-in defragmentation, what's the story for >> UDP? >> >> I think I know the answers to these but I'm not really sure - could somebody >> who really knows enlighten me? >> >> Thanks >> >> /Joe >> _______________________________________________ >> 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 zxq9@REDACTED Thu Jan 28 07:49:56 2016 From: zxq9@REDACTED (zxq9) Date: Thu, 28 Jan 2016 15:49:56 +0900 Subject: [erlang-questions] UDP questions In-Reply-To: <7653C261-FDB5-4128-99A4-36E7EB681609@gmail.com> References: <7653C261-FDB5-4128-99A4-36E7EB681609@gmail.com> Message-ID: <9505636.AmFrqQIEvZ@changa> On 2016?1?27? ??? 19:34:02 Artie Gold wrote: > If, of course, it arrives at all. Larger messages, spanning several MTUs > are more likely to be dropped. Exactly. That's why we tend to test for MTU and then stay below it, with the generally safe (and blind) guideline being 512 bytes total. This is pretty small, but control and status update messages tend not to be anywhere near this large in practice. Reliable transfer of data has to happen on a separate TCP connection, perhaps created in response to a UDP control message. -Craig From khitai.pang@REDACTED Thu Jan 28 08:22:22 2016 From: khitai.pang@REDACTED (Khitai Pang) Date: Thu, 28 Jan 2016 15:22:22 +0800 Subject: [erlang-questions] string concatenation efficiency Message-ID: Hi, For string concatenation, which one of the following is the most efficient? 1) strings:join(["Item:{", ItemID, "}")], ""] 2) lists:append(["Item:{", ItemID, "}")]) 3) "Item:{" ++ ItemID ++ "}" Here ItemID is a UUID. Thanks Khitai From sergej.jurecko@REDACTED Thu Jan 28 08:25:29 2016 From: sergej.jurecko@REDACTED (=?UTF-8?Q?Sergej_Jure=C4=8Dko?=) Date: Thu, 28 Jan 2016 08:25:29 +0100 Subject: [erlang-questions] string concatenation efficiency In-Reply-To: References: Message-ID: If your string is going to be sent over a socket or written to a file, an iolist is always the most efficient: ["Item:{", ItemID, "}"] If you must have flat strings, just use ++ Sergej On Thu, Jan 28, 2016 at 8:22 AM, Khitai Pang wrote: > Hi, > > For string concatenation, which one of the following is the most efficient? > > 1) > strings:join(["Item:{", ItemID, "}")], ""] > > 2) > lists:append(["Item:{", ItemID, "}")]) > > 3) > "Item:{" ++ ItemID ++ "}" > > Here ItemID is a UUID. > > > Thanks > Khitai > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vimal7370@REDACTED Thu Jan 28 09:12:58 2016 From: vimal7370@REDACTED (Vimal Kumar) Date: Thu, 28 Jan 2016 13:42:58 +0530 Subject: [erlang-questions] ets:init_table/2 example Message-ID: Hi, Can someone give me a short code example of using ets:init_table/2 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz@REDACTED Thu Jan 28 09:50:07 2016 From: aschultz@REDACTED (Andreas Schultz) Date: Thu, 28 Jan 2016 09:50:07 +0100 Subject: [erlang-questions] UDP questions In-Reply-To: References: Message-ID: <56A9D63F.1040007@tpip.net> Hi, On 01/28/2016 02:24 AM, Serge Aleynikov wrote: > In addition to what others have said, the max UDP binary size that can be sent/received is: > 64k - (sizeof(IPHeader) + sizeof(UDPHeader)) = 65535- (20 + 8) = 65507. This is the UDP protocol's limitation. I would say if you use UDP, > the {packet, N} option makes little sense, since each udp message is delivered as a whole (UDP is message oriented vs. TCP that is > byte-oriented). > > I see between your 3rd and 4th questions there's some confusion. UDP fragmentation may happen at the network layer (IP) when sending a large > datagram (> MTU size), but it's defragmented by the network stack, and delivered to the transport layer (UDP) and consequently the user > space as a whole message (preserving message boundaries). What you describe here is happens when the DF (don't fragment) bit in the IP header is not set. When the DF bit set, the first hop (which might be your local host) with a MTU smaller that your datagram size, will send an ICMP error with the reason set to "fragmentation needed". This ICMP will also include the largest MTU that this host can pass on. This procedure is also known as Path MTU discovery (PMTU disc). Whether your local host actually gets the ICMP error, depends on the (mis-)configuration of firewalls between the reporting hop and your host. This is what makes PMTU discovery somewhat unreliable. If your sending host does indeed get the ICMP report, it will usually store the new PMTU for the original destination IP. On Linux you should be able to inquire that value through the IP_MTU socket option (see 'man 7 ip' on Linux). A UDP datagram that was dropped due to a fragmentation needed error, even when your host did get the ICMP error, is not resent and you will not get a error from the socket. Only when you attempt to send another packet that is above the PMTU will you get a error from the socket. Note: The UDP socket error behaviour description above is what Erlang supports. At least on Linux you could configure the socket to report errors as OOB data and poll/select for that data. This error data would then need to be decode and forwarded to the socket owner as udp_error report. I have no idea if/how this work on other OSes. On Linux, UDP sockets are opened with systems defaults for the DF bit. In most cases this means the DF will be set on outgoing UDP datagrams. So any non localhost communication this will mean, that in the best case, your maximum usable UDP payload size will be 1472 (1500 - 20 - 8), the guaranteed minimum for IPv4 is 548 (576 - 20 - 8) and for IPv6 around 1200 (minimum MTU is 1280, but IPv6 header size can vary). It would be absolutely fantastic if Erlang would support proper PMTU discovery and error reporting on all supported OSes. I could contribute an Linux only version if there is a chance of having this as an officially supported feature. Regards, Andreas > > Regards, > > Serge > > On Wed, Jan 27, 2016 at 10:27 AM, Joe Armstrong > wrote: > > Hello, > > I have a simple UDP client/server > > The server is on a fixed port 4567 - I open it like this > > {ok, Socket} = gen_udp:open(4567, [binary]), > > then wait for registrations > receive > {udp, Socket, _Ip, _Port, <<"register">>) -> > > > Clients do this: > > {ok, Socket} = gen_udp:open(0, [binary]), > gen_udp:send(Socket, "localhost", 44567, <<"register">>), > ... > > I'm testing on "localhost" > > After registration the processes send binaries to each other > > This works fine for small binaries but gen_udp:send fails with > {error,emsgsize} for large binaries > > So I have a few questions: > > 1) Can I find out the max binary size that can be sent/received? > 2) Can I increase the max size? > 3) Is there a guaranteed minimum packet length that will not be fragemented? > 3) Can received packets be fragmented - TCP has a {packet,N} > option and some built-in defragmentation, what's the story for > UDP? > > I think I know the answers to these but I'm not really sure - could somebody > who really knows enlighten me? > > Thanks > > /Joe > _______________________________________________ > 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 msilvestre@REDACTED Thu Jan 28 10:33:27 2016 From: msilvestre@REDACTED (Miguel Silvestre) Date: Thu, 28 Jan 2016 09:33:27 +0000 Subject: [erlang-questions] Programing Erlang - second editon Chapter 25 In-Reply-To: <20160127134947.GO28491@fhebert-ltm2.internal.salesforce.com> References: <56A7C8BF.6090708@cs.ntua.gr> <20160127134947.GO28491@fhebert-ltm2.internal.salesforce.com> Message-ID: Thank you very nuch, That worked {ovirrides, }... ! -- Miguel Silvestre On Wed, Jan 27, 2016 at 1:49 PM, Fred Hebert wrote: > > On 01/27, Jesper Louis Andersen wrote: > >> It would be worthwhile to provide a 18.x-ready version of Bitcask anyway, >> though, because eventually they will need to upgrade :) >> > > We got bitcask to work with 18.x at Heroku using rebar3 with the following > entries in our rebar.config file: > > {deps, [ > {bitcask, {git, "https://github.com/basho/bitcask.git", {branch, > "develop"}}}, > ... > ]}. > {overrides, [ > {override, bitcask, [ > {erl_opts, [ > warnings_as_errors, debug_info, > {platform_define, "^[0-9]+", namespaced_types}, > {parse_transform, lager_transform} > ]}, > {deps, [lager]}, > {plugins, [pc]}, > {artifacts, ["priv/bitcask.so"]}, > {provider_hooks, [ > {post, [{compile, {pc, compile}}, > {clean, {pc, clean}}]} > ]} > ]} > ]}. > > It's quite a mouthful, but with these modifications we've been able to run > it fine on 18.x until upstream support is in. > > 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 roger@REDACTED Thu Jan 28 12:01:42 2016 From: roger@REDACTED (Roger Lipscombe) Date: Thu, 28 Jan 2016 11:01:42 +0000 Subject: [erlang-questions] How expensive are guard clauses? Message-ID: I'm considering adding more-expressive guard clauses to some of my functions, in order to prevent garbage data getting past certain points in my application. If I have a macro like something the following... -define(is_valid_id(Id), (is_binary(Id) andalso byte_size(Id) =:= 16 andalso Id =/= <<"0000000000000000">>)). ...and I use it in the following way... frobnicate(StudentId, CourseId) when ?is_valid_id(StudentId), ?is_valid_id(CourseId) -> ... ...just how expensive, in terms of timing, is that? Is it something I need to worry about? Can I scatter these guards everywhere? Should I restrict them to a few places? Should I make it so that they can be turned off in production (through a compiler define)? Obviously, I'll be looking to actually measure it, but I'm wondering if anyone's tried this and got anything to suggest. From carlsson.richard@REDACTED Thu Jan 28 12:22:12 2016 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Thu, 28 Jan 2016 12:22:12 +0100 Subject: [erlang-questions] How expensive are guard clauses? In-Reply-To: References: Message-ID: See http://erlang.org/doc/man/assert.hrl.html (requires Erlang/OTP 18 or later, otherwise the same macros can only be accessed by including eunit.hrl). /Richard 2016-01-28 12:01 GMT+01:00 Roger Lipscombe : > I'm considering adding more-expressive guard clauses to some of my > functions, in order to prevent garbage data getting past certain > points in my application. > > If I have a macro like something the following... > > -define(is_valid_id(Id), > (is_binary(Id) andalso byte_size(Id) =:= 16 andalso Id =/= > <<"0000000000000000">>)). > > ...and I use it in the following way... > > frobnicate(StudentId, CourseId) when ?is_valid_id(StudentId), > ?is_valid_id(CourseId) -> > ... > > ...just how expensive, in terms of timing, is that? Is it something I > need to worry about? Can I scatter these guards everywhere? Should I > restrict them to a few places? Should I make it so that they can be > turned off in production (through a compiler define)? > > Obviously, I'll be looking to actually measure it, but I'm wondering > if anyone's tried this and got anything to suggest. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlsson.richard@REDACTED Thu Jan 28 12:24:57 2016 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Thu, 28 Jan 2016 12:24:57 +0100 Subject: [erlang-questions] string concatenation efficiency In-Reply-To: References: Message-ID: Note that ++ is just an operator alias for lists:append/2. /Richard 2016-01-28 8:22 GMT+01:00 Khitai Pang : > Hi, > > For string concatenation, which one of the following is the most efficient? > > 1) > strings:join(["Item:{", ItemID, "}")], ""] > > 2) > lists:append(["Item:{", ItemID, "}")]) > > 3) > "Item:{" ++ ItemID ++ "}" > > Here ItemID is a UUID. > > > Thanks > Khitai > _______________________________________________ > 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 Jan 28 13:53:30 2016 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 28 Jan 2016 13:53:30 +0100 Subject: [erlang-questions] string concatenation efficiency In-Reply-To: References: Message-ID: On Thu, Jan 28, 2016 at 8:22 AM, Khitai Pang wrote: > For string concatenation, which one of the following is the most efficient? Ask eministat, but note that the A ++ B ++ C is probably recognized by the compiler as dead code, so we might be checking a loop here. Another note is that a single invocation has no measurable difference, so unless you are doing millions of these, it doesn't matter. Code and output follows. The ++ variant is fastest followed by the lists:append followed by the string:concat. But there is a lot of outlier variance in these measurements which suggest it is highly affected by outside factors. Don't put too much into these numbers and their precision as there is a lot of variance in runtime. ----- -module(concat). -export([t/0, datasets/0]). c1(Items) -> c1(Items, 10000). c1(_, 0) -> ok; c1(Items, K) -> string:join(Items, ""), c1(Items, K-1). c2(Items) -> c2(Items, 10000). c2(_, 0) -> ok; c2(Items, K) -> lists:append(Items), c2(Items, K-1). c3(Items) -> c3(Items, 10000). c3(_, 0) -> ok; c3([A,B,C] = Is, K) -> _ = A ++ B ++ C, c3(Is, K-1). datasets() -> ItemID = "123134-123-12313-1--123-1231-", Input = ["Item:{", ItemID, "}"], [eministat:s("++", fun() -> c3(Input) end, 50), eministat:s("strings:join/1", fun() -> c1(Input) end, 50), eministat:s("lists:append", fun() -> c2(Input) end, 50)]. t() -> [H | T] = datasets(), eministat:x(95.0, H, T). -------------- 18> concat:t(). x ++ + strings:join/1 * lists:append +--------------------------------------------------------------------------+ |x xx x xxxxx+++****x *+ ***x +** + +*+ ++ +++++++++++ xx + +| | x xx xxxx*** * x **** * + + + + ++++ | | x x xxxx*** * **** + ++++ | | x xxx *** *** + ++++ | | x xxx * * *** + +++ | | x x * * +++ | | x * + + | | x * + + | | x * + | | |_________MA__________| | | |______A_M____| | | |______AM_____| | +--------------------------------------------------------------------------+ ------ Dataset: x N=50 CI=95.0000 Statistic Value [ Bias] (Bootstrapped LB?UB) Min: 1404.00 1st Qu. 1730.00 Median: 1803.00 3rd Qu. 1844.00 Max: 3180.00 Average: 1844.26 [ 6.50820e-2] ( 1778.54 ? 1967.80) Std. Dev: 320.492 [ -13.6930] ( 177.997 ? 502.461) Outliers: 3/6 = 9 (?=1844.33, ?=306.799) Outlier variance: 0.852347 (severe, the data set is probably unusable) ------ Dataset: + N=50 CI=95.0000 Statistic Value [ Bias] (Bootstrapped LB?UB) Min: 2339.00 1st Qu. 2779.00 Median: 2965.00 3rd Qu. 3017.00 Max: 3523.00 Average: 2903.64 [ -1.28160e-2] ( 2847.28 ? 2959.10) Std. Dev: 200.957 [ -3.90939] ( 159.507 ? 269.636) Outliers: 1/1 = 2 (?=2903.63, ?=197.048) Outlier variance: 0.483689 (moderate) Difference at 95.0% confidence 1059.38 ? 106.139 57.4420% ? 5.75510% (Student's t, pooled s = 267.487) ------ Dataset: * N=50 CI=95.0000 Statistic Value [ Bias] (Bootstrapped LB?UB) Min: 1841.00 1st Qu. 1927.00 Median: 2158.00 3rd Qu. 2300.00 Max: 2586.00 Average: 2125.90 [ -0.186946] ( 2070.88 ? 2184.36) Std. Dev: 206.241 [ -2.58143] ( 189.011 ? 239.516) Outliers: 0/0 = 0 (?=2125.71, ?=203.660) Outlier variance: 0.645536 (severe, the data set is probably unusable) Difference at 95.0% confidence 281.640 ? 106.934 15.2712% ? 5.79820% (Student's t, pooled s = 269.491) ------ ok 19> -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Thu Jan 28 15:08:14 2016 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 28 Jan 2016 09:08:14 -0500 Subject: [erlang-questions] Recommendations for secure websocket + fallbacks In-Reply-To: References: Message-ID: <20160128140813.GP28491@fhebert-ltm2.internal.salesforce.com> On 01/27, Lyn Headley wrote: > My ideal solution will support low latency messaging and >high scalability, but will also support most browsers, and be easy to >install and configure. One tactic for example would be to prefer >websockets, but fall back to long-polling, which is what I understand >socket.io does. > This is what socket.io *did*. At some point around release 0.7, socket.io became a full blown framework mandating redis on the backend and whatnot. I used to be one of the maintainer of an Erlang implementation and we abandoned it at that point -- we had signed up for a translation/compatibility layer, not maintaining a full web framework (nevermind the weird protocol implementation). >I would be interested to hear any experiences you might have in this >domain, and any recommendations you might have for erlang libraries, >servers, etc. Has anyone done this? What stack did you deploy? What >were the issues you encountered? > Sadly I'm afraid I can't be of much more help there. I've left a lot of my web dev work behind me. Something equivalent in spirit to the socket.io of old, but with the Erlang frame of mind is 'bullet', developped to work with cowboy: https://github.com/ninenines/bullet It's what I would consider your best bet, but I'm out of the game when it comes to that stuff and don't know what else may exist. Regards, Fred. From jose.valim@REDACTED Thu Jan 28 15:51:56 2016 From: jose.valim@REDACTED (=?UTF-8?Q?Jos=C3=A9_Valim?=) Date: Thu, 28 Jan 2016 15:51:56 +0100 Subject: [erlang-questions] Recommendations for secure websocket + fallbacks In-Reply-To: References: Message-ID: Hi Lyn, I usually avoid posting Elixir related solutions in here but, if Elixir is an option, you should take a look at Phoenix: http://www.phoenixframework.org/ Phoenix is a framework running on top of Cowboy and has a feature called channels that seems to provide what you are looking for: * Handle websockets and fallback to long-polling when websockets is not available * Support cross-origin headers in both websockets and long-polling transports * Good browser compatibility (our long-polling implementation supports way back to IE8) * Ability to "force" SSL, allowing only https/ws connections Channels run on top of a pubsub system, which allows anywhere in your application to broadcast messages to all connected clients on a given topic. We have recently written on how we got 2 million websocket connections on a single machine (at an arrival rate of 20k/s iirc). Finally, the pubsub system is distributed. So if you want to deploy over multiple machines, we will use Distributed Erlang. No need for Redis. We are also working on a Phoenix Presence feature, using CRDTs alongside Distributed Erlang, so if you need presence support in the future, it will be handy too. If you are interested in more information, you can try the Phoenix guides , the mailing list or join us on #elixir-lang on IRC Freenode. *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D On Thu, Jan 28, 2016 at 2:00 AM, Lyn Headley wrote: > I am developing a web app that will use client-side js code that I am > writing to issue cross-origin requests from a domain not under my > control to a web server under my control; and am evaluating whether to > use websockets, long-polling, or another method. I need to consider > things like browser compatibility (the more browsers supported, the > better) and security (requests / packets must be secure, so https or > wss I think). My ideal solution will support low latency messaging and > high scalability, but will also support most browsers, and be easy to > install and configure. One tactic for example would be to prefer > websockets, but fall back to long-polling, which is what I understand > socket.io does. > > I would be interested to hear any experiences you might have in this > domain, and any recommendations you might have for erlang libraries, > servers, etc. Has anyone done this? What stack did you deploy? What > were the issues you encountered? > > I have a slight bias in favor of yaws, because I have already gotten > it running, but am open to other web servers if it turns out to be too > hard to make yaws do what I want. > > Thanks, > Lyn > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Thu Jan 28 15:55:08 2016 From: donpedrothird@REDACTED (John Doe) Date: Thu, 28 Jan 2016 17:55:08 +0300 Subject: [erlang-questions] ANN: Erlang connector to Sophia DB Message-ID: Hi list, I've just released an Erlang dirty-nif based connector library for Sophia DB https://github.com/brigadier/esphi/ About the Sophia DB: https://github.com/pmwkaa/sophia/ http://sophia.systems/ Req: Erlang 18+ built with the --enable-dirty-schedules flag -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Thu Jan 28 16:38:34 2016 From: erlang@REDACTED (Joe Armstrong) Date: Thu, 28 Jan 2016 16:38:34 +0100 Subject: [erlang-questions] UDP questions In-Reply-To: References: Message-ID: On Thu, Jan 28, 2016 at 2:59 AM, Felix Gallo wrote: > I've used OSC pretty heavily with Erlang recently, and: > > 1) use wired connections where possible; wireless connections experience > significantly higher packet loss, and at least two different models of > wireless router displayed unusual behavior in which a steady train of UDP > packets would get increasingly geometrically delayed for no apparent reason. > > 2) consult musician forums about wireless router brand / model / firmware > combinations that seem to work with the specific tools you want to use, if > you are going to use something like an iPad with TouchOSC or Lemur etc. as a > manual controller. I want to connect iPad/Mac/various synths together. I hadn't heard of Lemur I just got a midi-to-osc bridge working (midi half in swift) - osc-in erlang :-) Just need bonjour and get http://nexusosc.com/ working then I can have fun ... > > 3) use OSC bundles where possible; not all languages have libraries which > are good at that particular section of the spec, but properly implemented > bundles can significantly improve sync and a feeling of snappiness in > non-musical applications, such as higher level control. > > 4) Limit your packet sizes to 1500 bytes or lower on a LAN. For single > messages this is usually pretty easy unless you're trying to send data > instead of commands, which I don't recommend. You can breach the limit if > you pack a bunch of commands into a bundle, but if your application layer is > smart, it can fill up an outgoing packet to 500 bytes or whatever, and then > save off any further messages for the next packet. With good switches, good > PHYs (e.g. Intel), good OS with well-tuned buffers or good defaults, you > should be able to run at 100Mb line rate. In the real world, sometimes you > don't get to pick all of those things, so having your OSC code be tunable > (or self-tunable) down in packet size and packet rate is a good practice. > > 5) OSC is super awesome because there's a bunch of controllers, libraries, > real time graphical monitors, etc., for it, and it's pretty familiar in the > entertainment space, but it's also pretty verbose and hefty on the wire. > Cap'n Proto, protobufs and thrift are nearby cousins that deserve a look or > two if you're really pushing OSC out of its comfort envelope. > I agree - the music world has a load of very cool devices - I've been playing with Pure Data and my head hurts /Joe > F. > > > On Wed, Jan 27, 2016 at 5:24 PM, Serge Aleynikov > wrote: >> >> In addition to what others have said, the max UDP binary size that can be >> sent/received is: >> 64k - (sizeof(IPHeader) + sizeof(UDPHeader)) = 65535- (20 + 8) = 65507. >> This is the UDP protocol's limitation. I would say if you use UDP, the >> {packet, N} option makes little sense, since each udp message is delivered >> as a whole (UDP is message oriented vs. TCP that is byte-oriented). >> >> I see between your 3rd and 4th questions there's some confusion. UDP >> fragmentation may happen at the network layer (IP) when sending a large >> datagram (> MTU size), but it's defragmented by the network stack, and >> delivered to the transport layer (UDP) and consequently the user space as a >> whole message (preserving message boundaries). >> >> Regards, >> >> Serge >> >> On Wed, Jan 27, 2016 at 10:27 AM, Joe Armstrong wrote: >>> >>> Hello, >>> >>> I have a simple UDP client/server >>> >>> The server is on a fixed port 4567 - I open it like this >>> >>> {ok, Socket} = gen_udp:open(4567, [binary]), >>> >>> then wait for registrations >>> receive >>> {udp, Socket, _Ip, _Port, <<"register">>) -> >>> >>> >>> Clients do this: >>> >>> {ok, Socket} = gen_udp:open(0, [binary]), >>> gen_udp:send(Socket, "localhost", 44567, <<"register">>), >>> ... >>> >>> I'm testing on "localhost" >>> >>> After registration the processes send binaries to each other >>> >>> This works fine for small binaries but gen_udp:send fails with >>> {error,emsgsize} for large binaries >>> >>> So I have a few questions: >>> >>> 1) Can I find out the max binary size that can be sent/received? >>> 2) Can I increase the max size? >>> 3) Is there a guaranteed minimum packet length that will not be >>> fragemented? >>> 3) Can received packets be fragmented - TCP has a {packet,N} >>> option and some built-in defragmentation, what's the story for >>> UDP? >>> >>> I think I know the answers to these but I'm not really sure - could >>> somebody >>> who really knows enlighten me? >>> >>> Thanks >>> >>> /Joe >>> _______________________________________________ >>> 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 Thu Jan 28 16:40:51 2016 From: erlang@REDACTED (Joe Armstrong) Date: Thu, 28 Jan 2016 16:40:51 +0100 Subject: [erlang-questions] UDP questions In-Reply-To: References: Message-ID: On Thu, Jan 28, 2016 at 2:24 AM, Serge Aleynikov wrote: > In addition to what others have said, the max UDP binary size that can be > sent/received is: > 64k - (sizeof(IPHeader) + sizeof(UDPHeader)) = 65535- (20 + 8) = 65507. > This is the UDP protocol's limitation. I would say if you use UDP, the > {packet, N} option makes little sense, since each udp message is delivered > as a whole (UDP is message oriented vs. TCP that is byte-oriented). > > I see between your 3rd and 4th questions there's some confusion. UDP > fragmentation may happen at the network layer (IP) when sending a large > datagram (> MTU size), but it's defragmented by the network stack, and > delivered to the transport layer (UDP) and consequently the user space as a > whole message (preserving message boundaries). Yes - it was my understanding that the UDP packet if it is received by the application is not fragmented - but I wasn't sure. /Joe > > Regards, > > Serge > > On Wed, Jan 27, 2016 at 10:27 AM, Joe Armstrong wrote: >> >> Hello, >> >> I have a simple UDP client/server >> >> The server is on a fixed port 4567 - I open it like this >> >> {ok, Socket} = gen_udp:open(4567, [binary]), >> >> then wait for registrations >> receive >> {udp, Socket, _Ip, _Port, <<"register">>) -> >> >> >> Clients do this: >> >> {ok, Socket} = gen_udp:open(0, [binary]), >> gen_udp:send(Socket, "localhost", 44567, <<"register">>), >> ... >> >> I'm testing on "localhost" >> >> After registration the processes send binaries to each other >> >> This works fine for small binaries but gen_udp:send fails with >> {error,emsgsize} for large binaries >> >> So I have a few questions: >> >> 1) Can I find out the max binary size that can be sent/received? >> 2) Can I increase the max size? >> 3) Is there a guaranteed minimum packet length that will not be >> fragemented? >> 3) Can received packets be fragmented - TCP has a {packet,N} >> option and some built-in defragmentation, what's the story for >> UDP? >> >> I think I know the answers to these but I'm not really sure - could >> somebody >> who really knows enlighten me? >> >> Thanks >> >> /Joe >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > From serge@REDACTED Thu Jan 28 19:19:42 2016 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 28 Jan 2016 13:19:42 -0500 Subject: [erlang-questions] color customization Message-ID: Is it possible to customize background color in the "View Module" window of the debugger? I have a dark theme in KDE, and the current white background in that window is very irritating. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.valim@REDACTED Fri Jan 29 02:11:43 2016 From: jose.valim@REDACTED (=?UTF-8?Q?Jos=C3=A9_Valim?=) Date: Fri, 29 Jan 2016 02:11:43 +0100 Subject: [erlang-questions] Recommendations for secure websocket + fallbacks In-Reply-To: References: Message-ID: Someone mentioned on Twitter there is N2O as well: https://github.com/synrc/n2o It is in Erlang and it seems to be more focused on WebSockets instead of a web framework like Phoenix. It may better suit your needs. :) *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D On Thu, Jan 28, 2016 at 3:51 PM, Jos? Valim wrote: > Hi Lyn, > > I usually avoid posting Elixir related solutions in here but, if Elixir is > an option, you should take a look at Phoenix: > http://www.phoenixframework.org/ > > Phoenix is a framework running on top of Cowboy and has a feature called > channels that seems to provide what you are looking for: > > * Handle websockets and fallback to long-polling when websockets is not > available > * Support cross-origin headers in both websockets and long-polling > transports > * Good browser compatibility (our long-polling implementation supports way > back to IE8) > * Ability to "force" SSL, allowing only https/ws connections > > Channels run on top of a pubsub system, which allows anywhere in your > application to broadcast messages to all connected clients on a given > topic. We have recently written on how we got 2 million websocket > connections on a single machine (at an arrival rate of 20k/s iirc). > > Finally, the pubsub system is distributed. So if you want to deploy over > multiple machines, we will use Distributed Erlang. No need for Redis. We > are also working on a Phoenix Presence feature, using CRDTs alongside > Distributed Erlang, so if you need presence support in the future, it will > be handy too. > > If you are interested in more information, you can try the Phoenix guides > , the mailing list > or join us on > #elixir-lang on IRC Freenode. > > > *Jos? Valim* > www.plataformatec.com.br > Skype: jv.ptec > Founder and Director of R&D > > On Thu, Jan 28, 2016 at 2:00 AM, Lyn Headley wrote: > >> I am developing a web app that will use client-side js code that I am >> writing to issue cross-origin requests from a domain not under my >> control to a web server under my control; and am evaluating whether to >> use websockets, long-polling, or another method. I need to consider >> things like browser compatibility (the more browsers supported, the >> better) and security (requests / packets must be secure, so https or >> wss I think). My ideal solution will support low latency messaging and >> high scalability, but will also support most browsers, and be easy to >> install and configure. One tactic for example would be to prefer >> websockets, but fall back to long-polling, which is what I understand >> socket.io does. >> >> I would be interested to hear any experiences you might have in this >> domain, and any recommendations you might have for erlang libraries, >> servers, etc. Has anyone done this? What stack did you deploy? What >> were the issues you encountered? >> >> I have a slight bias in favor of yaws, because I have already gotten >> it running, but am open to other web servers if it turns out to be too >> hard to make yaws do what I want. >> >> Thanks, >> Lyn >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Fri Jan 29 02:24:14 2016 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 29 Jan 2016 14:24:14 +1300 Subject: [erlang-questions] string concatenation efficiency In-Reply-To: References: Message-ID: <56AABF3E.7010800@cs.otago.ac.nz> On 28/01/16 8:22 pm, Khitai Pang wrote: > For string concatenation, which one of the following is the most > efficient? > > 1) > strings:join(["Item:{", ItemID, "}")], ""] > > 2) > lists:append(["Item:{", ItemID, "}")]) > > 3) > "Item:{" ++ ItemID ++ "}" > > Here ItemID is a UUID. For something this size, it hardly matters. The definition of lists:append/1 is append([E]) -> E; append([H|T]) -> H ++ append(T); append([]) -> []. so lists:append([A,B,C]) -> A ++ lists:append([B,C]) -> A ++ B ++ lists:append([C]) -> A ++ B ++ C. Clearly, there is no way for this to be more efficient than writing A ++ B ++ C directly. The definition of string:join/2 is join([], Sep) when is_list(Sep) -> []; join([H|T], Sep) -> H ++ lists:append([Sep ++ X || X <- T]). -- at least in 18.1 -- which rather startled me because I was expecting join([E], Sep) when is_list(Sep) -> E; join([H|T], Sep) -> H ++ Sep ++ join(T, Sep); join([], Sep) when is_list(Sep) -> []. Clearly, there is no way that either version of join/2 can be faster than append/1. In fact append/1 is measurably faster than the revised join/2, which is measurably faster than the original join/2, but you have to push the sizes ridiculously high to make these measurements. Really, I suggest you write whichever makes your intentions clearest to human readers, get the program going, then measure it. I would be surprised if this particular issue made any significant difference. But why are you using strings at all? Strings are an *interface* data type; you process them when you receive data from an external source and you generate them (or rather you generate iolists) when you are sending data to an external source, but for internal processing you usually want some sort of tree. Seeing "Item:{$ItemID}" suggests that maybe you *are* generating output for some external process, but in that case, perhaps you should just be sending along the iolist ["Item:{",ItemId,"}"] and *not* concatenating the pieces. From jspain@REDACTED Fri Jan 29 01:05:13 2016 From: jspain@REDACTED (Josh Spain) Date: Thu, 28 Jan 2016 18:05:13 -0600 Subject: [erlang-questions] MongooseIM - Expose Roster Information to External Server Message-ID: I have some MongooseIM servers and would like to provide the roster information to another (non-XMPP) server. The ways I have thought of to do this are the following: - Use the ODBC roster module and pull the information directly from the SQL DB - Write a plugin that exposes the information through a REST API These roster queries would not happen at high volume. What would the impact of using SQL to store roster information have on the XMPP servers? Is there a preferred way to do something like this? Thanks, Josh -------------- next part -------------- An HTML attachment was scrubbed... URL: From pavananms@REDACTED Fri Jan 29 06:33:54 2016 From: pavananms@REDACTED (Pavanan M S) Date: Fri, 29 Jan 2016 11:03:54 +0530 Subject: [erlang-questions] rebar3 shell showing error Message-ID: Hi all, Whenever I try to open rebar3 shell the following message appears. The shell does work but this message keep on coming even in different project's shells. {error_logger,{{2016,1,26},{18,54,46}},?~s~n?,["driver_select(0x00007f6d0aa02470, 0, ERL_DRV_READ ERL_DRV_USE, 1) by tty_sl (tty_sl -c -e) driver #Port<0.15063> stealing control of fd=0 from input driver fd (0/1) #Port<0.298> \n"]} Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:4:4] [async-threads:0] [kernel-poll:false] What is this error? -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc@REDACTED Fri Jan 29 09:33:16 2016 From: marc@REDACTED (Marc Worrell) Date: Fri, 29 Jan 2016 09:33:16 +0100 Subject: [erlang-questions] Recommendations for secure websocket + fallbacks In-Reply-To: References: Message-ID: And if you need some content-management features (templates, multi-lingual, timezones, etc) then you can also use Zotonic :) http://channel.me uses it as the backend for their co-browsing solution. They place an iframe for their communication on the client?s website, this solves many (browser-)security issues. Zotonic?s client/server transports are battle tested with weird phones, corporate networks, and ancient Internet Explorer browsers. Some features of Zotonic transports: * Quick determination to use Websockets or Comet * Fallback to Comet if Websockets is failing * AJAX or Websocket postbacks to the server * Different kinds of payloads, with their own delegate handlers * You can add your own handlers * Active ping/pong to test the connection and check session status * Pubsub using MQTT-topic trees, in the browser and on the server The MQTT pubsub enables publishing a message via MQTT to the server and receiving it in browsers. - Marc > On 29 jan. 2016, at 02:11, Jos? Valim wrote: > > Someone mentioned on Twitter there is N2O as well: https://github.com/synrc/n2o > > It is in Erlang and it seems to be more focused on WebSockets instead of a web framework like Phoenix. It may better suit your needs. :) > > > > Jos? Valim > www.plataformatec.com.br > Skype: jv.ptec > Founder and Director of R&D > > On Thu, Jan 28, 2016 at 3:51 PM, Jos? Valim > wrote: > Hi Lyn, > > I usually avoid posting Elixir related solutions in here but, if Elixir is an option, you should take a look at Phoenix: http://www.phoenixframework.org/ > > Phoenix is a framework running on top of Cowboy and has a feature called channels that seems to provide what you are looking for: > > * Handle websockets and fallback to long-polling when websockets is not available > * Support cross-origin headers in both websockets and long-polling transports > * Good browser compatibility (our long-polling implementation supports way back to IE8) > * Ability to "force" SSL, allowing only https/ws connections > > Channels run on top of a pubsub system, which allows anywhere in your application to broadcast messages to all connected clients on a given topic. We have recently written on how we got 2 million websocket connections on a single machine (at an arrival rate of 20k/s iirc). > > Finally, the pubsub system is distributed. So if you want to deploy over multiple machines, we will use Distributed Erlang. No need for Redis. We are also working on a Phoenix Presence feature, using CRDTs alongside Distributed Erlang, so if you need presence support in the future, it will be handy too. > > If you are interested in more information, you can try the Phoenix guides , the mailing list or join us on #elixir-lang on IRC Freenode. > > > Jos? Valim > www.plataformatec.com.br > Skype: jv.ptec > Founder and Director of R&D > > On Thu, Jan 28, 2016 at 2:00 AM, Lyn Headley > wrote: > I am developing a web app that will use client-side js code that I am > writing to issue cross-origin requests from a domain not under my > control to a web server under my control; and am evaluating whether to > use websockets, long-polling, or another method. I need to consider > things like browser compatibility (the more browsers supported, the > better) and security (requests / packets must be secure, so https or > wss I think). My ideal solution will support low latency messaging and > high scalability, but will also support most browsers, and be easy to > install and configure. One tactic for example would be to prefer > websockets, but fall back to long-polling, which is what I understand > socket.io does. > > I would be interested to hear any experiences you might have in this > domain, and any recommendations you might have for erlang libraries, > servers, etc. Has anyone done this? What stack did you deploy? What > were the issues you encountered? > > I have a slight bias in favor of yaws, because I have already gotten > it running, but am open to other web servers if it turns out to be too > hard to make yaws do what I want. > > Thanks, > Lyn > _______________________________________________ > 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 rob@REDACTED Fri Jan 29 11:17:17 2016 From: rob@REDACTED (Rob A'Court) Date: Fri, 29 Jan 2016 10:17:17 +0000 Subject: [erlang-questions] Time Granularity on Windows Message-ID: Hi I'm trying to take some timings in our app. I'm taking timestamps using erlang:monotonic_time when certain events happen but noticed that on windows these aren't what I?m expecting The test below on linux logs the difference as being about 1ms. without the sleep its about 0.001ms which is what I would expect. On windows, the diff is 16ms, even if i change the timer to 10ms sleep. without the timer the difference is always 0ms. lists:foreach(fun(X) -> First = erlang:monotonic_time(), timer:sleep(1), Second = erlang:monotonic_time(), TimeDiff = erlang:convert_time_unit((Second - First), native, nano_seconds)/1000000, io:write(TimeDiff), io:format("\r\n") end, lists:seq(1,100)). Is this a problem with something I am doing or with the granularity of the windows system clock? Is there another approach I could take to get accurate (~microsecond granularity) timestamps on windows and linux? Many thanks Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Fri Jan 29 11:32:42 2016 From: lukas@REDACTED (Lukas Larsson) Date: Fri, 29 Jan 2016 11:32:42 +0100 Subject: [erlang-questions] Time Granularity on Windows In-Reply-To: References: Message-ID: Hello, On Fri, Jan 29, 2016 at 11:17 AM, Rob A'Court wrote: > > Is this a problem with something I am doing or with the granularity of the > windows system clock? > It is a problem with the granularity of the monotonic time source on Windows. > > Is there another approach I could take to get accurate (~microsecond > granularity) timestamps on windows and linux? > > > Maybe try os:timestamp on windows? I can't remember what it falls back onto, but as it does not have any monoticity guarantees it may give better values. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Fri Jan 29 11:37:49 2016 From: lukas@REDACTED (Lukas Larsson) Date: Fri, 29 Jan 2016 11:37:49 +0100 Subject: [erlang-questions] rebar3 shell showing error In-Reply-To: References: Message-ID: Hello, On Fri, Jan 29, 2016 at 6:33 AM, Pavanan M S wrote: > Hi all, > Whenever I try to open rebar3 shell the following message > appears. The shell does work but this message keep on coming even in > different project's shells. > > > {error_logger,{{2016,1,26},{18,54,46}},?~s~n?,["driver_select(0x00007f6d0aa02470, > 0, ERL_DRV_READ ERL_DRV_USE, 1) by tty_sl (tty_sl -c -e) driver > #Port<0.15063> stealing control of fd=0 from input driver fd (0/1) > #Port<0.298> \n"]} > Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:4:4] [async-threads:0] > [kernel-poll:false] > > What is this error? > For some reason both the basic and tty shell drivers have started and are trying to select on the same file descriptor. The problem is probably somewhere around here: https://github.com/rebar/rebar3/blob/10948be896e71f9f461c602e3bd81c989a9411d7/src/rebar_prv_shell.erl#L114-L134 in the rebar3 code. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From mremond@REDACTED Fri Jan 29 13:14:03 2016 From: mremond@REDACTED (=?utf-8?Q?Micka=C3=ABl_R=C3=A9mond?=) Date: Fri, 29 Jan 2016 12:14:03 +0000 Subject: [erlang-questions] MongooseIM - Expose Roster Information to External Server In-Reply-To: References: Message-ID: <2DDC7BB7-648E-4FF6-B702-9A2AA1A8F6CB@process-one.net> Hello, > On 29 Jan 2016, at 00:05, Josh Spain wrote: > > I have some MongooseIM servers and would like to provide the roster information to another (non-XMPP) server. The ways I have thought of to do this are the following: > - Use the ODBC roster module and pull the information directly from the SQL DB > - Write a plugin that exposes the information through a REST API > > These roster queries would not happen at high volume. What would the impact of using SQL to store roster information has on the XMPP servers? Is there a preferred way to do something like this? For ejabberd and variations, the best approach is definitely not to duplicate the data. ejabberd is extensible with hooks and you can build your own roster module quite easily with hooks. You can write a roster plugin that will either access your database directly or that query it through Rest API. That's definitely the best approach. You can also have a look in the code at mod_shared_roster. It is a good example showing that you can even write alternative logic to roster management. You can mail me directly if you need some guidance. Cheers, -- Micka?l R?mond http://www.process-one.net From mononcqc@REDACTED Fri Jan 29 13:55:49 2016 From: mononcqc@REDACTED (Fred Hebert) Date: Fri, 29 Jan 2016 07:55:49 -0500 Subject: [erlang-questions] rebar3 shell showing error In-Reply-To: References: Message-ID: <20160129125548.GB32812@fhebert-ltm2.internal.salesforce.com> On 01/29, Lukas Larsson wrote: > >For some reason both the basic and tty shell drivers have started and are >trying to select on the same file descriptor. The problem is probably >somewhere around here: >https://github.com/rebar/rebar3/blob/10948be896e71f9f461c602e3bd81c989a9411d7/src/rebar_prv_shell.erl#L114-L134 >in the rebar3 code. Yeah, I haven't been able to reproduce this one. I brought changes to the code specifically to get rid of the issue a few weeks ago https://github.com/rebar/rebar3/pull/995 and I've had two reports of that stuff failing. As I said, I've been unable to reproduce it on the versions I tried on Linux, OSX, and Windows. So at this point I'm not quite sure how to go about, the VM is fighting us very hard in making sure we don't take over the IO system. Going about it any other way ensures that on the old shell, the escript running rebar3 crashes directly and any TERM=dumb or windows system cannot use it at all. If I'm able to reproduce the issue reliably I'm gonna try to fix it, but for now I'm not sure what I can do. From dangud@REDACTED Fri Jan 29 15:09:06 2016 From: dangud@REDACTED (Dan Gudmundsson) Date: Fri, 29 Jan 2016 14:09:06 +0000 Subject: [erlang-questions] color customization In-Reply-To: References: Message-ID: The debugger uses wxStyledTextCtrl which seems to override window manager settings for background, it is easy to override the hard coded values but different from other windows which is why it probably does not work by default. Not as trivial to fix so that it works for all (themes/OSes), tough. Example: diff --git a/lib/debugger/src/dbg_wx_code.erl b/lib/debugger/src/dbg_wx_code.erl index a0e6c94..cd85fe7 100644 --- a/lib/debugger/src/dbg_wx_code.erl +++ b/lib/debugger/src/dbg_wx_code.erl @@ -88,10 +88,12 @@ code_area(Parent) -> {?wxSTC_ERLANG_MODULES, {64,102,244}}, {?wxSTC_ERLANG_MODULES_ATT, {64,102,244}} ], + ?stc:styleSetBackground(Ed, ?wxSTC_STYLE_DEFAULT, {127,127,127}), SetStyle = fun({Style, Color}) -> ?stc:styleSetFont(Ed, Style, FixedFont), - ?stc:styleSetForeground(Ed, Style, Color) + ?stc:styleSetForeground(Ed, Style, Color), + ?stc:styleSetBackground(Ed, Style, {127,127,127}) end, [SetStyle(Style) || Style <- Styles], ?stc:setKeyWords(Ed, 0, keyWords()), I guess most of the other windows work OK then, since tables in observer are hardcoded in observer_defs.hrl, see BG_EVEN/ODD defines. Regards /Dan On Fri, Jan 29, 2016 at 1:49 PM Serge Aleynikov wrote: > How do I get the Window of that code view window? > > I tried: > 2> f(P1),f(P2), {links,[P1,P2]} = > erlang:process_info(whereis(dbg_wx_winman), links). > {links,[<0.273.0>,<0.1974.0>]} > (mta@REDACTED)10> wxWindow:setBackgroundColour(P2, {128,128,128}). > ** exception error: no function clause matching > wxWindow:setBackgroundColour(<0.1974.0>, > > Apparently the Window is not a Pid but some tuple created by wxWindow. > > If you could implement color customization/saving along with having a > default light/dark themes that would be great. > > This is currently what debugger looks like by default: > > [image: image.png] > > This is what observer looks like: > > [image: image.png] > > On Fri, Jan 29, 2016 at 4:16 AM, Dan Gudmundsson wrote: > >> >> Does wxWindow:setBackgroundColour(Window, Color) work? >> >> Anyway that is the simple part, storing configurations, for colors/fonts >> and so on is the large part of the patch. >> >> >> On Thu, Jan 28, 2016 at 7:20 PM Serge Aleynikov >> wrote: >> >>> Is it possible to customize background color in the "View Module" window >>> of the debugger? I have a dark theme in KDE, and the current white >>> background in that window is very irritating. >>> _______________________________________________ >>> 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: image.png Type: image/png Size: 92936 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23223 bytes Desc: not available URL: From rob@REDACTED Fri Jan 29 14:32:33 2016 From: rob@REDACTED (Rob A'Court) Date: Fri, 29 Jan 2016 13:32:33 +0000 Subject: [erlang-questions] Time Granularity on Windows In-Reply-To: References: Message-ID: Ok, fine. Thank you! We?ve done a bit more research and it looks like it is possible to get better granularity on Windows, but only by making a windows kernel call: http://erlang.org/pipermail/erlang-questions/2011-May/058940.html From: Lukas Larsson [mailto:lukas@REDACTED] Sent: 29 January 2016 10:33 To: Rob A'Court Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] Time Granularity on Windows Hello, On Fri, Jan 29, 2016 at 11:17 AM, Rob A'Court > wrote: Is this a problem with something I am doing or with the granularity of the windows system clock? It is a problem with the granularity of the monotonic time source on Windows. Is there another approach I could take to get accurate (~microsecond granularity) timestamps on windows and linux? Maybe try os:timestamp on windows? I can't remember what it falls back onto, but as it does not have any monoticity guarantees it may give better values. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas.larsson@REDACTED Fri Jan 29 15:37:59 2016 From: lukas.larsson@REDACTED (Lukas Larsson) Date: Fri, 29 Jan 2016 15:37:59 +0100 Subject: [erlang-questions] Time Granularity on Windows In-Reply-To: References: Message-ID: The problem with QPC is that it is not monotonic. From https://msdn.microsoft.com/en-us/library/dn553408.aspx. "Can the performance counter be used to order events in time? Yes. However, when comparing performance counter results that are acquired from different threads, values that differ by ? 1 tick have an ambiguous ordering as if they had an identical time stamp." If it wasn't for that small caveat we would have used it. Lukas On Fri, Jan 29, 2016 at 2:32 PM, Rob A'Court wrote: > Ok, fine. Thank you! > > > > We?ve done a bit more research and it looks like it is possible to get better granularity on Windows, but only by making a windows kernel call: > > http://erlang.org/pipermail/erlang-questions/2011-May/058940.html > > > > > > *From:* Lukas Larsson [mailto:lukas@REDACTED] > *Sent:* 29 January 2016 10:33 > *To:* Rob A'Court > *Cc:* erlang-questions@REDACTED > *Subject:* Re: [erlang-questions] Time Granularity on Windows > > > > Hello, > > > > On Fri, Jan 29, 2016 at 11:17 AM, Rob A'Court wrote: > > > > Is this a problem with something I am doing or with the granularity of the > windows system clock? > > > > It is a problem with the granularity of the monotonic time source on > Windows. > > > > > > Is there another approach I could take to get accurate (~microsecond > granularity) timestamps on windows and linux? > > > > > > Maybe try os:timestamp on windows? I can't remember what it falls back > onto, but as it does not have any monoticity guarantees it may give better > values. > > > > Lukas > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Fri Jan 29 15:47:36 2016 From: t@REDACTED (Tristan Sloughter) Date: Fri, 29 Jan 2016 08:47:36 -0600 Subject: [erlang-questions] Recommendations for secure websocket + fallbacks In-Reply-To: References: Message-ID: <1454078856.1740614.506233842.4051B559@webmail.messagingengine.com> I just wanted to second the Phoenix suggestion as someone who isn't even an Elixir user, so Jos? doesn't feel bad suggesting it here :) Unless you are really just being an HTTP API on top of something, in which case webmachine is great but if you want websockets you'll have to use something else like elli or cowboy directly, I always suggest going with Phoenix to anyone who asks. Of course, if you can move your needs even higher up you could go with Zotonic. Not only is the momentum with Phoenix but I've never felt Erlang the language itself is able to provide the abstractions necessary for building webapps efficiently. -- Tristan Sloughter t@REDACTED On Thu, Jan 28, 2016, at 08:51 AM, Jos? Valim wrote: > Hi Lyn, > > I usually avoid posting Elixir related solutions in here but, if Elixir is an option, you should take a look at Phoenix:?http://www.phoenixframework.org/ > > Phoenix is a framework running on top of Cowboy and has a feature called channels that seems to provide what you are looking for: > > * Handle websockets and fallback to long-polling when websockets is not available > * Support cross-origin headers in both websockets and long-polling transports > * Good browser compatibility (our long-polling implementation supports way back to IE8) > * Ability to "force" SSL, allowing only https/ws connections > > Channels run on top of a pubsub system, which allows anywhere in your application to broadcast messages to all connected clients on a given topic. We have recently written on how we got 2 million websocket connections on a single machine (at an arrival rate of 20k/s iirc). > > Finally, the pubsub system is distributed. So if you want to deploy over multiple machines, we will use Distributed Erlang. No need for Redis. We are also working on a Phoenix Presence feature, using CRDTs alongside Distributed Erlang, so if you need presence support in the future, it will be handy too. > > If you are interested in more information, you can try the?Phoenix guides[1], the mailing list[2] or join us on #elixir-lang on IRC Freenode. > > > > *Jos? Valim* > > www.plataformatec.com.br[3] > Skype: jv.ptec > Founder and Director of R&D > > > > On Thu, Jan 28, 2016 at 2:00 AM, Lyn Headley wrote: >> I am developing a web app that will use client-side js code that I am >> writing to issue cross-origin requests from a domain not under my >> control to a web server under my control; and am evaluating whether to >> use websockets, long-polling, or another method. I need to consider >> things like browser compatibility (the more browsers supported, the >> better) and security (requests / packets must be secure, so https or >> wss I think). My ideal solution will support low latency messaging and >> high scalability, but will also support most browsers, and be easy to >> install and configure. One tactic for example would be to prefer >> websockets, but fall back to long-polling, which is what I understand >> socket.io does. >> >> I would be interested to hear any experiences you might have in this >> domain, and any recommendations you might have for erlang libraries, >> servers, etc. Has anyone done this? What stack did you deploy? What >> were the issues you encountered? >> >> I have a slight bias in favor of yaws, because I have already gotten >> it running, but am open to other web servers if it turns out to be too >> hard to make yaws do what I want. >> >> Thanks, >> Lyn >> _______________________________________________ >> 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 Links: 1. http://www.phoenixframework.org/docs/overview 2. https://groups.google.com/forum/#!forum/phoenix-talk 3. http://www.plataformatec.com.br/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Fri Jan 29 16:19:22 2016 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Fri, 29 Jan 2016 16:19:22 +0100 Subject: [erlang-questions] Recommendations for secure websocket + fallbacks In-Reply-To: <20160128140813.GP28491@fhebert-ltm2.internal.salesforce.com> References: <20160128140813.GP28491@fhebert-ltm2.internal.salesforce.com> Message-ID: <56AB82FA.4030803@ninenines.eu> On 01/28/2016 03:08 PM, Fred Hebert wrote: >> I would be interested to hear any experiences you might have in this >> domain, and any recommendations you might have for erlang libraries, >> servers, etc. Has anyone done this? What stack did you deploy? What >> were the issues you encountered? >> > > Sadly I'm afraid I can't be of much more help there. I've left a lot of > my web dev work behind me. Something equivalent in spirit to the > socket.io of old, but with the Erlang frame of mind is 'bullet', > developped to work with cowboy: https://github.com/ninenines/bullet > > It's what I would consider your best bet, but I'm out of the game when > it comes to that stuff and don't know what else may exist. My recommendation today is to go with Websocket directly. If you take a look at http://caniuse.com/#feat=websockets you can see that it will just work on close to 90% of the global market share. Chances are your local market share is higher than that, but it could also be lower (in particular if you are writing an enterprise system). Depending on when you will ship, it might not even make sense to ask yourself this question anymore. If you ship even in 1 year it already makes little sense, it's much easier to partially disable functionality with a message recommending people update or switch browser. Note that in those %s, nearly 5% are about Opera Mini. Opera Mini is a very particular browser that supports very little interactive features. I would not count it in market share and so the total of browsers that do support Websocket today is closer to 95%. If you need to support Opera Mini, I don't think even something like Bullet or Sockjs or other will work. As far as which Websocket implementation to use, I would suggest Cowboy of course, since I wrote it, but I will go as far as to suggest Cowboy master if you care about Websocket compression, although master is about to receive more breaking changes from the work toward 2.0. Cheers, -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From rob@REDACTED Fri Jan 29 16:32:52 2016 From: rob@REDACTED (Rob A'Court) Date: Fri, 29 Jan 2016 15:32:52 +0000 Subject: [erlang-questions] Time Granularity on Windows In-Reply-To: References: Message-ID: I can appreciate it wouldn?t be suitable in the general case for time, but for our use case of timing intervals for performance analysis the monotonic nature is less important. From: Lukas Larsson [mailto:lukas.larsson@REDACTED] Sent: 29 January 2016 14:38 To: Rob A'Court Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] Time Granularity on Windows The problem with QPC is that it is not monotonic. From https://msdn.microsoft.com/en-us/library/dn553408.aspx. "Can the performance counter be used to order events in time? Yes. However, when comparing performance counter results that are acquired from different threads, values that differ by ? 1 tick have an ambiguous ordering as if they had an identical time stamp." If it wasn't for that small caveat we would have used it. Lukas On Fri, Jan 29, 2016 at 2:32 PM, Rob A'Court > wrote: Ok, fine. Thank you! We?ve done a bit more research and it looks like it is possible to get better granularity on Windows, but only by making a windows kernel call: http://erlang.org/pipermail/erlang-questions/2011-May/058940.html From: Lukas Larsson [mailto:lukas@REDACTED] Sent: 29 January 2016 10:33 To: Rob A'Court > Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] Time Granularity on Windows Hello, On Fri, Jan 29, 2016 at 11:17 AM, Rob A'Court > wrote: Is this a problem with something I am doing or with the granularity of the windows system clock? It is a problem with the granularity of the monotonic time source on Windows. Is there another approach I could take to get accurate (~microsecond granularity) timestamps on windows and linux? Maybe try os:timestamp on windows? I can't remember what it falls back onto, but as it does not have any monoticity guarantees it may give better values. Lukas _______________________________________________ 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 Jan 29 17:09:05 2016 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Fri, 29 Jan 2016 17:09:05 +0100 Subject: [erlang-questions] Recommendations for secure websocket + fallbacks In-Reply-To: References: <20160128140813.GP28491@fhebert-ltm2.internal.salesforce.com> <56AB82FA.4030803@ninenines.eu> Message-ID: <56AB8EA1.5080501@ninenines.eu> To add to that: If you need messaging or can design your application this way, then RabbitMQ is definitely a great solution. A few notes however: The SockJS in the Web STOMP plugin only accepts UTF-8 messages (this is also true of Bullet and most solutions that provide fallbacks). If you need binary, the Web STOMP plugin has a plain Websocket endpoint but that one has no fallback. The Web MQTT plugin currently does not work against the most recent RabbitMQ version, it will work against 3.6.1 onward. Right now you need to have an unreleased version of the RabbitMQ MQTT plugin that contains the required changes. The Web MQTT plugin is currently considered experimental. Feedback would however be much appreciated. Disclaimer: I wrote the Web MQTT plugin and am the current maintainer of the Web STOMP plugin. On 01/29/2016 04:57 PM, Santiago Fern?ndez wrote: > If you want to take advantage from another Erlang system for your > development, take a look to RabbitMQ. There is a Web STOMP plugin (using > SockJS or plain WebSockets). I'm not sure what are the pros and cons of > STOMP vs plain WebSocket (bandwith, performance, scalability, etc) but > it is easy to integrate. > > You can develop your own Erlang application an deploy it with the broker > in the same cluster, to avoid AMQP overhead (direct connection). Or you > can develop your own plugin using Erlang and using all RabbitMQ > infrastructure. > > There is also a plugin for MQTT over WebSockets under development. > > sorry for my english! > > > > -- > Santiago > > On Fri, Jan 29, 2016 at 12:19 PM, Lo?c Hoguin > wrote: > > On 01/28/2016 03:08 PM, Fred Hebert wrote: > > I would be interested to hear any experiences you might have > in this > domain, and any recommendations you might have for erlang > libraries, > servers, etc. Has anyone done this? What stack did you > deploy? What > were the issues you encountered? > > > Sadly I'm afraid I can't be of much more help there. I've left a > lot of > my web dev work behind me. Something equivalent in spirit to the > socket.io of old, but with the Erlang frame > of mind is 'bullet', > developped to work with cowboy: https://github.com/ninenines/bullet > > It's what I would consider your best bet, but I'm out of the > game when > it comes to that stuff and don't know what else may exist. > > > My recommendation today is to go with Websocket directly. > > If you take a look at http://caniuse.com/#feat=websockets you can > see that it will just work on close to 90% of the global market > share. Chances are your local market share is higher than that, but > it could also be lower (in particular if you are writing an > enterprise system). > > Depending on when you will ship, it might not even make sense to ask > yourself this question anymore. If you ship even in 1 year it > already makes little sense, it's much easier to partially disable > functionality with a message recommending people update or switch > browser. > > Note that in those %s, nearly 5% are about Opera Mini. Opera Mini is > a very particular browser that supports very little interactive > features. I would not count it in market share and so the total of > browsers that do support Websocket today is closer to 95%. If you > need to support Opera Mini, I don't think even something like Bullet > or Sockjs or other will work. > > As far as which Websocket implementation to use, I would suggest > Cowboy of course, since I wrote it, but I will go as far as to > suggest Cowboy master if you care about Websocket compression, > although master is about to receive more breaking changes from the > work toward 2.0. > > Cheers, > > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From trenthampton@REDACTED Fri Jan 29 16:39:59 2016 From: trenthampton@REDACTED (Trent Hampton) Date: Fri, 29 Jan 2016 08:39:59 -0700 Subject: [erlang-questions] Common test with rebar3 Message-ID: Thank you in advance for any help on this one. Background: I have a simple module in ./src/adb.erl I have a simple common test suite in ./test/my_SUITE.erl rebar.config has no added config for common test. When I run the common test suite below with 'rebar3 ct --suite my_SUITE' i get a badmatch error indicating that the module has not been loaded. Why? Do I need to preload the modules in the same project as the common tests? The error is below. -module(my_SUITE). -compile(export_all). all() -> [mod_exists]. mod_exists(_) -> % {module,mnesia} = code:load_file(mnesia), {module,adb} = code:load_file(adb). [root@REDACTED adb]# rebar3 ct --suite my_SUITE --config /opt/codecloud/adb/test/test.config ===> Verifying dependencies... ===> Running Common Test suites... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - my_SUITE:mod_exists failed on line 9 Reason: {badmatch,{error,nofile}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %%% my_SUITE ==> mod_exists: FAILED %%% my_SUITE ==> {failed,{{badmatch,{error,nofile}}, [{my_SUITE,mod_exists,1, [{file,"/opt/codecloud/adb/_build/test/extras/test/my_SUITE.erl"}, {line,9}]}, {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1408}]}, {test_server,run_test_case_eval1,6, [{file,"test_server.erl"},{line,984}]}, {test_server,run_test_case_eval,9, [{file,"test_server.erl"},{line,926}]}]}} Failed 1 tests. Passed 0 tests. Results written to "/opt/codecloud/adb/_build/test/logs/index.html". ===> Failures occured running tests: 1 -------------- next part -------------- An HTML attachment was scrubbed... URL: From santif@REDACTED Fri Jan 29 16:57:54 2016 From: santif@REDACTED (=?UTF-8?Q?Santiago_Fern=C3=A1ndez?=) Date: Fri, 29 Jan 2016 12:57:54 -0300 Subject: [erlang-questions] Recommendations for secure websocket + fallbacks In-Reply-To: <56AB82FA.4030803@ninenines.eu> References: <20160128140813.GP28491@fhebert-ltm2.internal.salesforce.com> <56AB82FA.4030803@ninenines.eu> Message-ID: If you want to take advantage from another Erlang system for your development, take a look to RabbitMQ. There is a Web STOMP plugin (using SockJS or plain WebSockets). I'm not sure what are the pros and cons of STOMP vs plain WebSocket (bandwith, performance, scalability, etc) but it is easy to integrate. You can develop your own Erlang application an deploy it with the broker in the same cluster, to avoid AMQP overhead (direct connection). Or you can develop your own plugin using Erlang and using all RabbitMQ infrastructure. There is also a plugin for MQTT over WebSockets under development. sorry for my english! -- Santiago On Fri, Jan 29, 2016 at 12:19 PM, Lo?c Hoguin wrote: > On 01/28/2016 03:08 PM, Fred Hebert wrote: > >> I would be interested to hear any experiences you might have in this >>> domain, and any recommendations you might have for erlang libraries, >>> servers, etc. Has anyone done this? What stack did you deploy? What >>> were the issues you encountered? >>> >>> >> Sadly I'm afraid I can't be of much more help there. I've left a lot of >> my web dev work behind me. Something equivalent in spirit to the >> socket.io of old, but with the Erlang frame of mind is 'bullet', >> developped to work with cowboy: https://github.com/ninenines/bullet >> >> It's what I would consider your best bet, but I'm out of the game when >> it comes to that stuff and don't know what else may exist. >> > > My recommendation today is to go with Websocket directly. > > If you take a look at http://caniuse.com/#feat=websockets you can see > that it will just work on close to 90% of the global market share. Chances > are your local market share is higher than that, but it could also be lower > (in particular if you are writing an enterprise system). > > Depending on when you will ship, it might not even make sense to ask > yourself this question anymore. If you ship even in 1 year it already makes > little sense, it's much easier to partially disable functionality with a > message recommending people update or switch browser. > > Note that in those %s, nearly 5% are about Opera Mini. Opera Mini is a > very particular browser that supports very little interactive features. I > would not count it in market share and so the total of browsers that do > support Websocket today is closer to 95%. If you need to support Opera > Mini, I don't think even something like Bullet or Sockjs or other will work. > > As far as which Websocket implementation to use, I would suggest Cowboy of > course, since I wrote it, but I will go as far as to suggest Cowboy master > if you care about Websocket compression, although master is about to > receive more breaking changes from the work toward 2.0. > > Cheers, > > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zandra.hird@REDACTED Fri Jan 29 17:38:31 2016 From: zandra.hird@REDACTED (Zandra Hird) Date: Fri, 29 Jan 2016 17:38:31 +0100 Subject: [erlang-questions] Patch Package OTP 18.2.3 Released Message-ID: <56AB9587.2010708@ericsson.com> Patch Package: OTP 18.2.3 Git Tag: OTP-18.2.3 Date: 2016-01-29 Trouble Report Id: OTP-13248 Seq num: System: OTP Release: 18 Application: inets-6.1.1 Predecessor: OTP 18.2.2 Check out the git tag OTP-18.2.3, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- inets-6.1.1 ----------------------------------------------------- --------------------------------------------------------------------- The inets-6.1.1 application can be applied independently of other applications on a full OTP 18 installation. --- Fixed Bugs and Malfunctions --- OTP-13248 Application(s): inets mod_alias now traverses all aliases picking the longest match and not the first match. Full runtime dependencies of inets-6.1.1: erts-6.0, kernel-3.0, mnesia-4.12, runtime_tools-1.8.14, ssl-5.3.4, stdlib-2.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From t@REDACTED Fri Jan 29 17:48:57 2016 From: t@REDACTED (Tristan Sloughter) Date: Fri, 29 Jan 2016 10:48:57 -0600 Subject: [erlang-questions] Common test with rebar3 In-Reply-To: References: Message-ID: <1454086137.1768916.506358690.032832D3@webmail.messagingengine.com> Please open an issue on github.com/rebar/rebar3 The quick fix is to do `rebar3 ct --suite test/my_SUITE` But I don't like that it runs the test suite even when you have `rebar3 ct --suite my_SUITE`... -- Tristan Sloughter t@REDACTED On Fri, Jan 29, 2016, at 09:39 AM, Trent Hampton wrote: > Thank you in advance for any help on this one. > > Background: > I have a simple module in ./src/adb.erl > I have a simple common test suite in ./test/my_SUITE.erl > rebar.config has no added config for common test. > > When I run the common test suite below with 'rebar3 ct --suite my_SUITE' i get a badmatch error indicating that the module has not been loaded. Why? Do I need to preload the modules in the same project as the common tests? > The error is below. > > -module(my_SUITE). > -compile(export_all). > > all() -> > ? [mod_exists]. > > mod_exists(_) -> > %? {module,mnesia} = code:load_file(mnesia), > ? {module,adb} = code:load_file(adb). > > [root@REDACTED adb]# rebar3 ct --suite my_SUITE --config /opt/codecloud/adb/test/test.config > ===> Verifying dependencies... > ===> Running Common Test suites... > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > my_SUITE:mod_exists failed on line 9 > Reason: {badmatch,{error,nofile}} > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > %%% my_SUITE ==> mod_exists: FAILED > %%% my_SUITE ==> {failed,{{badmatch,{error,nofile}}, > ???????? [{my_SUITE,mod_exists,1, > ??????????????????? [{file,"/opt/codecloud/adb/_build/test/extras/test/my_SUITE.erl"}, > ???????????????????? {line,9}]}, > ????????? {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1408}]}, > ????????? {test_server,run_test_case_eval1,6, > ?????????????????????? [{file,"test_server.erl"},{line,984}]}, > ????????? {test_server,run_test_case_eval,9, > ?????????????????????? [{file,"test_server.erl"},{line,926}]}]}} > Failed 1 tests. Passed 0 tests. > Results written to "/opt/codecloud/adb/_build/test/logs/index.html". > ===> Failures occured running tests: 1 > _________________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From unix1@REDACTED Fri Jan 29 17:54:02 2016 From: unix1@REDACTED (Unix One) Date: Fri, 29 Jan 2016 16:54:02 +0000 Subject: [erlang-questions] Generic turn based game server in Erlang Message-ID: Hello, Few months ago I asked if anyone was aware of a turn based game server framework in Erlang. I got helpful replies, but I couldn't find exactly what I was looking for. So, I wrote one: https://github.com/unix1/nuk It's a general turn based server which can be used to plug in any arbitrary turn based game via behavior callbacks. It's pretty bare bones (but flexible), and intentionally so. It's also relatively well documented, and I've implemented a sample multi-player game to serve for example/testing purposes. I'm wondering if: - anyone would be willing to review and give feedback; any kind of constructive feedback - game-related, general Erlang, documentation, etc. - is greatly appreciated - anyone is interested in developing this further to make it more use case driven and fully featured Thank you. From max.lapshin@REDACTED Fri Jan 29 22:53:11 2016 From: max.lapshin@REDACTED (Max Lapshin) Date: Sat, 30 Jan 2016 00:53:11 +0300 Subject: [erlang-questions] ANN: Erlang connector to Sophia DB In-Reply-To: References: Message-ID: Very cool! It is the backend for tarantool, yes? -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Fri Jan 29 23:08:29 2016 From: donpedrothird@REDACTED (John Doe) Date: Sat, 30 Jan 2016 01:08:29 +0300 Subject: [erlang-questions] ANN: Erlang connector to Sophia DB In-Reply-To: References: Message-ID: Yes, It's one of the tarantool's backends. The library is for direct access to sophia API, without tarantool. 2016-01-30 0:53 GMT+03:00 Max Lapshin : > Very cool! It is the backend for tarantool, yes? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Sat Jan 30 00:06:35 2016 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 29 Jan 2016 18:06:35 -0500 Subject: [erlang-questions] rebar3 hex publish Message-ID: How can I exclude certain files from rebar3 hex publish? In the list below I'd like to exclude *.d dependency files from the hex package, but it's not clear where/how it's specified: /opt/bin/rebar3 hex publish Publishing erlexec 1.0.1 Dependencies: Excluded dependencies (not part of the Hex package): Included files: erlexec/src/edoc.css erlexec/src/erlexec.app.src erlexec/src/exec.erl erlexec/src/exec_app.erl erlexec/src/overview.edoc erlexec/c_src/ei++.cpp erlexec/c_src/ei++.d erlexec/c_src/ei++.hpp erlexec/c_src/exec.cpp erlexec/c_src/exec.d erlexec/include/exec.hrl erlexec/rebar.config.script erlexec/priv/x86_64-unknown-linux-gnu/exec-port erlexec/rebar.config erlexec/rebar.lock erlexec/README.md erlexec/LICENSE Serge -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Sat Jan 30 00:11:41 2016 From: t@REDACTED (Tristan Sloughter) Date: Fri, 29 Jan 2016 17:11:41 -0600 Subject: [erlang-questions] rebar3 hex publish In-Reply-To: References: Message-ID: <1454109101.1852061.506672466.6143BDC9@webmail.messagingengine.com> There isn't an exclude files option currently: https://github.com/hexpm/rebar3_hex/issues/25 -- Tristan Sloughter t@REDACTED On Fri, Jan 29, 2016, at 05:06 PM, Serge Aleynikov wrote: > How can I exclude certain files from rebar3 hex publish? > > In the list below I'd like to exclude *.d dependency files from the hex package, but it's not clear where/how it's specified: > > /opt/bin/rebar3 hex publish > Publishing erlexec 1.0.1 > ? Dependencies: > > ? Excluded dependencies (not part of the Hex package): > > ? Included files: > ? ? erlexec/src/edoc.css > ? ? erlexec/src/erlexec.app.src > ? ? erlexec/src/exec.erl > ? ? erlexec/src/exec_app.erl > ? ? erlexec/src/overview.edoc > ? ? erlexec/c_src/ei++.cpp > ? ? erlexec/c_src/ei++.d > ? ? erlexec/c_src/ei++.hpp > ? ? erlexec/c_src/exec.cpp > ? ? erlexec/c_src/exec.d > ? ? erlexec/include/exec.hrl > ? ? erlexec/rebar.config.script > ? ? erlexec/priv/x86_64-unknown-linux-gnu/exec-port > ? ? erlexec/rebar.config > ? ? erlexec/rebar.lock > ? ? erlexec/README.md > ? ? erlexec/LICENSE > > > Serge > _________________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From christopher.meiklejohn@REDACTED Sat Jan 30 02:01:07 2016 From: christopher.meiklejohn@REDACTED (Christopher Meiklejohn) Date: Fri, 29 Jan 2016 17:01:07 -0800 Subject: [erlang-questions] Trouble with ct_slave node initialization Message-ID: I'm seeing the following behavior where ct_slave fails to initialize the node within the boot_timeout, however, the node is being registered via epmd and is pingable after initialization. (chris2@REDACTED)9> ct_slave:start('chris3@REDACTED'). {error,boot_timeout,chris3@REDACTED@box545} (chris2@REDACTED)10> net_adm:ping('chris3@REDACTED'). pong (chris2@REDACTED)11> net_adm:ping('chris4'). pang (chris2@REDACTED)12> ct_slave:start('chris4'). {error,boot_timeout,chris4@REDACTED} (chris2@REDACTED)13> net_adm:ping('chris4'). pang (chris2@REDACTED)14> (chris2@REDACTED)16> net_adm:ping('chris4@REDACTED'). pong The boxes hostname is box545, however Erlang is running with distribution on, but with only shortnames enabled. Thanks, Christopher From pavananms@REDACTED Sat Jan 30 10:55:00 2016 From: pavananms@REDACTED (Pavanan M S) Date: Sat, 30 Jan 2016 15:25:00 +0530 Subject: [erlang-questions] rebar3 shell showing error In-Reply-To: <20160129125548.GB32812@fhebert-ltm2.internal.salesforce.com> References: <20160129125548.GB32812@fhebert-ltm2.internal.salesforce.com> Message-ID: This also comes up everytime. Is this another such case? Or should I do anything about this? ===> Missing beam file elf_format <<"/usr/local/lib/erlang/lib/hipe-3.11.3/ebin/elf_format.beam">> Thank you On 29 January 2016 at 18:25, Fred Hebert wrote: > On 01/29, Lukas Larsson wrote: > >> >> For some reason both the basic and tty shell drivers have started and are >> trying to select on the same file descriptor. The problem is probably >> somewhere around here: >> >> https://github.com/rebar/rebar3/blob/10948be896e71f9f461c602e3bd81c989a9411d7/src/rebar_prv_shell.erl#L114-L134 >> in the rebar3 code. >> > > Yeah, I haven't been able to reproduce this one. I brought changes to the > code specifically to get rid of the issue a few weeks ago > https://github.com/rebar/rebar3/pull/995 and I've had two reports of that > stuff failing. > > As I said, I've been unable to reproduce it on the versions I tried on > Linux, OSX, and Windows. So at this point I'm not quite sure how to go > about, the VM is fighting us very hard in making sure we don't take over > the IO system. Going about it any other way ensures that on the old shell, > the escript running rebar3 crashes directly and any TERM=dumb or windows > system cannot use it at all. > > If I'm able to reproduce the issue reliably I'm gonna try to fix it, but > for now I'm not sure what I can do. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pavananms@REDACTED Sat Jan 30 14:22:32 2016 From: pavananms@REDACTED (Pavanan M S) Date: Sat, 30 Jan 2016 18:52:32 +0530 Subject: [erlang-questions] dependency not reachable Message-ID: hi all I was trying to convert a rest api example built using rebar to rebar3 release ( http://jordenlowe.com/title/Explain_like_I_am_5_-_Erlang_REST_Framework_Cowboy) . I have added jsx to app.src . This error comes up . ===> Failed to solve release: Dependency jsx is specified as a dependency but is not reachable by the system. What could be the reason for this. Also...Is there anything I need to do more when making this a rebar 3 release? Please help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kansi13@REDACTED Sat Jan 30 14:54:23 2016 From: kansi13@REDACTED (Vanshdeep Singh) Date: Sat, 30 Jan 2016 19:24:23 +0530 Subject: [erlang-questions] dependency not reachable In-Reply-To: References: Message-ID: make sure that jsx is specified in the Makefile too. On Sat, Jan 30, 2016 at 6:52 PM, Pavanan M S wrote: > hi all > I was trying to convert a rest api example built using rebar to > rebar3 release ( > http://jordenlowe.com/title/Explain_like_I_am_5_-_Erlang_REST_Framework_Cowboy) > . I have added jsx to app.src . > This error comes up . > > ===> Failed to solve release: > Dependency jsx is specified as a dependency but is not > reachable by the system. > > What could be the reason for this. Also...Is there anything I > need to do more when making this a rebar 3 release? Please help. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Sat Jan 30 16:46:03 2016 From: t@REDACTED (Tristan Sloughter) Date: Sat, 30 Jan 2016 09:46:03 -0600 Subject: [erlang-questions] rebar3 shell showing error In-Reply-To: References: <20160129125548.GB32812@fhebert-ltm2.internal.salesforce.com> Message-ID: <1454168763.2050573.507050650.79494A0A@webmail.messagingengine.com> That is a warning from relx. I've recently moved it to a debug message instead of a warning. You can ignore it and when you upgrade rebar3 it should go away. Best to keep rebar3 updated with `rebar3 local upgrade` (with older rebar3s the command is `rebar3 unstable upgrade`) -- Tristan Sloughter t@REDACTED On Sat, Jan 30, 2016, at 03:55 AM, Pavanan M S wrote: > > This also comes up everytime. Is this another such case? Or should I do anything about this? > > ===> Missing beam file elf_format <<"/usr/local/lib/erlang/lib/hipe-3.11.3/ebin/elf_format.beam">> > Thank you > > On 29 January 2016 at 18:25, Fred Hebert wrote: >> On 01/29, Lukas Larsson wrote: >>> >>> For some reason both the basic and tty shell drivers have started and are >>> trying to select on the same file descriptor. The problem is probably >>> somewhere around here: >>> https://github.com/rebar/rebar3/blob/10948be896e71f9f461c602e3bd81c989a9411d7/src/rebar_prv_shell.erl#L114-L134 >>> in the rebar3 code. >> >> Yeah, I haven't been able to reproduce this one. I brought changes to the code specifically to get rid of the issue a few weeks ago https://github.com/rebar/rebar3/pull/995 and I've had two reports of that stuff failing. >> >> As I said, I've been unable to reproduce it on the versions I tried on Linux, OSX, and Windows. So at this point I'm not quite sure how to go about, the VM is fighting us very hard in making sure we don't take over the IO system. Going about it any other way ensures that on the old shell, the escript running rebar3 crashes directly and any TERM=dumb or windows system cannot use it at all. >> >> If I'm able to reproduce the issue reliably I'm gonna try to fix it, but for now I'm not sure what I can do. > _________________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From khitai.pang@REDACTED Sat Jan 30 17:04:24 2016 From: khitai.pang@REDACTED (Khitai Pang) Date: Sun, 31 Jan 2016 00:04:24 +0800 Subject: [erlang-questions] string concatenation efficiency In-Reply-To: <56AABF3E.7010800@cs.otago.ac.nz> References: <56AABF3E.7010800@cs.otago.ac.nz> Message-ID: Thank you all for your answers. The concatenated string is a redis key, it will be part of an erlang message that will be sent to a redis client erlang process. I tried sending the iolist ["Item:{",ItemId,"}"], and it works fine. I think this is the most efficient way. Thanks Khitai On 2016/1/29 9:24, Richard A. O'Keefe wrote: > > On 28/01/16 8:22 pm, Khitai Pang wrote: >> For string concatenation, which one of the following is the most >> efficient? >> >> 1) >> strings:join(["Item:{", ItemID, "}")], ""] >> >> 2) >> lists:append(["Item:{", ItemID, "}")]) >> >> 3) >> "Item:{" ++ ItemID ++ "}" >> >> Here ItemID is a UUID. > For something this size, it hardly matters. > > The definition of lists:append/1 is > append([E]) -> E; > append([H|T]) -> H ++ append(T); > append([]) -> []. > so lists:append([A,B,C]) -> A ++ lists:append([B,C]) > -> A ++ B ++ lists:append([C]) > -> A ++ B ++ C. > Clearly, there is no way for this to be more efficient than > writing A ++ B ++ C directly. > > The definition of string:join/2 is > join([], Sep) when is_list(Sep) -> []; > join([H|T], Sep) -> H ++ lists:append([Sep > ++ X || X <- T]). > -- at least in 18.1 -- which rather startled me because I was expecting > join([E], Sep) when is_list(Sep) -> E; > join([H|T], Sep) -> H ++ Sep ++ join(T, Sep); > join([], Sep) when is_list(Sep) -> []. > Clearly, there is no way that either version of join/2 can be faster than > append/1. In fact > append/1 is measurably faster than > the revised join/2, which is measurably faster than > the original join/2, > but you have to push the sizes ridiculously high to make these > measurements. > > Really, I suggest you write whichever makes your intentions clearest > to human readers, get the program going, then measure it. I would > be surprised if this particular issue made any significant difference. > > But why are you using strings at all? > Strings are an *interface* data type; you process them when you receive > data from an external source and you generate them (or rather you > generate iolists) when you are sending data to an external source, but > for internal processing you usually want some sort of tree. > > Seeing "Item:{$ItemID}" suggests that maybe you *are* generating output > for some external process, but in that case, perhaps you should just be > sending along the iolist ["Item:{",ItemId,"}"] and *not* concatenating > the > pieces. > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From ameretat.reith@REDACTED Sat Jan 30 17:57:59 2016 From: ameretat.reith@REDACTED (Ameretat Reith) Date: Sat, 30 Jan 2016 20:27:59 +0330 Subject: [erlang-questions] dependency not reachable In-Reply-To: References: Message-ID: <20160130202759.1b9341d2@gmail.com> On Sat, 30 Jan 2016 18:52:32 +0530 Pavanan M S wrote: > What could be the reason for this. Also...Is there > anything I need to do more when making this a rebar 3 release? Please > help. In your rebar.config, add jsx to deps section to fetch it and include in relx configuration to include it in release: ``` {deps, [ ... {jsx, {git, "https://github.com/talentdeficit/jsx", {branch,"master"}}} ] }. {relx, [ {release, {app, "1.0.0"}, [ ... {jsx, load} ] ] }. ``` app.src just specifies application dependency and tells which application should be started before another one. From t@REDACTED Sat Jan 30 18:17:38 2016 From: t@REDACTED (Tristan Sloughter) Date: Sat, 30 Jan 2016 11:17:38 -0600 Subject: [erlang-questions] dependency not reachable In-Reply-To: References: Message-ID: <1454174258.2069324.507095274.49C91EE4@webmail.messagingengine.com> No makefile if he is using rebar3. This example you give is using erlang.mk not rebar. To convert to rebar3 you'll need to add a rebar.config that lists the deps: {deps, [cowboy, jsx]}. Will work. -- Tristan Sloughter t@REDACTED On Sat, Jan 30, 2016, at 07:54 AM, Vanshdeep Singh wrote: > make sure that jsx is specified in the Makefile too. > > On Sat, Jan 30, 2016 at 6:52 PM, Pavanan M S wrote: >> hi all >> ?????????? I was trying to convert a rest api example built using rebar to rebar3 release ( http://jordenlowe.com/title/Explain_like_I_am_5_-_Erlang_REST_Framework_Cowboy) . I have added jsx to app.src . >> ?????????? This error comes up . >> ???? ? ? ? ? ? ===> Failed to solve release: >> ? ? ?????????? Dependency jsx is specified as a dependency but is not reachable by the system. >> >> ? ? ? ? ? ? What could be the reason for this. Also...Is there anything I need to do more when making this a rebar 3 release? Please help. ??????? >> >> _______________________________________________ >> 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 Jan 30 20:20:55 2016 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sat, 30 Jan 2016 19:20:55 +0000 Subject: [erlang-questions] Recommendations for secure websocket + fallbacks In-Reply-To: <56AB8EA1.5080501@ninenines.eu> References: <20160128140813.GP28491@fhebert-ltm2.internal.salesforce.com> <56AB82FA.4030803@ninenines.eu> <56AB8EA1.5080501@ninenines.eu> Message-ID: or vernemq with the websocket using mqtt js. you can even use ejabberd/mongooseim with the xmpp websocket client if you need messaging :) Another solution would be using n2o or nitrogen. now you have a lot of choices ;) On Fri, 29 Jan 2016 at 17:09, Lo?c Hoguin wrote: > To add to that: > > If you need messaging or can design your application this way, then > RabbitMQ is definitely a great solution. > > A few notes however: > > The SockJS in the Web STOMP plugin only accepts UTF-8 messages (this is > also true of Bullet and most solutions that provide fallbacks). If you > need binary, the Web STOMP plugin has a plain Websocket endpoint but > that one has no fallback. > > The Web MQTT plugin currently does not work against the most recent > RabbitMQ version, it will work against 3.6.1 onward. Right now you need > to have an unreleased version of the RabbitMQ MQTT plugin that contains > the required changes. > > The Web MQTT plugin is currently considered experimental. Feedback would > however be much appreciated. > > Disclaimer: I wrote the Web MQTT plugin and am the current maintainer of > the Web STOMP plugin. > > On 01/29/2016 04:57 PM, Santiago Fern?ndez wrote: > > If you want to take advantage from another Erlang system for your > > development, take a look to RabbitMQ. There is a Web STOMP plugin (using > > SockJS or plain WebSockets). I'm not sure what are the pros and cons of > > STOMP vs plain WebSocket (bandwith, performance, scalability, etc) but > > it is easy to integrate. > > > > You can develop your own Erlang application an deploy it with the broker > > in the same cluster, to avoid AMQP overhead (direct connection). Or you > > can develop your own plugin using Erlang and using all RabbitMQ > > infrastructure. > > > > There is also a plugin for MQTT over WebSockets under development. > > > > sorry for my english! > > > > > > > > -- > > Santiago > > > > On Fri, Jan 29, 2016 at 12:19 PM, Lo?c Hoguin > > wrote: > > > > On 01/28/2016 03:08 PM, Fred Hebert wrote: > > > > I would be interested to hear any experiences you might have > > in this > > domain, and any recommendations you might have for erlang > > libraries, > > servers, etc. Has anyone done this? What stack did you > > deploy? What > > were the issues you encountered? > > > > > > Sadly I'm afraid I can't be of much more help there. I've left a > > lot of > > my web dev work behind me. Something equivalent in spirit to the > > socket.io of old, but with the Erlang frame > > of mind is 'bullet', > > developped to work with cowboy: > https://github.com/ninenines/bullet > > > > It's what I would consider your best bet, but I'm out of the > > game when > > it comes to that stuff and don't know what else may exist. > > > > > > My recommendation today is to go with Websocket directly. > > > > If you take a look at http://caniuse.com/#feat=websockets you can > > see that it will just work on close to 90% of the global market > > share. Chances are your local market share is higher than that, but > > it could also be lower (in particular if you are writing an > > enterprise system). > > > > Depending on when you will ship, it might not even make sense to ask > > yourself this question anymore. If you ship even in 1 year it > > already makes little sense, it's much easier to partially disable > > functionality with a message recommending people update or switch > > browser. > > > > Note that in those %s, nearly 5% are about Opera Mini. Opera Mini is > > a very particular browser that supports very little interactive > > features. I would not count it in market share and so the total of > > browsers that do support Websocket today is closer to 95%. If you > > need to support Opera Mini, I don't think even something like Bullet > > or Sockjs or other will work. > > > > As far as which Websocket implementation to use, I would suggest > > Cowboy of course, since I wrote it, but I will go as far as to > > suggest Cowboy master if you care about Websocket compression, > > although master is about to receive more breaking changes from the > > work toward 2.0. > > > > Cheers, > > > > -- > > Lo?c Hoguin > > http://ninenines.eu > > Author of The Erlanger Playbook, > > A book about software development using Erlang > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.valim@REDACTED Sat Jan 30 21:04:19 2016 From: jose.valim@REDACTED (=?UTF-8?Q?Jos=C3=A9_Valim?=) Date: Sat, 30 Jan 2016 21:04:19 +0100 Subject: [erlang-questions] Atom Unicode Support Message-ID: Hello everyone, Back in 2012, the OTP team decided to improve Unicode Support in source files . Since I couldn't find a non-cached link (sorry), I will paste some bits here for convenience: > The default file encoding will be ISO-Latin-1 in R16, but will be changed to UTF-8 in R17. (...) Source code will need no change in R16, but adding a comment denoting ISO-Latin-1 encoding will ensure that the code can be compiled with the R17 compiler. Adding a comment denoting UTF-8 encoding will allow for Unicode characters with code points > 255 in string and character literals in R16. The same comment will allow for atoms containing any Unicode code point in R18. From this follows that function names also can contain any Unicode code point in R18. There was a lot of progress and most of those changes were implemented in R16 and R17, which are excellent! From my understanding, there is also runtime support for UTF-8 encoded atoms as well: 1> erlang:binary_to_term(<<131,100,0,4,"jos?">>). jos? 2> erlang:binary_to_term(<<131,118,0,5,"jos?"/utf8>>). jos? Even more interesting, those two atoms are equal because the VM translates the UTF-8 encoded one to latin when possible: 3> v(1) == v(2). true Atoms that cannot be translated to latin1 also work: 4> erlang:binary_to_term(<<131,118,0,9,227,131,142,227,130,175,227,130,185>>). '???' 5> erlang:atom_to_binary(v(1), utf8). <<227,131,142,227,130,175,227,130,185>> So while most of the runtime support just works?, erlang:binary_to_atom(Binary, utf8) still has the restriction of not supporting UTF-8 binaries with codepoints more than 255 (they are always encoded as latin). I have also tried to compile code using UTF8-encoded atoms, like above, but the compiler chain complained. Anthony Ramine also noticed the current beam format wouldn't allow UTF8 encoded atoms, we would need to introduce a new chunk for hosting those (which wouldn't break older beam files). With all that said, are there any plans of supporting UTF-8 encoded atoms on Erlang R19? If the feature is desired but not planned, I would love to contribute the compiler and bytecode changes above although I will likely need some guidance. If that is an option, I would love to get in touch. Thank you! *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Sat Jan 30 21:06:32 2016 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sat, 30 Jan 2016 21:06:32 +0100 Subject: [erlang-questions] rebar3 shell showing error In-Reply-To: <20160129125548.GB32812@fhebert-ltm2.internal.salesforce.com> References: <20160129125548.GB32812@fhebert-ltm2.internal.salesforce.com> Message-ID: On 29 January 2016 at 13:55, Fred Hebert wrote: > On 01/29, Lukas Larsson wrote: > > > > > > For some reason both the basic and tty shell drivers have started > > and are trying to select on the same file descriptor. The problem > > is probably somewhere around here: > > Yeah, I haven't been able to reproduce this one. I brought changes > to the code specifically to get rid of the issue a few weeks ago > https://github.com/rebar/rebar3/pull/995 and I've had two reports of > that stuff failing. > > As I said, I've been unable to reproduce it on the versions I tried > on Linux, OSX, and Windows. So at this point I'm not quite sure how > to go about, the VM is fighting us very hard in making sure we don't > take over the IO system. Going about it any other way ensures that > on the old shell, the escript running rebar3 crashes directly and > any TERM=dumb or windows system cannot use it at all. > > If I'm able to reproduce the issue reliably I'm gonna try to fix it, > but for now I'm not sure what I can do. We've been trying to work around the basic issue here for years now, and I think the only reliable way (that doesn't involve a modified erts) is an indirection that spawns another node with things configured as needed. Maybe a slave node? From mmzeeman@REDACTED Sat Jan 30 21:59:10 2016 From: mmzeeman@REDACTED (Maas-Maarten Zeeman) Date: Sat, 30 Jan 2016 21:59:10 +0100 Subject: [erlang-questions] Recommendations for secure websocket + fallbacks Message-ID: <5A53B15D-4F67-4F50-A802-8BCEAACFEDE5@xs4all.nl> Having to do cross-domain connections the easiest thing you can do is insert an communication iframe on the page and use the postMessage api between the page and your communication iframe. That is by far the easiest way to deal with this. As for experience with websockets. There are a couple of issues you will encounter in the real world. There are a browsers who don?t support websockets. Mainly IE < 11, usually found in corporate environments. If you have to serve these kind of clients you need a long-polling fallback mechanism. There could also be issues with proxies, which you can also typically find in corporate environments or mobile providers. Usually those problems can be avoided by running the websocket over ssl. Be aware that some mobile providers even block long-polling and mobile safari doesn?t support long-polling. Another possibility is using SSE for server to client push messages and use ajax for client to server messages. But sometimes this also doesn?t work. I?ve found some windows virus/firewall products which block SSE streams. When using a long-polling + ajax fallback you have to be aware that client -> server messages don?t always arrive in sequence. Ajax requests can also be cancelled and don?t arrive at all. You need a mechanism to deal with this. In zotonic we have automatic retransmissions to deal with situations like these. So it can be quite a puzzle to get websockets and fallbacks working reliably. It all depends a bit on what your needs are. Maas From pavananms@REDACTED Sun Jan 31 09:01:30 2016 From: pavananms@REDACTED (Pavanan M S) Date: Sun, 31 Jan 2016 13:31:30 +0530 Subject: [erlang-questions] rebar3 release console cannot be started Message-ID: Hi all, As the error output wont look good on this mail I have made it a screenshot and attached it. This is a rebar3 release compiled and released without any error. (There was this line ( ===> Missing beam file elf_format <<"/usr/local/lib/erlang/lib/hipe-3.11.3/ebin/elf_format.beam">>) I guess that's something else). There is a line in the error which says that there is another link using the same hostname. Seeing this I deleted all such projects of the same name and recompiled and re released. Also when i try start option no output is shown and localhost:8080 is not started. (I have been trying to do the example on this link in rebar3 :- http://jordenlowe.com/title/Explain_like_I_am_5_-_Erlang_REST_Framework_Cowboy ) What is/could be the reason for this error. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot from 2016-01-31 12:52:18.png Type: image/png Size: 328524 bytes Desc: not available URL: From jesper.louis.andersen@REDACTED Sun Jan 31 11:19:27 2016 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 31 Jan 2016 11:19:27 +0100 Subject: [erlang-questions] rebar3 release console cannot be started In-Reply-To: References: Message-ID: On Sun, Jan 31, 2016 at 9:01 AM, Pavanan M S wrote: > What is/could be the reason for this error. Immediate bet: you already have a node running on the machine with the name hello_erlang. You can verify that this is the case or not by asking epmd(1) what it thinks are running nodes on the machine: epmd -names alternatively, look for a running node with ps(1). Can the node boot without networking enabled? Do you have a deliberately crippled environment (docker, ...) which can wreak havoc? -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Sun Jan 31 11:42:43 2016 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sun, 31 Jan 2016 10:42:43 +0000 Subject: [erlang-questions] DTLS 1.2 / Erlang Support In-Reply-To: References: Message-ID: Did anyone went further? What would be the correct design for such feature. I may have some cycles to spend on it but any guidance would be appreciated :) - beno?t On Mon, Nov 16, 2015 at 7:34 PM Victor Medina wrote: > altough I still prefer sending chocolates and flowers =) > > > Sin mas a que hacer referencia, > > Victor Medina > > On Mon, Nov 16, 2015 at 1:58 PM, Benoit Chesneau > wrote: > >> cool :) keep us updated >> >> On Mon, 16 Nov 2015 at 18:54, Victor Medina wrote: >> >>> In fact Im clonning it! =) >>> >>> >>> Sin mas a que hacer referencia, >>> >>> Victor Medina >>> >>> On Mon, Nov 16, 2015 at 1:20 PM, Benoit Chesneau >>> wrote: >>> >>>> have a look to: >>>> >>>> http://www.openwebrtc.org/blog/2014/10/31/webrtc-in-safari-using-openwebrtc >>>> >>>> https://github.com/EricssonResearch/openwebrtc-browser-extensions >>>> >>>> they have a daemon apparently. >>>> On Mon, 16 Nov 2015 at 18:45, Victor Medina wrote: >>>> >>>>> >>>>> On Mon, Nov 16, 2015 at 1:08 PM, Benoit Chesneau >>>>> wrote: >>>>> >>>>>> openwebrtc >>>>> >>>>> >>>>> um... interesting! taking a look.... >>>>> >>>>> Other would be just to do something in c++ or c that takes care of >>>>> DTLS(using wolf's or mbed's tls) and handle it back to a erlang process... >>>>> >>>>> >>>>> Sin mas a que hacer referencia, >>>>> >>>>> Victor Medina >>>>> >>>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.platt@REDACTED Sun Jan 31 11:45:29 2016 From: pablo.platt@REDACTED (pablo platt) Date: Sun, 31 Jan 2016 12:45:29 +0200 Subject: [erlang-questions] DTLS 1.2 / Erlang Support In-Reply-To: References: Message-ID: I saw this repo which DTLS for R17: https://github.com/RoadRunnr/dtlsex Would be nice to update it to R18. I think it's missing the WebRTC extension. On Sun, Jan 31, 2016 at 12:42 PM, Benoit Chesneau wrote: > Did anyone went further? What would be the correct design for such > feature. I may have some cycles to spend on it but any guidance would be > appreciated :) > > - beno?t > > On Mon, Nov 16, 2015 at 7:34 PM Victor Medina wrote: > >> altough I still prefer sending chocolates and flowers =) >> >> >> Sin mas a que hacer referencia, >> >> Victor Medina >> >> On Mon, Nov 16, 2015 at 1:58 PM, Benoit Chesneau >> wrote: >> >>> cool :) keep us updated >>> >>> On Mon, 16 Nov 2015 at 18:54, Victor Medina wrote: >>> >>>> In fact Im clonning it! =) >>>> >>>> >>>> Sin mas a que hacer referencia, >>>> >>>> Victor Medina >>>> >>>> On Mon, Nov 16, 2015 at 1:20 PM, Benoit Chesneau >>>> wrote: >>>> >>>>> have a look to: >>>>> >>>>> http://www.openwebrtc.org/blog/2014/10/31/webrtc-in-safari-using-openwebrtc >>>>> >>>>> https://github.com/EricssonResearch/openwebrtc-browser-extensions >>>>> >>>>> they have a daemon apparently. >>>>> On Mon, 16 Nov 2015 at 18:45, Victor Medina wrote: >>>>> >>>>>> >>>>>> On Mon, Nov 16, 2015 at 1:08 PM, Benoit Chesneau >>>>> > wrote: >>>>>> >>>>>>> openwebrtc >>>>>> >>>>>> >>>>>> um... interesting! taking a look.... >>>>>> >>>>>> Other would be just to do something in c++ or c that takes care of >>>>>> DTLS(using wolf's or mbed's tls) and handle it back to a erlang process... >>>>>> >>>>>> >>>>>> Sin mas a que hacer referencia, >>>>>> >>>>>> Victor Medina >>>>>> >>>>> >>>> >> > _______________________________________________ > 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 Sun Jan 31 12:02:09 2016 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sun, 31 Jan 2016 11:02:09 +0000 Subject: [erlang-questions] DTLS 1.2 / Erlang Support In-Reply-To: References: Message-ID: just saw https://github.com/erlang/otp/pull/936 as well On Sun, Jan 31, 2016 at 11:45 AM pablo platt wrote: > I saw this repo which DTLS for R17: > https://github.com/RoadRunnr/dtlsex > > Would be nice to update it to R18. > > I think it's missing the WebRTC extension. > > On Sun, Jan 31, 2016 at 12:42 PM, Benoit Chesneau > wrote: > >> Did anyone went further? What would be the correct design for such >> feature. I may have some cycles to spend on it but any guidance would be >> appreciated :) >> >> - beno?t >> >> On Mon, Nov 16, 2015 at 7:34 PM Victor Medina wrote: >> >>> altough I still prefer sending chocolates and flowers =) >>> >>> >>> Sin mas a que hacer referencia, >>> >>> Victor Medina >>> >>> On Mon, Nov 16, 2015 at 1:58 PM, Benoit Chesneau >>> wrote: >>> >>>> cool :) keep us updated >>>> >>>> On Mon, 16 Nov 2015 at 18:54, Victor Medina wrote: >>>> >>>>> In fact Im clonning it! =) >>>>> >>>>> >>>>> Sin mas a que hacer referencia, >>>>> >>>>> Victor Medina >>>>> >>>>> On Mon, Nov 16, 2015 at 1:20 PM, Benoit Chesneau >>>>> wrote: >>>>> >>>>>> have a look to: >>>>>> >>>>>> http://www.openwebrtc.org/blog/2014/10/31/webrtc-in-safari-using-openwebrtc >>>>>> >>>>>> https://github.com/EricssonResearch/openwebrtc-browser-extensions >>>>>> >>>>>> they have a daemon apparently. >>>>>> On Mon, 16 Nov 2015 at 18:45, Victor Medina >>>>>> wrote: >>>>>> >>>>>>> >>>>>>> On Mon, Nov 16, 2015 at 1:08 PM, Benoit Chesneau < >>>>>>> bchesneau@REDACTED> wrote: >>>>>>> >>>>>>>> openwebrtc >>>>>>> >>>>>>> >>>>>>> um... interesting! taking a look.... >>>>>>> >>>>>>> Other would be just to do something in c++ or c that takes care of >>>>>>> DTLS(using wolf's or mbed's tls) and handle it back to a erlang process... >>>>>>> >>>>>>> >>>>>>> Sin mas a que hacer referencia, >>>>>>> >>>>>>> Victor Medina >>>>>>> >>>>>> >>>>> >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Sun Jan 31 16:37:54 2016 From: t@REDACTED (Tristan Sloughter) Date: Sun, 31 Jan 2016 09:37:54 -0600 Subject: [erlang-questions] rebar3 release console cannot be started In-Reply-To: References: Message-ID: <1454254674.2322681.507630002.7BC3FEE2@webmail.messagingengine.com> Yea. First, that "missing beam" is a relx warning, you can ignore it and it is now a debug message only in recent relx versions. As for the error message, Jesper is right, it is saying a node with that name is already running. Maybe you ran a node with 'start' before running console? If you want to attach to the running node that was started with 'start' use 'remote_console' -- Tristan Sloughter t@REDACTED On Sun, Jan 31, 2016, at 04:19 AM, Jesper Louis Andersen wrote: > > On Sun, Jan 31, 2016 at 9:01 AM, Pavanan M S wrote: >> What is/could be the reason for this error. > > Immediate bet: you already have a node running on the machine with the name hello_erlang. You can verify that this is the case or not by asking epmd(1) what it thinks are running nodes on the machine: > > epmd -names > > alternatively, look for a running node with ps(1). > > Can the node boot without networking enabled? Do you have a deliberately crippled environment (docker, ...) which can wreak havoc? > > > -- > J. > _________________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: