From codewiget95@REDACTED Mon Jan 1 01:23:40 2018 From: codewiget95@REDACTED (asdf asdf) Date: Sun, 31 Dec 2017 19:23:40 -0500 Subject: [erlang-questions] TLS 1.3 Development Message-ID: <00780945-a912-4ec1-ab04-1ea34b05b74d@Spark> Hello, I saw a post from a few months ago here:?http://erlang.org/pipermail/erlang-questions/2017-August/093136.html?about adding support for TLS 1.3 to the new OTP, and I am curious about the status of this and how I could get involved. I have made a deal of modifications to the underlying OTP ssl module to suit my businesses needs, and I believe I could help in the development. In the post I linked, the responder mentioned that there are many unknowns with the new TLS implementation, which is definitely true, but there are those who have implemented it successfully - both WolfSSL and OpenSSL support this (C implementation). TLS 1.3 has huge advantages for embedded/iot devices - it reduces the number of RTTs which is huge for customers with data and processing constraints. For companies managing millions of devices, this would add huge cost savings, not to mention the increased levels of security. This will be a great advantage for Erlang to have. Is there any work being done currently on development, and is it possible for a Non-Erricson employee to contribute? Thanks for your help -------------- next part -------------- An HTML attachment was scrubbed... URL: From goodjoe2049@REDACTED Mon Jan 1 19:06:28 2018 From: goodjoe2049@REDACTED (Joe K) Date: Mon, 1 Jan 2018 21:06:28 +0300 Subject: [erlang-questions] socket argument for ssl_connection:socket_control In-Reply-To: References: Message-ID: Thanks, Danil! On Sun, Dec 31, 2017 at 5:57 PM, Danil Zagoskin wrote: > Hi! > > It's because a socket in ssl app (TLS, DTLS) is an Erlang process. > Port is used internally only for TCP/UDP transport, and higher-level > operations (handshake, encoding, decoding, etc.) are performed by a > dedicated worker written in Erlang. > A tuple you see is needed to identify that worker. It also contains some > other data, but the main part is the worker pid. > > On Sun, Dec 31, 2017 at 4:41 PM, Joe K wrote: > >> Why is socket not a port, but a tuple for dtls_connection? >> >> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_co >> nnection.erl#L164 >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > > -- > Danil Zagoskin | z@REDACTED > -------------- next part -------------- An HTML attachment was scrubbed... URL: From goodjoe2049@REDACTED Mon Jan 1 19:11:51 2018 From: goodjoe2049@REDACTED (Joe K) Date: Mon, 1 Jan 2018 21:11:51 +0300 Subject: [erlang-questions] dtls error when used with chrome webrtc In-Reply-To: References: Message-ID: Sorry for bothering you, Danil, but I was trying to make something like `dtls:ssl_accept` work on udp sockets and then thought I would get more STUN requests to keep the connection in NATs "alive" after I finally `sslaccept` the socket. Would I have to somehow downgrade the dtls session back to udp? Or is there some other way? Right now I'm thinking about a hacky approach: forking erlang's ssl library and checking for STUN packets in every `handle_datagram` call in `dtls_udp_listener`. And thank you again, you've been incredibly helpful. On Fri, Dec 29, 2017 at 5:55 PM, Facundo Olano < facundo.olano@REDACTED> wrote: > Hi Danil! > > The server code is for signaling (using websockets), but it also includes > processone/stun as a dependency, so > it handles STUN/TURN as well. It also contains a couple of example > applications that server javascript clients that connect to the server > (both for signaling and ICE). The multiparty example uses a mesh. > > To be honest I don't know what DTLS+SRTP is about :P > > Thanks, > Facundo. > > On Fri, Dec 29, 2017 at 11:47 AM, Danil Zagoskin wrote: > >> Hi Federico! >> >> Is it just signalling server? >> E.g. do you handle all the DTLS+SRTP stuff or just build a full mesh of >> participants? >> >> On Fri, Dec 29, 2017 at 4:48 PM, Federico Carrone < >> federico.carrone@REDACTED> wrote: >> >>> Joe, >>> >>> We are creating an open source erlang webrtc server replacement for >>> appear.in. You can check it here: https://github.com/lambdaclass >>> /webrtc-server >>> >>> We are using the processone stun library. I am not sure if this mail is >>> of any help but might be interested in checking it since it is working fine. >>> >>> Regards, >>> Federico. >>> >>> On Fri, Dec 29, 2017 at 9:15 AM, Joe K wrote: >>> >>>> Tried this, hoped it would work, but it didn't ... >>>> >>>> 1> {ok, Socket} = gen_udp:open(9090, [binary, {active, false}]). >>>> {ok,#Port<0.441>} >>>> 2> dtls:connect(Socket, []). >>>> {error,{options,{not_supported,{packet,0}}}} >>>> >>>> On Fri, Dec 29, 2017 at 2:21 PM, Joe K wrote: >>>> >>>>> > Also you may try using external STUN server (check RTCPeerConnection >>>>> docs) and hope browser starts with DTLS hello. >>>>> >>>>> I've tried that, but the browser still sends STUN binding requests to >>>>> the DTLS process. And it uses the STUN server just to find out it's address. >>>>> >>>>> > It should be quite easy to implement and it would be consistent >>>>> with ssl:connect/2 and ssl:ssl_accept for TCP sockets. >>>>> >>>>> Will try this now. Thank you. >>>>> >>>>> On Thu, Dec 28, 2017 at 4:34 PM, Danil Zagoskin wrote: >>>>> >>>>>> > But now I don't know how to reply to both STUN binding request and >>>>>> then setup a DTLS session using erlang's ssl module. >>>>>> Yes, dtls implementation lacks support of starting/accepting a >>>>>> handshake over existing socket. >>>>>> It should be quite easy to implement and it would be consistent with >>>>>> ssl:connect/2 and ssl:ssl_accept for TCP sockets. >>>>>> >>>>>> Also you may try using external STUN server (check RTCPeerConnection >>>>>> docs) and hope browser starts with DTLS hello. >>>>>> If you try this, please share the results. >>>>>> >>>>>> On Thu, Dec 28, 2017 at 3:26 PM, Joe K wrote: >>>>>> >>>>>>> Oops, I forgot to reply to the mailing list in my last email. >>>>>>> >>>>>>> The response was >>>>>>> >>>>>>> > Maybe browser sends STUN requests to your port when you expect >>>>>>> DTLS hello? >>>>>>> You are absolutely right, Wireshark shows that there are lots of >>>>>>> STUN binding requests being made, I didn't think of that. >>>>>>> >>>>>>> > Do you use external STUN server? >>>>>>> I don't use external STUN servers ... For some reason, I didn't >>>>>>> think I would need them. >>>>>>> >>>>>>> > Also try checking chrome://webrtc-internals and chrome://webrtc-logs >>>>>>> for browser's view on what's going on. >>>>>>> chrome://webrtc-logs is empty for the webrtc whole session. >>>>>>> >>>>>>> But now I don't know how to reply to both STUN binding request and >>>>>>> then setup a DTLS session using erlang's ssl module. >>>>>>> >>>>>>> On Thu, Dec 28, 2017 at 1:28 AM, Danil Zagoskin wrote: >>>>>>> >>>>>>>> Hi! >>>>>>>> What do you see in Wireshark? >>>>>>>> Did you see handshake between two browsers? >>>>>>>> Is your application ready to receive the packet sent by browser? >>>>>>>> Do you use external STUN server? >>>>>>>> Maybe browser sends STUN requests to your port when you expect DTLS >>>>>>>> hello? >>>>>>>> >>>>>>>> Also try checking chrome://webrtc-internals and chrome://webrtc-logs >>>>>>>> for browser's view on what's going on. >>>>>>>> >>>>>>>> >>>>>>>> On Thu, Dec 28, 2017 at 12:09 AM, Joe K >>>>>>>> wrote: >>>>>>>> >>>>>>>>> I'm trying to implement parts of webrtc stack with elixir/erlang >>>>>>>>> and currently am stuck with setting up a dtls session. >>>>>>>>> >>>>>>>>> The minimal example is, I think, the following (in console, erlang >>>>>>>>> 20.2.2): >>>>>>>>> >>>>>>>>> 2> ssl:start(). >>>>>>>>> ok >>>>>>>>> 3> {ok, ListenSocket} = ssl:listen(8090, [ >>>>>>>>> 3> binary, >>>>>>>>> 3> {ip, {0, 0, 0, 0}}, >>>>>>>>> 3> {protocol, dtls}, >>>>>>>>> 3> {keyfile, <<"priv/server.key">>}, >>>>>>>>> 3> {certfile, <<"priv/server.pem">>}, >>>>>>>>> 3> {active, false} >>>>>>>>> 3> ]). >>>>>>>>> {ok, ...} >>>>>>>>> 4> {ok, AcceptSocket} = ssl:transport_accept(ListenSocket). >>>>>>>>> {ok,...} >>>>>>>>> 5> ssl:ssl_accept(AcceptSocket). >>>>>>>>> {error,{tls_alert,"record overflow"}} >>>>>>>>> >>>>>>>>> And js (with chrome canary): https://gist.github.c >>>>>>>>> om/idi-ot/a07b7330ff02f90373a2dcfe83883afa >>>>>>>>> >>>>>>>>> After {error,{tls_alert,"record overflow"}} the >>>>>>>>> RTCPeerConnection's iceConnectionState becomes "failed" and the connection >>>>>>>>> itself "closed". >>>>>>>>> >>>>>>>>> I wonder what I am doing wrong. >>>>>>>>> >>>>>>>>> openssl s_client -dtls1 -connect 127.0.0.1:8089 -debug >>>>>>>>> >>>>>>>>> works fine with the code snippet above. >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> erlang-questions mailing list >>>>>>>>> erlang-questions@REDACTED >>>>>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Danil Zagoskin | z@REDACTED >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Danil Zagoskin | z@REDACTED >>>>>> >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >> >> >> -- >> Danil Zagoskin | z@REDACTED >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From goodjoe2049@REDACTED Mon Jan 1 19:14:53 2018 From: goodjoe2049@REDACTED (Joe K) Date: Mon, 1 Jan 2018 21:14:53 +0300 Subject: [erlang-questions] dtls error when used with chrome webrtc In-Reply-To: References: Message-ID: I've also been thinking about turning the server into a TURN server which would relay packets to itself, but for that I would still have to handle Allocate STUN requests. On Mon, Jan 1, 2018 at 9:11 PM, Joe K wrote: > Sorry for bothering you, Danil, but I was trying to make something like > `dtls:ssl_accept` work on udp sockets and then thought I would get more > STUN requests to keep the connection in NATs "alive" after I finally > `sslaccept` the socket. Would I have to somehow downgrade the dtls session > back to udp? Or is there some other way? > > Right now I'm thinking about a hacky approach: forking erlang's ssl > library and checking for STUN packets in every `handle_datagram` call in > `dtls_udp_listener`. > > And thank you again, you've been incredibly helpful. > > On Fri, Dec 29, 2017 at 5:55 PM, Facundo Olano < > facundo.olano@REDACTED> wrote: > >> Hi Danil! >> >> The server code is for signaling (using websockets), but it also includes >> processone/stun as a dependency, so >> it handles STUN/TURN as well. It also contains a couple of example >> applications that server javascript clients that connect to the server >> (both for signaling and ICE). The multiparty example uses a mesh. >> >> To be honest I don't know what DTLS+SRTP is about :P >> >> Thanks, >> Facundo. >> >> On Fri, Dec 29, 2017 at 11:47 AM, Danil Zagoskin wrote: >> >>> Hi Federico! >>> >>> Is it just signalling server? >>> E.g. do you handle all the DTLS+SRTP stuff or just build a full mesh of >>> participants? >>> >>> On Fri, Dec 29, 2017 at 4:48 PM, Federico Carrone < >>> federico.carrone@REDACTED> wrote: >>> >>>> Joe, >>>> >>>> We are creating an open source erlang webrtc server replacement for >>>> appear.in. You can check it here: https://github.com/lambdaclass >>>> /webrtc-server >>>> >>>> We are using the processone stun library. I am not sure if this mail is >>>> of any help but might be interested in checking it since it is working fine. >>>> >>>> Regards, >>>> Federico. >>>> >>>> On Fri, Dec 29, 2017 at 9:15 AM, Joe K wrote: >>>> >>>>> Tried this, hoped it would work, but it didn't ... >>>>> >>>>> 1> {ok, Socket} = gen_udp:open(9090, [binary, {active, false}]). >>>>> {ok,#Port<0.441>} >>>>> 2> dtls:connect(Socket, []). >>>>> {error,{options,{not_supported,{packet,0}}}} >>>>> >>>>> On Fri, Dec 29, 2017 at 2:21 PM, Joe K wrote: >>>>> >>>>>> > Also you may try using external STUN server (check >>>>>> RTCPeerConnection docs) and hope browser starts with DTLS hello. >>>>>> >>>>>> I've tried that, but the browser still sends STUN binding requests to >>>>>> the DTLS process. And it uses the STUN server just to find out it's address. >>>>>> >>>>>> > It should be quite easy to implement and it would be consistent >>>>>> with ssl:connect/2 and ssl:ssl_accept for TCP sockets. >>>>>> >>>>>> Will try this now. Thank you. >>>>>> >>>>>> On Thu, Dec 28, 2017 at 4:34 PM, Danil Zagoskin wrote: >>>>>> >>>>>>> > But now I don't know how to reply to both STUN binding request >>>>>>> and then setup a DTLS session using erlang's ssl module. >>>>>>> Yes, dtls implementation lacks support of starting/accepting a >>>>>>> handshake over existing socket. >>>>>>> It should be quite easy to implement and it would be consistent with >>>>>>> ssl:connect/2 and ssl:ssl_accept for TCP sockets. >>>>>>> >>>>>>> Also you may try using external STUN server (check RTCPeerConnection >>>>>>> docs) and hope browser starts with DTLS hello. >>>>>>> If you try this, please share the results. >>>>>>> >>>>>>> On Thu, Dec 28, 2017 at 3:26 PM, Joe K >>>>>>> wrote: >>>>>>> >>>>>>>> Oops, I forgot to reply to the mailing list in my last email. >>>>>>>> >>>>>>>> The response was >>>>>>>> >>>>>>>> > Maybe browser sends STUN requests to your port when you expect >>>>>>>> DTLS hello? >>>>>>>> You are absolutely right, Wireshark shows that there are lots of >>>>>>>> STUN binding requests being made, I didn't think of that. >>>>>>>> >>>>>>>> > Do you use external STUN server? >>>>>>>> I don't use external STUN servers ... For some reason, I didn't >>>>>>>> think I would need them. >>>>>>>> >>>>>>>> > Also try checking chrome://webrtc-internals and chrome://webrtc-logs >>>>>>>> for browser's view on what's going on. >>>>>>>> chrome://webrtc-logs is empty for the webrtc whole session. >>>>>>>> >>>>>>>> But now I don't know how to reply to both STUN binding request and >>>>>>>> then setup a DTLS session using erlang's ssl module. >>>>>>>> >>>>>>>> On Thu, Dec 28, 2017 at 1:28 AM, Danil Zagoskin wrote: >>>>>>>> >>>>>>>>> Hi! >>>>>>>>> What do you see in Wireshark? >>>>>>>>> Did you see handshake between two browsers? >>>>>>>>> Is your application ready to receive the packet sent by browser? >>>>>>>>> Do you use external STUN server? >>>>>>>>> Maybe browser sends STUN requests to your port when you expect >>>>>>>>> DTLS hello? >>>>>>>>> >>>>>>>>> Also try checking chrome://webrtc-internals and chrome://webrtc-logs >>>>>>>>> for browser's view on what's going on. >>>>>>>>> >>>>>>>>> >>>>>>>>> On Thu, Dec 28, 2017 at 12:09 AM, Joe K >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> I'm trying to implement parts of webrtc stack with elixir/erlang >>>>>>>>>> and currently am stuck with setting up a dtls session. >>>>>>>>>> >>>>>>>>>> The minimal example is, I think, the following (in console, >>>>>>>>>> erlang 20.2.2): >>>>>>>>>> >>>>>>>>>> 2> ssl:start(). >>>>>>>>>> ok >>>>>>>>>> 3> {ok, ListenSocket} = ssl:listen(8090, [ >>>>>>>>>> 3> binary, >>>>>>>>>> 3> {ip, {0, 0, 0, 0}}, >>>>>>>>>> 3> {protocol, dtls}, >>>>>>>>>> 3> {keyfile, <<"priv/server.key">>}, >>>>>>>>>> 3> {certfile, <<"priv/server.pem">>}, >>>>>>>>>> 3> {active, false} >>>>>>>>>> 3> ]). >>>>>>>>>> {ok, ...} >>>>>>>>>> 4> {ok, AcceptSocket} = ssl:transport_accept(ListenSocket). >>>>>>>>>> {ok,...} >>>>>>>>>> 5> ssl:ssl_accept(AcceptSocket). >>>>>>>>>> {error,{tls_alert,"record overflow"}} >>>>>>>>>> >>>>>>>>>> And js (with chrome canary): https://gist.github.c >>>>>>>>>> om/idi-ot/a07b7330ff02f90373a2dcfe83883afa >>>>>>>>>> >>>>>>>>>> After {error,{tls_alert,"record overflow"}} the >>>>>>>>>> RTCPeerConnection's iceConnectionState becomes "failed" and the connection >>>>>>>>>> itself "closed". >>>>>>>>>> >>>>>>>>>> I wonder what I am doing wrong. >>>>>>>>>> >>>>>>>>>> openssl s_client -dtls1 -connect 127.0.0.1:8089 -debug >>>>>>>>>> >>>>>>>>>> works fine with the code snippet above. >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> erlang-questions mailing list >>>>>>>>>> erlang-questions@REDACTED >>>>>>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> Danil Zagoskin | z@REDACTED >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Danil Zagoskin | z@REDACTED >>>>>>> >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>>>> >>>> >>> >>> >>> -- >>> Danil Zagoskin | z@REDACTED >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fxn@REDACTED Mon Jan 1 20:43:31 2018 From: fxn@REDACTED (Xavier Noria) Date: Mon, 1 Jan 2018 20:43:31 +0100 Subject: [erlang-questions] start/stop applications without a callback module Message-ID: Trying to get the vocabulary right for OTP applications without a callback module. Does the application controller spawn an application master process for applications without callback modules? If yes, with what purpose? Do you still call that "starting" the application even though there is no `start/2` callback to invoke? Are applications without callback modules also "stopped" in some sense? I mean, do you use the verb "stop" for them even though there is no `stop/1` callback to invoke? And if yes, what does "stopping" do? Is there an official or common term to refer to "application without a callback module", and "application with a callback module"? -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Mon Jan 1 20:58:40 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 1 Jan 2018 20:58:40 +0100 Subject: [erlang-questions] start/stop applications without a callback module In-Reply-To: References: Message-ID: <8850ee2c-5af8-e874-f79d-9f214ff51e50@ninenines.eu> On 01/01/2018 08:43 PM, Xavier Noria wrote: > Trying to get the vocabulary right for OTP applications without a > callback module. > > Does the application controller spawn an application master process for > applications without callback modules? If yes, with what purpose? Do you > still call that "starting" the application even though there is no > `start/2` callback to invoke? All applications can be started. > Are applications without callback modules also "stopped" in some sense? > I mean, do you use the verb "stop" for them even though there is no > `stop/1` callback to invoke? And if yes, what does "stopping" do? All applications can also be stopped. For library applications (those without a callback module) it doesn't do a whole lot, just registers the application as being started (or not) and triggers some events for SASL and other. > Is there an official or common term to refer to "application without a > callback module", and "application with a callback module"? Library application and application, I don't think the latter has a specific name. All details are in this chapter: http://erlang.org/doc/design_principles/applications.html -- Lo?c Hoguin https://ninenines.eu From fxn@REDACTED Mon Jan 1 21:55:13 2018 From: fxn@REDACTED (Xavier Noria) Date: Mon, 01 Jan 2018 20:55:13 +0000 Subject: [erlang-questions] start/stop applications without a callback module In-Reply-To: <8850ee2c-5af8-e874-f79d-9f214ff51e50@ninenines.eu> References: <8850ee2c-5af8-e874-f79d-9f214ff51e50@ninenines.eu> Message-ID: Awesome, thanks Lo?c! On Mon, 1 Jan 2018 at 20:58, Lo?c Hoguin wrote: > On 01/01/2018 08:43 PM, Xavier Noria wrote: > > Trying to get the vocabulary right for OTP applications without a > > callback module. > > > > Does the application controller spawn an application master process for > > applications without callback modules? If yes, with what purpose? Do you > > still call that "starting" the application even though there is no > > `start/2` callback to invoke? > > All applications can be started. > > > Are applications without callback modules also "stopped" in some sense? > > I mean, do you use the verb "stop" for them even though there is no > > `stop/1` callback to invoke? And if yes, what does "stopping" do? > > All applications can also be stopped. > > For library applications (those without a callback module) it doesn't do > a whole lot, just registers the application as being started (or not) > and triggers some events for SASL and other. > > > Is there an official or common term to refer to "application without a > > callback module", and "application with a callback module"? > > Library application and application, I don't think the latter has a > specific name. > > All details are in this chapter: > http://erlang.org/doc/design_principles/applications.html > > -- > Lo?c Hoguin > https://ninenines.eu > -- Sent from Gmail Mobile -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Mon Jan 1 22:15:48 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 2 Jan 2018 00:15:48 +0300 Subject: [erlang-questions] Using SQLite3 in Erlang In-Reply-To: <29E0A8B6-2A48-46D2-8BCA-5D325D6BEF78@licenser.net> References: <29E0A8B6-2A48-46D2-8BCA-5D325D6BEF78@licenser.net> Message-ID: Using https://github.com/alexeyr/erlang-sqlite3 -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Mon Jan 1 22:16:39 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 2 Jan 2018 00:16:39 +0300 Subject: [erlang-questions] [ANN] locus: Geolocation and ASN lookup of IP addresses In-Reply-To: References: Message-ID: what is the difference from https://github.com/mochi/egeoip ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Mon Jan 1 22:19:17 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 2 Jan 2018 00:19:17 +0300 Subject: [erlang-questions] dtls error when used with chrome webrtc In-Reply-To: References: Message-ID: Danil was asking, because we have spend enormous time in flussonic at making full webrtc _server_, not only a communication point. DTLS + SRTP is only a beginning of problems =( -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlsson.richard@REDACTED Mon Jan 1 22:37:02 2018 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Mon, 1 Jan 2018 22:37:02 +0100 Subject: [erlang-questions] start/stop applications without a callback module In-Reply-To: <8850ee2c-5af8-e874-f79d-9f214ff51e50@ninenines.eu> References: <8850ee2c-5af8-e874-f79d-9f214ff51e50@ninenines.eu> Message-ID: 2018-01-01 20:58 GMT+01:00 Lo?c Hoguin : > On 01/01/2018 08:43 PM, Xavier Noria wrote: > >> Is there an official or common term to refer to "application without a >> callback module", and "application with a callback module"? >> > > Library application and application, I don't think the latter has a > specific name. > For our book (Erlang & OTP in Action), we chose to call them "active applications". Not sure if it's caught on anywhere. /Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Mon Jan 1 22:44:52 2018 From: g@REDACTED (Guilherme Andrade) Date: Mon, 1 Jan 2018 21:44:52 +0000 Subject: [erlang-questions] [ANN] locus: Geolocation and ASN lookup of IP addresses In-Reply-To: References: Message-ID: Hi Max, On 1 January 2018 at 21:16, Max Lapshin wrote: > what is the difference from https://github.com/mochi/egeoip ? > My original motivation in writing this library was indeed to create a modern replacement for egeoip, which I've depended upon for the past few years. Some of the things I desired: 1) Not having snapshots of the database committed into the repository - This makes the repository grow over time and cloning it taking ever longer. 2) Making database updates seamless - Which was solved by loading them from network (closely related to 1.) - Caching on the local file system is then leveraged to reduce potentially reduced reliability. - In order to not consume too much bandwidth, conditional HTTP requests are used whenever possible. 3) Support for the GeoLite2 databases - GeoLite Legacy databases are being discontinued and will no longer receive updates after April 2018. 4) Less rigidly structured entries - Which was solved by returning entries as maps instead of records and having the code be particularly unopinionated about what data those entries contain. 5) Not having a limited number of workers as a potential bottleneck - This was solved by sharing the different database sections as reference-counted binaries through ETS -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From fxn@REDACTED Tue Jan 2 00:20:21 2018 From: fxn@REDACTED (Xavier Noria) Date: Tue, 2 Jan 2018 00:20:21 +0100 Subject: [erlang-questions] start/stop applications without a callback module In-Reply-To: References: <8850ee2c-5af8-e874-f79d-9f214ff51e50@ninenines.eu> Message-ID: On Mon, Jan 1, 2018 at 10:37 PM, Richard Carlsson < carlsson.richard@REDACTED> wrote: 2018-01-01 20:58 GMT+01:00 Lo?c Hoguin : > >> On 01/01/2018 08:43 PM, Xavier Noria wrote: >> >>> Is there an official or common term to refer to "application without a >>> callback module", and "application with a callback module"? >>> >> >> Library application and application, I don't think the latter has a >> specific name. >> > > For our book (Erlang & OTP in Action), we chose to call them "active > applications". Not sure if it's caught on anywhere. > I see Erlang in Anger uses "regular applications". -------------- next part -------------- An HTML attachment was scrubbed... URL: From fxn@REDACTED Tue Jan 2 09:23:42 2018 From: fxn@REDACTED (Xavier Noria) Date: Tue, 2 Jan 2018 09:23:42 +0100 Subject: [erlang-questions] start/stop applications without a callback module In-Reply-To: References: <8850ee2c-5af8-e874-f79d-9f214ff51e50@ninenines.eu> Message-ID: If library applications are started and stopped, this paragraph in the official OTP intro to applications is accurate *When you have written code implementing some specific functionality you might want to make the code into an application, that is, a component that can be started and stopped as a unit, and which can also be reused in other systems.* but the next one says *To do this, create an application callback module, and describe how the application is to be started and stopped.* and that may mislead the reader I think. To start, stop, and reuse and application, you do not need to create an application callback module. You need if you want run custom code when it starts or stops. Should it be reworded? (Could volunteer a patch.) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Tue Jan 2 10:50:12 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 2 Jan 2018 10:50:12 +0100 Subject: [erlang-questions] Windows Patch Packages? In-Reply-To: References: Message-ID: Hi! 2017-12-21 14:56 GMT+01:00 Jeroen Roovers : > Hi everyone, > > > On 21 December 2017 at 14:07, Onorio Catenacci wrote: > > I would say that it's most likely that if you need those patch packages > > I would think most people want or indeed need security patches. > I would think so too. However this patch was handled the same way as any other not planned patch release. And you do not need to rebuild OTP to use it, it is enough to rebuild the ssl source files only. This should be easy enough as it is only Erlang code. We will consider if we should have some special handling for security patches in the future. Regards Ingela Erlang/OTP Team - Ericsson AB > > > you'll need to pull source and build it on your own machine. > > I know I probably should have created a new thread, but I build from > source (for an embedded Linux system) and I have looked at the patch > release news for a while now, and I simply don't see proper > instructions on how to turn the patch release tags from > https://github.com/erlang/otp/releases into something resembling the > OTP releases from the main download site. It looks like > https://github.com/erlang/otp/ is missing all these bundled modules. > If there is a way to update these while building, then I would like to > know how that works, and also how that would work when > cross-compiling. > > Using buildroot https://buildroot.org/ means creating a host build > (native to the build system) first and using it to create a target > build (native to the target system). This complicates steps involved > in what I can only assume means running a script (or compiles native > code?) that downloads the missing modules. > > See also https://git.buildroot.net/buildroot/tree/package/erlang/erlang.mk > > What puzzles me is that if you're going to announce a security > release, then why does the download page not mention that what you > download from there might be vulnerable? And in the same vein, I can > only guess that some very good reasons are stopping the OTP team from > packaging patch releases for distribution? What constraints might > those be? > > > Kind regards, > jer > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Tue Jan 2 11:17:23 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 2 Jan 2018 11:17:23 +0100 Subject: [erlang-questions] TLS 1.3 Development In-Reply-To: <00780945-a912-4ec1-ab04-1ea34b05b74d@Spark> References: <00780945-a912-4ec1-ab04-1ea34b05b74d@Spark> Message-ID: Hello! 2018-01-01 1:23 GMT+01:00 asdf asdf : > Hello, > > I saw a post from a few months ago here: http://erlang.org/ > pipermail/erlang-questions/2017-August/093136.html about adding support > for TLS 1.3 to the new OTP, and I am curious about the status of this and > how I could get involved. I have made a deal of modifications to the > underlying OTP ssl module to suit my businesses needs, and I believe I > could help in the development. > > > In the post I linked, the responder mentioned that there are many unknowns > with the new TLS implementation, which is definitely true, but there are > those who have implemented it successfully - both WolfSSL and OpenSSL > support this (C implementation). > > TLS 1.3 has huge advantages for embedded/iot devices - it reduces the > number of RTTs which is huge for customers with data and processing > constraints. For companies managing millions of devices, this would add > huge cost savings, not to mention the increased levels of security. This > will be a great advantage for Erlang to have. > > Is there any work being done currently on development, and is it possible > for a Non-Erricson employee to contribute? > > Thanks for your help > > The way you may contribute is to make PR (pull requests). My team is responsible for TLS development and we have done some preparations for TLS-1.3 but we have not added any TLS-1.3 specific code yet. The latest changes was to handle cipher suites as maps instead of tuples internally.We are thinking of moving the API that way too. To make contributing easier for us both if would be helpful if you can make small logical steps implementing some part of the code needed for TLS-1.3 support. If you need/want to make changes the does not follow the current design send me a mail at ingela@REDACTED so we can consider what will be best and also fit our plans. Regards Ingela Erlang/OTP Team - Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Tue Jan 2 12:11:49 2018 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Tue, 2 Jan 2018 13:11:49 +0200 Subject: [erlang-questions] [ANN]: pure functional and generic programming Message-ID: <29A05568-CFDD-46A8-8A38-237C617031DE@gmail.com> Hello list, I?ve been doing a pure functional programming with Erlang for few year in various business domains. Really starting with basics (data structures) to high-level concepts and also gaining experience from other languages. I?ve collected some of the useful pure functional tips, evaluate them ?in-production?. Finally, I?ve managed to assemble it into what-not sharable piece of code. * Source code: https://github.com/fogfish/datum * Features overview: https://github.com/fogfish/datum/blob/master/doc/features.md * Hex: https://hex.pm/packages/datum I would be nice to get a feedback from community about it! Proposals for improvements, etc. Best Regards, Dmitry -------------- next part -------------- An HTML attachment was scrubbed... URL: From fxn@REDACTED Tue Jan 2 12:39:12 2018 From: fxn@REDACTED (Xavier Noria) Date: Tue, 2 Jan 2018 12:39:12 +0100 Subject: [erlang-questions] start/stop applications without a callback module In-Reply-To: References: <8850ee2c-5af8-e874-f79d-9f214ff51e50@ninenines.eu> Message-ID: The rewording I have in mind would be to sharply distinguish starting/stopping *applications* from starting/stopping their supervision tree if there is any, and from callback invocation. Also, to make more explicit the existence of library and regular/active applications. For example, define that starting an application means (needs review): 1. (Guessing) The application controller makes sure all applications specified in the application resource file are started. 2. The application controller spawns an application master process for the application. 3. The application master becomes the group leader of all the application processes. 4. (Regular applications only) The application master calls `start/2` in the callback module if there is one, and stores the returned PID for later use. (Don't know if firing SASL events is worth being documented, I see generally they don't seem to be.) In particular, you know who the group leader is when `start/2` runs. And it is obvious that there are things going on regardless of the existence of a callback module. Stopping an application means (needs review): 1. (Regular applications only) The application master shuts down the top supervisor using the PID stored when the application started. 2. (Regular applications only) The application master invokes the `stop/1` callback of the application callback module. 3. The application master process is shut down (by the application controller?). 4. <> It could also be explicitly said that unless stated otherwise, from then on an "application" means a "regular application". Are there factual errors? Makes sense? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Tue Jan 2 13:16:03 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 2 Jan 2018 13:16:03 +0100 Subject: [erlang-questions] packet and packet_size options in dlls socket In-Reply-To: References: Message-ID: Hi! Jesper is correct about the reason it is not supported for DTLS, that is UDP is unreliable. Reason for setting the options to defult {packet, 0}, {packet_size, 0} (e.i. no packet) is that general code in ssl_connection handles both TLS and DTLS data. Regards Ingela Erlang/OTP Team - Ericsson AB 2017-12-30 18:52 GMT+01:00 Joe K : > Why is `packet` one of the default options here > https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_ > socket.erl#L142-L143 > > default_inet_values() -> > [{active, true}, {mode, list}, {packet, 0}, {packet_size, 0}]. > > But is then prohibited here > https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_ > socket.erl#L173-L174 > > emulated_options([{packet, _} = Opt | _], _, _) -> > throw({error, {options, {not_supported, Opt}}}); > > Same for `packet_size` option. > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Tue Jan 2 13:30:44 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 2 Jan 2018 13:30:44 +0100 Subject: [erlang-questions] dtls error when used with chrome webrtc In-Reply-To: References: Message-ID: Hi! 2017-12-29 12:21 GMT+01:00 Joe K : > > Also you may try using external STUN server (check RTCPeerConnection > docs) and hope browser starts with DTLS hello. > > I've tried that, but the browser still sends STUN binding requests to the > DTLS process. And it uses the STUN server just to find out it's address. > > > It should be quite easy to implement and it would be consistent with > ssl:connect/2 and ssl:ssl_accept for TCP sockets. > > Will try this now. Thank you. > > Pleas let us know if this is desirable functionality. So far we reasoned that as UDP is not connection oriented there is not the same interest to reuse to underlying sockets as if there is an underlying connection. Regards Ingela Erlang/OTP team - Ericsson AB > On Thu, Dec 28, 2017 at 4:34 PM, Danil Zagoskin wrote: > >> > But now I don't know how to reply to both STUN binding request and >> then setup a DTLS session using erlang's ssl module. >> Yes, dtls implementation lacks support of starting/accepting a handshake >> over existing socket. >> It should be quite easy to implement and it would be consistent with >> ssl:connect/2 and ssl:ssl_accept for TCP sockets. >> >> Also you may try using external STUN server (check RTCPeerConnection >> docs) and hope browser starts with DTLS hello. >> If you try this, please share the results. >> >> On Thu, Dec 28, 2017 at 3:26 PM, Joe K wrote: >> >>> Oops, I forgot to reply to the mailing list in my last email. >>> >>> The response was >>> >>> > Maybe browser sends STUN requests to your port when you expect DTLS >>> hello? >>> You are absolutely right, Wireshark shows that there are lots of STUN >>> binding requests being made, I didn't think of that. >>> >>> > Do you use external STUN server? >>> I don't use external STUN servers ... For some reason, I didn't think >>> I would need them. >>> >>> > Also try checking chrome://webrtc-internals and chrome://webrtc-logs >>> for browser's view on what's going on. >>> chrome://webrtc-logs is empty for the webrtc whole session. >>> >>> But now I don't know how to reply to both STUN binding request and then >>> setup a DTLS session using erlang's ssl module. >>> >>> On Thu, Dec 28, 2017 at 1:28 AM, Danil Zagoskin wrote: >>> >>>> Hi! >>>> What do you see in Wireshark? >>>> Did you see handshake between two browsers? >>>> Is your application ready to receive the packet sent by browser? >>>> Do you use external STUN server? >>>> Maybe browser sends STUN requests to your port when you expect DTLS >>>> hello? >>>> >>>> Also try checking chrome://webrtc-internals and chrome://webrtc-logs >>>> for browser's view on what's going on. >>>> >>>> >>>> On Thu, Dec 28, 2017 at 12:09 AM, Joe K wrote: >>>> >>>>> I'm trying to implement parts of webrtc stack with elixir/erlang and >>>>> currently am stuck with setting up a dtls session. >>>>> >>>>> The minimal example is, I think, the following (in console, erlang >>>>> 20.2.2): >>>>> >>>>> 2> ssl:start(). >>>>> ok >>>>> 3> {ok, ListenSocket} = ssl:listen(8090, [ >>>>> 3> binary, >>>>> 3> {ip, {0, 0, 0, 0}}, >>>>> 3> {protocol, dtls}, >>>>> 3> {keyfile, <<"priv/server.key">>}, >>>>> 3> {certfile, <<"priv/server.pem">>}, >>>>> 3> {active, false} >>>>> 3> ]). >>>>> {ok, ...} >>>>> 4> {ok, AcceptSocket} = ssl:transport_accept(ListenSocket). >>>>> {ok,...} >>>>> 5> ssl:ssl_accept(AcceptSocket). >>>>> {error,{tls_alert,"record overflow"}} >>>>> >>>>> And js (with chrome canary): https://gist.github.c >>>>> om/idi-ot/a07b7330ff02f90373a2dcfe83883afa >>>>> >>>>> After {error,{tls_alert,"record overflow"}} the RTCPeerConnection's >>>>> iceConnectionState becomes "failed" and the connection itself "closed". >>>>> >>>>> I wonder what I am doing wrong. >>>>> >>>>> openssl s_client -dtls1 -connect 127.0.0.1:8089 -debug >>>>> >>>>> works fine with the code snippet above. >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>>>> >>>> >>>> >>>> -- >>>> Danil Zagoskin | z@REDACTED >>>> >>> >>> >> >> >> -- >> Danil Zagoskin | z@REDACTED >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.14159@REDACTED Tue Jan 2 17:37:57 2018 From: j.14159@REDACTED (Jeremy Pierre) Date: Tue, 02 Jan 2018 16:37:57 +0000 Subject: [erlang-questions] ANN: Alpaca v0.2.8 release Message-ID: Hi everyone, Alpaca v0.2.8 is now available. For those not aware of it, Alpaca is a statically typed and functional programming language for the Erlang VM that borrows a little from various ML dialects. Lots big changes and community involvement in this release, highlights are: - type specifications/annotations - much friendlier compiler output - support for error message internationalization - rebar3 plugin now uses pre-built Alpaca compiler, allows for faster iteration and experimentation The full release announcement is available here along with authors: https://groups.google.com/forum/#!msg/alpaca-lang/MKOirlfUZRU/LjqkmkZDBAAJ Source is available here: https://github.com/alpaca-lang/alpaca Thanks, Jeremy -------------- next part -------------- An HTML attachment was scrubbed... URL: From goodjoe2049@REDACTED Tue Jan 2 18:28:36 2018 From: goodjoe2049@REDACTED (Joe K) Date: Tue, 2 Jan 2018 20:28:36 +0300 Subject: [erlang-questions] dtls error when used with chrome webrtc In-Reply-To: References: Message-ID: Hi, Ingela! I still don't know if that would actually solve my problem (STUN packets during DTLS session) ... So not particularly desirable right now. On Tue, Jan 2, 2018 at 3:30 PM, Ingela Andin wrote: > Hi! > > 2017-12-29 12:21 GMT+01:00 Joe K : > >> > Also you may try using external STUN server (check RTCPeerConnection >> docs) and hope browser starts with DTLS hello. >> >> I've tried that, but the browser still sends STUN binding requests to the >> DTLS process. And it uses the STUN server just to find out it's address. >> >> > It should be quite easy to implement and it would be consistent with >> ssl:connect/2 and ssl:ssl_accept for TCP sockets. >> >> Will try this now. Thank you. >> >> > > Pleas let us know if this is desirable functionality. So far we reasoned > that as UDP is not connection oriented there is not the same interest to > reuse > to underlying sockets as if there is an underlying connection. > > > Regards Ingela Erlang/OTP team - Ericsson AB > > > >> On Thu, Dec 28, 2017 at 4:34 PM, Danil Zagoskin wrote: >> >>> > But now I don't know how to reply to both STUN binding request and >>> then setup a DTLS session using erlang's ssl module. >>> Yes, dtls implementation lacks support of starting/accepting a handshake >>> over existing socket. >>> It should be quite easy to implement and it would be consistent with >>> ssl:connect/2 and ssl:ssl_accept for TCP sockets. >>> >>> Also you may try using external STUN server (check RTCPeerConnection >>> docs) and hope browser starts with DTLS hello. >>> If you try this, please share the results. >>> >>> On Thu, Dec 28, 2017 at 3:26 PM, Joe K wrote: >>> >>>> Oops, I forgot to reply to the mailing list in my last email. >>>> >>>> The response was >>>> >>>> > Maybe browser sends STUN requests to your port when you expect DTLS >>>> hello? >>>> You are absolutely right, Wireshark shows that there are lots of STUN >>>> binding requests being made, I didn't think of that. >>>> >>>> > Do you use external STUN server? >>>> I don't use external STUN servers ... For some reason, I didn't think >>>> I would need them. >>>> >>>> > Also try checking chrome://webrtc-internals and chrome://webrtc-logs >>>> for browser's view on what's going on. >>>> chrome://webrtc-logs is empty for the webrtc whole session. >>>> >>>> But now I don't know how to reply to both STUN binding request and then >>>> setup a DTLS session using erlang's ssl module. >>>> >>>> On Thu, Dec 28, 2017 at 1:28 AM, Danil Zagoskin wrote: >>>> >>>>> Hi! >>>>> What do you see in Wireshark? >>>>> Did you see handshake between two browsers? >>>>> Is your application ready to receive the packet sent by browser? >>>>> Do you use external STUN server? >>>>> Maybe browser sends STUN requests to your port when you expect DTLS >>>>> hello? >>>>> >>>>> Also try checking chrome://webrtc-internals and chrome://webrtc-logs >>>>> for browser's view on what's going on. >>>>> >>>>> >>>>> On Thu, Dec 28, 2017 at 12:09 AM, Joe K wrote: >>>>> >>>>>> I'm trying to implement parts of webrtc stack with elixir/erlang and >>>>>> currently am stuck with setting up a dtls session. >>>>>> >>>>>> The minimal example is, I think, the following (in console, erlang >>>>>> 20.2.2): >>>>>> >>>>>> 2> ssl:start(). >>>>>> ok >>>>>> 3> {ok, ListenSocket} = ssl:listen(8090, [ >>>>>> 3> binary, >>>>>> 3> {ip, {0, 0, 0, 0}}, >>>>>> 3> {protocol, dtls}, >>>>>> 3> {keyfile, <<"priv/server.key">>}, >>>>>> 3> {certfile, <<"priv/server.pem">>}, >>>>>> 3> {active, false} >>>>>> 3> ]). >>>>>> {ok, ...} >>>>>> 4> {ok, AcceptSocket} = ssl:transport_accept(ListenSocket). >>>>>> {ok,...} >>>>>> 5> ssl:ssl_accept(AcceptSocket). >>>>>> {error,{tls_alert,"record overflow"}} >>>>>> >>>>>> And js (with chrome canary): https://gist.github.c >>>>>> om/idi-ot/a07b7330ff02f90373a2dcfe83883afa >>>>>> >>>>>> After {error,{tls_alert,"record overflow"}} the RTCPeerConnection's >>>>>> iceConnectionState becomes "failed" and the connection itself "closed". >>>>>> >>>>>> I wonder what I am doing wrong. >>>>>> >>>>>> openssl s_client -dtls1 -connect 127.0.0.1:8089 -debug >>>>>> >>>>>> works fine with the code snippet above. >>>>>> >>>>>> _______________________________________________ >>>>>> erlang-questions mailing list >>>>>> erlang-questions@REDACTED >>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Danil Zagoskin | z@REDACTED >>>>> >>>> >>>> >>> >>> >>> -- >>> Danil Zagoskin | z@REDACTED >>> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From goodjoe2049@REDACTED Tue Jan 2 18:34:01 2018 From: goodjoe2049@REDACTED (Joe K) Date: Tue, 2 Jan 2018 20:34:01 +0300 Subject: [erlang-questions] dtls error when used with chrome webrtc In-Reply-To: References: Message-ID: Hi, Max! I wonder if you use ssl module in flussonic for dtls sessions. If you do, that would give me some hope ... What other problems have you encountered while making flussonic work with webrtc besides dtls+srtp? My use case was pretty simple, I want to receive media from the browser (h264+opus) and repackage it for hls (h264+aac), and then distribute it through some cdn. For some reason, I thought it would be simple ... If only browsers had websocket-like api for udp! Anyway, right now I'm looking into janus gateway and how to write plugins for it. On Tue, Jan 2, 2018 at 8:28 PM, Joe K wrote: > Hi, Ingela! > > I still don't know if that would actually solve my problem (STUN packets > during DTLS session) ... So not particularly desirable right now. > > On Tue, Jan 2, 2018 at 3:30 PM, Ingela Andin > wrote: > >> Hi! >> >> 2017-12-29 12:21 GMT+01:00 Joe K : >> >>> > Also you may try using external STUN server (check RTCPeerConnection >>> docs) and hope browser starts with DTLS hello. >>> >>> I've tried that, but the browser still sends STUN binding requests to >>> the DTLS process. And it uses the STUN server just to find out it's address. >>> >>> > It should be quite easy to implement and it would be consistent with >>> ssl:connect/2 and ssl:ssl_accept for TCP sockets. >>> >>> Will try this now. Thank you. >>> >>> >> >> Pleas let us know if this is desirable functionality. So far we reasoned >> that as UDP is not connection oriented there is not the same interest to >> reuse >> to underlying sockets as if there is an underlying connection. >> >> >> Regards Ingela Erlang/OTP team - Ericsson AB >> >> >> >>> On Thu, Dec 28, 2017 at 4:34 PM, Danil Zagoskin wrote: >>> >>>> > But now I don't know how to reply to both STUN binding request and >>>> then setup a DTLS session using erlang's ssl module. >>>> Yes, dtls implementation lacks support of starting/accepting a >>>> handshake over existing socket. >>>> It should be quite easy to implement and it would be consistent with >>>> ssl:connect/2 and ssl:ssl_accept for TCP sockets. >>>> >>>> Also you may try using external STUN server (check RTCPeerConnection >>>> docs) and hope browser starts with DTLS hello. >>>> If you try this, please share the results. >>>> >>>> On Thu, Dec 28, 2017 at 3:26 PM, Joe K wrote: >>>> >>>>> Oops, I forgot to reply to the mailing list in my last email. >>>>> >>>>> The response was >>>>> >>>>> > Maybe browser sends STUN requests to your port when you expect >>>>> DTLS hello? >>>>> You are absolutely right, Wireshark shows that there are lots of >>>>> STUN binding requests being made, I didn't think of that. >>>>> >>>>> > Do you use external STUN server? >>>>> I don't use external STUN servers ... For some reason, I didn't >>>>> think I would need them. >>>>> >>>>> > Also try checking chrome://webrtc-internals and chrome://webrtc-logs >>>>> for browser's view on what's going on. >>>>> chrome://webrtc-logs is empty for the webrtc whole session. >>>>> >>>>> But now I don't know how to reply to both STUN binding request and >>>>> then setup a DTLS session using erlang's ssl module. >>>>> >>>>> On Thu, Dec 28, 2017 at 1:28 AM, Danil Zagoskin wrote: >>>>> >>>>>> Hi! >>>>>> What do you see in Wireshark? >>>>>> Did you see handshake between two browsers? >>>>>> Is your application ready to receive the packet sent by browser? >>>>>> Do you use external STUN server? >>>>>> Maybe browser sends STUN requests to your port when you expect DTLS >>>>>> hello? >>>>>> >>>>>> Also try checking chrome://webrtc-internals and chrome://webrtc-logs >>>>>> for browser's view on what's going on. >>>>>> >>>>>> >>>>>> On Thu, Dec 28, 2017 at 12:09 AM, Joe K >>>>>> wrote: >>>>>> >>>>>>> I'm trying to implement parts of webrtc stack with elixir/erlang and >>>>>>> currently am stuck with setting up a dtls session. >>>>>>> >>>>>>> The minimal example is, I think, the following (in console, erlang >>>>>>> 20.2.2): >>>>>>> >>>>>>> 2> ssl:start(). >>>>>>> ok >>>>>>> 3> {ok, ListenSocket} = ssl:listen(8090, [ >>>>>>> 3> binary, >>>>>>> 3> {ip, {0, 0, 0, 0}}, >>>>>>> 3> {protocol, dtls}, >>>>>>> 3> {keyfile, <<"priv/server.key">>}, >>>>>>> 3> {certfile, <<"priv/server.pem">>}, >>>>>>> 3> {active, false} >>>>>>> 3> ]). >>>>>>> {ok, ...} >>>>>>> 4> {ok, AcceptSocket} = ssl:transport_accept(ListenSocket). >>>>>>> {ok,...} >>>>>>> 5> ssl:ssl_accept(AcceptSocket). >>>>>>> {error,{tls_alert,"record overflow"}} >>>>>>> >>>>>>> And js (with chrome canary): https://gist.github.c >>>>>>> om/idi-ot/a07b7330ff02f90373a2dcfe83883afa >>>>>>> >>>>>>> After {error,{tls_alert,"record overflow"}} the RTCPeerConnection's >>>>>>> iceConnectionState becomes "failed" and the connection itself "closed". >>>>>>> >>>>>>> I wonder what I am doing wrong. >>>>>>> >>>>>>> openssl s_client -dtls1 -connect 127.0.0.1:8089 -debug >>>>>>> >>>>>>> works fine with the code snippet above. >>>>>>> >>>>>>> _______________________________________________ >>>>>>> erlang-questions mailing list >>>>>>> erlang-questions@REDACTED >>>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Danil Zagoskin | z@REDACTED >>>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Danil Zagoskin | z@REDACTED >>>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From goodjoe2049@REDACTED Tue Jan 2 18:38:12 2018 From: goodjoe2049@REDACTED (Joe K) Date: Tue, 2 Jan 2018 20:38:12 +0300 Subject: [erlang-questions] packet and packet_size options in dlls socket In-Reply-To: References: Message-ID: Thanks, Ingela. I was just wondering why the these options exist if they are forbidden. Now I understand. On Tue, Jan 2, 2018 at 3:16 PM, Ingela Andin wrote: > Hi! > > Jesper is correct about the reason it is not supported for DTLS, that is > UDP is unreliable. Reason for setting the options to defult {packet, 0}, > {packet_size, 0} (e.i. no packet) is that general code in ssl_connection > handles both TLS and DTLS data. > > Regards Ingela Erlang/OTP Team - Ericsson AB > > 2017-12-30 18:52 GMT+01:00 Joe K : > >> Why is `packet` one of the default options here >> https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_s >> ocket.erl#L142-L143 >> >> default_inet_values() -> >> [{active, true}, {mode, list}, {packet, 0}, {packet_size, 0}]. >> >> But is then prohibited here >> https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_s >> ocket.erl#L173-L174 >> >> emulated_options([{packet, _} = Opt | _], _, _) -> >> throw({error, {options, {not_supported, Opt}}}); >> >> Same for `packet_size` option. >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seriy.pr@REDACTED Tue Jan 2 21:51:43 2018 From: seriy.pr@REDACTED (=?UTF-8?B?0KHQtdGA0LPQtdC5INCf0YDQvtGF0L7RgNC+0LI=?=) Date: Tue, 2 Jan 2018 21:51:43 +0100 Subject: [erlang-questions] [ANN] locus: Geolocation and ASN lookup of IP addresses Message-ID: Hi, Guilherme > 5) Not having a limited number of workers as a potential bottleneck > - This was solved by sharing the different database sections as > reference-counted binaries > through ETS Are you sure it works like this? Because, as far as I know, ETS data resides in a separate chunk of memory. Is the idea that ETS will only contain references to original shared binary, but not the binary itself? Have you checked / measured that it really works that way and not copying whole database to / from ETS for each lookup? -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Tue Jan 2 23:31:55 2018 From: g@REDACTED (Guilherme Andrade) Date: Tue, 2 Jan 2018 22:31:55 +0000 Subject: [erlang-questions] [ANN] locus: Geolocation and ASN lookup of IP addresses In-Reply-To: References: Message-ID: Hi Sergei, On 2 January 2018 at 20:51, ?????? ???????? wrote: > Are you sure it works like this? > Because, as far as I know, ETS data resides in a separate chunk of memory. > Is the idea that ETS will only contain references to original shared > binary, but not the binary itself? > Have you checked / measured that it really works that way and not copying > whole database to / from ETS for each lookup? > I didn't benchmark it. I looked around on the web for past discussions on the matter and found a previous thread[1] discussing this particular problem, in which it was stated that a 6 word overhead would be incurred for every lookup. As we're talking about blobs amounting to potentially dozens of megabytes, I felt very comfortable with such an overhead. I took those statements as likely being the truth, as the people involved seemed to know what they were talking about, but I'd be the first to restructure the current architecture if shown a better way. Cheers, [1]: http://erlang.org/pipermail/erlang-questions/2016-October/090712.html -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From hq@REDACTED Tue Jan 2 23:46:19 2018 From: hq@REDACTED (Adam Rutkowski) Date: Tue, 02 Jan 2018 23:46:19 +0100 Subject: [erlang-questions] AMD Ryzen anyone? Message-ID: <1514933179.2711481.1222260232.13494F16@webmail.messagingengine.com> Hey all, I'm thinking of building a Ryzen machine, mainly for Erlang development. There's this rather obscure bug with some Ryzen processors on Linux/BSD [1] and I'm worried I might be getting a unit from the faulty batch; I have no means of verifying this before purchasing from my local suppliers. I'm wondering if I should I expect any issues with Erlang VM doing the multi-core heavy lifting. Cheers [1]: https://www.phoronix.com/scan.php?page=news_item&px=Ryzen-Segv-Response A. From jer@REDACTED Wed Jan 3 09:32:23 2018 From: jer@REDACTED (Jeroen Roovers) Date: Wed, 3 Jan 2018 09:32:23 +0100 Subject: [erlang-questions] Windows Patch Packages? In-Reply-To: References: Message-ID: On 2 January 2018 at 10:50, Ingela Andin wrote: > Hi! > And you do not need to rebuild OTP to use it, it is enough to rebuild the > ssl source files > only. This should be easy enough as it is only Erlang code. That should not be hard to integrate into the buildroot cross-compile environment I use as long as I know what to actually do to "rebuild the ssl source files". First I would need to fetch them from somewhere (using some tool built for the host?) before building the target distribution. It's not entirely clear yet how that would happen. > We will consider if we should have some special handling for security > patches in the future. Thanks. Kind regards, jer From iblis@REDACTED Wed Jan 3 09:21:10 2018 From: iblis@REDACTED (Iblis Lin) Date: Wed, 3 Jan 2018 16:21:10 +0800 Subject: [erlang-questions] AMD Ryzen anyone? In-Reply-To: <2b1ebb6f-8e54-2bd5-b3dd-41839a8e934c@hs.ntnu.edu.tw> References: <1514933179.2711481.1222260232.13494F16@webmail.messagingengine.com> <2b1ebb6f-8e54-2bd5-b3dd-41839a8e934c@hs.ntnu.edu.tw> Message-ID: <9732f5dd-3428-7dfe-02cc-e7209d8b3e09@hs.ntnu.edu.tw> forgot to CC the list. On 01/03/2018 01:21 PM, Iblis Lin wrote: > well, purchasing decision is up to you, but I want to share my personal > experience: > > I will vote -100 for the Ryzen build. For me, the term "Ryzen" means > malicious trolling. > > It wasted my time and mental efforts. > > I will show you my journal: > > ? - I set up the Ryzen box in 2017/5. Mine is 1700 (8 cores 16 threads). > > ? - I install Arch Linux, ran CouchDB on it... and found the machine > crash and reboot regularly in an interval of 2-3 days. > > ? - I also tried to build mainline kernel, (at that moment, it's 4.12 > IIRC), not work , still crashing or freezing. > > ? - Another test: disabling all deamon, the box can be alive over a week. > > ? - Changing memory module in 2017/6, not work. > > ? - 2017/9 I RMA-ed it. > > ? - After RMA, it still keeps crashing, hard freezing, soft freezing... > within 3-6 hr if I run something on it. > > ??? the kill-ryzen script DOES kill my box, even it's the new CPU back > from RMA. > > ??? The *improvement* is the crashing interval shrunk. Thank you AMD. > > ? - 2017/10, I changed my OS from Arch to Ubuntu. not work. > > > On 01/03/2018 06:46 AM, Adam Rutkowski wrote: >> Hey all, >> >> I'm thinking of building a Ryzen machine, mainly for Erlang development. There's this rather obscure bug with some Ryzen processors on Linux/BSD [1] and I'm worried I might be getting a unit from the faulty batch; I have no means of verifying this before purchasing from my local suppliers. I'm wondering if I should I expect any issues with Erlang VM doing the multi-core heavy lifting. >> >> Cheers >> >> [1]: https://www.phoronix.com/scan.php?page=news_item&px=Ryzen-Segv-Response >> >> A. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions -- Iblis Lin ??? GitHub: https://github.com/iblis17 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 228 bytes Desc: OpenPGP digital signature URL: From andreas.schultz@REDACTED Wed Jan 3 10:09:04 2018 From: andreas.schultz@REDACTED (Andreas Schultz) Date: Wed, 03 Jan 2018 09:09:04 +0000 Subject: [erlang-questions] DTLS UDP socket reuse / SSL passive API? In-Reply-To: References: Message-ID: Spin off from: Re: [erlang-questions] dtls error when used with chrome webrtc Ingela Andin schrieb am Di., 2. Jan. 2018 um 13:30 Uhr: > Hi! > > 2017-12-29 12:21 GMT+01:00 Joe K : > >> > Also you may try using external STUN server (check RTCPeerConnection >> docs) and hope browser starts with DTLS hello. >> >> I've tried that, but the browser still sends STUN binding requests to the >> DTLS process. And it uses the STUN server just to find out it's address. >> >> > It should be quite easy to implement and it would be consistent with >> ssl:connect/2 and ssl:ssl_accept for TCP sockets. >> >> Will try this now. Thank you. >> >> > > Pleas let us know if this is desirable functionality. So far we reasoned > that as UDP is not connection oriented there is not the same interest to > reuse > to underlying sockets as if there is an underlying connection. > I do have a use case that is even more complicated then simply upgrading UDP to DTLS. CAPWAP is runnig unencrypted and DTLS traffic on the same socket. It distinguished between the traffic with a small header in front of the payload packet. I therefore need a demultiplexer on the UDP socket that removes the header and passes the encrypted payload to the DTLS stack. There is somewhat similar problem when doing EAP-TLS over RADIUS or DIAMETER. The TLS traffic is encapsulated within RADIUS/DIAMETER requests and needs to be passed into the TLS stack and the replies need to encapsultated with RADIUS/DIAMETER. The current socket abstraction in the SSL app is not prepared to handle this and would need invasive changes. A simplistic workarround would be to forward the DTLS traffic on loopback UDP socket. Hwever that would incure additional latency, signaling overhead and would make detection of failed connections more difficult. I therefore don't want to go there. A supported and documented API to pass (D)TLS traffic into the SSL app and get status change events and the decoded payload data back from the SSL app would IMHO help a lot. Just some quick idea: %% Create a new passive SSL connection of given type, return a opaque identifier. ssl:create_connection(Protocol :: 'stream' | 'datagram', Opts) -> ssl_connection_id(). %% Pass received SSL traffic into the connection, %% Return error, ok or Data to return on the connection. ssl:recv(Connection :: ssl_connection_id(), EncData :: binary()) -> {error, Error} | ok | {ok, {send, Data :: binary()}}. %% Pass unencrypted traffic into the SSL app ssl: send(Connection :: ssl_connection_id(), PlainText :: binary()) -> {error, Error} | ok | {ok, {send, EncData :: binary()}}. %% The owner of the connection is then getting messages like: %% - send encrypted data: %% {ssl, Connection :: connection_id(), {send, EncData :: binary()}} %% - got plaintext data: %% {ssl, Connection :: connection_id(), {recv, PlainText :: binary()}} %% - connection event: %% {ssl, Connection :: connection_id(), Event :: ssl_connection_event()} Wheter ssl:recv and ssl:send return data or use a message to the owner should depend on a mode setting (e.g. active, passive...) What do you think? Comments? Regards Andreas [...] -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth.lundin@REDACTED Wed Jan 3 10:48:23 2018 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Wed, 3 Jan 2018 10:48:23 +0100 Subject: [erlang-questions] Windows Patch Packages? In-Reply-To: References: Message-ID: By mistake my answer was only sent to Peter Tirell, should have been sent to the list. Here it is The pre built Windows installers on erlang.org are only provided for the planned releases and patch packages, they are not provided for "emergency" patches between or after the planned releases. 18.3 is the latest pre built Windows installer for the OTP 18 release track. In order to apply 18.3.4.7 you have to build from source. Another possibility if it is tricky to build on Windows, is that you build from source on Linux and then copy the only application changed by the patch to your Windows system under ERl_ROOT/lib or somewhere else if you point it out with erl -pa Since OTP 20.2 is just a patch it only lists in its README what has been fixed since the last patch , which was 20.1.7 containing a fix for OTP-14748. You can look i the release notes for the ssl application in OTP 20.2 and find that OTP-14748 is mentioned there. So there is a Windows build, namely 20.2 which includes the patch you are looking for. /Regards Kenneth, Erlang/OTP Ericsson On Wed, Dec 20, 2017 at 3:55 PM, Peter Tirrell wrote: > Hello all, > > I saw an existing recent thread about general patch packages but didn't > necessarily want to hijack that thread. I currently am using OTP 18.2.1 on > Windows but became aware of security advisory CVE-2017-1000385 ( > https://nvd.nist.gov/vuln/detail/CVE-2017-1000385#VulnChangeHistoryDiv) > > It looks like I can get OTP 18.3.4.7+ and have the advisory addressed, but > I'm unclear on how to do so. The downloads page simply lists an 18.3 > download and doesn't list the fixed OTP bug number in the readme. The > earlier thread I saw seemed to imply that Windows builds on the downloads > page aren't updated. > > So my question is - how do I apply the latest Windows patched builds? Are > there patched Windows release builds available somewhere? If I download a > version from the downloads page, will that be the latest available major > point version, including any patches for that point version? > > Or if there's a patch package put out, do I need to either compile that > version from source, or wait until there is another major point version > released that comes *after* that patch package was created? For example, > I'm looking for a fix for bug "OTP-14748". The only Windows build that > appears to be dated since that was fixed is 20.2, yet the readme for that > does not include a reference to 14748 either. > > Thanks for any info! > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vances@REDACTED Wed Jan 3 13:44:33 2018 From: vances@REDACTED (Vance Shipley) Date: Wed, 3 Jan 2018 18:14:33 +0530 Subject: [erlang-questions] DTLS UDP socket reuse / SSL passive API? In-Reply-To: References: Message-ID: On Wed, Jan 3, 2018 at 2:39 PM, Andreas Schultz wrote: > I do have a use case that is even more complicated then simply upgrading UDP > to DTLS. > CAPWAP is runnig unencrypted and DTLS traffic on the same socket. It > distinguished between the traffic with a small header in front of the > payload packet. I therefore need a demultiplexer on the UDP socket that > removes the header and passes the encrypted payload to the DTLS stack. I think you're in luck. > There is somewhat similar problem when doing EAP-TLS over RADIUS or > DIAMETER. The TLS traffic is encapsulated within RADIUS/DIAMETER requests > and needs to be passed into the TLS stack and the replies need to > encapsultated with RADIUS/DIAMETER. SigScale has a pure Erlang implementation of EAP-TTLS over RADIUS using the SSL app in OTP in our open source Online Charging System (OCS): https://github.com/sigscale/ocs > The current socket abstraction in the SSL app is not prepared to handle this > and would need invasive changes. The existence of the API is hidden in this one sentence of the User Guide: http://erlang.org/doc/apps/ssl/ssl_protocol.html "By default SSL/TLS is run over the TCP/IP protocol even though you can plug in any other reliable transport protocol with the same Application Programming Interface (API) as the gen_tcp module in Kernel." Here is our SSL transport callback module: https://github.com/sigscale/ocs/blob/master/src/ocs_eap_tls_transport.erl -- -Vance From andreas.schultz@REDACTED Wed Jan 3 15:48:30 2018 From: andreas.schultz@REDACTED (Andreas Schultz) Date: Wed, 03 Jan 2018 14:48:30 +0000 Subject: [erlang-questions] DTLS UDP socket reuse / SSL passive API? In-Reply-To: References: Message-ID: Hi Vance, Vance Shipley schrieb am Mi., 3. Jan. 2018 um 13:44 Uhr: > On Wed, Jan 3, 2018 at 2:39 PM, Andreas Schultz > wrote: > > I do have a use case that is even more complicated then simply upgrading > UDP > > to DTLS. > > CAPWAP is runnig unencrypted and DTLS traffic on the same socket. It > > distinguished between the traffic with a small header in front of the > > payload packet. I therefore need a demultiplexer on the UDP socket that > > removes the header and passes the encrypted payload to the DTLS stack. > > I think you're in luck. > > > There is somewhat similar problem when doing EAP-TLS over RADIUS or > > DIAMETER. The TLS traffic is encapsulated within RADIUS/DIAMETER requests > > and needs to be passed into the TLS stack and the replies need to > > encapsultated with RADIUS/DIAMETER. > > SigScale has a pure Erlang implementation of EAP-TTLS over RADIUS > using the SSL app in OTP in our open source Online Charging System > (OCS): https://github.com/sigscale/ocs I have seen that some time ago. > The current socket abstraction in the SSL app is not prepared to handle this > > and would need invasive changes. > > The existence of the API is hidden in this one sentence of the User Guide: > > http://erlang.org/doc/apps/ssl/ssl_protocol.html > "By default SSL/TLS is run over the TCP/IP protocol even though you > can plug in any other reliable transport protocol with the same > Application Programming Interface (API) as the gen_tcp module in > Kernel." > Last time I looked at the SSL library in that depth (around 2014) it did not permit to use of a Pid. The actual socket had to be a Erlang port. Back then I needed this change to use a Pid as socket replacement: https://github.com/RoadRunnr/otp/commit/77b9256fc15fa2f4293bd84fd0bb8dc06da8ddbf I also played with EAP based on Erlang SSL back then ( https://github.com/travelping/eradius/commits/eap), but didn't have the time to properly finish it. That SSL API restrictions to Erlang ports seem to have changed since then, at least for the TLS code. The DTLS code still seems to have the hard coded assumtions that it always runs over UDP sockets: https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_connection.erl#L142 The other major restriction was that it required two processes, one for the socket/transport side and another for the payload side of the SSL library. Using the same process for both sides would lead to a dead lock when calling ssl:send. Not sure if that restriction has been lifted. Andreas > Here is our SSL transport callback module: > https://github.com/sigscale/ocs/blob/master/src/ocs_eap_tls_transport.erl > > > -- > -Vance > -------------- next part -------------- An HTML attachment was scrubbed... URL: From list1@REDACTED Thu Jan 4 01:48:52 2018 From: list1@REDACTED (Grzegorz Junka) Date: Thu, 4 Jan 2018 00:48:52 +0000 Subject: [erlang-questions] AMD Ryzen anyone? In-Reply-To: <9732f5dd-3428-7dfe-02cc-e7209d8b3e09@hs.ntnu.edu.tw> References: <1514933179.2711481.1222260232.13494F16@webmail.messagingengine.com> <2b1ebb6f-8e54-2bd5-b3dd-41839a8e934c@hs.ntnu.edu.tw> <9732f5dd-3428-7dfe-02cc-e7209d8b3e09@hs.ntnu.edu.tw> Message-ID: <5A4D79F4.5080805@gjunka.com> On 03/01/2018 08:21, Iblis Lin wrote: > forgot to CC the list. > > > On 01/03/2018 01:21 PM, Iblis Lin wrote: >> well, purchasing decision is up to you, but I want to share my personal >> experience: >> >> I will vote -100 for the Ryzen build. For me, the term "Ryzen" means >> malicious trolling. >> >> It wasted my time and mental efforts. >> >> I will show you my journal: >> >> - I set up the Ryzen box in 2017/5. Mine is 1700 (8 cores 16 threads). >> >> - I install Arch Linux, ran CouchDB on it... and found the machine >> crash and reboot regularly in an interval of 2-3 days. >> >> - I also tried to build mainline kernel, (at that moment, it's 4.12 >> IIRC), not work , still crashing or freezing. >> >> - Another test: disabling all deamon, the box can be alive over a week. >> >> - Changing memory module in 2017/6, not work. >> >> - 2017/9 I RMA-ed it. >> >> - After RMA, it still keeps crashing, hard freezing, soft freezing... >> within 3-6 hr if I run something on it. >> >> the kill-ryzen script DOES kill my box, even it's the new CPU back >> from RMA. >> >> The *improvement* is the crashing interval shrunk. Thank you AMD. >> >> - 2017/10, I changed my OS from Arch to Ubuntu. not work. >> >> >> On 01/03/2018 06:46 AM, Adam Rutkowski wrote: >>> Hey all, >>> >>> I'm thinking of building a Ryzen machine, mainly for Erlang development. There's this rather obscure bug with some Ryzen processors on Linux/BSD [1] and I'm worried I might be getting a unit from the faulty batch; I have no means of verifying this before purchasing from my local suppliers. I'm wondering if I should I expect any issues with Erlang VM doing the multi-core heavy lifting. >>> >>> Cheers >>> >>> [1]: https://www.phoronix.com/scan.php?page=news_item&px=Ryzen-Segv-Response >>> >>> Interestingly, it's not that not choosing Ryzen guarantees you a worry-free reality: http://www.dailymail.co.uk/sciencetech/article-5232037/Security-flaw-Intel-chips-past-decade.html Arguably 50% slowdown or a security flaw is better than a random crash. But maybe the real lesson is to choose a processor that doesn't have any known vulnerability so far, e.g. Threadripper or a dedicated server processor? GrzegorzJ From technion@REDACTED Thu Jan 4 05:46:19 2018 From: technion@REDACTED (Technion) Date: Thu, 4 Jan 2018 04:46:19 +0000 Subject: [erlang-questions] xref Message-ID: Hi, I'm wondering if I could get some advise regarding xref. I've found across a number of projects, anything using Cowboy triggers similar alerts for me to below: $./rebar3 xref ===> Warning: api_handler:init/2 is unused export (Xref) The init/2 function is most definitely used - it's the Cowboy callback used exactly the same way as the demo echo server does here: https://github.com/ninenines/cowboy/blob/master/examples/echo_get/src/toppage_handler.erl I'm hoping to incorporate the xref test into my CI workflow, but I'd need to understand first how to convince it that Cowboy functions are not "unused". Is this a bug in xref or rebar? -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Thu Jan 4 14:39:24 2018 From: g@REDACTED (Guilherme Andrade) Date: Thu, 4 Jan 2018 13:39:24 +0000 Subject: [erlang-questions] xref In-Reply-To: References: Message-ID: On 4 January 2018 at 04:46, Technion wrote: > I'm wondering if I could get some advise regarding xref. > > I've found across a number of projects, anything using Cowboy triggers > similar alerts for me to below: > I believe the example module you mentioned ('toppage_handler') implements the 'cowboy_handler' behaviour[1]. If '-behaviour(cowboy_handler).' were to be explicitly declared on 'toppage_handler', xref would realize that those unused functions are actually callbacks. [1]: https://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy_handler/ -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Thu Jan 4 15:02:07 2018 From: erlang@REDACTED (Stefan Marr) Date: Thu, 4 Jan 2018 14:02:07 +0000 Subject: [erlang-questions] [MoreVMs'18] Call for Contributions: 2nd Workshop on Modern Language Runtimes, Ecosystems, and VMs at 2018 Message-ID: ============================================================================ Call for Papers: MoreVMs'18 2nd Workshop on Modern Language Runtimes, and Ecosystems Co-located with '18 April 9th, 2018, Nice, France https://2018.programming-conference.org/track/MoreVMs-2018 ============================================================================ The MoreVMs'18 workshop aims to bring together industrial and academic programmers to discuss the design, implementation, and usage of modern languages and runtimes. This includes aspects such as reuse of language runtimes, modular implementation, language design and compilation strategies. The workshop aims to enable a diverse discussion on how languages and runtimes are currently being utilized, and where they need to improve further. We welcome presentation proposals in the form of extended abstracts discussing experiences, work-in-progress, as well as future visions, from either an academic or industrial perspective. Relevant topics include, but are definitely not limited to, the following: - Extensible VM design (compiler- or interpreter-based VMs) - Reusable components (e.g. interpreters, garbage collectors, ...) - Static and dynamic compilation techniques - Techniques for targeting high-level languages such as JavaScript - Interoperability between languages - Tooling support (e.g. debugging, profiling, etc.) - Programming language development environments - Case studies of existing language implementation approaches - Language implementation challenges and trade-offs - Surveys and usage reports to understand usage in the wild - Ideas for more predictable performance - Ideas for how VMs could take advantage of new hardware features - Ideas for how we should build languages in the future Workshop Format and Submissions ------------------------------- Submissions should use the ACM Conference acmart Format with the ?sigconf? option with a font size of 10 point and the font family Times New Roman. All submissions should be in PDF format. If you use LaTeX or Word, please use the provided ACM acmart templates. Otherwise, please follow the ACM author instructions. https://www.acm.org/publications/proceedings-template If you are formatting your paper using LaTeX, you will need to set the 10pt option in the \documentclass command. If you are formatting your paper using Word, you may wish to use the provided Word template that supports this font size. Please include page numbers in your submission for review using the LaTeX command \settopmatter{printfolios=true} (see examples in template). Please also ensure that your submission is legible when printed on a black and white printer. In particular, please check that colors remain distinct and font sizes are legible. Submission Site: https://easychair.org/conferences/?conf=morevms18 Important Dates --------------- Extended abstract submission: 2018-01-26 Author notification: 2018-02-23 Workshop: 2018-04-09 All deadlines are Anywhere on Earth (AoE), i.e. GMT/UTC-12:00 hour. Program Committee ----------------- Cl?ment Bera, Inria Lille Nord Europe, France Maxime Chevalier-Boisvert, University of Montreal, Canada S?bastien Doeraene, EPFL, Switzerland Johan Fabry, Raincode Labs, Belgium Juliana Franco, Imperial College London, United Kingdom Tobias Grosser, ETH Zurich, Switzerland Ben L. Titzer, Google, Germany Niko Matsakis, Mozilla Research, United States Armin Rigo, PyPy, Switzerland Maoni Stephens, Microsoft, United States Ga?l Thomas, Telecom SudParis, France Mario Wolczko, Oracle Labs, United States Workshop Organizers ------------------- Edd Barrett, King's College London, United Kingdom Adam Welc, Uber Technologies, United States Stefan Marr, University of Kent, United Kingdom From Catenacci@REDACTED Thu Jan 4 17:29:42 2018 From: Catenacci@REDACTED (Onorio Catenacci) Date: Thu, 4 Jan 2018 11:29:42 -0500 Subject: [erlang-questions] Windows Patch Packages? Message-ID: Thanks for clarifying the situation Kenneth. While I agree with those who said that everyone should want all of the security patches and such on Windows (definitely true), I am afraid that some of the folks are looking for a turnkey solution to applying these patches which is simply not the case and it's not likely to be the case at any point in the future. -- Onorio Catenacci http://onor.io http://www.google.com/+OnorioCatenacci -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.des.courtis@REDACTED Thu Jan 4 18:58:38 2018 From: eric.des.courtis@REDACTED (Eric des Courtis) Date: Thu, 4 Jan 2018 12:58:38 -0500 Subject: [erlang-questions] AMD Ryzen anyone? In-Reply-To: <5A4D79F4.5080805@gjunka.com> References: <1514933179.2711481.1222260232.13494F16@webmail.messagingengine.com> <2b1ebb6f-8e54-2bd5-b3dd-41839a8e934c@hs.ntnu.edu.tw> <9732f5dd-3428-7dfe-02cc-e7209d8b3e09@hs.ntnu.edu.tw> <5A4D79F4.5080805@gjunka.com> Message-ID: +1 for Threadripper or Ryzen Pro On Wed, Jan 3, 2018 at 7:48 PM, Grzegorz Junka wrote: > > > On 03/01/2018 08:21, Iblis Lin wrote: > >> forgot to CC the list. >> >> >> On 01/03/2018 01:21 PM, Iblis Lin wrote: >> >>> well, purchasing decision is up to you, but I want to share my personal >>> experience: >>> >>> I will vote -100 for the Ryzen build. For me, the term "Ryzen" means >>> malicious trolling. >>> >>> It wasted my time and mental efforts. >>> >>> I will show you my journal: >>> >>> - I set up the Ryzen box in 2017/5. Mine is 1700 (8 cores 16 threads). >>> >>> - I install Arch Linux, ran CouchDB on it... and found the machine >>> crash and reboot regularly in an interval of 2-3 days. >>> >>> - I also tried to build mainline kernel, (at that moment, it's 4.12 >>> IIRC), not work , still crashing or freezing. >>> >>> - Another test: disabling all deamon, the box can be alive over a >>> week. >>> >>> - Changing memory module in 2017/6, not work. >>> >>> - 2017/9 I RMA-ed it. >>> >>> - After RMA, it still keeps crashing, hard freezing, soft freezing... >>> within 3-6 hr if I run something on it. >>> >>> the kill-ryzen script DOES kill my box, even it's the new CPU back >>> from RMA. >>> >>> The *improvement* is the crashing interval shrunk. Thank you AMD. >>> >>> - 2017/10, I changed my OS from Arch to Ubuntu. not work. >>> >>> >>> On 01/03/2018 06:46 AM, Adam Rutkowski wrote: >>> >>>> Hey all, >>>> >>>> I'm thinking of building a Ryzen machine, mainly for Erlang >>>> development. There's this rather obscure bug with some Ryzen processors on >>>> Linux/BSD [1] and I'm worried I might be getting a unit from the faulty >>>> batch; I have no means of verifying this before purchasing from my local >>>> suppliers. I'm wondering if I should I expect any issues with Erlang VM >>>> doing the multi-core heavy lifting. >>>> >>>> Cheers >>>> >>>> [1]: https://www.phoronix.com/scan.php?page=news_item&px=Ryzen-Se >>>> gv-Response >>>> >>>> >>>> > Interestingly, it's not that not choosing Ryzen guarantees you a > worry-free reality: > > http://www.dailymail.co.uk/sciencetech/article-5232037/Secur > ity-flaw-Intel-chips-past-decade.html > > Arguably 50% slowdown or a security flaw is better than a random crash. > But maybe the real lesson is to choose a processor that doesn't have any > known vulnerability so far, e.g. Threadripper or a dedicated server > processor? > > GrzegorzJ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From federico.carrone@REDACTED Thu Jan 4 18:00:14 2018 From: federico.carrone@REDACTED (Federico Carrone) Date: Thu, 4 Jan 2018 14:00:14 -0300 Subject: [erlang-questions] [BuzzConf '18] Call For Presentations Message-ID: Hi, We are organizing a conference in Buenos Aires, Argentina about topics that commonly arise in the Erlang world. We would like to extend an invitation to anyone interested. https://github.com/lambdaclass/buzzconf *Call for Presentations* BuzzConf is a conference thats explores the new horizons in computer science such as functional programming, distributed systems, big data, machine learning and other interdisciplinary areas and brings them to a bigger audience. The conference will take place between the last week of April and the first week of May 2018 in Buenos Aires, Argentina. The exact date will be confirmed shortly. Areas of particular interest to the conference include: programming languages functional programming distributed data machine learning big data profiling/debugging embedded systems the most modern tools to deal with the world's complexity To submit your talk proposal please complete the following form: https://goo.gl/forms/CnF3HhcPV7jb2ttZ2 *Format* Each accepted talk will get a 40 minute talk slot *Deadlines* Call for presentations closes: Monday, March 5st, 2018 Speakers notified: Monday, March 12th, 2018 Program announced: Wednesday, March 14th, 2018 *Admission and Travel* Speakers will receive free admission to BuzzConf. We are striving to provide some form of travel grant to assist with the costs of attending. We?ll post details here once a budget is finalized. -------------- next part -------------- An HTML attachment was scrubbed... URL: From technion@REDACTED Thu Jan 4 22:39:50 2018 From: technion@REDACTED (Technion) Date: Thu, 4 Jan 2018 21:39:50 +0000 Subject: [erlang-questions] xref In-Reply-To: References: , Message-ID: Indeed that is correct. Many thanks for this. ________________________________ From: Guilherme Andrade Sent: Friday, 5 January 2018 12:39:24 AM To: Technion Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] xref On 4 January 2018 at 04:46, Technion > wrote: I'm wondering if I could get some advise regarding xref. I've found across a number of projects, anything using Cowboy triggers similar alerts for me to below: I believe the example module you mentioned ('toppage_handler') implements the 'cowboy_handler' behaviour[1]. If '-behaviour(cowboy_handler).' were to be explicitly declared on 'toppage_handler', xref would realize that those unused functions are actually callbacks. [1]: https://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy_handler/ -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri Jan 5 08:01:00 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 5 Jan 2018 10:01:00 +0300 Subject: [erlang-questions] dtls error when used with chrome webrtc In-Reply-To: References: Message-ID: Your usecase is not simple, it is most complicated. We use ssl, but use own implementation of dtls. This configuration is working in flussonic at the moment and it is not simple. -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri Jan 5 08:02:54 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 5 Jan 2018 10:02:54 +0300 Subject: [erlang-questions] [ANN] locus: Geolocation and ASN lookup of IP addresses In-Reply-To: References: Message-ID: Got it. about: 5) Not having a limited number of workers as a potential bottleneck - This was solved by sharing the different database sections as reference-counted binaries through ETS On what request rates do you get performance problems with egeoip? we have never met them. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ssandamali@REDACTED Fri Jan 5 10:12:31 2018 From: ssandamali@REDACTED (Sandamali Fernando) Date: Fri, 5 Jan 2018 14:42:31 +0530 Subject: [erlang-questions] erlang-questions Digest, Vol 354, Issue 11 In-Reply-To: References: Message-ID: Fjbbnbmbnm?Kgjkjuio ?_\\?^__^^= On Jan 3, 2018 6:00 AM, wrote: > Send erlang-questions mailing list submissions to > erlang-questions@REDACTED > > To subscribe or unsubscribe via the World Wide Web, visit > http://erlang.org/mailman/listinfo/erlang-questions > or, via email, send a message with subject or body 'help' to > erlang-questions-request@REDACTED > > You can reach the person managing the list at > erlang-questions-owner@REDACTED > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of erlang-questions digest..." > > > Today's Topics: > > 1. Re: Windows Patch Packages? (Kenneth Lundin) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 3 Jan 2018 10:48:23 +0100 > From: Kenneth Lundin > To: "erlang-questions@REDACTED Questions" > > Subject: Re: [erlang-questions] Windows Patch Packages? > Message-ID: > gmail.com> > Content-Type: text/plain; charset="utf-8" > > By mistake my answer was only sent to Peter Tirell, should have been sent > to the list. > > Here it is > > > The pre built Windows installers on erlang.org are only provided for the > planned releases and patch packages, they are not provided for "emergency" > patches > between or after the planned releases. 18.3 is the latest pre built > Windows installer for the OTP 18 release track. > > In order to apply 18.3.4.7 you have to build from source. > > Another possibility if it is tricky to build on Windows, is that you build > from source on Linux and then copy the only application changed by the > patch to your Windows system under ERl_ROOT/lib or somewhere else if you > point it out with erl -pa > > Since OTP 20.2 is just a patch it only lists in its README what has been > fixed since the last patch , which was 20.1.7 containing a fix for > OTP-14748. You can look i the release notes for the ssl application in OTP > 20.2 and find that OTP-14748 is mentioned there. > > So there is a Windows build, namely 20.2 which includes the patch you are > looking for. > > /Regards Kenneth, Erlang/OTP Ericsson > > On Wed, Dec 20, 2017 at 3:55 PM, Peter Tirrell wrote: > > > Hello all, > > > > I saw an existing recent thread about general patch packages but didn't > > necessarily want to hijack that thread. I currently am using OTP 18.2.1 > on > > Windows but became aware of security advisory CVE-2017-1000385 ( > > https://nvd.nist.gov/vuln/detail/CVE-2017-1000385#VulnChangeHistoryDiv) > > > > It looks like I can get OTP 18.3.4.7+ and have the advisory addressed, > but > > I'm unclear on how to do so. The downloads page simply lists an 18.3 > > download and doesn't list the fixed OTP bug number in the readme. The > > earlier thread I saw seemed to imply that Windows builds on the downloads > > page aren't updated. > > > > So my question is - how do I apply the latest Windows patched builds? > Are > > there patched Windows release builds available somewhere? If I download > a > > version from the downloads page, will that be the latest available major > > point version, including any patches for that point version? > > > > Or if there's a patch package put out, do I need to either compile that > > version from source, or wait until there is another major point version > > released that comes *after* that patch package was created? For example, > > I'm looking for a fix for bug "OTP-14748". The only Windows build that > > appears to be dated since that was fixed is 20.2, yet the readme for that > > does not include a reference to 14748 either. > > > > Thanks for any info! > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: 20180103/faa07055/attachment-0001.html> > > ------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > End of erlang-questions Digest, Vol 354, Issue 11 > ************************************************* > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Fri Jan 5 19:09:40 2018 From: g@REDACTED (Guilherme Andrade) Date: Fri, 5 Jan 2018 18:09:40 +0000 Subject: [erlang-questions] [ANN] locus: Geolocation and ASN lookup of IP addresses In-Reply-To: References: Message-ID: Hello, On 5 January 2018 at 07:02, Max Lapshin wrote: > On what request rates do you get performance problems with egeoip? we > have never met them. > I have never reached the limit either, but it's a pattern that has previously led me to performance issues on other code very often. At this point it has become ingrained in me that, if I can avoid it at negligible cost to complexity / maintainability / extensibility, then that's what I'll do. Lest someone consider it premature optimization, I rather see it as being considerate of my future self 6 months from now :-). But that's all very subjective, of course. -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri Jan 5 21:01:38 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 5 Jan 2018 23:01:38 +0300 Subject: [erlang-questions] [ANN] locus: Geolocation and ASN lookup of IP addresses In-Reply-To: References: Message-ID: Understand. All other points are good, will try to look at it, thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex@REDACTED Fri Jan 5 18:11:27 2018 From: alex@REDACTED (Alex Alvarez) Date: Fri, 05 Jan 2018 12:11:27 -0500 Subject: [erlang-questions] AMD Ryzen anyone? In-Reply-To: References: <1514933179.2711481.1222260232.13494F16@webmail.messagingengine.com> <2b1ebb6f-8e54-2bd5-b3dd-41839a8e934c@hs.ntnu.edu.tw> <9732f5dd-3428-7dfe-02cc-e7209d8b3e09@hs.ntnu.edu.tw> <5A4D79F4.5080805@gjunka.com> Message-ID: <20180105171127.B7E34C0559@smtp.hushmail.com> The only thing I'd add for reference is that in high performance computing, the default is to disable virtual threads (e.g., hyper-threads) as they actually slow down things otherwise. Under normal execution, having more CPU threads available is a good thing, but not if the application needs a lot more out of the CPU. The biggest time issue is actually not the CPU, but memory access. In anything that really pushes the system, like when you perform parallel calculations (e.g., openmp), you simply don't want virtual threads anywhere. As far as I know, all super computer disable virtual threads by default. Each case could vary, but this is something to test for. And in the case Erlang, I'd try with/out to see what results you get. If possible, I'd disable the virtual threads and try CouchDB again. Cheers, Alex On 1/4/2018 at 12:58 PM, "Eric des Courtis" wrote:+1 for Threadripper or Ryzen Pro On Wed, Jan 3, 2018 at 7:48 PM, Grzegorz Junka wrote: On 03/01/2018 08:21, Iblis Lin wrote: forgot to CC the list. On 01/03/2018 01:21 PM, Iblis Lin wrote: well, purchasing decision is up to you, but I want to share my personal experience: I will vote -100 for the Ryzen build. For me, the term "Ryzen" means malicious trolling. It wasted my time and mental efforts. I will show you my journal: - I set up the Ryzen box in 2017/5. Mine is 1700 (8 cores 16 threads). - I install Arch Linux, ran CouchDB on it... and found the machine crash and reboot regularly in an interval of 2-3 days. - I also tried to build mainline kernel, (at that moment, it's 4.12 IIRC), not work , still crashing or freezing. - Another test: disabling all deamon, the box can be alive over a week. - Changing memory module in 2017/6, not work. - 2017/9 I RMA-ed it. - After RMA, it still keeps crashing, hard freezing, soft freezing... within 3-6 hr if I run something on it. the kill-ryzen script DOES kill my box, even it's the new CPU back from RMA. The *improvement* is the crashing interval shrunk. Thank you AMD. - 2017/10, I changed my OS from Arch to Ubuntu. not work. On 01/03/2018 06:46 AM, Adam Rutkowski wrote: Hey all, I'm thinking of building a Ryzen machine, mainly for Erlang development. There's this rather obscure bug with some Ryzen processors on Linux/BSD [1] and I'm worried I might be getting a unit from the faulty batch; I have no means of verifying this before purchasing from my local suppliers. I'm wondering if I should I expect any issues with Erlang VM doing the multi-core heavy lifting. Cheers [1]: https://www.phoronix.com/scan.php?page=news_item&px=Ryzen-Segv-Response Interestingly, it's not that not choosing Ryzen guarantees you a worry-free reality: http://www.dailymail.co.uk/sciencetech/article-5232037/Security-flaw-Intel-chips-past-decade.html Arguably 50% slowdown or a security flaw is better than a random crash. But maybe the real lesson is to choose a processor that doesn't have any known vulnerability so far, e.g. Threadripper or a dedicated server processor? GrzegorzJ _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.muller.erl@REDACTED Sat Jan 6 22:38:19 2018 From: frank.muller.erl@REDACTED (Frank Muller) Date: Sat, 06 Jan 2018 21:38:19 +0000 Subject: [erlang-questions] binary_part/3 Message-ID: Hi Everyone Is the binary returned when calling binary_part/3: 1. a sub-binary pointing to the original one 2. or a new binary Thank you. Frank -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Sat Jan 6 23:38:48 2018 From: erlang@REDACTED (Robert Carbone) Date: Sat, 06 Jan 2018 17:38:48 -0500 Subject: [erlang-questions] 2018: A Year for wxErlang Message-ID: <5A514FF8.7090008@scriptculture.com> Hi Fellow Erlang-Mailing-Listers: Foremost, to this entire community; thank you for being there, lending advice, and producing an amazing archive of helpful Erlang content. As a relative beginner, this treasure trove of information has been very helpful on numerous occasions. If you are interested in GUI programming, the following is sure to start your New Year out on a great note. For quite some time, I have been silently hacking away at wxErlang. A few days ago, I have launched an effort to teach wxErlang. My short-term goal is to alleviate the largest-barrier-to-entry for wxErlang. That is, the documentation is completely-scattered or non-existent. I have started this endeavor by publishing: - A diagram of the class-inheritance structure - Three edited libraries (first of many) ? CLASS INHERITANCE DIAGRAM ? One of the first steps to using wxErlang is to observe the library in its entirety. So here it is ? Here is a picture of the wxErlang class structure: Page 1: https://www.scriptculture.com/assets/sc_inherit_class_pg1.jpg Page 2: https://www.scriptculture.com/assets/sc_inherit_class_pg2.jpg As a chart of inheritance, this 2-page diagram allows you to visualize what function calls are inherited from upstream modules. That is, every module below (subclass) can call the functions of the module above, its 'super class' module. As reading one module is not enough to gain a complete picture, having beautiful, legible, readily-readable, source code documents becomes important. ? EDITED WX LIBRARY MODULES ? When you can sit down and seamlessly absorb what functions are at your disposal, it is simply fantastic. Your mind is freed up to think about the code you are about to write or UI, not straining to interpret the code in front of you. I am editing all the libraries by hand and releasing them. I have started with: ? wxEvent.erl ? wxEvtHandler.erl ? wxWindow.erl Having legible wx modules, with the options clearly labeled, makes wxErlang development not just possible, but efficient and fun. I'll continue to release a new library everyday or so until they are all available. They can be found at: https://scriptculture.com/ My resolution for this year is to bring beautification to the wxErlang Code Base. Cheers, Robert C. ScriptCulture.com ? 2018 Beautiful Erlang Code & Calligraphy wxfeedback@REDACTED From lloyd@REDACTED Sun Jan 7 15:47:25 2018 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Sun, 7 Jan 2018 09:47:25 -0500 Subject: [erlang-questions] 2018: A Year for wxErlang In-Reply-To: <5A514FF8.7090008@scriptculture.com> References: <5A514FF8.7090008@scriptculture.com> Message-ID: <5C3DA1D7-6575-462C-B22F-FC049B699181@writersglen.com> Outstanding Robert! Just the kind of work Erlang needs across many libraries. Hat?s off to you. LRP Sent from my iPad > On Jan 6, 2018, at 5:38 PM, Robert Carbone wrote: > > Hi Fellow Erlang-Mailing-Listers: > > Foremost, to this entire community; thank you for being there, lending advice, and producing an amazing archive of helpful Erlang content. > As a relative beginner, this treasure trove of information has been very helpful on numerous occasions. > If you are interested in GUI programming, the following is sure to start your New Year out on a great note. > > > For quite some time, I have been silently hacking away at wxErlang. > A few days ago, I have launched an effort to teach wxErlang. > > My short-term goal is to alleviate the largest-barrier-to-entry for wxErlang. > That is, the documentation is completely-scattered or non-existent. > > > I have started this endeavor by publishing: > - A diagram of the class-inheritance structure > - Three edited libraries (first of many) > > > ? CLASS INHERITANCE DIAGRAM ? > > One of the first steps to using wxErlang is to observe the library in its entirety. > So here it is ? Here is a picture of the wxErlang class structure: > > Page 1: https://www.scriptculture.com/assets/sc_inherit_class_pg1.jpg > Page 2: https://www.scriptculture.com/assets/sc_inherit_class_pg2.jpg > > As a chart of inheritance, this 2-page diagram allows you to visualize what function calls are inherited from upstream modules. That is, every module below (subclass) can call the functions of the module above, its 'super class' module. > As reading one module is not enough to gain a complete picture, having beautiful, legible, readily-readable, source code documents becomes important. > > > ? EDITED WX LIBRARY MODULES ? > > When you can sit down and seamlessly absorb what functions are at your disposal, it is simply fantastic. Your mind is freed up to think about the code you are about to write or UI, not straining to interpret the code in front of you. > > I am editing all the libraries by hand and releasing them. > I have started with: > ? wxEvent.erl > ? wxEvtHandler.erl > ? wxWindow.erl > > Having legible wx modules, with the options clearly labeled, makes wxErlang development not just possible, but efficient and fun. > I'll continue to release a new library everyday or so until they are all available. > They can be found at: > > https://scriptculture.com/ > > My resolution for this year is to bring beautification to the wxErlang Code Base. > > Cheers, > > Robert C. > > ScriptCulture.com ? 2018 > Beautiful Erlang Code & Calligraphy > wxfeedback@REDACTED > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From roger@REDACTED Sun Jan 7 17:00:53 2018 From: roger@REDACTED (Roger Lipscombe) Date: Sun, 7 Jan 2018 16:00:53 +0000 Subject: [erlang-questions] binary_part/3 In-Reply-To: References: Message-ID: It's a sub-binary: https://github.com/erlang/otp/blob/master/erts/emulator/beam/erl_bif_binary.c#L1915-L1924 On 6 January 2018 at 21:38, Frank Muller wrote: > Hi Everyone > > Is the binary returned when calling binary_part/3: > 1. a sub-binary pointing to the original one > 2. or a new binary > > Thank you. > Frank > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From frank.muller.erl@REDACTED Sun Jan 7 19:20:40 2018 From: frank.muller.erl@REDACTED (Frank Muller) Date: Sun, 07 Jan 2018 18:20:40 +0000 Subject: [erlang-questions] binary_part/3 In-Reply-To: References: Message-ID: Thank you Roger!!! It's a sub-binary: > > > https://github.com/erlang/otp/blob/master/erts/emulator/beam/erl_bif_binary.c#L1915-L1924 > > On 6 January 2018 at 21:38, Frank Muller > wrote: > > Hi Everyone > > > > Is the binary returned when calling binary_part/3: > > 1. a sub-binary pointing to the original one > > 2. or a new binary > > > > Thank you. > > Frank > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex@REDACTED Sun Jan 7 19:34:38 2018 From: alex@REDACTED (Alex Alvarez) Date: Sun, 07 Jan 2018 13:34:38 -0500 Subject: [erlang-questions] binary_part/3 In-Reply-To: References: Message-ID: <20180107183438.D4B8EC0546@smtp.hushmail.com> Okay, maybe I'm totally confused here, but is it a pointer to the original binary or a new binary? Looking at the source code it seems to build/make a new binary at the end of erts_gc_binary_part(). And from the shell... 1> A = . 2> B = erlang:binary_part(A, 0, 8). 3> f(A). ok 4> B. A is gone and we still have B. Does Erlang actually returns references? Cheers, Alex On 1/7/2018 at 1:21 PM, "Frank Muller" wrote:Thank you Roger!!! It's a sub-binary: https://github.com/erlang/otp/blob/master/erts/emulator/beam/erl_bif_binary.c#L1915-L1924 On 6 January 2018 at 21:38, Frank Muller wrote: > Hi Everyone > > Is the binary returned when calling binary_part/3: > 1. a sub-binary pointing to the original one > 2. or a new binary > > Thank you. > Frank > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.muller.erl@REDACTED Mon Jan 8 20:09:25 2018 From: frank.muller.erl@REDACTED (Frank Muller) Date: Mon, 08 Jan 2018 19:09:25 +0000 Subject: [erlang-questions] binary_part/3 In-Reply-To: <20180107183438.D4B8EC0546@smtp.hushmail.com> References: <20180107183438.D4B8EC0546@smtp.hushmail.com> Message-ID: OTP team, Anyone can shed some light on this please? /Frank Okay, maybe I'm totally confused here, but is it a pointer to the original > binary or a new binary? Looking at the source code it seems to build/make > a new binary at the end of erts_gc_binary_part(). And from the shell... > > 1> A = <<"A cookie is yummy!">>. > <<"A cookie is yummy!">> > 2> B = erlang:binary_part(A, 0, 8). > <<"A cookie">> > 3> f(A). > ok > 4> B. > <<"A cookie">> > > A is gone and we still have B. Does Erlang actually returns references? > > Cheers, > Alex > > On 1/7/2018 at 1:21 PM, "Frank Muller" wrote: > > Thank you Roger!!! > > It's a sub-binary: >> >> >> https://github.com/erlang/otp/blob/master/erts/emulator/beam/erl_bif_binary.c#L1915-L1924 >> >> On 6 January 2018 at 21:38, Frank Muller >> wrote: >> > Hi Everyone >> > >> > Is the binary returned when calling binary_part/3: >> > 1. a sub-binary pointing to the original one >> > 2. or a new binary >> > >> > Thank you. >> > Frank >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Mon Jan 8 20:20:18 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 08 Jan 2018 19:20:18 +0000 Subject: [erlang-questions] binary_part/3 In-Reply-To: References: <20180107183438.D4B8EC0546@smtp.hushmail.com> Message-ID: A sub-binary is a pointer into an already existing binary. It is, roughly, a triple of a pointer to the original binary, an offset into the binary, and a length (from that offset). They are quick to copy around, and they are making efficient use of the fact that data in an Erlang system is generally immutable. However, the caveat is that a sub-binary can keep an underlying binary "alive" for longer than it should. There are situations in which the ERTS will convert a sub-binary into a copy with a new binary, and the situation is slowly getting better and better. But if you want to be sure, you need to add a binary:copy/1 to a binary to make it into a full-blown (ref-counted) binary. In the example Alex writes, the f(A) in (3) merely forgets the ref-counted binary pointer. But the binary in (2) and (4) keeps it alive in the system. On Mon, Jan 8, 2018 at 8:09 PM Frank Muller wrote: > OTP team, > > Anyone can shed some light on this please? > > /Frank > > Okay, maybe I'm totally confused here, but is it a pointer to the original >> binary or a new binary? Looking at the source code it seems to build/make >> a new binary at the end of erts_gc_binary_part(). And from the shell... >> >> 1> A = <<"A cookie is yummy!">>. >> <<"A cookie is yummy!">> >> 2> B = erlang:binary_part(A, 0, 8). >> <<"A cookie">> >> 3> f(A). >> ok >> 4> B. >> <<"A cookie">> >> >> A is gone and we still have B. Does Erlang actually returns references? >> >> Cheers, >> Alex >> >> On 1/7/2018 at 1:21 PM, "Frank Muller" >> wrote: >> >> Thank you Roger!!! >> >> It's a sub-binary: >>> >>> >>> https://github.com/erlang/otp/blob/master/erts/emulator/beam/erl_bif_binary.c#L1915-L1924 >>> >>> On 6 January 2018 at 21:38, Frank Muller >>> wrote: >>> > Hi Everyone >>> > >>> > Is the binary returned when calling binary_part/3: >>> > 1. a sub-binary pointing to the original one >>> > 2. or a new binary >>> > >>> > Thank you. >>> > Frank >>> > >>> > _______________________________________________ >>> > erlang-questions mailing list >>> > erlang-questions@REDACTED >>> > http://erlang.org/mailman/listinfo/erlang-questions >>> > >>> >> _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex@REDACTED Mon Jan 8 21:04:08 2018 From: alex@REDACTED (Alex Alvarez) Date: Mon, 08 Jan 2018 15:04:08 -0500 Subject: [erlang-questions] binary_part/3 In-Reply-To: References: <20180107183438.D4B8EC0546@smtp.hushmail.com> Message-ID: <20180108200408.95BE3C0546@smtp.hushmail.com> Although I was not the original author of this thread, thanks Jesper for clearing this and the background info! Cheers, Alex On 1/8/2018 at 2:20 PM, "Jesper Louis Andersen" wrote:A sub-binary is a pointer into an already existing binary. It is, roughly, a triple of a pointer to the original binary, an offset into the binary, and a length (from that offset). They are quick to copy around, and they are making efficient use of the fact that data in an Erlang system is generally immutable. However, the caveat is that a sub-binary can keep an underlying binary "alive" for longer than it should. There are situations in which the ERTS will convert a sub-binary into a copy with a new binary, and the situation is slowly getting better and better. But if you want to be sure, you need to add a binary:copy/1 to a binary to make it into a full-blown (ref-counted) binary. In the example Alex writes, the f(A) in (3) merely forgets the ref-counted binary pointer. But the binary in (2) and (4) keeps it alive in the system. On Mon, Jan 8, 2018 at 8:09 PM Frank Muller wrote: OTP team, Anyone can shed some light on this please? /Frank Okay, maybe I'm totally confused here, but is it a pointer to the original binary or a new binary? Looking at the source code it seems to build/make a new binary at the end of erts_gc_binary_part(). And from the shell... 1> A = . 2> B = erlang:binary_part(A, 0, 8). 3> f(A). ok 4> B. A is gone and we still have B. Does Erlang actually returns references? Cheers, Alex On 1/7/2018 at 1:21 PM, "Frank Muller" wrote:Thank you Roger!!! It's a sub-binary: https://github.com/erlang/otp/blob/master/erts/emulator/beam/erl_bif_binary.c#L1915-L1924 On 6 January 2018 at 21:38, Frank Muller wrote: > Hi Everyone > > Is the binary returned when calling binary_part/3: > 1. a sub-binary pointing to the original one > 2. or a new binary > > Thank you. > Frank > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From billy.svensson@REDACTED Tue Jan 9 17:07:43 2018 From: billy.svensson@REDACTED (Billy Svensson) Date: Tue, 9 Jan 2018 17:07:43 +0100 Subject: [erlang-questions] Inconsistency in start_link Message-ID: Is there any particular reason why supervisor:start_link/3 takes a SupName of {global, atom()} instead of {global, term()}? I can't see any reason why it's limiting the global name to a atom instead of a tuple since it's just passing the SupName to gen_server:start_link/4 that accepts {global, term()}, but maybe I'm missing something? From Catenacci@REDACTED Wed Jan 10 20:58:00 2018 From: Catenacci@REDACTED (Onorio Catenacci) Date: Wed, 10 Jan 2018 14:58:00 -0500 Subject: [erlang-questions] [ANN] Chocolatey NuGet Packages Updated Message-ID: HI all, The Chocolatey NuGet package for Erlang is updated to 20.2 and the package for Rebar 3 is now updated to 3.5.0 -- Onorio Catenacci http://onor.io http://www.google.com/+OnorioCatenacci -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Thu Jan 11 03:27:01 2018 From: erlang@REDACTED (Script Culture) Date: Wed, 10 Jan 2018 21:27:01 -0500 Subject: [erlang-questions] 2018: A Year for wxErlang In-Reply-To: References: <5A514FF8.7090008@scriptculture.com> Message-ID: <18d080d1-900e-ccc8-cbba-aed38954c92f@scriptculture.com> Elegance is not optional. The changes you requested have been made to make the wxErlang scripts easier on the eyes. However, this is just a temporary band-aid as I construct a real solution. My problem is I am relying on SublimeText's Syntax Highlighter -to HTML- package for my Erlang HTML. The classes that Sublime's Highlighter cooks up are a pitiful match to Erlang's syntax/lexicon. It doesn't even distinguish a function_name() correctly. For building HTML scripts, all that needs to be actively generated/output is the : ? body format class at the top & wrapped-tokens at the bottom. / Classes string format:/ body .n { color: #fb660a; font-weight: bold } /* Keyword */ / Token String Format: / module_md5 I can imagine writing a lexical scanner to do this with two passes. - One to get the classes to be colored. - The other to apply the HTML bracket-format. /But I want Elegance.../ What's the best attack strategy if I want to scrape the code to get real syntax highlighting? I would like to do this in Erlang, that is, versus the traditional formal grammar file method. ? Should I take the AST as input...and do what?...recursively scan the tuple branches? {op,1,'-',{call,1,{atom,1,module},[{var,1,'ModuleName'}]}} I've checked out wrangler_parse, wrangler_syntax_lib & a good amount of our syntax tools to no avail, maybe I missed it. ? Or should I attempt to write functions based around scanning for unique tokens patterns, identifying terminal/terminals and compare adjacent tokens. I imagine i would have to follow expression reduction priority here. Then deducing the token into a given color. I don't mind wrapping all of Erlang in its own 'grammar logic'. Is there a library out there to obtain/explode the AST into syntactically correct tagged tokens? Cheers, Robert C. On 1/9/18 6:01 PM, Richard O'Keefe wrote: > You hero, sir! > > Except, I looked at https://scriptculture.com/wxevent.html > and it was the reverse of beautiful. In fact, it was very nearly > (physically) unreadable. The least important thing, the line numbers, > was in brilliant white. The most important thing, the text, was in > medium grey against a dark grey or black background, very poor > contrast, real eyestrain territory. I am willing to take it on faith > that you have made the code, qua code, beautiful. > > On 7 January 2018 at 11:38, Robert Carbone > wrote: > > Hi Fellow Erlang-Mailing-Listers: > > Foremost, to this entire community; thank you for being there, > lending advice, and producing an amazing archive of helpful Erlang > content. > As a relative beginner, this treasure trove of information has > been very helpful on numerous occasions. > If you are interested in GUI programming, the following is sure to > start your New Year out on a great note. > > > For quite some time, I have been silently hacking away at wxErlang. > A few days ago, I have launched an effort to teach wxErlang. > > My short-term goal is to alleviate the largest-barrier-to-entry > for wxErlang. > That is, the documentation is completely-scattered or non-existent. > > > I have started this endeavor by publishing: > - A diagram of the class-inheritance structure > - Three edited libraries (first of many) > > > ? CLASS INHERITANCE DIAGRAM ? > > One of the first steps to using wxErlang is to observe the library > in its entirety. > So here it is ? Here is a picture of the wxErlang class structure: > > Page 1: > https://www.scriptculture.com/assets/sc_inherit_class_pg1.jpg > > Page 2: > https://www.scriptculture.com/assets/sc_inherit_class_pg2.jpg > > > As a chart of inheritance, this 2-page diagram allows you to > visualize what function calls are inherited from upstream modules. > That is, every module below (subclass) can call the functions of > the module above, its 'super class' module. > As reading one module is not enough to gain a complete picture, > having beautiful, legible, readily-readable, source code documents > becomes important. > > > ? EDITED WX LIBRARY MODULES ? > > When you can sit down and seamlessly absorb what functions are at > your disposal, it is simply fantastic. Your mind is freed up to > think about the code you are about to write or UI, not straining > to interpret the code in front of you. > > I am editing all the libraries by hand and releasing them. > I have started with: > ? wxEvent.erl > ? wxEvtHandler.erl > ? wxWindow.erl > > Having legible wx modules, with the options clearly labeled, makes > wxErlang development not just possible, but efficient and fun. > I'll continue to release a new library everyday or so until they > are all available. > They can be found at: > > https://scriptculture.com/ > > My resolution for this year is to bring beautification to the > wxErlang Code Base. > > Cheers, > > Robert C. > > ScriptCulture.com ? 2018 > Beautiful Erlang Code & Calligraphy > wxfeedback@REDACTED > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenrique85@REDACTED Thu Jan 11 18:11:28 2018 From: jenrique85@REDACTED (Enrique) Date: Thu, 11 Jan 2018 12:11:28 -0500 Subject: [erlang-questions] Remote job Message-ID: Hi Friends, I am between jobs right now, does anyone need an erlang programmer for accomplish tasks for medium or short projects? Thanks From eshikafe@REDACTED Sat Jan 13 08:36:23 2018 From: eshikafe@REDACTED (austin aigbe) Date: Sat, 13 Jan 2018 08:36:23 +0100 Subject: [erlang-questions] QUIC Support in Erlang/OTP Message-ID: Hello, Some questions on QUIC 1. Please is there a complete QUIC implementation in Erlang? 2. Any plan to support QUIC transport in Erlang/OTP e.g gen_quic ? 3. Is cowboy support for QUIC available? Thanks. Regards, Austin -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Sat Jan 13 09:35:08 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Sat, 13 Jan 2018 09:35:08 +0100 Subject: [erlang-questions] QUIC Support in Erlang/OTP In-Reply-To: References: Message-ID: <0b23e9af-874a-bfa4-587c-dd3b01a7ec71@ninenines.eu> On 01/13/2018 08:36 AM, austin aigbe wrote: > Hello, > > Some questions on QUIC > > > 1. Please is there a complete QUIC implementation in Erlang? There is no complete QUIC specification so that's unlikely. Give it a year for that, and maybe another year for a good implementation. > 2. Any plan to support QUIC transport in Erlang/OTP e.g gen_quic ? > 3. Is cowboy support for QUIC available? It's still unclear what will be necessary for this because of the lack of specification. Last I heard there was still some big questions around how h2 must fit into QUIC. -- Lo?c Hoguin https://ninenines.eu From g@REDACTED Sat Jan 13 16:08:00 2018 From: g@REDACTED (Guilherme Andrade) Date: Sat, 13 Jan 2018 15:08:00 +0000 Subject: [erlang-questions] QUIC Support in Erlang/OTP In-Reply-To: References: Message-ID: Hi Austin, On 13 January 2018 at 07:36, austin aigbe wrote: > 1. Please is there a complete QUIC implementation in Erlang? > I've worked on it for a while[1] but it didn't go anywhere, and it's likely quite outdated by now. [1]: https://github.com/g-andrade/quack -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From pguyot@REDACTED Sun Jan 14 15:43:48 2018 From: pguyot@REDACTED (Paul Guyot) Date: Sun, 14 Jan 2018 15:43:48 +0100 Subject: [erlang-questions] [ANN] BBEdit Erlang Language Module v1.4 Message-ID: Hello, I'm pleased to announce v1.4 update of the Erlang language module for BBEdit, an award-winning MacOS X text editor. It features syntax coloring and code completion (including all Erlang/OTP documented API). You can download it here: https://github.com/pguyot/erlang-bblm/releases/tag/v1.4 Source code is available as well. Changes: ? [ENH] Upgraded for BBEdit 12.1 (64 bits). ? [ENH] Updated completion lists for Erlang OTP 20 ? [FEA] Added faceless helper application for reference lookups which either opens the man page in Terminal.app (if found) or performs a lookup on erlang.org in the default browser. Regards, Paul -- Semiocast http://semiocast.com/ +33.183627948 - 20 rue Lacaze, 75014 Paris From kuna.prime@REDACTED Sun Jan 14 15:59:07 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Sun, 14 Jan 2018 15:59:07 +0100 Subject: [erlang-questions] ets reference form name Message-ID: how to get table reference form table name of named table of ets table? thak you -------------- next part -------------- An HTML attachment was scrubbed... URL: From epailty@REDACTED Mon Jan 15 07:12:28 2018 From: epailty@REDACTED (Brian Modra) Date: Mon, 15 Jan 2018 16:12:28 +1000 Subject: [erlang-questions] Problem using PKI private key file Message-ID: I have to use PKI private key and its associated certificate. But I am having trouble reading the private key and using it. The following is copied from my terminal: $ erl Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [kernel-poll:false] Eshell V9.1 (abort with ^G) 1> {ok, PrivPemBin} = file:read_file("test.pk.pem"). {ok,<<"Bag Attributes\n localKeyID: A1 77 37 C0 83 09 CF E8 19 C9 C3 DD A7 56 79 28 DD 56 C6 01 \nKey Attributes: "...>>} 2> [PrivKeyEntry] = public_key:pem_decode(PrivPemBin). [{'PrivateKeyInfo',<<48,130,4,190,2,1,0,48,13,6,9,42,134,...>>, not_encrypted}] 3> PrivKey = public_key:pem_entry_decode(PrivKeyEntry). {'PrivateKeyInfo',v1, {'PrivateKeyInfo_privateKeyAlgorithm',{1,2,840,113549,1,1,1}, {asn1_OPENTYPE,<<5,0>>}}, <<48,130,4,164,2,1,0,2,130,1,1,0,174,64,216,53,107,61,116,...>>, asn1_NOVALUE} 4> Encrypted = public_key:encrypt_private(<<"Hello World">>, PrivKey). ** exception error: no function clause matching public_key:encrypt_private(<<"Hello World">>, {'PrivateKeyInfo',v1, {'PrivateKeyInfo_privateKeyAlgorithm',{1,2,840,113549,1,1,1}, {asn1_OPENTYPE,<<5,0>>}}, <<48,130,4,164,2,1,0,2,130,1,1,0,174,64,216,53,107,61,116,...>>, asn1_NOVALUE}, []) (public_key.erl, line 389) Notice that the key shows {'PrivateKeyInfo_privateKeyAlgorithm',{1,2,840,113549,1,1,1},{asn1_OPENTYPE,<<5,0>>}}, rather than something more recognisable like 'RSAPrivateKey'... Is this telling me the algorithm is not supported, or am I just not calling the right functions? The header of the PEM file looks as so: Bag Attributes localKeyID: A1 77 37 C0 83 09 CF E8 19 C9 C3 DD A7 56 79 28 DD 56 C6 01 Key Attributes: -----BEGIN PRIVATE KEY----- MIIEvgIB... [trimmed out obviously] -----END PRIVATE KEY----- ... which I think is telling me that the PK is a PKCS#8 ? (It was converted from a p12 file from an external source, using openssl). -- Brian Modra +61 4552 8 4772 26 Valley Drive, Caboolture, QLD 4510, Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth@REDACTED Mon Jan 15 14:38:07 2018 From: kenneth@REDACTED (Kenneth Lundin) Date: Mon, 15 Jan 2018 14:38:07 +0100 Subject: [erlang-questions] ets reference form name In-Reply-To: References: Message-ID: It is currently not possible to get the Table Id (tid()) from a named ets table. We have recently discussed to add a function ets:whereis/1 or ets:name2id/1 for this purpose so we have it in our backlog. /Kenneth Erlang/OTP team at Ericsson On Sun, Jan 14, 2018 at 3:59 PM, Karlo Kuna wrote: > how to get table reference form table name of named table of ets table? > > thak you > > > _______________________________________________ > 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 Mon Jan 15 18:28:33 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Mon, 15 Jan 2018 18:28:33 +0100 Subject: [erlang-questions] ets reference form name In-Reply-To: References: Message-ID: is there any time frame for this feature? On Mon, Jan 15, 2018 at 2:38 PM, Kenneth Lundin wrote: > It is currently not possible to get the Table Id (tid()) from a named ets > table. > We have recently discussed to add a function ets:whereis/1 or > ets:name2id/1 for this purpose so we have it in our backlog. > > /Kenneth Erlang/OTP team at Ericsson > > On Sun, Jan 14, 2018 at 3:59 PM, Karlo Kuna wrote: > >> how to get table reference form table name of named table of ets table? >> >> thak you >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadt18@REDACTED Mon Jan 15 21:16:57 2018 From: wadt18@REDACTED (Ionut Tutu) Date: Mon, 15 Jan 2018 20:16:57 +0000 Subject: [erlang-questions] =?utf-8?q?WADT_2018_=E2=80=93_1st_Call_for_Pap?= =?utf-8?q?ers?= Message-ID: ====================================================================== FIRST CALL FOR PAPERS WADT 2018 24th International Workshop on Algebraic Development Techniques http://wadt18.cs.rhul.ac.uk July 2?5, 2018, Royal Holloway University of London, Egham, UK ====================================================================== AIMS AND SCOPE The algebraic approach to system specification encompasses many aspects of the formal design of software systems. Originally born as a formal method for reasoning about abstract data types, it now covers new specification frameworks and programming paradigms (such as object-oriented, aspect-oriented, agent-oriented, logic and higher-order functional programming) as well as a wide range of application areas (including information systems, concurrent, distributed and mobile systems). The workshop will provide an opportunity to present recent and ongoing work, to meet colleagues, and to discuss new ideas and future trends. TOPICS OF INTEREST Typical, but not exclusive topics of interest are: ? Foundations of algebraic specification ? Other approaches to formal specification, including process calculi and models of concurrent, distributed, and cyber-physical systems ? Specification languages, methods, and environments ? Semantics of conceptual modelling methods and techniques ? Model-driven development ? Graph transformations, term rewriting, and proof systems ? Integration of formal specification techniques ? Formal testing and quality assurance, validation, and verification ? Algebraic approaches to cognitive sciences, including computational creativity WORKSHOP FORMAT AND LOCATION The workshop will take place over four days, Monday to Thursday, at Royal Holloway University of London in Egham, UK (https://www.royalholloway.ac.uk). Presentations will be selected on the basis of submitted abstracts. INVITED SPEAKERS Artur d'Avila Garcez (City, University of London, UK) Rolf Hennicker (LMU Munich, Germany) IMPORTANT DATES Submission deadline for abstracts: April 27th, 2018 Notification of acceptance: May 18th, 2018 Early registration: June 1st, 2018 Final abstract due: June 1st, 2018 Workshop: July 2?5, 2018 SUBMISSIONS The scientific programme of the workshop will include presentations of recent results or ongoing research as well as invited talks. The presentations will be selected by the Steering Committee on the basis of submitted abstracts according to originality, significance and general interest. Abstracts must not exceed two pages including references; if a longer version of the contribution is available, it can be made accessible on the web and referenced in the abstract. Abstracts have to be submitted electronically via the EasyChair system at https://easychair.org/conferences/?conf=wadt18. PROCEEDINGS After the workshop, authors will be invited to submit full papers for the refereed proceedings. All submissions will be reviewed by the Programme Committee. Selection will be based on originality, soundness, and significance of the presented ideas and results. The proceedings will be published as a volume of Lecture Notes in Computer Science (Springer). The deadline for submissions will be September 3, 2018, with notifications by October 29. Camera-ready versions will be required by November 11. SPONSORSHIP The workshop takes place under the auspices of IFIP WG 1.3. WADT STEERING COMMITTEE Andrea Corradini (Italy) Jos? Fiadeiro (UK) [co-chair] Rolf Hennicker (Germany) Hans-J?rg Kreowski (Germany) Till Mossakowski (Germany) Fernando Orejas (Spain) Markus Roggenbach (UK) Grigore Ro?u (United States) PROGRAMME COMMITEE Paolo Baldan (Italy) Andrea Corradini (Italy) R?zvan Diaconescu (Romania) Jos? Fiadeiro (UK) [co-chair] Fabio Gadducci (Italy) Artur d'Avila Garcez (UK) Reiko Heckel (UK) Rolf Hennicker (Germany) Alexander Knapp (Germany) Barbara K?nig (Germany) Ant?nia Lopes (Portugal) Narciso Marti-Oliet (Spain) Till Mossakowski (Germany) Fernando Orejas (Spain) Leila Ribeiro (Brazil) Markus Roggenbach (UK) Pierre-Yves Schobbens (Belgium) Lutz Schr?der (Germany) Pawel Sobocinski (UK) Ionu? ?u?u (UK) [co-chair] Martin Wirsing (Germany) ORGANIZING COMMITTEE Claudia Chiri?? (UK) Jos? Fiadeiro (UK) Ionu? ?u?u (UK) CONTACT INFORMATION Email: wadt18@REDACTED Homepage: http://wadt18.cs.rhul.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From sperber@REDACTED Tue Jan 16 18:40:58 2018 From: sperber@REDACTED (Michael Sperber) Date: Tue, 16 Jan 2018 18:40:58 +0100 Subject: [erlang-questions] 2nd Call for Participation: BOB 2018 (February 23, Berlin) Message-ID: Lots of functional programming at BOB! =================================================================== BOB 2018 Conference ?What happens if we simply use what?s best?? February 23, 2018, Berlin http://bobkonf.de/2018/ Program: http://bobkonf.de/2018/en/program.html Registration: http://bobkonf.de/2018/en/registration.html ================================================================ BOB is the conference for developers, architects and decision-makers to explore technologies beyond the mainstream in software development, and to find the best tools available to software developers today. Our goal is for all participants of BOB to return home with new insights that enable them to improve their own software development experiences. The program features 14 talks and 8 tutorials on current topics: http://bobkonf.de/2018/en/program.html The subject range of talks includes functional programming, verticalization, formal methods, and data analytics. The tutorials feature introductions to Haskell, Clojure, Livecoding, terminal programming, Liquid Haskell, functional reactive programming, and domain-driven design. Leif Andersen will give the keynote talk. Registration is open online: http://bobkonf.de/2018/en/registration.html NOTE: The early-bird rates expire on January 22, 2018! BOB cooperates with the :clojured conference on the following day. There is a registration discount available for participants of both events. http://www.clojured.de/ From lukas@REDACTED Wed Jan 17 10:34:28 2018 From: lukas@REDACTED (Lukas Larsson) Date: Wed, 17 Jan 2018 10:34:28 +0100 Subject: [erlang-questions] ets reference form name In-Reply-To: References: Message-ID: On Mon, Jan 15, 2018 at 6:28 PM, Karlo Kuna wrote: > is there any time frame for this feature? > No, we do not know when it will get done. If you wish to speed things along, a contribution would be most welcome. It should be quite simple to implement. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From bp@REDACTED Thu Jan 18 08:51:11 2018 From: bp@REDACTED (Bjarne Wichmann Bagge Petersen) Date: Thu, 18 Jan 2018 08:51:11 +0100 Subject: [erlang-questions] KATT multiplies floats by a factor of 10 or 100. Message-ID: Have this head scratcher where I apply a float to a KATT parameter but in the request that float have been inflated by a factor of 10 or 100. I am wondering whether I am missing something obvious about how to treat floats in katt/jsx/erlang? Or this is a KATT bug? Got this minimal test case: float_test(Config) -> File = filename:join([?config(data_dir, Config), "float_test.apib"]), Params = [ {test_float, 1.23}], katt:run(File, Params). And the contents of float_test.apib: POST http://localhost:9999 > Accept: application/json > Content-Type: application/json > User-Agent: KATT { "test": "{{ From ilya.khaprov@REDACTED Thu Jan 18 14:52:26 2018 From: ilya.khaprov@REDACTED (Ilya Khaprov) Date: Thu, 18 Jan 2018 13:52:26 +0000 Subject: [erlang-questions] Calling Erlang functions from NIFs Message-ID: Hello, How to call an Erlang function from NIFs? Been trying to find for a while now. My use case - data structure implemented in C++ with user validation. I want to implement this validation via callbacks e.g. user calls NIF with a fun as an argument and NIF calls this function say in a filter loop. I can imagine some scheduling problems behind this, but can it be done in principle? Regards, Ilya From leonard.boyce@REDACTED Thu Jan 18 14:56:26 2018 From: leonard.boyce@REDACTED (Leonard B) Date: Thu, 18 Jan 2018 08:56:26 -0500 Subject: [erlang-questions] KATT multiplies floats by a factor of 10 or 100. In-Reply-To: References: Message-ID: Hello Bjanre, If I'm looking at the correct source for KATT (https://github.com/for-GET/katt), it looks like it may be a bug in katt_util:my_float_to_list/2 Quick test. 1> F = fun My_float_to_list(X, Decimals) -> 1> Multiplier = trunc(math:pow(10, Decimals)), 1> X1 = X * Multiplier, 1> X2 = trunc(X1) + 0.0, 1> case X1 =:= X2 of 1> true -> 1> String = integer_to_list(trunc(X1)), 1> Number = [ string:sub_string(String, 1, Decimals) 1> , string:sub_string(String, min( Decimals + 1 1> , string:len(String) + 1 1> )) 1> ], 1> string:join(Number, "."); 1> false -> 1> Decimals1 = Decimals + 1, 1> My_float_to_list(X, Decimals1) 1> end end. #Fun 2> F(1.23,0). "12.3" On Thu, Jan 18, 2018 at 2:51 AM, Bjarne Wichmann Bagge Petersen wrote: > Have this head scratcher where I apply a float to a KATT parameter but in > the request that float have been inflated by a factor of 10 or 100. > > I am wondering whether I am missing something obvious about how to treat > floats in katt/jsx/erlang? Or this is a KATT bug? > > Got this minimal test case: > > float_test(Config) -> > File = filename:join([?config(data_dir, Config), "float_test.apib"]), > Params = [ {test_float, 1.23}], > katt:run(File, Params). > > And the contents of float_test.apib: > > POST http://localhost:9999 >> Accept: application/json >> Content-Type: application/json >> User-Agent: KATT > { > "test": "{{ "reference": 1.23 > } > < 200 > < Content-Type: application/json > {} > > And this is how the request looks using nc -l 9999 > > POST / HTTP/1.1 > Accept: application/json > Content-Type: application/json > User-Agent: KATT > Host: localhost:9999 > Content-Length: 43 > > { > "test": 12.3, > "reference": 1.23 > } > > As you can see "test_float" have been multiplied by a factor 10. > > > Best regards > > > Bjarne Wichmann Bagge Petersen > > Backend Developer, ShopGun > > > E: bp@REDACTED > L: dk.linkedin.com/in/bjarnewp > W: shopgun.com > A: Arne Jacobsens All? 16, Field's, 3rd floor, DK-2300 K?benhavn S, Denmark > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From essen@REDACTED Thu Jan 18 15:05:33 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Thu, 18 Jan 2018 15:05:33 +0100 Subject: [erlang-questions] Calling Erlang functions from NIFs In-Reply-To: References: Message-ID: Hello, I did something similar to what you need a few days ago: https://git.ninenines.eu/esdl2.git/commit/?id=d6de0fce0b46be3b382ba3c30fb7c9559f3fcb8e I have also put some thoughts on various callback mechanisms and how I would implement them at the bottom here: https://git.ninenines.eu/esdl2.git/about/ The only way to call an Erlang function from a NIF is to send a message to a callback process that will then run the function. You can send the fun in this message but to keep it in the NIF you will probably need to copy it in an environment you allocated yourself (and then copy it again in the environment that will send the message). Calling a function from a NIF is easy. Having the NIF receive the result of the callback is much harder. My solution involves having a separate NIF function for receiving the result, called by the callback process at the end of the callback execution. This NIF function will then require a mutex lock/cond to store the result where I will be able to read it afterwards, and to signal the waiting thread that it can read it. My own code runs in a separate thread from the schedulers, if you need to wait from inside a scheduler thread things might get funny if there's only one scheduler or if the callback takes too long. Suffice to say that it's probably not very efficient to do all this. On 01/18/2018 02:52 PM, Ilya Khaprov wrote: > Hello, > > How to call an Erlang function from NIFs? Been trying to find for a > while now. > > My use case - data structure implemented in C++ with user validation. I > want to implement this validation via callbacks e.g. user calls NIF with > a fun as an argument and NIF calls this function say in a filter loop. I > can imagine some scheduling problems behind this, but can it be done in > principle? > > Regards, > > Ilya > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin https://ninenines.eu From iamexile@REDACTED Thu Jan 18 17:43:05 2018 From: iamexile@REDACTED (Eugene Pirogov) Date: Thu, 18 Jan 2018 18:43:05 +0200 Subject: [erlang-questions] crypto:engine_list() returns empty list Message-ID: Hi, I'm running *crypto:engine_list()*, but it won't list any OpenSSL engines I have installed. What can be the reason? I can see the engine in the system by running the following: # openssl engine -t gost (gost) Reference implementation of GOST engine [ available ] # openssl engine -t dstu (dstu) Reference implementation of DSTU engine [ available ] However when running from erl repl, I get this: # erl Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.2 (abort with ^G) 1> crypto:engine_list(). [] What's weird is that if I try to forcefully load the engine, it *works sometimes.* - it works with gost engine: # erl Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.2 (abort with ^G) 1> {ok, Engine} = crypto:engine_load(<<"gost">>, [], []). {ok,#Ref<0.950608548.1984823298.71941>} - it does not work with dstu engine: # erl Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.2 (abort with ^G) 1> {ok, Engine} = crypto:engine_load(<<"dstu">>, [], []). ** exception error: no match of right hand side value {error,bad_engine_id} What am I missing? How can I get to load dstu engine in my case? -- http://www.gmile.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From felixgallo@REDACTED Fri Jan 19 01:05:04 2018 From: felixgallo@REDACTED (Felix Gallo) Date: Thu, 18 Jan 2018 16:05:04 -0800 Subject: [erlang-questions] backpressure removal Message-ID: I was recently surprise-educated that reduction-based backpressure on senders is being removed: https://github.com/erlang/otp/commit/2e601a2efc19d64ed0628a5973596e6331ddcc7c#diff-de35f5a632c1decd2fbd06cf7ed2c8dc Can someone catch me up on the thinking and where I could go to learn more? F. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kjnilsson@REDACTED Fri Jan 19 09:50:56 2018 From: kjnilsson@REDACTED (Karl Nilsson) Date: Fri, 19 Jan 2018 08:50:56 +0000 Subject: [erlang-questions] Sender punishment removed Message-ID: So I saw that the sender punishment was removed in [1]. The commit message doesn't outline any of the reasoning behind this. Is there any more details available about this anywhere I can read? I understand it never really worked that well but it would still be interesting to understand a bit further. On a similar note what is the current thinking on flow control between erlang processes? Are there any improvements on mixing in a few calls in with the casts? [1] https://github.com/erlang/otp/commit/2e601a2efc19d64ed0628a5973596e6331ddcc7c -------------- next part -------------- An HTML attachment was scrubbed... URL: From fxn@REDACTED Fri Jan 19 09:56:14 2018 From: fxn@REDACTED (Xavier Noria) Date: Fri, 19 Jan 2018 09:56:14 +0100 Subject: [erlang-questions] module preloading in embedded mode Message-ID: I have been tracing the boot progress of a minimal release (generated with Mix) to understand who and when preloads modules and runs on_load handlers. The source code of application.erl and application_controller.erl seem to suggest that (-init_debug notation) {apply,{application,load,...} basically loads the application resource file and stores stuff in ETS tables, but object code does not seem to be loaded (that coincides with the documentation of application:load/1, but contradicts at least two books). I have added an on_load callback in a module that prints a trace, and that trace is shown after *all* applications have been loaded, after kernel has been started, and before stdlib is started. I thought that meant kernel:start_boot preloaded the modules. But I have read some of the initialization of kernel and I believe the callback is *not* called when the module has been loaded into the VM, but with this ad- hoc line in the init/1 of kernel_sup: https://github.com/erlang/otp /blob/db58a0c04ca183de5e5436e0ae97e3f109a458fe/lib/kernel/src/kernel.erl #L224 On the other hand, I have read the source code of init.erl and looks like the thing happens when processing primLoad: https://github.com/erlang/otp /blob/db58a0c04ca183de5e5436e0ae97e3f109a458fe/erts/preloaded/src/init.erl #L899 which goes before all application loading in a conventional generated boot script. So, I've come with this tentative workflow: * primLoad loads all object code into the BEAM. In a normal boot script that means loading all modules of all bundled applications and included applications. * Loading applications just processes and stores the application resource file. * On boot, on_load handlers do not actually run when the object code is loaded into the BEAM, but much later, when kernel_sup is initialized as part of starting the kernel application (which I guess makes sense because you want to run that code when the callback is able to execute with enough stuff bootstrapped). My walkthrough has not been exhaustive, though. Can anyone confirm/refute that? -------------- next part -------------- An HTML attachment was scrubbed... URL: From lars.thorsen@REDACTED Fri Jan 19 10:11:20 2018 From: lars.thorsen@REDACTED (Lars Thorsen) Date: Fri, 19 Jan 2018 09:11:20 +0000 Subject: [erlang-questions] crypto:engine_list() returns empty list In-Reply-To: References: Message-ID: Hi, crypto:engine_list() returns what engine is loaded for OTP ssl (OTP just uses crypto lib and not openssl ) and not what is available (it loops too get all engines by using ENGINE_get_first() and ENGINE_get_next() from crypto lib). OTP just uses crypto lib and not openssl. So after you executed {ok, Engine} = crypto:engine_load(<<"gost">>, [], []). you should see gost in the list. Interesting with dstu, where is that engine located. Same place as gost ? Normally if you just use the id, the engine must be located in the OpenSSL/LibreSSL installation "engines" directory for crypto lib to find it. See crypto users guide for loading from other directory. Perhaps openssl has some other config where to find engines that not affects cryptolib. BR Lars Thors?n OTP Team ________________________________ From: erlang-questions-bounces@REDACTED on behalf of Eugene Pirogov Sent: Thursday, January 18, 2018 5:43:05 PM To: erlang-questions@REDACTED Subject: [erlang-questions] crypto:engine_list() returns empty list Hi, I'm running crypto:engine_list(), but it won't list any OpenSSL engines I have installed. What can be the reason? I can see the engine in the system by running the following: # openssl engine -t gost (gost) Reference implementation of GOST engine [ available ] # openssl engine -t dstu (dstu) Reference implementation of DSTU engine [ available ] However when running from erl repl, I get this: # erl Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.2 (abort with ^G) 1> crypto:engine_list(). [] What's weird is that if I try to forcefully load the engine, it works sometimes. * it works with gost engine: # erl Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.2 (abort with ^G) 1> {ok, Engine} = crypto:engine_load(<<"gost">>, [], []). {ok,#Ref<0.950608548.1984823298.71941>} * it does not work with dstu engine: # erl Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.2 (abort with ^G) 1> {ok, Engine} = crypto:engine_load(<<"dstu">>, [], []). ** exception error: no match of right hand side value {error,bad_engine_id} What am I missing? How can I get to load dstu engine in my case? -- http://www.gmile.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From fxn@REDACTED Fri Jan 19 10:56:13 2018 From: fxn@REDACTED (Xavier Noria) Date: Fri, 19 Jan 2018 10:56:13 +0100 Subject: [erlang-questions] module preloading in embedded mode In-Reply-To: References: Message-ID: Ah! Even more. I just realized that workflow does not seem to depend on the mode. primLoad seems to be unconditionally processed, so I believe all modules in the primLoads of whatever boot script is used are loaded into the BEAM regardless of interactive/embedded. In a release, you eager load all modules NOT because embedded mode is on, but because the generated scripts lists them all in primLoads. What embedded does is basically preventing the error handler from falling back to the code server, here: https://github.com/erlang/otp/blob/9ff28ca4095c7877f4f4a6cab4d691ba52f07372/lib/kernel/src/code_server.erl#L310-L318 That's an aha! moment for me. Because some docs imply that embedded mode means eager loading. -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Fri Jan 19 11:45:21 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Fri, 19 Jan 2018 11:45:21 +0100 Subject: [erlang-questions] Why does Core Erlang have a catch-all clause for everything? Message-ID: Hello, A short discussion about exceptions left us wondering why generated Core Erlang code always has a catch-all clause for things that don't match? Is it so it can throw a specific exception? And what would happen if the catch-all was missing and the input failed to match? Cheers, -- Lo?c Hoguin https://ninenines.eu From n.oxyde@REDACTED Fri Jan 19 11:48:20 2018 From: n.oxyde@REDACTED (Anthony Ramine) Date: Fri, 19 Jan 2018 11:48:20 +0100 Subject: [erlang-questions] Why does Core Erlang have a catch-all clause for everything? In-Reply-To: References: Message-ID: It is undefined behaviour from Core Erlang's POV to have a value that doesn't match against any case arm. There are other similar UB cases, such as a Core Erlang clause guard not evaluating to a boolean. See the spec for more details. https://www.it.uu.se/research/group/hipe/cerl/doc/core_erlang-1.0.3.pdf > Le 19 janv. 2018 ? 11:45, Lo?c Hoguin a ?crit : > > Hello, > > A short discussion about exceptions left us wondering why generated Core Erlang code always has a catch-all clause for things that don't match? Is it so it can throw a specific exception? And what would happen if the catch-all was missing and the input failed to match? > > Cheers, > > -- > Lo?c Hoguin > https://ninenines.eu > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From carlsson.richard@REDACTED Fri Jan 19 12:01:24 2018 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Fri, 19 Jan 2018 12:01:24 +0100 Subject: [erlang-questions] Why does Core Erlang have a catch-all clause for everything? In-Reply-To: References: Message-ID: The point of leaving it as undefined behaviour is so that the specification of case clauses is free from any hardwired assumptions about what is the right thing to do if there is no match. This is both in order to let the Core Erlang spec be decoupled from any particular implementation of Erlang or any other language using Core Erlang, now or in the future, and to force the actual behaviour to be expressed as explicit code that can be processed by tools rather than being baked into the behaviour of the case switch (meaning that all tools would need to know about it, add extra code for it, and get it right every time). /Richard 2018-01-19 11:48 GMT+01:00 Anthony Ramine : > It is undefined behaviour from Core Erlang's POV to have a value that > doesn't match against any case arm. There are other similar UB cases, such > as a Core Erlang clause guard not evaluating to a boolean. > > See the spec for more details. > > https://www.it.uu.se/research/group/hipe/cerl/doc/core_erlang-1.0.3.pdf > > > Le 19 janv. 2018 ? 11:45, Lo?c Hoguin a ?crit : > > > > Hello, > > > > A short discussion about exceptions left us wondering why generated Core > Erlang code always has a catch-all clause for things that don't match? Is > it so it can throw a specific exception? And what would happen if the > catch-all was missing and the input failed to match? > > > > Cheers, > > > > -- > > Lo?c Hoguin > > https://ninenines.eu > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seriy.pr@REDACTED Fri Jan 19 12:51:33 2018 From: seriy.pr@REDACTED (=?UTF-8?B?0KHQtdGA0LPQtdC5INCf0YDQvtGF0L7RgNC+0LI=?=) Date: Fri, 19 Jan 2018 12:51:33 +0100 Subject: [erlang-questions] Sender punishment removed Message-ID: Hi, I asked the same question in Erlang Slack chat and got the answer from Lukas Larsson: https://erlanger.slack.com/archives/C055DJA49/p1516182075000430 garazdawi10:41 AM @seriyps we have been wanting to remove it for a very long time, as it was introduced mainly to solve problems with non-smp systems and doesn't do much in smp systems. We are just now in progress of re-writing how process to process signal/message passing works, so we decided that it was time to remove sender punishment at the same time. Also, we have lately been writing a lot of more benchmarks in order to track the performance of various parts of the Erlang/OTP and senderpunishment makes it very hard to get predictable performance. So I saw that the sender punishment was removed in [1]. The commit message > doesn't outline any of the reasoning behind this. Is there any more details > available about this anywhere I can read? I understand it never really > worked that well but it would still be interesting to understand a bit > further. > On a similar note what is the current thinking on flow control between > erlang processes? Are there any improvements on mixing in a few calls in > with the casts? > [1] > https://github.com/erlang/otp/commit/2e601a2efc19d64ed0628a5 > 973596e6331ddcc7c -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Fri Jan 19 22:17:16 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Fri, 19 Jan 2018 21:17:16 +0000 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: As Lukas already wrote on slack somewhere: Imagine you have a 2000'es machine: single core, around 400 mhz if you are lucky. In that setting, sender punishment can in some situations rectify a system that is going overboard. We simply let the offending process have less time on the scheduler in the hope that the overloaded mailbox process can catch up and do its work. It is not a surefire solution, but it may avoid some situations in which the system would otherwise topple. Fast forward 18 years. Now, the machines are multicore, at least 4 threads commonly. Here, a sender might live on one core whereas the reciever might live on another process. It is less clear why the punishment strategy is good: we get to stop the sender, but there were already a scheduler for the other core and it is still overloaded. Worse, perhaps all the other cores are able to send messages through to the overloaded process. As for the flow control: Erlang systems already employ flow control, namely TCP flow control between distributed nodes. I've seen two recent problems pertaining to having flow control inside flow control: gRPC has 3 layers: gRPC itself, HTTP/2 and TCP. And HTTP/2 has a layer on top of TCP. This is dangerous as the flow control of the underlying system can interfere with the flow control of the system above. By extension, any Erlang-mechanism of flow control needs to protect against a scenario where your application has its own layer and make sure it doesn't interfere. Personally, I think Ulf Wiger's "Jobs" model paved the way[0]: Apply flow control on input edge of the system, but don't apply it internally. If you do this correct, then a system shouldn't overload because of the border-limit. If you apply internal flow control, you also expose yourself to the danger of an artificial internal bottleneck. Rather, sample internally and use this as a feedback mechanism for the input edge. Also note distributed flow control is a considerably harder problem to solve, and since Erlang is distributed by default, any general solution has to address this as well. [0] https://github.com/uwiger/jobs/blob/master/doc/erlang07g-wiger.pdf On Fri, Jan 19, 2018 at 9:51 AM Karl Nilsson wrote: > So I saw that the sender punishment was removed in [1]. The commit message > doesn't outline any of the reasoning behind this. Is there any more details > available about this anywhere I can read? I understand it never really > worked that well but it would still be interesting to understand a bit > further. > > On a similar note what is the current thinking on flow control between > erlang processes? Are there any improvements on mixing in a few calls in > with the casts? > > [1] > https://github.com/erlang/otp/commit/2e601a2efc19d64ed0628a5973596e6331ddcc7c > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Fri Jan 19 23:33:36 2018 From: t@REDACTED (Tristan Sloughter) Date: Fri, 19 Jan 2018 14:33:36 -0800 Subject: [erlang-questions] seq_trace with bigint labels Message-ID: <1516401216.2365459.1241588784.5518363F@webmail.messagingengine.com> I've gone back and forth for a while now on how seq_trace, http://erlang.org/doc/man/seq_trace.html, could best be used, if at all, to benefit distributed tracing libraries. In particular I've been working on OpenCensus (http://opencensus.io) -- a recent announcement on the Google open source blog about it: https://opensource.googleblog.com/2018/01/opencensus.html -- implementation in Erlang, https://github.com/census-instrumentation/opencensus-erlang. But this is not unique to Census, the OpenTracing (http://opentracing.io) implementation Otter, https://github.com/Bluehouse-Technology/otter/, works in a similar manner. A trace must track a trace id and span id and propagate them to children. Both opencensus and Otter provide functionality to track the context in a variable or in the process dictionary. But when it comes to message passing the only option is adding a variable. Libraries that are instrumented internally can make this not have to modify the user's api, for example in Erleans we have 'call' extract the trace context behind the scenes and pass it through the gen_statem:call, https://github.com/SpaceTime-IoT/erleans/blob/master/src/erleans_grain.erl#L142 If it were possible to carry the trace context through the message pass in the background in general this would open up possibility for easier instrumentation with few changes to a user's code. This is essentially what seq_trace already does. The first issue hit when looking at using it to carry a census trace id (128 bit integer) is that while the docs say: > The label component is an integer which identifies all events belonging to the same sequential trace. 'integer' here does not mean any Erlang integer: seq_trace:set_token(label, 38995684955506843782500595084643303673). ** exception error: bad argument Looking in the seq trace code I found it does a `is_small` check on the integer, resulting in the badarg for integers the size of a census trace id. So finally.. the main point of this email is really just to raise the idea of increasing the size of allowable labels in seq_trace. Otherwise we must keep track of a label -> trace mapping in a central process or ets table. The first issue that solution would have to solve is, what happens when a message goes to another node where that label mapping doesn't exist. I'm interested to hear if this is a possibility, what other blockers might arise from using seq_trace like this, if someone has an alternative idea or if someone just thinks this is a bad idea in general :) -- Tristan Sloughter "I am not a crackpot" - Abe Simpson t@REDACTED From viktor@REDACTED Sat Jan 20 14:32:28 2018 From: viktor@REDACTED (=?UTF-8?Q?Viktor_S=c3=b6derqvist?=) Date: Sat, 20 Jan 2018 14:32:28 +0100 Subject: [erlang-questions] Booleans in bit syntax Message-ID: <5A6344EC.9090703@zuiderkwast.se> Adding a boolean type specifier in the bit syntax would be useful, I think. Then you could write decode_stuff(<>) -> {Flag1, Flag2, Rest}. instead of decode_stuff(<>) -> Flag1 = case F1 of 1 -> true; 0 -> false end, Flag2 = case F2 of 1 -> true; 0 -> false; end, {Flag1, Flag2, Rest}. Many binary protocols contain flags and indicators, typically used as booleans in application logic with 1 for true, 0 for false. The default size would be 1 bit, i.e. Size = 1 and Unit = 1. It would be for constructing binaries as well. It is intuitive and it would be backward compatible. What do you think? Any reason for not adding it? Viktor From g@REDACTED Sat Jan 20 14:37:27 2018 From: g@REDACTED (Guilherme Andrade) Date: Sat, 20 Jan 2018 13:37:27 +0000 Subject: [erlang-questions] Booleans in bit syntax In-Reply-To: <5A6344EC.9090703@zuiderkwast.se> References: <5A6344EC.9090703@zuiderkwast.se> Message-ID: Hi Viktor, I've recently wondered exactly the same. It would be very helpful in doing away with boilerplate helpers for converting single bits into booleans and vice-versa. On 20 January 2018 at 13:32, Viktor S?derqvist wrote: > Adding a boolean type specifier in the bit syntax would be useful, I > think. Then you could write > > decode_stuff(<>) -> > {Flag1, Flag2, Rest}. > > instead of > > decode_stuff(<>) -> > Flag1 = case F1 of 1 -> true; > 0 -> false > end, > Flag2 = case F2 of 1 -> true; > 0 -> false; > end, > {Flag1, Flag2, Rest}. > > Many binary protocols contain flags and indicators, typically used as > booleans in application logic with 1 for true, 0 for false. > > The default size would be 1 bit, i.e. Size = 1 and Unit = 1. It would be > for constructing binaries as well. It is intuitive and it would be > backward compatible. > > What do you think? Any reason for not adding it? > > Viktor > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From kostis@REDACTED Sat Jan 20 15:58:44 2018 From: kostis@REDACTED (Kostis Sagonas) Date: Sat, 20 Jan 2018 15:58:44 +0100 Subject: [erlang-questions] Booleans in bit syntax In-Reply-To: <5A6344EC.9090703@zuiderkwast.se> References: <5A6344EC.9090703@zuiderkwast.se> Message-ID: <5d190fc4-0115-d736-60ae-2cf49e806b59@cs.ntua.gr> On 01/20/2018 02:32 PM, Viktor S?derqvist wrote: > Adding a boolean type specifier in the bit syntax would be useful, I > think. Then you could write > > decode_stuff(<>) -> > {Flag1, Flag2, Rest}. > > instead of > > decode_stuff(<>) -> > Flag1 = case F1 of 1 -> true; > 0 -> false > end, > Flag2 = case F2 of 1 -> true; > 0 -> false; > end, > {Flag1, Flag2, Rest}. > > Many binary protocols contain flags and indicators, typically used as > booleans in application logic with 1 for true, 0 for false. > > The default size would be 1 bit, i.e. Size = 1 and Unit = 1. It would be > for constructing binaries as well. It is intuitive and it would be > backward compatible. > > What do you think? Any reason for not adding it? Yes. The Erlang type language already has a type boolean() which is defined to comprise of the atoms 'true' and 'false'. Suddenly adding some syntactic sugar which transforms 1s to trues and 0s to falses in binaries does not add any significant expressive power to the language; just confusion. By the way, your "instead of" code is just bad programming. The following is shorter and nicer: decode_stuff(<>) -> {bit2bool(F1), bit2bool(F2), Rest}. bit2bool(1) -> true; bit2bool(0) -> false. Kostis From jacob01@REDACTED Sat Jan 20 15:53:29 2018 From: jacob01@REDACTED (Jacob) Date: Sat, 20 Jan 2018 15:53:29 +0100 Subject: [erlang-questions] Booleans in bit syntax In-Reply-To: <5A6344EC.9090703@zuiderkwast.se> References: <5A6344EC.9090703@zuiderkwast.se> Message-ID: <36287b13-cf60-d956-c24b-96aeedcf52f8@gmx.net> On 20.01.2018 14:32, Viktor S?derqvist wrote: > Adding a boolean type specifier in the bit syntax would be useful, I > think. Then you could write > > decode_stuff(<>) -> > {Flag1, Flag2, Rest}. > > instead of > > decode_stuff(<>) -> > Flag1 = case F1 of 1 -> true; > 0 -> false > end, > Flag2 = case F2 of 1 -> true; > 0 -> false; > end, > {Flag1, Flag2, Rest}. What about decode_stuff(<>) -> {F1 =:= 1, F2 =:= 1, Rest} it's even shorter than your proposal and already works (okay, encoding bools is a different thing). > What do you think? Any reason for not adding it? In my opinion, it changes much without really filling a gap. So far, the <<>> expressions/matches only convert numbers to binaries/bitstrings and vice versa. Also, encoding 'true' as 1 and 'false' as 0 is just one possible encoding (even if it is common). I prefer to have explicit conversions, IMO they are much better to maintain than using conversion magic. Jacob From viktor@REDACTED Sun Jan 21 03:14:30 2018 From: viktor@REDACTED (=?UTF-8?Q?Viktor_S=c3=b6derqvist?=) Date: Sun, 21 Jan 2018 03:14:30 +0100 Subject: [erlang-questions] Booleans in bit syntax In-Reply-To: <36287b13-cf60-d956-c24b-96aeedcf52f8@gmx.net> References: <5A6344EC.9090703@zuiderkwast.se> <36287b13-cf60-d956-c24b-96aeedcf52f8@gmx.net> Message-ID: <5A63F786.5010808@zuiderkwast.se> The topic 1=true and 0=false as a convention seems to be controversial. :-) If not adding booleans in bit syntax, then how about adding build-in conversion functions for booleans and bit values? E.g. boolean_to_integer/1. If we can't assume that convention, then how about adding four functions: is_zero/1, is_one/1, true_count/1 and false_count/1 instead? That should get rid of any confusion. Theoretically, of course there are two possible bijective mappings between bit values (0, 1) and boolean values (true, false). It may be radical, but in practice, I believe the convention (1 for true) can be safely assumed to be generally understood by almost everyone in almost every such such mapping situation. Even persons who doesn't have any insight in programming often have an intuition that it is all about ones and zeroes, representing true/false, or electric switch on/off; the bit as the smallest and most basic unit of information in computers. Replies to Jacob and Kostis inline. On 2018-01-20 15:53, Jacob wrote: > In my opinion, it changes much without really filling a gap. So far, the > <<>> expressions/matches only convert numbers to binaries/bitstrings and > vice versa. Bit syntax can also convert between Unicode codepoints, UTF-8, UTF-16 and UTF-32. It can convert endianess for IEEE floats and integers too. Pretty much any convenient conversion for basic types to/from binary. << <> || <> <= <<"Example">> >>. On 2018-01-20 15:58, Kostis Sagonas wrote: > Yes. The Erlang type language already has a type boolean() which is > defined to comprise of the atoms 'true' and 'false'. true and false are not just any atoms. They have special meaning in language constructs for branching, i.e. logic. Arguably the most basic values of all. On 2018-01-20 15:53, Jacob wrote: > What about > > decode_stuff(<>) -> > {F1 =:= 1, F2 =:= 1, Rest} > > it's even shorter than your proposal and already works (okay, encoding > bools is a different thing). You are right, the manual conversion is really just three tokens. The simplest encoding I can think of would be a function call, given you already have such a function in your module. > I prefer to have explicit conversions, IMO they are much better to > maintain than using conversion magic. Doesn't the type specifier in the bit syntax indicate an explicit conversion between binary and the explicitly specified type? On 2018-01-20 15:58, Kostis Sagonas wrote: > Suddenly adding some syntactic sugar which transforms 1s to trues and 0s > to falses in binaries does not add any significant expressive power to > the language; just confusion. Isn't most of the binary syntax just syntactic sugar for conversions? Viktor From markalanj@REDACTED Sun Jan 21 08:48:10 2018 From: markalanj@REDACTED (Mark Jones) Date: Sun, 21 Jan 2018 01:48:10 -0600 Subject: [erlang-questions] Booleans in bit syntax In-Reply-To: <5A63F786.5010808@zuiderkwast.se> References: <5A6344EC.9090703@zuiderkwast.se> <36287b13-cf60-d956-c24b-96aeedcf52f8@gmx.net> <5A63F786.5010808@zuiderkwast.se> Message-ID: I'd just like to point out that the logic is sometimes inverted. Specifically when you're interfacing to certain types of hardware. Cheers, Mark Sent from my PDP-11 On Jan 20, 2018 8:14 PM, "Viktor S?derqvist" wrote: > The topic 1=true and 0=false as a convention seems to be controversial. :-) > > If not adding booleans in bit syntax, then how about adding build-in > conversion functions for booleans and bit values? E.g. > boolean_to_integer/1. > > If we can't assume that convention, then how about adding four > functions: is_zero/1, is_one/1, true_count/1 and false_count/1 instead? > That should get rid of any confusion. > > Theoretically, of course there are two possible bijective mappings > between bit values (0, 1) and boolean values (true, false). > > It may be radical, but in practice, I believe the convention (1 for > true) can be safely assumed to be generally understood by almost > everyone in almost every such such mapping situation. Even persons who > doesn't have any insight in programming often have an intuition that it > is all about ones and zeroes, representing true/false, or electric > switch on/off; the bit as the smallest and most basic unit of > information in computers. > > Replies to Jacob and Kostis inline. > > On 2018-01-20 15:53, Jacob wrote: > > In my opinion, it changes much without really filling a gap. So far, the > > <<>> expressions/matches only convert numbers to binaries/bitstrings and > > vice versa. > > Bit syntax can also convert between Unicode codepoints, UTF-8, UTF-16 > and UTF-32. It can convert endianess for IEEE floats and integers too. > Pretty much any convenient conversion for basic types to/from binary. > > << <> || <> <= <<"Example">> >>. > > On 2018-01-20 15:58, Kostis Sagonas wrote: > > Yes. The Erlang type language already has a type boolean() which is > > defined to comprise of the atoms 'true' and 'false'. > > true and false are not just any atoms. They have special meaning in > language constructs for branching, i.e. logic. Arguably the most basic > values of all. > > On 2018-01-20 15:53, Jacob wrote: > > What about > > > > decode_stuff(<>) -> > > {F1 =:= 1, F2 =:= 1, Rest} > > > > it's even shorter than your proposal and already works (okay, encoding > > bools is a different thing). > > You are right, the manual conversion is really just three tokens. > > The simplest encoding I can think of would be a function call, given you > already have such a function in your module. > > > I prefer to have explicit conversions, IMO they are much better to > > maintain than using conversion magic. > > Doesn't the type specifier in the bit syntax indicate an explicit > conversion between binary and the explicitly specified type? > > On 2018-01-20 15:58, Kostis Sagonas wrote: > > Suddenly adding some syntactic sugar which transforms 1s to trues and 0s > > to falses in binaries does not add any significant expressive power to > > the language; just confusion. > > Isn't most of the binary syntax just syntactic sugar for conversions? > > Viktor > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hobson42@REDACTED Sun Jan 21 12:25:04 2018 From: hobson42@REDACTED (Ian Hobson) Date: Sun, 21 Jan 2018 11:25:04 +0000 Subject: [erlang-questions] Booleans in bit syntax In-Reply-To: <5A6344EC.9090703@zuiderkwast.se> References: <5A6344EC.9090703@zuiderkwast.se> Message-ID: On 20/01/2018 13:32, Viktor S?derqvist wrote: > Many binary protocols contain flags and indicators, typically used as > booleans in application logic with 1 for true, 0 for false. Your description of the convention is loose and incomplete. I fear it risks the wrong decision being made. The convention is better expressed as... 0 and anything that auto-converts to 0 is false. Everything else that can be compared is true. The system returns 0 for false, and 1 for true Examples: Php has 0, 0.0, "", null, and an empty array as all false, while -1, NaN, and resources are all true. In Java Script 0, -0, "", undefined, null, NaN, and false are false. Everything with value is true. C has had 0 for false, while true was often 1 but varied with version and programmer. Since C99 implementation has been standardized and hidden inside stdbool.h. C++ would be the same as C. Python has None, False, zero in any form, '', {}, [] and (), and user defined types with a len() of zero as false. Everything else is True. Also the operations 'and' and 'or' return one of their operands, and not 1 or 0. As for your proposal, I think it adds complication without adding utility. Ian From kuna.prime@REDACTED Sun Jan 21 12:45:42 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Sun, 21 Jan 2018 12:45:42 +0100 Subject: [erlang-questions] mnesia select key range Message-ID: given ordered_set table in mnesia, what is the most efficient way to select objects that fall in the range X < key =< Y ?? thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From iamexile@REDACTED Sun Jan 21 16:01:24 2018 From: iamexile@REDACTED (Eugene Pirogov) Date: Sun, 21 Jan 2018 17:01:24 +0200 Subject: [erlang-questions] crypto:engine_list() returns empty list In-Reply-To: References: Message-ID: Hi Lars, I figured it out. I mistakingly ended up with two different openssl (and libssl1.0.0) in the system: - one that was installed from Ubuntu sources, e.g. https://launchpad.net/ubuntu/+source/openssl/1.0.1f-1ubuntu2.23, - another one was the one I built & installed manually (via make install ). My custom-built & installed openssl command somehow successfully saw custom-built libssl1.0.0, which contained dstu engine. However erlang was unable to see custom-built libssl1.0.0. Instead, it remained to refer to libssl1.0.0 that existed somewhere else in the system. Hence Erlang was unable to load "dstu". I packed my custom-built openssl as a .deb package and properly installed it (overriding/upgrading existing system one). Erlang now sees correct libssl1.0.0 with no problem, and is able to load the engine in question: crypto:engine_load(<<"dstu">>, [], []). {ok,#Ref<0.3776855326.4257087491.172227>} Just as an observation, interestingly, crypto:engine_list() still will not show a list of available engines... until I load at least some engine: # erl Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.2 (abort with ^G) 1> crypto:engine_list(). [] 2> crypto:engine_load(<<"dstu">>, [], []). {ok,#Ref<0.3447474459.3988914180.174416>} 3> crypto:engine_list(). [<<"dynamic">>,<<"dstu">>] 4> It's not an issue, just a question: why won't crypto:engine_list() tell me what engines exist in the system, upfront? On Fri, Jan 19, 2018 at 11:11 AM, Lars Thorsen wrote: > Hi, > > *crypto:engine_list()* returns what engine is loaded for OTP ssl (OTP > just uses crypto lib and not openssl ) and not what is available > > (it loops too get all engines by using ENGINE_get_first() and > ENGINE_get_next() from crypto lib). OTP just uses crypto lib and not > openssl. > > > So after you executed {ok, Engine} = crypto:engine_load(<<"gost">>, [], > []). you should see gost in the list. > > > Interesting with dstu, where is that engine located. Same place as gost ? > > Normally if you just use the id, the engine must be located in the > OpenSSL/LibreSSL installation "engines" directory for crypto lib to find > it. > > See crypto users guide for loading from other directory. > > Perhaps openssl has some other config where to find engines that not > affects cryptolib. > > > BR Lars Thors?n > > OTP Team > > > > ------------------------------ > *From:* erlang-questions-bounces@REDACTED erlang.org> on behalf of Eugene Pirogov > *Sent:* Thursday, January 18, 2018 5:43:05 PM > *To:* erlang-questions@REDACTED > *Subject:* [erlang-questions] crypto:engine_list() returns empty list > > Hi, > > I'm running *crypto:engine_list()*, but it won't list any OpenSSL engines > I have installed. What can be the reason? > > I can see the engine in the system by running the following: > > # openssl engine -t gost > (gost) Reference implementation of GOST engine > [ available ] > > # openssl engine -t dstu > (dstu) Reference implementation of DSTU engine > [ available ] > > > However when running from erl repl, I get this: > > # erl > Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.2 (abort with ^G) > 1> crypto:engine_list(). > [] > > > What's weird is that if I try to forcefully load the engine, it *works > sometimes.* > > - it works with gost engine: > > # erl > Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.2 (abort with ^G) > 1> {ok, Engine} = crypto:engine_load(<<"gost">>, [], []). > {ok,#Ref<0.950608548.1984823298.71941>} > > - it does not work with dstu engine: > > # erl > Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.2 (abort with ^G) > 1> {ok, Engine} = crypto:engine_load(<<"dstu">>, [], []). > ** exception error: no match of right hand side value > {error,bad_engine_id} > > What am I missing? How can I get to load dstu engine > in my > case? > > -- > http://www.gmile.me > -- http://www.gmile.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Sun Jan 21 19:00:17 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 21 Jan 2018 18:00:17 +0000 Subject: [erlang-questions] Booleans in bit syntax In-Reply-To: References: <5A6344EC.9090703@zuiderkwast.se> Message-ID: Most languages with static typing does not permit the mixing of integers and boolean values unless you explicitly convert between them. At leas the languages which are sane do. Whenever you propose a change for syntactic convenience, it is important to think about the dual as well: if we introduce the feature, does it lead to increased error rates due to misunderstanding. Here, a crash is considerably less of a problem than a silent acceptance of some value which the programmer might not have wanted. This is why it is sometimes better to have the conversion be explicit in the program, because the removal of (dual) errors makes up for the extra typing that could be needed in the process. Any bit on a wire is a representation of some underlying state or value. If I were to handle this, I would seek to map this representation into a meaningful internal state. And here I note that a boolean value isn't always what you want because it bears too little meaning. It is often better to invent meaningful atoms and pass those around as it improves the readability of the code. For instance, we could have written gen_tcp:listen/2 and gen_tcp:listen/16 and then supplied a large list of true false values, but it wouldn't work out. Rather, we pass in a list of options which are then parsed and interpreted. Some of those become bits in the underlying protocol, but we hide this from the high-level interface. On Sun, Jan 21, 2018 at 12:25 PM Ian Hobson wrote: > > On 20/01/2018 13:32, Viktor S?derqvist wrote: > > Many binary protocols contain flags and indicators, typically used as > > booleans in application logic with 1 for true, 0 for false. > > Your description of the convention is loose and incomplete. I fear it > risks the wrong decision being made. > > The convention is better expressed as... > 0 and anything that auto-converts to 0 is false. > Everything else that can be compared is true. > The system returns 0 for false, and 1 for true > > Examples: > Php has 0, 0.0, "", null, and an empty array as all false, > while -1, NaN, and resources are all true. > > In Java Script 0, -0, "", undefined, null, NaN, and false are false. > Everything with value is true. > > C has had 0 for false, while true was often 1 but varied with version > and programmer. Since C99 implementation has been standardized and > hidden inside stdbool.h. > > C++ would be the same as C. > > Python has None, False, zero in any form, '', {}, [] and (), and user > defined types with a len() of zero as false. Everything else is True. > Also the operations 'and' and 'or' return one of their operands, and not > 1 or 0. > > As for your proposal, I think it adds complication without adding utility. > > Ian > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kostis@REDACTED Mon Jan 22 01:36:14 2018 From: kostis@REDACTED (Kostis Sagonas) Date: Mon, 22 Jan 2018 01:36:14 +0100 Subject: [erlang-questions] Booleans in bit syntax In-Reply-To: <5A63F786.5010808@zuiderkwast.se> References: <5A6344EC.9090703@zuiderkwast.se> <36287b13-cf60-d956-c24b-96aeedcf52f8@gmx.net> <5A63F786.5010808@zuiderkwast.se> Message-ID: <9ca8f758-de7e-abea-191a-0fa8a1403103@cs.ntua.gr> On 01/21/2018 03:14 AM, Viktor S?derqvist wrote: > > On 2018-01-20 15:58, Kostis Sagonas wrote: >> Suddenly adding some syntactic sugar which transforms 1s to trues and 0s >> to falses in binaries does not add any significant expressive power to >> the language; just confusion. > Isn't most of the binary syntax just syntactic sugar for conversions? No, it's not just syntactic sugar. The binary/bitstring data type is something that cannot be converted to some other Erlang term with the same (space-efficient) underlying representation. Kostis From lars.thorsen@REDACTED Mon Jan 22 07:16:54 2018 From: lars.thorsen@REDACTED (Lars Thorsen) Date: Mon, 22 Jan 2018 06:16:54 +0000 Subject: [erlang-questions] crypto:engine_list() returns empty list In-Reply-To: References: , Message-ID: Hi, fine you got it working. Then for your question: crypto:engine_list() shows which engines are loaded and not which are available to the system. So in your case it shows you dstu which you load and dynamic which the system loads to be able to load other engines dynamically. BR Lars ________________________________ From: Eugene Pirogov Sent: Sunday, January 21, 2018 4:01:24 PM To: Lars Thorsen Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] crypto:engine_list() returns empty list Hi Lars, I figured it out. I mistakingly ended up with two different openssl (and libssl1.0.0) in the system: * one that was installed from Ubuntu sources, e.g. https://launchpad.net/ubuntu/+source/openssl/1.0.1f-1ubuntu2.23, * another one was the one I built & installed manually (via make install). My custom-built & installed openssl command somehow successfully saw custom-built libssl1.0.0, which contained dstu engine. However erlang was unable to see custom-built libssl1.0.0. Instead, it remained to refer to libssl1.0.0 that existed somewhere else in the system. Hence Erlang was unable to load "dstu". I packed my custom-built openssl as a .deb package and properly installed it (overriding/upgrading existing system one). Erlang now sees correct libssl1.0.0 with no problem, and is able to load the engine in question: crypto:engine_load(<<"dstu">>, [], []). {ok,#Ref<0.3776855326.4257087491.172227>} Just as an observation, interestingly, crypto:engine_list() still will not show a list of available engines... until I load at least some engine: # erl Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.2 (abort with ^G) 1> crypto:engine_list(). [] 2> crypto:engine_load(<<"dstu">>, [], []). {ok,#Ref<0.3447474459.3988914180.174416>} 3> crypto:engine_list(). [<<"dynamic">>,<<"dstu">>] 4> It's not an issue, just a question: why won't crypto:engine_list() tell me what engines exist in the system, upfront? On Fri, Jan 19, 2018 at 11:11 AM, Lars Thorsen > wrote: Hi, crypto:engine_list() returns what engine is loaded for OTP ssl (OTP just uses crypto lib and not openssl ) and not what is available (it loops too get all engines by using ENGINE_get_first() and ENGINE_get_next() from crypto lib). OTP just uses crypto lib and not openssl. So after you executed {ok, Engine} = crypto:engine_load(<<"gost">>, [], []). you should see gost in the list. Interesting with dstu, where is that engine located. Same place as gost ? Normally if you just use the id, the engine must be located in the OpenSSL/LibreSSL installation "engines" directory for crypto lib to find it. See crypto users guide for loading from other directory. Perhaps openssl has some other config where to find engines that not affects cryptolib. BR Lars Thors?n OTP Team ________________________________ From: erlang-questions-bounces@REDACTED > on behalf of Eugene Pirogov > Sent: Thursday, January 18, 2018 5:43:05 PM To: erlang-questions@REDACTED Subject: [erlang-questions] crypto:engine_list() returns empty list Hi, I'm running crypto:engine_list(), but it won't list any OpenSSL engines I have installed. What can be the reason? I can see the engine in the system by running the following: # openssl engine -t gost (gost) Reference implementation of GOST engine [ available ] # openssl engine -t dstu (dstu) Reference implementation of DSTU engine [ available ] However when running from erl repl, I get this: # erl Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.2 (abort with ^G) 1> crypto:engine_list(). [] What's weird is that if I try to forcefully load the engine, it works sometimes. * it works with gost engine: # erl Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.2 (abort with ^G) 1> {ok, Engine} = crypto:engine_load(<<"gost">>, [], []). {ok,#Ref<0.950608548.1984823298.71941>} * it does not work with dstu engine: # erl Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.2 (abort with ^G) 1> {ok, Engine} = crypto:engine_load(<<"dstu">>, [], []). ** exception error: no match of right hand side value {error,bad_engine_id} What am I missing? How can I get to load dstu engine in my case? -- http://www.gmile.me -- http://www.gmile.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From kjnilsson@REDACTED Mon Jan 22 10:52:01 2018 From: kjnilsson@REDACTED (Karl Nilsson) Date: Mon, 22 Jan 2018 09:52:01 +0000 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: Thanks Jesper, keeping flow control to the input edge makes perfect sense to me but developing a good feedback mechanism that is both safe and not overly cautious is likely to be quite challenging in non-trivial, potentially distributed domains. I have some thinking to do. :) Any further reading along these lines that anyone knows of would be very welcome. On Fri, 19 Jan 2018 at 21:17 Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > As Lukas already wrote on slack somewhere: > > Imagine you have a 2000'es machine: single core, around 400 mhz if you are > lucky. In that setting, sender punishment can in some situations rectify a > system that is going overboard. We simply let the offending process have > less time on the scheduler in the hope that the overloaded mailbox process > can catch up and do its work. It is not a surefire solution, but it may > avoid some situations in which the system would otherwise topple. > > Fast forward 18 years. Now, the machines are multicore, at least 4 threads > commonly. Here, a sender might live on one core whereas the reciever might > live on another process. It is less clear why the punishment strategy is > good: we get to stop the sender, but there were already a scheduler for the > other core and it is still overloaded. Worse, perhaps all the other cores > are able to send messages through to the overloaded process. > > As for the flow control: Erlang systems already employ flow control, > namely TCP flow control between distributed nodes. I've seen two recent > problems pertaining to having flow control inside flow control: gRPC has 3 > layers: gRPC itself, HTTP/2 and TCP. And HTTP/2 has a layer on top of TCP. > This is dangerous as the flow control of the underlying system can > interfere with the flow control of the system above. > > By extension, any Erlang-mechanism of flow control needs to protect > against a scenario where your application has its own layer and make sure > it doesn't interfere. > > Personally, I think Ulf Wiger's "Jobs" model paved the way[0]: Apply flow > control on input edge of the system, but don't apply it internally. If you > do this correct, then a system shouldn't overload because of the > border-limit. If you apply internal flow control, you also expose yourself > to the danger of an artificial internal bottleneck. Rather, sample > internally and use this as a feedback mechanism for the input edge. > > Also note distributed flow control is a considerably harder problem to > solve, and since Erlang is distributed by default, any general solution has > to address this as well. > > [0] https://github.com/uwiger/jobs/blob/master/doc/erlang07g-wiger.pdf > > On Fri, Jan 19, 2018 at 9:51 AM Karl Nilsson wrote: > >> So I saw that the sender punishment was removed in [1]. The commit >> message doesn't outline any of the reasoning behind this. Is there any more >> details available about this anywhere I can read? I understand it never >> really worked that well but it would still be interesting to understand a >> bit further. >> >> On a similar note what is the current thinking on flow control between >> erlang processes? Are there any improvements on mixing in a few calls in >> with the casts? >> >> [1] >> https://github.com/erlang/otp/commit/2e601a2efc19d64ed0628a5973596e6331ddcc7c >> > _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From iamexile@REDACTED Mon Jan 22 12:37:35 2018 From: iamexile@REDACTED (Eugene Pirogov) Date: Mon, 22 Jan 2018 13:37:35 +0200 Subject: [erlang-questions] crypto:engine_list() returns empty list In-Reply-To: References: Message-ID: Hi Lars, crypto:engine_list() shows which engines are loaded and not which are > available to the system. I just realized you already said it twice, and wasn't paying enough attention. Noted, thank your for clarification! On Mon, Jan 22, 2018 at 8:16 AM, Lars Thorsen wrote: > Hi, > > fine you got it working. > > > Then for your question: > > crypto:engine_list() shows which engines are loaded and not which are > available to the system. > > So in your case it shows you dstu which you load and dynamic which the > system loads to be able to load other engines dynamically. > > > BR Lars > ------------------------------ > *From:* Eugene Pirogov > *Sent:* Sunday, January 21, 2018 4:01:24 PM > *To:* Lars Thorsen > *Cc:* erlang-questions@REDACTED > *Subject:* Re: [erlang-questions] crypto:engine_list() returns empty list > > Hi Lars, > > I figured it out. > > I mistakingly ended up with two different openssl (and libssl1.0.0) in the > system: > > - one that was installed from Ubuntu sources, e.g. > https://launchpad.net/ubuntu/+source/openssl/1.0.1f-1ubuntu2.23 > , > - another one was the one I built & installed manually (via make > install). > > My custom-built & installed openssl command somehow successfully saw > custom-built libssl1.0.0, which contained dstu engine. However erlang was > unable to see custom-built libssl1.0.0. Instead, it remained to refer to > libssl1.0.0 that existed somewhere else in the system. Hence Erlang was > unable to load "dstu". > > I packed my custom-built openssl as a .deb package and properly installed > it (overriding/upgrading existing system one). Erlang now sees correct > libssl1.0.0 with no problem, and is able to load the engine in question: > > crypto:engine_load(<<"dstu">>, [], []). > {ok,#Ref<0.3776855326.4257087491 <(425)%20708-7491>.172227>} > > Just as an observation, interestingly, crypto:engine_list() still will > not show a list of available engines... until I load at least some engine: > > > # erl > Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.2 (abort with ^G) > 1> crypto:engine_list(). > [] > 2> crypto:engine_load(<<"dstu">>, [], []). > {ok,#Ref<0.3447474459.3988914180.174416>} > 3> crypto:engine_list(). > [<<"dynamic">>,<<"dstu">>] > 4> > > It's not an issue, just a question: why won't crypto:engine_list() tell > me what engines exist in the system, upfront? > > On Fri, Jan 19, 2018 at 11:11 AM, Lars Thorsen > wrote: > > Hi, > > *crypto:engine_list()* returns what engine is loaded for OTP ssl (OTP > just uses crypto lib and not openssl ) and not what is available > > (it loops too get all engines by using ENGINE_get_first() and > ENGINE_get_next() from crypto lib). OTP just uses crypto lib and not > openssl. > > > So after you executed {ok, Engine} = crypto:engine_load(<<"gost">>, [], > []). you should see gost in the list. > > > Interesting with dstu, where is that engine located. Same place as gost ? > > Normally if you just use the id, the engine must be located in the > OpenSSL/LibreSSL installation "engines" directory for crypto lib to find > it. > > See crypto users guide for loading from other directory. > > Perhaps openssl has some other config where to find engines that not > affects cryptolib. > > > BR Lars Thors?n > > OTP Team > > > > ------------------------------ > *From:* erlang-questions-bounces@REDACTED ng.org> on behalf of Eugene Pirogov > *Sent:* Thursday, January 18, 2018 5:43:05 PM > *To:* erlang-questions@REDACTED > *Subject:* [erlang-questions] crypto:engine_list() returns empty list > > Hi, > > I'm running *crypto:engine_list()*, but it won't list any OpenSSL engines > I have installed. What can be the reason? > > I can see the engine in the system by running the following: > > # openssl engine -t gost > (gost) Reference implementation of GOST engine > [ available ] > > # openssl engine -t dstu > (dstu) Reference implementation of DSTU engine > [ available ] > > > However when running from erl repl, I get this: > > # erl > Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.2 (abort with ^G) > 1> crypto:engine_list(). > [] > > > What's weird is that if I try to forcefully load the engine, it *works > sometimes.* > > - it works with gost engine: > > # erl > Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.2 (abort with ^G) > 1> {ok, Engine} = crypto:engine_load(<<"gost">>, [], []). > {ok,#Ref<0.950608548.1984823298.71941>} > > - it does not work with dstu engine: > > # erl > Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.2 (abort with ^G) > 1> {ok, Engine} = crypto:engine_load(<<"dstu">>, [], []). > ** exception error: no match of right hand side value > {error,bad_engine_id} > > What am I missing? How can I get to load dstu engine > in my > case? > > -- > http://www.gmile.me > > > > > -- > http://www.gmile.me > -- http://www.gmile.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Mon Jan 22 15:25:05 2018 From: mononcqc@REDACTED (Fred Hebert) Date: Mon, 22 Jan 2018 09:25:05 -0500 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: I have written Handling Overload (https://ferd.ca/handling-overload.html) as tour of the multiple options in Erlang. It may prove helpful. On Mon, Jan 22, 2018 at 4:52 AM, Karl Nilsson wrote: > Thanks Jesper, keeping flow control to the input edge makes perfect sense > to me but developing a good feedback mechanism that is both safe and not > overly cautious is likely to be quite challenging in non-trivial, > potentially distributed domains. > > I have some thinking to do. :) Any further reading along these lines that > anyone knows of would be very welcome. > > On Fri, 19 Jan 2018 at 21:17 Jesper Louis Andersen < > jesper.louis.andersen@REDACTED> wrote: > >> As Lukas already wrote on slack somewhere: >> >> Imagine you have a 2000'es machine: single core, around 400 mhz if you >> are lucky. In that setting, sender punishment can in some situations >> rectify a system that is going overboard. We simply let the offending >> process have less time on the scheduler in the hope that the overloaded >> mailbox process can catch up and do its work. It is not a surefire >> solution, but it may avoid some situations in which the system would >> otherwise topple. >> >> Fast forward 18 years. Now, the machines are multicore, at least 4 >> threads commonly. Here, a sender might live on one core whereas the >> reciever might live on another process. It is less clear why the punishment >> strategy is good: we get to stop the sender, but there were already a >> scheduler for the other core and it is still overloaded. Worse, perhaps all >> the other cores are able to send messages through to the overloaded process. >> >> As for the flow control: Erlang systems already employ flow control, >> namely TCP flow control between distributed nodes. I've seen two recent >> problems pertaining to having flow control inside flow control: gRPC has 3 >> layers: gRPC itself, HTTP/2 and TCP. And HTTP/2 has a layer on top of TCP. >> This is dangerous as the flow control of the underlying system can >> interfere with the flow control of the system above. >> >> By extension, any Erlang-mechanism of flow control needs to protect >> against a scenario where your application has its own layer and make sure >> it doesn't interfere. >> >> Personally, I think Ulf Wiger's "Jobs" model paved the way[0]: Apply flow >> control on input edge of the system, but don't apply it internally. If you >> do this correct, then a system shouldn't overload because of the >> border-limit. If you apply internal flow control, you also expose yourself >> to the danger of an artificial internal bottleneck. Rather, sample >> internally and use this as a feedback mechanism for the input edge. >> >> Also note distributed flow control is a considerably harder problem to >> solve, and since Erlang is distributed by default, any general solution has >> to address this as well. >> >> [0] https://github.com/uwiger/jobs/blob/master/doc/erlang07g-wiger.pdf >> >> On Fri, Jan 19, 2018 at 9:51 AM Karl Nilsson wrote: >> >>> So I saw that the sender punishment was removed in [1]. The commit >>> message doesn't outline any of the reasoning behind this. Is there any more >>> details available about this anywhere I can read? I understand it never >>> really worked that well but it would still be interesting to understand a >>> bit further. >>> >>> On a similar note what is the current thinking on flow control between >>> erlang processes? Are there any improvements on mixing in a few calls in >>> with the casts? >>> >>> [1] https://github.com/erlang/otp/commit/2e601a2efc19d64ed0628a5973596e >>> 6331ddcc7c >>> >> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From san.gillis@REDACTED Mon Jan 22 16:28:58 2018 From: san.gillis@REDACTED (San Gillis) Date: Mon, 22 Jan 2018 16:28:58 +0100 Subject: [erlang-questions] SSL hostname verification Message-ID: Since upgrading to Erlang 20.2 (from 19.3) we've been having issues with using SSL for Erlang distribution. We used to run our nodes with ``` -ssl_dist_opt server_verify verify_peer -ssl_dist_opt client_verify verify_peer ``` in the vm.args file. Since the upgrade this failed with {bad_cert, hostname_check_failed}. I noticed that this hostname check fails because `fun public_key:verify_hostname_match_default/2` is receiving `{dns_id, " nodename@REDACTED"}` and `{dNSName,"*.hostname.com"}` as arguments, which will fail to check. I have looked into providing `verify_fun` to do custom verification, but this seems pretty convoluted if I just want to `erl -remsh nodename@REDACTED -ssl_dist_optfile ...` into the given node. Did anyone else run into this issue? Are there some better ways to fix this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Mon Jan 22 16:34:42 2018 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 22 Jan 2018 17:34:42 +0200 Subject: [erlang-questions] SSL hostname verification In-Reply-To: References: Message-ID: <615B8B25-28CC-42BA-BB86-FF12887691E9@gmail.com> Hello, I had a similar problem with plain TLS socket after 19.x to 20.x migration. This is due to SNI feature. I?ve disabled it using following ssl socket option: {server_name_indication, disable} I think same applies for dist sockets as well. Best Regards, Dmitry > On 22 Jan 2018, at 17.28, San Gillis wrote: > > Since upgrading to Erlang 20.2 (from 19.3) we've been having issues with using SSL for Erlang distribution. > > We used to run our nodes with > ``` > -ssl_dist_opt server_verify verify_peer > -ssl_dist_opt client_verify verify_peer > ``` > in the vm.args file. Since the upgrade this failed with {bad_cert, hostname_check_failed}. > > I noticed that this hostname check fails because `fun public_key:verify_hostname_match_default/2` is receiving `{dns_id, "nodename@REDACTED "}` and `{dNSName,"*.hostname.com "}` as arguments, which will fail to check. > > I have looked into providing `verify_fun` to do custom verification, but this seems pretty convoluted if I just want to `erl -remsh nodename@REDACTED -ssl_dist_optfile ...` into the given node. > > Did anyone else run into this issue? Are there some better ways to fix this? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Mon Jan 22 16:41:46 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 22 Jan 2018 15:41:46 +0000 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: To be more concrete: Amazon might have a fancy ALB load balancer. Amazon might also use HTTP/2 in that fancy ALB load balancer. HTTP/2 has a flow control system because you are muxing several streams into one TCP connection. Also note that TCP has a send window. Amazon might have defaulted their HTTP/2 Window frames to 16kilobyte in the upload direction. If you do the tcp plots, this leads to a fun situation where the packets are flapping between MSS and ack-only packets, and your speed is limited by the RTT of the line. People running gRPC knows that "using the Amazon layer 4 load balancer works", but they have yet to analyze the problem further. They know it "doesn't work with HTTP/2". gRPC has its own flow control (!!) on top of HTTP/2, because "gRPC has to be transport agnostic in case you want to use UDP". The end result is that you are not running at maximal utilization of the underlying TCP connection. ... Another thing to think about: If you employ flow control, you have to think about the "lock" situation in which the flow control locks up the system. If the sender can be flow controlled, the problem is twofold at sender and at receiver side. This interaction is somewhat complex, compared to interaction in one side only. Corollary: Go, with bounded channels, have way more points where quasi-deadlock can occur than an Erlang program. But the Erlang program can overflow its mailbox in contrast. On Mon, Jan 22, 2018 at 3:25 PM Fred Hebert wrote: > I have written Handling Overload (https://ferd.ca/handling-overload.html) > as tour of the multiple options in Erlang. It may prove helpful. > > On Mon, Jan 22, 2018 at 4:52 AM, Karl Nilsson wrote: > >> Thanks Jesper, keeping flow control to the input edge makes perfect sense >> to me but developing a good feedback mechanism that is both safe and not >> overly cautious is likely to be quite challenging in non-trivial, >> potentially distributed domains. >> >> I have some thinking to do. :) Any further reading along these lines that >> anyone knows of would be very welcome. >> >> On Fri, 19 Jan 2018 at 21:17 Jesper Louis Andersen < >> jesper.louis.andersen@REDACTED> wrote: >> >>> As Lukas already wrote on slack somewhere: >>> >>> Imagine you have a 2000'es machine: single core, around 400 mhz if you >>> are lucky. In that setting, sender punishment can in some situations >>> rectify a system that is going overboard. We simply let the offending >>> process have less time on the scheduler in the hope that the overloaded >>> mailbox process can catch up and do its work. It is not a surefire >>> solution, but it may avoid some situations in which the system would >>> otherwise topple. >>> >>> Fast forward 18 years. Now, the machines are multicore, at least 4 >>> threads commonly. Here, a sender might live on one core whereas the >>> reciever might live on another process. It is less clear why the punishment >>> strategy is good: we get to stop the sender, but there were already a >>> scheduler for the other core and it is still overloaded. Worse, perhaps all >>> the other cores are able to send messages through to the overloaded process. >>> >>> As for the flow control: Erlang systems already employ flow control, >>> namely TCP flow control between distributed nodes. I've seen two recent >>> problems pertaining to having flow control inside flow control: gRPC has 3 >>> layers: gRPC itself, HTTP/2 and TCP. And HTTP/2 has a layer on top of TCP. >>> This is dangerous as the flow control of the underlying system can >>> interfere with the flow control of the system above. >>> >>> By extension, any Erlang-mechanism of flow control needs to protect >>> against a scenario where your application has its own layer and make sure >>> it doesn't interfere. >>> >>> Personally, I think Ulf Wiger's "Jobs" model paved the way[0]: Apply >>> flow control on input edge of the system, but don't apply it internally. If >>> you do this correct, then a system shouldn't overload because of the >>> border-limit. If you apply internal flow control, you also expose yourself >>> to the danger of an artificial internal bottleneck. Rather, sample >>> internally and use this as a feedback mechanism for the input edge. >>> >>> Also note distributed flow control is a considerably harder problem to >>> solve, and since Erlang is distributed by default, any general solution has >>> to address this as well. >>> >>> [0] https://github.com/uwiger/jobs/blob/master/doc/erlang07g-wiger.pdf >>> >>> On Fri, Jan 19, 2018 at 9:51 AM Karl Nilsson >>> wrote: >>> >>>> So I saw that the sender punishment was removed in [1]. The commit >>>> message doesn't outline any of the reasoning behind this. Is there any more >>>> details available about this anywhere I can read? I understand it never >>>> really worked that well but it would still be interesting to understand a >>>> bit further. >>>> >>>> On a similar note what is the current thinking on flow control between >>>> erlang processes? Are there any improvements on mixing in a few calls in >>>> with the casts? >>>> >>>> [1] >>>> https://github.com/erlang/otp/commit/2e601a2efc19d64ed0628a5973596e6331ddcc7c >>>> >>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From san.gillis@REDACTED Mon Jan 22 16:55:14 2018 From: san.gillis@REDACTED (San Gillis) Date: Mon, 22 Jan 2018 16:55:14 +0100 Subject: [erlang-questions] SSL hostname verification In-Reply-To: <615B8B25-28CC-42BA-BB86-FF12887691E9@gmail.com> References: <615B8B25-28CC-42BA-BB86-FF12887691E9@gmail.com> Message-ID: I tried adding {server_name_indication, disable} to my ssl_dist_optfile. (So it is `[{server, ...}, {client, [..., {server_name_indication, disable}]}]`, is that correct?). This doesn't change the error I get. Also, if I understand the documentation correctly, this disables all hostname checking. Would this leave us vulnerable to MITM attacks? 2018-01-22 16:34 GMT+01:00 Dmitry Kolesnikov : > Hello, > > I had a similar problem with plain TLS socket after 19.x to 20.x > migration. This is due to SNI feature. I?ve disabled it using following ssl > socket option: {server_name_indication, disable} > > I think same applies for dist sockets as well. > > Best Regards, > Dmitry > > On 22 Jan 2018, at 17.28, San Gillis wrote: > > Since upgrading to Erlang 20.2 (from 19.3) we've been having issues with > using SSL for Erlang distribution. > > We used to run our nodes with > ``` > -ssl_dist_opt server_verify verify_peer > -ssl_dist_opt client_verify verify_peer > ``` > in the vm.args file. Since the upgrade this failed with {bad_cert, > hostname_check_failed}. > > I noticed that this hostname check fails because `fun > public_key:verify_hostname_match_default/2` is receiving `{dns_id, " > nodename@REDACTED"}` and `{dNSName,"*.hostname.com"}` as > arguments, which will fail to check. > > I have looked into providing `verify_fun` to do custom verification, but > this seems pretty convoluted if I just want to `erl -remsh > nodename@REDACTED -ssl_dist_optfile ...` into the given > node. > > Did anyone else run into this issue? Are there some better ways to fix > this? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierrefenoll@REDACTED Mon Jan 22 20:03:56 2018 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Mon, 22 Jan 2018 20:03:56 +0100 Subject: [erlang-questions] Booleans in bit syntax In-Reply-To: <9ca8f758-de7e-abea-191a-0fa8a1403103@cs.ntua.gr> References: <5A6344EC.9090703@zuiderkwast.se> <36287b13-cf60-d956-c24b-96aeedcf52f8@gmx.net> <5A63F786.5010808@zuiderkwast.se> <9ca8f758-de7e-abea-191a-0fa8a1403103@cs.ntua.gr> Message-ID: > I'd just like to point out that the logic is sometimes inverted. Specifically when you're interfacing to certain types of hardware. How about introducing both /bool0 and /bool1 Cheers, -- Pierre Fenoll On 22 January 2018 at 01:36, Kostis Sagonas wrote: > On 01/21/2018 03:14 AM, Viktor S?derqvist wrote: > >> >> On 2018-01-20 15:58, Kostis Sagonas wrote: >> >>> Suddenly adding some syntactic sugar which transforms 1s to trues and 0s >>> to falses in binaries does not add any significant expressive power to >>> the language; just confusion. >>> >> Isn't most of the binary syntax just syntactic sugar for conversions? >> > > No, it's not just syntactic sugar. The binary/bitstring data type is > something that cannot be converted to some other Erlang term with the same > (space-efficient) underlying representation. > > Kostis > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Mon Jan 22 21:29:00 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 22 Jan 2018 21:29:00 +0100 Subject: [erlang-questions] SSL hostname verification In-Reply-To: References: <615B8B25-28CC-42BA-BB86-FF12887691E9@gmail.com> Message-ID: Hi! 2018-01-22 16:55 GMT+01:00 San Gillis : > I tried adding {server_name_indication, disable} to my ssl_dist_optfile. > (So it is `[{server, ...}, {client, [..., {server_name_indication, > disable}]}]`, is that correct?). This doesn't change the error I get. > > Looks right .... it is a pretty new feature so we will look into if it is tested well enough or if you just missed some little detail! > Also, if I understand the documentation correctly, this disables all > hostname checking. Would this leave us vulnerable to MITM attacks? > Yes it disables all hostname checks making you vulnerable to the things they where designed to protect. The way to customize the checks is to handle them in your own verify_fun, why do you think that is convulted? The verify_fun can be very simple only specifically handling the {bad_cert, hostname_check_failed} then all other checks will behave as before. The verify_fun is not meant to replace the default certiface checks it is for extending the checks and possible ignoring some specific error (even though this is seldom desirable). Something like: {fun(_,{bad_cert, hostname_check_failed}, _) -> %%% Preform own check ... (_,{extension, _}, UserState) -> {unknown, UserState}; (_, valid, UserState) -> {valid, UserState}; (_, valid_peer, UserState) -> {valid, UserState} end, []} Initial UserStae is [] Regards Ingela Erlang/OTP team - Ericsson AB > 2018-01-22 16:34 GMT+01:00 Dmitry Kolesnikov : > >> Hello, >> >> I had a similar problem with plain TLS socket after 19.x to 20.x >> migration. This is due to SNI feature. I?ve disabled it using following ssl >> socket option: {server_name_indication, disable} >> >> I think same applies for dist sockets as well. >> >> Best Regards, >> Dmitry >> >> On 22 Jan 2018, at 17.28, San Gillis wrote: >> >> Since upgrading to Erlang 20.2 (from 19.3) we've been having issues with >> using SSL for Erlang distribution. >> >> We used to run our nodes with >> ``` >> -ssl_dist_opt server_verify verify_peer >> -ssl_dist_opt client_verify verify_peer >> ``` >> in the vm.args file. Since the upgrade this failed with {bad_cert, >> hostname_check_failed}. >> >> I noticed that this hostname check fails because `fun >> public_key:verify_hostname_match_default/2` is receiving `{dns_id, " >> nodename@REDACTED"}` and `{dNSName,"*.hostname.com"}` as >> arguments, which will fail to check. >> >> I have looked into providing `verify_fun` to do custom verification, but >> this seems pretty convoluted if I just want to `erl -remsh >> nodename@REDACTED -ssl_dist_optfile ...` into the given >> node. >> >> Did anyone else run into this issue? Are there some better ways to fix >> this? >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Mon Jan 22 21:45:36 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 22 Jan 2018 21:45:36 +0100 Subject: [erlang-questions] SSL hostname verification In-Reply-To: References: <615B8B25-28CC-42BA-BB86-FF12887691E9@gmail.com> Message-ID: Hoops did not mean du remove the default fail on cert error clause .... {fun(_,{bad_cert, hostname_check_failed}, _) -> %%% Preform own check ... (_,{bad_cert, _} = Reason, _) -> {fail, Reason}; (_,{extension, _}, UserState) -> {unknown, UserState}; (_, valid, UserState) -> {valid, UserState}; (_, valid_peer, UserState) -> {valid, UserState} end, []} Regards Ingela 2018-01-22 21:29 GMT+01:00 Ingela Andin : > > Hi! > > 2018-01-22 16:55 GMT+01:00 San Gillis : > >> I tried adding {server_name_indication, disable} to my ssl_dist_optfile. >> (So it is `[{server, ...}, {client, [..., {server_name_indication, >> disable}]}]`, is that correct?). This doesn't change the error I get. >> >> > Looks right .... it is a pretty new feature so we will look into if it is > tested well enough or if you just missed some little detail! > > >> Also, if I understand the documentation correctly, this disables all >> hostname checking. Would this leave us vulnerable to MITM attacks? >> > > > Yes it disables all hostname checks making you vulnerable to the things > they where designed to protect. The way to customize the checks is to > handle them in your own verify_fun, why do you think that is convulted? > The verify_fun can be very simple only specifically handling the {bad_cert, > hostname_check_failed} then all other checks will behave as before. The > verify_fun is not meant to replace the default certiface checks it > is for extending the checks and possible ignoring some specific error > (even though this is seldom desirable). > > Something like: > > {fun(_,{bad_cert, hostname_check_failed}, _) -> > %%% Preform own check ... > (_,{extension, _}, UserState) -> > {unknown, UserState}; > (_, valid, UserState) -> > {valid, UserState}; > (_, valid_peer, UserState) -> > {valid, UserState} > end, []} > > > Initial UserStae is [] > > Regards Ingela Erlang/OTP team - Ericsson AB > > >> 2018-01-22 16:34 GMT+01:00 Dmitry Kolesnikov : >> >>> Hello, >>> >>> I had a similar problem with plain TLS socket after 19.x to 20.x >>> migration. This is due to SNI feature. I?ve disabled it using following ssl >>> socket option: {server_name_indication, disable} >>> >>> I think same applies for dist sockets as well. >>> >>> Best Regards, >>> Dmitry >>> >>> On 22 Jan 2018, at 17.28, San Gillis wrote: >>> >>> Since upgrading to Erlang 20.2 (from 19.3) we've been having issues with >>> using SSL for Erlang distribution. >>> >>> We used to run our nodes with >>> ``` >>> -ssl_dist_opt server_verify verify_peer >>> -ssl_dist_opt client_verify verify_peer >>> ``` >>> in the vm.args file. Since the upgrade this failed with {bad_cert, >>> hostname_check_failed}. >>> >>> I noticed that this hostname check fails because `fun >>> public_key:verify_hostname_match_default/2` is receiving `{dns_id, " >>> nodename@REDACTED"}` and `{dNSName,"*.hostname.com"}` as >>> arguments, which will fail to check. >>> >>> I have looked into providing `verify_fun` to do custom verification, but >>> this seems pretty convoluted if I just want to `erl -remsh >>> nodename@REDACTED -ssl_dist_optfile ...` into the given >>> node. >>> >>> Did anyone else run into this issue? Are there some better ways to fix >>> this? >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >>> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.platt@REDACTED Tue Jan 23 08:55:23 2018 From: pablo.platt@REDACTED (pablo platt) Date: Tue, 23 Jan 2018 09:55:23 +0200 Subject: [erlang-questions] erlang-solutions Ubuntu repository Message-ID: Hi, The erlang-solutions Ubuntu repository is missing package 20.2. Is there a chance to add it? https://www.erlang-solutions.com/resources/download.html The erlang-solutions_1.0_all.deb package is adding http://binaries.erlang-solutions.com/debian entry to apt sources while the manual instructions use a different url https://packages.erlang-solutions.com/ubuntu. I think both should use the same url with ubuntu instead of debian. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Tue Jan 23 11:30:19 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 23 Jan 2018 13:30:19 +0300 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: It is a pity, but this advice is not enough: > Just use synchronous OTP calls in gen_* behaviours for all desirable interactions If you have a HTTP API that sends gen_server:call to some process, then you can get into a storm situation: 1) client comes to HTTP 2) http handler makes gen_server:call to singleton server 3) waits for 5 or 60 seconds and then exits, but message is already in process queue 4) server fetches this useless message from mailbox and starts making useless expensive operations 5) meanwhile client makes another duplicate request and again fills singleton mailbox with the same request It is a dangereous situation and sometimes it is required to look at gen_server message_queue_len before calling it, but if you do it on a multicore machine, you get into lock contention and you will see low CPU and low RPS with high locks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fchschneider@REDACTED Tue Jan 23 11:39:52 2018 From: fchschneider@REDACTED (Frans Schneider) Date: Tue, 23 Jan 2018 11:39:52 +0100 Subject: [erlang-questions] xmerl scan file and validate using schema Message-ID: <25429108-b186-7842-9d8c-d2d954e52a4e@gmail.com> Dear list, I would like to use validation while reading XML files using xmerl_scan:file/2 or even better, using xmerl_xsd:validate/2 with a previously processed schema. In both cases, I get the error {fetch_fun_failed,{http,"http://www.w3.org/2001/xml.xsd"}}. However, the documentation gives no details on what the fetch function should look like and looking through the sources did not help much. I also made a local copy of the imported xml.xsd file and tried several options without luck. My question is if somebody knows about an easy way to get this working? The xsd's head is listed below. NB: I know about Erlsom, which does work well but lacks line numbers in the output which I need for reporting errors in the XML file. Thanks, Frans From san.gillis@REDACTED Tue Jan 23 12:13:37 2018 From: san.gillis@REDACTED (San Gillis) Date: Tue, 23 Jan 2018 12:13:37 +0100 Subject: [erlang-questions] SSL hostname verification In-Reply-To: References: <615B8B25-28CC-42BA-BB86-FF12887691E9@gmail.com> Message-ID: Hi! First of all, thank you Dmitry and Ingela for the quick replies. Yes it disables all hostname checks making you vulnerable to the things > they where designed to protect. > Thought so, so I would prefer not to use the disable option. > The way to customize the checks is to handle them in your own verify_fun, > why do you think that is convulted? > It just seemed weird to me to write erlang functions inside a configuration file. But then again, I didn't understand it could be just a short function, which makes it a lot more acceptable. > The verify_fun can be very simple only specifically handling the {bad_cert, > hostname_check_failed} then all other checks will behave as before. The > verify_fun is not meant to replace the default certiface checks it > is for extending the checks and possible ignoring some specific error > (even though this is seldom desirable). > > Something like: > > {fun(_,{bad_cert, hostname_check_failed}, _) -> > %%% Preform own check ... > (_,{extension, _}, UserState) -> > {unknown, UserState}; > (_, valid, UserState) -> > {valid, UserState}; > (_, valid_peer, UserState) -> > {valid, UserState} > end, []} > > I tried this, but the weird thing is that when I explicitly set verify_fun to what is described as the default in the documentation: {fun(_,{bad_cert, _} = Reason, _) -> {fail, Reason}; (_,{extension, _}, UserState) -> {unknown, UserState}; (_, valid, UserState) -> {valid, UserState}; (_, valid_peer, UserState) -> {valid, UserState} end, []} I do not get the hostname_check_failed error anymore. I did not expect this. I believe `ssl_certificate:verify_hostname` is called when I do not explicitly provide verify_fun, because I added some debug statements that got executed. When I do provide the verify_fun as above the debug statements no longer get executed. But I couldn't find any other occurrences of hostname_check_failed in my copy of the `lib` dir of erlang 20.2. -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Tue Jan 23 12:35:01 2018 From: g@REDACTED (Guilherme Andrade) Date: Tue, 23 Jan 2018 11:35:01 +0000 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: On 23 January 2018 at 10:30, Max Lapshin wrote: > 1) client comes to HTTP > 2) http handler makes gen_server:call to singleton server > 3) waits for 5 or 60 seconds and then exits, but message is already in > process queue > 4) server fetches this useless message from mailbox and starts making > useless expensive operations > 5) meanwhile client makes another duplicate request and again fills > singleton mailbox with the same request > I've recently started to explore sbroker[1] as an alternative (in some cases) and I've been getting very interesting results. Then again it's also (IIRC) backed by single processes that might become a bottleneck themselves, but at least those processes aren't doing anything else. Also, because it's this big toolkit with a lot of bells and whistles, it's easy to shoot yourself in the foot if you're not already acquainted with some of the abstractions, and so there might be somewhat of a learning curve. [1]: https://github.com/fishcakez/sbroker -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tobias.Schlager@REDACTED Tue Jan 23 12:43:23 2018 From: Tobias.Schlager@REDACTED (Tobias Schlager) Date: Tue, 23 Jan 2018 11:43:23 +0000 Subject: [erlang-questions] xmerl scan file and validate using schema In-Reply-To: <25429108-b186-7842-9d8c-d2d954e52a4e@gmail.com> References: <25429108-b186-7842-9d8c-d2d954e52a4e@gmail.com> Message-ID: <12F2115FD1CCEE4294943B2608A18FA301C2A12F55@MAIL01.win.lbaum.eu> Hi Frans, I've been using xmerl successfully a long time ago. The fetch_fun needs to provide the path to a local file. From what I can remember, I shipped all XSD files along with my application in its priv directory, to be able to validate without downloading the respective XSD every time. However, you could download them on-the-fly. You could use something similar to the following as a start (code will crash if XSD cannot be found): fetch_xsd(URL = "http://" ++ _, State = #xsd_state{}) -> FilePath = download(URL), {ok, {file, FilePath}, State}; fetch_xsd(Location, State = #xsd_state{fetch_path = Paths}) -> {ok, get_file(Location, Paths), State}. get_file(File, [Dir | Rest]) -> Path = filename:join([Dir, File]), case filelib:is_file(Path) of true -> {file, Path}; false -> get_file(File, Rest) end. My options looked like this: [{fetch_fun, fun fetch_xsd/2}, {fetch_path, [PrivDir]}] Regards Tobias ________________________________________ Von: erlang-questions-bounces@REDACTED [erlang-questions-bounces@REDACTED]" im Auftrag von "Frans Schneider [fchschneider@REDACTED] Gesendet: Dienstag, 23. Januar 2018 11:39 An: Erlang Questions Betreff: [erlang-questions] xmerl scan file and validate using schema Dear list, I would like to use validation while reading XML files using xmerl_scan:file/2 or even better, using xmerl_xsd:validate/2 with a previously processed schema. In both cases, I get the error {fetch_fun_failed,{http,"http://www.w3.org/2001/xml.xsd"}}. However, the documentation gives no details on what the fetch function should look like and looking through the sources did not help much. I also made a local copy of the imported xml.xsd file and tried several options without luck. My question is if somebody knows about an easy way to get this working? The xsd's head is listed below. NB: I know about Erlsom, which does work well but lacks line numbers in the output which I need for reporting errors in the XML file. Thanks, Frans _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions From jesper.louis.andersen@REDACTED Tue Jan 23 14:05:14 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Tue, 23 Jan 2018 13:05:14 +0000 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: call(Msg) -> gen_server:call({Msg, erlang:monotonic_time()}). receive {Msg, In} -> Out = erlang:monotonic_time(), Sojourn = erlang:convert_time_unit(Out - In, native, milli_seconds), case Sojourn > 5000 of true -> {reply, argh, State} false -> ... end end is usually a better way of tracking calls if you have overflow troubles. Sojourn tracking and head-drop from the FIFO is what CoDel does, and it works wonders on network connections. It can avoid having to process messages in the queue which already fell for a timeout. Better, you can do case (Sojourn + ExpectedProcessingTime) > ?LIMIT of ..., which can avoid doing work which will break the time limit anyway, proactively. On Tue, Jan 23, 2018 at 12:35 PM Guilherme Andrade wrote: > On 23 January 2018 at 10:30, Max Lapshin wrote: > >> 1) client comes to HTTP >> 2) http handler makes gen_server:call to singleton server >> 3) waits for 5 or 60 seconds and then exits, but message is already in >> process queue >> 4) server fetches this useless message from mailbox and starts making >> useless expensive operations >> 5) meanwhile client makes another duplicate request and again fills >> singleton mailbox with the same request >> > > I've recently started to explore sbroker[1] as an alternative (in some > cases) and I've been getting very interesting results. > > Then again it's also (IIRC) backed by single processes that might become a > bottleneck themselves, but at least those processes aren't doing anything > else. Also, because it's this big toolkit with a lot of bells and whistles, > it's easy to shoot yourself in the foot if you're not already acquainted > with some of the abstractions, and so there might be somewhat of a learning > curve. > > [1]: https://github.com/fishcakez/sbroker > > -- > Guilherme > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Tue Jan 23 14:09:42 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Tue, 23 Jan 2018 14:09:42 +0100 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: How about adding this to gen_server directly? Perhaps as a new function? I think this could be done with and without the expected processing time in a fairly generic manner. On 01/23/2018 02:05 PM, Jesper Louis Andersen wrote: > > call(Msg) -> > ??? gen_server:call({Msg, erlang:monotonic_time()}). > > receive > ??? {Msg, In} -> > ????? Out = erlang:monotonic_time(), > ????? Sojourn = erlang:convert_time_unit(Out - In, native, milli_seconds), > ????? case Sojourn > 5000 of > ????????? true -> {reply, argh, State} > ????????? false -> ... > ?????? end > end > > is usually a better way of tracking calls if you have overflow troubles. > Sojourn tracking and head-drop from the FIFO is what CoDel does, and it > works wonders on network connections. It can avoid having to process > messages in the queue which already fell for a timeout. Better, you can > do case (Sojourn + ExpectedProcessingTime) > ?LIMIT of ..., which can > avoid doing work which will break the time limit anyway, proactively. > > > > On Tue, Jan 23, 2018 at 12:35 PM Guilherme Andrade > wrote: > > On 23 January 2018 at 10:30, Max Lapshin > wrote: > > 1) client comes to HTTP > 2) http handler makes gen_server:call to singleton server > 3) waits for 5 or 60 seconds and then exits, but message is > already in process queue > 4) server fetches this useless message from mailbox and starts > making useless expensive operations > 5) meanwhile client makes another duplicate request and again > fills singleton mailbox with the same request > > > I've recently started to explore sbroker[1] as an alternative (in > some cases) and I've been getting very interesting results. > > Then again it's also (IIRC) backed by single processes that might > become a bottleneck themselves, but at least those processes aren't > doing anything else. Also, because it's this big toolkit with a lot > of bells and whistles, it's easy to shoot yourself in the foot if > you're not already acquainted with some of the abstractions, and so > there might be somewhat of a learning curve. > > [1]: https://github.com/fishcakez/sbroker > > -- > Guilherme > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin https://ninenines.eu From jesper.louis.andersen@REDACTED Tue Jan 23 14:13:44 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Tue, 23 Jan 2018 13:13:44 +0000 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: At some point writing the post, I considered recieve Msg:Sojourn -> ... end but this requires an EEP, and then I realized it is better to handle this in the language in an orthogonal fashion. But I like the point of considering such a change on gen_server, indeed. Queue Sojourn is often a far better metric to track on a queue rather than length (because msg processing times differ) or bytes in the queue (because processing time varies). On Tue, Jan 23, 2018 at 2:09 PM Lo?c Hoguin wrote: > How about adding this to gen_server directly? Perhaps as a new function? > I think this could be done with and without the expected processing time > in a fairly generic manner. > > On 01/23/2018 02:05 PM, Jesper Louis Andersen wrote: > > > > call(Msg) -> > > gen_server:call({Msg, erlang:monotonic_time()}). > > > > receive > > {Msg, In} -> > > Out = erlang:monotonic_time(), > > Sojourn = erlang:convert_time_unit(Out - In, native, > milli_seconds), > > case Sojourn > 5000 of > > true -> {reply, argh, State} > > false -> ... > > end > > end > > > > is usually a better way of tracking calls if you have overflow troubles. > > Sojourn tracking and head-drop from the FIFO is what CoDel does, and it > > works wonders on network connections. It can avoid having to process > > messages in the queue which already fell for a timeout. Better, you can > > do case (Sojourn + ExpectedProcessingTime) > ?LIMIT of ..., which can > > avoid doing work which will break the time limit anyway, proactively. > > > > > > > > On Tue, Jan 23, 2018 at 12:35 PM Guilherme Andrade > > wrote: > > > > On 23 January 2018 at 10:30, Max Lapshin > > wrote: > > > > 1) client comes to HTTP > > 2) http handler makes gen_server:call to singleton server > > 3) waits for 5 or 60 seconds and then exits, but message is > > already in process queue > > 4) server fetches this useless message from mailbox and starts > > making useless expensive operations > > 5) meanwhile client makes another duplicate request and again > > fills singleton mailbox with the same request > > > > > > I've recently started to explore sbroker[1] as an alternative (in > > some cases) and I've been getting very interesting results. > > > > Then again it's also (IIRC) backed by single processes that might > > become a bottleneck themselves, but at least those processes aren't > > doing anything else. Also, because it's this big toolkit with a lot > > of bells and whistles, it's easy to shoot yourself in the foot if > > you're not already acquainted with some of the abstractions, and so > > there might be somewhat of a learning curve. > > > > [1]: https://github.com/fishcakez/sbroker > > > > -- > > Guilherme > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > Lo?c Hoguin > https://ninenines.eu > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Tue Jan 23 15:59:35 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 23 Jan 2018 15:59:35 +0100 Subject: [erlang-questions] SSL hostname verification In-Reply-To: References: <615B8B25-28CC-42BA-BB86-FF12887691E9@gmail.com> Message-ID: Hi! Well I forgot you are using distribution over TLS and when specifying the fun via the configuration file you must use fun /3 format for funs. So you need to have a module implementing the function that you want to use as a fun. So -module(my_verify) -export([verify/3]). verify(Cert,{bad_cert, hostname_check_failed} = Reason, UserState) -> case my_hostname_check(Cert, UserState) of {fail, Reason}; verify(_,{bad_cert, _} = Reason, _) -> {fail, Reason}; verify(_,{extension, _}, UserState) -> {unknown, UserState}; verify(_, valid, UserState) -> {valid, UserState}; verify(_, valid_peer, UserState) -> {valid, UserState}. 2018-01-23 12:13 GMT+01:00 San Gillis : > Hi! > > First of all, thank you Dmitry and Ingela for the quick replies. > > Yes it disables all hostname checks making you vulnerable to the things >> they where designed to protect. >> > > Thought so, so I would prefer not to use the disable option. > > >> The way to customize the checks is to handle them in your own verify_fun, >> why do you think that is convulted? >> > > It just seemed weird to me to write erlang functions inside a > configuration file. But then again, I didn't understand it could be just a > short function, which makes it a lot more acceptable. > > >> The verify_fun can be very simple only specifically handling the {bad_cert, >> hostname_check_failed} then all other checks will behave as before. The >> verify_fun is not meant to replace the default certiface checks it >> is for extending the checks and possible ignoring some specific error >> (even though this is seldom desirable). >> >> Something like: >> >> {fun(_,{bad_cert, hostname_check_failed}, _) -> >> %%% Preform own check ... >> (_,{extension, _}, UserState) -> >> {unknown, UserState}; >> (_, valid, UserState) -> >> {valid, UserState}; >> (_, valid_peer, UserState) -> >> {valid, UserState} >> end, []} >> >> > I tried this, but the weird thing is that when I explicitly set verify_fun > to what is described as the default in the documentation: > > {fun(_,{bad_cert, _} = Reason, _) -> > {fail, Reason}; > (_,{extension, _}, UserState) -> > {unknown, UserState}; > (_, valid, UserState) -> > {valid, UserState}; > (_, valid_peer, UserState) -> > {valid, UserState} > end, []} > > I do not get the hostname_check_failed error anymore. I did not expect this. > > I believe `ssl_certificate:verify_hostname` is called when I do not explicitly provide verify_fun, because I added some debug statements that got executed. > > When I do provide the verify_fun as above the debug statements no longer get executed. But I couldn't find any other occurrences of hostname_check_failed in my copy of the `lib` dir of erlang 20.2. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Tue Jan 23 16:10:26 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 23 Jan 2018 16:10:26 +0100 Subject: [erlang-questions] SSL hostname verification In-Reply-To: References: <615B8B25-28CC-42BA-BB86-FF12887691E9@gmail.com> Message-ID: Hi! Just ignore my previous mail. Note to self never edit code in browser-mail-window! ;) Well I forgot you are using distribution over TLS and when specifying the fun via the configuration file you must use fun :/3 format for funs. So you need to have a module implementing the function that you want to use as a fun. Somethin like: -module(my_verify) -export([verify/3]). verify(Cert,{bad_cert, hostname_check_failed} = Reason, UserState) -> case my_hostname_check(Cert, UserState) of true -> {valid, UserState}; false -> {fail, Reason} end; verify(_,{bad_cert, _}, UserState) -> {fail, Reason}; verify(_,{bad_cert, _} = Reason, _) -> {fail, Reason}; verify(_,{extension, _}, UserState) -> {unknown, UserState}; verify(_, valid, UserState) -> {valid, UserState}; verify(_, valid_peer, UserState) -> {valid, UserState}. And option like: {verify_fun, fun my_verify:verify/3, } This is a limitation for distribution over TLS as unamed funs can not be handled in files. Regards Ingela Erlang/OTP -team 2018-01-23 15:59 GMT+01:00 Ingela Andin : > Hi! > > Well I forgot you are using distribution over TLS and when specifying the > fun via the configuration file you must use fun /3 format for funs. > So you need to have a module implementing the function that you want to > use as a fun. > > So > > -module(my_verify) > > -export([verify/3]). > > verify(Cert,{bad_cert, hostname_check_failed} = Reason, UserState) -> > case my_hostname_check(Cert, UserState) of > > > {fail, Reason}; > verify(_,{bad_cert, _} = Reason, _) -> > {fail, Reason}; > verify(_,{extension, _}, UserState) -> > {unknown, UserState}; > verify(_, valid, UserState) -> > {valid, UserState}; > verify(_, valid_peer, UserState) -> > {valid, UserState}. > > 2018-01-23 12:13 GMT+01:00 San Gillis : > >> Hi! >> >> First of all, thank you Dmitry and Ingela for the quick replies. >> >> Yes it disables all hostname checks making you vulnerable to the things >>> they where designed to protect. >>> >> >> Thought so, so I would prefer not to use the disable option. >> >> >>> The way to customize the checks is to handle them in your own >>> verify_fun, why do you think that is convulted? >>> >> >> It just seemed weird to me to write erlang functions inside a >> configuration file. But then again, I didn't understand it could be just a >> short function, which makes it a lot more acceptable. >> >> >>> The verify_fun can be very simple only specifically handling the {bad_cert, >>> hostname_check_failed} then all other checks will behave as before. The >>> verify_fun is not meant to replace the default certiface checks it >>> is for extending the checks and possible ignoring some specific error >>> (even though this is seldom desirable). >>> >>> Something like: >>> >>> {fun(_,{bad_cert, hostname_check_failed}, _) -> >>> %%% Preform own check ... >>> (_,{extension, _}, UserState) -> >>> {unknown, UserState}; >>> (_, valid, UserState) -> >>> {valid, UserState}; >>> (_, valid_peer, UserState) -> >>> {valid, UserState} >>> end, []} >>> >>> >> I tried this, but the weird thing is that when I explicitly set >> verify_fun to what is described as the default in the documentation: >> >> {fun(_,{bad_cert, _} = Reason, _) -> >> {fail, Reason}; >> (_,{extension, _}, UserState) -> >> {unknown, UserState}; >> (_, valid, UserState) -> >> {valid, UserState}; >> (_, valid_peer, UserState) -> >> {valid, UserState} >> end, []} >> >> I do not get the hostname_check_failed error anymore. I did not expect this. >> >> I believe `ssl_certificate:verify_hostname` is called when I do not explicitly provide verify_fun, because I added some debug statements that got executed. >> >> When I do provide the verify_fun as above the debug statements no longer get executed. But I couldn't find any other occurrences of hostname_check_failed in my copy of the `lib` dir of erlang 20.2. >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From san.gillis@REDACTED Tue Jan 23 18:04:53 2018 From: san.gillis@REDACTED (San Gillis) Date: Tue, 23 Jan 2018 18:04:53 +0100 Subject: [erlang-questions] SSL hostname verification In-Reply-To: References: <615B8B25-28CC-42BA-BB86-FF12887691E9@gmail.com> Message-ID: > So you need to have a module implementing the function that you want to > use as a fun. > I tried this, and I start my remote shell using `erl -remsh nodename@REDACTED -pa ./ebin -setcookie cookie -name node@REDACTED -ssl_dist_optfile ./sslopts.conf -proto_dist inet_tls` where ./ebin contains the module beam. In this case the shell process just terminates without giving me any error messages. This is a limitation for distribution over TLS as unamed funs can not be > handled in files. > When I put some `io:format` statements in my unnamed function they did get printed to console, so it seems this does work? Regards, San -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Tue Jan 23 18:12:58 2018 From: t@REDACTED (Tristan Sloughter) Date: Tue, 23 Jan 2018 09:12:58 -0800 Subject: [erlang-questions] seq_trace with bigint labels In-Reply-To: References: <1516401216.2365459.1241588784.5518363F@webmail.messagingengine.com> Message-ID: <1516727578.459975.1245422512.012B98FB@webmail.messagingengine.com> > Ideally we'd have a solution where the individual applications would not > have to be modified/recompiled but the whole node could be configured to > send trace data out to a trace collector. Mostly. You'd still need to include the app that is capable of receiving the seq_trace messages and formatting spans to be reported from them, but you'd be able to trace any message path without code modifications. But yea, I don't know either if it is as simple as letting it use bigints, or what the consequences of doing so would be. Hopefully someone on the OTP team sees this and can answer :) From comptekki@REDACTED Tue Jan 23 18:22:57 2018 From: comptekki@REDACTED (Wes James) Date: Tue, 23 Jan 2018 10:22:57 -0700 Subject: [erlang-questions] erlang-solutions Ubuntu repository In-Reply-To: References: Message-ID: Why not install from source? Then you can pick the version you want from github. https://github.com/erlang/otp/tags -wes On Tue, Jan 23, 2018 at 12:55 AM, pablo platt wrote: > Hi, > > The erlang-solutions Ubuntu repository is missing package 20.2. > Is there a chance to add it? > https://www.erlang-solutions.com/resources/download.html > > The erlang-solutions_1.0_all.deb package is adding http://binaries.erlang- > solutions.com/debian entry to apt sources while the manual instructions > use a different url https://packages.erlang-solutions.com/ubuntu. I think > both should use the same url with ubuntu instead of debian. > > Thanks > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris@REDACTED Tue Jan 23 18:05:35 2018 From: chris@REDACTED (Chris Dutton) Date: Tue, 23 Jan 2018 09:05:35 -0800 Subject: [erlang-questions] Errors with ADH algorithms (using ranch) Message-ID: <683F6DA9-C000-402D-B42E-BC0E1832CF37@aquatic-edge.com> Note: Also posted to https://github.com/ninenines/ranch/issues/179 which might have better formatting. I am trying to implement ADH algorithms but have been stuck and can?t seem to find anything to help? Here is my code and issues: (Note: This is Elixir code calling to cowboy which I am told calls to ssl) dispatch = :cowboy_router.compile([{:_, [ {"/", __MODULE__, initial_state} ]}] {:ok, pid} = :cowboy.start_tls( __MODULE__, [ :inet6, {:port, @http_port}, {:cacertfile, String.to_charlist(Path.join(priv_dir, "ssl/cowboy-ca.crt"))}, {:certfile, String.to_charlist(Path.join(priv_dir, "ssl/server.crt"))}, {:keyfile, String.to_charlist(Path.join(priv_dir, "ssl/server.key"))}, {:ciphers, [{:rsa, :aes_128_gcm, :null, :sha256}, {:dh_anon, :aes_256_cbc, :sha256}, {:dh_anon, :aes_256_gcm, :null, :sha384}]}, {:dhfile, String.to_charlist(Path.join(priv_dir, "ssl/dh.pem"))}, {:versions, [String.to_atom("tlsv1.2")]} ], %{ env: %{dispatch: dispatch} } ) but always seem to get the error 08:40:45.886 [info] ['TLS', 32, 'server', 58, 32, 73, 110, 32, 115, 116, 97, 116, 101, 32, 'certify', 32, 'received CLIENT ALERT: Fatal - Decode Error', 10] which corresponds to the client giving error curl: (35) error:1408D099:SSL routines:SSL3_GET_KEY_EXCHANGE:extra data in message I have tried other ciphers and am able to establish a TLS connection. Here is some example curlrequests Chriss-MacBook-Pro:~ chris$ curl -v --insecure --ciphers AES128-GCM-SHA256 https://localhost:8002 * Rebuilt URL to: https://localhost:8002/ * Trying ::1... * TCP_NODELAY set * Connected to localhost (::1) port 8002 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * Cipher selection: AES128-GCM-SHA256 * successfully set certificate verify locations: * CAfile: /etc/ssl/cert.pem CApath: none * TLSv1.2 (OUT), TLS handshake, Client hello (1): * TLSv1.2 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (IN), TLS handshake, Server finished (14): * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): * TLSv1.2 (OUT), TLS change cipher, Client hello (1): * TLSv1.2 (OUT), TLS handshake, Finished (20): * TLSv1.2 (IN), TLS change cipher, Client hello (1): * TLSv1.2 (IN), TLS handshake, Finished (20): * SSL connection using TLSv1.2 / AES128-GCM-SHA256 * ALPN, server accepted to use h2 * Server certificate: * subject: C=US; ST=Texas; O=Nine Nines; OU=Cowboy; CN=localhost * start date: Feb 28 05:23:34 2013 GMT * expire date: Feb 23 05:23:34 2033 GMT * issuer: C=US; ST=Texas; O=Nine Nines; OU=Cowboy; CN=ROOT CA * SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway. * Using HTTP2, server supports multi-use * Connection state changed (HTTP/2 confirmed) * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0 * Using Stream ID: 1 (easy handle 0x7feba8805800) > GET / HTTP/2 > Host: localhost:8002 > User-Agent: curl/7.54.0 > Accept: */* > * Connection state changed (MAX_CONCURRENT_STREAMS updated)! < HTTP/2 200 < content-length: 0 < content-type: application/json < date: Tue, 23 Jan 2018 16:40:35 GMT < server: Cowboy < * Connection #0 to host localhost left intact Chriss-MacBook-Pro:~ chris$ curl -v --insecure --ciphers ADH-AES256-SHA256 https://localhost:8002 * Rebuilt URL to: https://localhost:8002/ * Trying ::1... * TCP_NODELAY set * Connected to localhost (::1) port 8002 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * Cipher selection: ADH-AES256-SHA256 * successfully set certificate verify locations: * CAfile: /etc/ssl/cert.pem CApath: none * TLSv1.2 (OUT), TLS handshake, Client hello (1): * TLSv1.2 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Server key exchange (12): * TLSv1.2 (OUT), TLS alert, Server hello (2): * error:1408D099:SSL routines:SSL3_GET_KEY_EXCHANGE:extra data in message * stopped the pause stream! * Closing connection 0 curl: (35) error:1408D099:SSL routines:SSL3_GET_KEY_EXCHANGE:extra data in message Chriss-MacBook-Pro:~ chris$ curl -v --insecure --ciphers ADH-AES256-GCM-SHA384 https://localhost:8002 * Rebuilt URL to: https://localhost:8002/ * Trying ::1... * TCP_NODELAY set * Connected to localhost (::1) port 8002 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * Cipher selection: ADH-AES256-GCM-SHA384 * successfully set certificate verify locations: * CAfile: /etc/ssl/cert.pem CApath: none * TLSv1.2 (OUT), TLS handshake, Client hello (1): * TLSv1.2 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Server key exchange (12): * TLSv1.2 (OUT), TLS alert, Server hello (2): * error:1408D099:SSL routines:SSL3_GET_KEY_EXCHANGE:extra data in message * stopped the pause stream! * Closing connection 0 curl: (35) error:1408D099:SSL routines:SSL3_GET_KEY_EXCHANGE:extra data in message Am I missing something? -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidnwelton@REDACTED Wed Jan 24 04:02:22 2018 From: davidnwelton@REDACTED (David Welton) Date: Tue, 23 Jan 2018 19:02:22 -0800 Subject: [erlang-questions] Strange inet_gethost_native:gethostbyname behavior Message-ID: Hi, I ssh'ed into a system to see what was causing connection problems. inet_gethost_native:gethostbyname("google.com", inet). kept failing with {error, try_again}. Started up a new Erlang shell and tried the same thing. It worked fine. Killed the external process it was using, inet_gethost and retried, and it started working. This is an older Erlang: erts-6.4.1.2 but inet_gethost hasn't seen a lot of changes lately, going on the git logs. Any ideas what 1) may cause this and 2) how to get around it? The system is stuck not being able to do DNS lookups, which is problematic, to say the least. Thanks -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From zxq9@REDACTED Wed Jan 24 06:45:28 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Wed, 24 Jan 2018 14:45:28 +0900 Subject: [erlang-questions] erlang-solutions Ubuntu repository In-Reply-To: References: Message-ID: <8337705.P3AhBfp0nE@takoyaki> On 2018?1?23???? 10?22?57? JST Wes James wrote: > Why not install from source? Then you can pick the version you want from > github. That isn't a fix for every situation, especially across a lot of machines. -Craig From ulf@REDACTED Wed Jan 24 09:50:13 2018 From: ulf@REDACTED (Ulf Wiger) Date: Wed, 24 Jan 2018 09:50:13 +0100 Subject: [erlang-questions] ANN: app controller supporting a 'start_before' option Message-ID: Currently looking for early adopters and feedback for: https://github.com/aeternity/app_ctrl Status: first working prototype. I occasionally run into the problem that I would like to run one of my own applications BEFORE a third-party or OTP application, and there is currently no good way to do that. Typical such scenarios could be: - to have a 'prep' application that checks various things and sets environment variables. Currently, that may have to be done before starting the node, but then becomes both slower and more cumbersome - e.g. defining exometer probes that depend on certain applications that exometer doesn't know about. Since we can't guarantee that they are running before exometer, we have to create such probes manually in an application that has both exometer and the other apps as dependencies. The app_ctrl component is primarily (at the moment) a way to impose a stricter start order than OTP can manage, e.g. by defining that `gproc` must start before `exometer_core`. For a few more details, see the README.md file. I know that the question has been raised e.g. with `relx`, where people would like it to preserve the sort order in the .rel file. But even preserving the sort order doesn't guarantee order, since applications that have no dependencies to each other can start in parallel. The app_ctrl code has made some preparations for being a fully-fledged Distributed Application Controller. This is in part a decency requirement since it hogs app permissions and the `dist_ac` protocol. But currently, it doesn't do all the work required for distributed app control. Comments and contributions are most welcome! BR, Ulf W -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth@REDACTED Wed Jan 24 10:34:53 2018 From: kenneth@REDACTED (Kenneth Lundin) Date: Wed, 24 Jan 2018 10:34:53 +0100 Subject: [erlang-questions] seq_trace with bigint labels In-Reply-To: <1516727578.459975.1245422512.012B98FB@webmail.messagingengine.com> References: <1516401216.2365459.1241588784.5518363F@webmail.messagingengine.com> <1516727578.459975.1245422512.012B98FB@webmail.messagingengine.com> Message-ID: I will take it up to discussion within the OTP team and come back with an answer as soon as possible. The idea with the small_int solution is that we wanted an immediate data here to avoid dynamic memory allocation. But I think it would be possible to allow a bigger value which still is of fixed size (big int is dynamic). I think it would be very good if seqtrace could support use cases like this. /Kenneth, Erlang/OTP team at Ericsson On Tue, Jan 23, 2018 at 6:12 PM, Tristan Sloughter wrote: > > Ideally we'd have a solution where the individual applications would not > > have to be modified/recompiled but the whole node could be configured to > > send trace data out to a trace collector. > > Mostly. You'd still need to include the app that is capable of receiving > the seq_trace messages and formatting spans to be reported from them, but > you'd be able to trace any message path without code modifications. > > But yea, I don't know either if it is as simple as letting it use bigints, > or what the consequences of doing so would be. > > Hopefully someone on the OTP team sees this and can answer :) > _______________________________________________ > 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 Wed Jan 24 10:47:51 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 24 Jan 2018 10:47:51 +0100 Subject: [erlang-questions] Strange inet_gethost_native:gethostbyname behavior In-Reply-To: References: Message-ID: <20180124094751.GA46575@erix.ericsson.se> On Tue, Jan 23, 2018 at 07:02:22PM -0800, David Welton wrote: > Hi, > > I ssh'ed into a system to see what was causing connection problems. > > inet_gethost_native:gethostbyname("google.com", inet). kept failing > with {error, try_again}. > > Started up a new Erlang shell and tried the same thing. It worked fine. > > Killed the external process it was using, inet_gethost and retried, > and it started working. > > This is an older Erlang: erts-6.4.1.2 but inet_gethost hasn't seen a > lot of changes lately, going on the git logs. > > Any ideas what 1) may cause this and 2) how to get around it? The > system is stuck not being able to do DNS lookups, which is > problematic, to say the least. > > Thanks > -- > David N. Welton > > http://www.welton.it/davidw/ > http://www.dedasys.com/ This sounds like a job for the API call inet_gethost_native:control(soft_restart) It happens that libc in a native resolver process caches DNS replies for too long, maybe after some network reconfiguration, and this call restarts all native resolver processes the node uses. -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From fchschneider@REDACTED Wed Jan 24 16:14:13 2018 From: fchschneider@REDACTED (Frans Schneider) Date: Wed, 24 Jan 2018 16:14:13 +0100 Subject: [erlang-questions] Making changes to the erlang libs Message-ID: <92f9abda-418f-120f-a5e8-ff25039b3834@gmail.com> Hi list, I want to make some changes to xmerl_xsd because I think there is a bug in there. I use kerl and made an installation with the latest 20.2 release. So, I thought I would just edit the source of xmerl_xsd where kerl installed the sources and use c(xmerl_xsd) to compile the thing, however nothing happens. I see the beam file getting a new time stamp after compiling but its size remains the same, so I assume it compiles using some other source file than the one I am editing. So, what is it I am doing wrong and what is the easiest way to make changes to library modules and do some experiments? Thanks, Frans From comptekki@REDACTED Wed Jan 24 17:14:13 2018 From: comptekki@REDACTED (Wes James) Date: Wed, 24 Jan 2018 09:14:13 -0700 Subject: [erlang-questions] Making changes to the erlang libs In-Reply-To: <92f9abda-418f-120f-a5e8-ff25039b3834@gmail.com> References: <92f9abda-418f-120f-a5e8-ff25039b3834@gmail.com> Message-ID: How is your initial erlang installed. One way is to git clone the source, git checkout the version you want to install, make your changes to the file and then make, then rename /usr/local/lib/erlang to something else, then sudo make install and the change should take effect. killall epmd or any other erlang apps that might be running, then start your app. On Wed, Jan 24, 2018 at 8:14 AM, Frans Schneider wrote: > Hi list, > > I want to make some changes to xmerl_xsd because I think there is a bug in > there. I use kerl and made an installation with the latest 20.2 release. > So, I thought I would just edit the source of xmerl_xsd where kerl > installed the sources and use c(xmerl_xsd) to compile the thing, however > nothing happens. I see the beam file getting a new time stamp after > compiling but its size remains the same, so I assume it compiles using some > other source file than the one I am editing. > > So, what is it I am doing wrong and what is the easiest way to make > changes to library modules and do some experiments? > > 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 t@REDACTED Wed Jan 24 17:26:43 2018 From: t@REDACTED (Tristan Sloughter) Date: Wed, 24 Jan 2018 08:26:43 -0800 Subject: [erlang-questions] seq_trace with bigint labels In-Reply-To: References: <1516401216.2365459.1241588784.5518363F@webmail.messagingengine.com> <1516727578.459975.1245422512.012B98FB@webmail.messagingengine.com> Message-ID: <1516811203.3136299.1246700920.72ED52DF@webmail.messagingengine.com> Great! And yea, it doesn't have to be dynamic. For census it needs to be 128bits for the trace id and span ids are 64bits. -- Tristan Sloughter "I am not a crackpot" - Abe Simpson t@REDACTED On Wed, Jan 24, 2018, at 1:34 AM, Kenneth Lundin wrote: > I will take it up to discussion within the OTP team and come back with > an answer as soon as possible.> The idea with the small_int solution is that we wanted an immediate > data here to avoid dynamic memory allocation. But I think it would be > possible to allow a bigger> value which still is of fixed size (big int is dynamic). > > I think it would be very good if seqtrace could support use cases > like this.> > /Kenneth, Erlang/OTP team at Ericsson > > On Tue, Jan 23, 2018 at 6:12 PM, Tristan Sloughter > wrote:>> > Ideally we'd have a solution where the individual applications >> > would not>> > have to be modified/recompiled but the whole node could be >> > configured to>> > send trace data out to a trace collector. >> >> Mostly. You'd still need to include the app that is capable of >> receiving the seq_trace messages and formatting spans to be reported >> from them, but you'd be able to trace any message path without code >> modifications.>> >> But yea, I don't know either if it is as simple as letting it use >> bigints, or what the consequences of doing so would be.>> >> Hopefully someone on the OTP team sees this and can answer :) >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Wed Jan 24 17:51:11 2018 From: g@REDACTED (Guilherme Andrade) Date: Wed, 24 Jan 2018 16:51:11 +0000 Subject: [erlang-questions] Making changes to the erlang libs In-Reply-To: <92f9abda-418f-120f-a5e8-ff25039b3834@gmail.com> References: <92f9abda-418f-120f-a5e8-ff25039b3834@gmail.com> Message-ID: On 24 January 2018 at 15:14, Frans Schneider wrote: > I want to make some changes to xmerl_xsd because I think there is a bug in > there. I use kerl and made an installation with the latest 20.2 release. > So, I thought I would just edit the source of xmerl_xsd where kerl > installed the sources and use c(xmerl_xsd) to compile the thing, however > nothing happens. I see the beam file getting a new time stamp after > compiling but its size remains the same, so I assume it compiles using some > other source file than the one I am editing. > > So, what is it I am doing wrong and what is the easiest way to make > changes to library modules and do some experiments? > You can avoid marking the directories containing key runtime modules as 'sticky'[1]. Would this allow you to load your modified copies of the modules, residing in your own application? I never tried it, so I'm not sure, but it seems worth a shot. [1]: http://erlang.org/doc/man/code.html -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Wed Jan 24 17:56:15 2018 From: g@REDACTED (Guilherme Andrade) Date: Wed, 24 Jan 2018 16:56:15 +0000 Subject: [erlang-questions] Making changes to the erlang libs In-Reply-To: References: <92f9abda-418f-120f-a5e8-ff25039b3834@gmail.com> Message-ID: Unless your intention is to simply iterate over the development of this potential fix you mentioned, of course. In that case it's probably easier to simply git clone the OTP repo, pick the appropriate branch or tag, and begin the usual 'change code -> 'recompile -> 'launch erlang or tests' cycle. This won't require you to install OTP system-wide or anything. -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From fchschneider@REDACTED Wed Jan 24 19:21:21 2018 From: fchschneider@REDACTED (Frans Schneider) Date: Wed, 24 Jan 2018 19:21:21 +0100 Subject: [erlang-questions] Making changes to the erlang libs In-Reply-To: References: <92f9abda-418f-120f-a5e8-ff25039b3834@gmail.com> Message-ID: The Debian box I am using has Erlang installed from Erlang Solutions. For personal use, I use kerl to install a version within my home directory and switch to it using the kerl activate command. The global version is 20.1 and the my own version is 20.2 as verified by running erl before and after activating. What I do for installing and activating the local erlang install: $ kerl build 20.2 20.2 ... Erlang/OTP 20.2 (20.2) has been successfully built $ kerl install 20.2 ~/otp/20.2 Installing Erlang/OTP 20.2 (20.2) in /home/frans/otp/20.2... $ . /home/frans/otp/20.2/activate This changes $PATH and adds some _KERL* variables to the env. In erl, I check where xmer_xsd resides: 2> code:which(xmerl_xsd). "/home/frans/otp/20.2/lib/xmerl-1.3.16/ebin/xmerl_xsd.beam" I edit file "/home/frans/otp/20.2/lib/xmerl-1.3.16/src/xmerl_xsd_erl" and compile using c(xmerl_xsd) and now I see why all this goes wrong. It recompiles "/home/frans/.kerl/builds/20.2/otp_src_20.2/lib/xmerl/src/xmerl_xsd.erl" and not the file I was editing. Could somebody explain why it is using the sources from the .kerl directory and not the otp directory? Now I can run some tests with little effort before even thinking about a bug report. Thanks, Frans On 01/24/2018 05:14 PM, Wes James wrote: > How is your initial erlang installed.? One way is to git clone the > source, git checkout the version you want to install, make your changes > to the file and then make, then rename /usr/local/lib/erlang to > something else, then sudo make install and the change should take > effect.? killall epmd or any other erlang apps that might be running, > then start your app. > > On Wed, Jan 24, 2018 at 8:14 AM, Frans Schneider > wrote: > > Hi list, > > I want to make some changes to xmerl_xsd because I think there is a > bug in there. I use kerl and made an installation with the latest > 20.2 release. So, I thought I would just edit the source of > xmerl_xsd where kerl installed the sources and use c(xmerl_xsd) to > compile the thing, however nothing happens. I see the beam file > getting a new time stamp after compiling but its size remains the > same, so I assume it compiles using some other source file than the > one I am editing. > > So, what is it I am doing wrong and what is the easiest way to make > changes to library modules and do some experiments? > > Thanks, > > Frans > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > From g@REDACTED Wed Jan 24 21:56:32 2018 From: g@REDACTED (Guilherme Andrade) Date: Wed, 24 Jan 2018 20:56:32 +0000 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: On 23 January 2018 at 13:13, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > I like the point of considering such a change on gen_server, indeed. > I took a look at the OTP source as this seemed simple enough to implement; the code was kind enough to remind me that one can call gen processes on remote nodes. At that point any possibility of using the monotonic clock breaks down. The functionality *could* be restricted to local gen processes, but then it's this one more crevasse people have to consider when working with the gen behaviours OTP provides, so I don't see it flying as a PR. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierrefenoll@REDACTED Wed Jan 24 22:22:58 2018 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Wed, 24 Jan 2018 22:22:58 +0100 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: Having a timeout inside the pattern matching semantics of receiving messages would be interesting. But yes as Guilherme points out how would that work with receiving from distributed nodes? Maybe something along recieve Msg:Node -> ... end maybe better: recieve Msg:Node:Sojourn -> ... end which alows recieve Msg:node() -> ... Msg:_:Sojourn -> ... end where node() would just get compiled to matching the local node. Well this leaves the question of how would the libraries look like in the future. Cheers, -- Pierre Fenoll On 24 January 2018 at 21:56, Guilherme Andrade wrote: > > > On 23 January 2018 at 13:13, Jesper Louis Andersen < > jesper.louis.andersen@REDACTED> wrote: > >> I like the point of considering such a change on gen_server, indeed. >> > > I took a look at the OTP source as this seemed simple enough to implement; > the code was kind enough to remind me that one can call gen processes on > remote nodes. At that point any possibility of using the monotonic clock > breaks down. > > The functionality *could* be restricted to local gen processes, but then > it's this one more crevasse people have to consider when working with the > gen behaviours OTP provides, so I don't see it flying as a PR. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Wed Jan 24 23:01:30 2018 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 24 Jan 2018 23:01:30 +0100 Subject: [erlang-questions] [ANN] BBEdit Erlang Language Module v1.4 In-Reply-To: References: Message-ID: <1009F479-8F92-471D-BF4F-79D154080295@gmail.com> > On 14 Jan 2018, at 15:43, Paul Guyot wrote: > > Hello, > > I'm pleased to announce v1.4 update of the Erlang language module for BBEdit, an award-winning MacOS X text editor. > It features syntax coloring and code completion (including all Erlang/OTP documented API). > > You can download it here: > https://github.com/pguyot/erlang-bblm/releases/tag/v1.4 > > Source code is available as well. > > Changes: > ? [ENH] Upgraded for BBEdit 12.1 (64 bits). > ? [ENH] Updated completion lists for Erlang OTP 20 > ? [FEA] Added faceless helper application for reference lookups which either opens the man page in Terminal.app (if found) or performs a lookup on erlang.org in the default browser. > > Regards, > > Paul > -- > Semiocast http://semiocast.com/ > +33.183627948 - 20 rue Lacaze, 75014 Paris > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions nice! Thanks for it :) - benoit From raimo+erlang-questions@REDACTED Thu Jan 25 10:40:30 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 25 Jan 2018 10:40:30 +0100 Subject: [erlang-questions] SSL hostname verification In-Reply-To: References: <615B8B25-28CC-42BA-BB86-FF12887691E9@gmail.com> Message-ID: <20180125094030.GA27648@erix.ericsson.se> On Tue, Jan 23, 2018 at 06:04:53PM +0100, San Gillis wrote: > > So you need to have a module implementing the function that you want to > > use as a fun. > > > > I tried this, and I start my remote shell using > `erl -remsh nodename@REDACTED -pa ./ebin -setcookie cookie -name node@REDACTED > -ssl_dist_optfile ./sslopts.conf -proto_dist inet_tls` > where ./ebin contains the module beam. > > In this case the shell process just terminates without giving me any error > messages. > > > This is a limitation for distribution over TLS as unamed funs can not be > > handled in files. > > > > When I put some `io:format` statements in my unnamed function they did get > printed to console, so it seems this does work? > > Regards, > San Well, I'll be darned, but that acually seems to work! The file parsing results in an erl_eval internal fun with the parsed abstract form in its environment, so when that fun is called it is interpreted by erl_eval. Interpretation is _much_ slower then execution, but I do not know when that would be a real problem... Here is an example that works, I ripped out pieces from after running the test suite ssl_dist_bench_SUITE:setup/1: To start one node: erl -run application start crypto -run application start public_key -eval 'net_kernel:verbose(1)' -sname ssl_dist_bench_SUITE_node_a -proto_dist inet_tls -ssl_dist_optfile ~/tmp/ssl_dist_bench_SUITE_node_a@REDACTED To start the other node: erl -run application start crypto -run application start public_key -eval 'net_kernel:verbose(1)' -sname ssl_dist_bench_SUITE_node_b -proto_dist inet_tls -ssl_dist_optfile ~/tmp/ssl_dist_bench_SUITE_node_b@REDACTED My host's short name is elxd1243rl3. The "-eval 'net_kernel:verbose(1)' increases verbosity for testing. The applications 'crypto' and 'public_key' has to be started, either from the command line like this, or from a dedicated boot script. See: http://erlang.org/doc/apps/ssl/ssl_distribution.html Section 4.1 The test framework generates the .conf files containing certificates for the short node names so these nodes actually pass hostname verification. In these .conf files I have added an inline verify_fun in the client section. Excerpt from ~/tmp/ssl_dist_bench_SUITE_node_b@REDACTED: [{server, [{fail_if_no_peer_cert,true}, {verify,verify_peer}, {versions,['tlsv1.2']}, {ciphers,[{ecdhe_ecdsa,aes_128_cbc,sha256,sha256}]}, {cert,<<48,130,2,237,48,130,2,72,160,3,2,1,2,2,1,4,48,16,6,7,42,134, ...,235,67,74,159,21,16,15>>}, {key,{'ECPrivateKey',<<48,129,220,2,1,1,4,66,1,177,250,81,233,146, ...,60,213,172>>}}, {cacerts,[<<48,130,2,213,48,130,2,48,160,3,2,1,2,2,1,2,48,16,6,7,42, ...,141,240,231,115,166,243>>, <<48,130,2,213,48,130,2,48,160,3,2,1,2,2,1,2,48,16,6,7, ...,237,32,9,141,240,231,115,166,243>>]}]}, {client, [{verify,verify_peer}, {verify_fun, {fun (_, Event, UserState) -> io:format("~p.~n", [Event]), case Event of {bad_cert, hostname_check_failed} -> %%% Preform own check ... {valid, UserState}; {extension, _} -> {unknown, UserState}; valid -> {valid, UserState}; valid_peer -> {valid, UserState} end end, []}}, {versions,['tlsv1.2']}, {ciphers,[{ecdhe_ecdsa,aes_128_cbc,sha256,sha256}]}, {cert,<<48,130,2,237,48,130,2,72,160,3,2,1,2,2,1,4,48,16,6,7,42,134, ...,235,67,74,159,21,16,15>>}, {key,{'ECPrivateKey',<<48,129,220,2,1,1,4,66,1,177,250,81,233,146, ...,60,213,172>>}}, {cacerts,[<<48,130,2,213,48,130,2,48,160,3,2,1,2,2,1,2,48,16,6,7,42, ...,141,240,231,115,166,243>>, <<48,130,2,213,48,130,2,48,160,3,2,1,2,2,1,2,48,16,6, ...,206,74,237,32,9,141,240,231,115,166,243>>]} ] }]. This is node a that gets connected to, I am sorry I connected from node b to node a, that is not according to telco tradition :-( erl -run application start crypto -run application start public_key -eval 'net_kernel:verbose(1)' -sname ssl_dist_bench_SUITE_node_a -proto_dist inet_tls -ssl_dist_optfile ~/tmp/ssl_dist_bench_SUITE_node_a@REDACTED Erlang/OTP 21 [DEVELOPMENT] [erts-9.2] [source-8e66754] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] Eshell V9.2 (abort with ^G) (ssl_dist_bench_SUITE_node_a@REDACTED)1> =ERROR REPORT==== 25-Jan-2018::09:53:37 === Net kernel got ping And this is node b that connects: erl -run application start crypto -run application start public_key -eval 'net_kernel:verbose(1)' -sname ssl_dist_bench_SUITE_node_b -proto_dist inet_tls -ssl_dist_optfile ~/tmp/ssl_dist_bench_SUITE_node_b@REDACTED Erlang/OTP 21 [DEVELOPMENT] [erts-9.2] [source-8e66754] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] Eshell V9.2 (abort with ^G) (ssl_dist_bench_SUITE_node_b@REDACTED)1> {net_kernel,ssl_dist_bench_SUITE_node_a@REDACTED} ! ping. ping =INFO REPORT==== 25-Jan-2018::09:53:37 === {net_kernel,{auto_connect,ssl_dist_bench_SUITE_node_a@REDACTED,1, #Ref<0.1220262086.1603141640.225564>}} {extension, {'Extension',{2,5,29,17},false, [{dNSName,"ssl_dist_bench_SUITE_node_a@REDACTED"}]}}. valid_peer. (ssl_dist_bench_SUITE_node_b@REDACTED)2> So we got two printouts from the verify_fun on node b, one for the subject altnames extension, and one from the succesful validation. I hope this information was useful. -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From jesper.louis.andersen@REDACTED Thu Jan 25 15:28:58 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 25 Jan 2018 14:28:58 +0000 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: On Wed, Jan 24, 2018 at 10:23 PM Pierre Fenoll wrote: > But yes as Guilherme points out how would that work with receiving from > distributed nodes? > This would work exactly as advertised. When the message enters the mailbox on the receiving nodes end. You cannot in any way build a safe time construct over multiple nodes, so you opt for the next best case: a lower bound on the sojourn. This means that a message has spent at least XXms in queues inside the system. But it could have spent more time than that. I don't think you can do better than this in a distributed network, but of course this requires a proof. -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Thu Jan 25 16:10:25 2018 From: g@REDACTED (Guilherme Andrade) Date: Thu, 25 Jan 2018 15:10:25 +0000 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: On 25 January 2018 at 14:28, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > > This would work exactly as advertised. When the message enters the mailbox > on the receiving nodes end. You cannot in any way build a safe time > construct over multiple nodes, so you opt for the next best case: a lower > bound on the sojourn. This means that a message has spent at least XXms in > queues inside the system. But it could have spent more time than that. > How would this work? Monotonic timestamps originating on different nodes are not comparable. Let's imagine: - There's two nodes connected through distribution: A and B; - There's a process named Alice at node A; - There's a gen process named Bob at node B; - At a given instant T1, monotonic_timestamp{A} = 3s and monotonic_timestamp{B} = 10s; - Alice calls Bob; it attaches monotonic_timestamp{A} to the call message; - Excluding buffering and network delays, the call message arrives at Bob with a measured Sojourn of (10 - 3) = 7s and gets dropped, even though ~0s have passed. And this is the ugly case, of course. Reverse the roles of Alice and Bob and we would get the bad case, as it would mean a lot of work would go through even if arriving terribly late. As an alternative, a temporary caller process could always be launched on the same node the gen process resides in; it would be inside this caller process that the timestamp would get attached and the actual call performed, and so local Sojourn would be measurable, but that implies higher saturation of the distribution channels, besides telling us nothing of buffer or network -induced delays. I would very much like to see this working, I just don't see a good way of dealing with distribution. But please correct me if I'm wrong in any of the assumptions above. -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Thu Jan 25 18:05:13 2018 From: g@REDACTED (Guilherme Andrade) Date: Thu, 25 Jan 2018 17:05:13 +0000 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: On 25 January 2018 at 16:34, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > 2. Node B, where Bob lives, receives the message in its TCP stack. At this > point the message enters the mailbox of process Bob, so we take a Ts = > monotonic_timestamp(), but at node B. This means the timestamp is a bound > on the sojourn. The reported value is always going to be lower than the > actual sojourn (since we don't measure the TCP travel time). But if the > reported sojourn is too high for our taste, we can always reject the > message. > Ah yes, that makes perfect sense, of course. I was reasoning within the expectation that we wouldn't want to change something so fundamental as the nature of inboxes in ERTS. But indeed there's no good alternative. -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidnwelton@REDACTED Thu Jan 25 18:59:16 2018 From: davidnwelton@REDACTED (David Welton) Date: Thu, 25 Jan 2018 09:59:16 -0800 Subject: [erlang-questions] Strange inet_gethost_native:gethostbyname behavior In-Reply-To: <20180124094751.GA46575@erix.ericsson.se> References: <20180124094751.GA46575@erix.ericsson.se> Message-ID: Hi, Thanks... >> inet_gethost_native:gethostbyname("google.com", inet). kept failing >> with {error, try_again}. >> Any ideas what 1) may cause this and 2) how to get around it? The >> system is stuck not being able to do DNS lookups, which is >> problematic, to say the least. > It happens that libc in a native resolver process caches DNS replies for > too long, maybe after some network reconfiguration, and this call > restarts all native resolver processes the node uses. Seems odd, though, that things are unable to recover. I wonder what might cause that. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From raimo+erlang-questions@REDACTED Fri Jan 26 09:37:00 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 26 Jan 2018 09:37:00 +0100 Subject: [erlang-questions] Strange inet_gethost_native:gethostbyname behavior In-Reply-To: References: <20180124094751.GA46575@erix.ericsson.se> Message-ID: <20180126083700.GA76745@erix.ericsson.se> On Thu, Jan 25, 2018 at 09:59:16AM -0800, David Welton wrote: > Hi, > > Thanks... > > >> inet_gethost_native:gethostbyname("google.com", inet). kept failing > >> with {error, try_again}. > > >> Any ideas what 1) may cause this and 2) how to get around it? The > >> system is stuck not being able to do DNS lookups, which is > >> problematic, to say the least. > > > It happens that libc in a native resolver process caches DNS replies for > > too long, maybe after some network reconfiguration, and this call > > restarts all native resolver processes the node uses. > > Seems odd, though, that things are unable to recover. I wonder what > might cause that. One thing that has caused this in the past is reconfiguring the DNS resolver for the machine. Then the erlang node can have cached negative responses with long lifetime, but the DNS reconfiguration was intended to fix those negative responses. And libc can not do better than using the lifetime of the negative responses it got. So the situation will probably recover, but it might take a week... > > -- > David N. Welton > > http://www.welton.it/davidw/ > > http://www.dedasys.com/ -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From pablo.platt@REDACTED Fri Jan 26 21:39:34 2018 From: pablo.platt@REDACTED (pablo platt) Date: Fri, 26 Jan 2018 22:39:34 +0200 Subject: [erlang-questions] erlang-solutions Ubuntu repository In-Reply-To: <8337705.P3AhBfp0nE@takoyaki> References: <8337705.P3AhBfp0nE@takoyaki> Message-ID: The erlang-solutions package was updated to otp 20.2. Thanks On Wed, Jan 24, 2018 at 7:45 AM, wrote: > On 2018?1?23???? 10?22?57? JST Wes James wrote: > > Why not install from source? Then you can pick the version you want from > > github. > > That isn't a fix for every situation, especially across a lot of machines. > > -Craig > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Sat Jan 27 17:08:06 2018 From: g@REDACTED (Guilherme Andrade) Date: Sat, 27 Jan 2018 16:08:06 +0000 Subject: [erlang-questions] Sender punishment removed In-Reply-To: References: Message-ID: I've opened a PR[1] proposing a solution for expirable gen calls. Any input is welcome[2]. [1]: https://github.com/erlang/otp/pull/1693 [2]: Including naming. I'm really not fond of 'expirable'. -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Sun Jan 28 09:35:00 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Sun, 28 Jan 2018 11:35:00 +0300 Subject: [erlang-questions] erlang ssh and port forwarding Message-ID: Hi. I'm writing ssh proxy in erlang: https://github.com/flussonic/ssh-proxy It is required for our support team: engineers need to login to customers servers but I want to make a revocation of access. So this is a proxy that will hide our team private key from whole team (except me). There is a working POC, but I've got a problem: port forwarding do not work: debug1: Connection to port 9080 forwarding to localhost port 80 requested. debug1: channel 3: new [direct-tcpip] channel 3: open failed: administratively prohibited: Not allowed debug1: channel 3: free: direct-tcpip: listening port 9080 for localhost port 80, connect from ::1 port 54743 to ::1 port 9080, nchannels 4 Is something not ready in erlang ssh? -------------- next part -------------- An HTML attachment was scrubbed... URL: From fxn@REDACTED Sun Jan 28 17:13:01 2018 From: fxn@REDACTED (Xavier Noria) Date: Sun, 28 Jan 2018 17:13:01 +0100 Subject: [erlang-questions] uses cases for limiting schedulers or threads? In-Reply-To: References: Message-ID: For the archives, I saw another use case near the end of the book: Reducing the number of cores may ease the detection of bottlenecks when stress testing. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdsebald@REDACTED Sun Jan 28 22:51:07 2018 From: mdsebald@REDACTED (Mark Sebald) Date: Sun, 28 Jan 2018 15:51:07 -0600 Subject: [erlang-questions] net_kernel:start() "the name seems to be in use by another Erlang node" Message-ID: I am using "net_kernel:start()", to start multiple nodes of the same application, on the same host. Each time I start a node, I don't know how many other nodes were already started, so my thinking was to add an index number to the node name, and if start() returns: "{already_started, pid()}" I will increment the index on the node name, and call start() again. Instead, when I try to start a second node of the same name I get this: 14:14:29.425 [info] Protocol 'inet_tcp': the name my_node01@REDACTED seems to be in use by another Erlang node 14:14:29.425 [error] CRASH REPORT Process <0.109.0> with 0 neighbours exited with reason: {error,badarg} in gen_server:init_it/6 line 349 and an error tuple is returned This seems like an Erlang bug, since the info log message indicates that the situation is well in hand, but then we get a crash. Is there a better way to start multiple nodes? Are there any conditions where start() will return "already_started"? I found this from 2013: https://github.com/elixir-lang/elixir/issues/1707, where an Elixir user reports the same issue and Jose Valim's responds: "I did more research on this one and unfortunately there is nothing we can do. The error comes from within the vm, before Elixir kicks in. I will open up a discussion with the OTP team. ..." In the end, I match the case where start() returns an error, and then try starting the next node in my series, which works, but it seems rather ugly. I am on OTP ver. 20.x. Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.platt@REDACTED Mon Jan 29 09:22:10 2018 From: pablo.platt@REDACTED (pablo platt) Date: Mon, 29 Jan 2018 10:22:10 +0200 Subject: [erlang-questions] How to test multi-pollset? Message-ID: Hi, What is the expected effect of the multi-pollset PR [1] on a UDP socket on the sender/receiver side? My use case is a media server with several broadcaster and many viewers. Each stream use 1Mbps (aprox 100 * 1500 bytes packets per second). Should I expect improvement when gen_udp is sending packets, receiving packets or both? Is it reasonable to pick a point in master and use it on a production system after testing? [1] https://github.com/erlang/otp/pull/1552 Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Mon Jan 29 09:49:12 2018 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 29 Jan 2018 09:49:12 +0100 Subject: [erlang-questions] How to test multi-pollset? In-Reply-To: References: Message-ID: Hello, On Mon, Jan 29, 2018 at 9:22 AM, pablo platt wrote: > Hi, > > What is the expected effect of the multi-pollset PR [1] on a UDP socket on > the sender/receiver side? > My use case is a media server with several broadcaster and many viewers. > Each stream use 1Mbps (aprox 100 * 1500 bytes packets per second). > Should I expect improvement when gen_udp is sending packets, receiving > packets or both? > Yes, I believe that you will see an improvement. It depends on what type of HW that you are running on, typically the more logical cpu's you have the more gain you will get from the improvements in I/O polling[1]. Also the exact usage pattern matters. > Is it reasonable to pick a point in master and use it on a production > system after testing? > I would take the latest tip of master and test that thoroughly for you application. The things that we merge into master have gone through all our testing before it is merged, so it is as stable as the maint branch. However we make a lot more changes in master than in maint, so because of that there will be a greater chance of some bug slipping through. If you do decide to give the improved I/O polling implementation a go, please do come back with any negative or positive findings that you get! Lukas [1]: The largest change in the PR is not actually the ability to use multiple pollsets, but that the polling has been lifted out to be done by dedicated threads. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Mon Jan 29 09:57:09 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Mon, 29 Jan 2018 17:57:09 +0900 Subject: [erlang-questions] net_kernel:start() "the name seems to be in use by another Erlang node" In-Reply-To: References: Message-ID: <28099967.CzVN9HJnuF@takoyaki.shinden.tsuriai.jp> On 2018?1?28???? 15?51?07? JST Mark Sebald wrote: > I am using "net_kernel:start()", to start multiple nodes of the same > application, on the same host. Each time I start a node, I don't know how > many other nodes were already started, so my thinking was to add an index > number to the node name, and if start() returns: "{already_started, pid()}" > I will increment the index on the node name, and call start() again. > > Instead, when I try to start a second node of the same name I get this: > > 14:14:29.425 [info] Protocol 'inet_tcp': the name my_node01@REDACTED seems > to be in use by another Erlang node > 14:14:29.425 [error] CRASH REPORT Process <0.109.0> with 0 neighbours > exited with reason: {error,badarg} in gen_server:init_it/6 line 349 > > and an error tuple is returned > > This seems like an Erlang bug, since the info log message indicates that > the situation is well in hand, but then we get a crash. Is there a better > way to start multiple nodes? Are there any conditions where start() will > return "already_started"? I've not messed with this in a while, but I do recall being able to do dynamic start names like this. I don't have a sample of the code that did it for me, though. In the shell, however, the following worked. Node 1: Eshell V9.2 (abort with ^G) 1> net_kernel:start([foo, longnames]). {ok,<0.66.0>} (foo@REDACTED)2> Node 2: Eshell V9.2 (abort with ^G) 1> Start = 1> fun(Name1, Name2) -> 1> case net_kernel:start([Name1, longnames]) of 1> {ok, Pid} -> 1> {ok, Pid}; 1> {error, Reason} -> 1> ok = io:format("Failed with ~tp~nTrying ~tp~n", [Reason, Name2]), 1> net_kernel:start([Name2, longnames]) 1> end 1> end. #Fun 2> Start(foo, bar). Failed with {{shutdown, {failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}, {child,undefined,net_sup_dynamic, {erl_distribution,start_link,[[foo,longnames],false]}, permanent,1000,supervisor, [erl_distribution]}} Trying bar =INFO REPORT==== 29-Jan-2018::17:48:11 === Protocol 'inet_tcp': the name foo@REDACTED seems to be in use by another Erlang node {ok,<0.71.0>} (bar@REDACTED)3> The info message from SASL still pops up, but it isn't crashing anything, just returning the error tuple as expected. I'm not sure what else would be going on in your case. I know there are a few tricky EPMD issues, I just never seem to run into them. -Craig From pablo.platt@REDACTED Mon Jan 29 10:19:19 2018 From: pablo.platt@REDACTED (pablo platt) Date: Mon, 29 Jan 2018 11:19:19 +0200 Subject: [erlang-questions] How to test multi-pollset? In-Reply-To: References: Message-ID: It's great to see all the hard work invested in performance in master. Thanks. On Mon, Jan 29, 2018 at 10:49 AM, Lukas Larsson wrote: > Hello, > > On Mon, Jan 29, 2018 at 9:22 AM, pablo platt > wrote: > >> Hi, >> >> What is the expected effect of the multi-pollset PR [1] on a UDP socket >> on the sender/receiver side? >> My use case is a media server with several broadcaster and many viewers. >> Each stream use 1Mbps (aprox 100 * 1500 bytes packets per second). >> Should I expect improvement when gen_udp is sending packets, receiving >> packets or both? >> > > Yes, I believe that you will see an improvement. It depends on what type > of HW that you are running on, typically the more logical cpu's you have > the more gain you will get from the improvements in I/O polling[1]. Also > the exact usage pattern matters. > > >> Is it reasonable to pick a point in master and use it on a production >> system after testing? >> > > I would take the latest tip of master and test that thoroughly for you > application. The things that we merge into master have gone through all our > testing before it is merged, so it is as stable as the maint branch. > However we make a lot more changes in master than in maint, so because of > that there will be a greater chance of some bug slipping through. > > If you do decide to give the improved I/O polling implementation a go, > please do come back with any negative or positive findings that you get! > > Lukas > > [1]: The largest change in the PR is not actually the ability to use > multiple pollsets, but that the polling has been lifted out to be done by > dedicated threads. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ali.sabil@REDACTED Mon Jan 29 11:43:37 2018 From: ali.sabil@REDACTED (Ali Sabil) Date: Mon, 29 Jan 2018 11:43:37 +0100 Subject: [erlang-questions] erlang ssh and port forwarding In-Reply-To: References: Message-ID: Hi Max, I did the same thing some months ago, and I did dive into the Erlang ssh implementation a bit. I didn't have a need for port forwarding, but as far as I can remember they are not implemented by the ssh application because all `ssh global requests` are denied: https://github.com/erlang/otp/blob/177eab3b67d9840c75d9986cd8870a84414bcacb/lib/ssh/src/ssh_connection.erl#L654 Best, Ali On Sun, Jan 28, 2018 at 9:35 AM, Max Lapshin wrote: > Hi. > > I'm writing ssh proxy in erlang: https://github.com/flussonic/ssh-proxy > > It is required for our support team: engineers need to login to customers > servers but I want to make a revocation of access. > > So this is a proxy that will hide our team private key from whole team > (except me). > > There is a working POC, but I've got a problem: > > port forwarding do not work: > > debug1: Connection to port 9080 forwarding to localhost port 80 requested. > > debug1: channel 3: new [direct-tcpip] > > channel 3: open failed: administratively prohibited: Not allowed > > debug1: channel 3: free: direct-tcpip: listening port 9080 for localhost > port 80, connect from ::1 port 54743 to ::1 port 9080, nchannels 4 > > > Is something not ready in erlang ssh? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans.r.nilsson@REDACTED Mon Jan 29 13:43:24 2018 From: hans.r.nilsson@REDACTED (Hans Nilsson R) Date: Mon, 29 Jan 2018 13:43:24 +0100 Subject: [erlang-questions] erlang ssh and port forwarding In-Reply-To: References: Message-ID: Hi, there was a start of tcp port forwarding, but since it makes me feel uneasy to have unfinished code hanging around in security software I removed it in commit 7efc9c9460baa78dba0bc63e300890df5a97812f Thu Apr 28 16:35:23 2016 +0200 There are currently no plans to implement port-forwarding or X11-forwarding. /Hans On 01/29/2018 11:43 AM, Ali Sabil wrote: > Hi Max, > > I did the same thing some months ago, and I did dive into the Erlang ssh > implementation a bit. > > I didn't have a need for port forwarding, but as far as I can remember they > are not implemented by the ssh application because all `ssh global > requests` are denied: > https://github.com/erlang/otp/blob/177eab3b67d9840c75d9986cd8870a84414bcacb/lib/ssh/src/ssh_connection.erl#L654 > > Best, > Ali > > On Sun, Jan 28, 2018 at 9:35 AM, Max Lapshin wrote: > >> Hi. >> >> I'm writing ssh proxy in erlang: https://github.com/flussonic/ssh-proxy >> >> It is required for our support team: engineers need to login to customers >> servers but I want to make a revocation of access. >> >> So this is a proxy that will hide our team private key from whole team >> (except me). >> >> There is a working POC, but I've got a problem: >> >> port forwarding do not work: >> >> debug1: Connection to port 9080 forwarding to localhost port 80 requested. >> >> debug1: channel 3: new [direct-tcpip] >> >> channel 3: open failed: administratively prohibited: Not allowed >> >> debug1: channel 3: free: direct-tcpip: listening port 9080 for localhost >> port 80, connect from ::1 port 54743 to ::1 port 9080, nchannels 4 >> >> >> Is something not ready in erlang ssh? >> >> _______________________________________________ >> 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: 4101 bytes Desc: S/MIME Cryptographic Signature URL: From arif@REDACTED Mon Jan 29 13:47:22 2018 From: arif@REDACTED (arif@REDACTED) Date: Mon, 29 Jan 2018 04:47:22 -0800 Subject: [erlang-questions] net_kernel:start() "the name seems to be in use by another Erlang node" Message-ID: Hi, 1. if you use longnames, you must _use_ a long name 2. epmd must be running Eshell V9.2 (abort with ^G) 1> net_kernel:start([foo,longnames]). =INFO REPORT==== 29-Jan-2018::12:11:46 === Can't set long node name! Please check your configuration {error, {{shutdown, {failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}, {child,undefined,net_sup_dynamic, {erl_distribution,start_link,[[foo,longnames],false]}, permanent,1000,supervisor, [erl_distribution]}}} 2> net_kernel:start(['foo@REDACTED',longnames]). =INFO REPORT==== 29-Jan-2018::12:12:07 === Protocol 'inet_tcp': register/listen error: econnrefused {error, {{shutdown, {failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}, {child,undefined,net_sup_dynamic, {erl_distribution,start_link, [['foo@REDACTED',longnames],false]}, permanent,1000,supervisor, [erl_distribution]}}} >From epmd documentation: The daemon is started automatically by command erl(1) if the node is to be distributed and no running instance is present. Since we didn?t start the node so, it's not auotmatic. In fact me@REDACTED ~ $ ps -ef | grep epmd me 2439 2422 0 12:12 pts/2 00:00:00 grep --colour=auto epmd If you start a node with distribution, and kill it immediately, epmd will have started: me@REDACTED ~ $ erl -sname foo Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.2 (abort with ^G) (foo@REDACTED)1> (foo@REDACTED)1> User switch command --> q me@REDACTED ~ $ ps -ef | grep epmd me 2454 1521 0 12:19 ? 00:00:00 /usr/local/lib/erlang/erts-9.2/bin/epmd -daemon me 2524 2422 0 12:20 pts/2 00:00:00 grep --colour=auto epmd me@REDACTED ~ $ So now you can attempt starting the node again: 3> net_kernel:start(['foo@REDACTED',longnames]). {ok,<0.73.0>} (foo@REDACTED)4> Also, net_kernel:start/1 does not return {already_started, pid()}, but {error, Reason} and Reason _could_ be {already_started, pid()}. If you now try to start another node in the same way with the same name, you will get the error you are getting: 1> net_kernel:start(['foo@REDACTED',longnames]). =INFO REPORT==== 29-Jan-2018::13:45:13 === Protocol 'inet_tcp': the name foo@REDACTED seems to be in use by another Erlang node {error, {{shutdown, {failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}, {child,undefined,net_sup_dynamic, {erl_distribution,start_link, [['foo@REDACTED',longnames],false]}, permanent,1000,supervisor, [erl_distribution]}}} 2> BR/Arif Date: Mon, 29 Jan 2018 17:57:09 +0900 From: zxq9@REDACTED To: erlang-questions@REDACTED Subject: Re: [erlang-questions] net_kernel:start() "the name seems to be in use by another Erlang node" Message-ID: <28099967.CzVN9HJnuF@REDACTED> Content-Type: text/plain; charset="UTF-8" On 2018?1?28???? 15?51?07? JST Mark Sebald wrote: > I am using "net_kernel:start()", to start multiple nodes of the same > application, on the same host. Each time I start a node, I don't know > how many other nodes were already started, so my thinking was to add > an index number to the node name, and if start() returns: "{already_started, pid()}" > I will increment the index on the node name, and call start() again. > > Instead, when I try to start a second node of the same name I get this: > > 14:14:29.425 [info] Protocol 'inet_tcp': the name my_node01@REDACTED > seems to be in use by another Erlang node > 14:14:29.425 [error] CRASH REPORT Process <0.109.0> with 0 neighbours > exited with reason: {error,badarg} in gen_server:init_it/6 line 349 > > and an error tuple is returned > > This seems like an Erlang bug, since the info log message indicates > that the situation is well in hand, but then we get a crash. Is there > a better way to start multiple nodes? Are there any conditions where > start() will return "already_started"? I've not messed with this in a while, but I do recall being able to do dynamic start names like this. I don't have a sample of the code that did it for me, though. In the shell, however, the following worked. Node 1: Eshell V9.2 (abort with ^G) 1> net_kernel:start([foo, longnames]). {ok,<0.66.0>} (foo@REDACTED)2> Node 2: Eshell V9.2 (abort with ^G) 1> Start = 1> fun(Name1, Name2) -> 1> case net_kernel:start([Name1, longnames]) of 1> {ok, Pid} -> 1> {ok, Pid}; 1> {error, Reason} -> 1> ok = io:format("Failed with ~tp~nTrying ~tp~n", [Reason, Name2]), 1> net_kernel:start([Name2, longnames]) 1> end 1> end. #Fun 2> Start(foo, bar). Failed with {{shutdown, {failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}, {child,undefined,net_sup_dynamic, {erl_distribution,start_link,[[foo,longnames],false]}, permanent,1000,supervisor, [erl_distribution]}} Trying bar =INFO REPORT==== 29-Jan-2018::17:48:11 === Protocol 'inet_tcp': the name foo@REDACTED seems to be in use by another Erlang node {ok,<0.71.0>} (bar@REDACTED)3> The info message from SASL still pops up, but it isn't crashing anything, just returning the error tuple as expected. I'm not sure what else would be going on in your case. I know there are a few tricky EPMD issues, I just never seem to run into them. -Craig From arif@REDACTED Mon Jan 29 13:52:07 2018 From: arif@REDACTED (arif@REDACTED) Date: Mon, 29 Jan 2018 04:52:07 -0800 Subject: [erlang-questions] net_kernel:start() "the name seems to be in use by another Erlang node" In-Reply-To: References: Message-ID: <40ba5a44c48643be0cc14c2ca2754ef1@riseup.net> Sorry, I forgot to add that you will get the error {already_started, pid()} if you try to start the node from the already started node: (foo@REDACTED)4> net_kernel:start(['foo@REDACTED',longnames]). {error,{already_started,<0.73.0>}} (foo@REDACTED)5> BR/Arif On 2018-01-29 13:47, arif@REDACTED wrote: > Hi, > > 1. if you use longnames, you must _use_ a long name > 2. epmd must be running > > Eshell V9.2 (abort with ^G) > 1> net_kernel:start([foo,longnames]). > > =INFO REPORT==== 29-Jan-2018::12:11:46 === > Can't set long node name! > Please check your configuration > {error, > {{shutdown, > {failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}, > {child,undefined,net_sup_dynamic, > {erl_distribution,start_link,[[foo,longnames],false]}, > permanent,1000,supervisor, > [erl_distribution]}}} > 2> net_kernel:start(['foo@REDACTED',longnames]). > > =INFO REPORT==== 29-Jan-2018::12:12:07 === > Protocol 'inet_tcp': register/listen error: econnrefused > {error, > {{shutdown, > {failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}, > {child,undefined,net_sup_dynamic, > {erl_distribution,start_link, > [['foo@REDACTED',longnames],false]}, > permanent,1000,supervisor, > [erl_distribution]}}} > > From epmd documentation: > The daemon is started automatically by command erl(1) if the node is to > be distributed and no running instance is present. > > Since we didn?t start the node so, it's not auotmatic. In fact > me@REDACTED ~ $ ps -ef | grep epmd > me 2439 2422 0 12:12 pts/2 00:00:00 grep --colour=auto epmd > > If you start a node with distribution, and kill it immediately, epmd > will have started: > me@REDACTED ~ $ erl -sname foo > Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.2 (abort with ^G) > (foo@REDACTED)1> > (foo@REDACTED)1> > User switch command > --> q > me@REDACTED ~ $ ps -ef | grep epmd > me 2454 1521 0 12:19 ? 00:00:00 > /usr/local/lib/erlang/erts-9.2/bin/epmd -daemon > me 2524 2422 0 12:20 pts/2 00:00:00 grep --colour=auto epmd > me@REDACTED ~ $ > > So now you can attempt starting the node again: > 3> net_kernel:start(['foo@REDACTED',longnames]). > {ok,<0.73.0>} > (foo@REDACTED)4> > > Also, net_kernel:start/1 does not return {already_started, pid()}, but > {error, Reason} and Reason _could_ be {already_started, pid()}. > > If you now try to start another node in the same way with the same name, > you will get the error you are getting: > > 1> net_kernel:start(['foo@REDACTED',longnames]). > > =INFO REPORT==== 29-Jan-2018::13:45:13 === > Protocol 'inet_tcp': the name foo@REDACTED seems to be in use by > another Erlang node > {error, > {{shutdown, > {failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}, > {child,undefined,net_sup_dynamic, > {erl_distribution,start_link, > [['foo@REDACTED',longnames],false]}, > permanent,1000,supervisor, > [erl_distribution]}}} > 2> > > BR/Arif > > > > Date: Mon, 29 Jan 2018 17:57:09 +0900 > From: zxq9@REDACTED > To: erlang-questions@REDACTED > Subject: Re: [erlang-questions] net_kernel:start() "the name seems to > be in use by another Erlang node" > Message-ID: <28099967.CzVN9HJnuF@REDACTED> > Content-Type: text/plain; charset="UTF-8" > > On 2018?1?28???? 15?51?07? JST Mark Sebald wrote: >> I am using "net_kernel:start()", to start multiple nodes of the same >> application, on the same host. Each time I start a node, I don't know >> how many other nodes were already started, so my thinking was to add >> an index number to the node name, and if start() returns: "{already_started, pid()}" >> I will increment the index on the node name, and call start() again. >> >> Instead, when I try to start a second node of the same name I get this: >> >> 14:14:29.425 [info] Protocol 'inet_tcp': the name my_node01@REDACTED >> seems to be in use by another Erlang node >> 14:14:29.425 [error] CRASH REPORT Process <0.109.0> with 0 neighbours >> exited with reason: {error,badarg} in gen_server:init_it/6 line 349 >> >> and an error tuple is returned >> >> This seems like an Erlang bug, since the info log message indicates >> that the situation is well in hand, but then we get a crash. Is there >> a better way to start multiple nodes? Are there any conditions where >> start() will return "already_started"? > > I've not messed with this in a while, but I do recall being able to do > dynamic start names like this. I don't have a sample of the code that > did it for me, though. > > In the shell, however, the following worked. > > Node 1: > > Eshell V9.2 (abort with ^G) > 1> net_kernel:start([foo, longnames]). > {ok,<0.66.0>} > (foo@REDACTED)2> > > > Node 2: > > Eshell V9.2 (abort with ^G) > 1> Start = > 1> fun(Name1, Name2) -> > 1> case net_kernel:start([Name1, longnames]) of > 1> {ok, Pid} -> > 1> {ok, Pid}; > 1> {error, Reason} -> > 1> ok = io:format("Failed with ~tp~nTrying ~tp~n", [Reason, > Name2]), > 1> net_kernel:start([Name2, longnames]) > 1> end > 1> end. > #Fun > 2> Start(foo, bar). > Failed with {{shutdown, > > {failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}, > {child,undefined,net_sup_dynamic, > > {erl_distribution,start_link,[[foo,longnames],false]}, > permanent,1000,supervisor, > [erl_distribution]}} > Trying bar > > =INFO REPORT==== 29-Jan-2018::17:48:11 === > Protocol 'inet_tcp': the name foo@REDACTED seems to > be in use by another Erlang node > {ok,<0.71.0>} > (bar@REDACTED)3> > > > The info message from SASL still pops up, but it isn't crashing > anything, just returning the error tuple as expected. I'm not sure what > else would be going on in your case. I know there are a few tricky EPMD > issues, I just never seem to run into them. > > -Craig From max.lapshin@REDACTED Mon Jan 29 15:55:43 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 29 Jan 2018 17:55:43 +0300 Subject: [erlang-questions] erlang ssh and port forwarding In-Reply-To: References: Message-ID: Hi, Hans. Yes, found this commit. Perhaps it is possible to return it as a pluggable thing? Port forwarding is a very important thing for such a daemon. Would you accept a pull request that makes possible it via some behaviour in daemon options? -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Mon Jan 29 16:02:07 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 29 Jan 2018 18:02:07 +0300 Subject: [erlang-questions] erlang ssh and port forwarding In-Reply-To: References: Message-ID: -handle_msg(#ssh_msg_channel_open{channel_type = "forwarded-tcpip" = Type, - sender_channel = RemoteId, - initial_window_size = RWindowSz, - maximum_packet_size = RPacketSz, I see in this commit forwarded-tcpip, but do not see here direct-tcpip. Have you implemented it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From francesco@REDACTED Mon Jan 29 16:57:18 2018 From: francesco@REDACTED (Francesco Cesarini) Date: Mon, 29 Jan 2018 15:57:18 +0000 Subject: [erlang-questions] OSCON Call for Talks & Tutorials: Deadline Jan 30th Message-ID: <066518af-102a-d9d9-58b7-8c2d03aff394@erlang-solutions.com> Hi, a reminder that the deadline to submit your talks to OSCON, the Open Source Convention in Portland, OR, is midnight (PST) January 30th: https://conferences.oreilly.com/oscon/oscon-or/public/cfp/615 This will be OSCON's 20th anniversary, coinciding with Erlang's 20th anniversary of it being open sourced. As always, we want a strong Erlang and Elixir presence at the conference. Consider submitting talks and tutorials. If you have any questions about it, feel free to reach out to me (I am on the program committee). There are also lots of ideas you can tap into on their website. Hope to see you there! Francesco From max.lapshin@REDACTED Mon Jan 29 20:27:23 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 29 Jan 2018 22:27:23 +0300 Subject: [erlang-questions] uses cases for limiting schedulers or threads? In-Reply-To: References: Message-ID: There is another thing. If you are running moderately busy erlang node and periodically launch something like updatedb that consumes whole core, then it may be a good idea to leave 1-2 cores out of erlang usage. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.des.courtis@REDACTED Mon Jan 29 21:15:16 2018 From: eric.des.courtis@REDACTED (Eric des Courtis) Date: Mon, 29 Jan 2018 15:15:16 -0500 Subject: [erlang-questions] erlang ssh and port forwarding In-Reply-To: References: Message-ID: I need this functionality also. Please consider having a way to plug this functionality back in. Eric On Mon, Jan 29, 2018 at 10:02 AM, Max Lapshin wrote: > -handle_msg(#ssh_msg_channel_open{channel_type = "forwarded-tcpip" = Type, > > - sender_channel = RemoteId, > > - initial_window_size = RWindowSz, > > - maximum_packet_size = RPacketSz, > > I see in this commit forwarded-tcpip, but do not see here direct-tcpip. > Have you implemented it? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans.r.nilsson@REDACTED Tue Jan 30 11:43:43 2018 From: hans.r.nilsson@REDACTED (Hans Nilsson R) Date: Tue, 30 Jan 2018 11:43:43 +0100 Subject: [erlang-questions] erlang ssh and port forwarding In-Reply-To: References: Message-ID: I don't know any implementation of direct-tcpip. And pull requests are always welcome! But as usual, remember doc and test(s)... Making it pluggable would be excellent. I have not studied the implemntation I removed with that in mind, but if it could be done as a subsystem like sftp it would be great. /Hans > Perhaps it is possible to return it as a pluggable thing? > Port forwarding is a very important thing for such a daemon. Would you > accept a pull request that makes possible it via some behaviour in daemon > options? On 01/29/2018 09:15 PM, Eric des Courtis wrote: > I need this functionality also. Please consider having a way to plug this > functionality back in. > > Eric > > On Mon, Jan 29, 2018 at 10:02 AM, Max Lapshin wrote: > >> -handle_msg(#ssh_msg_channel_open{channel_type = "forwarded-tcpip" = Type, >> >> - sender_channel = RemoteId, >> >> - initial_window_size = RWindowSz, >> >> - maximum_packet_size = RPacketSz, >> >> I see in this commit forwarded-tcpip, but do not see here direct-tcpip. >> Have you implemented it? >> >> _______________________________________________ >> 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: 4101 bytes Desc: S/MIME Cryptographic Signature URL: From bchesneau@REDACTED Wed Jan 31 09:08:51 2018 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 31 Jan 2018 09:08:51 +0100 Subject: [erlang-questions] looking for an imap server/client lib Message-ID: <1E4920AA-5463-41DB-A95F-22A078B19FAA@gmail.com> Hi, For a toy project I'm looking for a lib that would allows me to build an imap server in *Erlang* independently of its storage layer, ie. being able to react to IMAP commands and return the content needed from them. DO you hav any lib to advise ? I've found: eimap: https://github.com/altenwald/eimap , client guam: https://git.kolab.org/diffusion/G/guam.git not sur what it does diemap: https://github.com/Vagabond/diemap unmaintained,"Initial import - doesn't really work at all yet " erlimap: https://github.com/boorad/erlimap unmaintained, "work in progress..." switchboard: http://switchboard.spatch.co has a client inside, unmaintained? Is there anything I missed? - beno?t -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew@REDACTED Wed Jan 31 18:58:34 2018 From: andrew@REDACTED (Andrew Thompson) Date: Wed, 31 Jan 2018 12:58:34 -0500 Subject: [erlang-questions] looking for an imap server/client lib In-Reply-To: <1E4920AA-5463-41DB-A95F-22A078B19FAA@gmail.com> References: <1E4920AA-5463-41DB-A95F-22A078B19FAA@gmail.com> Message-ID: <20180131175833.GG59418@thecloud.hijacked.us> On Wed, Jan 31, 2018 at 09:08:51AM +0100, Benoit Chesneau wrote: > Hi, > > For a toy project I'm looking for a lib that would allows me to build an imap server in *Erlang* independently of its storage layer, ie. being able to react to IMAP commands and return the content needed from them. DO you hav any lib to advise ? > > > I've found: > > eimap: https://github.com/altenwald/eimap , client > guam: https://git.kolab.org/diffusion/G/guam.git not sur what it does > diemap: https://github.com/Vagabond/diemap unmaintained,"Initial import - doesn't really work at all yet " > erlimap: https://github.com/boorad/erlimap unmaintained, "work in progress..." > switchboard: http://switchboard.spatch.co has a client inside, unmaintained? > > Is there anything I missed? > > - beno?t I actually got pretty far with diemap, it was pretty usable to *read* email in mutt/alpine/thunderbird/apple mail. Unforunately IMAP is an incredibly complicated protocol, and the spec is vague or misleading in several crucial places and there's a wide variety of incompatabilities between various clients and servers. I mostly gave up on diemap because it was a hobby project that just needed too much time to finish. I'm confident I could have finished it had I had an actual usecase that allowed me to devote enough time to it. Not that any of this helps you, just trying to provide some context. Andrew