From raimo+erlang-questions@REDACTED Wed Aug 1 09:55:19 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 1 Aug 2018 09:55:19 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180731202216.3796b55d@raspy> References: <20180724110243.11f236ce@raspy> <20180726131147.GA94922@erix.ericsson.se> <20180730103304.25ea8f8a@raspy> <20180730085615.GA89447@erix.ericsson.se> <20180731202216.3796b55d@raspy> Message-ID: <20180801075519.GA31676@erix.ericsson.se> On Tue, Jul 31, 2018 at 08:22:16PM +0200, empro2@REDACTED wrote: > Am Mon, 30 Jul 2018 10:56:15 +0200 > schrieb Raimo Niskanen > : > > > Thank you for the review! > > Not at all! least I could do having brought this up. > > > > I think now is a better time than most, thanks to being > > vacation time... > > I wonder what to do with the notes I took while at it. > > - EEP: overkill, completely wrong place. > > - erlang-patches? The things there do look different. > > - bugs.erlang.org: as an improvement? and then each one > separately? there is nothing like it (yet)(?) > > I noted down 4 and a half cases in which the change itself > seems to be of little use. As I could not make much sense of > the text in these cases (using only the extended diff > contexts) my "suggestions" are no more than possibly helpful > phrasings. I would say that the appropriate way would be to fork the project at GitHub and to submit pull request / a pull request. Documentation improvements are a good thing. I also noted that in some of the places the "cannot" change was only a tiny improvement and that the surrounding text really would benefit from being reworked. But I wanted my pull request to only change one thing, not only according to our pull request guidelines... Thank you for pointing at the bad wordings below, we'll see if someone steps up. Now they at least are on record. / Raimo > > The notes are down below my name, introduced by > ===, [comments in square brackets]. > > I have no experience with projects of that size and no idea > about the hassle : gain ratio. > > Michael > > > === erts/emulator/beam/erl_db_tree.c 3129 > https://github.com/erlang/otp/pull/1891/files#diff-30fdd1356f85b600e88e98de46e5a338 > > + erts_fprintf(stderr," cannot match lesser > than "); > > less than [This is the half one: not misleading, but seems > so basic a message that it might be desirable to have > "correct".] > > > === erts/doc/src/notes.xml 9902 > https://github.com/erlang/otp/pull/1891/files#diff-eb82a09c6aefc9ef174ead9c8181a141 > > and there > > === lib/stdlib/doc/src/notes.xml 3657 > https://github.com/erlang/otp/pull/1891/files#diff-4e42fb7d23d206e8b0fcbfd4858b1672 > >

To roughly the old behaviour, to not wait for > ports and async threads operations when you exit the > emulator, you use erlang:halt/2 with an integer > first argument and an option list containing > {flush,false} as the second argument. Note that now > is flushing not dependant of the > - exit code, and you can not only flush > async threads > + exit code, and you cannot only flush > async threads > operations which we deemed as a strange behaviour > anyway.

> > To roughly approximate the old behaviour,[?] > which was to not wait ... when you exit the emulator,[?] > use erlang:halt/2 [without the "you"?] > Note that flushing does not depend on the exit code anymore > [??] > and you are no longer restricted to flushing async threads > operations only[?] > , a restriction we deemed strange anyway.[?, useful? > replace with:] > ; now you can flush sync ones too.[?] > > > === lib/observer/src/observer_wx.erl 809 > https://github.com/erlang/otp/pull/1891/files#diff-ebe399fc76aff158ba9cb898ccfba2d2 > > %% If already started, somebody else may use it. > + %% We cannot use it too, as far log file would > be overriden. Not fair. > > somebody else may be using it.[But is this about using it > at all? or about preventing the start of a second one?] > > We must not start a second one[?], > as that would overwrite the remote log file.[?] > > > === lib/odbc/doc/src/notes_history.xml 196 > https://github.com/erlang/otp/pull/1891/files#diff-c673d56ed2511271ba68533de94c9b13 > > + connection cannot be established. No > connection no process it is expected. > > No connection, no process; just as one would expect.[??] > > > -- > > Reasonable is that which cannot be criticised reasonably. > > > > > > > > > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From devon.c.estes@REDACTED Wed Aug 1 12:30:07 2018 From: devon.c.estes@REDACTED (Devon Estes) Date: Wed, 1 Aug 2018 12:30:07 +0200 Subject: [erlang-questions] Memory usage in OTP 21 In-Reply-To: References: <953b1a28-e8e4-706f-8af7-412efc4320f0@gmail.com> Message-ID: And here's a gist with an Erlang reproduction: https://gist.github.com/devonestes/abe4dc60484e5426d4890c4494430194. When I run this escript as is, I see that the `recent_size` is different (which is only supposed to change after a GC run, right?) but no trace messages indicating that garbage collection took place. However, with this Erlang example, the `heap_block_size` and `old_heap_block_size` remain the same. When I bump up the size of the list I'm mapping over (ToMap) from 50 to 100, I see garbage collection trace messages indicating that a single minor collection took place. On Tue, Jul 31, 2018 at 8:08 PM Devon Estes wrote: > Thanks so much for this! That's probably a good idea calling > `erlang:garbage_collect()` and relying on the trace information. I'll play > around with that to see how that affects things. > > I'm seeing the behavior with the heap_block_size on this branch: > https://github.com/PragTob/benchee/tree/memory-measurement-issues > > We have some samples in there, usually to show how to use benchee, but > I've added one to reproduce this issue (in `samples/wtf.exs`). If you run > `mix run samples/wtf.exs`, you'll see the process_info data printed to the > console, both before and after the function to be measured is run, and you > won't see any indication that a garbage collection event happened. If you > bump up the size of the range in the sample `samples/wtf.exs` to `1..5000`, > you'll see that 9 GC runs take place (7 minor, 2 major). > > Also, if it helps, the code around memory measurement is all in > `lib/benchee/benchmark/measure/memory.ex`. > > I'll try tomorrow to write this up in Erlang to reproduce it that way as > well. > > On Tue, Jul 31, 2018 at 9:39 AM Lukas Larsson wrote: > >> Hello, >> >> On Fri, Jul 27, 2018 at 10:11 PM Devon Estes >> wrote: >> >>> I hope this helps jog some ideas as to what might be going on here, and >>> thanks again for any help y'all can offer. >>> >> >> I think I have figured out what is going on. It seems to be the >> allocation of the term containing the garbage_collection_info that is >> messing with measurements. I'll try to change the code inside process_info >> to give a more accurate view of the current memory usage, however as long >> as the call to process_info happens in the process doing the call there >> will be some miss match. >> >> I would suggest that you instead do a call to erlang:garbage_collect() >> before and after the benchmark is run and rely on tracing to get the >> correct information. Alternatively you could call erlang:process_info on >> the process from the trace collector, though then you would need some type >> of synchronization in between the processes. >> >> I have not been able to reproduce the scenario you mentioned where the >> heap_block_size is increased without getting a trace message. What code did >> you run to trigger that? As always an Erlang example would be preferable, >> but I should manage with an Elixir one as well. >> >> Lukas >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Wed Aug 1 13:34:51 2018 From: lukas@REDACTED (Lukas Larsson) Date: Wed, 1 Aug 2018 13:34:51 +0200 Subject: [erlang-questions] Memory usage in OTP 21 In-Reply-To: References: <953b1a28-e8e4-706f-8af7-412efc4320f0@gmail.com> Message-ID: On Wed, Aug 1, 2018 at 12:30 PM Devon Estes wrote: > And here's a gist with an Erlang reproduction: > https://gist.github.com/devonestes/abe4dc60484e5426d4890c4494430194. When > I run this escript as is, I see that the `recent_size` is different (which > is only supposed to change after a GC run, right?) but no trace messages > indicating that garbage collection took place. However, with this Erlang > example, the `heap_block_size` and `old_heap_block_size` remain the same. > When I bump up the size of the list I'm mapping over (ToMap) from 50 to > 100, I see garbage collection trace messages indicating that a single minor > collection took place. > I think that is because you do not synchronize the start of the tracer with the benchmark. i.e. by the time that the tracer is started and applies the trace the benchmark has already completed. I forked your gist and updated it here: https://gist.github.com/garazdawi/01467ecd6b8c7bcb08ddc8f3eb03d1af. With that change i get trace messages from three collections. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.platt@REDACTED Wed Aug 1 17:38:13 2018 From: pablo.platt@REDACTED (pablo platt) Date: Wed, 1 Aug 2018 18:38:13 +0300 Subject: [erlang-questions] CRC32c in Erlang? Message-ID: Hi, Is there CRC32c implementation in Erlang? It's required for SCTP checksum [1]. I only found NIF bindings but I prefer native Erlang implementation if exists. [1] https://tools.ietf.org/html/rfc4960#section-6.8 [2] https://github.com/zmstone/crc32cer -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang.org@REDACTED Wed Aug 1 18:26:44 2018 From: erlang.org@REDACTED (Stanislaw Klekot) Date: Wed, 1 Aug 2018 18:26:44 +0200 Subject: [erlang-questions] CRC32c in Erlang? In-Reply-To: References: Message-ID: <20180801162644.GA29634@jarowit.net> On Wed, Aug 01, 2018 at 06:38:13PM +0300, pablo platt wrote: > Is there CRC32c implementation in Erlang? > It's required for SCTP checksum [1]. > I only found NIF bindings but I prefer native Erlang implementation if > exists. You mean, something like erlang:crc32/1 and erlang:crc32/2? -- Stanislaw Klekot From devon.c.estes@REDACTED Wed Aug 1 19:45:54 2018 From: devon.c.estes@REDACTED (Devon Estes) Date: Wed, 1 Aug 2018 19:45:54 +0200 Subject: [erlang-questions] Memory usage in OTP 21 In-Reply-To: References: <953b1a28-e8e4-706f-8af7-412efc4320f0@gmail.com> Message-ID: Well, between the race condition that you spotted and removing the calls to `process_info/2` and replacing them with calls to `erlang:garbage_collect/0`, we've now got this working like a charm. Thank you so much for the help! On Wed, Aug 1, 2018 at 1:35 PM Lukas Larsson wrote: > On Wed, Aug 1, 2018 at 12:30 PM Devon Estes > wrote: > >> And here's a gist with an Erlang reproduction: >> https://gist.github.com/devonestes/abe4dc60484e5426d4890c4494430194. >> When I run this escript as is, I see that the `recent_size` is different >> (which is only supposed to change after a GC run, right?) but no trace >> messages indicating that garbage collection took place. However, with this >> Erlang example, the `heap_block_size` and `old_heap_block_size` remain the >> same. When I bump up the size of the list I'm mapping over (ToMap) from 50 >> to 100, I see garbage collection trace messages indicating that a single >> minor collection took place. >> > > I think that is because you do not synchronize the start of the tracer > with the benchmark. i.e. by the time that the tracer is started and applies > the trace the benchmark has already completed. I forked your gist and > updated it here: > https://gist.github.com/garazdawi/01467ecd6b8c7bcb08ddc8f3eb03d1af. With > that change i get trace messages from three collections. > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amuhar3@REDACTED Wed Aug 1 19:53:33 2018 From: amuhar3@REDACTED (=?UTF-8?B?0JDQvdC90LAg0JzRg9GF0LDRgNGA0LDQvA==?=) Date: Wed, 1 Aug 2018 20:53:33 +0300 Subject: [erlang-questions] re2 Message-ID: Hello everyone! With use of *re* library it is possible to get all words in string with command: re:run("word1, word2 ,word3", "[a-z0-9]+", [global, {capture, all, > binary}]). > {match,[[<<"word1">>],[<<"word2">>],[<<"word3">>]]} > But *re2* doesn't have *global* option. So with *re2* I get: re2:run("word1, word2 ,word3", "[a-z0-9]+", [{capture, all, > binary}]). > {match,[<<"word1">>]} > How could I find all words in string with *re2*? Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From ledest@REDACTED Thu Aug 2 02:30:36 2018 From: ledest@REDACTED (Led) Date: Thu, 2 Aug 2018 03:30:36 +0300 Subject: [erlang-questions] re2 In-Reply-To: References: Message-ID: 2018-08-01 20:53 GMT+03:00 ???? ???????? : > Hello everyone! > > With use of *re* library it is possible to get all words in string with > command: > > re:run("word1, word2 ,word3", "[a-z0-9]+", [global, {capture, all, >> binary}]). >> {match,[[<<"word1">>],[<<"word2">>],[<<"word3">>]]} >> > > But *re2* doesn't have *global* option. So with *re2* I get: > > re2:run("word1, word2 ,word3", "[a-z0-9]+", [{capture, all, >> binary}]). >> {match,[<<"word1">>]} >> > > How could I find all words in string with *re2*? > > Thank you! > > [{offset, Offset}, {capture, all, index}] with recursion. But... Why??? -- Led. -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Thu Aug 2 10:25:25 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 2 Aug 2018 10:25:25 +0200 Subject: [erlang-questions] re2 In-Reply-To: References: Message-ID: <20180802082525.GA54853@erix.ericsson.se> On Wed, Aug 01, 2018 at 08:53:33PM +0300, ???? ???????? wrote: > Hello everyone! > > With use of *re* library it is possible to get all words in string with > command: > > re:run("word1, word2 ,word3", "[a-z0-9]+", [global, {capture, all, > > binary}]). > > {match,[[<<"word1">>],[<<"word2">>],[<<"word3">>]]} > > > > But *re2* doesn't have *global* option. So with *re2* I get: > > re2:run("word1, word2 ,word3", "[a-z0-9]+", [{capture, all, > > binary}]). > > {match,[<<"word1">>]} > > > > How could I find all words in string with *re2*? Have you tried to create an issue at https://github.com/tuncer/re2/ which I guess this question is about...? Or at the source library: https://github.com/google/re2 that implements it? > > Thank you! -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From krzysztof.jurewicz@REDACTED Thu Aug 2 14:19:17 2018 From: krzysztof.jurewicz@REDACTED (Krzysztof Jurewicz) Date: Thu, 02 Aug 2018 14:19:17 +0200 Subject: [erlang-questions] RNG algorithm choice for uniform natural numbers Message-ID: <87h8kdklkq.fsf@gmail.com> I?m looking for an algorithm to perform a transparent, reproducible generation of an uniform sequence of natural numbers. There are three RNG algorithms documented in the rand module: ? Xoroshiro116+. According to the linked page at http://xoshiro.di.unimi.it/ , it is suitable only for floating point numbers, so it doesn?t fit. Moreover, the page actually describes an algorithm with 64-bit precision, while rand implements a variant with 56-bit precision. It looks like the latter is implemented only in Erlang, so there is little practical interoperability between languages. ? Xorshift1024*. It fails the BigCrush test according to https://lemire.me/blog/2017/09/15/the-xorshift1024-random-number-generator-fails-bigcrush/ . ? Xorshift116+. The comment about 58-bit precision being rare applies (according to https://github.com/jj1bdx/emprng/ , ?the original exsplus was Xorshift128+?). Xorshift128+ fails the BigCrush test, so I presume that xorshift116+ fails it too. So? is there any particular reason for the rand module to not implement xoshiro256**, which is more widespread than 58-bit precision algorithms and, according to its creators, ?has excellent (sub-ns) speed, a state space (256 bits) that is large enough for any parallel application, and it passes all tests we are aware of?? From alanrevans@REDACTED Thu Aug 2 15:28:41 2018 From: alanrevans@REDACTED (Alan Evans) Date: Thu, 2 Aug 2018 14:28:41 +0100 Subject: [erlang-questions] Q: Is there a repository of Diameter dictionaries anywhere? Message-ID: Hello Erlangers, Does anyone know if there is a repository of Erlang Diameter dictionaries (.dia files) anywhere? I need to implement the 3GPP SWx interface and its becoming very tedious building a dictionary file as the AVPs seem to be scattered over various 3GPP specs and RFCs. Thanks in Advance Alan --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus From andreas.schultz@REDACTED Thu Aug 2 17:14:20 2018 From: andreas.schultz@REDACTED (Andreas Schultz) Date: Thu, 2 Aug 2018 17:14:20 +0200 Subject: [erlang-questions] Q: Is there a repository of Diameter dictionaries anywhere? In-Reply-To: References: Message-ID: Hi Alan, I feel your pain. Recently i had to build dictionaries for Rf and Ro, Unfortunately, I'm not aware of an central repository. But the are two project that have 3GPP Erlang dictionaries that i know of. Maybe you can find some of what you need there. The one I'm working on: https://github.com/travelping/ergw_aaa/tree/master/dia SigScale's OCS: https://gitlab.com/sigscale/ocs/tree/master/src Obviously, i like my version better ;-) Regards, Andreas Alan Evans schrieb am Do., 2. Aug. 2018 um 15:29 Uhr: > Hello Erlangers, > > Does anyone know if there is a repository of Erlang Diameter > dictionaries (.dia files) anywhere? > I need to implement the 3GPP SWx interface and its becoming very tedious > building a dictionary file as the AVPs seem to be scattered over various > 3GPP specs and RFCs. > > Thanks in Advance > > Alan > > > --- > This email has been checked for viruses by Avast antivirus software. > https://www.avast.com/antivirus > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- -- Dipl.-Inform. Andreas Schultz ----------------------- enabling your networks ---------------------- Travelping GmbH Phone: +49-391-81 90 99 0 Roentgenstr. 13 Fax: +49-391-81 90 99 299 39108 Magdeburg Email: info@REDACTED GERMANY Web: http://www.travelping.com Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 Geschaeftsfuehrer: Holger Winkelmann VAT ID No.: DE236673780 --------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Thu Aug 2 18:10:24 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 2 Aug 2018 18:10:24 +0200 Subject: [erlang-questions] RNG algorithm choice for uniform natural numbers In-Reply-To: <87h8kdklkq.fsf@gmail.com> References: <87h8kdklkq.fsf@gmail.com> Message-ID: <20180802161024.GA85691@erix.ericsson.se> On Thu, Aug 02, 2018 at 02:19:17PM +0200, Krzysztof Jurewicz wrote: > I?m looking for an algorithm to perform a transparent, reproducible generation of an uniform sequence of natural numbers. There are three RNG algorithms documented in the rand module: > > ? Xoroshiro116+. According to the linked page at http://xoshiro.di.unimi.it/ , it is suitable only for floating point numbers, so it doesn?t fit. Moreover, the page actually describes an algorithm with 64-bit precision, while rand implements a variant with 56-bit precision. It looks like the latter is implemented only in Erlang, so there is little practical interoperability between languages. > ? Xorshift1024*. It fails the BigCrush test according to https://lemire.me/blog/2017/09/15/the-xorshift1024-random-number-generator-fails-bigcrush/ . It is a known fact that the lowest bits of Xors... generators with * and + scramblers are of lower quality than the rest. If he had used the high 32 bits I predict that it would have passed. The author of Xoroshiro, etc, thinks that this is a small problem. > ? Xorshift116+. The comment about 58-bit precision being rare applies (according to https://github.com/jj1bdx/emprng/ , ?the original exsplus was Xorshift128+?). Xorshift128+ fails the BigCrush test, so I presume that xorshift116+ fails it too. I would also guess so. > > So? is there any particular reason for the rand module to not implement xoshiro256**, which is more widespread than 58-bit precision algorithms and, according to its creators, ?has excellent (sub-ns) speed, a state space (256 bits) that is large enough for any parallel application, and it passes all tests we are aware of?? Any 64-bit word algorithm runs about 2..3 (or more) times slower than a 58-bit output word one, on 64-bit Erlang. That's why. Implementation of a new algorithm should be fairly easy (mostly cut-and-paste). Unfortunately the bignum operations that 64-bit calculations provoke hits performance a lot. We do not have any generator that uses the new ** scrambler that makes all tests pass BigCrush (with the lowest bits), yet, but... I have a pull request for Xoroshiro928** that is a reworked Xoroshiro1024** with 58-bit word size, exactly because of speed reasons. For the next step I was thinking about rewriting Xoroshiro256** to 58-bit, but the resulting algorighm would not be much faster than Xoroshiro928**, it would only have smaller state space, hopefully. So I am not certain that it would be worth implementing. https://github.com/erlang/otp/pull/1857 I have never thought about implementing the new 64-bit word size generators since nobody has asked for inter-platform compatibility before, and you still have to be careful with bit compatibility. It is only when you request the generator word size range that you get the raw numbers. And for floating point if you are lucky that both platforms use the same bits (low/high/middle). -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Thu Aug 2 18:25:11 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 2 Aug 2018 18:25:11 +0200 Subject: [erlang-questions] RNG algorithm choice for uniform natural numbers In-Reply-To: <20180802161024.GA85691@erix.ericsson.se> References: <87h8kdklkq.fsf@gmail.com> <20180802161024.GA85691@erix.ericsson.se> Message-ID: <20180802162511.GA88785@erix.ericsson.se> On Thu, Aug 02, 2018 at 06:10:24PM +0200, Raimo Niskanen wrote: > On Thu, Aug 02, 2018 at 02:19:17PM +0200, Krzysztof Jurewicz wrote: > > I?m looking for an algorithm to perform a transparent, reproducible generation of an uniform sequence of natural numbers. There are three RNG algorithms documented in the rand module: > > : : > > I have a pull request for Xoroshiro928** that is a reworked Xoroshiro1024** > with 58-bit word size, exactly because of speed reasons. For the next > step I was thinking about rewriting Xoroshiro256** to 58-bit, but the > resulting algorighm would not be much faster than Xoroshiro928**, > it would only have smaller state space, hopefully. So I am not certain > that it would be worth implementing. > > https://github.com/erlang/otp/pull/1857 To get you platform interoperability I could publish the C code I used as reference for writing Xoroshiro928** in Erlang. Yes there is a C implementation of it! > > I have never thought about implementing the new 64-bit word size generators > since nobody has asked for inter-platform compatibility before, and you still > have to be careful with bit compatibility. It is only when you request > the generator word size range that you get the raw numbers. And for > floating point if you are lucky that both platforms use the same bits > (low/high/middle). > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raoknz@REDACTED Thu Aug 2 19:49:39 2018 From: raoknz@REDACTED (Richard O'Keefe) Date: Fri, 3 Aug 2018 05:49:39 +1200 Subject: [erlang-questions] RNG algorithm choice for uniform natural numbers In-Reply-To: <87h8kdklkq.fsf@gmail.com> References: <87h8kdklkq.fsf@gmail.com> Message-ID: a "uniform sequence of natural numbers". There are infinitely many natural numbers. The generators you mention produce integers of fixed size. What exactly is it you want? Do you want something like https://gmplib.org/manual/Integer-Random-Numbers.html ? On 3 August 2018 at 00:19, Krzysztof Jurewicz wrote: > I?m looking for an algorithm to perform a transparent, reproducible > generation of an uniform sequence of natural numbers. There are three RNG > algorithms documented in the rand module: > > ? Xoroshiro116+. According to the linked page at > http://xoshiro.di.unimi.it/ , it is suitable only for floating point > numbers, so it doesn?t fit. Moreover, the page actually describes an > algorithm with 64-bit precision, while rand implements a variant with > 56-bit precision. It looks like the latter is implemented only in Erlang, > so there is little practical interoperability between languages. > ? Xorshift1024*. It fails the BigCrush test according to > https://lemire.me/blog/2017/09/15/the-xorshift1024-random- > number-generator-fails-bigcrush/ . > ? Xorshift116+. The comment about 58-bit precision being rare applies > (according to https://github.com/jj1bdx/emprng/ , ?the original exsplus > was Xorshift128+?). Xorshift128+ fails the BigCrush test, so I presume that > xorshift116+ fails it too. > > So? is there any particular reason for the rand module to not implement > xoshiro256**, which is more widespread than 58-bit precision algorithms > and, according to its creators, ?has excellent (sub-ns) speed, a state > space (256 bits) that is large enough for any parallel application, and it > passes all tests we are aware of?? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From empro2@REDACTED Fri Aug 3 11:09:43 2018 From: empro2@REDACTED (empro2@REDACTED) Date: Fri, 3 Aug 2018 11:09:43 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: References: <20180724110243.11f236ce@raspy> <20180726131147.GA94922@erix.ericsson.se> <20180727075225.GA78257@erix.ericsson.se> <20180730104914.417563e4@raspy> <20180730090200.GB89447@erix.ericsson.se> Message-ID: <20180803110943.612f20d4@raspy> I will try to summarise (and briefly too): The great language keepers (Oxford, Cambridge, Collins, Webster) mostly recommend "cannot"; they except cases in which the "not" belongs to the following phrase. So: You cannot smoke here. You must not smoke here! You need not smoke here, though this is a smoking club. You can not smoke here, but the others will sneer at you. You can not only M but also Q. You cannot only say A - without saying B. Webster gives an example for an emphasis of "not" by splitting it off, but neglects to mention the resulting collision. They all give the meaning of "cannot" as 'can not' instead of less confusing 'be not able/possible to'. So shame on them! (and a little thank-you for the free-of-cost web service :-) Further reading: In the good old time (1997 CE), the subject matter seems to have caused no question: http://faqs.cs.uu.nl/na-dir/alt-usage-english-faq.html For emphasis they simply used "*cannot*". In ancient times (1987 CE), compelled by metre, these blokes seem to have felt a need to clarify with a "no can" at 2:43 https://www.youtube.com/watch?v=16bFBzx7I_0 In prehistoric times (1922 CE) there was "to-morrow" (together with "tonight" in one sentence), http://gutenberg.net.au/ebooks01/0100111.txt and the author seems to have had no problem using: "he went on to collect" "he had got on to his camel". So (valid for any gender): He who is right today, may tomorrow be https://archive.org/details/TheLastManOnEarth_72 Michael -- Reasonable is that which cannot be criticised reasonably. From joe@REDACTED Fri Aug 3 12:58:25 2018 From: joe@REDACTED (Joe Harrison) Date: Fri, 03 Aug 2018 11:58:25 +0100 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <2768873.NH1MvFoY5h@takoyaki> Message-ID: <10959641533293905@myt5-c56023d17c6b.qloud-c.yandex.net> Let's not forget what happens in the Core Erlang compilation pass: In Erlang: f() -> other:check_db_ok() andalso other:do_db_transaction(). After compilation with +to_core: f'/0 = fun () -> ( case call 'other':'check_db_ok' () of ( <( 'true' -| ['compiler_generated'] )> when 'true' -> call 'other':'do_db_transaction' () -| ['compiler_generated'] ) ( <( 'false' -| ['compiler_generated'] )> when 'true' -> 'false' -| ['compiler_generated'] ) ( <_@REDACTED> when 'true' -> ( call ( 'erlang' -| ['compiler_generated'] ):( 'error' -| ['compiler_generated'] ) (( {( 'badarg' -| ['compiler_generated'] ),_@REDACTED} -| ['compiler_generated'] )) -| ['compiler_generated'] ) -| ['compiler_generated'] ) end -| ['compiler_generated'] ) Which, as we've all been discussing, is the same as a case expression, and furthermore is de-sugared as such. 24.07.2018, 08:20, "Pierre Fenoll" : > I don?t understand the strong answers. > To me the semantics of orelse/and also are well known. They are even known as ||/&& in the mainstream. > They have their use as the common boolean shortcut operators. They are even more than that: > case ShouldOpen andalso file:open(...) of > false -> > {error,_} -> > {ok,_} -> > end > > These operators are very interesting semantics. Erlang is not exactly a pure language. Being able to express side effects in such an easy-to-comment amount of code that?s just priceless. Here?s a legit example: > https://github.com/2600hz/kazoo/blob/master/applications/tasks/src/kz_tasks_scheduler.erl#L526 > > So why the big words? What?s next, the process dictionary, using list comprehensions with 1-element lists generators? > To me if you don?t like this kind of code it?s only because you have not needed / seen it much. So, read more code? > > On Tue 24 Jul 2018 at 05:42, wrote: >> On 2018?7?22???? 14?25?00? JST Viktor S?derqvist wrote: >>> Hey everyone, >>> >>> I've seen these short-circuit operators with a non-boolean second >>> operand, usually where the second operand is doing some side-effect and >>> the return value is not important. It seems to be a trend. Example: >>> >>>? ? ?Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), >>> >>> I this good or bad style? >> >> That code should die in a fire and the author should say repent with >> the chanting of 100 Hail McCarthys. >> >> -Craig >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > -- > > Cheers, > -- > Pierre Fenoll > > , > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From raimo+erlang-questions@REDACTED Fri Aug 3 13:42:07 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 3 Aug 2018 13:42:07 +0200 Subject: [erlang-questions] Patch Package OTP-20.3.8.4 Released Message-ID: <20180803114207.GB76532@erix.ericsson.se> This patch package will not be published for download from http://erlang.org/download/ but the README below can be found at: http://erlang/org/download/OTP-20.3.8.4.README Patch Package: OTP 20.3.8.4 Git Tag: OTP-20.3.8.4 Date: 2018-08-03 Trouble Report Id: OTP-14440 Seq num: ERIERL-220 System: OTP Release: 20 Application: asn1-5.0.5.1 Predecessor: OTP 20.3.8.3 Check out the git tag OTP-20.3.8.4, 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. --------------------------------------------------------------------- --- asn1-5.0.5.1 ---------------------------------------------------- --------------------------------------------------------------------- The asn1-5.0.5.1 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-14440 Application(s): asn1 Related Id(s): ERIERL-220 A bug in ASN.1 BER decoding has been fixed. When decoding a recursively enclosed term the length was not propagated to that term decoding, so if the length of the enclosed term was longer than the enclosing that error was not dectected. A hard coded C stack limitation for decoding recursive ASN.1 terms has been introduced. This is currently set to 8 kWords giving a nesting depth of about 1000 levels. Deeper terms can not be decoded, which should not be much of a real world limitation. Full runtime dependencies of asn1-5.0.5.1: erts-7.0, kernel-3.0, stdlib-2.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From getonga2018@REDACTED Fri Aug 3 18:08:23 2018 From: getonga2018@REDACTED (=?UTF-8?B?5qC86YCa?=) Date: Sat, 4 Aug 2018 00:08:23 +0800 Subject: [erlang-questions] erlang 21 binary matching bug in functin definition Message-ID: I try to fix the mysql-otp for erlang 21, but found a bug like this: ``` -module(a). -export([decode_binary/2]). decode_binary(_, <>) -> %% Coded in the same way as DATETIME and TIMESTAMP below, but returned in %% a simple triple. case {Length, Data} of {0, _} -> io:format("~p length:~p, Data:~p, ~n" , [?LINE, Length, Data]),{{0, 0, 0}, Data}; {4, <>} -> io:format("~p~n" , [?LINE]),{{Y, M, D}, Rest} end. ``` A function copy from https://github.com/mysql-otp/mysql-otp/blob/master/src/mysql_protocol.erl#L789-L795 My erlang version is 21.0.4, and the pr address is https://github.com/mysql-otp/mysql-otp/pull/84 . compile it and run: ``` erlc a.erl erl 1> a:decode_binary(test, <<0>>). 8 length:0, Data:<<0>>, {{0,0,0},<<0>>} ``` But in pattern matching: ``` 2> <> = <<0>>. <<0>> 3>Length. 0 4>Data. <<>> ``` It must be a bug in erlang 21 binary matching in function definition. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.platt@REDACTED Fri Aug 3 18:31:41 2018 From: pablo.platt@REDACTED (pablo platt) Date: Fri, 3 Aug 2018 19:31:41 +0300 Subject: [erlang-questions] UDP receive performance In-Reply-To: References: <20180524072357.GA97377@erix.ericsson.se> <355E67A6-9883-451D-A31D-8CC710244719@gmail.com> <19DDAEE8-037B-4793-9C83-7D8D5C73C234@mobilearts.com> <0AE32206-3A53-404A-A97E-426E0E974FA1@mobilearts.com> Message-ID: The PR is merged. Will the fix be in the 21 branch and next point release? On Mon, Jul 30, 2018 at 6:08 PM, Lukas Larsson wrote: > On Tue, Jul 17, 2018 at 11:10 AM Max Lapshin > wrote: > >> Will try to check it, because right now we are running separate thread >> with libevent for capturing udp =( >> > > I suppose you didn't find time to test it yet? If you need any further > help or find that it still isn't fast enough for you, I would be very > interested in trying to make it fast enough. > > I stumbled upon the recvmmsg syscall today, which could replace the > read_packets option and significantly decrease the number of roundtrips > into the kernel that you have to make. > > Lukas > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elbrujohalcon@REDACTED Fri Aug 3 18:32:16 2018 From: elbrujohalcon@REDACTED (Brujo Benavides) Date: Fri, 3 Aug 2018 13:32:16 -0300 Subject: [erlang-questions] erlang 21 binary matching bug in functin definition In-Reply-To: References: Message-ID: <19E031C7-F7CD-411D-888C-3BDBF53AB317@gmail.com> Well, that?s not happening here? Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] Eshell V10.0 (abort with ^G) 1> <> = <<0>>, {X, Y}. {0,<<>>} 2> F = fun(<>) -> {X, Y} end. #Fun 3> F(<<0>>). {0,<<>>} 4> {ok, A} = file:read_file("a.erl"), io:format("~s~n", [A]). -module a. -export [f/1]. f(<>) -> {X, Y}. ok 5> c(a). {ok,a} 6> a:f(<<0>>). {0,<<>>} 7> There must be something else happening with your code. Brujo Benavides > On 3 Aug 2018, at 13:08, ?? wrote: > > I try to fix the mysql-otp for erlang 21, but found a bug like this: > ``` > -module(a). > -export([decode_binary/2]). > decode_binary(_, <>) -> > %% Coded in the same way as DATETIME and TIMESTAMP below, but returned in > %% a simple triple. > > case {Length, Data} of > {0, _} -> io:format("~p length:~p, Data:~p, ~n" , [?LINE, Length, Data]),{{0, 0, 0}, Data}; > {4, <>} -> io:format("~p~n" , [?LINE]),{{Y, M, D}, Rest} > end. > > ``` > A function copy from https://github.com/mysql-otp/mysql-otp/blob/master/src/mysql_protocol.erl#L789-L795 > My erlang version is 21.0.4, and the pr address is https://github.com/mysql-otp/mysql-otp/pull/84 . > compile it and run: > ``` > erlc a.erl > erl > 1> a:decode_binary(test, <<0>>). > 8 length:0, Data:<<0>>, > {{0,0,0},<<0>>} > ``` > But in pattern matching: > ``` > 2> <> = <<0>>. > <<0>> > 3>Length. > 0 > 4>Data. > <<>> > ``` > It must be a bug in erlang 21 binary matching in function definition. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From elbrujohalcon@REDACTED Fri Aug 3 18:42:35 2018 From: elbrujohalcon@REDACTED (Brujo Benavides) Date: Fri, 3 Aug 2018 13:42:35 -0300 Subject: [erlang-questions] erlang 21 binary matching bug in functin definition In-Reply-To: <19E031C7-F7CD-411D-888C-3BDBF53AB317@gmail.com> References: <19E031C7-F7CD-411D-888C-3BDBF53AB317@gmail.com> Message-ID: Actually? I could reproduce the bug, see? Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] Eshell V10.0 (abort with ^G) 1> {ok, A} = file:read_file("a.erl"), io:format("~s~n", [A]). -module a. -export [f1/1, f2/1]. f1(<>) -> case {Length, Data} of {0, _} -> {Length, Data}; {4, <<_:16/little, _/binary>>} -> irrelevant end. f2(<>) -> case {Length, Data} of {0, _} -> {Length, Data}; {4, _} -> irrelevant end. ok 2> a:f1(<<0>>). {0,<<0>>} 3> a:f2(<<0>>). {0,<<>>} 4> F = fun(<>) -> 4> case {Length, Data} of 4> {0, _} -> {Length, Data}; 4> {4, <<_:16/little, _/binary>>} -> irrelevant 4> end 4> end. #Fun 5> F(<<0>>). {0,<<>>} It seems to be related to the second pattern matching in the case statement. That?s weird Brujo Benavides > On 3 Aug 2018, at 13:32, Brujo Benavides wrote: > > Well, that?s not happening here? > > Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] > > Eshell V10.0 (abort with ^G) > 1> <> = <<0>>, {X, Y}. > {0,<<>>} > 2> F = fun(<>) -> {X, Y} end. > #Fun > 3> F(<<0>>). > {0,<<>>} > 4> {ok, A} = file:read_file("a.erl"), io:format("~s~n", [A]). > -module a. > -export [f/1]. > > f(<>) -> {X, Y}. > > ok > 5> c(a). > {ok,a} > 6> a:f(<<0>>). > {0,<<>>} > 7> > > There must be something else happening with your code. > > Brujo Benavides > > > >> On 3 Aug 2018, at 13:08, ?? > wrote: >> >> I try to fix the mysql-otp for erlang 21, but found a bug like this: >> ``` >> -module(a). >> -export([decode_binary/2]). >> decode_binary(_, <>) -> >> %% Coded in the same way as DATETIME and TIMESTAMP below, but returned in >> %% a simple triple. >> >> case {Length, Data} of >> {0, _} -> io:format("~p length:~p, Data:~p, ~n" , [?LINE, Length, Data]),{{0, 0, 0}, Data}; >> {4, <>} -> io:format("~p~n" , [?LINE]),{{Y, M, D}, Rest} >> end. >> >> ``` >> A function copy from https://github.com/mysql-otp/mysql-otp/blob/master/src/mysql_protocol.erl#L789-L795 >> My erlang version is 21.0.4, and the pr address is https://github.com/mysql-otp/mysql-otp/pull/84 . >> compile it and run: >> ``` >> erlc a.erl >> erl >> 1> a:decode_binary(test, <<0>>). >> 8 length:0, Data:<<0>>, >> {{0,0,0},<<0>>} >> ``` >> But in pattern matching: >> ``` >> 2> <> = <<0>>. >> <<0>> >> 3>Length. >> 0 >> 4>Data. >> <<>> >> ``` >> It must be a bug in erlang 21 binary matching in function definition. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Fri Aug 3 18:43:38 2018 From: lukas@REDACTED (Lukas Larsson) Date: Fri, 3 Aug 2018 18:43:38 +0200 Subject: [erlang-questions] UDP receive performance In-Reply-To: References: <20180524072357.GA97377@erix.ericsson.se> <355E67A6-9883-451D-A31D-8CC710244719@gmail.com> <19DDAEE8-037B-4793-9C83-7D8D5C73C234@mobilearts.com> <0AE32206-3A53-404A-A97E-426E0E974FA1@mobilearts.com> Message-ID: On Fri, Aug 3, 2018 at 6:31 PM pablo platt wrote: > The PR is merged. Will the fix be in the 21 branch and next point release? > > The fix will be part of OTP-21.1. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michal@REDACTED Fri Aug 3 18:45:38 2018 From: michal@REDACTED (=?utf-8?Q?Micha=C5=82_Muska=C5=82a?=) Date: Fri, 3 Aug 2018 18:45:38 +0200 Subject: [erlang-questions] erlang 21 binary matching bug in functin definition In-Reply-To: <19E031C7-F7CD-411D-888C-3BDBF53AB317@gmail.com> References: <19E031C7-F7CD-411D-888C-3BDBF53AB317@gmail.com> Message-ID: <495dc63b-9b48-42ca-a980-bc2189a644f3@Spark> On 3 Aug 2018, 18:32 +0200, Brujo Benavides , wrote: > Well, that?s not happening here? > I think you simplified the function too much, so it doesn't trigger the bug in the compiler anymore. I can reproduce the bug with a somewhat simpler code: -module(a). -export([err/2]). err(_, <>) -> ? ? case {Length, Data} of ? ? ? ? {0, _} -> Data; ? ? ? ? {4, <>} -> Rest ? ? end. Calling a:err(1, <<0>>) returns <<0>>. That's on 21.0.2 Micha?. -------------- next part -------------- An HTML attachment was scrubbed... URL: From elbrujohalcon@REDACTED Fri Aug 3 18:48:05 2018 From: elbrujohalcon@REDACTED (Brujo Benavides) Date: Fri, 3 Aug 2018 13:48:05 -0300 Subject: [erlang-questions] erlang 21 binary matching bug in functin definition In-Reply-To: <495dc63b-9b48-42ca-a980-bc2189a644f3@Spark> References: <19E031C7-F7CD-411D-888C-3BDBF53AB317@gmail.com> <495dc63b-9b48-42ca-a980-bc2189a644f3@Spark> Message-ID: Yeah, you?re right Micha?! :) In OTP20 it works? Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.1 (abort with ^G) 1> c(a), a:err(<<0>>). {0,<<>>} 2> ??: I think you should report the bug :) Brujo Benavides > On 3 Aug 2018, at 13:45, Micha? Muska?a wrote: > > On 3 Aug 2018, 18:32 +0200, Brujo Benavides , wrote: >> Well, that?s not happening here? >> > > I think you simplified the function too much, so it doesn't trigger the bug in the compiler anymore. I can reproduce the bug with a somewhat simpler code: > > > -module(a). > > -export([err/2]). > > err(_, <>) -> > case {Length, Data} of > {0, _} -> Data; > {4, <>} -> Rest > end. > > Calling a:err(1, <<0>>) returns <<0>>. That's on 21.0.2 > > Micha?. -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri Aug 3 19:39:06 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 3 Aug 2018 20:39:06 +0300 Subject: [erlang-questions] UDP receive performance In-Reply-To: References: <20180524072357.GA97377@erix.ericsson.se> <355E67A6-9883-451D-A31D-8CC710244719@gmail.com> <19DDAEE8-037B-4793-9C83-7D8D5C73C234@mobilearts.com> <0AE32206-3A53-404A-A97E-426E0E974FA1@mobilearts.com> Message-ID: Going to check it next week. I had to add this hacky thing with separate libevent thread because our old driver began to work badly. It would be good to check new mechanism. -------------- next part -------------- An HTML attachment was scrubbed... URL: From krzysztof.jurewicz@REDACTED Sat Aug 4 13:02:14 2018 From: krzysztof.jurewicz@REDACTED (Krzysztof Jurewicz) Date: Sat, 04 Aug 2018 13:02:14 +0200 Subject: [erlang-questions] RNG algorithm choice for uniform natural numbers In-Reply-To: <20180802161024.GA85691@erix.ericsson.se> References: <87h8kdklkq.fsf@gmail.com> <20180802161024.GA85691@erix.ericsson.se> Message-ID: <87effel7ih.fsf@gmail.com> Raimo Niskanen writes: >> ? Xorshift1024*. It fails the BigCrush test according to https://lemire.me/blog/2017/09/15/the-xorshift1024-random-number-generator-fails-bigcrush/ . > > It is a known fact that the lowest bits of Xors... generators with * and + > scramblers are of lower quality than the rest. If he had used the high 32 > bits I predict that it would have passed. > > The author of Xoroshiro, etc, thinks that this is a small problem. What I actually want to implement is a randomized apportionment scheme, as described on https://rangevoting.org/Apportion.html (?Truly unbiased methods?), but more efficient, like in the code below (not tested). Therefore if the test failure won?t cause a noticeable bias, then it indeed shouldn?t be a problem. -type score() :: ({Votes :: non_neg_integer(), Id :: any()}). -spec apportion(list(score()), pos_integer(), pos_integer()) -> list({Id :: any(), Seats :: non_neg_integer()}). apportion(Scores, TotalSeats, VotesSum) -> apportion(Scores, TotalSeats, VotesSum, []). apportion([], 0, 0, Acc) -> Acc; apportion([{Votes, Id}|ScoresTail], TotalSeats, VotesSum, Acc) -> WholeSeats = Votes * TotalSeats div VotesSum, DrawnSeats = case rand:uniform(VotesSum) =< Votes * TotalSeats rem VotesSum of true -> 1; false -> 0 end, Seats = WholeSeats + DrawnSeats, apportion(ScoresTail, TotalSeats - Seats, VotesSum - Votes, [{Id, Seats}|Acc]). > Any 64-bit word algorithm runs about 2..3 (or more) times slower > than a 58-bit output word one, on 64-bit Erlang. That's why. Sounds plausible. Though such differences likely won?t matter in my case, it doesn?t rule out choosing a 58-bit algorithm. The inter-platform compatibility issue is hypothetical for now. > I have never thought about implementing the new 64-bit word size generators > since nobody has asked for inter-platform compatibility before, and you still > have to be careful with bit compatibility. It is only when you request > the generator word size range that you get the raw numbers. And for > floating point if you are lucky that both platforms use the same bits > (low/high/middle). If I understand correctly, you basically mean that different RNG libraries can convert the same entropy bits to numbers differently. From emofine@REDACTED Sun Aug 5 20:31:21 2018 From: emofine@REDACTED (Edwin Fine) Date: Sun, 5 Aug 2018 14:31:21 -0400 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180724110243.11f236ce@raspy> References: <20180724110243.11f236ce@raspy> Message-ID: <4F830686-E373-49B7-8331-7B9B01DABC44@gmail.com> As a native English speaker, ?can? implies ?able to?, and ?cannot? implies ?unable to?. I *cannot* lift a 4000 lb car above my head using only my unaugmented body. However, I *can* absolutely ?apply the kernel-5.4.3.2 application independently of other applications on an arbitrary OTP 20 installation.? I just copy it into the right directory. It (presumably) simply will not work, or will break. The underlying meaning of the warning appears to be ?applying the kernel-5.4.3.2 application independently of other applications on an arbitrary OTP 20 installation results in a broken installation, so do not do this.? How about rewording it in an unambiguous imperative active voice? Note! Do *not* apply the kernel-5.4.3.2 application independently of other applications on an arbitrary OTP 20 installation. It will break the installation. //EOF > On Jul 24, 2018, at 05:02, wrote: > > Note! The kernel-5.4.3.2 application can *not* be applied > independently of other applications on an arbitrary > OTP 20 installation. From krzysztof.jurewicz@REDACTED Sun Aug 5 22:04:03 2018 From: krzysztof.jurewicz@REDACTED (Krzysztof Jurewicz) Date: Sun, 05 Aug 2018 22:04:03 +0200 Subject: [erlang-questions] RNG algorithm choice for uniform natural numbers In-Reply-To: References: <87h8kdklkq.fsf@gmail.com> Message-ID: <87d0uwr364.fsf@gmail.com> Richard O'Keefe writes: > a "uniform sequence of natural numbers". There are infinitely many natural > numbers. The generators you mention > produce integers of fixed size. What exactly is it you want? Do you want > something like > https://gmplib.org/manual/Integer-Random-Numbers.html ? Yes, bad wording on my side. It will be a sequence of invocations of rand:uniform_s/2 (on potentially differing integers). From Andras.Bekes@REDACTED Mon Aug 6 10:49:22 2018 From: Andras.Bekes@REDACTED (Bekes, Andras G) Date: Mon, 6 Aug 2018 08:49:22 +0000 Subject: [erlang-questions] {error,closed} vs. {error,econnreset} In-Reply-To: <20160926141520.GB2341@nybek.com> References: <54E4A07E.5010307@erlang.org> <20150502103209.GA19880@nybek.com> <20150624124817.GA30126@nybek.com> <20160926141520.GB2341@nybek.com> Message-ID: Hi All, Reviving this old thread again, because I am getting more and more convinced that we need further changes. We're still observing connection close events when an error should be reported to gen_tcp level. It can be a reset error somehow still not reported as 'econnreset', but I suspect it must be some other error. I checked the code in inet_drv.c. The function static int tcp_recv(tcp_descriptor* desc, int request_len) seems to work properly -- a reset is either reported as closed or econnreset, depending on show_econnreset, all other errors are reported as errors. However, the function static int tcp_send_or_shutdown_error(tcp_descriptor* desc, int err) hides errors. Connection reset errors are properly handled (either reported as closed or econnreset, depending on show_econnreset), but all other errors are just reported as closed. Active and passive modes have independent code paths, but I think both do the same: all errors are reported as normal close -- except for econnreset. Apparently I need to detect all errors. Is it possible to implement a show_errors (or show_all_errors) flag, too? Actually, this new flag could replace the current show_econnreset flag. Having two separate flags for econnreset & others requires more complex code, but having a single show_errors flag would simplify the current that provides special treatment for econnreset. I am not sure if it makes much sense to expose connection reset errors but still mask all other errors as normal close events. >From a farther point of view, it seems there are network-programming tasks (there is at least one!), for which Erlang seems not suitable. This sounds rather sad. Luckily the fix doesn't seem difficult. What do you think? Regards, Andras -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Rory Byrne Sent: Monday, September 26, 2016 4:15 PM To: erlang-questions@REDACTED Subject: Re: [erlang-questions] {error,closed} vs. {error,econnreset} Hi Andras, I'm answering this because you addressed my directly. At the current moment I am not in a position to speak with any authority regarding the code in inet_drv.c. It's been over a year since I last looked at this code and it would take me a good few hours to get to a point where I was comfortable to comment on it again. If you sniff the wire and can confirm with absolute certainty that the peer is sending an RST that is getting reported as {error, closed} in Erlang, then I'll make the time to look into it. Needless to say, you would need to provide significantly more information about the scenario in which this occurred: OS where Erlang is running, OS on the peer, all the socket options you set, the exact call(s) where you received {error, closed}, etc. Ideally you'd be able to provide a tcpdump trace of when the connection went down; it wouldn't need to be a deep trace, just enough to see the details of the TCP traffic (flags, sequence numbers, etc). Regards, Rory On Thu, Sep 22, 2016 at 12:51:38PM +0000, Bekes, Andras G wrote: > Hi Rory, All, > > Let me revive this old thread for a minute. The new gen_tcp option {show_econnreset, true} works well. > > However, we still notice some cases when we observe {error,closed} on the Erlang side, but other signs suggest that the TCP connection wasn't intentionally closed by the peer, but was closed because of some error. > We suspect some packets being dropped by the OS due to various buffer overruns. > I am not very familiar with packet-level details of TCP. Can someone confirm if there are other erroneous terminations of a TCP connection (other than econnreset), reported simply as {error,closed} by Erlang? > > I tried checking the code erts/emulator/drivers/common/inet_drv.c and it seems to me not, but can someone actually understanding that code also confirm? > > Thank you very much, > Andras > > -----Original Message----- > From: Bekes, Andras G (ICT) > Sent: Tuesday, August 11, 2015 2:43 PM > To: 'Rory Byrne'; erlang-questions@REDACTED > Subject: RE: [erlang-questions] {error,closed} vs. {error,econnreset} > > Hi Rory, > > I just tested this new feature in Erlang/OTP R18 and it works fine. > > Thank you very much all for implementing it! > > Regards, > Andras > > -----Original Message----- > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Rory Byrne > Sent: Wednesday, June 24, 2015 2:48 PM > To: erlang-questions@REDACTED > Subject: Re: [erlang-questions] {error,closed} vs. {error,econnreset} > > Hi Andras, > > On Tue, May 05, 2015 at 07:44:47AM +0000, Bekes, Andras G wrote: > > Thank you very much for your efforts Rory. > > > > The ability "to set a socket option that shows all econnreset errors" sounds like the right solution. I am wondering why hiding this detail is the default, but I believe there were good enough reasons to design it that way. > > > > I accept that your solution will not notice the connection reset event in some corner cases. I think this will not apply in my case: I am sending a small amount of data (<1KB) and wait for the reply. > > > > I am looking forward to see your patch in the next release of Erlang/OTP! > > The fix for this is in the 18.0 release. It should take care of the corner cases too. > > Use the socket option '{show_econnreset, true}' and you'll receive {error, econnreset} in passive mode or {tcp_error, Socket, econnreset} in active mode. See the docs [1] for more information. > > Regards, > > Rory > > [1] http://www.erlang.org/doc/man/inet.html#setopts-2 > _______________________________________________ > 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 fchschneider@REDACTED Mon Aug 6 13:42:37 2018 From: fchschneider@REDACTED (Frans Schneider) Date: Mon, 6 Aug 2018 13:42:37 +0200 Subject: [erlang-questions] Background wx_object set_id/2 Message-ID: <28a3f49c-5ea1-e022-c664-c3673e02a863@gmail.com> Dear list, I am wondering what purpose the wx_object:set_pid/2 function serves? Why would one use this? Thanks, Frans From dangud@REDACTED Mon Aug 6 14:29:21 2018 From: dangud@REDACTED (Dan Gudmundsson) Date: Mon, 6 Aug 2018 14:29:21 +0200 Subject: [erlang-questions] Background wx_object set_id/2 In-Reply-To: <28a3f49c-5ea1-e022-c664-c3673e02a863@gmail.com> References: <28a3f49c-5ea1-e022-c664-c3673e02a863@gmail.com> Message-ID: If you use wx_object module the pid is used to access the corresponding erlang process/server. If you fetch the "object" from wxWidgets for example from Parent = wxWindow:getParent(Window) you will get an object without the pid set and you can manually set it with wx_object:set_pid/2. /Dan On Mon, Aug 6, 2018 at 1:42 PM Frans Schneider wrote: > Dear list, > > I am wondering what purpose the wx_object:set_pid/2 function serves? Why > would one use this? > > Thanks, > > Frans > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fchschneider@REDACTED Mon Aug 6 14:56:21 2018 From: fchschneider@REDACTED (Frans Schneider) Date: Mon, 6 Aug 2018 14:56:21 +0200 Subject: [erlang-questions] Background wx_object set_id/2 In-Reply-To: References: <28a3f49c-5ea1-e022-c664-c3673e02a863@gmail.com> Message-ID: I am not really sure I get the full picture yet. So, it is not tinkering with the wx_object process itself but just sets an attribute in the data structure of the wxWidget object? But why are the wx_object functions stop, call and cast using that Pid than? Frans On 08/06/2018 02:29 PM, Dan Gudmundsson wrote: > If you use wx_object module the pid is used to access the corresponding > erlang process/server. > > If you fetch the "object" from wxWidgets for example > from Parent = wxWindow:getParent(Window) you will get an object without > the pid set and you can manually set it with wx_object:set_pid/2. > > /Dan > > On Mon, Aug 6, 2018 at 1:42 PM Frans Schneider > wrote: > > Dear list, > > I am wondering what purpose the wx_object:set_pid/2 function serves? > Why > would one use this? > > Thanks, > > Frans > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From dangud@REDACTED Mon Aug 6 15:27:45 2018 From: dangud@REDACTED (Dan Gudmundsson) Date: Mon, 6 Aug 2018 15:27:45 +0200 Subject: [erlang-questions] Background wx_object set_id/2 In-Reply-To: References: <28a3f49c-5ea1-e022-c664-c3673e02a863@gmail.com> Message-ID: On Mon, Aug 6, 2018 at 2:56 PM Frans Schneider wrote: > I am not really sure I get the full picture yet. So, it is not tinkering > with the wx_object process itself but just sets an attribute in the data > structure of the wxWidget object? Yes > But why are the wx_object functions > stop, call and cast using that Pid than? > I don't think I understand the question, stop, call and cast needs to know which pid to send the messages to. Normally the pid attribute is set in wx_object init before it is returned to the user. But if you get the wxWidget object via another call to wx the pid attribute may not be set, and this gave an option to associate the pid with the wxWidgets object without tinkering with internal opaque record. I needed to set it somewhere/sometime and added the function so I could keep the record definition internal to wx. /Dan > > Frans > > On 08/06/2018 02:29 PM, Dan Gudmundsson wrote: > > If you use wx_object module the pid is used to access the corresponding > > erlang process/server. > > > > If you fetch the "object" from wxWidgets for example > > from Parent = wxWindow:getParent(Window) you will get an object without > > the pid set and you can manually set it with wx_object:set_pid/2. > > > > /Dan > > > > On Mon, Aug 6, 2018 at 1:42 PM Frans Schneider > > wrote: > > > > Dear list, > > > > I am wondering what purpose the wx_object:set_pid/2 function serves? > > Why > > would one use this? > > > > Thanks, > > > > Frans > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fchschneider@REDACTED Mon Aug 6 16:49:33 2018 From: fchschneider@REDACTED (Frans Schneider) Date: Mon, 6 Aug 2018 16:49:33 +0200 Subject: [erlang-questions] Background wx_object set_id/2 In-Reply-To: References: <28a3f49c-5ea1-e022-c664-c3673e02a863@gmail.com> Message-ID: <1254c4c9-53c1-7253-001a-38d4e0e9dec4@gmail.com> Thanks Dan, clear now. Somehow the mentioning of setting a controlling process in the documentation made me expect something more magic. Frans On 08/06/2018 03:27 PM, Dan Gudmundsson wrote: > On Mon, Aug 6, 2018 at 2:56 PM Frans Schneider > wrote: > > I am not really sure I get the full picture yet. So, it is not > tinkering > with the wx_object process itself but just sets an attribute in the > data > structure of the wxWidget object? > > > Yes > > But why are the wx_object functions > stop, call and cast using that Pid than? > > > I don't think I understand the question, stop, call and cast needs to > know which pid to send the messages to. > > Normally the pid attribute is set in wx_object init before it is > returned to the user. > > But if you get the wxWidget object via another call to wx the pid > attribute may not be set, and this gave an option to associate the pid > with the wxWidgets object without tinkering with internal opaque record. > > I needed to set it somewhere/sometime and added the function so I could > keep the record definition internal to wx. > > /Dan > > > Frans > > On 08/06/2018 02:29 PM, Dan Gudmundsson wrote: > > If you use wx_object module the pid is used to access the > corresponding > > erlang process/server. > > > > If you fetch the "object" from wxWidgets for example > > from Parent = wxWindow:getParent(Window) you will get an object > without > > the pid set and you can manually set it with wx_object:set_pid/2. > > > > /Dan > > > > On Mon, Aug 6, 2018 at 1:42 PM Frans Schneider > > > >> > wrote: > > > >? ? ?Dear list, > > > >? ? ?I am wondering what purpose the wx_object:set_pid/2 function > serves? > >? ? ?Why > >? ? ?would one use this? > > > >? ? ?Thanks, > > > >? ? ?Frans > >? ? ?_______________________________________________ > >? ? ?erlang-questions mailing list > > erlang-questions@REDACTED > > > > http://erlang.org/mailman/listinfo/erlang-questions > > > From g@REDACTED Tue Aug 7 10:38:09 2018 From: g@REDACTED (Guilherme Andrade) Date: Tue, 7 Aug 2018 09:38:09 +0100 Subject: [erlang-questions] enif_send() and overrun heap In-Reply-To: <1529516344.30324.29.camel@ericsson.com> References: <1529516344.30324.29.camel@ericsson.com> Message-ID: Hi, On 20 June 2018 at 18:39, Sverker Eriksson wrote: > I suggest you (and everybody during NIF development) to run on a debug-VM. > It's slower but it catches a lot of faults earlier and produces a nicer > core > dump. It will catch enif_* API violations such as building > tuples/lists/maps > with terms from different environments. > I finally found the time to look into this matter again. Using a debug build of the VM (20.3), the crash consistently happens due to a failed assertion in line 445 of erl_nif.c[1]. Other conditions are the same as before. Is this enlightening in anyway? I've got a 2.8 GiB core dump I can look into if you tell me that's the right direction to go. [1]: https://github.com/erlang/otp/blob/OTP-20.3.8.4/erts/emulator/beam/erl_nif.c#L445 -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Tue Aug 7 12:23:41 2018 From: g@REDACTED (Guilherme Andrade) Date: Tue, 7 Aug 2018 11:23:41 +0100 Subject: [erlang-questions] enif_send() and overrun heap In-Reply-To: References: <1529516344.30324.29.camel@ericsson.com> Message-ID: I've distilled the flow that triggers the crash and made a demo. https://github.com/g-andrade/enif_send_crash It implements a dirty NIF which sends messages to a second process using enif_send() and a message containing a heap-allocated term. It increases the number of iterations exponentially until it crashes. This is what happens in my machine very consistently (macOS): > ./enif_send_crash > Trying to crash (1 iterations)... > Trying to crash (2 iterations)... > Trying to crash (4 iterations)... > Trying to crash (8 iterations)... > Trying to crash (16 iterations)... > Trying to crash (32 iterations)... > Trying to crash (64 iterations)... > Trying to crash (128 iterations)... > Trying to crash (256 iterations)... > Trying to crash (512 iterations)... > Trying to crash (1024 iterations)... > beam/erl_nif.c:445:cache_env() Assertion failed: env->hp_end == (env->proc)->stop On 7 August 2018 at 09:38, Guilherme Andrade wrote: > Hi, > > On 20 June 2018 at 18:39, Sverker Eriksson > wrote: > >> I suggest you (and everybody during NIF development) to run on a debug-VM. >> It's slower but it catches a lot of faults earlier and produces a nicer >> core >> dump. It will catch enif_* API violations such as building >> tuples/lists/maps >> with terms from different environments. >> > > I finally found the time to look into this matter again. > > Using a debug build of the VM (20.3), the crash consistently happens due > to a failed assertion in line 445 of erl_nif.c[1]. > Other conditions are the same as before. > > Is this enlightening in anyway? I've got a 2.8 GiB core dump I can look > into if you tell me that's the right direction to go. > > > [1]: https://github.com/erlang/otp/blob/OTP-20.3.8.4/erts/ > emulator/beam/erl_nif.c#L445 > > -- > Guilherme > -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From krzysztof.jurewicz@REDACTED Tue Aug 7 13:23:04 2018 From: krzysztof.jurewicz@REDACTED (Krzysztof Jurewicz) Date: Tue, 07 Aug 2018 13:23:04 +0200 Subject: [erlang-questions] Requirements for seed integers in the rand module Message-ID: <87a7pyqv3b.fsf@gmail.com> The seed/2 and seed_s/2 functions in the rand module take a 3-element tuple of integers as a seed, however it doesn?t document what are the requirements for those integers (how they need to be distributed). If seed is omitted (the seed/1 and seed_s/1 functions), then the following (undocumented) value is used: {erlang:phash2([{node(),self()}]), erlang:system_time(), erlang:unique_integer()} I have 64 bytes of entropy which I want to use as a seed. Is it ok to do it in the way below? {binary:decode_unsigned(Entropy), 0, 0} From g@REDACTED Tue Aug 7 18:25:07 2018 From: g@REDACTED (Guilherme Andrade) Date: Tue, 7 Aug 2018 17:25:07 +0100 Subject: [erlang-questions] enif_send() and overrun heap In-Reply-To: References: <1529516344.30324.29.camel@ericsson.com> Message-ID: On 7 August 2018 at 11:23, Guilherme Andrade wrote: > I've distilled the flow that triggers the crash and made a demo. > > https://github.com/g-andrade/enif_send_crash > > It implements a dirty NIF which sends messages to a second process using > enif_send() and a message containing a heap-allocated term. > It increases the number of iterations exponentially until it crashes. > I've also created an issue[1] in the bug tracker after someone privately suggested it to me. [1]: https://bugs.erlang.org/browse/ERL-695 > > This is what happens in my machine very consistently (macOS): > > > ./enif_send_crash > > Trying to crash (1 iterations)... > > Trying to crash (2 iterations)... > > Trying to crash (4 iterations)... > > Trying to crash (8 iterations)... > > Trying to crash (16 iterations)... > > Trying to crash (32 iterations)... > > Trying to crash (64 iterations)... > > Trying to crash (128 iterations)... > > Trying to crash (256 iterations)... > > Trying to crash (512 iterations)... > > Trying to crash (1024 iterations)... > > beam/erl_nif.c:445:cache_env() Assertion failed: env->hp_end == > (env->proc)->stop > > > On 7 August 2018 at 09:38, Guilherme Andrade wrote: > >> Hi, >> >> On 20 June 2018 at 18:39, Sverker Eriksson > > wrote: >> >>> I suggest you (and everybody during NIF development) to run on a >>> debug-VM. >>> It's slower but it catches a lot of faults earlier and produces a nicer >>> core >>> dump. It will catch enif_* API violations such as building >>> tuples/lists/maps >>> with terms from different environments. >>> >> >> I finally found the time to look into this matter again. >> >> Using a debug build of the VM (20.3), the crash consistently happens due >> to a failed assertion in line 445 of erl_nif.c[1]. >> Other conditions are the same as before. >> >> Is this enlightening in anyway? I've got a 2.8 GiB core dump I can look >> into if you tell me that's the right direction to go. >> >> >> [1]: https://github.com/erlang/otp/blob/OTP-20.3.8.4/erts/emulato >> r/beam/erl_nif.c#L445 >> >> -- >> Guilherme >> > > > > -- > Guilherme > -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From icfp.publicity@REDACTED Tue Aug 7 20:14:44 2018 From: icfp.publicity@REDACTED (Lindsey Kuper) Date: Tue, 07 Aug 2018 11:14:44 -0700 Subject: [erlang-questions] Call for Participation: ICFP 2018 Message-ID: <5b69e194465e1_20503ff7ee055bec1011ac@landin.local.mail> *** Early registration ends 27 August. *** ===================================================================== Call for Participation ICFP 2018 23rd ACM SIGPLAN International Conference on Functional Programming and affiliated events September 23 - September 29, 2018 St. Louis, Missouri, USA http://icfp18.sigplan.org/ ===================================================================== ICFP provides a forum for researchers and developers to hear about the latest work on the design, implementations, principles, and uses of functional programming. The conference covers the entire spectrum of work, from practice to theory, including its peripheries. This year, ICFP is co-located with Strange Loop! Considering attending ICFP for the first time? See our brief explainer: https://icfp18.sigplan.org/attending/introduction-to-icfp * Overview and affiliated events: http://icfp18.sigplan.org/home * Program: http://icfp18.sigplan.org/program/program-icfp-2018 * Accepted papers: http://icfp18.sigplan.org/track/icfp-2018-papers * Registration is available via: https://regmaster4.com/2018conf/ICFP18/register.php Early registration ends 27 August, 2018. * Programming contest results: https://icfpcontest2018.github.io/ * Student Research Competition: https://icfp18.sigplan.org/track/icfp-2018-Student-Research-Competition * Follow us on Twitter for the latest news: http://twitter.com/icfp_conference In addition to Strange Loop (9/26-9/28), there are several events co-located with ICFP: * Erlang Workshop (9/29) * Functional Art, Music, Modeling and Design (9/29) * Functional High-Performance Computing (9/29) * Haskell Implementors' Workshop (9/23) * Haskell Symposium (9/27-9/28) * Higher-order Programming with Effects (9/23) * ICFP Tutorials (9/27-9/29) * ML Family Workshop (9/28) * Numerical Programming in Functional Languages (9/27) * OCaml Workshop (9/27) * Programming Languages Mentoring Workshop (9/23) * Scala Symposium (9/28) * Scheme Workshop (9/28) * Type-Driven Development (9/27) Conference Organizers: General Chair: Robby Findler (Northwestern University, USA) Program Chair: Matthew Flatt (University of Utah, USA) Accessibility Chair: Alan Jeffrey (Mozilla Research, USA) Artefact Evaluation Co-Chair: Simon Marlow (Facebook, UK) Industrial Relations Chair: Alan Jeffrey (Mozilla Research, USA) PLMW Co-Chair: Dan Licata (Wesleyan University, USA) PLMW Co-Chair: David Van Horn (University of Maryland, USA) PLMW Co-Chair: Niki Vazou (University of Maryland, USA) Programming Contest Organizer: Matthew Fluet (Rochester Institute of Technology, USA) Publications Co-Chair: Alex Potanin (Victoria University of Wellington, New Zealand) Publicity Chair: Lindsey Kuper (UC Santa Cruz, USA) Student Research Competition Chair: Ravi Chugh (University of Chicago, USA) Student Volunteer Co-Captain: Jakub Zalewski (University of Edinburgh, UK) Student Volunteer Co-Captain: Spencer P. Florence (Northwestern University, USA) Treasurer and Conference Manager: Annabel Satin (P.C.K., UK) Video Co-Chair Jamie Willis (University of Bristol, UK) Video Co-Chair: Jose Calderon (Galois, USA) Workshops Co-Chair: Christophe Scholliers (Ghent University, Belgium) Workshops Co-Chair: David Christiansen (Galois, USA) Sponsors and industrial partners: Platinum supporters: Ahrefs Jane Street Standard Chartered X Gold supporters: DFINITY Facebook Mozilla McCormick School of Engineering, Northwestern University Silver supporters: Bloomberg Cal Poly Computer Science & Software Engineering Digital Asset Galois Microsoft Research Oracle Labs Tweag I/O Bronze supporters: Google IntelliFactory Kadena Obsidian Systems Systor Vest Well-Typed From codewiget95@REDACTED Tue Aug 7 20:29:39 2018 From: codewiget95@REDACTED (Code Wiget) Date: Tue, 7 Aug 2018 14:29:39 -0400 Subject: [erlang-questions] Gracefully Exit from state_timeout gen statem Message-ID: Hi everyone, How do you gracefully exit from a state_timeout in a gen_statem? Generally, for a gen_statem, I can return ?stop? or {stop, Reason} from a state function and the statem will terminate. However, if I use a state timeout method, returned from init: > {ok, new_state, State, {state_timeout, 2000}} The new_state(state_timeout, Info, State) method is called after 2000. Returning ?stop? from this given an error?: > 18:22:33.039 [error] <0.576.0> : ?Lager event handler error_logger_lager_h exited with reason {'EXIT',{{badmatch,[smdpp_proxy,{state_timeout,timeout},[{data,[{"State",{awaiting_ > What can I return from this function to gracefully exit? Can this be done with state_timeout? If this is an obvious question, please point me in the right direction. The documentation here:http://erlang.org/doc/man/gen_statem.html?doesn?t seem to mention any return from the state_timeout. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From amin.arria@REDACTED Tue Aug 7 21:19:16 2018 From: amin.arria@REDACTED (Amin Arria) Date: Tue, 7 Aug 2018 16:19:16 -0300 Subject: [erlang-questions] Unknown error while using SSL/TLS Message-ID: Hi everyone, I have an application using cowboy with SSL/TLS. For some reason it has stopped accepting connections and giving SSL erros to the clients connecting. The only piece of info the server gives is "TLS server: In state certify received CLIENT ALERT: Fatal - Illegal Parameter" and I can't find anything about. Do you know anything? Thanks, Amin -------------- next part -------------- An HTML attachment was scrubbed... URL: From codewiget95@REDACTED Tue Aug 7 21:05:08 2018 From: codewiget95@REDACTED (Code Wiget) Date: Tue, 7 Aug 2018 15:05:08 -0400 Subject: [erlang-questions] Gracefully Exit from state_timeout gen statem In-Reply-To: References: Message-ID: <1d4167e3-ea88-4b0c-ae69-a4fd27d98cc2@Spark> Would like to update this to say that I?m using {state_timeout, 2000, timeout}, rather than {state_timeout, 2000} On Aug 7, 2018, 2:29 PM -0400, Code Wiget , wrote: > Hi everyone, > > How do you gracefully exit from a state_timeout in a gen_statem? Generally, for a gen_statem, I can return ?stop? or {stop, Reason} from a state function and the statem will terminate. However, if I use a state timeout method, returned from init: > > > {ok, new_state, State, {state_timeout, 2000}} > > The new_state(state_timeout, Info, State) method is called after 2000. Returning ?stop? from this given an error?: > > > 18:22:33.039 [error] <0.576.0> : ?Lager event handler error_logger_lager_h exited with reason {'EXIT',{{badmatch,[smdpp_proxy,{state_timeout,timeout},[{data,[{"State",{awaiting_ > > > What can I return from this function to gracefully exit? Can this be done with state_timeout? If this is an obvious question, please point me in the right direction. The documentation here:http://erlang.org/doc/man/gen_statem.html?doesn?t seem to mention any return from the state_timeout. > > Thanks! > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Wed Aug 8 08:43:49 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Wed, 8 Aug 2018 08:43:49 +0200 Subject: [erlang-questions] Unknown error while using SSL/TLS In-Reply-To: References: Message-ID: Hi Amin! 2018-08-07 21:19 GMT+02:00 Amin Arria : > Hi everyone, > > I have an application using cowboy with SSL/TLS. For some reason it has > stopped accepting connections and giving SSL erros to the clients > connecting. > > The only piece of info the server gives is "TLS server: In state certify > received CLIENT ALERT: Fatal - Illegal Parameter" and I can't find anything > about. Do you know anything? > > If you think about the wording, you would realise that it is the clients that are sending the alerts and not the server. However it is possible that it is due to a bug in the server, but it could also be a client problem. Illegal Parameter is tipically a subtle interop problem that is the client or the server is doing something wrong so that they are not able to a agree on a shared secret. Without any more details about versions of OTP and the ssl application and what cipher suites used to work it is hard to say anything more. Regards Ingela Erlang/OTP team - Ericsson AB > Thanks, > Amin > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdl.web@REDACTED Wed Aug 8 14:23:45 2018 From: sdl.web@REDACTED (Leo Liu) Date: Wed, 08 Aug 2018 20:23:45 +0800 Subject: [erlang-questions] Unknown error while using SSL/TLS In-Reply-To: (Amin Arria's message of "Tue, 7 Aug 2018 16:19:16 -0300") References: Message-ID: On 2018-08-07 16:19 -0300, Amin Arria wrote: > I have an application using cowboy with SSL/TLS. For some reason it has > stopped accepting connections and giving SSL erros to the clients > connecting. > > The only piece of info the server gives is "TLS server: In state certify > received CLIENT ALERT: Fatal - Illegal Parameter" and I can't find anything > about. Do you know anything? I have to debug such an issue some weeks ago. I got a call for help near midnight and wasted nearly 3 hours to get it working (sort of). Something changed between OTP 20.3.2 and 20.3.8.3 that makes some certificates unhappy. I bypassed it by using SSL application from 20.3.2 with OTP 20.3.8.3. There is some bug somewhere. Leo From mononcqc@REDACTED Wed Aug 8 20:09:09 2018 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 8 Aug 2018 14:09:09 -0400 Subject: [erlang-questions] [ANN] Property-Based Testing with PropEr, Erlang, and Elixir (Beta) Message-ID: Hi everyone, I wanted to announce that today, my new book enters its beta phase with pragmatic programmers. The full title is Property-Based Testing with PropEr, Erlang, and Elixir: find bugs before your users do. You have possibly seen it?s early draft, PropEr Testing, but this copy is a fancier one that has gone through the benefit of full editing. I?ve also added Elixir translations, in case this may be of interest to folks on this mailing list as well. If you?ve always been interested by property based testing but felt ?holy crap this is wizard stuff? I?m happy to say I truly believe this is going to be the easiest way to get into the practice of thinking in properties. Anyway, the full announcement with more information is at https://media.pragprog.com/newsletters/2018-08-08.html Thanks, Fred. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.geib.44@REDACTED Wed Aug 8 23:01:37 2018 From: mark.geib.44@REDACTED (Mark Geib) Date: Wed, 8 Aug 2018 15:01:37 -0600 Subject: [erlang-questions] R21 logger mangles map messages Message-ID: I am migrating an application to R21 to try out the new logger. When I log a message with a map, using ?~p?, it appears like: #{pmt_pid =>, 33, program_number =>, 5837} <-----(notice the extra commas after each =>) compared to io:format output of #{pmt_pid => 33, program_number => 5837} In both cases my formatting is ?~p?. Has anyone seen this before.?? Thanks, Mark. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 528 bytes Desc: Message signed with OpenPGP URL: From ingela.andin@REDACTED Thu Aug 9 09:53:47 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Thu, 9 Aug 2018 09:53:47 +0200 Subject: [erlang-questions] Unknown error while using SSL/TLS In-Reply-To: References: Message-ID: Hi! I believe the bug could be solved by the following patch: diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl index 40d974f..aa453fe 100644 --- a/lib/ssl/src/ssl_cipher.erl +++ b/lib/ssl/src/ssl_cipher.erl @@ -2555,6 +2555,8 @@ ecdsa_signed_suites(Ciphers, Version) -> rsa_keyed(dhe_rsa) -> true; +rsa_keyed(ecdhe_rsa) -> + true; rsa_keyed(rsa) -> true; rsa_keyed(rsa_psk) -> @@ -2618,6 +2620,8 @@ ec_keyed(ecdh_ecdsa) -> true; ec_keyed(ecdh_rsa) -> true; +ec_keyed(ecdhe_ecdsa) -> + true; ec_keyed(_) -> false. Regards Ingela Erlang/OTP Team 2018-08-08 14:23 GMT+02:00 Leo Liu : > On 2018-08-07 16:19 -0300, Amin Arria wrote: > > I have an application using cowboy with SSL/TLS. For some reason it has > > stopped accepting connections and giving SSL erros to the clients > > connecting. > > > > The only piece of info the server gives is "TLS server: In state certify > > received CLIENT ALERT: Fatal - Illegal Parameter" and I can't find > anything > > about. Do you know anything? > > I have to debug such an issue some weeks ago. I got a call for help near > midnight and wasted nearly 3 hours to get it working (sort of). > > Something changed between OTP 20.3.2 and 20.3.8.3 that makes some > certificates unhappy. I bypassed it by using SSL application from 20.3.2 > with OTP 20.3.8.3. There is some bug somewhere. > > Leo > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangsiri@REDACTED Thu Aug 9 10:31:32 2018 From: erlangsiri@REDACTED (Siri Hansen) Date: Thu, 9 Aug 2018 10:31:32 +0200 Subject: [erlang-questions] R21 logger mangles map messages In-Reply-To: References: Message-ID: It is probably the single_line property on the formatter that causes this. If single_line is true (default), then the formatted string is converted to a single line by replacing all newlines with ", " (comma, space). Could you please try to set single_line to false and let me see the output? The property can be set as follows (if the printout comes from the default handler): logger:update_formatter_config(default,single_line,false). Regards /siri Den ons. 8. aug. 2018 kl. 23:01 skrev Mark Geib : > I am migrating an application to R21 to try out the new logger. When I log > a message with a map, using ?~p?, it appears like: > > #{pmt_pid =>, 33, program_number =>, 5837} <-----(notice the extra commas > after each =>) > > compared to io:format output of #{pmt_pid => 33, program_number => 5837} > > In both cases my formatting is ?~p?. > > Has anyone seen this before.?? > > Thanks, > > Mark. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdl.web@REDACTED Thu Aug 9 10:39:20 2018 From: sdl.web@REDACTED (Leo Liu) Date: Thu, 09 Aug 2018 16:39:20 +0800 Subject: [erlang-questions] Unknown error while using SSL/TLS In-Reply-To: (Ingela Andin's message of "Thu, 9 Aug 2018 09:53:47 +0200") References: Message-ID: On 2018-08-09 09:53 +0200, Ingela Andin wrote: > Hi! > > > I believe the bug could be solved by the following patch: Yes, fix the issue here. Amin, can you verify it also fixes the issue you were seeing? Leo > > diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl > index 40d974f..aa453fe 100644 > --- a/lib/ssl/src/ssl_cipher.erl > +++ b/lib/ssl/src/ssl_cipher.erl > @@ -2555,6 +2555,8 @@ ecdsa_signed_suites(Ciphers, Version) -> > > rsa_keyed(dhe_rsa) -> > true; > +rsa_keyed(ecdhe_rsa) -> > + true; > rsa_keyed(rsa) -> > true; > rsa_keyed(rsa_psk) -> > @@ -2618,6 +2620,8 @@ ec_keyed(ecdh_ecdsa) -> > true; > ec_keyed(ecdh_rsa) -> > true; > +ec_keyed(ecdhe_ecdsa) -> > + true; > ec_keyed(_) -> > false. > > > Regards Ingela Erlang/OTP Team From jesper.louis.andersen@REDACTED Thu Aug 9 14:16:57 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 9 Aug 2018 14:16:57 +0200 Subject: [erlang-questions] [ANN] Property-Based Testing with PropEr, Erlang, and Elixir (Beta) In-Reply-To: References: Message-ID: Awesome work! Now I have something to point to when people ask me about books on the subject. On Wed, Aug 8, 2018 at 8:09 PM Fred Hebert wrote: > Hi everyone, > > I wanted to announce that today, my new book enters its beta phase with > pragmatic programmers. The full title is Property-Based Testing with > PropEr, Erlang, and Elixir: find bugs before your users do. > > You have possibly seen it?s early draft, PropEr Testing, but this copy is > a fancier one that has gone through the benefit of full editing. I?ve also > added Elixir translations, in case this may be of interest to folks on this > mailing list as well. > > If you?ve always been interested by property based testing but felt ?holy > crap this is wizard stuff? I?m happy to say I truly believe this is going > to be the easiest way to get into the practice of thinking in properties. > > Anyway, the full announcement with more information is at > https://media.pragprog.com/newsletters/2018-08-08.html > > Thanks, > Fred. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From krzysztof.jurewicz@REDACTED Thu Aug 9 15:27:51 2018 From: krzysztof.jurewicz@REDACTED (Krzysztof Jurewicz) Date: Thu, 09 Aug 2018 15:27:51 +0200 Subject: [erlang-questions] RNG algorithm choice for uniform natural numbers In-Reply-To: <87effel7ih.fsf@gmail.com> References: <87h8kdklkq.fsf@gmail.com> <20180802161024.GA85691@erix.ericsson.se> <87effel7ih.fsf@gmail.com> Message-ID: <877ekzr7oo.fsf@gmail.com> > What I actually want to implement is a randomized apportionment scheme, as described on https://rangevoting.org/Apportion.html (?Truly unbiased methods?), but more efficient, like in the code below (not tested). Tests revealed that the simple algorithm does not satisfy the quota property. Therefore I?ve used a more sophisticated one (code below), which however doesn?t require using a specific interval for drawing integers. Instead of the rand module, I use SHA-256 to generate random integers (taking first n bits). This is very interoperable between languages, though I don?t know whether SHA-256 satisfies all RNG properties desirable in that context. (Also I don?t have a proof that the distribution of apportioned seats is unbiased). -type score() :: ({Votes :: non_neg_integer(), Id :: any()}). -type result() :: {Id :: any(), Seats :: non_neg_integer()}. -spec apportion(list(score()), pos_integer(), pos_integer(), binary()) -> list(result()). apportion(Scores, TotalSeats, VotesSum, State) -> {WholeSeatsMap, RemainderScores, RemainingSeats, _} = lists:foldl( fun ( {Votes, Id}, {WholeSeatsAcc, RemainderScoresAcc, RemSeatsAcc, StateAcc}) -> Seats = Votes * TotalSeats div VotesSum, <> = NewState = crypto:hash(sha256, StateAcc), RemainderScore = (Votes * TotalSeats rem VotesSum) * (RandInt + 1), {maps:put(Id, Seats, WholeSeatsAcc), [{RemainderScore, Id}|RemainderScoresAcc], RemSeatsAcc - Seats, NewState} end, {#{}, [], TotalSeats, State}, Scores), DrawnIds = %% We actually need to sort the list only at first RemainderSeats places, so here is a room for optimization. [Id || {_, Id} <- lists:sublist(lists:reverse(lists:sort(RemainderScores)), RemainingSeats)], ResultMap = lists:foldl( fun (Id, ResultMapAcc) -> maps:update_with( Id, fun (OldSeats) -> OldSeats + 1 end, 1, ResultMapAcc) end, WholeSeatsMap, DrawnIds), lists:sort([{Id, Seats} || {Id, Seats} <- maps:to_list(ResultMap), Seats > 0]). From mark.geib.44@REDACTED Thu Aug 9 16:42:20 2018 From: mark.geib.44@REDACTED (Mark Geib) Date: Thu, 9 Aug 2018 08:42:20 -0600 Subject: [erlang-questions] R21 logger mangles map messages In-Reply-To: References: Message-ID: <10D95C90-B138-4387-96A3-B8B6B2B2600D@gmail.com> Yes that removed the extra commas. Of course now the log messages are multi-line. So to get a single line message for maps, without the commas, is the only approach to format the message with something like io_lib:print(MyBigMap,1,8192,-1) and then log the string? These log messages are being consumed by splunk, so the commas are causing problems, and the messages need to be single line. Thanks, Mark. > On Aug 9, 2018, at 2:31 AM, Siri Hansen wrote: > > It is probably the single_line property on the formatter that causes this. If single_line is true (default), then the formatted string is converted to a single line by replacing all newlines with ", " (comma, space). Could you please try to set single_line to false and let me see the output? The property can be set as follows (if the printout comes from the default handler): > > logger:update_formatter_config(default,single_line,false). > > Regards > /siri > > Den ons. 8. aug. 2018 kl. 23:01 skrev Mark Geib >: > I am migrating an application to R21 to try out the new logger. When I log a message with a map, using ?~p?, it appears like: > > #{pmt_pid =>, 33, program_number =>, 5837} <-----(notice the extra commas after each =>) > > compared to io:format output of #{pmt_pid => 33, program_number => 5837} > > In both cases my formatting is ?~p?. > > Has anyone seen this before.?? > > Thanks, > > Mark. > _______________________________________________ > 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: signature.asc Type: application/pgp-signature Size: 528 bytes Desc: Message signed with OpenPGP URL: From max.lapshin@REDACTED Thu Aug 9 22:23:27 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 9 Aug 2018 23:23:27 +0300 Subject: [erlang-questions] R21 logger mangles map messages In-Reply-To: <10D95C90-B138-4387-96A3-B8B6B2B2600D@gmail.com> References: <10D95C90-B138-4387-96A3-B8B6B2B2600D@gmail.com> Message-ID: Oh, I see mpegts =) -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Thu Aug 9 22:29:07 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 9 Aug 2018 23:29:07 +0300 Subject: [erlang-questions] [ANN] Property-Based Testing with PropEr, Erlang, and Elixir (Beta) In-Reply-To: References: Message-ID: Excellent, thanks! Have just purchased. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierrefenoll@REDACTED Fri Aug 10 08:52:02 2018 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Fri, 10 Aug 2018 08:52:02 +0200 Subject: [erlang-questions] [ANN] Property-Based Testing with PropEr, Erlang, and Elixir (Beta) In-Reply-To: References: Message-ID: Amazing! Hopefully this will change the state of testing at large a little! Just bought it :) On Thu 9 Aug 2018 at 22:29, Max Lapshin wrote: > Excellent, thanks! > > Have just purchased. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Cheers, -- Pierre Fenoll -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangsiri@REDACTED Fri Aug 10 11:07:08 2018 From: erlangsiri@REDACTED (Siri Hansen) Date: Fri, 10 Aug 2018 11:07:08 +0200 Subject: [erlang-questions] R21 logger mangles map messages In-Reply-To: <10D95C90-B138-4387-96A3-B8B6B2B2600D@gmail.com> References: <10D95C90-B138-4387-96A3-B8B6B2B2600D@gmail.com> Message-ID: Den tor. 9. aug. 2018 kl. 16:42 skrev Mark Geib : > Yes that removed the extra commas. Of course now the log messages are > multi-line. > > So to get a single line message for maps, without the commas, is the only > approach to format the message with something like > io_lib:print(MyBigMap,1,8192,-1) and then log the string? > Yes, or you could specify field with 0 with ~p to indicate infinite line length, e.g. logger:notice("my map: ~0p",[MyMap]) (Using the value 0 here is new from OTP-21, see the description of control sequence 'p' in the ref.man for io:format.) I do, however, see this a bug in logger. It needs to be a bit more sophisticated when ensuring single line - I'm looking into it. Regards /siri -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickard@REDACTED Fri Aug 10 13:14:33 2018 From: rickard@REDACTED (Rickard Green) Date: Fri, 10 Aug 2018 13:14:33 +0200 Subject: [erlang-questions] Patch package OTP 20.3.8.5 released Message-ID: Patch Package: OTP 20.3.8.5 Git Tag: OTP-20.3.8.5 Date: 2018-08-10 Trouble Report Id: OTP-15168, OTP-15194, OTP-15203, OTP-15204, OTP-15221, OTP-15223, OTP-15225, OTP-15226 Seq num: ERIERL-217, ERIERL-221, ERL-673, ERL-679 System: OTP Release: 20 Application: compiler-7.1.5.1, crypto-4.2.2.1, erts-9.3.3.3, mnesia-4.15.3.1, ssl-8.2.6.2 Predecessor: OTP 20.3.8.4 Check out the git tag OTP-20.3.8.5, 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. --------------------------------------------------------------------- --- POTENTIAL INCOMPATIBILITIES ------------------------------------- --------------------------------------------------------------------- OTP-15225 Application(s): erts Fixed a bug causing some Erlang references to be inconsistently ordered. This could for example cause failure to look up certain elements with references as keys in search data structures. This bug was introduced in R13B02. Thanks to Simon Cornish for finding the bug and supplying a fix. --------------------------------------------------------------------- --- compiler-7.1.5.1 ------------------------------------------------ --------------------------------------------------------------------- The compiler-7.1.5.1 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-15204 Application(s): compiler Related Id(s): ERL-679 Fixed an issue where files compiled with the +deterministic option differed if they were compiled in a different directory but were otherwise identical. Full runtime dependencies of compiler-7.1.5.1: crypto-3.6, erts-9.0, hipe-3.12, kernel-4.0, stdlib-2.5 --------------------------------------------------------------------- --- crypto-4.2.2.1 -------------------------------------------------- --------------------------------------------------------------------- The crypto-4.2.2.1 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-15194 Application(s): crypto Related Id(s): ERL-673 Fixed a node crash in crypto:compute_key(ecdh, ...) when passing a wrongly typed Others argument. Full runtime dependencies of crypto-4.2.2.1: erts-9.0, kernel-5.3, stdlib-3.4 --------------------------------------------------------------------- --- erts-9.3.3.3 ---------------------------------------------------- --------------------------------------------------------------------- The erts-9.3.3.3 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-15223 Application(s): erts Fixed a bug which caused an emulator crash when enif_send() was called by a NIF that executed on a dirty scheduler. The bug was either triggered when the NIF called enif_send() without a message environment, or when the process executing the NIF was send traced. OTP-15225 Application(s): erts *** POTENTIAL INCOMPATIBILITY *** Fixed a bug causing some Erlang references to be inconsistently ordered. This could for example cause failure to look up certain elements with references as keys in search data structures. This bug was introduced in R13B02. Thanks to Simon Cornish for finding the bug and supplying a fix. Full runtime dependencies of erts-9.3.3.3: kernel-5.0, sasl-3.0.1, stdlib-3.0 --------------------------------------------------------------------- --- mnesia-4.15.3.1 ------------------------------------------------- --------------------------------------------------------------------- The mnesia-4.15.3.1 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-15221 Application(s): mnesia Related Id(s): ERIERL-217 When master node is set do not force a load from ram_copies replica when there are no available disc_copies, since that would load an empty table. Wait until a disk replica is available or until user explicitly force_loads the table. OTP-15226 Application(s): mnesia Related Id(s): ERIERL-221 Allow to add replicas even if all other replicas are down when the other replicase are not stored on disk. Full runtime dependencies of mnesia-4.15.3.1: erts-9.0, kernel-5.3, stdlib-3.4 --------------------------------------------------------------------- --- ssl-8.2.6.2 ----------------------------------------------------- --------------------------------------------------------------------- Note! The ssl-8.2.6.2 application can *not* be applied independently of other applications on an arbitrary OTP 20 installation. On a full OTP 20 installation, also the following runtime dependencies have to be satisfied: -- crypto-4.2 (first satisfied in OTP 20.2) -- public_key-1.5 (first satisfied in OTP 20.1) --- Fixed Bugs and Malfunctions --- OTP-15168 Application(s): ssl Correct handling of empty server SNI extension OTP-15203 Application(s): ssl Correct cipher suite handling for ECDHE_*, the incorrect handling could cause an incorrrect suite to be selected and most likly fail the handshake. Full runtime dependencies of ssl-8.2.6.2: crypto-4.2, erts-7.0, inets-5.10.7, kernel-3.0, public_key-1.5, stdlib-3.2 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From felixgallo@REDACTED Fri Aug 10 15:51:24 2018 From: felixgallo@REDACTED (Felix Gallo) Date: Fri, 10 Aug 2018 06:51:24 -0700 Subject: [erlang-questions] [ANN] Property-Based Testing with PropEr, Erlang, and Elixir (Beta) In-Reply-To: References: Message-ID: As an aside: another fantastic property testing library I stumbled across is Hypothesis (https://hypothesis.works/). Written in Python, but applicable to other languages as well as an external runner. It's another tool in the toolbox for those of us with polyglot systems, and the principles in Fred's book are broadly applicable with Hypothesis as well. F. On Thu, Aug 9, 2018 at 11:52 PM, Pierre Fenoll wrote: > Amazing! Hopefully this will change the state of testing at large a little! > Just bought it :) > > On Thu 9 Aug 2018 at 22:29, Max Lapshin wrote: > >> Excellent, thanks! >> >> Have just purchased. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -- > > Cheers, > -- > Pierre Fenoll > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.geib.44@REDACTED Fri Aug 10 21:27:29 2018 From: mark.geib.44@REDACTED (Mark Geib) Date: Fri, 10 Aug 2018 13:27:29 -0600 Subject: [erlang-questions] R21 logger mangles map messages In-Reply-To: References: <10D95C90-B138-4387-96A3-B8B6B2B2600D@gmail.com> Message-ID: <7CBF2D7C-8B99-4D89-BA38-157F65231496@gmail.com> So the combination of single_line => true, and the ~0p format field gives me what I want. Thanks. > On Aug 10, 2018, at 3:07 AM, Siri Hansen wrote: > > > > Den tor. 9. aug. 2018 kl. 16:42 skrev Mark Geib >: > Yes that removed the extra commas. Of course now the log messages are multi-line. > > So to get a single line message for maps, without the commas, is the only approach to format the message with something like > io_lib:print(MyBigMap,1,8192,-1) and then log the string? > > Yes, or you could specify field with 0 with ~p to indicate infinite line length, e.g. > > logger:notice("my map: ~0p",[MyMap]) > > (Using the value 0 here is new from OTP-21, see the description of control sequence 'p' in the ref.man for io:format.) > > I do, however, see this a bug in logger. It needs to be a bit more sophisticated when ensuring single line - I'm looking into it. > > Regards > /siri -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 528 bytes Desc: Message signed with OpenPGP URL: From amin.arria@REDACTED Fri Aug 10 16:49:05 2018 From: amin.arria@REDACTED (Amin Arria) Date: Fri, 10 Aug 2018 11:49:05 -0300 Subject: [erlang-questions] Unknown error while using SSL/TLS In-Reply-To: References: Message-ID: Hi, sorry for the delay. I couldn't test the patch directly, but with the new OTP 20.3.8.5 (that has the patch) everything works fine. Thank you Ingela and Leo! On Thu, Aug 9, 2018 at 5:39 AM, Leo Liu wrote: > On 2018-08-09 09:53 +0200, Ingela Andin wrote: > > Hi! > > > > > > I believe the bug could be solved by the following patch: > > Yes, fix the issue here. Amin, can you verify it also fixes the issue > you were seeing? > > Leo > > > > > diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl > > index 40d974f..aa453fe 100644 > > --- a/lib/ssl/src/ssl_cipher.erl > > +++ b/lib/ssl/src/ssl_cipher.erl > > @@ -2555,6 +2555,8 @@ ecdsa_signed_suites(Ciphers, Version) -> > > > > rsa_keyed(dhe_rsa) -> > > true; > > +rsa_keyed(ecdhe_rsa) -> > > + true; > > rsa_keyed(rsa) -> > > true; > > rsa_keyed(rsa_psk) -> > > @@ -2618,6 +2620,8 @@ ec_keyed(ecdh_ecdsa) -> > > true; > > ec_keyed(ecdh_rsa) -> > > true; > > +ec_keyed(ecdhe_ecdsa) -> > > + true; > > ec_keyed(_) -> > > false. > > > > > > Regards Ingela Erlang/OTP Team > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jkrukoff@REDACTED Fri Aug 10 19:44:44 2018 From: jkrukoff@REDACTED (John Krukoff) Date: Fri, 10 Aug 2018 17:44:44 +0000 Subject: [erlang-questions] [ANN] Property-Based Testing with PropEr, Erlang, and Elixir (Beta) In-Reply-To: References: Message-ID: <35d8a96802da4bfe8f47aeacdc776eae@EX2013MBX2.bit9.local> That?s exciting, and I?ll be looking forward to being able to buy a paper copy. A thank you for putting the initial draft online, when I first started with property testing a year ago it was an excellent reference. After reading through it, I had a reasonable property testing suite added to my existing eunit tests in a single day?s worth of work. Made everything very approachable and I can recommend it as an excellent resource. Thanks again, John Krukoff On Behalf Of Fred Hebert Hi everyone, I wanted to announce that today, my new book enters its beta phase with pragmatic programmers. The full title is Property-Based Testing with PropEr, Erlang, and Elixir: find bugs before your users do. You have possibly seen it?s early draft, PropEr Testing, but this copy is a fancier one that has gone through the benefit of full editing. I?ve also added Elixir translations, in case this may be of interest to folks on this mailing list as well. If you?ve always been interested by property based testing but felt ?holy crap this is wizard stuff? I?m happy to say I truly believe this is going to be the easiest way to get into the practice of thinking in properties. Anyway, the full announcement with more information is at https://media.pragprog.com/newsletters/2018-08-08.html Thanks, Fred. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 6290 bytes Desc: not available URL: From rickard@REDACTED Sat Aug 11 15:56:56 2018 From: rickard@REDACTED (Rickard Green) Date: Sat, 11 Aug 2018 15:56:56 +0200 Subject: [erlang-questions] Patch package OTP 19.3.6.10 released Message-ID: <88a117dd-d4a3-4a8b-b9ef-bdbbac5e6089@erlang.org> Patch Package: OTP 19.3.6.10 Git Tag: OTP-19.3.6.10 Date: 2018-08-11 Trouble Report Id: OTP-15098, OTP-15158, OTP-15225 Seq num: ERIERL-177, ERL-654 System: OTP Release: 19 Application: erts-8.3.5.5, syntax_tools-2.1.1.1 Predecessor: OTP 19.3.6.9 Check out the git tag OTP-19.3.6.10, 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. --------------------------------------------------------------------- --- POTENTIAL INCOMPATIBILITIES ------------------------------------- --------------------------------------------------------------------- OTP-15225 Application(s): erts Fixed a bug causing some Erlang references to be inconsistently ordered. This could for example cause failure to look up certain elements with references as keys in search data structures. This bug was introduced in R13B02. Thanks to Simon Cornish for finding the bug and supplying a fix. --------------------------------------------------------------------- --- erts-8.3.5.5 ---------------------------------------------------- --------------------------------------------------------------------- Note! The erts-8.3.5.5 application can *not* be applied independently of other applications on an arbitrary OTP 19 installation. On a full OTP 19 installation, also the following runtime dependency has to be satisfied: -- sasl-3.0.1 (first satisfied in OTP 19.1) --- Fixed Bugs and Malfunctions --- OTP-15158 Application(s): erts Related Id(s): ERL-654 Fixed a race condition in the inet driver that could cause receive to hang when the emulator was compiled with gcc 8. OTP-15225 Application(s): erts *** POTENTIAL INCOMPATIBILITY *** Fixed a bug causing some Erlang references to be inconsistently ordered. This could for example cause failure to look up certain elements with references as keys in search data structures. This bug was introduced in R13B02. Thanks to Simon Cornish for finding the bug and supplying a fix. Full runtime dependencies of erts-8.3.5.5: kernel-5.0, sasl-3.0.1, stdlib-3.0 --------------------------------------------------------------------- --- syntax_tools-2.1.1.1 -------------------------------------------- --------------------------------------------------------------------- The syntax_tools-2.1.1.1 application can be applied independently of other applications on a full OTP 19 installation. --- Fixed Bugs and Malfunctions --- OTP-15098 Application(s): syntax_tools Related Id(s): ERIERL-177 Fix a bug regarding reverting map types. Full runtime dependencies of syntax_tools-2.1.1.1: compiler-7.0, erts-8.0, kernel-5.0, stdlib-3.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From rickard@REDACTED Sat Aug 11 16:13:30 2018 From: rickard@REDACTED (Rickard Green) Date: Sat, 11 Aug 2018 16:13:30 +0200 Subject: [erlang-questions] Patch package OTP 21.0.5 released Message-ID: Patch Package: OTP 21.0.5 Git Tag: OTP-21.0.5 Date: 2018-08-11 Trouble Report Id: OTP-15194, OTP-15204, OTP-15223, OTP-15225 Seq num: ERL-673, ERL-679 System: OTP Release: 21 Application: compiler-7.2.3, crypto-4.3.1, erts-10.0.5 Predecessor: OTP 21.0.4 Check out the git tag OTP-21.0.5, 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. --------------------------------------------------------------------- --- POTENTIAL INCOMPATIBILITIES ------------------------------------- --------------------------------------------------------------------- OTP-15225 Application(s): erts Fixed a bug causing some Erlang references to be inconsistently ordered. This could for example cause failure to look up certain elements with references as keys in search data structures. This bug was introduced in R13B02. Thanks to Simon Cornish for finding the bug and supplying a fix. --------------------------------------------------------------------- --- compiler-7.2.3 -------------------------------------------------- --------------------------------------------------------------------- The compiler-7.2.3 application can be applied independently of other applications on a full OTP 21 installation. --- Fixed Bugs and Malfunctions --- OTP-15204 Application(s): compiler Related Id(s): ERL-679 Fixed an issue where files compiled with the +deterministic option differed if they were compiled in a different directory but were otherwise identical. Full runtime dependencies of compiler-7.2.3: crypto-3.6, erts-9.0, hipe-3.12, kernel-4.0, stdlib-2.5 --------------------------------------------------------------------- --- crypto-4.3.1 ---------------------------------------------------- --------------------------------------------------------------------- The crypto-4.3.1 application can be applied independently of other applications on a full OTP 21 installation. --- Fixed Bugs and Malfunctions --- OTP-15194 Application(s): crypto Related Id(s): ERL-673 Fixed a node crash in crypto:compute_key(ecdh, ...) when passing a wrongly typed Others argument. Full runtime dependencies of crypto-4.3.1: erts-9.0, kernel-5.3, stdlib-3.4 --------------------------------------------------------------------- --- erts-10.0.5 ----------------------------------------------------- --------------------------------------------------------------------- The erts-10.0.5 application can be applied independently of other applications on a full OTP 21 installation. --- Fixed Bugs and Malfunctions --- OTP-15223 Application(s): erts Fixed a bug which caused an emulator crash when enif_send() was called by a NIF that executed on a dirty scheduler. The bug was either triggered when the NIF called enif_send() without a message environment, or when the process executing the NIF was send traced. OTP-15225 Application(s): erts *** POTENTIAL INCOMPATIBILITY *** Fixed a bug causing some Erlang references to be inconsistently ordered. This could for example cause failure to look up certain elements with references as keys in search data structures. This bug was introduced in R13B02. Thanks to Simon Cornish for finding the bug and supplying a fix. Full runtime dependencies of erts-10.0.5: kernel-6.0, sasl-3.0.1, stdlib-3.5 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From jrh53@REDACTED Sat Aug 11 16:55:48 2018 From: jrh53@REDACTED (Joe Harrison) Date: Sat, 11 Aug 2018 15:55:48 +0100 Subject: [erlang-questions] [meta] Messages not reaching the mailing list Message-ID: Hey everyone, tl;dr it appears that the mailing list software is modifying message headers/bodies, leading to broken message signatures, ultimately causing mail providers to outright *reject* some messages from the list. --- Just a note to those that are having problems with their messages getting onto the mailing list. The erlang-questions Mailman configuration seems to be breaking DKIM signatures, which means that messages from the mailing list will be marked as either spam or outright rejected depending on the DMARC policy of the original sender's domain. Assuming this is the case, the mailing list owners need to read: https://wiki.list.org/DEV/DMARC and pick an option, while those sending from domains with strict DMARC policies should temporarily send messages from a different domain. Cheers, Joe From erlangsiri@REDACTED Mon Aug 13 15:55:15 2018 From: erlangsiri@REDACTED (Siri Hansen) Date: Mon, 13 Aug 2018 15:55:15 +0200 Subject: [erlang-questions] R21 logger mangles map messages In-Reply-To: <7CBF2D7C-8B99-4D89-BA38-157F65231496@gmail.com> References: <10D95C90-B138-4387-96A3-B8B6B2B2600D@gmail.com> <7CBF2D7C-8B99-4D89-BA38-157F65231496@gmail.com> Message-ID: Great! I'm currently testing an improved single_line implementation in logger_formatter, which modifies the field width to 0 for all ~p/~P in the format strings before replacing the rest of the newlines by ", " as before. It will be included in OTP-21.1. /siri Den fre. 10. aug. 2018 kl. 21:27 skrev Mark Geib : > So the combination of single_line => true, and the ~0p format field gives > me what I want. > Thanks. > > On Aug 10, 2018, at 3:07 AM, Siri Hansen wrote: > > > > Den tor. 9. aug. 2018 kl. 16:42 skrev Mark Geib : > >> Yes that removed the extra commas. Of course now the log messages are >> multi-line. >> >> So to get a single line message for maps, without the commas, is the only >> approach to format the message with something like >> io_lib:print(MyBigMap,1,8192,-1) and then log the string? >> > > Yes, or you could specify field with 0 with ~p to indicate infinite line > length, e.g. > > logger:notice("my map: ~0p",[MyMap]) > > (Using the value 0 here is new from OTP-21, see the description of control > sequence 'p' in the ref.man for io:format.) > > I do, however, see this a bug in logger. It needs to be a bit more > sophisticated when ensuring single line - I'm looking into it. > > Regards > /siri > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yevhenii.kurtov@REDACTED Mon Aug 13 21:36:21 2018 From: yevhenii.kurtov@REDACTED (Yevhenii Kurtov) Date: Tue, 14 Aug 2018 02:36:21 +0700 Subject: [erlang-questions] Problems with unpacking package Message-ID: Hi everyone, I'm having problem with unpacking release_handler:unpack_release . Looking at https://github.com/erlang/otp/blob/maint-21/lib/sasl/src/release_handler.erl#L850-L854 I understand that it's supposed to copy and `releases/app_name.rel` into `releases//app_name.rel` and then delete the origin file. Somehow it doesn't work in my case: - releases//app_name.rel is already present in an archive - releases//app_name.rel is not there after upgrade - releases/app_name.rel still there Illustration: $ mkdir /srv/apps/flowmail_web/releases/1.4.6+5aead53/ $ mv flowmail_web_1.4.6+5aead53.upgrade.tar.gz /srv/apps/flowmail_web/releases/1.4.6+5aead53/flowmail_web.tar.gz $ ./bin/flowmail_web upgrade 1.4.6+5aead53 Release flowmail_web:1.4.6+5aead53 not found, attempting to unpack releases/1.4.6+5aead53/flowmail_web.tar.gz Unpacked '1.4.6+5aead53' successfully! Release flowmail_web:1.4.6+5aead53 is already unpacked, installing.. Installed release flowmail_web:1.4.6+5aead53 Updating config.. Made release flowmail_web:1.4.6+5aead53 permanent $ ./bin/flowmail_web ping grep: /srv/apps/flowmail_web/releases/1.4.6+5aead53/flowmail_web.rel: No such file or directory grep: /srv/apps/flowmail_web/releases/1.4.6+5aead53/flowmail_web.rel: No such file or directory pong ## but it's present in an archive $ tar -C /tmp/5aead53/ -zxvf releases/1.4.6+5aead53/flowmail_web_1.4.6+5aead53.tar.gz $ [ -f /tmp/5aead53/releases/1.4.6+5aead53/flowmail_web.rel ] && echo "File exist" || echo "File does not exist" File exist $ [ -f releases/flowmail_web.rel ] && echo "File exist" || echo "File does not exist" File exist There are no any special file permissions or anything like that -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.r.nohl@REDACTED Tue Aug 14 10:09:51 2018 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Tue, 14 Aug 2018 10:09:51 +0200 Subject: [erlang-questions] Still memory leak in SSL Message-ID: Hello! I'm facing the same problem as mentioned in https://groups.google.com/d/msg/erlang-programming/xWpKjeG21Ys/mfoOkjzwBgAJ Unfortunately I can't upgrade to Erlang 20 (or later). I did apply the https://github.com/erlang/otp/commit/256e01ce80b3aadd63f303b9bda5722ad313220f patch on the 19.3.6.9 sources, but I still have the problem. I also tried to disable the session reuse (i.e. pass {reuse_sessions, false} to ssl:listen) too, still the ETS memory usage grows in the VM to 8 GB. I need to triple check that indeed the patched version ran, but do you have any idea what else could cause this? Of course, this only happens at outside-organization test and I can't reproduce the leakage locally :-( From eric.pailleau@REDACTED Tue Aug 14 10:22:41 2018 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Tue, 14 Aug 2018 10:22:41 +0200 Subject: [erlang-questions] Problems with unpacking package In-Reply-To: References: Message-ID: <09a5toindftk6p54nn577orh.1534234630092@email.android.com> Hi, Looks like error is raised by grep. + is a special character for grep. Can you look at those grep line? Envoy? depuis mon mobile ---- Yevhenii Kurtov a ?crit ---- >Hi everyone, > >I'm having problem with unpacking release_handler:unpack_release . >Looking at >https://github.com/erlang/otp/blob/maint-21/lib/sasl/src/release_handler.erl#L850-L854 >I understand that it's supposed to copy and `releases/app_name.rel` into >`releases//app_name.rel` and then delete the origin file. > >Somehow it doesn't work in my case: > >- releases//app_name.rel is already present in an archive >- releases//app_name.rel is not there after upgrade >- releases/app_name.rel still there > >Illustration: > >$ mkdir /srv/apps/flowmail_web/releases/1.4.6+5aead53/ >$ mv flowmail_web_1.4.6+5aead53.upgrade.tar.gz >/srv/apps/flowmail_web/releases/1.4.6+5aead53/flowmail_web.tar.gz >$ ./bin/flowmail_web upgrade 1.4.6+5aead53 >Release flowmail_web:1.4.6+5aead53 not found, attempting to unpack >releases/1.4.6+5aead53/flowmail_web.tar.gz >Unpacked '1.4.6+5aead53' successfully! >Release flowmail_web:1.4.6+5aead53 is already unpacked, installing.. >Installed release flowmail_web:1.4.6+5aead53 >Updating config.. >Made release flowmail_web:1.4.6+5aead53 permanent >$ ./bin/flowmail_web ping >grep: /srv/apps/flowmail_web/releases/1.4.6+5aead53/flowmail_web.rel: No >such file or directory >grep: /srv/apps/flowmail_web/releases/1.4.6+5aead53/flowmail_web.rel: No >such file or directory >pong > >## but it's present in an archive > >$ tar -C /tmp/5aead53/ -zxvf >releases/1.4.6+5aead53/flowmail_web_1.4.6+5aead53.tar.gz >$ [ -f /tmp/5aead53/releases/1.4.6+5aead53/flowmail_web.rel ] && echo "File >exist" || echo "File does not exist" >File exist >$ [ -f releases/flowmail_web.rel ] && echo "File exist" || echo "File does >not exist" >File exist > > >There are no any special file permissions or anything like that > >_______________________________________________ >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 Tue Aug 14 11:10:35 2018 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Tue, 14 Aug 2018 11:10:35 +0200 Subject: [erlang-questions] Problems with unpacking package In-Reply-To: <09a5toindftk6p54nn577orh.1534234630092@email.android.com> References: <09a5toindftk6p54nn577orh.1534234630092@email.android.com> Message-ID: Where's that "grep" coming from? You might need to tell it to treat the filename as fixed, i.e. use "grep -F" or "fgrep" instead. On Tue, Aug 14, 2018 at 10:22 AM, Eric Pailleau wrote: > Hi, > > Looks like error is raised by grep. + is a special character for grep. Can > you look at those grep line? > > Envoy? depuis mon mobile > > > ---- Yevhenii Kurtov a ?crit ---- > > > Hi everyone, > > I'm having problem with unpacking release_handler:unpack_release . > Looking at https://github.com/erlang/otp/blob/maint-21/lib/sasl/src/ > release_handler.erl#L850-L854 I understand that it's supposed to copy > and `releases/app_name.rel` into `releases//app_name.rel` and then > delete the origin file. > > Somehow it doesn't work in my case: > > - releases//app_name.rel is already present in an archive > - releases//app_name.rel is not there after upgrade > - releases/app_name.rel still there > > Illustration: > > $ mkdir /srv/apps/flowmail_web/releases/1.4.6+5aead53/ > $ mv flowmail_web_1.4.6+5aead53.upgrade.tar.gz /srv/apps/flowmail_web/ > releases/1.4.6+5aead53/flowmail_web.tar.gz > $ ./bin/flowmail_web upgrade 1.4.6+5aead53 > Release flowmail_web:1.4.6+5aead53 not found, attempting to unpack > releases/1.4.6+5aead53/flowmail_web.tar.gz > Unpacked '1.4.6+5aead53' successfully! > Release flowmail_web:1.4.6+5aead53 is already unpacked, installing.. > Installed release flowmail_web:1.4.6+5aead53 > Updating config.. > Made release flowmail_web:1.4.6+5aead53 permanent > $ ./bin/flowmail_web ping > grep: /srv/apps/flowmail_web/releases/1.4.6+5aead53/flowmail_web.rel: No > such file or directory > grep: /srv/apps/flowmail_web/releases/1.4.6+5aead53/flowmail_web.rel: No > such file or directory > pong > > ## but it's present in an archive > > $ tar -C /tmp/5aead53/ -zxvf releases/1.4.6+5aead53/flowmail_web_1.4.6+ > 5aead53.tar.gz > $ [ -f /tmp/5aead53/releases/1.4.6+5aead53/flowmail_web.rel ] && echo "File > exist" || echo "File does not exist" > File exist > $ [ -f releases/flowmail_web.rel ] && echo "File exist" || echo "File > does not exist" > File exist > > > There are no any special file permissions or anything like that > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.r.nohl@REDACTED Tue Aug 14 14:34:19 2018 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Tue, 14 Aug 2018 14:34:19 +0200 Subject: [erlang-questions] Still memory leak in SSL In-Reply-To: References: Message-ID: Attila Rajmund Nohl ezt ?rta (id?pont: 2018. aug. 14., K, 10:09): > > Hello! > > I'm facing the same problem as mentioned in > https://groups.google.com/d/msg/erlang-programming/xWpKjeG21Ys/mfoOkjzwBgAJ > > Unfortunately I can't upgrade to Erlang 20 (or later). I did apply the > https://github.com/erlang/otp/commit/256e01ce80b3aadd63f303b9bda5722ad313220f > patch on the 19.3.6.9 sources, but I still have the problem. I also > tried to disable the session reuse (i.e. pass {reuse_sessions, false} > to ssl:listen) too, still the ETS memory usage grows in the VM to 8 > GB. I need to triple check that indeed the patched version ran, but do > you have any idea what else could cause this? Of course, this only > happens at outside-organization test and I can't reproduce the leakage > locally :-( Managed to reproduce the problem locally: it looks like the client creates SSL sessions at a faster rate (around 200/sec) then the session_validator removes them (around 150/sec). So the session cache grows about 50 entries/sec. From matwey.kornilov@REDACTED Tue Aug 14 21:55:00 2018 From: matwey.kornilov@REDACTED (Matwey V. Kornilov) Date: Tue, 14 Aug 2018 22:55:00 +0300 Subject: [erlang-questions] Patch package OTP 21.0.5 released In-Reply-To: References: Message-ID: Hello, Could you please opensource the tool which is used to produce this mails from OTP sources? This is because I always need this changes in other format for packaging RPM, so I would like to use your tool sources as a ground true reference. 11.08.2018 17:13, Rickard Green ?????: > Patch Package:?????????? OTP 21.0.5 > Git Tag:???????????????? OTP-21.0.5 > Date:??????????????????? 2018-08-11 > Trouble Report Id:?????? OTP-15194, OTP-15204, OTP-15223, OTP-15225 > Seq num:???????????????? ERL-673, ERL-679 > System:????????????????? OTP > Release:???????????????? 21 > Application:???????????? compiler-7.2.3, crypto-4.3.1, erts-10.0.5 > Predecessor:???????????? OTP 21.0.4 > > ?Check out the git tag OTP-21.0.5, 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. > > ?--------------------------------------------------------------------- > ?--- POTENTIAL INCOMPATIBILITIES ------------------------------------- > ?--------------------------------------------------------------------- > > ? OTP-15225??? Application(s): erts > > ?????????????? Fixed a bug causing some Erlang references to be > ?????????????? inconsistently ordered. This could for example cause > ?????????????? failure to look up certain elements with references as > ?????????????? keys in search data structures. This bug was introduced > ?????????????? in R13B02. > > ?????????????? Thanks to Simon Cornish for finding the bug and > ?????????????? supplying a fix. > > > ?--------------------------------------------------------------------- > ?--- compiler-7.2.3 -------------------------------------------------- > ?--------------------------------------------------------------------- > > ?The compiler-7.2.3 application can be applied independently of other > ?applications on a full OTP 21 installation. > > ?--- Fixed Bugs and Malfunctions --- > > ? OTP-15204??? Application(s): compiler > ?????????????? Related Id(s): ERL-679 > > ?????????????? Fixed an issue where files compiled with the > ?????????????? +deterministic option differed if they were compiled in > ?????????????? a different directory but were otherwise identical. > > > ?Full runtime dependencies of compiler-7.2.3: crypto-3.6, erts-9.0, > ?hipe-3.12, kernel-4.0, stdlib-2.5 > > > ?--------------------------------------------------------------------- > ?--- crypto-4.3.1 ---------------------------------------------------- > ?--------------------------------------------------------------------- > > ?The crypto-4.3.1 application can be applied independently of other > ?applications on a full OTP 21 installation. > > ?--- Fixed Bugs and Malfunctions --- > > ? OTP-15194??? Application(s): crypto > ?????????????? Related Id(s): ERL-673 > > ?????????????? Fixed a node crash in crypto:compute_key(ecdh, ...) > ?????????????? when passing a wrongly typed Others argument. > > > ?Full runtime dependencies of crypto-4.3.1: erts-9.0, kernel-5.3, > ?stdlib-3.4 > > > ?--------------------------------------------------------------------- > ?--- erts-10.0.5 ----------------------------------------------------- > ?--------------------------------------------------------------------- > > ?The erts-10.0.5 application can be applied independently of other > ?applications on a full OTP 21 installation. > > ?--- Fixed Bugs and Malfunctions --- > > ? OTP-15223??? Application(s): erts > > ?????????????? Fixed a bug which caused an emulator crash when > ?????????????? enif_send() was called by a NIF that executed on a > ?????????????? dirty scheduler. The bug was either triggered when the > ?????????????? NIF called enif_send() without a message environment, > ?????????????? or when the process executing the NIF was send traced. > > > ? OTP-15225??? Application(s): erts > > ?????????????? *** POTENTIAL INCOMPATIBILITY *** > > ?????????????? Fixed a bug causing some Erlang references to be > ?????????????? inconsistently ordered. This could for example cause > ?????????????? failure to look up certain elements with references as > ?????????????? keys in search data structures. This bug was introduced > ?????????????? in R13B02. > > ?????????????? Thanks to Simon Cornish for finding the bug and > ?????????????? supplying a fix. > > > ?Full runtime dependencies of erts-10.0.5: kernel-6.0, sasl-3.0.1, > ?stdlib-3.5 > > > ?--------------------------------------------------------------------- > ?--------------------------------------------------------------------- > ?--------------------------------------------------------------------- From jared@REDACTED Wed Aug 15 06:17:40 2018 From: jared@REDACTED (Jared Davison) Date: Wed, 15 Aug 2018 14:17:40 +1000 Subject: [erlang-questions] Ensuring a process is crashed with raise/3 in a Common_Test case Message-ID: Hi, Could you please assist me in using common test. I'm trying to ensure that a gen_statem:call/3 raises a {timeout, _} in a common test case. At first I tried a catch because I thought it would be a throw but it catches nothing. Digging into the gen_statem:call/3 code it appears that it uses erlang:raise/3 which stops the execution of the process, so that makes sense that catch does nothing. I want to be sure that the process was stopped with the a particular reason, and pass the test if it does. Is this possible in Common Test? Thanks Jared -------------- next part -------------- An HTML attachment was scrubbed... URL: From publicityifl@REDACTED Tue Aug 14 09:58:34 2018 From: publicityifl@REDACTED (Jurriaan Hage) Date: Tue, 14 Aug 2018 03:58:34 -0400 Subject: [erlang-questions] First Call for Participation for IFL 2018 (Implementation and Application of Functional Languages) Message-ID: Hello, Please, find below the 1st call for participation for IFL 2018. Please forward these to anyone you think may be interested. Apologies for any duplicates you may receive. best regards, Jurriaan Hage Publicity Chair of IFL --- CALL FOR PARTICIPATION: ================================================================================ IFL 2018 30th Symposium on Implementation and Application of Functional Languages University of Massachusetts Lowell, MA, USA September 5th-7th, 2018 http://iflconference.org September 5th: Haskell Mini-Course by Galois, Inc, see details below. ================================================================================ ### Scope The goal of the IFL symposia is to bring together researchers actively engaged in the implementation and application of functional and function-based programming languages. IFL 2018 will be a venue for researchers to present and discuss new ideas and concepts, work in progress, and publication-ripe results related to the implementation and application of functional languages and function-based programming. ### Keynote Speakers * Adam Chlipala, Massachusetts Institute of Technology CSAIL * Arjun Guha, University of Massachusetts Amherst ### Haskell Mini-Course (September 5th, 2018) Mini-course on Haskell by Galois, Inc, presented by David Thrane Christiansen and Jose Manuel Calderon Trilla. Register: Attendance at the course is free, but you must RSVP. (Link to RSVP form can be found at http://iflconference.org) Course Description: Recent versions of the GHC compiler for Haskell feature support for a number of advanced type system features, including pattern-matching functions in the type system (type families), indexed families (generalized algebraic datatypes, or GADTs), type-level data structures (data kinds), and general compile-time metaprogramming (Template Haskell). At Galois, we use these features in a number of our projects, which allows us to build deep embeddings of programming languages and have GHC enforce the target language's type system for us. This style of programming ensures that we only produce well-typed terms, including that we do not forget any of the run-time checks that are necessary to preserve our invariants when accepting input from untyped sources such as files. In the course of developing these projects, some common problems and programming patterns emerged. We developed the `parameterized-utils` library to codify solutions to these problems, and provide necessary generalizations of interfaces from the standard library (Eq, Applicative, Traversable, etc.) We will expect that participants in the course have used Haskell before, but we will not expect everyone to be experts. We will introduce GADTs, type families, and data kinds, and then show how to use them together with the tools from parameterized-utils with an implementation of the simply-typed lambda calculus, including basic AST definitions, evaluation, and parsing. ### Peter Landin Prize The Peter Landin Prize is awarded to the best paper presented at the symposium every year. The honored article is selected by the program committee based on the submissions received for the formal review process. The prize carries a cash award equivalent to 150 Euros. ### Organization and Program committee Chairs: Jay McCarthy & Matteo Cimini, University of Massachusetts Lowell, USA Program Committee: * Arthur Chargueraud, Inria, FR * Ben Delaware, Purdue University, USA * Christos Dimoulas, Northwestern University, USA * David Darais, University of Vermont, USA * Dominic Orchard, University of Kent, UK * Ekaterina Komendantskaya, Heriot-Watt University, UK * Garrett Morris, University of Kansas, USA * Heather Miller, EPFL & Northeastern University, CH & USA * Jeremy Yallop, University of Cambridge, UK * Keiko Nakata, SAP Innovation Center Potsdam, DE * Laura Castro, University of A Coruna, ESP * Magnus Myreen, Chalmers University of Technology, SWE * Natalia Chechina, Bournemouth University, UK * Peter Achten, Radboud Universiteit Nijmegen, NL * Peter-Michael Osera, Grinnell College, USA * Richard Eisenberg, Bryn Mawr College, USA * Trevor McDonell, University of New South Wales, AUS * Yukiyoshi Kameyama, University of Tsukuba, JAP ### Venue The 30th IFL is organized by the University of Massachusetts Lowell. The City of Lowell is located at the heart of the Merrimack Valley just 30 miles northwest of Boston. Lowell can be easily reached by train or taxi. See the website for more information on the venue. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Ingela.Anderton.Andin@REDACTED Wed Aug 15 11:34:20 2018 From: Ingela.Anderton.Andin@REDACTED (Ingela Anderton Andin) Date: Wed, 15 Aug 2018 11:34:20 +0200 Subject: [erlang-questions] Patch package OTP 20.3.8.6 released Message-ID: <20180815093420.GA99164@duper.otp.ericsson.se> Patch Package: OTP 20.3.8.6 Git Tag: OTP-20.3.8.6 Date: 2018-08-15 Trouble Report Id: OTP-15215 Seq num: System: OTP Release: 20 Application: inets-6.5.2.3 Predecessor: OTP 20.3.8.5 Check out the git tag OTP-20.3.8.6, 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.5.2.3 --------------------------------------------------- --------------------------------------------------------------------- The inets-6.5.2.3 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-15215 Application(s): inets Change status code for no mod found to handle request to 501 Full runtime dependencies of inets-6.5.2.3: erts-6.0, kernel-3.0, mnesia-4.12, runtime_tools-1.8.14, ssl-5.3.4, stdlib-2.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From ebegumisa@REDACTED Wed Aug 15 14:40:36 2018 From: ebegumisa@REDACTED (Edmond Begumisa) Date: Wed, 15 Aug 2018 22:40:36 +1000 Subject: [erlang-questions] Ensuring a process is crashed with raise/3 in a Common_Test case In-Reply-To: References: Message-ID: On Wed, 15 Aug 2018 14:17:40 +1000, Jared Davison wrote: > Hi, > > Could you please assist me in using common test. > > I'm trying to ensure that a gen_statem:call/3 raises a {timeout, _} in a > common test case. > > At first I tried a catch because I thought it would be a throw but it > catches nothing. Sounds like you're catching the wrong exception class. For gen_* timeouts, I believe the exception class is 'exit' rather than 'throw'. > Digging into the gen_statem:call/3 code it appears that it uses > erlang:raise/3 which stops the >execution of the process, so that makes > sense that catch does nothing. Catch should do something if you're catching the right exception class ('exit') or matching any exception class ('_'). It is still possible to catch exceptions generated using erlang:raise/3 for any class ('error'|'throw'|'exit'). E.g from an erlang shell ... $ try erlang:raise(exit, foo, []) catch exit:foo -> yep end. ... returns 'yep'. As do... $ try erlang:raise(throw, foo, []) catch throw:foo -> yep end. $ try erlang:raise(error, foo, []) catch error:foo -> yep end. ... so do... $ try exit(foo) catch exit:foo -> yep end. $ try throw(foo) catch throw:foo -> yep end. $ try error(foo) catch error:foo -> yep end. ... and also ... $ try erlang:raise(exit, foo, []) catch _:foo -> yep end. $ try erlang:raise(error, foo, []) catch _:foo -> yep end. $ try erlang:raise(throw, foo, []) catch _:foo -> yep end. $ try exit(foo) catch _:foo -> yep end. $ try throw(foo) catch _:foo -> yep end. $ try error(foo) catch _:foo -> yep end. > I want to be sure that the process was stopped with the a particular > reason, and pass the test if >it does. > Is this possible in Common Test? Should be. My guess is that your test case is catching something like so... try gen_statem:call(foo, bar, 5000) catch throw:{timeout,_} -> .. end. Try changing that to... try gen_statem:call(foo, bar, 5000) catch exit:{timeout,_} -> .. end. - Edmond - > > Thanks > > Jared > > > -- Using Opera's mail client: http://www.opera.com/mail/ From raimo+erlang-questions@REDACTED Wed Aug 15 14:48:19 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 15 Aug 2018 14:48:19 +0200 Subject: [erlang-questions] Requirements for seed integers in the rand module In-Reply-To: <87a7pyqv3b.fsf@gmail.com> References: <87a7pyqv3b.fsf@gmail.com> Message-ID: <20180815124819.GA93646@erix.ericsson.se> On Tue, Aug 07, 2018 at 01:23:04PM +0200, Krzysztof Jurewicz wrote: > The seed/2 and seed_s/2 functions in the rand module take a 3-element tuple of integers as a seed, however it doesn?t document what are the requirements for those integers (how they need to be distributed). If seed is omitted (the seed/1 and seed_s/1 functions), then the following (undocumented) value is used: > > {erlang:phash2([{node(),self()}]), > erlang:system_time(), > erlang:unique_integer()} > > I have 64 bytes of entropy which I want to use as a seed. Is it ok to do it in the way below? > > {binary:decode_unsigned(Entropy), 0, 0} The different algorithms use the 3-tuple seed in slightly different ways, but in general it they expect the entropy to be spread over all integers. The default algorithm (exrop) and the previous default (exsp) has a slightly imperfect way to try to aviod zero seed that works if the supplied integers have 26 bits or less. The exs64 algorithm uses the 32 lowest bits of each integer. The exs1024s algorithm uses the 21 lowest bits of each integer. So I would say the most generic way to use a 64 bit binary as entropy source for the current algorithms would be: <> = Entropy, Seed = {A, B, C}, In my pull request https://github.com/erlang/otp/pull/1857 I have added two new seed formats. One that takes a 64-bit integer seed that is fed through a SplitMix64 generator to seed all state words, and one that takes a list of state words directly and just checks that not all are zero. This can give better control over the seeding but will not appear until OTP-22.0... -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Wed Aug 15 14:59:38 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 15 Aug 2018 14:59:38 +0200 Subject: [erlang-questions] Gracefully Exit from state_timeout gen statem In-Reply-To: <1d4167e3-ea88-4b0c-ae69-a4fd27d98cc2@Spark> References: <1d4167e3-ea88-4b0c-ae69-a4fd27d98cc2@Spark> Message-ID: <20180815125938.GB93646@erix.ericsson.se> On Tue, Aug 07, 2018 at 03:05:08PM -0400, Code Wiget wrote: > Would like to update this to say that I?m using {state_timeout, 2000, timeout}, rather than {state_timeout, 2000} > > On Aug 7, 2018, 2:29 PM -0400, Code Wiget , wrote: > > Hi everyone, > > > > How do you gracefully exit from a state_timeout in a gen_statem? Generally, for a gen_statem, I can return ?stop? or {stop, Reason} from a state function and the statem will terminate. However, if I use a state timeout method, returned from init: > > > > > {ok, new_state, State, {state_timeout, 2000}} > > > > The new_state(state_timeout, Info, State) method is called after 2000. Returning ?stop? from this given an error?: > > > > > 18:22:33.039 [error] <0.576.0> : ?Lager event handler error_logger_lager_h exited with reason {'EXIT',{{badmatch,[smdpp_proxy,{state_timeout,timeout},[{data,[{"State",{awaiting_ Can you post the whole printout? The truncation hides where the process has crashed. > > > > > What can I return from this function to gracefully exit? Can this be done with state_timeout? If this is an obvious question, please point me in the right direction. The documentation here:http://erlang.org/doc/man/gen_statem.html?doesn?t seem to mention any return from the state_timeout. > > > > Thanks! > > > > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Wed Aug 15 15:01:30 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 15 Aug 2018 15:01:30 +0200 Subject: [erlang-questions] Gracefully Exit from state_timeout gen statem In-Reply-To: <1d4167e3-ea88-4b0c-ae69-a4fd27d98cc2@Spark> References: <1d4167e3-ea88-4b0c-ae69-a4fd27d98cc2@Spark> Message-ID: <20180815130130.GC93646@erix.ericsson.se> On Tue, Aug 07, 2018 at 03:05:08PM -0400, Code Wiget wrote: > Would like to update this to say that I?m using {state_timeout, 2000, timeout}, rather than {state_timeout, 2000} > > On Aug 7, 2018, 2:29 PM -0400, Code Wiget , wrote: > > Hi everyone, > > > > How do you gracefully exit from a state_timeout in a gen_statem? Generally, for a gen_statem, I can return ?stop? or {stop, Reason} from a state function and the statem will terminate. However, if I use a state timeout method, returned from init: > > > > > {ok, new_state, State, {state_timeout, 2000}} > > > > The new_state(state_timeout, Info, State) method is called after 2000. Returning ?stop? from this given an error?: > > > > > 18:22:33.039 [error] <0.576.0> : ?Lager event handler error_logger_lager_h exited with reason {'EXIT',{{badmatch,[smdpp_proxy,{state_timeout,timeout},[{data,[{"State",{awaiting_ > > > > > What can I return from this function to gracefully exit? Can this be done with state_timeout? If this is an obvious question, please point me in the right direction. The documentation here:http://erlang.org/doc/man/gen_statem.html?doesn?t seem to mention any return from the state_timeout. > > > > Thanks! > > > > Which Erlang/OTP version is this? -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Wed Aug 15 15:12:20 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 15 Aug 2018 15:12:20 +0200 Subject: [erlang-questions] RNG algorithm choice for uniform natural numbers In-Reply-To: <877ekzr7oo.fsf@gmail.com> References: <87h8kdklkq.fsf@gmail.com> <20180802161024.GA85691@erix.ericsson.se> <87effel7ih.fsf@gmail.com> <877ekzr7oo.fsf@gmail.com> Message-ID: <20180815131220.GD93646@erix.ericsson.se> On Thu, Aug 09, 2018 at 03:27:51PM +0200, Krzysztof Jurewicz wrote: > > What I actually want to implement is a randomized apportionment scheme, as described on https://rangevoting.org/Apportion.html (?Truly unbiased methods?), but more efficient, like in the code below (not tested). > > Tests revealed that the simple algorithm does not satisfy the quota property. Therefore I?ve used a more sophisticated one (code below), which however doesn?t require using a specific interval for drawing integers. Instead of the rand module, I use SHA-256 to generate random integers (taking first n bits). This is very interoperable between languages, though I don?t know whether SHA-256 satisfies all RNG properties desirable in that context. (Also I don?t have a proof that the distribution of apportioned seats is unbiased). > > -type score() :: ({Votes :: non_neg_integer(), Id :: any()}). > -type result() :: {Id :: any(), Seats :: non_neg_integer()}. > > -spec apportion(list(score()), pos_integer(), pos_integer(), binary()) -> list(result()). > apportion(Scores, TotalSeats, VotesSum, State) -> > {WholeSeatsMap, RemainderScores, RemainingSeats, _} = > lists:foldl( > fun ( > {Votes, Id}, > {WholeSeatsAcc, > RemainderScoresAcc, > RemSeatsAcc, > StateAcc}) -> > Seats = Votes * TotalSeats div VotesSum, > <> = NewState = crypto:hash(sha256, StateAcc), Have you tried to change line above to RandInt = rand:uniform(1 bsl 32), and not add 1 to RandInt below? To see if the problem you had was about the random number generator or in the surrounding code... > RemainderScore = (Votes * TotalSeats rem VotesSum) * (RandInt + 1), > {maps:put(Id, Seats, WholeSeatsAcc), > [{RemainderScore, Id}|RemainderScoresAcc], > RemSeatsAcc - Seats, > NewState} > end, > {#{}, > [], > TotalSeats, > State}, > Scores), > DrawnIds = > %% We actually need to sort the list only at first RemainderSeats places, so here is a room for optimization. > [Id || {_, Id} <- lists:sublist(lists:reverse(lists:sort(RemainderScores)), RemainingSeats)], > ResultMap = > lists:foldl( > fun (Id, ResultMapAcc) -> > maps:update_with( > Id, > fun (OldSeats) -> OldSeats + 1 end, > 1, > ResultMapAcc) > end, > WholeSeatsMap, > DrawnIds), > lists:sort([{Id, Seats} || {Id, Seats} <- maps:to_list(ResultMap), Seats > 0]). -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Wed Aug 15 15:22:12 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 15 Aug 2018 15:22:12 +0200 Subject: [erlang-questions] [meta] Messages not reaching the mailing list In-Reply-To: References: Message-ID: <20180815132212.GE93646@erix.ericsson.se> On Sat, Aug 11, 2018 at 03:55:48PM +0100, Joe Harrison wrote: > Hey everyone, > > tl;dr it appears that the mailing list software is modifying message > headers/bodies, leading to broken message signatures, ultimately causing This is default mailing list behaviour since the dawn of the Internet. > mail providers to outright *reject* some messages from the list. This is a new behaviour caused by the DMARC project completely ignoring mailing lists when they created their new nifty feature. > > --- > > Just a note to those that are having problems with their messages > getting onto the mailing list. > > The erlang-questions Mailman configuration seems to be breaking DKIM > signatures, which means that messages from the mailing list will be > marked as either spam or outright rejected depending on the DMARC policy > of the original sender's domain. > > Assuming this is the case, the mailing list owners need to read: > > https://wiki.list.org/DEV/DMARC > > and pick an option, while those sending from domains with strict DMARC Unfortunately it is not enough to _read_ that document. ;-) In this case "pick an option" constitutes of upgrading the mail server machine OS, installing a newer Mailman that has got these options to pick, configuring a new web server to handle the mailing list archives, configuring a new mail server for the new Mailan, and re-implementing the mail list archive address obscurification via .png pictures that Mailman still has not implemented. And then "pick an option". While maintaining the real business... Hopefully this will happen within a month or so. > policies should temporarily send messages from a different domain. > > Cheers, > Joe > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From k.petrauskas@REDACTED Wed Aug 15 16:49:14 2018 From: k.petrauskas@REDACTED (Karolis Petrauskas) Date: Wed, 15 Aug 2018 17:49:14 +0300 Subject: [erlang-questions] Mnesia secondary index: a memory leak or lasy cleanup? Message-ID: Hello, I have strange trend in memory consumption on some servers. The ETS memory constantly increases. The tables that are increasing are mnesia_index tables. It looks like these tables are not cleaned-up after the corresponding records are deleted from the indexed table. Maybe the index is cleaned up later? I was waiting for a month, the mnesia_index table has grown to 1GB approximately. To reproduce the situation I made a simple test case. The code of the tst module is shown at the end of this email. First I create a bag table and add some (1000) records to it: 4> tst:create_table(). ok 10> tst:data_add(). ok 12> ets:i(). id name type size mem owner ---------------------------------------------------------------------------- ... 45084 mnesia_index ordered_set 1000 10088 mnesia_monitor ... t t bag 1000 9298 mnesia_monitor ok The table and the index has same number of records (the data for the primary and the secondary indexes are unique in this case). Then I delete the records: 14> tst:data_del(). ok 16> ets:i(). id name type size mem owner ---------------------------------------------------------------------------- ... 45084 mnesia_index ordered_set 1000 10088 mnesia_monitor ... t t bag 0 298 mnesia_monitor ok Here the table has 0 records (as expected), and the index still has 1000 records. The code of the tst module: -module(tst). -export([create_table/0, data_add/0, data_del/0]). -record(t, {a, b, c}). create_table() -> {atomic, ok} = mnesia:create_table(t, [{type, bag}, {attributes, record_info(fields, t)}]), {atomic, ok} = mnesia:add_table_index(t, b), ok. data_add() -> mnesia:activity(transaction, fun () -> lists:foreach(fun (Key) -> mnesia:write(#t{a = Key, b = Key}) end, lists:seq(1, 1000)) end). data_del() -> mnesia:activity(transaction, fun () -> lists:foreach(fun (Key) -> [R] = mnesia:match_object(#t{a = Key, _ = '_'}), mnesia:delete_object(R) end, lists:seq(1, 1000)) end). Karolis Petrauskas From k.petrauskas@REDACTED Wed Aug 15 20:37:47 2018 From: k.petrauskas@REDACTED (Karolis Petrauskas) Date: Wed, 15 Aug 2018 21:37:47 +0300 Subject: [erlang-questions] Mnesia secondary index: a memory leak or lasy cleanup? In-Reply-To: References: Message-ID: Forgot to mention the versions. This case is reproducible with "Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]". The same behaviour is observed on Erlang/OTP 19. Karolis Petrauskas On Wed, Aug 15, 2018 at 5:49 PM Karolis Petrauskas wrote: > > Hello, > > I have strange trend in memory consumption on some servers. The ETS > memory constantly increases. The tables that are increasing are > mnesia_index tables. It looks like these tables are not cleaned-up > after the corresponding records are deleted from the indexed table. > Maybe the index is cleaned up later? I was waiting for a month, the > mnesia_index table has grown to 1GB approximately. > > To reproduce the situation I made a simple test case. The code of the > tst module is shown at the end of this email. > > First I create a bag table and add some (1000) records to it: > > 4> tst:create_table(). > ok > 10> tst:data_add(). > ok > 12> ets:i(). > id name type size mem owner > ---------------------------------------------------------------------------- > ... > 45084 mnesia_index ordered_set 1000 10088 > mnesia_monitor > ... > t t bag 1000 9298 mnesia_monitor > ok > > The table and the index has same number of records (the data for the > primary and the secondary indexes are unique in this case). > Then I delete the records: > > 14> tst:data_del(). > ok > 16> ets:i(). > id name type size mem owner > ---------------------------------------------------------------------------- > ... > 45084 mnesia_index ordered_set 1000 10088 > mnesia_monitor > ... > t t bag 0 298 mnesia_monitor > ok > > Here the table has 0 records (as expected), and the index still has > 1000 records. > > The code of the tst module: > > -module(tst). > -export([create_table/0, data_add/0, data_del/0]). > -record(t, {a, b, c}). > > create_table() -> > {atomic, ok} = mnesia:create_table(t, [{type, bag}, > {attributes, record_info(fields, t)}]), > {atomic, ok} = mnesia:add_table_index(t, b), > ok. > > data_add() -> > mnesia:activity(transaction, fun () -> > lists:foreach(fun (Key) -> > mnesia:write(#t{a = Key, b = Key}) > end, lists:seq(1, 1000)) > end). > > data_del() -> > mnesia:activity(transaction, fun () -> > lists:foreach(fun (Key) -> > [R] = mnesia:match_object(#t{a = Key, _ = '_'}), > mnesia:delete_object(R) > end, lists:seq(1, 1000)) > end). > > > Karolis Petrauskas From codewiget95@REDACTED Wed Aug 15 22:31:21 2018 From: codewiget95@REDACTED (Code Wiget) Date: Wed, 15 Aug 2018 16:31:21 -0400 Subject: [erlang-questions] Gracefully Exit from state_timeout gen statem In-Reply-To: <20180815125938.GB93646@erix.ericsson.se> References: <1d4167e3-ea88-4b0c-ae69-a4fd27d98cc2@Spark> <20180815125938.GB93646@erix.ericsson.se> Message-ID: <8c217b6a-0e30-4eb4-a5b7-cee29eca0601@Spark> Thanks for the reply. I?m having an issue getting the full report because lager is truncating it. Will the stack trace help? Stacktrace: [{gen_statem,parse_event_result,8,[{file,"gen_statem.erl"},{line,1267}]},{gen_statem,loop_event,6,[{file,"gen_statem.erl"},{line,1015}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}] But the process is exiting on this line: > handle_event(state_timeout, _Msg, StateName, State) -> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??LOG(warning, "STATE TIMEOUT(State:~p)", [StateName], State), > {stop, timeout}; ? ?<- This line On Aug 15, 2018, 9:45 AM -0400, Raimo Niskanen , wrote: > On Tue, Aug 07, 2018 at 03:05:08PM -0400, Code Wiget wrote: > > Would like to update this to say that I?m using {state_timeout, 2000, timeout}, rather than {state_timeout, 2000} > > > > On Aug 7, 2018, 2:29 PM -0400, Code Wiget , wrote: > > > Hi everyone, > > > > > > How do you gracefully exit from a state_timeout in a gen_statem? Generally, for a gen_statem, I can return ?stop? or {stop, Reason} from a state function and the statem will terminate. However, if I use a state timeout method, returned from init: > > > > > > > {ok, new_state, State, {state_timeout, 2000}} > > > > > > The new_state(state_timeout, Info, State) method is called after 2000. Returning ?stop? from this given an error?: > > > > > > > 18:22:33.039 [error] <0.576.0> : ?Lager event handler error_logger_lager_h exited with reason {'EXIT',{{badmatch,[smdpp_proxy,{state_timeout,timeout},[{data,[{"State",{awaiting_ > > Can you post the whole printout? > The truncation hides where the process has crashed. > > > > > > > > What can I return from this function to gracefully exit? Can this be done with state_timeout? If this is an obvious question, please point me in the right direction. The documentation here:http://erlang.org/doc/man/gen_statem.html?doesn?t seem to mention any return from the state_timeout. > > > > > > Thanks! > > > > > > > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From jared@REDACTED Thu Aug 16 02:31:48 2018 From: jared@REDACTED (Jared Davison) Date: Thu, 16 Aug 2018 10:31:48 +1000 Subject: [erlang-questions] Ensuring a process is crashed with raise/3 in a Common_Test case In-Reply-To: References: Message-ID: Hi Edmond, Thanks for your reply, it was very helpful. I had something like: ?assertMatch({timeout,_}, try gen_statem:call(foo, bar, 5000), timeout_was_not_thrown catch A -> A end). Adding the exit class as you have suggested in the catch pattern match seems to do the trick: ?assertMatch({timeout,_}, try gen_statem:call(foo, bar, 5000), timeout_was_not_thrown catch exit:A -> A end). Thanks again. Jared On Wed, Aug 15, 2018 at 10:40 PM, Edmond Begumisa < ebegumisa@REDACTED> wrote: > On Wed, 15 Aug 2018 14:17:40 +1000, Jared Davison < > jared@REDACTED> wrote: > > Hi, >> >> Could you please assist me in using common test. >> >> I'm trying to ensure that a gen_statem:call/3 raises a {timeout, _} in a >> common test case. >> >> At first I tried a catch because I thought it would be a throw but it >> catches nothing. >> > > Sounds like you're catching the wrong exception class. For gen_* timeouts, > I believe the exception class is 'exit' rather than 'throw'. > > > Digging into the gen_statem:call/3 code it appears that it uses >> erlang:raise/3 which stops the >execution of the process, so that makes >> sense that catch does nothing. >> > > Catch should do something if you're catching the right exception class > ('exit') or matching any exception class ('_'). It is still possible to > catch exceptions generated using erlang:raise/3 for any class > ('error'|'throw'|'exit'). E.g from an erlang shell ... > > $ try erlang:raise(exit, foo, []) catch exit:foo -> yep end. > > ... returns 'yep'. As do... > > $ try erlang:raise(throw, foo, []) catch throw:foo -> yep end. > $ try erlang:raise(error, foo, []) catch error:foo -> yep end. > > ... so do... > > $ try exit(foo) catch exit:foo -> yep end. > $ try throw(foo) catch throw:foo -> yep end. > $ try error(foo) catch error:foo -> yep end. > > ... and also ... > > $ try erlang:raise(exit, foo, []) catch _:foo -> yep end. > $ try erlang:raise(error, foo, []) catch _:foo -> yep end. > $ try erlang:raise(throw, foo, []) catch _:foo -> yep end. > $ try exit(foo) catch _:foo -> yep end. > $ try throw(foo) catch _:foo -> yep end. > $ try error(foo) catch _:foo -> yep end. > > I want to be sure that the process was stopped with the a particular >> reason, and pass the test if >it does. >> Is this possible in Common Test? >> > > Should be. My guess is that your test case is catching something like so... > > > > try gen_statem:call(foo, bar, 5000) > catch throw:{timeout,_} -> .. > end. > > > > Try changing that to... > > > > try gen_statem:call(foo, bar, 5000) > catch exit:{timeout,_} -> .. > end. > > > > - Edmond - > > >> Thanks >> >> Jared >> >> >> >> > > > -- > Using Opera's mail client: http://www.opera.com/mail/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jrh53@REDACTED Wed Aug 15 16:17:51 2018 From: jrh53@REDACTED (Joe Harrison) Date: Wed, 15 Aug 2018 15:17:51 +0100 Subject: [erlang-questions] [meta] Messages not reaching the mailing list In-Reply-To: <20180815132212.GE93646@erix.ericsson.se> References: <20180815132212.GE93646@erix.ericsson.se> Message-ID: <0016f968-bd32-7863-fae0-c8c5a44d147b@kent.ac.uk> On 15/08/18 14:22, Raimo Niskanen wrote: > On Sat, Aug 11, 2018 at 03:55:48PM +0100, Joe Harrison wrote: >> Hey everyone, >> >> tl;dr it appears that the mailing list software is modifying message >> headers/bodies, leading to broken message signatures, ultimately causing > > This is default mailing list behaviour since the dawn of the Internet. > >> mail providers to outright *reject* some messages from the list. > > This is a new behaviour caused by the DMARC project completely ignoring > mailing lists when they created their new nifty feature Yes, it's an unfortunate breakage, but it's also a modern spam mitigation technique, and it's slowly gaining steam amongst the bigger free providers (there were rumours of gmail setting "p=reject" in 2017). > >> >> --- >> >> Just a note to those that are having problems with their messages >> getting onto the mailing list. >> >> The erlang-questions Mailman configuration seems to be breaking DKIM >> signatures, which means that messages from the mailing list will be >> marked as either spam or outright rejected depending on the DMARC policy >> of the original sender's domain. >> >> Assuming this is the case, the mailing list owners need to read: >> >> https://wiki.list.org/DEV/DMARC >> >> and pick an option, while those sending from domains with strict DMARC > > Unfortunately it is not enough to _read_ that document. ;-) > > In this case "pick an option" constitutes of upgrading the mail server > machine OS, installing a newer Mailman that has got these options to pick, > configuring a new web server to handle the mailing list archives, > configuring a new mail server for the new Mailan, and re-implementing > the mail list archive address obscurification via .png pictures that > Mailman still has not implemented. And then "pick an option". I feel your pain. I sympathise with mailing list managers - I've had the displeasure of running Mailman once myself. As an aside, it looks like Mailman 3 has switched from pipermail to hyperkitty, which might provide the obfuscation/hiding of email addresses that you're looking for. > > While maintaining the real business... > > Hopefully this will happen within a month or so. Thank you for your time. I realise this is not a high priority thing :) > > >> policies should temporarily send messages from a different domain. >> >> Cheers, >> Joe >> > From raimo+erlang-questions@REDACTED Thu Aug 16 10:07:54 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 16 Aug 2018 10:07:54 +0200 Subject: [erlang-questions] [meta] Messages not reaching the mailing list In-Reply-To: <0016f968-bd32-7863-fae0-c8c5a44d147b@kent.ac.uk> References: <20180815132212.GE93646@erix.ericsson.se> <0016f968-bd32-7863-fae0-c8c5a44d147b@kent.ac.uk> Message-ID: <20180816080754.GA84894@erix.ericsson.se> On Wed, Aug 15, 2018 at 03:17:51PM +0100, Joe Harrison wrote: > > > On 15/08/18 14:22, Raimo Niskanen wrote: > > On Sat, Aug 11, 2018 at 03:55:48PM +0100, Joe Harrison wrote: > >> Hey everyone, > >> > >> tl;dr it appears that the mailing list software is modifying message > >> headers/bodies, leading to broken message signatures, ultimately causing > > > > This is default mailing list behaviour since the dawn of the Internet. > > > >> mail providers to outright *reject* some messages from the list. > > > > This is a new behaviour caused by the DMARC project completely ignoring > > mailing lists when they created their new nifty feature > > Yes, it's an unfortunate breakage, but it's also a modern spam > mitigation technique, and it's slowly gaining steam amongst the bigger > free providers (there were rumours of gmail setting "p=reject" in 2017). I know, I am just whining... It seems Ericsson is also about to enforce DMARC, probably through p=reject, so I have Ericsson Security breathing down my neck. > : : > > As an aside, it looks like Mailman 3 has switched from pipermail to > hyperkitty, which might provide the obfuscation/hiding of email > addresses that you're looking for. Thank you - I will have a look at that. Last time I looked it seemed that Mailman 3 was not quite ready for prime time. > > > > > While maintaining the real business... > > > > Hopefully this will happen within a month or so. > > Thank you for your time. I realise this is not a high priority thing :) More like "hard to prioritize", albeit important... ;-( > > > > > > >> policies should temporarily send messages from a different domain. > >> > >> Cheers, > >> Joe > >> > > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Thu Aug 16 10:37:22 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 16 Aug 2018 10:37:22 +0200 Subject: [erlang-questions] Gracefully Exit from state_timeout gen statem In-Reply-To: <8c217b6a-0e30-4eb4-a5b7-cee29eca0601@Spark> References: <1d4167e3-ea88-4b0c-ae69-a4fd27d98cc2@Spark> <20180815125938.GB93646@erix.ericsson.se> <8c217b6a-0e30-4eb4-a5b7-cee29eca0601@Spark> Message-ID: <20180816083722.GB84894@erix.ericsson.se> On Wed, Aug 15, 2018 at 04:31:21PM -0400, Code Wiget wrote: > Thanks for the reply. I?m having an issue getting the full report because lager is truncating it. Will the stack trace help? > > Stacktrace: [{gen_statem,parse_event_result,8,[{file,"gen_statem.erl"},{line,1267}]},{gen_statem,loop_event,6,[{file,"gen_statem.erl"},{line,1015}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}] > > But the process is exiting on this line: > > handle_event(state_timeout, _Msg, StateName, State) -> > > ?LOG(warning, "STATE TIMEOUT(State:~p)", [StateName], State), > > {stop, timeout}; ? ?<- This line This is consistent with e.g OTP-20.0 and returning {stop, timeout} from the event handler. The process should terminate with exception class 'exit', reason 'timeout' and that stacktrace. Before terminating it should print the termination reason through error_logger:format/2, and I guess that is where Lager gets involved. The term [smdpp_proxy,{state_timeout,timeout}, [{data,[{"State",{awaiting_ that is involved in the 'badmatch' exception is argument 2 to error_logger:format/2 (the name of the gen_statem server is smdpp_proxy, right?). The first argument is a format string. So it seems Lager's event handler error_logger_lager_h exits with a 'badmatch' involving the term that is the arguments to the format string. Smells like an internal Lager error to me. Maybe. Probably... / Raimo > > > On Aug 15, 2018, 9:45 AM -0400, Raimo Niskanen , wrote: > > On Tue, Aug 07, 2018 at 03:05:08PM -0400, Code Wiget wrote: > > > Would like to update this to say that I?m using {state_timeout, 2000, timeout}, rather than {state_timeout, 2000} > > > > > > On Aug 7, 2018, 2:29 PM -0400, Code Wiget , wrote: > > > > Hi everyone, > > > > > > > > How do you gracefully exit from a state_timeout in a gen_statem? Generally, for a gen_statem, I can return ?stop? or {stop, Reason} from a state function and the statem will terminate. However, if I use a state timeout method, returned from init: > > > > > > > > > {ok, new_state, State, {state_timeout, 2000}} > > > > > > > > The new_state(state_timeout, Info, State) method is called after 2000. Returning ?stop? from this given an error?: > > > > > > > > > 18:22:33.039 [error] <0.576.0> : ?Lager event handler error_logger_lager_h exited with reason {'EXIT',{{badmatch,[smdpp_proxy,{state_timeout,timeout},[{data,[{"State",{awaiting_ > > > > Can you post the whole printout? > > The truncation hides where the process has crashed. > > > > > > > > > > > What can I return from this function to gracefully exit? Can this be done with state_timeout? If this is an obvious question, please point me in the right direction. The documentation here:http://erlang.org/doc/man/gen_statem.html?doesn?t seem to mention any return from the state_timeout. > > > > > > > > Thanks! > > > > > > > > > > > > -- > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From lukas@REDACTED Thu Aug 16 14:36:52 2018 From: lukas@REDACTED (Lukas Larsson) Date: Thu, 16 Aug 2018 14:36:52 +0200 Subject: [erlang-questions] {error,closed} vs. {error,econnreset} In-Reply-To: References: <54E4A07E.5010307@erlang.org> <20150502103209.GA19880@nybek.com> <20150624124817.GA30126@nybek.com> <20160926141520.GB2341@nybek.com> Message-ID: Hello, On Mon, 6 Aug 2018, 10:49 Bekes, Andras G, wrote: > Hi All, > > Reviving this old thread again, because I am getting more and more > convinced that we need further changes. > We're still observing connection close events when an error should be > reported to gen_tcp level. > It can be a reset error somehow still not reported as 'econnreset', but I > suspect it must be some other error. > I suppose that you have not managed to catch the error in a tcp dump as Rory asked for? > > I checked the code in inet_drv.c. The function > static int tcp_recv(tcp_descriptor* desc, int request_len) > seems to work properly -- a reset is either reported as closed or > econnreset, depending on show_econnreset, all other errors are reported as > errors. > > However, the function > static int tcp_send_or_shutdown_error(tcp_descriptor* desc, int err) > hides errors. Connection reset errors are properly handled (either > reported as closed or econnreset, depending on show_econnreset), but all > other errors are just reported as closed. > Active and passive modes have independent code paths, but I think both do > the same: all errors are reported as normal close -- except for econnreset. > There is a merge of error codes happening in tcp_send_error, so some other errors get mapped into econnreset before tcp_send_or_shutdown_error is called. > > Apparently I need to detect all errors. > Is it possible to implement a show_errors (or show_all_errors) flag, too? > > Actually, this new flag could replace the current show_econnreset flag. > Having two separate flags for econnreset & others requires more complex > code, but having a single show_errors flag would simplify the current that > provides special treatment for econnreset. > I am not sure if it makes much sense to expose connection reset errors but > still mask all other errors as normal close events. > > From a farther point of view, it seems there are network-programming tasks > (there is at least one!), for which Erlang seems not suitable. This sounds > rather sad. > Luckily the fix doesn't seem difficult. > > What do you think? > I agree that it should be possible to get the original error from the tcp stack. Given the discussions here https://github.com/erlang/otp/pull/731, maybe it is time to reverse the options so that returning the original error becomes the default and you have to set an option to get the backwards compatible behaviour? We are currently in the process of a major overhaul of gen_tcp and friends, so maybe this can be changed while doing that, as we are bound to break backwards compatibility in various ways during that rewrite anyways. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From dgud@REDACTED Thu Aug 16 16:46:31 2018 From: dgud@REDACTED (Dan Gudmundsson) Date: Thu, 16 Aug 2018 16:46:31 +0200 Subject: [erlang-questions] Mnesia secondary index: a memory leak or lasy cleanup? In-Reply-To: References: Message-ID: Yep seems broken for 'bag' types. I will take at look at that, thanks for the bug report. /Dan On Wed, Aug 15, 2018 at 8:38 PM Karolis Petrauskas wrote: > Forgot to mention the versions. > This case is reproducible with "Erlang/OTP 21 [erts-10.0] [source] > [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]". > The same behaviour is observed on Erlang/OTP 19. > > Karolis Petrauskas > On Wed, Aug 15, 2018 at 5:49 PM Karolis Petrauskas > wrote: > > > > Hello, > > > > I have strange trend in memory consumption on some servers. The ETS > > memory constantly increases. The tables that are increasing are > > mnesia_index tables. It looks like these tables are not cleaned-up > > after the corresponding records are deleted from the indexed table. > > Maybe the index is cleaned up later? I was waiting for a month, the > > mnesia_index table has grown to 1GB approximately. > > > > To reproduce the situation I made a simple test case. The code of the > > tst module is shown at the end of this email. > > > > First I create a bag table and add some (1000) records to it: > > > > 4> tst:create_table(). > > ok > > 10> tst:data_add(). > > ok > > 12> ets:i(). > > id name type size mem owner > > > ---------------------------------------------------------------------------- > > ... > > 45084 mnesia_index ordered_set 1000 10088 > > mnesia_monitor > > ... > > t t bag 1000 9298 > mnesia_monitor > > ok > > > > The table and the index has same number of records (the data for the > > primary and the secondary indexes are unique in this case). > > Then I delete the records: > > > > 14> tst:data_del(). > > ok > > 16> ets:i(). > > id name type size mem owner > > > ---------------------------------------------------------------------------- > > ... > > 45084 mnesia_index ordered_set 1000 10088 > > mnesia_monitor > > ... > > t t bag 0 298 > mnesia_monitor > > ok > > > > Here the table has 0 records (as expected), and the index still has > > 1000 records. > > > > The code of the tst module: > > > > -module(tst). > > -export([create_table/0, data_add/0, data_del/0]). > > -record(t, {a, b, c}). > > > > create_table() -> > > {atomic, ok} = mnesia:create_table(t, [{type, bag}, > > {attributes, record_info(fields, t)}]), > > {atomic, ok} = mnesia:add_table_index(t, b), > > ok. > > > > data_add() -> > > mnesia:activity(transaction, fun () -> > > lists:foreach(fun (Key) -> > > mnesia:write(#t{a = Key, b = Key}) > > end, lists:seq(1, 1000)) > > end). > > > > data_del() -> > > mnesia:activity(transaction, fun () -> > > lists:foreach(fun (Key) -> > > [R] = mnesia:match_object(#t{a = Key, _ = '_'}), > > mnesia:delete_object(R) > > end, lists:seq(1, 1000)) > > end). > > > > > > Karolis Petrauskas > _______________________________________________ > 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 Aug 17 12:06:50 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Fri, 17 Aug 2018 12:06:50 +0200 Subject: [erlang-questions] Still memory leak in SSL In-Reply-To: References: Message-ID: Hi! A possible workaround is to provide your own session_db callback module that does not create session tables. A session reuse is per connection, disabling session reuse does not take away the sessions tables only their use. The path away form this problem (at least in the long run) I think is implementing session tickets instead of the original session reuse strategy. Regards Ingela Erlang OTP Team - Ericsson Ab 2018-08-14 14:34 GMT+02:00 Attila Rajmund Nohl : > Attila Rajmund Nohl ezt ?rta (id?pont: 2018. > aug. 14., K, 10:09): > > > > Hello! > > > > I'm facing the same problem as mentioned in > > https://groups.google.com/d/msg/erlang-programming/ > xWpKjeG21Ys/mfoOkjzwBgAJ > > > > Unfortunately I can't upgrade to Erlang 20 (or later). I did apply the > > https://github.com/erlang/otp/commit/256e01ce80b3aadd63f303b9bda572 > 2ad313220f > > patch on the 19.3.6.9 sources, but I still have the problem. I also > > tried to disable the session reuse (i.e. pass {reuse_sessions, false} > > to ssl:listen) too, still the ETS memory usage grows in the VM to 8 > > GB. I need to triple check that indeed the patched version ran, but do > > you have any idea what else could cause this? Of course, this only > > happens at outside-organization test and I can't reproduce the leakage > > locally :-( > > Managed to reproduce the problem locally: it looks like the client > creates SSL sessions at a faster rate (around 200/sec) then the > session_validator removes them (around 150/sec). So the session cache > grows about 50 entries/sec. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Fri Aug 17 14:31:40 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 17 Aug 2018 14:31:40 +0200 Subject: [erlang-questions] Gracefully Exit from state_timeout gen statem In-Reply-To: <8c217b6a-0e30-4eb4-a5b7-cee29eca0601@Spark> References: <1d4167e3-ea88-4b0c-ae69-a4fd27d98cc2@Spark> <20180815125938.GB93646@erix.ericsson.se> <8c217b6a-0e30-4eb4-a5b7-cee29eca0601@Spark> Message-ID: <20180817123140.GA75778@erix.ericsson.se> On Wed, Aug 15, 2018 at 04:31:21PM -0400, Code Wiget wrote: > Thanks for the reply. I?m having an issue getting the full report because lager is truncating it. Will the stack trace help? > > Stacktrace: [{gen_statem,parse_event_result,8,[{file,"gen_statem.erl"},{line,1267}]},{gen_statem,loop_event,6,[{file,"gen_statem.erl"},{line,1015}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}] > > But the process is exiting on this line: > > handle_event(state_timeout, _Msg, StateName, State) -> > > ?LOG(warning, "STATE TIMEOUT(State:~p)", [StateName], State), > > {stop, timeout}; ? ?<- This line This is consistent with e.g OTP-20.0 and returning {stop, timeout} from the event handler. The process should terminate with exception class 'exit', reason 'timeout' and that stacktrace. Before terminating it should print the termination reason through error_logger:format/2, and I guess that is where Lager gets involved. The term [smdpp_proxy,{state_timeout,timeout}, [{data,[{"State",{awaiting_ that is involved in the 'badmatch' exception is argument 2 to error_logger:format/2 (the name of the gen_statem server is smdpp_proxy, right?). The first argument is a format string. So it seems Lager's event handler error_logger_lager_h exits with a 'badmatch' involving the term that is the arguments to the format string. Smells like an internal Lager error to me. Maybe. Probably... / Raimo > > > On Aug 15, 2018, 9:45 AM -0400, Raimo Niskanen , wrote: > > On Tue, Aug 07, 2018 at 03:05:08PM -0400, Code Wiget wrote: > > > Would like to update this to say that I?m using {state_timeout, 2000, timeout}, rather than {state_timeout, 2000} > > > > > > On Aug 7, 2018, 2:29 PM -0400, Code Wiget , wrote: > > > > Hi everyone, > > > > > > > > How do you gracefully exit from a state_timeout in a gen_statem? Generally, for a gen_statem, I can return ?stop? or {stop, Reason} from a state function and the statem will terminate. However, if I use a state timeout method, returned from init: > > > > > > > > > {ok, new_state, State, {state_timeout, 2000}} > > > > > > > > The new_state(state_timeout, Info, State) method is called after 2000. Returning ?stop? from this given an error?: > > > > > > > > > 18:22:33.039 [error] <0.576.0> : ?Lager event handler error_logger_lager_h exited with reason {'EXIT',{{badmatch,[smdpp_proxy,{state_timeout,timeout},[{data,[{"State",{awaiting_ > > > > Can you post the whole printout? > > The truncation hides where the process has crashed. > > > > > > > > > > > What can I return from this function to gracefully exit? Can this be done with state_timeout? If this is an obvious question, please point me in the right direction. The documentation here:http://erlang.org/doc/man/gen_statem.html?doesn?t seem to mention any return from the state_timeout. > > > > > > > > Thanks! > > > > > > > > > > > > -- > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Fri Aug 17 14:34:13 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 17 Aug 2018 14:34:13 +0200 Subject: [erlang-questions] RNG algorithm choice for uniform natural numbers In-Reply-To: <877ekzr7oo.fsf@gmail.com> References: <87h8kdklkq.fsf@gmail.com> <20180802161024.GA85691@erix.ericsson.se> <87effel7ih.fsf@gmail.com> <877ekzr7oo.fsf@gmail.com> Message-ID: <20180817123413.GB75778@erix.ericsson.se> On Thu, Aug 09, 2018 at 03:27:51PM +0200, Krzysztof Jurewicz wrote: > > What I actually want to implement is a randomized apportionment scheme, as described on https://rangevoting.org/Apportion.html (?Truly unbiased methods?), but more efficient, like in the code below (not tested). > > Tests revealed that the simple algorithm does not satisfy the quota property. Therefore I?ve used a more sophisticated one (code below), which however doesn?t require using a specific interval for drawing integers. Instead of the rand module, I use SHA-256 to generate random integers (taking first n bits). This is very interoperable between languages, though I don?t know whether SHA-256 satisfies all RNG properties desirable in that context. (Also I don?t have a proof that the distribution of apportioned seats is unbiased). > > -type score() :: ({Votes :: non_neg_integer(), Id :: any()}). > -type result() :: {Id :: any(), Seats :: non_neg_integer()}. > > -spec apportion(list(score()), pos_integer(), pos_integer(), binary()) -> list(result()). > apportion(Scores, TotalSeats, VotesSum, State) -> > {WholeSeatsMap, RemainderScores, RemainingSeats, _} = > lists:foldl( > fun ( > {Votes, Id}, > {WholeSeatsAcc, > RemainderScoresAcc, > RemSeatsAcc, > StateAcc}) -> > Seats = Votes * TotalSeats div VotesSum, > <> = NewState = crypto:hash(sha256, StateAcc), Have you tried to change line above to RandInt = rand:uniform(1 bsl 32), and not add 1 to RandInt below? To see if the problem you had was about the random number generator or in the surrounding code... > RemainderScore = (Votes * TotalSeats rem VotesSum) * (RandInt + 1), > {maps:put(Id, Seats, WholeSeatsAcc), > [{RemainderScore, Id}|RemainderScoresAcc], > RemSeatsAcc - Seats, > NewState} > end, > {#{}, > [], > TotalSeats, > State}, > Scores), > DrawnIds = > %% We actually need to sort the list only at first RemainderSeats places, so here is a room for optimization. > [Id || {_, Id} <- lists:sublist(lists:reverse(lists:sort(RemainderScores)), RemainingSeats)], > ResultMap = > lists:foldl( > fun (Id, ResultMapAcc) -> > maps:update_with( > Id, > fun (OldSeats) -> OldSeats + 1 end, > 1, > ResultMapAcc) > end, > WholeSeatsMap, > DrawnIds), > lists:sort([{Id, Seats} || {Id, Seats} <- maps:to_list(ResultMap), Seats > 0]). -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From cean.ebengt@REDACTED Fri Aug 17 17:56:55 2018 From: cean.ebengt@REDACTED (bengt e) Date: Fri, 17 Aug 2018 17:56:55 +0200 Subject: [erlang-questions] Dialyzer warning has me baffled. Message-ID: Greetings, This is on Erlang 20.3. I am at work, so if anybody could test on 21 that would be nice. The source code below (the smallest I could make the original and still get the warning) gives me the Dialyzer warning (line 19 is first/2): src/test_dialyzer.erl 19 : The pattern <_, {'error', _Reason}> can never match the type If I remove the first argument to key/2, Dialyzer is silent. Is there anybody that would like to explain why I get the warning? Is it some kind of interference between type specs? Ie, is_dets_file/1 hides {error, Reason} from oldest/1 ? Best Wishes, bengt -module( test_dialyzer ). %% API exports -export( [key/1] ). %%==================================================================== %% API functions %%==================================================================== -spec( key(Name::file:filename()) -> ok ). key( Name ) -> O = oldest( file:list_dir(Name) ), key( dets:is_dets_file(O), O ). %%==================================================================== %% Internal functions %%==================================================================== key( _, {error, _Reason} ) -> ok; key( _, _ ) -> ok. oldest( {ok, [H | _]} ) -> H; oldest( {error, Reason} ) -> {error, Reason}. -------------- next part -------------- An HTML attachment was scrubbed... URL: From elbrujohalcon@REDACTED Fri Aug 17 18:05:17 2018 From: elbrujohalcon@REDACTED (Brujo Benavides) Date: Fri, 17 Aug 2018 13:05:17 -0300 Subject: [erlang-questions] Dialyzer warning has me baffled. In-Reply-To: References: Message-ID: <1CDF8EA5-088C-45EE-A18D-410FB991FA38@gmail.com> Hi bengt, This would be my guess: The spec for sets:is_dets_file/1 says? -spec is_dets_file(Filename) -> boolean() | {'error', Reason} when Filename :: file:name(), Reason :: term(). That means that, for it to work, its parameter must be of type file:name(). Therefore, in your code, dialyzer infers that your variable O is, in fact, a file:name() which of course doesn?t match with {error, Reason}. When you remove the first argument for key/2, you?re basically removing that restriction? dialyzer can no longer infer anything about the type of O and therefore is silent. Hope this helps. Brujo Benavides > On 17 Aug 2018, at 12:56, bengt e wrote: > > Greetings, > > This is on Erlang 20.3. I am at work, so if anybody could test on 21 that would be nice. > > The source code below (the smallest I could make the original and still get the warning) gives me the Dialyzer warning (line 19 is first/2): > src/test_dialyzer.erl > 19 > : The pattern <_, {'error', _Reason}> can never match the type > > If I remove the first argument to key/2, Dialyzer is silent. > Is there anybody that would like to explain why I get the warning? > Is it some kind of interference between type specs? Ie, is_dets_file/1 hides {error, Reason} from oldest/1 ? > > > Best Wishes, > bengt > > > -module( test_dialyzer ). > > %% API exports > -export( [key/1] ). > > %%==================================================================== > %% API functions > %%==================================================================== > > -spec( key(Name::file:filename()) -> ok ). > key( Name ) -> > O = oldest( file:list_dir(Name) ), > key( dets:is_dets_file(O), O ). > > %%==================================================================== > %% Internal functions > %%==================================================================== > > key( _, {error, _Reason} ) -> ok; > key( _, _ ) -> ok. > > oldest( {ok, [H | _]} ) -> H; > oldest( {error, Reason} ) -> {error, Reason}. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From krzysztof.jurewicz@REDACTED Fri Aug 17 22:41:17 2018 From: krzysztof.jurewicz@REDACTED (Krzysztof Jurewicz) Date: Fri, 17 Aug 2018 22:41:17 +0200 Subject: [erlang-questions] RNG algorithm choice for uniform natural numbers In-Reply-To: <20180815131220.GD93646@erix.ericsson.se> References: <87h8kdklkq.fsf@gmail.com> <20180802161024.GA85691@erix.ericsson.se> <87effel7ih.fsf@gmail.com> <877ekzr7oo.fsf@gmail.com> <20180815131220.GD93646@erix.ericsson.se> Message-ID: <877ekosp3m.fsf@gmail.com> > Have you tried to change line above to > RandInt = rand:uniform(1 bsl 32), > and not add 1 to RandInt below? > > To see if the problem you had was about the random number generator or in > the surrounding code... Let?s assume that we have 3 seats and the following voting results (in order): A ? 1 vote; B ? 1 vote; C ? 100 votes. Following the simple algorithm, A has 1?102 chance of getting a seat. Let?s assume that A was lucky. Then we have 2 remaining seats and the following results remaining: B ? 1 vote; C ? 100 votes. B has then 1?101 chance of getting a seat. Let?s assume that it was lucky. Then we have one remaining seat which goes to C. Final results: A ? 1 seat; B ? 1 seat; C ? 1 seat. But according to quota property, C should get either 2 or 3 seats. This flaw is inherent to the simple apportionment algorithm and independent of the random number generator. From donpedrothird@REDACTED Fri Aug 17 22:46:30 2018 From: donpedrothird@REDACTED (John Doe) Date: Fri, 17 Aug 2018 23:46:30 +0300 Subject: [erlang-questions] merl behaves differently (incorrectly?) in OTP 21 Message-ID: minimal code for reproducing the issue -module(a). -export([test/0]). -include_lib("syntax_tools/include/merl.hrl"). test() -> Str = "a_string", ?Q("_@REDACTED@ -> 1"). Result in OTP 19: {tree,clause, {attr,7,[],none}, {clause,[{tree,string,{attr,0,[],none},"a_string"}], none, [{integer,7,1}]}} in OTP 21 {tree,clause, {attr,7,[],none}, {clause,[{tree,class_qualifier, {attr,0,[],none}, {class_qualifier,{atom,7,throw}, {tree,string,{attr,0,[],none},"a_string"}, {var,7,'_'}}}], none, [{integer,7,1}]}} -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Fri Aug 17 23:20:03 2018 From: donpedrothird@REDACTED (John Doe) Date: Sat, 18 Aug 2018 00:20:03 +0300 Subject: [erlang-questions] merl behaves differently (incorrectly?) in OTP 21 In-Reply-To: References: Message-ID: erl_syntax:try_expr_handlers({'try',0,[{atom,0,true}],[],[{clause,7,[{tuple,7,[{atom,7,'throw'},{var,7,'_@REDACTED@'},{var,7,'_'}]}],[],[{integer,7,1}]}],[]}). In 19: [{clause,7,[{var,7,'_@REDACTED@'}],[],[{integer,7,1}]}] in 21: erl_syntax:try_expr_handlers({'try',0,[{atom,0,true}],[],[{clause,7,[{tuple,7,[{atom,7,'throw'},{var,7,'_@REDACTED@'},{var,7,'_'}]}],[],[{integer,7,1}]}],[]}). 2018-08-17 23:46 GMT+03:00 John Doe : > minimal code for reproducing the issue > > -module(a). > -export([test/0]). > -include_lib("syntax_tools/include/merl.hrl"). > test() -> > Str = "a_string", > ?Q("_@REDACTED@ -> 1"). > > Result in OTP 19: > > {tree,clause, > {attr,7,[],none}, > {clause,[{tree,string,{attr,0,[],none},"a_string"}], > none, > [{integer,7,1}]}} > > in OTP 21 > > {tree,clause, > {attr,7,[],none}, > {clause,[{tree,class_qualifier, > {attr,0,[],none}, > {class_qualifier,{atom,7,throw}, > {tree,string,{attr,0,[],none},"a_string"}, > {var,7,'_'}}}], > none, > [{integer,7,1}]}} > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Fri Aug 17 23:22:13 2018 From: donpedrothird@REDACTED (John Doe) Date: Sat, 18 Aug 2018 00:22:13 +0300 Subject: [erlang-questions] merl behaves differently (incorrectly?) in OTP 21 In-Reply-To: References: Message-ID: erl_syntax:try_expr_handlers({'try',0,[{atom,0,true}],[],[{clause,7,[{tuple,7,[{atom,7,'throw'},{var,7,'_@REDACTED@'},{var,7,'_'}]}],[],[{integer,7,1}]}],[]}). In 19: [{clause,7,[{var,7,'_@REDACTED@'}],[],[{integer,7,1}]}] in 21: [{clause,7, [{tree,class_qualifier, {attr,0,[],none}, {class_qualifier,{atom,7,throw}, {var,7,'_@REDACTED@'}, {var,7,'_'}}}], [], [{integer,7,1}]}] 2018-08-17 23:46 GMT+03:00 John Doe : > minimal code for reproducing the issue > > -module(a). > -export([test/0]). > -include_lib("syntax_tools/include/merl.hrl"). > test() -> > Str = "a_string", > ?Q("_@REDACTED@ -> 1"). > > Result in OTP 19: > > {tree,clause, > {attr,7,[],none}, > {clause,[{tree,string,{attr,0,[],none},"a_string"}], > none, > [{integer,7,1}]}} > > in OTP 21 > > {tree,clause, > {attr,7,[],none}, > {clause,[{tree,class_qualifier, > {attr,0,[],none}, > {class_qualifier,{atom,7,throw}, > {tree,string,{attr,0,[],none},"a_string"}, > {var,7,'_'}}}], > none, > [{integer,7,1}]}} > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cean.ebengt@REDACTED Sat Aug 18 10:29:49 2018 From: cean.ebengt@REDACTED (bengt e) Date: Sat, 18 Aug 2018 10:29:49 +0200 Subject: [erlang-questions] Dialyzer warning has me baffled. In-Reply-To: <1CDF8EA5-088C-45EE-A18D-410FB991FA38@gmail.com> References: <1CDF8EA5-088C-45EE-A18D-410FB991FA38@gmail.com> Message-ID: Thank you very much. That makes sense. I can fix this. My mistake was to think that Dialyzer knew the return value of oldest/1, since it is there, in the file. Whereas, to me, the spec for is_dets_file/1 is 'just a spec'. dets:is_dest_file( {not, "afile", 1} ) will return {error, Reason} and not crash. On Fri, Aug 17, 2018 at 6:05 PM, Brujo Benavides wrote: > Hi bengt, > > This would be my guess: > > The spec for *sets:is_dets_file/1* says? > -spec is_dets_file(Filename) -> boolean() | {'error', Reason} when > Filename :: file:name(), > Reason :: term(). > > That means that, for it to work, its parameter must be of type > *file:name().* > > Therefore, in your code, dialyzer infers that your variable *O* is, in > fact, a *file:name()* which of course doesn?t match with *{error, Reason}* > . > > When you remove the first argument for *key/2*, you?re basically removing > that restriction? dialyzer can no longer infer anything about the type of > *O* and therefore is silent. > > Hope this helps. > > ------------------------------ > *Brujo Benavides * > > > > On 17 Aug 2018, at 12:56, bengt e wrote: > > Greetings, > > This is on Erlang 20.3. I am at work, so if anybody could test on 21 that > would be nice. > > The source code below (the smallest I could make the original and still > get the warning) gives me the Dialyzer warning (line 19 is first/2): > src/test_dialyzer.erl > 19 > : The pattern <_, {'error', _Reason}> can never match the type | {'error',_},[atom() | [any()] | char()]> > > If I remove the first argument to key/2, Dialyzer is silent. > Is there anybody that would like to explain why I get the warning? > Is it some kind of interference between type specs? Ie, is_dets_file/1 > hides {error, Reason} from oldest/1 ? > > > Best Wishes, > bengt > > > -module( test_dialyzer ). > > %% API exports > -export( [key/1] ). > > %%==================================================================== > %% API functions > %%==================================================================== > > -spec( key(Name::file:filename()) -> ok ). > key( Name ) -> > O = oldest( file:list_dir(Name) ), > key( dets:is_dets_file(O), O ). > > %%==================================================================== > %% Internal functions > %%==================================================================== > > key( _, {error, _Reason} ) -> ok; > key( _, _ ) -> ok. > > oldest( {ok, [H | _]} ) -> H; > oldest( {error, Reason} ) -> {error, Reason}. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From technion@REDACTED Sun Aug 19 08:14:57 2018 From: technion@REDACTED (Technion) Date: Sun, 19 Aug 2018 06:14:57 +0000 Subject: [erlang-questions] [meta] Messages not reaching the mailing list In-Reply-To: <0016f968-bd32-7863-fae0-c8c5a44d147b@kent.ac.uk> References: <20180815132212.GE93646@erix.ericsson.se>, <0016f968-bd32-7863-fae0-c8c5a44d147b@kent.ac.uk> Message-ID: Hi, I've tried running corporate systems which reject mail that fails DMARC, I wouldn't recommend it. Google would never ever do it - you reject an astounding amount of legitimate email (including most email from Australian Government organisations like the new MyHealth system) and you very quickly get a C-level person demanding you "fix" the mail system. I was whitelisting ten+ domains a day until I gave in. In terms of blocking spam, you'll achieve just about nothing. A high portion of spam these days comes from compromised mail accounts, which come "legitimately" from Office 365 or Gmail's own servers and successfully pass any SPF and DKIM rules in place, even where DMARC is setup to enforce as such - which is pretty rare. Unfortunately this breakage does an awful lot more harm than good at this point, although I'd look forward to a future where this changes. ________________________________ From: erlang-questions-bounces@REDACTED on behalf of Joe Harrison Sent: Thursday, 16 August 2018 12:17 AM To: Raimo Niskanen Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] [meta] Messages not reaching the mailing list On 15/08/18 14:22, Raimo Niskanen wrote: .. Yes, it's an unfortunate breakage, but it's also a modern spam mitigation technique, and it's slowly gaining steam amongst the bigger free providers (there were rumours of gmail setting "p=reject" in 2017). -------------- next part -------------- An HTML attachment was scrubbed... URL: From thebullno1@REDACTED Mon Aug 20 09:30:08 2018 From: thebullno1@REDACTED (Bach Le) Date: Mon, 20 Aug 2018 15:30:08 +0800 Subject: [erlang-questions] Make dialyzer use -callback types in behaviour module Message-ID: Currently, `-callback` declaration only affects how dialyzer works on the callback module. Those info are ignored in the behaviour module when a dynamic call is made: `HandlerMod:callback_fun()`. Right now, I am rewriting some behaviour specs and having dialyzer check the types would be great. I can think of two ways to do this: * Make dialyzer consider all dynamic calls in a module that declare `-callback` to be calls to the matching callback functions. I have no idea about dialyzer's internal though. * Create a parse transform that is only called when using dialyzer. Each `-callback` will have a matching wrapper function e.g: `-callback foo(number()) -> ok` will generate ` `'$call_foo'(module(), number()) -> ok`. All dynamic calls (e.g: `HandlerMod:foo(42)`) will be rewritten to use those wrappers (`'$call_foo'(HandlerMod, 42)`). IIRC, there are ways to pass compiler options into dialyzer. What are your thoughts? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Mon Aug 20 11:30:43 2018 From: bchesneau@REDACTED (Benoit Chesneau) Date: Mon, 20 Aug 2018 11:30:43 +0200 Subject: [erlang-questions] efficient way to make some resources available as precompiled beams Message-ID: Hi all, I'm wondering what Is most efficient when you want to make some resource available as precompiled beams. Say for example, you have a a resource available as CSV and there is a need for a lookup on this list based on one of column. I am for now transforming this list in a list of matching functions (lookup(X1) ->. V1; ... lookup(XN) -> VN.). Ie you have a CSV (simplified version): Key1; V1 Key2; V2 ... KeyN; VN which is transformed in the following erlang file, later compiled: lookup(Key1) -> V1; lookup(Key2) -> V2; ... lookup(KeyN) -> VN. But with the new optimisations in Erlang 20/21 sharing literals I am wondering if it wouldn't be more efficient to use a maps there? So the generated erlang file would be: -define(to_lookup_map, #{ Key1 => V1; Key2 => V2; ... KeyN => VN }). lookup(Key) -> maps:get(Key, ?to_lookup_map). A maps would also have some benefit in compressing a little the info I guess. Thoughts? Beside that maybe having that ressource in a memory mapped file would be better? I believe that beams are fully loaded in RAM, aren't they? Benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Mon Aug 20 11:43:24 2018 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 20 Aug 2018 11:43:24 +0200 Subject: [erlang-questions] efficient way to make some resources available as precompiled beams In-Reply-To: References: Message-ID: On Mon, Aug 20, 2018 at 11:31 AM Benoit Chesneau wrote: > But with the new optimisations in Erlang 20/21 sharing literals I am > wondering if it wouldn't be more efficient to use a maps there? > That optimization should not effect the performance of the lookups at all. It will change how much it will cost to send the values once you have done the lookup, but that should be the same with both approaches. > > So the generated erlang file would be: > > -define(to_lookup_map, #{ Key1 => V1; > Key2 => V2; > ... > KeyN => VN }). > > lookup(Key) -> maps:get(Key, ?to_lookup_map). > > > A maps would also have some benefit in compressing a little the info I > guess. > > Thoughts? Beside that maybe having that ressource in a memory mapped file > would be better? I believe that beams are fully loaded in RAM, aren't they? > > The difference in between the two approaches will depend on what the keys are. If they are strings (list or binary) then I doubt that the maps code will be able to beat compiled beam code. If they are integers, then maybe maps will stand a chance, unless the compiler is able to build a jump table of the integers. There are bound to be cases where the maps approach is faster, but I can't think of any right now. As always, measure measure measure. -------------- next part -------------- An HTML attachment was scrubbed... URL: From solvip@REDACTED Mon Aug 20 15:24:26 2018 From: solvip@REDACTED (=?UTF-8?B?U8O2bHZpIFDDoWxsIMOBc2dlaXJzc29u?=) Date: Mon, 20 Aug 2018 13:24:26 +0000 Subject: [erlang-questions] Make dialyzer use -callback types in behaviour module In-Reply-To: References: Message-ID: Hi I think that the way I'd prefer is to type the record field(or whatever) that are used to store HandlerMod, just like we do when typing other things. i.e., you should be able to define your state as something like: -record(state, { handler_mod :: some_behaviour_type() }). And dialyzer would figure out that handler_mod should infer to a module that implements that behaviour type. That way, no unexpected magic is going on and the typing of the callback will be no different from the typing of other things that you might have in your state. Cheers S?lvi P?ll ?. On Mon, Aug 20, 2018 at 7:30 AM Bach Le wrote: > > Currently, `-callback` declaration only affects how dialyzer works on the callback module. Those info are ignored in the behaviour module when a dynamic call is made: `HandlerMod:callback_fun()`. Right now, I am rewriting some behaviour specs and having dialyzer check the types would be great. > > I can think of two ways to do this: > > * Make dialyzer consider all dynamic calls in a module that declare `-callback` to be calls to the matching callback functions. I have no idea about dialyzer's internal though. > * Create a parse transform that is only called when using dialyzer. Each `-callback` will have a matching wrapper function e.g: `-callback foo(number()) -> ok` will generate ` > `'$call_foo'(module(), number()) -> ok`. All dynamic calls (e.g: `HandlerMod:foo(42)`) will be rewritten to use those wrappers (`'$call_foo'(HandlerMod, 42)`). IIRC, there are ways to pass compiler options into dialyzer. > > What are your thoughts? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From codewiget95@REDACTED Mon Aug 20 22:00:52 2018 From: codewiget95@REDACTED (Code Wiget) Date: Mon, 20 Aug 2018 16:00:52 -0400 Subject: [erlang-questions] TLS 1.3 Development Message-ID: <800d57d8-db04-4909-8d70-291c44fdd025@Spark> Hi all, I noticed that TLS 1.3 was recently finalized (https://searchsecurity.techtarget.com/news/252446998/Finalized-TLS-13-update-has-been-published-at-last)?: "The finalized and completed version of TLS 1.3 was published last week following a lengthy draft review process. The Internet Engineering Task Force (IETF) published the latest version of the?Transport Layer Security?protocol used for internet encryption and authentication on Friday, Aug. 10, 2018, after starting work on it in April 2014. ? It appears that openssl has a current working version right now. What?s the state of TLS 1.3 in the OTP? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Wed Aug 22 11:11:41 2018 From: lukas@REDACTED (Lukas Larsson) Date: Wed, 22 Aug 2018 11:11:41 +0200 Subject: [erlang-questions] Patch package OTP 21.0.5 released In-Reply-To: References: Message-ID: Hello, On Tue, Aug 14, 2018 at 9:55 PM Matwey V. Kornilov < matwey.kornilov@REDACTED> wrote: > > Could you please opensource the tool which is used to produce this mails > from OTP sources? > > The tools does not generate the email from OTP sources, but from our internal ticket database. So it is not possible to run it outside of our environment. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Wed Aug 22 16:51:02 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Wed, 22 Aug 2018 16:51:02 +0200 Subject: [erlang-questions] TLS 1.3 Development In-Reply-To: <800d57d8-db04-4909-8d70-291c44fdd025@Spark> References: <800d57d8-db04-4909-8d70-291c44fdd025@Spark> Message-ID: <8b2f14f4-3172-3c1d-e148-ca466a3629d9@ninenines.eu> Worth adding that the upcoming QUIC protocol requires TLS 1.3. I'm not sure whether there are any specific requirements that should influence the ssl application's interface but it does sound like QUIC specifies a few things related to the TLS handshake. Cheers, On 08/20/2018 10:00 PM, Code Wiget wrote: > Hi all, > > I noticed that TLS 1.3 was recently finalized > (https://searchsecurity.techtarget.com/news/252446998/Finalized-TLS-13-update-has-been-published-at-last)?: > > > "The finalized and completed version of TLS 1.3 was published last week > following a lengthy draft review process. > The Internet Engineering Task Force (IETF) published the latest version > of the?Transport Layer Security?protocol used for internet encryption > and authentication on Friday, Aug. 10, 2018, after starting work on it > in April 2014. ? > > It appears that openssl has a current working version right now. What?s > the state of TLS 1.3 in the OTP? > > Thanks > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin https://ninenines.eu From ingela.andin@REDACTED Thu Aug 23 10:21:43 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Thu, 23 Aug 2018 10:21:43 +0200 Subject: [erlang-questions] Fwd: TLS 1.3 Development In-Reply-To: References: <800d57d8-db04-4909-8d70-291c44fdd025@Spark> Message-ID: Hi! 2018-08-20 22:00 GMT+02:00 Code Wiget : > Hi all, > > I noticed that TLS 1.3 was recently finalized ( > https://searchsecurity.techtarget.com/news/252446998/Finalized-TLS-13-update-has-been-published-at-last > ) : > > "The finalized and completed version of TLS 1.3 was published last week > following a lengthy draft review process. > The Internet Engineering Task Force (IETF) published the latest version of > the Transport Layer Security protocol used for internet encryption and > authentication on Friday, Aug. 10, 2018, after starting work on it in April > 2014. ? > > It appears that openssl has a current working version right now. What?s > the state of TLS 1.3 in the OTP? > > No promises but planed for OTP-22. Regards Ingela Erlang/OTP Team - Ericsson AB > Thanks > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lars.thorsen@REDACTED Thu Aug 23 10:41:31 2018 From: lars.thorsen@REDACTED (Lars Thorsen) Date: Thu, 23 Aug 2018 08:41:31 +0000 Subject: [erlang-questions] Patch Package OTP 20.3.8.7 Released Message-ID: Patch Package: OTP 20.3.8.7 Git Tag: OTP-20.3.8.7 Date: 2018-08-23 Trouble Report Id: OTP-15233, OTP-15243 Seq num: System: OTP Release: 20 Application: crypto-4.2.2.2, mnesia-4.15.3.2 Predecessor: OTP 20.3.8.6 Check out the git tag OTP-20.3.8.7, 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. --------------------------------------------------------------------- --- crypto-4.2.2.2 -------------------------------------------------- --------------------------------------------------------------------- The crypto-4.2.2.2 application can be applied independently of other applications on a full OTP 20 installation. --- Improvements and New Features --- OTP-15233 Application(s): crypto Update the crypto engine functions to handle multiple loads of an engine. engine_load/3/4 is updated so it doesn't add the engine ID to OpenSSLs internal list of engines which makes it possible to run the engine_load more than once if it doesn't contain global data. Added ensure_engine_loaded/2/3 which guarantees that the engine just is loaded once and the following calls just returns a reference to it. This is done by add the ID to the internal OpenSSL list and check if it is already registered when the function is called. Added ensure_engine_unloaded/1/2 to unload engines loaded with ensure_engine_loaded. Then some more utility functions are added. engine_add/1, adds the engine to OpenSSL internal list engine_remove/1, remove the engine from OpenSSL internal list engine_get_id/1, fetch the engines id engine_get_name/1, fetch the engine name Full runtime dependencies of crypto-4.2.2.2: erts-9.0, kernel-5.3, stdlib-3.4 --------------------------------------------------------------------- --- mnesia-4.15.3.2 ------------------------------------------------- --------------------------------------------------------------------- The mnesia-4.15.3.2 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-15243 Application(s): mnesia Fixed a bug where the bag table index data was not deleted when objects were deleted. Full runtime dependencies of mnesia-4.15.3.2: erts-9.0, kernel-5.3, stdlib-3.4 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From S.J.Thompson@REDACTED Thu Aug 23 13:04:34 2018 From: S.J.Thompson@REDACTED (Simon Thompson) Date: Thu, 23 Aug 2018 12:04:34 +0100 Subject: [erlang-questions] CFP: 4th International Workshop on Real World Domain Specific Languages Message-ID: Apologies for any duplicates! CALL FOR PAPERS 4th International Workshop on Real World Domain Specific Languages https://sites.google.com/site/realworlddsl In conjunction with The International Symposium on Code Generation and Optimisation 2019. http://cgo.org/cgo2019/ Washington DC, USA, 16th February, 2019 As the use of computers proliferates, the complexity and variety of systems continues to grow. As a result, it is becoming increasingly inflexible to "hard wire? behaviours into software. Software developers can enable more control over their software configurations by exploiting Domain Specific Languages (DSLs). Such DSLs provide a systematic way to structure the underlying computational components: to coin a phrase, a DSL is a library with syntax. There is an enormous variety of DSLs for a very wide range of domains. Most DSLs are highly idiosyncratic, reflecting both the specific natures of their application domains and their designers? own preferences. This workshop will bring together constructors of DSLs for ?real world? domains; that is, DSLs intended primarily to aid in building software to solve real world problems rather than to explore the more theoretical aspects of language design and implementation. We are looking for submissions that present the motivation, design, implementation, use and evaluation of such DSLs. Previous workshops were RWSDL?16 (Barcelona), RWDSL?17 (Austin) and RWDSL?18 (Vienna), all collocated with CGO and published in the ACM Digital Library. Key Dates: Paper submission deadline: 9th November 2018 Author notification: 7th December 2018 Final manuscript due: 11th January 2019 Workshop: 16th February 2019 Submission Instructions: The EasyChair submission page for this workshop is: https://easychair.org/conferences/?conf=rwdsl19 Accepted submissions will be published in the ACM Digital Library within its International Conference Proceedings Series. Submissions should be 8-10 pages in ACM double-column format. Authors should follow the information for formatting ACM SIGPLAN conference papers, which can be found at http://www.acm.org/publications/proceedings-template. Full submission details are on the workshop web page. Program Chairs Rob Stewart, Heriot-Watt University, UK Greg Michaelson, Heriot-Watt University, UK PC Members Allin Cottrell, Wake Forest University, USA Nina Dethlefs, University of Hull, UK Andy Gill, X ? The Moonshot Factory, USA Kevin Hammond, University of St Andrews, UK Patrick Maier, University of Glasgow, UK Mathijs Schuts, Phillips Healthcare, Netherlands Simon Thompson, University of Kent, UK Phil Trinder, University of Glasgow, UK Contact Please email inquiries concerning the workshop to: R.Stewart@REDACTED From askjuise@REDACTED Thu Aug 23 16:57:28 2018 From: askjuise@REDACTED (Alexander Petrovsky) Date: Thu, 23 Aug 2018 17:57:28 +0300 Subject: [erlang-questions] SSL and hardcoded DH prime Message-ID: Hello! We have stumble upon default DH prime (2048 bits) in Erlang when we try to establish TLS session with cisco spa303 (VoIP hardphone) via TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) cipher suite. Unfortunately, this hardphone can work only with 1024 bit DH prime. I wonder, why Ingela hardcoded this DH prime - https://github.com/erlang/otp/commit/3458af579af6600870c5ada69b81085f47e9f52b In my synthetical tests, new DH prime generation is fast enough (crypto:strong_rand_bytes(256)), about 17 us in 99 percentile in 1000000 iterations. Why Ingela has hardcoded this DH prime and is any reason why I shouldn't generate DH prime in real-time? -- ?????????? ????????? / Alexander Petrovsky, Skype: askjuise Phone: +7 931 9877991 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Thu Aug 23 19:12:18 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Thu, 23 Aug 2018 19:12:18 +0200 Subject: [erlang-questions] SSL and hardcoded DH prime In-Reply-To: References: Message-ID: Hi! It is only the default value that is hard coded (a recommend value), you may configure your own parameters with dh or dhfile option. Regards Ingela Den tors 23 aug. 2018 kl 16:57 skrev Alexander Petrovsky : > Hello! > > We have stumble upon default DH prime (2048 bits) in Erlang when we try to > establish TLS session with cisco spa303 (VoIP hardphone) > via TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) cipher suite. Unfortunately, > this hardphone can work only with 1024 bit DH prime. > > I wonder, why Ingela hardcoded this DH prime - > https://github.com/erlang/otp/commit/3458af579af6600870c5ada69b81085f47e9f52b > > In my synthetical tests, new DH prime generation is fast enough > (crypto:strong_rand_bytes(256)), about 17 us in 99 percentile in 1000000 > iterations. > > Why Ingela has hardcoded this DH prime and is any reason why I shouldn't > generate DH prime in real-time? > > -- > ?????????? ????????? / Alexander Petrovsky, > > Skype: askjuise > Phone: +7 931 9877991 > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From askjuise@REDACTED Thu Aug 23 19:27:02 2018 From: askjuise@REDACTED (Alexander Petrovsky) Date: Thu, 23 Aug 2018 20:27:02 +0300 Subject: [erlang-questions] SSL and hardcoded DH prime In-Reply-To: References: Message-ID: Yeah, Ingela, thanks! About default value and dh, dhfile options I know. The main question - is the any reasons don?t generate DH prime in real-time? ??, 23 ???. 2018 ?. ? 20:12, Ingela Andin : > Hi! > > It is only the default value that is hard coded (a recommend value), you > may configure your own parameters with dh or dhfile option. > > Regards Ingela > > Den tors 23 aug. 2018 kl 16:57 skrev Alexander Petrovsky < > askjuise@REDACTED>: > >> Hello! >> >> We have stumble upon default DH prime (2048 bits) in Erlang when we try >> to establish TLS session with cisco spa303 (VoIP hardphone) >> via TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) cipher suite. Unfortunately, >> this hardphone can work only with 1024 bit DH prime. >> >> I wonder, why Ingela hardcoded this DH prime - >> https://github.com/erlang/otp/commit/3458af579af6600870c5ada69b81085f47e9f52b >> >> In my synthetical tests, new DH prime generation is fast enough >> (crypto:strong_rand_bytes(256)), about 17 us in 99 percentile in 1000000 >> iterations. >> >> Why Ingela has hardcoded this DH prime and is any reason why I shouldn't >> generate DH prime in real-time? >> >> -- >> ?????????? ????????? / Alexander Petrovsky, >> >> Skype: askjuise >> Phone: +7 931 9877991 >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -- ?????????? ????????? / Alexander Petrovsky, Skype: askjuise Phone: +7 931 9877991 -------------- next part -------------- An HTML attachment was scrubbed... URL: From paulperegud@REDACTED Thu Aug 23 21:07:24 2018 From: paulperegud@REDACTED (Paul Peregud) Date: Thu, 23 Aug 2018 19:07:24 +0000 Subject: [erlang-questions] SSL and hardcoded DH prime In-Reply-To: References: Message-ID: Its a long-ish process. But you can run it during installation or first run. $ time openssl dhparam -out dhparam.pem 2048 ... real 0m3,623s user 0m3,612s sys 0m0,000s On Thu, Aug 23, 2018 at 5:27 PM Alexander Petrovsky wrote: > Yeah, Ingela, thanks! About default value and dh, dhfile options I know. > The main question - is the any reasons don?t generate DH prime in real-time? > > ??, 23 ???. 2018 ?. ? 20:12, Ingela Andin : > >> Hi! >> >> It is only the default value that is hard coded (a recommend value), you >> may configure your own parameters with dh or dhfile option. >> >> Regards Ingela >> >> Den tors 23 aug. 2018 kl 16:57 skrev Alexander Petrovsky < >> askjuise@REDACTED>: >> >>> Hello! >>> >>> We have stumble upon default DH prime (2048 bits) in Erlang when we try >>> to establish TLS session with cisco spa303 (VoIP hardphone) >>> via TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) cipher suite. Unfortunately, >>> this hardphone can work only with 1024 bit DH prime. >>> >>> I wonder, why Ingela hardcoded this DH prime - >>> https://github.com/erlang/otp/commit/3458af579af6600870c5ada69b81085f47e9f52b >>> >>> In my synthetical tests, new DH prime generation is fast enough >>> (crypto:strong_rand_bytes(256)), about 17 us in 99 percentile in 1000000 >>> iterations. >>> >>> Why Ingela has hardcoded this DH prime and is any reason why I shouldn't >>> generate DH prime in real-time? >>> >>> -- >>> ?????????? ????????? / Alexander Petrovsky, >>> >>> Skype: askjuise >>> Phone: +7 931 9877991 >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> -- > ?????????? ????????? / Alexander Petrovsky, > > Skype: askjuise > Phone: +7 931 9877991 > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Best regards, Paul Peregud +48602112091 -------------- next part -------------- An HTML attachment was scrubbed... URL: From askjuise@REDACTED Thu Aug 23 21:43:19 2018 From: askjuise@REDACTED (Alexander Petrovsky) Date: Thu, 23 Aug 2018 22:43:19 +0300 Subject: [erlang-questions] SSL and hardcoded DH prime In-Reply-To: References: Message-ID: No, I can use dh option in Erlang and generate in des format DH prime and DH generator. It?s very fast. ??, 23 ???. 2018 ?. ? 22:07, Paul Peregud : > Its a long-ish process. But you can run it during installation or first > run. > > $ time openssl dhparam -out dhparam.pem 2048 > ... > real 0m3,623s > user 0m3,612s > sys 0m0,000s > > > > On Thu, Aug 23, 2018 at 5:27 PM Alexander Petrovsky > wrote: > >> Yeah, Ingela, thanks! About default value and dh, dhfile options I know. >> The main question - is the any reasons don?t generate DH prime in real-time? >> >> ??, 23 ???. 2018 ?. ? 20:12, Ingela Andin : >> >>> Hi! >>> >>> It is only the default value that is hard coded (a recommend value), you >>> may configure your own parameters with dh or dhfile option. >>> >>> Regards Ingela >>> >>> Den tors 23 aug. 2018 kl 16:57 skrev Alexander Petrovsky < >>> askjuise@REDACTED>: >>> >>>> Hello! >>>> >>>> We have stumble upon default DH prime (2048 bits) in Erlang when we try >>>> to establish TLS session with cisco spa303 (VoIP hardphone) >>>> via TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) cipher suite. Unfortunately, >>>> this hardphone can work only with 1024 bit DH prime. >>>> >>>> I wonder, why Ingela hardcoded this DH prime - >>>> https://github.com/erlang/otp/commit/3458af579af6600870c5ada69b81085f47e9f52b >>>> >>>> In my synthetical tests, new DH prime generation is fast enough >>>> (crypto:strong_rand_bytes(256)), about 17 us in 99 percentile in 1000000 >>>> iterations. >>>> >>>> Why Ingela has hardcoded this DH prime and is any reason why I >>>> shouldn't generate DH prime in real-time? >>>> >>>> -- >>>> ?????????? ????????? / Alexander Petrovsky, >>>> >>>> Skype: askjuise >>>> Phone: +7 931 9877991 >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>> -- >> ?????????? ????????? / Alexander Petrovsky, >> >> Skype: askjuise >> Phone: +7 931 9877991 >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > -- > Best regards, > Paul Peregud > +48602112091 > -- ?????????? ????????? / Alexander Petrovsky, Skype: askjuise Phone: +7 931 9877991 -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.muller.erl@REDACTED Fri Aug 24 05:11:15 2018 From: frank.muller.erl@REDACTED (Frank Muller) Date: Fri, 24 Aug 2018 05:11:15 +0200 Subject: [erlang-questions] SSL and hardcoded DH prime In-Reply-To: References: Message-ID: How? Show us please!!! No, I can use dh option in Erlang and generate in des format DH prime and > DH generator. It?s very fast. > > ??, 23 ???. 2018 ?. ? 22:07, Paul Peregud : > >> Its a long-ish process. But you can run it during installation or first >> run. >> >> $ time openssl dhparam -out dhparam.pem 2048 >> ... >> real 0m3,623s >> user 0m3,612s >> sys 0m0,000s >> >> >> >> On Thu, Aug 23, 2018 at 5:27 PM Alexander Petrovsky >> wrote: >> >>> Yeah, Ingela, thanks! About default value and dh, dhfile options I know. >>> The main question - is the any reasons don?t generate DH prime in real-time? >>> >>> ??, 23 ???. 2018 ?. ? 20:12, Ingela Andin : >>> >>>> Hi! >>>> >>>> It is only the default value that is hard coded (a recommend value), >>>> you may configure your own parameters with dh or dhfile option. >>>> >>>> Regards Ingela >>>> >>>> Den tors 23 aug. 2018 kl 16:57 skrev Alexander Petrovsky < >>>> askjuise@REDACTED>: >>>> >>>>> Hello! >>>>> >>>>> We have stumble upon default DH prime (2048 bits) in Erlang when we >>>>> try to establish TLS session with cisco spa303 (VoIP hardphone) >>>>> via TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) cipher suite. Unfortunately, >>>>> this hardphone can work only with 1024 bit DH prime. >>>>> >>>>> I wonder, why Ingela hardcoded this DH prime - >>>>> https://github.com/erlang/otp/commit/3458af579af6600870c5ada69b81085f47e9f52b >>>>> >>>>> In my synthetical tests, new DH prime generation is fast enough >>>>> (crypto:strong_rand_bytes(256)), about 17 us in 99 percentile in 1000000 >>>>> iterations. >>>>> >>>>> Why Ingela has hardcoded this DH prime and is any reason why I >>>>> shouldn't generate DH prime in real-time? >>>>> >>>>> -- >>>>> ?????????? ????????? / Alexander Petrovsky, >>>>> >>>>> Skype: askjuise >>>>> Phone: +7 931 9877991 >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>>> -- >>> ?????????? ????????? / Alexander Petrovsky, >>> >>> Skype: askjuise >>> Phone: +7 931 9877991 >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> >> >> -- >> Best regards, >> Paul Peregud >> +48602112091 >> > -- > ?????????? ????????? / Alexander Petrovsky, > > Skype: askjuise > Phone: +7 931 9877991 > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From askjuise@REDACTED Fri Aug 24 09:13:22 2018 From: askjuise@REDACTED (Alexander Petrovsky) Date: Fri, 24 Aug 2018 10:13:22 +0300 Subject: [erlang-questions] SSL and hardcoded DH prime In-Reply-To: References: Message-ID: >From official ssl doc http://erlang.org/doc/man/ssl.html *{dh, public_key:der_encoded()}* The DER-encoded Diffie-Hellman parameters. If specified, it overrides option dhfile. ??, 24 ???. 2018 ?. ? 6:11, Frank Muller : > How? Show us please!!! > > No, I can use dh option in Erlang and generate in des format DH prime and >> DH generator. It?s very fast. >> >> ??, 23 ???. 2018 ?. ? 22:07, Paul Peregud : >> >>> Its a long-ish process. But you can run it during installation or first >>> run. >>> >>> $ time openssl dhparam -out dhparam.pem 2048 >>> ... >>> real 0m3,623s >>> user 0m3,612s >>> sys 0m0,000s >>> >>> >>> >>> On Thu, Aug 23, 2018 at 5:27 PM Alexander Petrovsky >>> wrote: >>> >>>> Yeah, Ingela, thanks! About default value and dh, dhfile options I >>>> know. The main question - is the any reasons don?t generate DH prime in >>>> real-time? >>>> >>>> ??, 23 ???. 2018 ?. ? 20:12, Ingela Andin : >>>> >>>>> Hi! >>>>> >>>>> It is only the default value that is hard coded (a recommend value), >>>>> you may configure your own parameters with dh or dhfile option. >>>>> >>>>> Regards Ingela >>>>> >>>>> Den tors 23 aug. 2018 kl 16:57 skrev Alexander Petrovsky < >>>>> askjuise@REDACTED>: >>>>> >>>>>> Hello! >>>>>> >>>>>> We have stumble upon default DH prime (2048 bits) in Erlang when we >>>>>> try to establish TLS session with cisco spa303 (VoIP hardphone) >>>>>> via TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) cipher suite. Unfortunately, >>>>>> this hardphone can work only with 1024 bit DH prime. >>>>>> >>>>>> I wonder, why Ingela hardcoded this DH prime - >>>>>> https://github.com/erlang/otp/commit/3458af579af6600870c5ada69b81085f47e9f52b >>>>>> >>>>>> In my synthetical tests, new DH prime generation is fast enough >>>>>> (crypto:strong_rand_bytes(256)), about 17 us in 99 percentile in 1000000 >>>>>> iterations. >>>>>> >>>>>> Why Ingela has hardcoded this DH prime and is any reason why I >>>>>> shouldn't generate DH prime in real-time? >>>>>> >>>>>> -- >>>>>> ?????????? ????????? / Alexander Petrovsky, >>>>>> >>>>>> Skype: askjuise >>>>>> Phone: +7 931 9877991 >>>>>> >>>>>> _______________________________________________ >>>>>> erlang-questions mailing list >>>>>> erlang-questions@REDACTED >>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>> >>>>> -- >>>> ?????????? ????????? / Alexander Petrovsky, >>>> >>>> Skype: askjuise >>>> Phone: +7 931 9877991 >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>> >>> >>> -- >>> Best regards, >>> Paul Peregud >>> +48602112091 >>> >> -- >> ?????????? ????????? / Alexander Petrovsky, >> >> Skype: askjuise >> Phone: +7 931 9877991 >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -- ?????????? ????????? / Alexander Petrovsky, Skype: askjuise Phone: +7 931 9877991 -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.muller.erl@REDACTED Fri Aug 24 09:46:30 2018 From: frank.muller.erl@REDACTED (Frank Muller) Date: Fri, 24 Aug 2018 09:46:30 +0200 Subject: [erlang-questions] SSL and hardcoded DH prime In-Reply-To: References: Message-ID: It?s not about that. Generating a 2048 DH can take a long time. And you said it?s fast and you want to make it real time. >From official ssl doc > http://erlang.org/doc/man/ssl.html > > *{dh, public_key:der_encoded()}* > > The DER-encoded Diffie-Hellman parameters. If specified, it overrides > option dhfile. > > ??, 24 ???. 2018 ?. ? 6:11, Frank Muller : > >> How? Show us please!!! >> >> No, I can use dh option in Erlang and generate in des format DH prime and >>> DH generator. It?s very fast. >>> >>> ??, 23 ???. 2018 ?. ? 22:07, Paul Peregud : >>> >>>> Its a long-ish process. But you can run it during installation or first >>>> run. >>>> >>>> $ time openssl dhparam -out dhparam.pem 2048 >>>> ... >>>> real 0m3,623s >>>> user 0m3,612s >>>> sys 0m0,000s >>>> >>>> >>>> >>>> On Thu, Aug 23, 2018 at 5:27 PM Alexander Petrovsky >>>> wrote: >>>> >>>>> Yeah, Ingela, thanks! About default value and dh, dhfile options I >>>>> know. The main question - is the any reasons don?t generate DH prime in >>>>> real-time? >>>>> >>>>> ??, 23 ???. 2018 ?. ? 20:12, Ingela Andin : >>>>> >>>>>> Hi! >>>>>> >>>>>> It is only the default value that is hard coded (a recommend value), >>>>>> you may configure your own parameters with dh or dhfile option. >>>>>> >>>>>> Regards Ingela >>>>>> >>>>>> Den tors 23 aug. 2018 kl 16:57 skrev Alexander Petrovsky < >>>>>> askjuise@REDACTED>: >>>>>> >>>>>>> Hello! >>>>>>> >>>>>>> We have stumble upon default DH prime (2048 bits) in Erlang when we >>>>>>> try to establish TLS session with cisco spa303 (VoIP hardphone) >>>>>>> via TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) cipher suite. Unfortunately, >>>>>>> this hardphone can work only with 1024 bit DH prime. >>>>>>> >>>>>>> I wonder, why Ingela hardcoded this DH prime - >>>>>>> https://github.com/erlang/otp/commit/3458af579af6600870c5ada69b81085f47e9f52b >>>>>>> >>>>>>> In my synthetical tests, new DH prime generation is fast enough >>>>>>> (crypto:strong_rand_bytes(256)), about 17 us in 99 percentile in 1000000 >>>>>>> iterations. >>>>>>> >>>>>>> Why Ingela has hardcoded this DH prime and is any reason why I >>>>>>> shouldn't generate DH prime in real-time? >>>>>>> >>>>>>> -- >>>>>>> ?????????? ????????? / Alexander Petrovsky, >>>>>>> >>>>>>> Skype: askjuise >>>>>>> Phone: +7 931 9877991 >>>>>>> >>>>>>> _______________________________________________ >>>>>>> erlang-questions mailing list >>>>>>> erlang-questions@REDACTED >>>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>>> >>>>>> -- >>>>> ?????????? ????????? / Alexander Petrovsky, >>>>> >>>>> Skype: askjuise >>>>> Phone: +7 931 9877991 >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>>> >>>> >>>> -- >>>> Best regards, >>>> Paul Peregud >>>> +48602112091 >>>> >>> -- >>> ?????????? ????????? / Alexander Petrovsky, >>> >>> Skype: askjuise >>> Phone: +7 931 9877991 >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> -- > ?????????? ????????? / Alexander Petrovsky, > > Skype: askjuise > Phone: +7 931 9877991 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From askjuise@REDACTED Fri Aug 24 10:29:51 2018 From: askjuise@REDACTED (Alexander Petrovsky) Date: Fri, 24 Aug 2018 11:29:51 +0300 Subject: [erlang-questions] SSL and hardcoded DH prime In-Reply-To: References: Message-ID: Oh, shame on me, I forget that it's not a random number, it's random prime, so, you are absolutely right, it's not so fast. Thanks. ??, 24 ???. 2018 ?. ? 10:48, Frank Muller : > It?s not about that. Generating a 2048 DH can take a long time. And you > said it?s fast and you want to make it real time. > > From official ssl doc >> http://erlang.org/doc/man/ssl.html >> >> *{dh, public_key:der_encoded()}* >> >> The DER-encoded Diffie-Hellman parameters. If specified, it overrides >> option dhfile. >> >> ??, 24 ???. 2018 ?. ? 6:11, Frank Muller : >> >>> How? Show us please!!! >>> >>> No, I can use dh option in Erlang and generate in des format DH prime >>>> and DH generator. It?s very fast. >>>> >>>> ??, 23 ???. 2018 ?. ? 22:07, Paul Peregud : >>>> >>>>> Its a long-ish process. But you can run it during installation or >>>>> first run. >>>>> >>>>> $ time openssl dhparam -out dhparam.pem 2048 >>>>> ... >>>>> real 0m3,623s >>>>> user 0m3,612s >>>>> sys 0m0,000s >>>>> >>>>> >>>>> >>>>> On Thu, Aug 23, 2018 at 5:27 PM Alexander Petrovsky < >>>>> askjuise@REDACTED> wrote: >>>>> >>>>>> Yeah, Ingela, thanks! About default value and dh, dhfile options I >>>>>> know. The main question - is the any reasons don?t generate DH prime in >>>>>> real-time? >>>>>> >>>>>> ??, 23 ???. 2018 ?. ? 20:12, Ingela Andin : >>>>>> >>>>>>> Hi! >>>>>>> >>>>>>> It is only the default value that is hard coded (a recommend value), >>>>>>> you may configure your own parameters with dh or dhfile option. >>>>>>> >>>>>>> Regards Ingela >>>>>>> >>>>>>> Den tors 23 aug. 2018 kl 16:57 skrev Alexander Petrovsky < >>>>>>> askjuise@REDACTED>: >>>>>>> >>>>>>>> Hello! >>>>>>>> >>>>>>>> We have stumble upon default DH prime (2048 bits) in Erlang when we >>>>>>>> try to establish TLS session with cisco spa303 (VoIP hardphone) >>>>>>>> via TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) cipher suite. Unfortunately, >>>>>>>> this hardphone can work only with 1024 bit DH prime. >>>>>>>> >>>>>>>> I wonder, why Ingela hardcoded this DH prime - >>>>>>>> https://github.com/erlang/otp/commit/3458af579af6600870c5ada69b81085f47e9f52b >>>>>>>> >>>>>>>> In my synthetical tests, new DH prime generation is fast enough >>>>>>>> (crypto:strong_rand_bytes(256)), about 17 us in 99 percentile in 1000000 >>>>>>>> iterations. >>>>>>>> >>>>>>>> Why Ingela has hardcoded this DH prime and is any reason why I >>>>>>>> shouldn't generate DH prime in real-time? >>>>>>>> >>>>>>>> -- >>>>>>>> ?????????? ????????? / Alexander Petrovsky, >>>>>>>> >>>>>>>> Skype: askjuise >>>>>>>> Phone: +7 931 9877991 >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> erlang-questions mailing list >>>>>>>> erlang-questions@REDACTED >>>>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>>>> >>>>>>> -- >>>>>> ?????????? ????????? / Alexander Petrovsky, >>>>>> >>>>>> Skype: askjuise >>>>>> Phone: +7 931 9877991 >>>>>> >>>>>> _______________________________________________ >>>>>> erlang-questions mailing list >>>>>> erlang-questions@REDACTED >>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>> >>>>> >>>>> >>>>> -- >>>>> Best regards, >>>>> Paul Peregud >>>>> +48602112091 >>>>> >>>> -- >>>> ?????????? ????????? / Alexander Petrovsky, >>>> >>>> Skype: askjuise >>>> Phone: +7 931 9877991 >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>> -- >> ?????????? ????????? / Alexander Petrovsky, >> >> Skype: askjuise >> Phone: +7 931 9877991 >> >> -- ?????????? ????????? / Alexander Petrovsky, Skype: askjuise Phone: +7 931 9877991 -------------- next part -------------- An HTML attachment was scrubbed... URL: From lars.thorsen@REDACTED Fri Aug 24 10:31:33 2018 From: lars.thorsen@REDACTED (Lars Thorsen) Date: Fri, 24 Aug 2018 08:31:33 +0000 Subject: [erlang-questions] Patch package OTP 21.0.6 released Message-ID: Patch Package: OTP 21.0.6 Git Tag: OTP-21.0.6 Date: 2018-08-24 Trouble Report Id: OTP-15203, OTP-15215, OTP-15233 Seq num: System: OTP Release: 21 Application: crypto-4.3.2, inets-7.0.1, ssl-9.0.1 Predecessor: OTP 21.0.5 Check out the git tag OTP-21.0.6, 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. --------------------------------------------------------------------- --- crypto-4.3.2 ---------------------------------------------------- --------------------------------------------------------------------- The crypto-4.3.2 application can be applied independently of other applications on a full OTP 21 installation. --- Fixed Bugs and Malfunctions --- OTP-15233 Application(s): crypto Update the crypto engine functions to handle multiple loads of an engine. engine_load/3/4 is updated so it doesn't add the engine ID to OpenSSLs internal list of engines which makes it possible to run the engine_load more than once if it doesn't contain global data. Added ensure_engine_loaded/2/3 which guarantees that the engine just is loaded once and the following calls just returns a reference to it. This is done by add the ID to the internal OpenSSL list and check if it is already registered when the function is called. Added ensure_engine_unloaded/1/2 to unload engines loaded with ensure_engine_loaded. Then some more utility functions are added. engine_add/1, adds the engine to OpenSSL internal list engine_remove/1, remove the engine from OpenSSL internal list engine_get_id/1, fetch the engines id engine_get_name/1, fetch the engine name Full runtime dependencies of crypto-4.3.2: erts-9.0, kernel-5.3, stdlib-3.4 --------------------------------------------------------------------- --- inets-7.0.1 ----------------------------------------------------- --------------------------------------------------------------------- The inets-7.0.1 application can be applied independently of other applications on a full OTP 21 installation. --- Fixed Bugs and Malfunctions --- OTP-15215 Application(s): inets Change status code for no mod found to handle request to 501 Full runtime dependencies of inets-7.0.1: erts-6.0, kernel-3.0, mnesia-4.12, runtime_tools-1.8.14, ssl-5.3.4, stdlib-3.5 --------------------------------------------------------------------- --- ssl-9.0.1 ------------------------------------------------------- --------------------------------------------------------------------- The ssl-9.0.1 application can be applied independently of other applications on a full OTP 21 installation. --- Fixed Bugs and Malfunctions --- OTP-15203 Application(s): ssl Correct cipher suite handling for ECDHE_*, the incorrect handling could cause an incorrrect suite to be selected and most likly fail the handshake. Full runtime dependencies of ssl-9.0.1: crypto-4.2, erts-10.0, inets-5.10.7, kernel-6.0, public_key-1.5, stdlib-3.5 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.muller.erl@REDACTED Fri Aug 24 10:33:43 2018 From: frank.muller.erl@REDACTED (Frank Muller) Date: Fri, 24 Aug 2018 10:33:43 +0200 Subject: [erlang-questions] SSL and hardcoded DH prime In-Reply-To: References: Message-ID: No problem, thanks! Oh, shame on me, I forget that it's not a random number, it's random prime, > so, you are absolutely right, it's not so fast. Thanks. > > ??, 24 ???. 2018 ?. ? 10:48, Frank Muller : > >> It?s not about that. Generating a 2048 DH can take a long time. And you >> said it?s fast and you want to make it real time. >> >> From official ssl doc >>> http://erlang.org/doc/man/ssl.html >>> >>> *{dh, public_key:der_encoded()}* >>> >>> The DER-encoded Diffie-Hellman parameters. If specified, it overrides >>> option dhfile. >>> >>> ??, 24 ???. 2018 ?. ? 6:11, Frank Muller : >>> >>>> How? Show us please!!! >>>> >>>> No, I can use dh option in Erlang and generate in des format DH prime >>>>> and DH generator. It?s very fast. >>>>> >>>>> ??, 23 ???. 2018 ?. ? 22:07, Paul Peregud : >>>>> >>>>>> Its a long-ish process. But you can run it during installation or >>>>>> first run. >>>>>> >>>>>> $ time openssl dhparam -out dhparam.pem 2048 >>>>>> ... >>>>>> real 0m3,623s >>>>>> user 0m3,612s >>>>>> sys 0m0,000s >>>>>> >>>>>> >>>>>> >>>>>> On Thu, Aug 23, 2018 at 5:27 PM Alexander Petrovsky < >>>>>> askjuise@REDACTED> wrote: >>>>>> >>>>>>> Yeah, Ingela, thanks! About default value and dh, dhfile options I >>>>>>> know. The main question - is the any reasons don?t generate DH prime in >>>>>>> real-time? >>>>>>> >>>>>>> ??, 23 ???. 2018 ?. ? 20:12, Ingela Andin : >>>>>>> >>>>>>>> Hi! >>>>>>>> >>>>>>>> It is only the default value that is hard coded (a recommend >>>>>>>> value), you may configure your own parameters with dh or dhfile option. >>>>>>>> >>>>>>>> Regards Ingela >>>>>>>> >>>>>>>> Den tors 23 aug. 2018 kl 16:57 skrev Alexander Petrovsky < >>>>>>>> askjuise@REDACTED>: >>>>>>>> >>>>>>>>> Hello! >>>>>>>>> >>>>>>>>> We have stumble upon default DH prime (2048 bits) in Erlang when >>>>>>>>> we try to establish TLS session with cisco spa303 (VoIP hardphone) >>>>>>>>> via TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) cipher suite. Unfortunately, >>>>>>>>> this hardphone can work only with 1024 bit DH prime. >>>>>>>>> >>>>>>>>> I wonder, why Ingela hardcoded this DH prime - >>>>>>>>> https://github.com/erlang/otp/commit/3458af579af6600870c5ada69b81085f47e9f52b >>>>>>>>> >>>>>>>>> In my synthetical tests, new DH prime generation is fast enough >>>>>>>>> (crypto:strong_rand_bytes(256)), about 17 us in 99 percentile in 1000000 >>>>>>>>> iterations. >>>>>>>>> >>>>>>>>> Why Ingela has hardcoded this DH prime and is any reason why I >>>>>>>>> shouldn't generate DH prime in real-time? >>>>>>>>> >>>>>>>>> -- >>>>>>>>> ?????????? ????????? / Alexander Petrovsky, >>>>>>>>> >>>>>>>>> Skype: askjuise >>>>>>>>> Phone: +7 931 9877991 >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> erlang-questions mailing list >>>>>>>>> erlang-questions@REDACTED >>>>>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>>>>> >>>>>>>> -- >>>>>>> ?????????? ????????? / Alexander Petrovsky, >>>>>>> >>>>>>> Skype: askjuise >>>>>>> Phone: +7 931 9877991 >>>>>>> >>>>>>> _______________________________________________ >>>>>>> erlang-questions mailing list >>>>>>> erlang-questions@REDACTED >>>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Best regards, >>>>>> Paul Peregud >>>>>> +48602112091 >>>>>> >>>>> -- >>>>> ?????????? ????????? / Alexander Petrovsky, >>>>> >>>>> Skype: askjuise >>>>> Phone: +7 931 9877991 >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>>> -- >>> ?????????? ????????? / Alexander Petrovsky, >>> >>> Skype: askjuise >>> Phone: +7 931 9877991 >>> >>> > > -- > ?????????? ????????? / Alexander Petrovsky, > > Skype: askjuise > Phone: +7 931 9877991 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans.r.nilsson@REDACTED Fri Aug 24 10:41:14 2018 From: hans.r.nilsson@REDACTED (Hans Nilsson R) Date: Fri, 24 Aug 2018 10:41:14 +0200 Subject: [erlang-questions] SSL and hardcoded DH prime In-Reply-To: References: Message-ID: <1a6fa0a9-35d6-0b0b-0288-fa6d663f3720@ericsson.com> Hi! You can't just grab any prime and use it in DH. Any prime will work, but very few primes are safe to use. And to find a safe prime is a slow process... Only one out of 400000 1024-bits primes are safe according to https://security.stackexchange.com/questions/5263/where-do-i-get-prime-numbers-for-diffie-hellman-can-i-use-them-twice /Hans On 08/23/2018 04:57 PM, Alexander Petrovsky wrote: > Hello! > > We have stumble upon default DH prime (2048 bits) in Erlang when we try to > establish TLS session with cisco spa303 (VoIP hardphone) > via TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) cipher suite. Unfortunately, > this hardphone can work only with 1024 bit DH prime. > > I wonder, why Ingela hardcoded this DH prime - > https://github.com/erlang/otp/commit/3458af579af6600870c5ada69b81085f47e9f52b > > In my synthetical tests, new DH prime generation is fast enough > (crypto:strong_rand_bytes(256)), about 17 us in 99 percentile in 1000000 > iterations. > > Why Ingela has hardcoded this DH prime and is any reason why I shouldn't > generate DH prime in real-time? > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From askjuise@REDACTED Fri Aug 24 10:52:51 2018 From: askjuise@REDACTED (Alexander Petrovsky) Date: Fri, 24 Aug 2018 11:52:51 +0300 Subject: [erlang-questions] SSL and hardcoded DH prime In-Reply-To: <1a6fa0a9-35d6-0b0b-0288-fa6d663f3720@ericsson.com> References: <1a6fa0a9-35d6-0b0b-0288-fa6d663f3720@ericsson.com> Message-ID: Oh, thanks, I don't know about that, it's very helpful. ??, 24 ???. 2018 ?. ? 11:41, Hans Nilsson R : > Hi! > > You can't just grab any prime and use it in DH. Any prime will work, but > very > few primes are safe to use. And to find a safe prime is a slow process... > > Only one out of 400000 1024-bits primes are safe according to > > > https://security.stackexchange.com/questions/5263/where-do-i-get-prime-numbers-for-diffie-hellman-can-i-use-them-twice > > /Hans > > On 08/23/2018 04:57 PM, Alexander Petrovsky wrote: > > Hello! > > > > We have stumble upon default DH prime (2048 bits) in Erlang when we try > to > > establish TLS session with cisco spa303 (VoIP hardphone) > > via TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) cipher suite. > Unfortunately, > > this hardphone can work only with 1024 bit DH prime. > > > > I wonder, why Ingela hardcoded this DH prime - > > > https://github.com/erlang/otp/commit/3458af579af6600870c5ada69b81085f47e9f52b > > > > In my synthetical tests, new DH prime generation is fast enough > > (crypto:strong_rand_bytes(256)), about 17 us in 99 percentile in 1000000 > > iterations. > > > > Why Ingela has hardcoded this DH prime and is any reason why I shouldn't > > generate DH prime in real-time? > > > > > > > > _______________________________________________ > > 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 > -- ?????????? ????????? / Alexander Petrovsky, Skype: askjuise Phone: +7 931 9877991 -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans.r.nilsson@REDACTED Fri Aug 24 11:35:46 2018 From: hans.r.nilsson@REDACTED (Hans Nilsson R) Date: Fri, 24 Aug 2018 11:35:46 +0200 Subject: [erlang-questions] SSL and hardcoded DH prime In-Reply-To: References: <1a6fa0a9-35d6-0b0b-0288-fa6d663f3720@ericsson.com> Message-ID: <7971428a-4924-0ee0-44c6-c2657053c7ce@ericsson.com> Check the ssh-keygen command with -G and -T https://man.openbsd.org/ssh-keygen#MODULI_GENERATION or try the Erlang/OTP function public_key:dh_gex_group/4 which randomly selects a good prime from a pre-generated list of such: 1> public_key:dh_gex_group(1024, 1024, 1024, undefined). {ok,{1023, {5, 137423569441246262992289626302405506810075372518201635033473127540045433614984773406065519964899878780586235832348933590594300290793347611716697640359482924853366011641117770719027755146909495326369377183195861495553717174988136205384838926110458474346294939275424613035724229598089601829380531182016066518343}}} 2> public_key:dh_gex_group(1024, 1024, 1024, undefined). {ok,{1023, {2, 137423569441246262992289626302405506810075372518201635033473127540045433614984773406065519964899878780586235832348933590594300290793347611716697640359482924853366011641117770719027755146909495326369377183195861495553717174988136205384838926110458474346294939275424613035724229598089601829380531182016051761379}}} 3> /Hans On 08/24/2018 10:52 AM, Alexander Petrovsky wrote: > Oh, thanks, I don't know about that, it's very helpful. > > ??, 24 ???. 2018 ?. ? 11:41, Hans Nilsson R : > >> Hi! >> >> You can't just grab any prime and use it in DH. Any prime will work, but >> very >> few primes are safe to use. And to find a safe prime is a slow process... >> >> Only one out of 400000 1024-bits primes are safe according to >> >> >> https://security.stackexchange.com/questions/5263/where-do-i-get-prime-numbers-for-diffie-hellman-can-i-use-them-twice >> >> /Hans >> >> On 08/23/2018 04:57 PM, Alexander Petrovsky wrote: >>> Hello! >>> >>> We have stumble upon default DH prime (2048 bits) in Erlang when we try >> to >>> establish TLS session with cisco spa303 (VoIP hardphone) >>> via TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) cipher suite. >> Unfortunately, >>> this hardphone can work only with 1024 bit DH prime. >>> >>> I wonder, why Ingela hardcoded this DH prime - >>> >> https://github.com/erlang/otp/commit/3458af579af6600870c5ada69b81085f47e9f52b >>> >>> In my synthetical tests, new DH prime generation is fast enough >>> (crypto:strong_rand_bytes(256)), about 17 us in 99 percentile in 1000000 >>> iterations. >>> >>> Why Ingela has hardcoded this DH prime and is any reason why I shouldn't >>> generate DH prime in real-time? >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4161 bytes Desc: S/MIME Cryptographic Signature URL: From alex@REDACTED Sun Aug 26 08:38:41 2018 From: alex@REDACTED (alex@REDACTED) Date: Sun, 26 Aug 2018 02:38:41 -0400 Subject: [erlang-questions] discourse for erlang Message-ID: <881af76d82180c4780219b90b6f0a4ec@smtp.hushmail.com> Although I'm still very passionate about Erlang, lately I've been checking out Julia.? And one thing that called my attention recently is the fact they no longer use a mailing list.? They instead are using Discourse (https://discourse.julialang.org/) and seems to be pretty effective for their project.? Just saying! *Discourse vs Email & Mailing lists* https://meta.discourse.org/t/discourse-vs-email-mailing-lists/54298 -------------- next part -------------- An HTML attachment was scrubbed... URL: From v@REDACTED Sun Aug 26 09:22:51 2018 From: v@REDACTED (Valentin Micic) Date: Sun, 26 Aug 2018 09:22:51 +0200 Subject: [erlang-questions] Information on file:advise/4 Message-ID: Hi, Would it be possible for someone to shed a bit more light on various posix_file_advise() options in file:advise/4 function? For example, I could guess that 'will_need' may ask OS to buffer the file, whilst 'don't_need' may have an opposite effect. I could also guess that 'sequential' should instruct OS to provide for a larger working I/O buffer than in a case of 'random'. But what about 'no_resue' or 'normal'? Finally, it would be good to know when one should reference these functions? Immediately after opening the file, or when required. Thanks in advance. V/ From jesper.louis.andersen@REDACTED Sun Aug 26 14:44:30 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 26 Aug 2018 14:44:30 +0200 Subject: [erlang-questions] Information on file:advise/4 In-Reply-To: References: Message-ID: On Sun, Aug 26, 2018 at 9:23 AM Valentin Micic wrote: > Hi, > > Would it be possible for someone to shed a bit more light on various > posix_file_advise() options in file:advise/4 function? > > It binds to the posix_fadvise(2) call If I remember correctly. Thus, the actual behavior is dependent on your operating system. FreeBSD ignores SEQUENTIAL for instance, because its default semantics autodetects sequential access. FreeBSD can also handle a WILL_NEED by async loading that data. NetBSD ignores the offset and len in some cases and applies it to the whole file. OpenBSD doesn't support the call at all it seems. Illumos supports the call, but does so in libc, detects that the parameters are valid, and then does nothing with the information. This is compliant with the specification. In most cases, you want to carefully measure before toying with these interfaces. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Sun Aug 26 15:54:29 2018 From: t@REDACTED (Tristan Sloughter) Date: Sun, 26 Aug 2018 07:54:29 -0600 Subject: [erlang-questions] discourse for erlang In-Reply-To: <881af76d82180c4780219b90b6f0a4ec@smtp.hushmail.com> References: <881af76d82180c4780219b90b6f0a4ec@smtp.hushmail.com> Message-ID: <1535291669.2245035.1486543288.0A10C06C@webmail.messagingengine.com> I've been pushing this. Instead of having a custom built forum like erlangcentral used to have, just use discourse like every other language :). I also thought about setting it up myself and trying to get it adopted that way, but geez does it have a lot of moving parts.... But not going to divert this into a rant about Ruby on Rails projects... Anyway, I don't see it as a replacement for the mailing list, but a complement. Tristan -------------- next part -------------- An HTML attachment was scrubbed... URL: From drasko.draskovic@REDACTED Sun Aug 26 17:32:53 2018 From: drasko.draskovic@REDACTED (Drasko DRASKOVIC) Date: Sun, 26 Aug 2018 17:32:53 +0200 Subject: [erlang-questions] Problems with cowboy:start_clear() - undefined function Message-ID: Hi all, I am trying to run https://github.com/drasko/erlang-starter-kit and I am getting: Exec: /home/drasko/erlang/esk/_rel/esk_release/erts-9.3.3.3/bin/erlexec -boot /home/drasko/erlang/esk/_rel/esk_release/releases/1/esk_release -mode embedded -boot_var ERTS_LIB_DIR /home/drasko/erlang/esk/_rel/esk_release/lib -config /home/drasko/erlang/esk/_rel/esk_release/releases/1/sys.config -args_file /home/drasko/erlang/esk/_rel/esk_release/releases/1/vm.args -pa -- console Root: /home/drasko/erlang/esk/_rel/esk_release /home/drasko/erlang/esk/_rel/esk_release heart_beat_kill_pid = 3160 Erlang/OTP 20 [erts-9.3.3.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [kernel-poll:false] 17:23:46.517 [info] Application lager started on node 'esk@REDACTED' 17:23:46.517 [info] Application asn1 started on node 'esk@REDACTED' 17:23:46.518 [info] Application public_key started on node 'esk@REDACTED' 17:23:46.519 [info] Application ssl started on node 'esk@REDACTED' 17:23:46.519 [info] Application unicode_util_compat started on node 'esk@REDACTED' 17:23:46.519 [info] Application idna started on node 'esk@REDACTED' 17:23:46.519 [info] Application mimerl started on node 'esk@REDACTED' 17:23:46.520 [info] Application certifi started on node 'esk@REDACTED' 17:23:46.520 [info] Application ssl_verify_fun started on node 'esk@REDACTED' 17:23:46.520 [info] Application metrics started on node 'esk@REDACTED' 17:23:46.520 [info] Application hackney started on node 'esk@REDACTED' 17:23:46.521 [info] Application couchbeam started on node 'esk@REDACTED' 17:23:46.522 [error] CRASH REPORT Process <0.608.0> with 0 neighbours exited with reason: call to undefined function cowboy:start_clear(esk_cowboy, [{ip,{0,0,0,0}},{port,8089}], #{env => #{dispatch => [{'_',[],[{[<<"status">>],[],esk_status,[]},{[<<"user">>],[],esk_user,...},...]}]}}) in application_master:init/4 line 134 17:23:46.522 [info] Application esk exited with reason: call to undefined function cowboy:start_clear(esk_cowboy, [{ip,{0,0,0,0}},{port,8089}], #{env => #{dispatch => [{'_',[],[{[<<"status">>],[],esk_status,[]},{[<<"user">>],[],esk_user,...},...]}]}}) {"Kernel pid terminated",application_controller,"{application_start_failure,esk,{bad_return,{{esk_app,start,[normal,[]]},{'EXIT',{undef,[{cowboy,start_clear,[esk_cowboy,[{ip,{0,0,0,0}},{port,8089}],#{env => #{dispatch => [{'_',[],[{[<<\"status\">>],[],esk_status,[]},{[<<\"user\">>],[],esk_user,[]},{[<<\"login\">>],[],esk_login,[]}]}]}}],[]},{esk_app,start,2,[{file,\"src/esk_app.erl\"},{line,32}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,273}]}]}}}}}"} Kernel pid terminated (application_controller) ({application_start_failure,esk,{bad_return,{{esk_app,start,[normal,[]]},{'EXIT',{undef,[{cowboy,start_clear,[esk_cowboy,[{ip,{0,0,0,0}},{port,8089}],#{e heart: Sun Aug 26 17:23:48 2018: Erlang is crashing .. (waiting for crash dump file) heart: Sun Aug 26 17:23:48 2018: Would reboot. Terminating. make: *** [erlang.mk:6782: run] Error 1 Any idea why this is happening? I am running Debian Buster with Erlang/OTP 20. BR, Drasko From rtrlists@REDACTED Sun Aug 26 19:12:44 2018 From: rtrlists@REDACTED (Robert Raschke) Date: Sun, 26 Aug 2018 19:12:44 +0200 Subject: [erlang-questions] Problems with cowboy:start_clear() - undefined function In-Reply-To: References: Message-ID: Looks like the cowboy v2 dependency hasn't been fetched properly. Could either be that cowboy as a whole isn't there, or that v1 was retrieved for some reason. On 26 Aug 2018 16:33, "Drasko DRASKOVIC" wrote: > Hi all, > I am trying to run https://github.com/drasko/erlang-starter-kit and I > am getting: > > Exec: /home/drasko/erlang/esk/_rel/esk_release/erts-9.3.3.3/bin/erlexec > -boot /home/drasko/erlang/esk/_rel/esk_release/releases/1/esk_release > -mode embedded -boot_var ERTS_LIB_DIR > /home/drasko/erlang/esk/_rel/esk_release/lib -config > /home/drasko/erlang/esk/_rel/esk_release/releases/1/sys.config > -args_file /home/drasko/erlang/esk/_rel/esk_release/releases/1/vm.args > -pa -- console > Root: /home/drasko/erlang/esk/_rel/esk_release > /home/drasko/erlang/esk/_rel/esk_release > heart_beat_kill_pid = 3160 > Erlang/OTP 20 [erts-9.3.3.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] > [async-threads:10] [kernel-poll:false] > > 17:23:46.517 [info] Application lager started on node 'esk@REDACTED' > 17:23:46.517 [info] Application asn1 started on node 'esk@REDACTED' > 17:23:46.518 [info] Application public_key started on node 'esk@REDACTED' > 17:23:46.519 [info] Application ssl started on node 'esk@REDACTED' > 17:23:46.519 [info] Application unicode_util_compat started on node > 'esk@REDACTED' > 17:23:46.519 [info] Application idna started on node 'esk@REDACTED' > 17:23:46.519 [info] Application mimerl started on node 'esk@REDACTED' > 17:23:46.520 [info] Application certifi started on node 'esk@REDACTED' > 17:23:46.520 [info] Application ssl_verify_fun started on node ' > esk@REDACTED' > 17:23:46.520 [info] Application metrics started on node 'esk@REDACTED' > 17:23:46.520 [info] Application hackney started on node 'esk@REDACTED' > 17:23:46.521 [info] Application couchbeam started on node 'esk@REDACTED' > 17:23:46.522 [error] CRASH REPORT Process <0.608.0> with 0 neighbours > exited with reason: call to undefined function > cowboy:start_clear(esk_cowboy, [{ip,{0,0,0,0}},{port,8089}], #{env => > #{dispatch => [{'_',[],[{[<<"status">>],[],esk_status,[]},{[<<"user">>],[ > ],esk_user,...},...]}]}}) > in application_master:init/4 line 134 > 17:23:46.522 [info] Application esk exited with reason: call to > undefined function cowboy:start_clear(esk_cowboy, > [{ip,{0,0,0,0}},{port,8089}], #{env => #{dispatch => > [{'_',[],[{[<<"status">>],[],esk_status,[]},{[<<"user">>],[ > ],esk_user,...},...]}]}}) > {"Kernel pid terminated",application_controller,"{application_ > start_failure,esk,{bad_return,{{esk_app,start,[normal,[]]},{ > 'EXIT',{undef,[{cowboy,start_clear,[esk_cowboy,[{ip,{0,0,0, > 0}},{port,8089}],#{env > => #{dispatch => > [{'_',[],[{[<<\"status\">>],[],esk_status,[]},{[<<\"user\">> > ],[],esk_user,[]},{[<<\"login\">>],[],esk_login,[]}]}]}}],[] > },{esk_app,start,2,[{file,\"src/esk_app.erl\"},{line,32}]} > ,{application_master,start_it_old,4,[{file,\"application_ > master.erl\"},{line,273}]}]}}}}}"} > Kernel pid terminated (application_controller) > ({application_start_failure,esk,{bad_return,{{esk_app, > start,[normal,[]]},{'EXIT',{undef,[{cowboy,start_clear,[ > esk_cowboy,[{ip,{0,0,0,0}},{port,8089}],#{e > heart: Sun Aug 26 17:23:48 2018: Erlang is crashing .. (waiting for > crash dump file) > heart: Sun Aug 26 17:23:48 2018: Would reboot. Terminating. > make: *** [erlang.mk:6782: run] Error 1 > > Any idea why this is happening? > > I am running Debian Buster with Erlang/OTP 20. > > BR, > Drasko > _______________________________________________ > 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 Sun Aug 26 19:49:15 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Sun, 26 Aug 2018 19:49:15 +0200 Subject: [erlang-questions] Problems with cowboy:start_clear() - undefined function In-Reply-To: References: Message-ID: You need to add this to your Makefile: dep_cowboy_commit = master See https://ninenines.eu/docs/en/cowboy/2.4/guide/getting_started/ If you really wanted Cowboy 1.x then you're reading the wrong docs. On 08/26/2018 05:32 PM, Drasko DRASKOVIC wrote: > Hi all, > I am trying to run https://github.com/drasko/erlang-starter-kit and I > am getting: > > Exec: /home/drasko/erlang/esk/_rel/esk_release/erts-9.3.3.3/bin/erlexec > -boot /home/drasko/erlang/esk/_rel/esk_release/releases/1/esk_release > -mode embedded -boot_var ERTS_LIB_DIR > /home/drasko/erlang/esk/_rel/esk_release/lib -config > /home/drasko/erlang/esk/_rel/esk_release/releases/1/sys.config > -args_file /home/drasko/erlang/esk/_rel/esk_release/releases/1/vm.args > -pa -- console > Root: /home/drasko/erlang/esk/_rel/esk_release > /home/drasko/erlang/esk/_rel/esk_release > heart_beat_kill_pid = 3160 > Erlang/OTP 20 [erts-9.3.3.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] > [async-threads:10] [kernel-poll:false] > > 17:23:46.517 [info] Application lager started on node 'esk@REDACTED' > 17:23:46.517 [info] Application asn1 started on node 'esk@REDACTED' > 17:23:46.518 [info] Application public_key started on node 'esk@REDACTED' > 17:23:46.519 [info] Application ssl started on node 'esk@REDACTED' > 17:23:46.519 [info] Application unicode_util_compat started on node > 'esk@REDACTED' > 17:23:46.519 [info] Application idna started on node 'esk@REDACTED' > 17:23:46.519 [info] Application mimerl started on node 'esk@REDACTED' > 17:23:46.520 [info] Application certifi started on node 'esk@REDACTED' > 17:23:46.520 [info] Application ssl_verify_fun started on node 'esk@REDACTED' > 17:23:46.520 [info] Application metrics started on node 'esk@REDACTED' > 17:23:46.520 [info] Application hackney started on node 'esk@REDACTED' > 17:23:46.521 [info] Application couchbeam started on node 'esk@REDACTED' > 17:23:46.522 [error] CRASH REPORT Process <0.608.0> with 0 neighbours > exited with reason: call to undefined function > cowboy:start_clear(esk_cowboy, [{ip,{0,0,0,0}},{port,8089}], #{env => > #{dispatch => [{'_',[],[{[<<"status">>],[],esk_status,[]},{[<<"user">>],[],esk_user,...},...]}]}}) > in application_master:init/4 line 134 > 17:23:46.522 [info] Application esk exited with reason: call to > undefined function cowboy:start_clear(esk_cowboy, > [{ip,{0,0,0,0}},{port,8089}], #{env => #{dispatch => > [{'_',[],[{[<<"status">>],[],esk_status,[]},{[<<"user">>],[],esk_user,...},...]}]}}) > {"Kernel pid terminated",application_controller,"{application_start_failure,esk,{bad_return,{{esk_app,start,[normal,[]]},{'EXIT',{undef,[{cowboy,start_clear,[esk_cowboy,[{ip,{0,0,0,0}},{port,8089}],#{env > => #{dispatch => > [{'_',[],[{[<<\"status\">>],[],esk_status,[]},{[<<\"user\">>],[],esk_user,[]},{[<<\"login\">>],[],esk_login,[]}]}]}}],[]},{esk_app,start,2,[{file,\"src/esk_app.erl\"},{line,32}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,273}]}]}}}}}"} > Kernel pid terminated (application_controller) > ({application_start_failure,esk,{bad_return,{{esk_app,start,[normal,[]]},{'EXIT',{undef,[{cowboy,start_clear,[esk_cowboy,[{ip,{0,0,0,0}},{port,8089}],#{e > heart: Sun Aug 26 17:23:48 2018: Erlang is crashing .. (waiting for > crash dump file) > heart: Sun Aug 26 17:23:48 2018: Would reboot. Terminating. > make: *** [erlang.mk:6782: run] Error 1 > > Any idea why this is happening? > > I am running Debian Buster with Erlang/OTP 20. > > BR, > Drasko > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin https://ninenines.eu From essen@REDACTED Sun Aug 26 19:50:35 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Sun, 26 Aug 2018 19:50:35 +0200 Subject: [erlang-questions] Problems with cowboy:start_clear() - undefined function In-Reply-To: References: Message-ID: Correcting, should be: dep_cowboy_commit = 2.4.0 Don't use master directly unless you know what you're doing. Sorry for double post, shouldn't post on Sunday... On 08/26/2018 07:49 PM, Lo?c Hoguin wrote: > You need to add this to your Makefile: > > dep_cowboy_commit = master > > See https://ninenines.eu/docs/en/cowboy/2.4/guide/getting_started/ > > If you really wanted Cowboy 1.x then you're reading the wrong docs. > > On 08/26/2018 05:32 PM, Drasko DRASKOVIC wrote: >> Hi all, >> I am trying to run https://github.com/drasko/erlang-starter-kit and I >> am getting: >> >> Exec: /home/drasko/erlang/esk/_rel/esk_release/erts-9.3.3.3/bin/erlexec >> -boot /home/drasko/erlang/esk/_rel/esk_release/releases/1/esk_release >> -mode embedded -boot_var ERTS_LIB_DIR >> /home/drasko/erlang/esk/_rel/esk_release/lib -config >> /home/drasko/erlang/esk/_rel/esk_release/releases/1/sys.config >> -args_file /home/drasko/erlang/esk/_rel/esk_release/releases/1/vm.args >> -pa -- console >> Root: /home/drasko/erlang/esk/_rel/esk_release >> /home/drasko/erlang/esk/_rel/esk_release >> heart_beat_kill_pid = 3160 >> Erlang/OTP 20 [erts-9.3.3.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] >> [async-threads:10] [kernel-poll:false] >> >> 17:23:46.517 [info] Application lager started on node 'esk@REDACTED' >> 17:23:46.517 [info] Application asn1 started on node 'esk@REDACTED' >> 17:23:46.518 [info] Application public_key started on node >> 'esk@REDACTED' >> 17:23:46.519 [info] Application ssl started on node 'esk@REDACTED' >> 17:23:46.519 [info] Application unicode_util_compat started on node >> 'esk@REDACTED' >> 17:23:46.519 [info] Application idna started on node 'esk@REDACTED' >> 17:23:46.519 [info] Application mimerl started on node 'esk@REDACTED' >> 17:23:46.520 [info] Application certifi started on node 'esk@REDACTED' >> 17:23:46.520 [info] Application ssl_verify_fun started on node >> 'esk@REDACTED' >> 17:23:46.520 [info] Application metrics started on node 'esk@REDACTED' >> 17:23:46.520 [info] Application hackney started on node 'esk@REDACTED' >> 17:23:46.521 [info] Application couchbeam started on node 'esk@REDACTED' >> 17:23:46.522 [error] CRASH REPORT Process <0.608.0> with 0 neighbours >> exited with reason: call to undefined function >> cowboy:start_clear(esk_cowboy, [{ip,{0,0,0,0}},{port,8089}], #{env => >> #{dispatch => >> [{'_',[],[{[<<"status">>],[],esk_status,[]},{[<<"user">>],[],esk_user,...},...]}]}}) >> >> in application_master:init/4 line 134 >> 17:23:46.522 [info] Application esk exited with reason: call to >> undefined function cowboy:start_clear(esk_cowboy, >> [{ip,{0,0,0,0}},{port,8089}], #{env => #{dispatch => >> [{'_',[],[{[<<"status">>],[],esk_status,[]},{[<<"user">>],[],esk_user,...},...]}]}}) >> >> {"Kernel pid >> terminated",application_controller,"{application_start_failure,esk,{bad_return,{{esk_app,start,[normal,[]]},{'EXIT',{undef,[{cowboy,start_clear,[esk_cowboy,[{ip,{0,0,0,0}},{port,8089}],#{env >> >> => #{dispatch => >> [{'_',[],[{[<<\"status\">>],[],esk_status,[]},{[<<\"user\">>],[],esk_user,[]},{[<<\"login\">>],[],esk_login,[]}]}]}}],[]},{esk_app,start,2,[{file,\"src/esk_app.erl\"},{line,32}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,273}]}]}}}}}"} >> >> Kernel pid terminated (application_controller) >> ({application_start_failure,esk,{bad_return,{{esk_app,start,[normal,[]]},{'EXIT',{undef,[{cowboy,start_clear,[esk_cowboy,[{ip,{0,0,0,0}},{port,8089}],#{e >> >> heart: Sun Aug 26 17:23:48 2018: Erlang is crashing .. (waiting for >> crash dump file) >> heart: Sun Aug 26 17:23:48 2018: Would reboot. Terminating. >> make: *** [erlang.mk:6782: run] Error 1 >> >> Any idea why this is happening? >> >> I am running Debian Buster with Erlang/OTP 20. >> >> BR, >> Drasko >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -- Lo?c Hoguin https://ninenines.eu From drasko.draskovic@REDACTED Sun Aug 26 20:47:33 2018 From: drasko.draskovic@REDACTED (Drasko DRASKOVIC) Date: Sun, 26 Aug 2018 20:47:33 +0200 Subject: [erlang-questions] Problems with cowboy:start_clear() - undefined function In-Reply-To: References: Message-ID: Hi Loic, On Sun, Aug 26, 2018 at 7:50 PM Lo?c Hoguin wrote: > > Correcting, should be: > > dep_cowboy_commit = 2.4.0 > > Don't use master directly unless you know what you're doing. Works like a charm. Thanks a lot! BR, Drasko From alex@REDACTED Sun Aug 26 20:57:37 2018 From: alex@REDACTED (alex@REDACTED) Date: Sun, 26 Aug 2018 14:57:37 -0400 Subject: [erlang-questions] discourse for erlang In-Reply-To: <1535291669.2245035.1486543288.0A10C06C@webmail.messagingengine.com> References: <881af76d82180c4780219b90b6f0a4ec@smtp.hushmail.com> <1535291669.2245035.1486543288.0A10C06C@webmail.messagingengine.com> Message-ID: <6c26b77164a8c23b583a1b98a01fd228@smtp.hushmail.com> No doubt that each medium has its pluses and minuses, and I do like email+mail lists in general.? But when you have a lot of content, you want to openly show what's going on and want to bring more people in, for some projects mail lists alone are probably too obscure and thus less helpful.? The ability to show not only communication between users and developers, but also other items in a single front page, like related conferences, projects, research, products, services, etc., can be quite nice.? And the fact that Discourse has been successfully tested + deployed by a number of comparable projects is also a plus.? Just saying!? ;0) On 8/26/18 9:54 AM, Tristan Sloughter wrote: > I've been pushing this. Instead of having a custom built forum like > erlangcentral used to have, just use discourse like every other > language :). I also thought about setting it up myself and trying to > get it adopted that way, but geez does it have a lot of moving > parts.... But not going to divert this into a rant about Ruby on Rails > projects... > > Anyway, I don't see it as a replacement for the mailing list, but a > complement. > > Tristan > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From jrh53@REDACTED Sun Aug 26 22:18:17 2018 From: jrh53@REDACTED (Joe Harrison) Date: Sun, 26 Aug 2018 21:18:17 +0100 Subject: [erlang-questions] discourse for erlang In-Reply-To: <1535291669.2245035.1486543288.0A10C06C@webmail.messagingengine.com> References: <881af76d82180c4780219b90b6f0a4ec@smtp.hushmail.com> <1535291669.2245035.1486543288.0A10C06C@webmail.messagingengine.com> Message-ID: On 26/08/18 14:54, Tristan Sloughter wrote: > I've been pushing this. Instead of having a custom built forum like > erlangcentral used to have, just use discourse like every other language > :). I also thought about setting it up myself and trying to get it > adopted that way, but geez does it have a lot of moving parts.... But > not going to divert this into a rant about Ruby on Rails projects... Let me take the bait, then: "The only officially supported installs of Discourse are Docker based." I find this sad, and the reasoning even more tragic: https://github.com/discourse/discourse/blob/master/docs/INSTALL.md#why-do-you-only-officially-support-docker Several people (i.e. myself) may consider such complexity of forum software to be criminal. I may have dropped the DMARC bomb earlier (which is enough of a burden), but I think that asking Raimo or anyone else to host Discourse counts as cruel and unusual punishment. -- On a more positive note, I find the mailing list archives to be a great way to judge the "size" or popularity of discussions here. I can quickly see names, topics, and the length of threads. If I want to search, my mail client does a "good enough" job. - Joe From v@REDACTED Sun Aug 26 23:08:09 2018 From: v@REDACTED (Valentin Micic) Date: Sun, 26 Aug 2018 23:08:09 +0200 Subject: [erlang-questions] Information on file:advise/4 In-Reply-To: References: Message-ID: <5403150F-7CB3-4259-B52A-51885758C2A1@pharos-corp.com> On 26 Aug 2018, at 2:44 PM, Jesper Louis Andersen wrote: > It binds to the posix_fadvise(2) call If I remember correctly Thanks Jasper, much appreciated. V/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Sun Aug 26 23:22:17 2018 From: mjtruog@REDACTED (Michael Truog) Date: Sun, 26 Aug 2018 14:22:17 -0700 Subject: [erlang-questions] discourse for erlang In-Reply-To: References: <881af76d82180c4780219b90b6f0a4ec@smtp.hushmail.com> <1535291669.2245035.1486543288.0A10C06C@webmail.messagingengine.com> Message-ID: On 08/26/2018 01:18 PM, Joe Harrison wrote: > On 26/08/18 14:54, Tristan Sloughter wrote: >> I've been pushing this. Instead of having a custom built forum like >> erlangcentral used to have, just use discourse like every other language >> :). I also thought about setting it up myself and trying to get it >> adopted that way, but geez does it have a lot of moving parts.... But >> not going to divert this into a rant about Ruby on Rails projects... > Let me take the bait, then: > > "The only officially supported installs of Discourse are Docker based." > > I find this sad, and the reasoning even more tragic: > > https://github.com/discourse/discourse/blob/master/docs/INSTALL.md#why-do-you-only-officially-support-docker > > Several people (i.e. myself) may consider such complexity of forum > software to be criminal. > > I may have dropped the DMARC bomb earlier (which is enough of a burden), > but I think that asking Raimo or anyone else to host Discourse counts as > cruel and unusual punishment. > > -- > > On a more positive note, I find the mailing list archives to be a great > way to judge the "size" or popularity of discussions here. I can quickly > see names, topics, and the length of threads. If I want to search, my > mail client does a "good enough" job. > > - Joe > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > I agree that email provides valuable discussion and the email information has remained accessible for long period of time.? The accessibility of email is likely due to its reliance on published standards and the amount of software facilitating email. In comparison, Discourse is a single small open-source project that favors Docker, making it similar to a corporate walled-garden that is not interested in preserving its data for years as Discourse source code changes.? If a Discourse interface was as ubiquitous as email, then it may be advantageous to use, but that would be a very different situation.? Lets wait until Discourse replaces email in popularity. Best Regards, Michael From michael.nisi@REDACTED Mon Aug 27 08:03:57 2018 From: michael.nisi@REDACTED (Michael Nisi) Date: Mon, 27 Aug 2018 08:03:57 +0200 Subject: [erlang-questions] discourse for erlang In-Reply-To: References: <881af76d82180c4780219b90b6f0a4ec@smtp.hushmail.com> <1535291669.2245035.1486543288.0A10C06C@webmail.messagingengine.com> Message-ID: As Swift and JavaScript user, let me state, this mailing list is unique?world cultural heritage. Let?s keep it forever. >> On 26/08/18 14:54, Tristan Sloughter wrote: >>> >>> erlangcentral used to have, just use discourse like every other language From raimo+erlang-questions@REDACTED Mon Aug 27 12:18:23 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Mon, 27 Aug 2018 12:18:23 +0200 Subject: [erlang-questions] discourse for erlang In-Reply-To: References: <881af76d82180c4780219b90b6f0a4ec@smtp.hushmail.com> <1535291669.2245035.1486543288.0A10C06C@webmail.messagingengine.com> Message-ID: <20180827101823.GA26118@erix.ericsson.se> On Sun, Aug 26, 2018 at 09:18:17PM +0100, Joe Harrison wrote: : > Several people (i.e. myself) may consider such complexity of forum > software to be criminal. > > I may have dropped the DMARC bomb earlier (which is enough of a burden), > but I think that asking Raimo or anyone else to host Discourse counts as > cruel and unusual punishment. > :-) I actually had a look at Mailman3 and thought _that_ was too cumbersome to install and maintain... -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From peterdmv@REDACTED Tue Aug 28 16:12:11 2018 From: peterdmv@REDACTED (Peter Dimitrov) Date: Tue, 28 Aug 2018 16:12:11 +0200 Subject: [erlang-questions] Patch package OTP 20.3.8.8 released Message-ID: <20180828141211.GA86194@duper.otp.ericsson.se> Patch Package: OTP 20.3.8.8 Git Tag: OTP-20.3.8.8 Date: 2018-08-28 Trouble Report Id: OTP-15241, OTP-15242 Seq num: System: OTP Release: 20 Application: inets-6.5.2.4 Predecessor: OTP 20.3.8.7 Check out the git tag OTP-20.3.8.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. --------------------------------------------------------------------- --- inets-6.5.2.4 --------------------------------------------------- --------------------------------------------------------------------- The inets-6.5.2.4 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-15241 Application(s): inets Do not use chunked-encoding with 1xx, 204 and 304 responses when using mod_esi. Old behavior was not compliant with HTTP/1.1 RFC and could cause clients to hang when they received 1xx, 204 or 304 responses that included an empty chunked-encoded body. OTP-15242 Application(s): inets Add robust handling of chunked-encoded HTTP responses with an empty body (1xx, 204, 304). Old behavior could cause the client to hang when connecting to a faulty server implementation. Full runtime dependencies of inets-6.5.2.4: erts-6.0, kernel-3.0, mnesia-4.12, runtime_tools-1.8.14, ssl-5.3.4, stdlib-2.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From fedotov.danil@REDACTED Tue Aug 28 17:33:08 2018 From: fedotov.danil@REDACTED (Daniil Fedotov) Date: Tue, 28 Aug 2018 16:33:08 +0100 Subject: [erlang-questions] Mnesia activity API future. Message-ID: Hi, In RabbitMQ team we are currently investigating possibilities of improving our use of mnesia by replacing the clustering bit and the native mnesia transactions with a custom mnesia_access module. This is in order to improve partition handling in RabbitMQ, which have been a long standing issue. The `mnesia:activity` API will be the main integration part of this change. As the RabbitMQ team will have to support this solution for years, we would like to be sure that it will not be deprecated or changed significantly in the future mnesia versions. So the question is foes Erlang OTP team have any plans for changing, removing or deprecating the API and will the mnesia_access behaviour be made a proper behaviour to keep the API callbacks in check? Thanks. Daniil Fedotov, RabbitMQ team. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kuna.prime@REDACTED Tue Aug 28 22:34:18 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Tue, 28 Aug 2018 22:34:18 +0200 Subject: [erlang-questions] constructing function with merl Message-ID: i'm trying to construct simple function using merl, and documentation states taht any metavariable ending with @ character will be automatically represented as abstrast syntax but when i'm trying to do this: 1> merl:show(merl:qquote("f(#'@R@'{ _@REDACTED@ = ok }) -> ok.", [{'R', rec}, {'A', field}])). function: f(#'@R@'{...}) -> ok. atom: f + clause: (#'@R@'{'@A@' = ok}) -> ok record_expr: #'@R@'{'@A@' = ok} atom: '@R@' + record_field: '@A@' = ok atom: '@A@' + atom: ok + atom: ok this is not what i expect. I would expect this instead: function: f(#rec{...}) -> ok. atom: f + clause: (#rec{field = ok}) -> ok record_expr: #rec{field = ok} atom: rec + record_field: field = ok atom: field + atom: ok + atom: ok which is what i get if i call: 2> merl:show(merl:qquote("f(#'@R'{ _@REDACTED = ok }) -> ok.", [{'R', erl_syntax:abstract(rec)}, {'A', erl_syntax:abstract(field)}])). what am i missing?? to clarify: i expect both calls to produce the same thing thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From dgud@REDACTED Wed Aug 29 07:50:31 2018 From: dgud@REDACTED (Dan Gudmundsson) Date: Wed, 29 Aug 2018 07:50:31 +0200 Subject: [erlang-questions] Mnesia activity API future. In-Reply-To: References: Message-ID: On Tue, Aug 28, 2018 at 6:12 PM Daniil Fedotov wrote: > > Hi, > > In RabbitMQ team we are currently investigating possibilities of improving > our use of mnesia by replacing the clustering bit and the native mnesia > transactions with a custom mnesia_access module. > This is in order to improve partition handling in RabbitMQ, which have > been a long standing issue. > The `mnesia:activity` API will be the main integration part of this change. > > As the RabbitMQ team will have to support this solution for years, we > would like to be sure that it will not be deprecated or changed > significantly in the future mnesia versions. > > So the question is foes Erlang OTP team have any plans for changing, > removing or deprecating the API and will the mnesia_access behaviour be > made a proper behaviour to keep the API callbacks in check? > mnesia_access behaviour is seen as an official API, so that should be a stable API. Of course any API can change, so that users of it might need to do changes, but it's been stable for many moons now and I see nothing right now that will change the API. On the other hand is there anything out there outside of mnesia_frag that uses it? Your "new" usage might find bugs in API which might force us to change that. A new behaviour will probably not be prioritized by us, if you want/require that do a PR including tests and documentation. /Dan > Thanks. > > Daniil Fedotov, > RabbitMQ team. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartek@REDACTED Wed Aug 29 11:18:45 2018 From: bartek@REDACTED (=?UTF-8?B?QmFydMWCb21pZWogR8Ozcm55?=) Date: Wed, 29 Aug 2018 11:18:45 +0200 Subject: [erlang-questions] env with erlang version number - rebar3, maybe? Message-ID: <74fa503e-f9e7-f631-355c-f3a3aa1ef139@gorny.edu.pl> Hello Is it possible to automatically set an env variable with erlang version number, to solve that notorious deprecaction vs backward compatibility problem? Rebar3 "knows" major release number (since it supports "require_otp_vsn" clause), is there a way to set it in the environment? BG -- m??czyzna potrzebuje dw?ch narz?dzi - ta?my klej?cej i WD40. co si? rusza, a nie powinno sklei? ta?m?, a co si? nie rusza, a powinno - spryska? WD40. (mafodope, bash.org.pl) From gomoripeti@REDACTED Wed Aug 29 13:02:10 2018 From: gomoripeti@REDACTED (=?UTF-8?B?UGV0aSBHw7Ztw7ZyaQ==?=) Date: Wed, 29 Aug 2018 13:02:10 +0200 Subject: [erlang-questions] env with erlang version number - rebar3, maybe? In-Reply-To: <74fa503e-f9e7-f631-355c-f3a3aa1ef139@gorny.edu.pl> References: <74fa503e-f9e7-f631-355c-f3a3aa1ef139@gorny.edu.pl> Message-ID: hello, since OTP 21 there is a predefined macro OTP_RELEASE that even the Erlang compiler knows (so not rebar3 specific), see http://erlang.org/doc/reference_manual/macros.html#predefined-macros On Wed, Aug 29, 2018 at 11:18 AM, Bart?omiej G?rny wrote: > Hello > > Is it possible to automatically set an env variable with erlang version > number, to solve that notorious deprecaction vs backward compatibility > problem? Rebar3 "knows" major release number (since it supports > "require_otp_vsn" clause), is there a way to set it in the environment? > > BG > > > -- > m??czyzna potrzebuje dw?ch narz?dzi - ta?my klej?cej i WD40. co si? rusza, > a nie powinno sklei? ta?m?, a co si? nie rusza, a powinno - spryska? WD40. > > (mafodope, bash.org.pl) > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From khaelin@REDACTED Wed Aug 29 18:01:45 2018 From: khaelin@REDACTED (Nicolas Martyanoff) Date: Wed, 29 Aug 2018 18:01:45 +0200 Subject: [erlang-questions] proper way to use the new logger Message-ID: <20180829160145.GA1867@valhala> Hi, I have been trying to use the new logger application, and I am not sure about the way I am supposed to configure it for my needs (keep in mind that I am an Erlang beginner, hoping to use Erlang in production someday). During development of a "library", i.e. an OTP application used by the program I am working on, I need to see all logs related to the modules which are part of the OTP application. However I cannot see how to set the log level to `debug` for these modules only (and not globally with `{logger_level, debug}`). Ideally, there would be a way to configure it in a local sys.config to get this effect only during development, without having to do it programmatically in every module I work on. More importantly, I can't seem to find a way to include the name of the module in log messages, either in the formatter template or anywhere else. Am I supposed to add it manually to every single logger message I write ? I am just trying to find a simple way to add log instructions to the code I write, with the possibility to control which ones are printed depending on the environment (local library development, application development, tests, production...) using settings in sys.config. Thank you in advance. -- Nicolas Martyanoff http://snowsyn.net khaelin@REDACTED From codewiget95@REDACTED Wed Aug 29 19:46:07 2018 From: codewiget95@REDACTED (Code Wiget) Date: Wed, 29 Aug 2018 13:46:07 -0400 Subject: [erlang-questions] Separating Functionality Message-ID: <92429a25-7af2-4653-9af3-6fbe89d41ff8@Spark> Hi everyone, With many programming languages, it is easy to think of ways to separate projects into distinct micro services. With Erlang, I'm having trouble deciding on how to spread out functionality. Because the Erlang VM can run multiple different fully independent applications, it seems tedious to spin up 5 different Erlang VM?s to do different things when it could all be accomplished on one. At the same time, as you scale, you probably want to separate functionality? So, do you have a rule of thumb or rules by which you decide on how to separate functionalities into modules vs applications vs entire releases? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From rtrlists@REDACTED Wed Aug 29 21:50:14 2018 From: rtrlists@REDACTED (Robert Raschke) Date: Wed, 29 Aug 2018 21:50:14 +0200 Subject: [erlang-questions] Separating Functionality In-Reply-To: <92429a25-7af2-4653-9af3-6fbe89d41ff8@Spark> References: <92429a25-7af2-4653-9af3-6fbe89d41ff8@Spark> Message-ID: The main equivalent of a microservice is what Erlang calls an "application". This is an entity that you are supposed to be able to start, stop and up/downgrade as a thing in its own right. And it may depend on other "applications", in turn it may be depended upon, or it can be independent or even just a stateless library. Multiple "applications" make up your system, called a "release" in Erlang. Whether your "applications" are distributed across multiple nodes or not is up to you. On Wed, 29 Aug 2018 19:50 Code Wiget, wrote: > Hi everyone, > > With many programming languages, it is easy to think of ways to separate > projects into distinct micro services. With Erlang, I'm having trouble > deciding on how to spread out functionality. Because the Erlang VM can run > multiple different fully independent applications, it seems tedious to spin > up 5 different Erlang VM?s to do different things when it could all be > accomplished on one. > > At the same time, as you scale, you probably want to separate > functionality? > > So, do you have a rule of thumb or rules by which you decide on how to > separate functionalities into modules vs applications vs entire releases? > > Thanks! > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rtrlists@REDACTED Wed Aug 29 22:00:40 2018 From: rtrlists@REDACTED (Robert Raschke) Date: Wed, 29 Aug 2018 22:00:40 +0200 Subject: [erlang-questions] Separating Functionality In-Reply-To: References: <92429a25-7af2-4653-9af3-6fbe89d41ff8@Spark> Message-ID: Further, a "module" is a code organisational thing, "applications" and similar OTP entities, like "supervisor", "gen_server "or "gen_statem", are runtime things. Thus, an "application" is made up of a bunch of "modules" that implement either libraries of functions and/or processes that that do stateful work (usually implemented using "gen_..." frameworks). On Wed, 29 Aug 2018 21:50 Robert Raschke, wrote: > The main equivalent of a microservice is what Erlang calls an > "application". This is an entity that you are supposed to be able to start, > stop and up/downgrade as a thing in its own right. And it may depend on > other "applications", in turn it may be depended upon, or it can be > independent or even just a stateless library. > > Multiple "applications" make up your system, called a "release" in Erlang. > Whether your "applications" are distributed across multiple nodes or not is > up to you. > > On Wed, 29 Aug 2018 19:50 Code Wiget, wrote: > >> Hi everyone, >> >> With many programming languages, it is easy to think of ways to separate >> projects into distinct micro services. With Erlang, I'm having trouble >> deciding on how to spread out functionality. Because the Erlang VM can run >> multiple different fully independent applications, it seems tedious to spin >> up 5 different Erlang VM?s to do different things when it could all be >> accomplished on one. >> >> At the same time, as you scale, you probably want to separate >> functionality? >> >> So, do you have a rule of thumb or rules by which you decide on how to >> separate functionalities into modules vs applications vs entire releases? >> >> Thanks! >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kuna.prime@REDACTED Thu Aug 30 02:25:18 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Thu, 30 Aug 2018 02:25:18 +0200 Subject: [erlang-questions] heir and give_away for digraph? Message-ID: would it make sense to add heir option and give_away function to digraph module as this module is currently using ets tables for internal representation? -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincefoley@REDACTED Thu Aug 30 05:18:06 2018 From: vincefoley@REDACTED (Vince Foley) Date: Wed, 29 Aug 2018 20:18:06 -0700 Subject: [erlang-questions] os_mon unexpected logging Message-ID: Howdy, I'm using os_mon to grab some system memory stuff, but now I'm getting extra junk in my log when the app shuts down. This code is a library and I don't want to litter other folks app logs.. ``` [os_mon] cpu supervisor port (cpu_sup): Erlang has closed ``` I can suppress it by not starting cpu_sup via config, but I need some of that data too. Is there a way to gently shut that application down or to suppress this logging? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Thu Aug 30 05:43:46 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 30 Aug 2018 06:43:46 +0300 Subject: [erlang-questions] Information on file:advise/4 In-Reply-To: <5403150F-7CB3-4259-B52A-51885758C2A1@pharos-corp.com> References: <5403150F-7CB3-4259-B52A-51885758C2A1@pharos-corp.com> Message-ID: I advice to find out how to very deeply and properly monitor usage of this feature. We had once made a release that ruined performance of flussonic disk access when I just tried to play with this feature. Just plain linux vfs cache happened to be more efficient than our efforts to help it. So if you want to use it, it would be good to find out how to track its performance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From v@REDACTED Thu Aug 30 09:52:21 2018 From: v@REDACTED (Valentin Micic) Date: Thu, 30 Aug 2018 09:52:21 +0200 Subject: [erlang-questions] Information on file:advise/4 In-Reply-To: References: <5403150F-7CB3-4259-B52A-51885758C2A1@pharos-corp.com> Message-ID: On 30 Aug 2018, at 5:43 AM, Max Lapshin wrote: > I advice to find out how to very deeply and properly monitor usage of this feature. > > We had once made a release that ruined performance of flussonic disk access when I just tried to play with this feature. > > Just plain linux vfs cache happened to be more efficient than our efforts to help it. > > So if you want to use it, it would be good to find out how to track its performance. Thanks for sharing, Max. As a matter of fact, if memory serves me correctly, it may be someone from my company (amongst many others) that have asked for this feature a few years back. At the time, we have been loading a number of reasonably big files into the RAM on Linux OS. We noticed that a considerable amount of RAM was utilized by OS for caching of files, which we no longer needed. As there was no on-demand support for release of this cache from Erlang, we had to write a C code and call it against the given file once it has been loaded. Quite cumbersome! So, I am very grateful that this interface has been made available in Erlang. I just wasn't clear about semantics behind various options. But, I do understand caveats... for a long time, my (or, shall I say our clients') operating environment was a mixed bag of Solairs and Linux. The thing about these two, for example, is that they have a diametrically different views on OS caching. Thus, over the time, I came to a realization that it is quite difficult to relay on good OS features and still stay out of trouble in a heterogeneous environment. The remedy for us was to reinvent a hot water from time to time, by providing our own alternative for these features, which was always easy because Erlang seems to be generous that way. Again thank you very much for sharing your experiences. Kind regards V/ From rickard@REDACTED Thu Aug 30 16:25:47 2018 From: rickard@REDACTED (Rickard Green) Date: Thu, 30 Aug 2018 16:25:47 +0200 Subject: [erlang-questions] Patch package OTP 21.0.7 released Message-ID: <400c7fba-ff9e-52da-eaa8-304d7854e4e3@erlang.org> Patch Package: OTP 21.0.7 Git Tag: OTP-21.0.7 Date: 2018-08-30 Trouble Report Id: OTP-15237, OTP-15269 Seq num: ERL-713 System: OTP Release: 21 Application: erts-10.0.6 Predecessor: OTP 21.0.6 Check out the git tag OTP-21.0.7, 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. --------------------------------------------------------------------- --- erts-10.0.6 ----------------------------------------------------- --------------------------------------------------------------------- The erts-10.0.6 application can be applied independently of other applications on a full OTP 21 installation. --- Fixed Bugs and Malfunctions --- OTP-15237 Application(s): erts A race between termination of a process and resume of the same process via erlang:resume_process/1 could cause the VM to crash. This bug was introduced in erts version 10.0 (OTP 21.0). OTP-15269 Application(s): erts Related Id(s): ERL-713 When tracing on running, in trace events could be lost when a process was rescheduled between a dirty and a normal scheduler. Full runtime dependencies of erts-10.0.6: kernel-6.0, sasl-3.0.1, stdlib-3.5 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From lloyd@REDACTED Thu Aug 30 18:48:16 2018 From: lloyd@REDACTED (lloyd@REDACTED) Date: Thu, 30 Aug 2018 12:48:16 -0400 (EDT) Subject: [erlang-questions] =?utf-8?q?ANN=3A_erlPress=5Fcore_V=2E_0=2E01?= Message-ID: <1535647696.61235260@apps.rackspace.com> Generate PDFs from your Erlang applications. GitHub: writersglen:erlPress_core MIT license. erlPress_core modifies and extends the Hugh Watkins fork of Erlang Erlguten originally developed by Joe Armstrong. Joe Armstrong set out an ambitious goal: "Better than TeX." http://erlang.org/euc/04/erlguten.pdf But development flagged. erlPress_core picks up the baton. With your creative and technical help, our aspiration is to bring Joe's vision to reality and beyond. We see erlPress_core as the base for many as yet-to-be-developed Erlang applications for creative print media publishing tools. To see current functionality, display .../pdf/galleys/ep_show_n_tell.pdf. For source see ../src/tests/ep_show_n_tell.erl. erlPress_core is not yet the polished gem we envision. Your help in buffing up rough edges and fleshing out functionality is heartily welcome. Among other things, Erlguten source contains still more hidden gems than we've been able to dig out for lack of technical understanding or time. We'd love to integrate them into erlPress_core. High on our help-wanted list: typefaces in erlPress_core are currently limited to PostScript Type I. Support for OTF, TTF, and/or maybe TeX fonts rank high on our road map. Your help here would be welcomed and much appreciated. We have ideas how this can be done if you're interested. And more... we look forward to the creative applications that erlPress_core will enable you to build. P.S. Thanks to Frank Muller and others who have encouraged and supported development of erlPress_core. ********************************************* My books: THE GOSPEL OF ASHES http://thegospelofashes.com Strength is not enough. Do they have the courage and the cunning? Can they survive long enough to save the lives of millions? FREEIN' PANCHO http://freeinpancho.com A community of misfits help a troubled boy find his way AYA TAKEO http://ayatakeo.com Star-crossed love, war and power in an alternative universe Available through Amazon or by request from your favorite bookstore ********************************************** From roehst@REDACTED Thu Aug 30 19:50:25 2018 From: roehst@REDACTED (Rodrigo Stevaux) Date: Thu, 30 Aug 2018 14:50:25 -0300 Subject: [erlang-questions] Unidirectional architectures in Erlang Message-ID: Hi, If I may ask, I have a question about actor-based systems design that arose while writing a simple system for integrating GitHub and Slack. GitHub events are sent to a server using their Webhook API. We do some application logic on the events, and forward them to Slack. So our architecture is unidirectional: messages are followed from the HTTP server to a sequence of processes until they finally get to a message dispatcher process that sends messages to Slack. Message comes in, logic applies, message goes out. The generic servers are very easy to test in a pure fashion: just test the return values of handle_call for a given state. But: - unit testing should test that the unit under test forwards a message to a given address (and that is not reflected on the handle_call return value) - doing the integration testing of a "pipeline" of process involves testing that ultimately a message gets to the last process. Given the maturity of Erlang, I'd expect to promptly find solutions to this case. I haven't found a nice solution yet, so I suppose I am using OTP in a wrong way (maybe it's not a good fit for my project), or I am choosing the wrong architecture, or that I am missing key knowledge about how to test things in Erlang. Can anyone shed some light on this questions? Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathaniel@REDACTED Fri Aug 31 01:22:17 2018 From: nathaniel@REDACTED (Nathaniel Waisbrot) Date: Thu, 30 Aug 2018 19:22:17 -0400 Subject: [erlang-questions] ANN: erlPress_core V. 0.01 In-Reply-To: <1535647696.61235260@apps.rackspace.com> References: <1535647696.61235260@apps.rackspace.com> Message-ID: This is nice. I love my TeX-generated documents and I love Erlang. For the lazy, here are the full links to the examples. Project: https://github.com/writersglen/erlPress_core Example document: https://github.com/writersglen/erlPress_core/blob/master/pdf/galleys/ep_show_n_tell.pdf (for me, GitHub fails to display this inline and I have to download it to see it) Source of the example document: https://github.com/writersglen/erlPress_core/blob/master/src/tests/ep_show_n_tell.erl Maybe I'll try a rewrite of my TeX-based resume in erlPress_core. I wonder if this is something that would benefit from a language with more powerful macros, like Elixir or LFE. > On Aug 30, 2018, at 12:48 PM, lloyd@REDACTED wrote: > > Generate PDFs from your Erlang applications. > > GitHub: writersglen:erlPress_core > > MIT license. > > erlPress_core modifies and extends the Hugh Watkins fork of Erlang Erlguten originally developed by Joe Armstrong. > > Joe Armstrong set out an ambitious goal: "Better than TeX." > > http://erlang.org/euc/04/erlguten.pdf > > But development flagged. > > erlPress_core picks up the baton. With your creative and technical help, our aspiration is to bring Joe's vision to reality and beyond. > > We see erlPress_core as the base for many as yet-to-be-developed Erlang applications for creative print media publishing tools. > > To see current functionality, display .../pdf/galleys/ep_show_n_tell.pdf. For source see ../src/tests/ep_show_n_tell.erl. > > erlPress_core is not yet the polished gem we envision. Your help in buffing up rough edges and fleshing out functionality is heartily welcome. > > Among other things, Erlguten source contains still more hidden gems than we've been able to dig out for lack of technical understanding or time. We'd love to integrate them into erlPress_core. > > High on our help-wanted list: typefaces in erlPress_core are currently limited to PostScript Type I. Support for OTF, TTF, and/or maybe TeX fonts rank high on our road map. Your help here would be welcomed and much appreciated. We have ideas how this can be done if you're interested. > > And more... we look forward to the creative applications that erlPress_core will enable you to build. > > P.S. Thanks to Frank Muller and others who have encouraged and supported development of erlPress_core. > > > > > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Fri Aug 31 01:33:09 2018 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 30 Aug 2018 19:33:09 -0400 Subject: [erlang-questions] Unidirectional architectures in Erlang In-Reply-To: References: Message-ID: <20180830233307.GE801@ferdmbp.local> On 08/30, Rodrigo Stevaux wrote: >Message comes in, logic applies, message goes out. >The generic servers are very easy to test in a pure fashion: just test the >return values of handle_call for a given state. > That can be done as a regular unit test, yes. >But: >- unit testing should test that the unit under test forwards a message to a >given address (and that is not reflected on the handle_call return value) Aside from using mocks to know that the proper function calls have taken place, you can't easily test the forwarding of messages since that would imply side-effects turning your unit tests into integration tests. >- doing the integration testing of a "pipeline" of process involves testing >that ultimately a message gets to the last process. > Yes and no. You can test that each element of the chain properly forwards data to the right destination. You can do that if you make the endpoint/address/destination for each forwarded message parametrizable or configurable. Forward the data to the test process instead to confirm that the right side-effect has taken place. This lets you test each section of the chain in isolation; then if all sections are well-behaved, you can infer that the whole chain should behave well. You can confirm that with a more naive end-to-end test, knowing that individual components are tested more thoroughly. >Given the maturity of Erlang, I'd expect to promptly find solutions to this >case. On top of the techniques above, you can try using the `sys' module to introspect all OTP behaviours and look at their transitions as a neutral observer: 1> sys:get_status(disk_log_server). {status,<0.75.0>, {module,gen_server}, [[{<0.76.0>,'$#group_history'}, {'$initial_call',{disk_log_server,init,1}}, {'$ancestors',[kernel_safe_sup,kernel_sup,<0.45.0>]}], running,<0.66.0>,[], [{header,"Status for generic server disk_log_server"}, {data,[{"Status",running}, {"Parent",<0.66.0>}, {"Logged events",[]}]}, {data,[{"State",{state,[]}}]}]]} 2> P = self(), 2> sys:install( 2> disk_log_server, 2> {fun(_Acc, Event, State) -> P ! {trace, Event, State} end, 2> nodata} 2> ). ok 3> disk_log_server ! fake_data. fake_data 4> flush(). Shell got {trace,{in,fake_data},disk_log_server} Shell got {trace,{noreply,{state,[]}},disk_log_server} ok Those won't let you see arbitrary calls being made, but if you have a process chain A -> B -> C, then you can, by looking at the traces of all three processes, track the history of a call and the consequences they have. The sys module is full of really cool functionality few people know about, and that can make live debugging, but also testing much simpler. > >I haven't found a nice solution yet, so I suppose I am using OTP in a wrong >way (maybe it's not a good fit for my project), or I am choosing the wrong >architecture, or that I am missing key knowledge about how to test things >in Erlang. There aren't enough details to know at this point. I frequently just use `meck' (https://github.com/eproxus/meck) as a library, which lets you replace arbitrary function calls through hot code loadig, get traces and counts of all calls and values returned of unmodified code, and so on. If what you're looking for is a way to track side-effects in a very whitebox manner, meck is hard to beat. > >Can anyone shed some light on this questions? Thanks in advance! please provide more details about the nature of the side-effects you are trying to observe in a unit test. My default reflex would be to say that the moment you're testing side-effects, you are doing integration testing. Regards, Fred. From mononcqc@REDACTED Fri Aug 31 01:58:42 2018 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 30 Aug 2018 19:58:42 -0400 Subject: [erlang-questions] ANN: erlPress_core V. 0.01 In-Reply-To: References: <1535647696.61235260@apps.rackspace.com> Message-ID: <20180830235841.GF801@ferdmbp.local> I'm very happy to see that stuff, Lloyd! You've been around for a while and have voiced concerns about things that you found confusing in the past, but I'm impressed by what you got there out of what is (I think) the first publicly announced release you've got. On 08/30, Nathaniel Waisbrot wrote: > >Maybe I'll try a rewrite of my TeX-based resume in erlPress_core. > Now that's something interesting. I don't know when I'd have time to try that but it would definitely be interesting. From mononcqc@REDACTED Fri Aug 31 02:19:27 2018 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 30 Aug 2018 20:19:27 -0400 Subject: [erlang-questions] Separating Functionality In-Reply-To: <92429a25-7af2-4653-9af3-6fbe89d41ff8@Spark> References: <92429a25-7af2-4653-9af3-6fbe89d41ff8@Spark> Message-ID: <20180831001926.GG801@ferdmbp.local> On 08/29, Code Wiget wrote: >Hi everyone, > >With many programming languages, it is easy to think of ways to separate projects into distinct micro services. With Erlang, I'm having trouble deciding on how to spread out functionality. Because the Erlang VM can run multiple different fully independent applications, it seems tedious to spin up 5 different Erlang VM?s to do different things when it could all be accomplished on one. > >At the same time, as you scale, you probably want to separate functionality? > >So, do you have a rule of thumb or rules by which you decide on how to separate functionalities into modules vs applications vs entire releases? > My rule of thumb is always: How do I want this to fail? Should the apps be independent from each other? Is one of them worth running without the other? If they can't live without each other then they're probably worth keeping on the same node. Do they communicate heavily with each other? The cost of talking over the network is higher than communicating over the loopback interface, which is higher than message passing. This can impact decisions. Is one of the components unreliable? If you got code talking to C or C++ programs that you don't necessarily trust, or that the code itself is kind of risky, isolating it entirely will allow to crash the whole VM of one app without hurting the others What's their scaling factor? If you have a stateless component serving lots of traffic for cheap (such as a web front-end), splitting it from stateful parts that must be treated more carefully may make sense; even put them on different machines if you must. From lloyd@REDACTED Fri Aug 31 02:23:51 2018 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Thu, 30 Aug 2018 20:23:51 -0400 Subject: [erlang-questions] ANN: erlPress_core V. 0.01 In-Reply-To: <20180830235841.GF801@ferdmbp.local> References: <1535647696.61235260@apps.rackspace.com> <20180830235841.GF801@ferdmbp.local> Message-ID: Hi Nathaniel, ErlPress resumes would be fairly easy. I?m happy to help you with it, perhaps as a project we could publish as a blog post. First step, scan the web for an attractive/functional layout. From there we can create a template. It would be cool to pour text into the template from your favorite db. Several tasks high on my road-map would make it even easier and more elegant: ? Wider choice of fonts ? Wrapping up work-in-progress Markdown parsing ? db data input functions The first task is challenging, though I have ideas. The second two should be fairly easy. Thanks for your interest. All the best, Lloyd Sent from my iPad > On Aug 30, 2018, at 7:58 PM, Fred Hebert wrote: > > I'm very happy to see that stuff, Lloyd! You've been around for a while and have voiced concerns about things that you found confusing in the past, but I'm impressed by what you got there out of what is (I think) the first publicly announced release you've got. > > >> On 08/30, Nathaniel Waisbrot wrote: >> >> Maybe I'll try a rewrite of my TeX-based resume in erlPress_core. >> > > Now that's something interesting. I don't know when I'd have time to try that but it would definitely be interesting. > > > From Andras.Bekes@REDACTED Fri Aug 31 12:43:29 2018 From: Andras.Bekes@REDACTED (Bekes, Andras G) Date: Fri, 31 Aug 2018 10:43:29 +0000 Subject: [erlang-questions] {error,closed} vs. {error,econnreset} In-Reply-To: References: <54E4A07E.5010307@erlang.org> <20150502103209.GA19880@nybek.com> <20150624124817.GA30126@nybek.com> <20160926141520.GB2341@nybek.com> Message-ID: Hi Lukas, All, I do not have TCP dump, but according to strace, the error is: <... writev resumed> ) = -1 ENOTCONN (Transport endpoint is not connected) The error indeed happens on a write, and on the Erlang side this is reported as a normal close, at the next gen_tcp:recv call. Let us not go into discussing what can cause this error on a socket (unix domain BTW). It is irrelevant here. The important here is that this socket error, and any other socket error shall not be confused with an orderly shutdown of the socket. I support the below mentioned proposal of making the default behavior report all errors, and the masking behavior explicitly selected with an option. Regards, Andras From: Lukas Larsson [mailto:lukas@REDACTED] Sent: Thursday, August 16, 2018 2:37 PM To: Bekes, Andras G (IST) Cc: Erlang Questions Subject: Re: [erlang-questions] {error,closed} vs. {error,econnreset} Hello, On Mon, 6 Aug 2018, 10:49 Bekes, Andras G, > wrote: Hi All, Reviving this old thread again, because I am getting more and more convinced that we need further changes. We're still observing connection close events when an error should be reported to gen_tcp level. It can be a reset error somehow still not reported as 'econnreset', but I suspect it must be some other error. I suppose that you have not managed to catch the error in a tcp dump as Rory asked for? I checked the code in inet_drv.c. The function static int tcp_recv(tcp_descriptor* desc, int request_len) seems to work properly -- a reset is either reported as closed or econnreset, depending on show_econnreset, all other errors are reported as errors. However, the function static int tcp_send_or_shutdown_error(tcp_descriptor* desc, int err) hides errors. Connection reset errors are properly handled (either reported as closed or econnreset, depending on show_econnreset), but all other errors are just reported as closed. Active and passive modes have independent code paths, but I think both do the same: all errors are reported as normal close -- except for econnreset. There is a merge of error codes happening in tcp_send_error, so some other errors get mapped into econnreset before tcp_send_or_shutdown_error is called. Apparently I need to detect all errors. Is it possible to implement a show_errors (or show_all_errors) flag, too? Actually, this new flag could replace the current show_econnreset flag. Having two separate flags for econnreset & others requires more complex code, but having a single show_errors flag would simplify the current that provides special treatment for econnreset. I am not sure if it makes much sense to expose connection reset errors but still mask all other errors as normal close events. From a farther point of view, it seems there are network-programming tasks (there is at least one!), for which Erlang seems not suitable. This sounds rather sad. Luckily the fix doesn't seem difficult. What do you think? I agree that it should be possible to get the original error from the tcp stack. Given the discussions here https://github.com/erlang/otp/pull/731, maybe it is time to reverse the options so that returning the original error becomes the default and you have to set an option to get the backwards compatible behaviour? We are currently in the process of a major overhaul of gen_tcp and friends, so maybe this can be changed while doing that, as we are bound to break backwards compatibility in various ways during that rewrite anyways. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From denc716@REDACTED Fri Aug 31 16:23:36 2018 From: denc716@REDACTED (books) Date: Fri, 31 Aug 2018 07:23:36 -0700 Subject: [erlang-questions] Separating Functionality In-Reply-To: <92429a25-7af2-4653-9af3-6fbe89d41ff8@Spark> References: <92429a25-7af2-4653-9af3-6fbe89d41ff8@Spark> Message-ID: On Wed, Aug 29, 2018 at 10:50 AM Code Wiget wrote: > > Hi everyone, > > With many programming languages, it is easy to think of ways to separate projects into distinct micro services. With Erlang, I'm having trouble deciding on how to spread out functionality. Because the Erlang VM can run multiple different fully independent applications, it seems tedious to spin up 5 different Erlang VM?s to do different things when it could all be accomplished on one. I wonder in Erlang terms of 'application', if running multiple applications in one single Erlang VM, are there any ways to configure resource restrictions to each application, at OTP Supervisor tree level ? like how much memory can it use at most, and CPU, network, ... etc From roehst@REDACTED Fri Aug 31 18:51:31 2018 From: roehst@REDACTED (Rodrigo Stevaux) Date: Fri, 31 Aug 2018 13:51:31 -0300 Subject: [erlang-questions] Unidirectional architectures in Erlang In-Reply-To: <20180830233307.GE801@ferdmbp.local> References: <20180830233307.GE801@ferdmbp.local> Message-ID: yes, we fundamentally are trying to do integration testing. unit testing process communication pairwise by sending a message to the parent process is something we tried to do and it worked reasonably well. but we want to know that the whole composition of processes works well. the challenge we found on that approach is that the processes have names and we would have to find a way to inject the pid of the "next" process in the chain and make it the test process during testing and other process during production (which can be done with a little bit of instrumentation and conditional compiling -- we are on Elixir actually). is using the "sys" module a regular practice? thanks for the reply. Em qui, 30 de ago de 2018 ?s 20:33, Fred Hebert escreveu: > On 08/30, Rodrigo Stevaux wrote: > >Message comes in, logic applies, message goes out. > >The generic servers are very easy to test in a pure fashion: just test the > >return values of handle_call for a given state. > > > > That can be done as a regular unit test, yes. > > >But: > >- unit testing should test that the unit under test forwards a message to > a > >given address (and that is not reflected on the handle_call return value) > > Aside from using mocks to know that the proper function calls have taken > place, you can't easily test the forwarding of messages since that would > imply side-effects turning your unit tests into integration tests. > > >- doing the integration testing of a "pipeline" of process involves > testing > >that ultimately a message gets to the last process. > > > > Yes and no. You can test that each element of the chain properly > forwards data to the right destination. You can do that if you make the > endpoint/address/destination for each forwarded message parametrizable > or configurable. Forward the data to the test process instead to confirm > that the right side-effect has taken place. > > This lets you test each section of the chain in isolation; then if all > sections are well-behaved, you can infer that the whole chain should > behave well. You can confirm that with a more naive end-to-end test, > knowing that individual components are tested more thoroughly. > > >Given the maturity of Erlang, I'd expect to promptly find solutions to > this > >case. > > On top of the techniques above, you can try using the `sys' module to > introspect all OTP behaviours and look at their transitions as a neutral > observer: > > 1> sys:get_status(disk_log_server). > {status,<0.75.0>, > {module,gen_server}, > [[{<0.76.0>,'$#group_history'}, > {'$initial_call',{disk_log_server,init,1}}, > {'$ancestors',[kernel_safe_sup,kernel_sup,<0.45.0>]}], > running,<0.66.0>,[], > [{header,"Status for generic server disk_log_server"}, > {data,[{"Status",running}, > {"Parent",<0.66.0>}, > {"Logged events",[]}]}, > {data,[{"State",{state,[]}}]}]]} > 2> P = self(), > 2> sys:install( > 2> disk_log_server, > 2> {fun(_Acc, Event, State) -> P ! {trace, Event, State} end, > 2> nodata} > 2> ). > ok > 3> disk_log_server ! fake_data. > fake_data > 4> flush(). > Shell got {trace,{in,fake_data},disk_log_server} > Shell got {trace,{noreply,{state,[]}},disk_log_server} > ok > > Those won't let you see arbitrary calls being made, but if you have a > process chain A -> B -> C, then you can, by looking at the traces of all > three processes, track the history of a call and the consequences they > have. > > The sys module is full of really cool functionality few people know > about, and that can make live debugging, but also testing much simpler. > > > > >I haven't found a nice solution yet, so I suppose I am using OTP in a > wrong > >way (maybe it's not a good fit for my project), or I am choosing the wrong > >architecture, or that I am missing key knowledge about how to test things > >in Erlang. > > There aren't enough details to know at this point. I frequently just use > `meck' (https://github.com/eproxus/meck) as a library, which lets you > replace arbitrary function calls through hot code loadig, get traces and > counts of all calls and values returned of unmodified code, and so on. > > If what you're looking for is a way to track side-effects in a very > whitebox manner, meck is hard to beat. > > > > >Can anyone shed some light on this questions? Thanks in advance! > > please provide more details about the nature of the side-effects you are > trying to observe in a unit test. My default reflex would be to say that > the moment you're testing side-effects, you are doing integration > testing. > > Regards, > Fred. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From freza@REDACTED Fri Aug 31 20:25:20 2018 From: freza@REDACTED (Jachym Holecek) Date: Fri, 31 Aug 2018 14:25:20 -0400 Subject: [erlang-questions] Unidirectional architectures in Erlang In-Reply-To: References: Message-ID: <20180831182520.GA4854@circlewave.net> Hi, # Rodrigo Stevaux 2018-08-30: > If I may ask, I have a question about actor-based systems design that arose > while writing a simple system for integrating GitHub and Slack. > > GitHub events are sent to a server using their Webhook API. We do some > application logic on the events, and forward them to Slack. > > So our architecture is unidirectional: messages are followed from the HTTP > server to a sequence of processes until they finally get to a message > dispatcher process that sends messages to Slack. > > Message comes in, logic applies, message goes out. Erlang comes by default with the brilliant Common Test application, I would very much recommend giving it a try even if it may take a bit of effort to learn. > The generic servers are very easy to test in a pure fashion: just test the > return values of handle_call for a given state. Not really -- doing so violates abstraction boundaries and processes of such variety typically do most of their useful work by performing side effects. So either you have to introduce artificial complexity to satisfy requirements of the test machinery (highly undesirable) or your test won't really capture much (but you're still paying the maintenance cost for them). > But: > - unit testing should test that the unit under test forwards a message to a > given address (and that is not reflected on the handle_call return value) > - doing the integration testing of a "pipeline" of process involves testing > that ultimately a message gets to the last process. Good questions to be asking -- what assurances do you want to obtain from the tests and consequently what granularity should you being testing at and what methods and tools are available to assist. Also: what is the maintenance cost of these tests looking forward, and does the utility of these justify them? Black-box tests, whereby you start the whole thing, tickle its public interfaces and see the right reactions come out the other end, tend to always be desirable. You can do this against full cluster, individual node, individual application, individual process, individual functions. Common Test, with project-specific scaffolding around it, will be helpful at all these levels. With it being ordinary Erlang code running as ordinary Erlang node all the native communication and diagnostic facilities are also available to you should you need to inspect or tweak something behind the system's back. It is also not entirely out of the question for the production code to be somewhat tweaked to cater for testing needs specifically, where you can't get your way by more standard means. Perhaps too broad an answer... my two cents anyways. :) BR, -- Jachym From freza@REDACTED Fri Aug 31 20:36:29 2018 From: freza@REDACTED (Jachym Holecek) Date: Fri, 31 Aug 2018 14:36:29 -0400 Subject: [erlang-questions] Unidirectional architectures in Erlang In-Reply-To: <20180830233307.GE801@ferdmbp.local> References: <20180830233307.GE801@ferdmbp.local> Message-ID: <20180831183629.GB4854@circlewave.net> # Fred Hebert 2018-08-30: > This lets you test each section of the chain in isolation; then if all > sections are well-behaved, you can infer that the whole chain should behave > well. That sounds like a very dangerous conclusion to be making, personally. It's not unheard of that thousands of unit-tests "pass" and everything is "ready" and then it all falls like a house of cards with a single naive end-to-end flow. ;-) BR, -- Jachym From roehst@REDACTED Fri Aug 31 20:56:18 2018 From: roehst@REDACTED (Rodrigo Stevaux) Date: Fri, 31 Aug 2018 15:56:18 -0300 Subject: [erlang-questions] Unidirectional architectures in Erlang In-Reply-To: <20180831183629.GB4854@circlewave.net> References: <20180830233307.GE801@ferdmbp.local> <20180831183629.GB4854@circlewave.net> Message-ID: > It's not unheard of that thousands of unit-tests "pass" and everything is > "ready" and then it all falls like a house of cards with a single naive > end-to-end flow. ;-) > My exact experience. Even though everything passes unit tests, the system might be mis-configured for example -- moreover if everything is unit testable, dependency injection is probably being used so configuration matters. -------------- next part -------------- An HTML attachment was scrubbed... URL: From roehst@REDACTED Fri Aug 31 20:58:57 2018 From: roehst@REDACTED (Rodrigo Stevaux) Date: Fri, 31 Aug 2018 15:58:57 -0300 Subject: [erlang-questions] Unidirectional architectures in Erlang In-Reply-To: <20180831182520.GA4854@circlewave.net> References: <20180831182520.GA4854@circlewave.net> Message-ID: > > Not really -- doing so violates abstraction boundaries and processes of > such > variety typically do most of their useful work by performing side effects. > So > either you have to introduce artificial complexity to satisfy requirements > of > the test machinery (highly undesirable) or your test won't really capture > much (but you're still paying the maintenance cost for them). > This is something I am curious about. I am not deeply familiar with any erlang code base and I ask: is it common for Genservers to do side-effects (for example, sending a message to a process which is not the sender)? If not, should there be an OTP behavior for processes that forward messages to others (like returning a list of messages instead of a single reply)? tks! Em sex, 31 de ago de 2018 ?s 15:24, Jachym Holecek escreveu: > Hi, > > # Rodrigo Stevaux 2018-08-30: > > If I may ask, I have a question about actor-based systems design that > arose > > while writing a simple system for integrating GitHub and Slack. > > > > GitHub events are sent to a server using their Webhook API. We do some > > application logic on the events, and forward them to Slack. > > > > So our architecture is unidirectional: messages are followed from the > HTTP > > server to a sequence of processes until they finally get to a message > > dispatcher process that sends messages to Slack. > > > > Message comes in, logic applies, message goes out. > > Erlang comes by default with the brilliant Common Test application, I would > very much recommend giving it a try even if it may take a bit of effort to > learn. > > > The generic servers are very easy to test in a pure fashion: just test > the > > return values of handle_call for a given state. > > Not really -- doing so violates abstraction boundaries and processes of > such > variety typically do most of their useful work by performing side effects. > So > either you have to introduce artificial complexity to satisfy requirements > of > the test machinery (highly undesirable) or your test won't really capture > much (but you're still paying the maintenance cost for them). > > > But: > > - unit testing should test that the unit under test forwards a message > to a > > given address (and that is not reflected on the handle_call return value) > > - doing the integration testing of a "pipeline" of process involves > testing > > that ultimately a message gets to the last process. > > Good questions to be asking -- what assurances do you want to obtain from > the > tests and consequently what granularity should you being testing at and > what > methods and tools are available to assist. Also: what is the maintenance > cost > of these tests looking forward, and does the utility of these justify them? > > Black-box tests, whereby you start the whole thing, tickle its public > interfaces and see the right reactions come out the other end, tend to > always be desirable. You can do this against full cluster, individual > node, individual application, individual process, individual functions. > > Common Test, with project-specific scaffolding around it, will be helpful > at all these levels. With it being ordinary Erlang code running as ordinary > Erlang node all the native communication and diagnostic facilities are also > available to you should you need to inspect or tweak something behind the > system's back. It is also not entirely out of the question for the > production > code to be somewhat tweaked to cater for testing needs specifically, where > you can't get your way by more standard means. > > Perhaps too broad an answer... my two cents anyways. :) > > BR, > -- Jachym > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Fri Aug 31 21:24:11 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Fri, 31 Aug 2018 21:24:11 +0200 Subject: [erlang-questions] Unidirectional architectures in Erlang In-Reply-To: References: <20180830233307.GE801@ferdmbp.local> Message-ID: Hi, I've used the sys module more than once, in both debugging and testing. It is useful, also because you can use sys:log/2,3 to have a trace log of a running process and inspect it later. Another approach I've used is to add trace messages to a system. A module defines this function: report_event(_DetailLevel, _From, _To, _Label, _Contents) -> hopefully_traced. And you call it in your system. Now, you can attach a tracer to this call in tests and verify the trace you get is what you expect. This allows you to "see inside" your system and verify its behavior. More advanced solutions involves rewriting traces into the notion of a temporal monad and then asking questions on the trace for correctness. Yet another approach is to rewrite your code into a computational (pure) part which sets up a set of actions but has no effect, and an effectful part which runs said actions. This allows you to scrutinize the actions without having to bind your system up. Look up, e.g., the Elm architecture for this approach. The basic idea is that of a free monad: rather than running the program, return a command set which can be interpreted either as a test (where the effects are logged) or as a real system (where the effects are run). We do this at $WORK, which means we can test all of our stack without ever having to run the system as a whole in unit tests. In fact, we don't even need a database, or supervisor tree, since we just simulate the universe around a process. Integration tests are run later via a QuickCheck like tool written by Martin Gausby - treating the system as a black box and poking it from the outside to verify we can glue things together as expected. On Fri, Aug 31, 2018 at 7:07 PM Rodrigo Stevaux wrote: > yes, we fundamentally are trying to do integration testing. > > unit testing process communication pairwise by sending a message to the > parent process is something we tried to do and it worked reasonably well. > but we want to know that the whole composition of processes works well. > > the challenge we found on that approach is that the processes have names > and we would have to find a way to inject the pid of the "next" process in > the chain and make it the test process during testing and other process > during production (which can be done with a little bit of instrumentation > and conditional compiling -- we are on Elixir actually). > > is using the "sys" module a regular practice? > > thanks for the reply. > > Em qui, 30 de ago de 2018 ?s 20:33, Fred Hebert > escreveu: > >> On 08/30, Rodrigo Stevaux wrote: >> >Message comes in, logic applies, message goes out. >> >The generic servers are very easy to test in a pure fashion: just test >> the >> >return values of handle_call for a given state. >> > >> >> That can be done as a regular unit test, yes. >> >> >But: >> >- unit testing should test that the unit under test forwards a message >> to a >> >given address (and that is not reflected on the handle_call return value) >> >> Aside from using mocks to know that the proper function calls have taken >> place, you can't easily test the forwarding of messages since that would >> imply side-effects turning your unit tests into integration tests. >> >> >- doing the integration testing of a "pipeline" of process involves >> testing >> >that ultimately a message gets to the last process. >> > >> >> Yes and no. You can test that each element of the chain properly >> forwards data to the right destination. You can do that if you make the >> endpoint/address/destination for each forwarded message parametrizable >> or configurable. Forward the data to the test process instead to confirm >> that the right side-effect has taken place. >> >> This lets you test each section of the chain in isolation; then if all >> sections are well-behaved, you can infer that the whole chain should >> behave well. You can confirm that with a more naive end-to-end test, >> knowing that individual components are tested more thoroughly. >> >> >Given the maturity of Erlang, I'd expect to promptly find solutions to >> this >> >case. >> >> On top of the techniques above, you can try using the `sys' module to >> introspect all OTP behaviours and look at their transitions as a neutral >> observer: >> >> 1> sys:get_status(disk_log_server). >> {status,<0.75.0>, >> {module,gen_server}, >> [[{<0.76.0>,'$#group_history'}, >> {'$initial_call',{disk_log_server,init,1}}, >> {'$ancestors',[kernel_safe_sup,kernel_sup,<0.45.0>]}], >> running,<0.66.0>,[], >> [{header,"Status for generic server disk_log_server"}, >> {data,[{"Status",running}, >> {"Parent",<0.66.0>}, >> {"Logged events",[]}]}, >> {data,[{"State",{state,[]}}]}]]} >> 2> P = self(), >> 2> sys:install( >> 2> disk_log_server, >> 2> {fun(_Acc, Event, State) -> P ! {trace, Event, State} end, >> 2> nodata} >> 2> ). >> ok >> 3> disk_log_server ! fake_data. >> fake_data >> 4> flush(). >> Shell got {trace,{in,fake_data},disk_log_server} >> Shell got {trace,{noreply,{state,[]}},disk_log_server} >> ok >> >> Those won't let you see arbitrary calls being made, but if you have a >> process chain A -> B -> C, then you can, by looking at the traces of all >> three processes, track the history of a call and the consequences they >> have. >> >> The sys module is full of really cool functionality few people know >> about, and that can make live debugging, but also testing much simpler. >> >> > >> >I haven't found a nice solution yet, so I suppose I am using OTP in a >> wrong >> >way (maybe it's not a good fit for my project), or I am choosing the >> wrong >> >architecture, or that I am missing key knowledge about how to test things >> >in Erlang. >> >> There aren't enough details to know at this point. I frequently just use >> `meck' (https://github.com/eproxus/meck) as a library, which lets you >> replace arbitrary function calls through hot code loadig, get traces and >> counts of all calls and values returned of unmodified code, and so on. >> >> If what you're looking for is a way to track side-effects in a very >> whitebox manner, meck is hard to beat. >> >> > >> >Can anyone shed some light on this questions? Thanks in advance! >> >> please provide more details about the nature of the side-effects you are >> trying to observe in a unit test. My default reflex would be to say that >> the moment you're testing side-effects, you are doing integration >> testing. >> >> Regards, >> Fred. >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Fri Aug 31 21:28:33 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Fri, 31 Aug 2018 21:28:33 +0200 Subject: [erlang-questions] Separating Functionality In-Reply-To: References: <92429a25-7af2-4653-9af3-6fbe89d41ff8@Spark> Message-ID: Historically no. At present, we can limit processes and their memory usage. In extension of the excellent response by Fred, this is yet another reason as to why you might want to split your system. If parts of the system proves to be unreliable, or expected to be so, then isolate them. On the other hand, Erlang systems are usually good at fair scheduling among processes, so if you can manage the memory pressure of the VM, it might be enough. On Fri, Aug 31, 2018 at 4:23 PM books wrote: > On Wed, Aug 29, 2018 at 10:50 AM Code Wiget wrote: > > > > Hi everyone, > > > > With many programming languages, it is easy to think of ways to separate > projects into distinct micro services. With Erlang, I'm having trouble > deciding on how to spread out functionality. Because the Erlang VM can run > multiple different fully independent applications, it seems tedious to spin > up 5 different Erlang VM?s to do different things when it could all be > accomplished on one. > > I wonder in Erlang terms of 'application', if running multiple > applications in one single Erlang VM, are there any ways to > configure resource restrictions to each application, at OTP > Supervisor tree level ? like how much memory can it use at most, > and CPU, network, ... etc > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From roehst@REDACTED Fri Aug 31 21:29:26 2018 From: roehst@REDACTED (Rodrigo Stevaux) Date: Fri, 31 Aug 2018 16:29:26 -0300 Subject: [erlang-questions] Unidirectional architectures in Erlang In-Reply-To: References: <20180830233307.GE801@ferdmbp.local> Message-ID: This brings the question, is there a library for writing temporal properties for testing with quickcheck or proper? I mean properties that say something about the sequence of trace messages and not about the contents of the list of trace mssages for example. Em sex, 31 de ago de 2018 ?s 16:24, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> escreveu: > Hi, > > I've used the sys module more than once, in both debugging and testing. It > is useful, also because you can use sys:log/2,3 to have a trace log of a > running process and inspect it later. > > Another approach I've used is to add trace messages to a system. A module > defines this function: > > report_event(_DetailLevel, _From, _To, _Label, _Contents) -> > hopefully_traced. > > And you call it in your system. Now, you can attach a tracer to this call > in tests and verify the trace you get is what you expect. This allows you > to "see inside" your system and verify its behavior. More advanced > solutions involves rewriting traces into the notion of a temporal monad and > then asking questions on the trace for correctness. > > Yet another approach is to rewrite your code into a computational (pure) > part which sets up a set of actions but has no effect, and an effectful > part which runs said actions. This allows you to scrutinize the actions > without having to bind your system up. Look up, e.g., the Elm architecture > for this approach. The basic idea is that of a free monad: rather than > running the program, return a command set which can be interpreted either > as a test (where the effects are logged) or as a real system (where the > effects are run). We do this at $WORK, which means we can test all of our > stack without ever having to run the system as a whole in unit tests. In > fact, we don't even need a database, or supervisor tree, since we just > simulate the universe around a process. Integration tests are run later via > a QuickCheck like tool written by Martin Gausby - treating the system as a > black box and poking it from the outside to verify we can glue things > together as expected. > > > On Fri, Aug 31, 2018 at 7:07 PM Rodrigo Stevaux wrote: > >> yes, we fundamentally are trying to do integration testing. >> >> unit testing process communication pairwise by sending a message to the >> parent process is something we tried to do and it worked reasonably well. >> but we want to know that the whole composition of processes works well. >> >> the challenge we found on that approach is that the processes have names >> and we would have to find a way to inject the pid of the "next" process in >> the chain and make it the test process during testing and other process >> during production (which can be done with a little bit of instrumentation >> and conditional compiling -- we are on Elixir actually). >> >> is using the "sys" module a regular practice? >> >> thanks for the reply. >> >> Em qui, 30 de ago de 2018 ?s 20:33, Fred Hebert >> escreveu: >> >>> On 08/30, Rodrigo Stevaux wrote: >>> >Message comes in, logic applies, message goes out. >>> >The generic servers are very easy to test in a pure fashion: just test >>> the >>> >return values of handle_call for a given state. >>> > >>> >>> That can be done as a regular unit test, yes. >>> >>> >But: >>> >- unit testing should test that the unit under test forwards a message >>> to a >>> >given address (and that is not reflected on the handle_call return >>> value) >>> >>> Aside from using mocks to know that the proper function calls have taken >>> place, you can't easily test the forwarding of messages since that would >>> imply side-effects turning your unit tests into integration tests. >>> >>> >- doing the integration testing of a "pipeline" of process involves >>> testing >>> >that ultimately a message gets to the last process. >>> > >>> >>> Yes and no. You can test that each element of the chain properly >>> forwards data to the right destination. You can do that if you make the >>> endpoint/address/destination for each forwarded message parametrizable >>> or configurable. Forward the data to the test process instead to confirm >>> that the right side-effect has taken place. >>> >>> This lets you test each section of the chain in isolation; then if all >>> sections are well-behaved, you can infer that the whole chain should >>> behave well. You can confirm that with a more naive end-to-end test, >>> knowing that individual components are tested more thoroughly. >>> >>> >Given the maturity of Erlang, I'd expect to promptly find solutions to >>> this >>> >case. >>> >>> On top of the techniques above, you can try using the `sys' module to >>> introspect all OTP behaviours and look at their transitions as a neutral >>> observer: >>> >>> 1> sys:get_status(disk_log_server). >>> {status,<0.75.0>, >>> {module,gen_server}, >>> [[{<0.76.0>,'$#group_history'}, >>> {'$initial_call',{disk_log_server,init,1}}, >>> {'$ancestors',[kernel_safe_sup,kernel_sup,<0.45.0>]}], >>> running,<0.66.0>,[], >>> [{header,"Status for generic server disk_log_server"}, >>> {data,[{"Status",running}, >>> {"Parent",<0.66.0>}, >>> {"Logged events",[]}]}, >>> {data,[{"State",{state,[]}}]}]]} >>> 2> P = self(), >>> 2> sys:install( >>> 2> disk_log_server, >>> 2> {fun(_Acc, Event, State) -> P ! {trace, Event, State} end, >>> 2> nodata} >>> 2> ). >>> ok >>> 3> disk_log_server ! fake_data. >>> fake_data >>> 4> flush(). >>> Shell got {trace,{in,fake_data},disk_log_server} >>> Shell got {trace,{noreply,{state,[]}},disk_log_server} >>> ok >>> >>> Those won't let you see arbitrary calls being made, but if you have a >>> process chain A -> B -> C, then you can, by looking at the traces of all >>> three processes, track the history of a call and the consequences they >>> have. >>> >>> The sys module is full of really cool functionality few people know >>> about, and that can make live debugging, but also testing much simpler. >>> >>> > >>> >I haven't found a nice solution yet, so I suppose I am using OTP in a >>> wrong >>> >way (maybe it's not a good fit for my project), or I am choosing the >>> wrong >>> >architecture, or that I am missing key knowledge about how to test >>> things >>> >in Erlang. >>> >>> There aren't enough details to know at this point. I frequently just use >>> `meck' (https://github.com/eproxus/meck) as a library, which lets you >>> replace arbitrary function calls through hot code loadig, get traces and >>> counts of all calls and values returned of unmodified code, and so on. >>> >>> If what you're looking for is a way to track side-effects in a very >>> whitebox manner, meck is hard to beat. >>> >>> > >>> >Can anyone shed some light on this questions? Thanks in advance! >>> >>> please provide more details about the nature of the side-effects you are >>> trying to observe in a unit test. My default reflex would be to say that >>> the moment you're testing side-effects, you are doing integration >>> testing. >>> >>> Regards, >>> Fred. >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > -- > J. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Fri Aug 31 21:33:01 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Fri, 31 Aug 2018 21:33:01 +0200 Subject: [erlang-questions] Unidirectional architectures in Erlang In-Reply-To: References: <20180830233307.GE801@ferdmbp.local> Message-ID: QuickCheck has eqc_temporal (which is a temporal monad). I don't think proper currently implements the interface, but it isn't too hard to write it yourself if you want to attack the problem. You generate random commands like in a statem model. The system-under-test (SUT) generates trace events. You stuff those trace events into eqc_temporal or equivalent. You ask properties of the eqc_temporal trace representation, failing the test if the rules are broken. On Fri, Aug 31, 2018 at 9:29 PM Rodrigo Stevaux wrote: > This brings the question, is there a library for writing temporal > properties for testing with quickcheck or proper? I mean properties that > say something about the sequence of trace messages and not about the > contents of the list of trace mssages for example. > > Em sex, 31 de ago de 2018 ?s 16:24, Jesper Louis Andersen < > jesper.louis.andersen@REDACTED> escreveu: > >> Hi, >> >> I've used the sys module more than once, in both debugging and testing. >> It is useful, also because you can use sys:log/2,3 to have a trace log of a >> running process and inspect it later. >> >> Another approach I've used is to add trace messages to a system. A module >> defines this function: >> >> report_event(_DetailLevel, _From, _To, _Label, _Contents) -> >> hopefully_traced. >> >> And you call it in your system. Now, you can attach a tracer to this call >> in tests and verify the trace you get is what you expect. This allows you >> to "see inside" your system and verify its behavior. More advanced >> solutions involves rewriting traces into the notion of a temporal monad and >> then asking questions on the trace for correctness. >> >> Yet another approach is to rewrite your code into a computational (pure) >> part which sets up a set of actions but has no effect, and an effectful >> part which runs said actions. This allows you to scrutinize the actions >> without having to bind your system up. Look up, e.g., the Elm architecture >> for this approach. The basic idea is that of a free monad: rather than >> running the program, return a command set which can be interpreted either >> as a test (where the effects are logged) or as a real system (where the >> effects are run). We do this at $WORK, which means we can test all of our >> stack without ever having to run the system as a whole in unit tests. In >> fact, we don't even need a database, or supervisor tree, since we just >> simulate the universe around a process. Integration tests are run later via >> a QuickCheck like tool written by Martin Gausby - treating the system as a >> black box and poking it from the outside to verify we can glue things >> together as expected. >> >> >> On Fri, Aug 31, 2018 at 7:07 PM Rodrigo Stevaux wrote: >> >>> yes, we fundamentally are trying to do integration testing. >>> >>> unit testing process communication pairwise by sending a message to the >>> parent process is something we tried to do and it worked reasonably well. >>> but we want to know that the whole composition of processes works well. >>> >>> the challenge we found on that approach is that the processes have names >>> and we would have to find a way to inject the pid of the "next" process in >>> the chain and make it the test process during testing and other process >>> during production (which can be done with a little bit of instrumentation >>> and conditional compiling -- we are on Elixir actually). >>> >>> is using the "sys" module a regular practice? >>> >>> thanks for the reply. >>> >>> Em qui, 30 de ago de 2018 ?s 20:33, Fred Hebert >>> escreveu: >>> >>>> On 08/30, Rodrigo Stevaux wrote: >>>> >Message comes in, logic applies, message goes out. >>>> >The generic servers are very easy to test in a pure fashion: just test >>>> the >>>> >return values of handle_call for a given state. >>>> > >>>> >>>> That can be done as a regular unit test, yes. >>>> >>>> >But: >>>> >- unit testing should test that the unit under test forwards a message >>>> to a >>>> >given address (and that is not reflected on the handle_call return >>>> value) >>>> >>>> Aside from using mocks to know that the proper function calls have >>>> taken >>>> place, you can't easily test the forwarding of messages since that >>>> would >>>> imply side-effects turning your unit tests into integration tests. >>>> >>>> >- doing the integration testing of a "pipeline" of process involves >>>> testing >>>> >that ultimately a message gets to the last process. >>>> > >>>> >>>> Yes and no. You can test that each element of the chain properly >>>> forwards data to the right destination. You can do that if you make the >>>> endpoint/address/destination for each forwarded message parametrizable >>>> or configurable. Forward the data to the test process instead to >>>> confirm >>>> that the right side-effect has taken place. >>>> >>>> This lets you test each section of the chain in isolation; then if all >>>> sections are well-behaved, you can infer that the whole chain should >>>> behave well. You can confirm that with a more naive end-to-end test, >>>> knowing that individual components are tested more thoroughly. >>>> >>>> >Given the maturity of Erlang, I'd expect to promptly find solutions to >>>> this >>>> >case. >>>> >>>> On top of the techniques above, you can try using the `sys' module to >>>> introspect all OTP behaviours and look at their transitions as a >>>> neutral >>>> observer: >>>> >>>> 1> sys:get_status(disk_log_server). >>>> {status,<0.75.0>, >>>> {module,gen_server}, >>>> [[{<0.76.0>,'$#group_history'}, >>>> {'$initial_call',{disk_log_server,init,1}}, >>>> {'$ancestors',[kernel_safe_sup,kernel_sup,<0.45.0>]}], >>>> running,<0.66.0>,[], >>>> [{header,"Status for generic server disk_log_server"}, >>>> {data,[{"Status",running}, >>>> {"Parent",<0.66.0>}, >>>> {"Logged events",[]}]}, >>>> {data,[{"State",{state,[]}}]}]]} >>>> 2> P = self(), >>>> 2> sys:install( >>>> 2> disk_log_server, >>>> 2> {fun(_Acc, Event, State) -> P ! {trace, Event, State} end, >>>> 2> nodata} >>>> 2> ). >>>> ok >>>> 3> disk_log_server ! fake_data. >>>> fake_data >>>> 4> flush(). >>>> Shell got {trace,{in,fake_data},disk_log_server} >>>> Shell got {trace,{noreply,{state,[]}},disk_log_server} >>>> ok >>>> >>>> Those won't let you see arbitrary calls being made, but if you have a >>>> process chain A -> B -> C, then you can, by looking at the traces of >>>> all >>>> three processes, track the history of a call and the consequences they >>>> have. >>>> >>>> The sys module is full of really cool functionality few people know >>>> about, and that can make live debugging, but also testing much simpler. >>>> >>>> > >>>> >I haven't found a nice solution yet, so I suppose I am using OTP in a >>>> wrong >>>> >way (maybe it's not a good fit for my project), or I am choosing the >>>> wrong >>>> >architecture, or that I am missing key knowledge about how to test >>>> things >>>> >in Erlang. >>>> >>>> There aren't enough details to know at this point. I frequently just >>>> use >>>> `meck' (https://github.com/eproxus/meck) as a library, which lets you >>>> replace arbitrary function calls through hot code loadig, get traces >>>> and >>>> counts of all calls and values returned of unmodified code, and so on. >>>> >>>> If what you're looking for is a way to track side-effects in a very >>>> whitebox manner, meck is hard to beat. >>>> >>>> > >>>> >Can anyone shed some light on this questions? Thanks in advance! >>>> >>>> please provide more details about the nature of the side-effects you >>>> are >>>> trying to observe in a unit test. My default reflex would be to say >>>> that >>>> the moment you're testing side-effects, you are doing integration >>>> testing. >>>> >>>> Regards, >>>> Fred. >>>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> >> >> -- >> J. >> > -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From roehst@REDACTED Fri Aug 31 21:37:15 2018 From: roehst@REDACTED (Rodrigo Stevaux) Date: Fri, 31 Aug 2018 16:37:15 -0300 Subject: [erlang-questions] Unidirectional architectures in Erlang In-Reply-To: References: <20180830233307.GE801@ferdmbp.local> Message-ID: Great man, I think this is what I was looking after. Exactly this! Em sex, 31 de ago de 2018 ?s 16:33, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> escreveu: > QuickCheck has eqc_temporal (which is a temporal monad). I don't think > proper currently implements the interface, but it isn't too hard to write > it yourself if you want to attack the problem. > > You generate random commands like in a statem model. > The system-under-test (SUT) generates trace events. > You stuff those trace events into eqc_temporal or equivalent. > You ask properties of the eqc_temporal trace representation, failing the > test if the rules are broken. > > > On Fri, Aug 31, 2018 at 9:29 PM Rodrigo Stevaux wrote: > >> This brings the question, is there a library for writing temporal >> properties for testing with quickcheck or proper? I mean properties that >> say something about the sequence of trace messages and not about the >> contents of the list of trace mssages for example. >> >> Em sex, 31 de ago de 2018 ?s 16:24, Jesper Louis Andersen < >> jesper.louis.andersen@REDACTED> escreveu: >> >>> Hi, >>> >>> I've used the sys module more than once, in both debugging and testing. >>> It is useful, also because you can use sys:log/2,3 to have a trace log of a >>> running process and inspect it later. >>> >>> Another approach I've used is to add trace messages to a system. A >>> module defines this function: >>> >>> report_event(_DetailLevel, _From, _To, _Label, _Contents) -> >>> hopefully_traced. >>> >>> And you call it in your system. Now, you can attach a tracer to this >>> call in tests and verify the trace you get is what you expect. This allows >>> you to "see inside" your system and verify its behavior. More advanced >>> solutions involves rewriting traces into the notion of a temporal monad and >>> then asking questions on the trace for correctness. >>> >>> Yet another approach is to rewrite your code into a computational (pure) >>> part which sets up a set of actions but has no effect, and an effectful >>> part which runs said actions. This allows you to scrutinize the actions >>> without having to bind your system up. Look up, e.g., the Elm architecture >>> for this approach. The basic idea is that of a free monad: rather than >>> running the program, return a command set which can be interpreted either >>> as a test (where the effects are logged) or as a real system (where the >>> effects are run). We do this at $WORK, which means we can test all of our >>> stack without ever having to run the system as a whole in unit tests. In >>> fact, we don't even need a database, or supervisor tree, since we just >>> simulate the universe around a process. Integration tests are run later via >>> a QuickCheck like tool written by Martin Gausby - treating the system as a >>> black box and poking it from the outside to verify we can glue things >>> together as expected. >>> >>> >>> On Fri, Aug 31, 2018 at 7:07 PM Rodrigo Stevaux >>> wrote: >>> >>>> yes, we fundamentally are trying to do integration testing. >>>> >>>> unit testing process communication pairwise by sending a message to the >>>> parent process is something we tried to do and it worked reasonably well. >>>> but we want to know that the whole composition of processes works well. >>>> >>>> the challenge we found on that approach is that the processes have >>>> names and we would have to find a way to inject the pid of the "next" >>>> process in the chain and make it the test process during testing and other >>>> process during production (which can be done with a little bit of >>>> instrumentation and conditional compiling -- we are on Elixir actually). >>>> >>>> is using the "sys" module a regular practice? >>>> >>>> thanks for the reply. >>>> >>>> Em qui, 30 de ago de 2018 ?s 20:33, Fred Hebert >>>> escreveu: >>>> >>>>> On 08/30, Rodrigo Stevaux wrote: >>>>> >Message comes in, logic applies, message goes out. >>>>> >The generic servers are very easy to test in a pure fashion: just >>>>> test the >>>>> >return values of handle_call for a given state. >>>>> > >>>>> >>>>> That can be done as a regular unit test, yes. >>>>> >>>>> >But: >>>>> >- unit testing should test that the unit under test forwards a >>>>> message to a >>>>> >given address (and that is not reflected on the handle_call return >>>>> value) >>>>> >>>>> Aside from using mocks to know that the proper function calls have >>>>> taken >>>>> place, you can't easily test the forwarding of messages since that >>>>> would >>>>> imply side-effects turning your unit tests into integration tests. >>>>> >>>>> >- doing the integration testing of a "pipeline" of process involves >>>>> testing >>>>> >that ultimately a message gets to the last process. >>>>> > >>>>> >>>>> Yes and no. You can test that each element of the chain properly >>>>> forwards data to the right destination. You can do that if you make >>>>> the >>>>> endpoint/address/destination for each forwarded message parametrizable >>>>> or configurable. Forward the data to the test process instead to >>>>> confirm >>>>> that the right side-effect has taken place. >>>>> >>>>> This lets you test each section of the chain in isolation; then if all >>>>> sections are well-behaved, you can infer that the whole chain should >>>>> behave well. You can confirm that with a more naive end-to-end test, >>>>> knowing that individual components are tested more thoroughly. >>>>> >>>>> >Given the maturity of Erlang, I'd expect to promptly find solutions >>>>> to this >>>>> >case. >>>>> >>>>> On top of the techniques above, you can try using the `sys' module to >>>>> introspect all OTP behaviours and look at their transitions as a >>>>> neutral >>>>> observer: >>>>> >>>>> 1> sys:get_status(disk_log_server). >>>>> {status,<0.75.0>, >>>>> {module,gen_server}, >>>>> [[{<0.76.0>,'$#group_history'}, >>>>> {'$initial_call',{disk_log_server,init,1}}, >>>>> {'$ancestors',[kernel_safe_sup,kernel_sup,<0.45.0>]}], >>>>> running,<0.66.0>,[], >>>>> [{header,"Status for generic server disk_log_server"}, >>>>> {data,[{"Status",running}, >>>>> {"Parent",<0.66.0>}, >>>>> {"Logged events",[]}]}, >>>>> {data,[{"State",{state,[]}}]}]]} >>>>> 2> P = self(), >>>>> 2> sys:install( >>>>> 2> disk_log_server, >>>>> 2> {fun(_Acc, Event, State) -> P ! {trace, Event, State} end, >>>>> 2> nodata} >>>>> 2> ). >>>>> ok >>>>> 3> disk_log_server ! fake_data. >>>>> fake_data >>>>> 4> flush(). >>>>> Shell got {trace,{in,fake_data},disk_log_server} >>>>> Shell got {trace,{noreply,{state,[]}},disk_log_server} >>>>> ok >>>>> >>>>> Those won't let you see arbitrary calls being made, but if you have a >>>>> process chain A -> B -> C, then you can, by looking at the traces of >>>>> all >>>>> three processes, track the history of a call and the consequences they >>>>> have. >>>>> >>>>> The sys module is full of really cool functionality few people know >>>>> about, and that can make live debugging, but also testing much simpler. >>>>> >>>>> > >>>>> >I haven't found a nice solution yet, so I suppose I am using OTP in a >>>>> wrong >>>>> >way (maybe it's not a good fit for my project), or I am choosing the >>>>> wrong >>>>> >architecture, or that I am missing key knowledge about how to test >>>>> things >>>>> >in Erlang. >>>>> >>>>> There aren't enough details to know at this point. I frequently just >>>>> use >>>>> `meck' (https://github.com/eproxus/meck) as a library, which lets you >>>>> replace arbitrary function calls through hot code loadig, get traces >>>>> and >>>>> counts of all calls and values returned of unmodified code, and so on. >>>>> >>>>> If what you're looking for is a way to track side-effects in a very >>>>> whitebox manner, meck is hard to beat. >>>>> >>>>> > >>>>> >Can anyone shed some light on this questions? Thanks in advance! >>>>> >>>>> please provide more details about the nature of the side-effects you >>>>> are >>>>> trying to observe in a unit test. My default reflex would be to say >>>>> that >>>>> the moment you're testing side-effects, you are doing integration >>>>> testing. >>>>> >>>>> Regards, >>>>> Fred. >>>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>> >>> >>> -- >>> J. >>> >> > > -- > J. > -------------- next part -------------- An HTML attachment was scrubbed... URL: