From veerareddy@REDACTED Mon Oct 1 05:24:58 2018 From: veerareddy@REDACTED (Krishna Sai Veera Reddy) Date: Sun, 30 Sep 2018 20:24:58 -0700 Subject: [erlang-questions] Opening files in O_TRUNC mode Message-ID: Is it possible to open files in O_TRUNC mode in erlang using the `file` module? If not, is this something we want added to the standard library? Thanks, Krishna -------------- next part -------------- An HTML attachment was scrubbed... URL: From noah@REDACTED Mon Oct 1 06:52:03 2018 From: noah@REDACTED (Noah Silverman) Date: Mon, 01 Oct 2018 04:52:03 +0000 Subject: [erlang-questions] State in Cowboy Websockets Message-ID: <3lpyHhIdmKkxk1j7WmzXM4RxT3Jz6V_5aOMVlCvunmaWSCLGrqiBzppo9D-iEPmzNO_GWXSX7VmMmyJL2psJtf1aI-XhYPxkFbL0alj9f6I=@helios.ai> Hello, I've written a fairly standard websocket handler using Cowboy 2.4.? It correctly accepts websockts, and handles messages in both directions.? Cowboy's built in functionality makes this simple. However, I can't find a way to store any state for a websocket connection.? Cowboy creates a separate PID for each connection, so theoretically we should be able to have each PID keep state (like any other erlang process or gen_server.) I'd like users to be able to do things like authenticate, set preferences, etc. for a websocket connection.? the easiest way to handle this would be to simply save a few variable sin state, as we do in any other gen_server process.? The Cowboy Websocket handler *does* have a state variable that gets passed through calls, HOWEVER there is no way to define the state record like we'd do with other gen_server processes.? I tried simply adding the record definition to the top of the handler file (standard workflow for gen_server), but Cowboy then crashes with an undefined record error when I try to use the state record. Does anybody have any ideas on haw to handle this, or a potential solutions? Thank You! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: publickey - noah@REDACTED - 0xBCEFA873.asc Type: application/pgp-keys Size: 3136 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 855 bytes Desc: OpenPGP digital signature URL: From essen@REDACTED Mon Oct 1 07:48:01 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 1 Oct 2018 07:48:01 +0200 Subject: [erlang-questions] State in Cowboy Websockets In-Reply-To: <3lpyHhIdmKkxk1j7WmzXM4RxT3Jz6V_5aOMVlCvunmaWSCLGrqiBzppo9D-iEPmzNO_GWXSX7VmMmyJL2psJtf1aI-XhYPxkFbL0alj9f6I=@helios.ai> References: <3lpyHhIdmKkxk1j7WmzXM4RxT3Jz6V_5aOMVlCvunmaWSCLGrqiBzppo9D-iEPmzNO_GWXSX7VmMmyJL2psJtf1aI-XhYPxkFbL0alj9f6I=@helios.ai> Message-ID: <38010026-314b-2f6e-a3c6-ac0b0615f0a8@ninenines.eu> Hello, Without seeing your code I have no idea why you think you can't use a record for the state. Just do: init(Req, _) -> {cowboy_websocket, Req, #state{}}. On 10/01/2018 06:52 AM, Noah Silverman wrote: > Hello, > > I've written a fairly standard websocket handler using Cowboy 2.4.? It > correctly accepts websockts, and handles messages in both directions. > Cowboy's built in functionality makes this simple. > > However, I can't find a way to store any state for a websocket > connection.? Cowboy creates a separate PID for each connection, so > theoretically we should be able to have each PID keep state (like any > other erlang process or gen_server.) I'd like users to be able to do > things like authenticate, set preferences, etc. for a websocket > connection.? the easiest way to handle this would be to simply save a > few variable sin state, as we do in any other gen_server process. > > The Cowboy Websocket handler *does* have a state variable that gets > passed through calls, HOWEVER there is no way to define the state record > like we'd do with other gen_server processes.? I tried simply adding the > record definition to the top of the handler file (standard workflow for > gen_server), but Cowboy then crashes with an undefined record error when > I try to use the state record. > > Does anybody have any ideas on haw to handle this, or a potential solutions? > > Thank You! > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin https://ninenines.eu From cean.ebengt@REDACTED Mon Oct 1 08:25:12 2018 From: cean.ebengt@REDACTED (bengt) Date: Mon, 1 Oct 2018 08:25:12 +0200 Subject: [erlang-questions] Opening files in O_TRUNC mode In-Reply-To: References: Message-ID: Greetings, file:open/2 documentation has this to say about Modes. Does it cover what you want to do? write The file is opened for writing. It is created if it does not exist. If the file exists and write is not combined with read, the file is truncated. > On 1 Oct 2018, at 05:24, Krishna Sai Veera Reddy wrote: > > Is it possible to open files in O_TRUNC mode in erlang using the `file` module? If not, is this something we want added to the standard library? > > Thanks, > Krishna > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From noah@REDACTED Mon Oct 1 08:25:36 2018 From: noah@REDACTED (Noah Silverman) Date: Mon, 01 Oct 2018 06:25:36 +0000 Subject: [erlang-questions] State in Cowboy Websockets In-Reply-To: <38010026-314b-2f6e-a3c6-ac0b0615f0a8@ninenines.eu> References: <3lpyHhIdmKkxk1j7WmzXM4RxT3Jz6V_5aOMVlCvunmaWSCLGrqiBzppo9D-iEPmzNO_GWXSX7VmMmyJL2psJtf1aI-XhYPxkFbL0alj9f6I=@helios.ai> <38010026-314b-2f6e-a3c6-ac0b0615f0a8@ninenines.eu> Message-ID: <3_3TewENb2KOMlTy13OLg-3y_5kRvCabyRMtg2oMM7qJ3Z4y84eBF6TXb29O1fPNpn0ZQeY25Ee9fH1qYM_VJgNBaQlJTA4E_5u5QmlncjY=@helios.ai> Here's a relevant snippet of code. I'm attempting to store the IP of the request in the State. One guess is that the problem arises because I'm attempting to use the State variable passed into init. =============== -record(state,{ ip }). init(Req0, State) -> {IP,_Port} = maps:get(peer,Req0, {0,0}), Opts = #{idle_timeout => 600000, max_frame_size => 256}, {cowboy_websocket, Req0, State#state{ip=IP}, Opts}. =============== ??????? Original Message ??????? On Monday, October 1, 2018 1:48 PM, Lo?c Hoguin wrote: > Hello, > > Without seeing your code I have no idea why you think you can't use a > record for the state. > > Just do: > > init(Req, _) -> > > {cowboy_websocket, Req, #state{}}. > > > On 10/01/2018 06:52 AM, Noah Silverman wrote: > > > Hello, > > I've written a fairly standard websocket handler using Cowboy 2.4.? It > > correctly accepts websockts, and handles messages in both directions. > > Cowboy's built in functionality makes this simple. > > However, I can't find a way to store any state for a websocket > > connection.? Cowboy creates a separate PID for each connection, so > > theoretically we should be able to have each PID keep state (like any > > other erlang process or gen_server.) I'd like users to be able to do > > things like authenticate, set preferences, etc. for a websocket > > connection.? the easiest way to handle this would be to simply save a > > few variable sin state, as we do in any other gen_server process. > > The Cowboy Websocket handler does have a state variable that gets > > passed through calls, HOWEVER there is no way to define the state record > > like we'd do with other gen_server processes.? I tried simply adding the > > record definition to the top of the handler file (standard workflow for > > gen_server), but Cowboy then crashes with an undefined record error when > > I try to use the state record. > > Does anybody have any ideas on haw to handle this, or a potential solutions? > > Thank You! > > > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -- > > Lo?c Hoguin > https://ninenines.eu -------------- next part -------------- A non-text attachment was scrubbed... Name: publickey - noah@REDACTED - 0xBCEFA873.asc Type: application/pgp-keys Size: 3136 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 855 bytes Desc: OpenPGP digital signature URL: From essen@REDACTED Mon Oct 1 08:34:51 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 1 Oct 2018 08:34:51 +0200 Subject: [erlang-questions] State in Cowboy Websockets In-Reply-To: <3_3TewENb2KOMlTy13OLg-3y_5kRvCabyRMtg2oMM7qJ3Z4y84eBF6TXb29O1fPNpn0ZQeY25Ee9fH1qYM_VJgNBaQlJTA4E_5u5QmlncjY=@helios.ai> References: <3lpyHhIdmKkxk1j7WmzXM4RxT3Jz6V_5aOMVlCvunmaWSCLGrqiBzppo9D-iEPmzNO_GWXSX7VmMmyJL2psJtf1aI-XhYPxkFbL0alj9f6I=@helios.ai> <38010026-314b-2f6e-a3c6-ac0b0615f0a8@ninenines.eu> <3_3TewENb2KOMlTy13OLg-3y_5kRvCabyRMtg2oMM7qJ3Z4y84eBF6TXb29O1fPNpn0ZQeY25Ee9fH1qYM_VJgNBaQlJTA4E_5u5QmlncjY=@helios.ai> Message-ID: Your guess is correct. The initial state is whatever you configured in routing, so if it's not a #state{} it's not going to work. On 10/01/2018 08:25 AM, Noah Silverman wrote: > Here's a relevant snippet of code. I'm attempting to store the IP of the request in the State. One guess is that the problem arises because I'm attempting to use the State variable passed into init. > > =============== > > -record(state,{ > ip > }). > > init(Req0, State) -> > {IP,_Port} = maps:get(peer,Req0, {0,0}), > > Opts = #{idle_timeout => 600000, max_frame_size => 256}, > > {cowboy_websocket, Req0, State#state{ip=IP}, Opts}. > > > =============== > > > ??????? Original Message ??????? > On Monday, October 1, 2018 1:48 PM, Lo?c Hoguin wrote: > >> Hello, >> > >> Without seeing your code I have no idea why you think you can't use a >> record for the state. >> > >> Just do: >> > >> init(Req, _) -> >> > >> {cowboy_websocket, Req, #state{}}. >> > >> > >> On 10/01/2018 06:52 AM, Noah Silverman wrote: >> > >>> Hello, >>> I've written a fairly standard websocket handler using Cowboy 2.4.? It >>> correctly accepts websockts, and handles messages in both directions. >>> Cowboy's built in functionality makes this simple. >>> However, I can't find a way to store any state for a websocket >>> connection.? Cowboy creates a separate PID for each connection, so >>> theoretically we should be able to have each PID keep state (like any >>> other erlang process or gen_server.) I'd like users to be able to do >>> things like authenticate, set preferences, etc. for a websocket >>> connection.? the easiest way to handle this would be to simply save a >>> few variable sin state, as we do in any other gen_server process. >>> The Cowboy Websocket handler does have a state variable that gets >>> passed through calls, HOWEVER there is no way to define the state record >>> like we'd do with other gen_server processes.? I tried simply adding the >>> record definition to the top of the handler file (standard workflow for >>> gen_server), but Cowboy then crashes with an undefined record error when >>> I try to use the state record. >>> Does anybody have any ideas on haw to handle this, or a potential solutions? >>> Thank You! >>> > >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> > >> -- >> > >> Lo?c Hoguin >> https://ninenines.eu > -- Lo?c Hoguin https://ninenines.eu From noah@REDACTED Mon Oct 1 08:49:05 2018 From: noah@REDACTED (Noah Silverman) Date: Mon, 01 Oct 2018 06:49:05 +0000 Subject: [erlang-questions] State in Cowboy Websockets In-Reply-To: References: <3lpyHhIdmKkxk1j7WmzXM4RxT3Jz6V_5aOMVlCvunmaWSCLGrqiBzppo9D-iEPmzNO_GWXSX7VmMmyJL2psJtf1aI-XhYPxkFbL0alj9f6I=@helios.ai> <38010026-314b-2f6e-a3c6-ac0b0615f0a8@ninenines.eu> <3_3TewENb2KOMlTy13OLg-3y_5kRvCabyRMtg2oMM7qJ3Z4y84eBF6TXb29O1fPNpn0ZQeY25Ee9fH1qYM_VJgNBaQlJTA4E_5u5QmlncjY=@helios.ai> Message-ID: <_Z544cZgs-nK7oMTWSU86QJ-IiLOCVCXQR0a3SBnmVwG__jS6TCo3Dm76LeHXQ6hTeFCAlQ8B9xCynK74w3gYtXuUR4ulSMfBd2Kgu0E7I4=@helios.ai> Ahhh, that makes perfect sense. It works! Thank you!!! ??????? Original Message ??????? On Monday, October 1, 2018 2:34 PM, Lo?c Hoguin wrote: > Your guess is correct. The initial state is whatever you configured in > routing, so if it's not a #state{} it's not going to work. > > On 10/01/2018 08:25 AM, Noah Silverman wrote: > > > Here's a relevant snippet of code. I'm attempting to store the IP of the request in the State. One guess is that the problem arises because I'm attempting to use the State variable passed into init. > > =============== > > -record(state,{ > > ip > > }). > > init(Req0, State) -> > > {IP,_Port} = maps:get(peer,Req0, {0,0}), > > > > Opts = #{idle_timeout => 600000, max_frame_size => 256}, > > > > {cowboy_websocket, Req0, State#state{ip=IP}, Opts}. > > > > > > =============== > > ??????? Original Message ??????? > > On Monday, October 1, 2018 1:48 PM, Lo?c Hoguin essen@REDACTED wrote: > > > > > Hello, > > > > > Without seeing your code I have no idea why you think you can't use a > > > record for the state. > > > > > Just do: > > > > > init(Req, _) -> > > > > > {cowboy_websocket, Req, #state{}}. > > > > > > > > > > > > > On 10/01/2018 06:52 AM, Noah Silverman wrote: > > > > > > Hello, > > > > I've written a fairly standard websocket handler using Cowboy 2.4.? It > > > > correctly accepts websockts, and handles messages in both directions. > > > > Cowboy's built in functionality makes this simple. > > > > However, I can't find a way to store any state for a websocket > > > > connection.? Cowboy creates a separate PID for each connection, so > > > > theoretically we should be able to have each PID keep state (like any > > > > other erlang process or gen_server.) I'd like users to be able to do > > > > things like authenticate, set preferences, etc. for a websocket > > > > connection.? the easiest way to handle this would be to simply save a > > > > few variable sin state, as we do in any other gen_server process. > > > > The Cowboy Websocket handler does have a state variable that gets > > > > passed through calls, HOWEVER there is no way to define the state record > > > > like we'd do with other gen_server processes.? I tried simply adding the > > > > record definition to the top of the handler file (standard workflow for > > > > gen_server), but Cowboy then crashes with an undefined record error when > > > > I try to use the state record. > > > > Does anybody have any ideas on haw to handle this, or a potential solutions? > > > > Thank You! > > > > > > erlang-questions mailing list > > > > erlang-questions@REDACTED > > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -- > > > > > Lo?c Hoguin > > > https://ninenines.eu > > -- > > Lo?c Hoguin > https://ninenines.eu -------------- next part -------------- A non-text attachment was scrubbed... Name: publickey - noah@REDACTED - 0xBCEFA873.asc Type: application/pgp-keys Size: 3136 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 855 bytes Desc: OpenPGP digital signature URL: From ben.browitt@REDACTED Mon Oct 1 10:27:54 2018 From: ben.browitt@REDACTED (Ben Browitt) Date: Mon, 1 Oct 2018 11:27:54 +0300 Subject: [erlang-questions] use_srtp extension for DTLS Message-ID: DTLS is missing the use_srtp extension required for DTLS-SRTP [1]. What's the best way to add it? We need to encode the extension in ssl_handshake.erl encode_hello_extensions([use_srtp | Rest], Acc) -> ExtData = <<0,2,0,1,0>>, Len = byte_size(ExtData), encode_hello_extensions(Rest, <>). https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L657 Define USE_SRTP_EXT in ssl_handshake.hrl -define(USE_SRTP_EXT, 14). Add use_srtp to the hello_extensions record: https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.hrl#L100 Add use_srtp to hello_extensions_list https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L1826 Add use_srtp to client_hello_extensions https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L968 Add use_srtp to the #ssl_options record https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_internal.hrl#L111 [1] https://tools.ietf.org/html/rfc5764#section-4.1 Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc@REDACTED Mon Oct 1 16:59:06 2018 From: marc@REDACTED (Marc Worrell) Date: Mon, 1 Oct 2018 16:59:06 +0200 Subject: [erlang-questions] [ANN] Zotonic release 0.41 Message-ID: <84DB35E3-C420-4632-B952-4AE455D58F02@worrell.nl> Zotonic is the Erlang Content Management System and Framework. We have released Zotonic version 0.41. This is a maintenance release. Main changes are: ? Upgraded jquery from 1.11.1 to 3.3.1 (:issue:1922). ? Added livereload to mod_development (enable via /admin/development). ? Fix a problem with default date handlng in resource updates (:issue:1885). ? mod_mailinglist now uses mod_email_status for bounce checks. ? Option to merge language versions when merging resources ? Controller option to use user_id as the default controller id jQuery upgrade note: Please note that if you manually include jquery-migrate in your templates, you will have to change your templates manually because jquery-migrate is also upgraded from jquery-migrate-1.2.1 to jquery-migrate-1.4.1. See the full release notes at http://docs.zotonic.com/en/latest/developer-guide/releasenotes/rel_0.41.0.html Kind regards, Marc Worrell and the Zotonic core team. -------------- next part -------------- An HTML attachment was scrubbed... URL: From veerareddy@REDACTED Mon Oct 1 22:48:24 2018 From: veerareddy@REDACTED (Krishna Sai Veera Reddy) Date: Mon, 1 Oct 2018 13:48:24 -0700 Subject: [erlang-questions] Opening files in O_TRUNC mode Message-ID: Hello, Opening file in `write` only mode seems to truncate the file but for whatever reason when `append` mode is also used the file doesn't truncate. Was this intentional? Regards, Krishna -------------- next part -------------- An HTML attachment was scrubbed... URL: From xrobledo@REDACTED Wed Oct 3 23:34:45 2018 From: xrobledo@REDACTED (Xavier Robledo) Date: Wed, 3 Oct 2018 16:34:45 -0500 Subject: [erlang-questions] Problem in Erlang 21.0 and 21.1. Is this already known? Message-ID: Hello I've run into a problem with this code: inets:start(), ssl:start(), httpc:request(post, {"https://sandbox.itunes.apple.com/verifyReceipt", [], "application/json", []}, [], []). It returns the following error in the terminal: =INFO REPORT==== 3-Oct-2018::16:26:14.278110 === TLS client: In state hello received SERVER ALERT: Fatal - Handshake Failure {error,{failed_connect,[{to_address,{"sandbox.itunes.apple.com", 443}}, {inet,[inet],{tls_alert,"handshake failure"}}]}} Does anyone know if this is a known issue? From cean.ebengt@REDACTED Thu Oct 4 08:50:19 2018 From: cean.ebengt@REDACTED (bengt) Date: Thu, 4 Oct 2018 08:50:19 +0200 Subject: [erlang-questions] Opening files in O_TRUNC mode In-Reply-To: References: Message-ID: Speaking only for myself, and not even a native english speaker, I think that ?append? implies something that you want to put things after. If you truncate there is nothing to put things after. So one of them has to be ??wrong??. Maybe the person that wrote the software tossed a coin? bengt > On 1 Oct 2018, at 22:48, Krishna Sai Veera Reddy wrote: > > Hello, > > Opening file in `write` only mode seems to truncate the file but for whatever reason when `append` mode is also used the file doesn't truncate. Was this intentional? > > Regards, > Krishna > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From antoine.koener@REDACTED Thu Oct 4 09:08:46 2018 From: antoine.koener@REDACTED (Antoine Koener) Date: Thu, 4 Oct 2018 09:08:46 +0200 Subject: [erlang-questions] Problem in Erlang 21.0 and 21.1. Is this already known? In-Reply-To: References: Message-ID: May be some hints: https://www.ssllabs.com/ssltest/analyze.html?d=sandbox.itunes.apple.com reveals interesting thing inside the "handshake simulations" part of the report: Apple ATS 9 / iOS 9 R Server sent fatal alert: handshake_failure And looking at various warning from the same report I would say that you are dealing with some "not so" rfc compliant business :-) On Thu, Oct 4, 2018 at 5:42 AM Xavier Robledo wrote: > Hello I've run into a problem with this code: > inets:start(), ssl:start(), httpc:request(post, > {"https://sandbox.itunes.apple.com/verifyReceipt", [], > "application/json", []}, [], []). > > It returns the following error in the terminal: > > =INFO REPORT==== 3-Oct-2018::16:26:14.278110 === > > TLS client: In state hello received SERVER ALERT: Fatal - Handshake Failure > > > {error,{failed_connect,[{to_address,{"sandbox.itunes.apple.com", > > 443}}, > > {inet,[inet],{tls_alert,"handshake failure"}}]}} > > Does anyone know if this is a known issue? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From peterdmv@REDACTED Thu Oct 4 09:36:42 2018 From: peterdmv@REDACTED (Peter Dimitrov) Date: Thu, 4 Oct 2018 09:36:42 +0200 Subject: [erlang-questions] Problem in Erlang 21.0 and 21.1. Is this already known? Message-ID: Hi, It looks like itunes would like to negotiate a weaker cipher suite using RSA key exchange. Those ciphers are not supported by default but you can still configure ssl to support them: All = ssl:cipher_suites(all, 'tlsv1.2'). Opts = [{ciphers, All}]. httpc:request(post,{"https://sandbox.itunes.apple.com/verifyReceipt", [],"application/json", []}, [{ssl,Opts}], []). BR/Peter -----Original Message----- From: erlang-questions-bounces@REDACTED On Behalf Of Xavier Robledo Sent: den 3 oktober 2018 23:35 To: erlang-questions@REDACTED Subject: [erlang-questions] Problem in Erlang 21.0 and 21.1. Is this already known? Hello I've run into a problem with this code: inets:start(), ssl:start(), httpc:request(post, {" https://sandbox.itunes.apple.com/verifyReceipt", [], "application/json", []}, [], []). It returns the following error in the terminal: =INFO REPORT==== 3-Oct-2018::16:26:14.278110 === TLS client: In state hello received SERVER ALERT: Fatal - Handshake Failure {error,{failed_connect,[{to_address,{"sandbox.itunes.apple.com", 443}}, {inet,[inet],{tls_alert,"handshake failure"}}]}} Does anyone know if this is a known issue? _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From askjuise@REDACTED Thu Oct 4 23:13:08 2018 From: askjuise@REDACTED (Alexander Petrovsky) Date: Fri, 5 Oct 2018 00:13:08 +0300 Subject: [erlang-questions] sshd self connect problems Message-ID: Hello, I've some strange problem, when I run ssh server and try to connect to it from code on the same machine I've got an error: Selection of key exchange algorithm failed Server: > ssh:daemon(Port, [{system_dir, "/etc/ssh"}, > {subsystems, > [wm_ssh_sftp_ext:subsystem_spec(), > > ssh_sftpd:subsystem_spec([{cwd, _CWD = "/"}])]}, > {user_passwords, [{"user", "pass"}]}]). Client: > Opts = [{user, "user"}, > {password, "pass"}, > {silently_accept_hosts, true}], > ssh:connect(Node, Port, Opts, _Timeout = 5000). When I capture ssh traffic I find out that the server doesn't suggest `host_key_algorithms` kex_algorithms length: 257 > kex_algorithms string [truncated]: > ecdh-sha2-nistp384,ecdh-sha2-nistp521,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-grou > server_host_key_algorithms length: 0 > server_host_key_algorithms string: [Empty] > encryption_algorithms_client_to_server length: 98 > encryption_algorithms_client_to_server string: > aes256-gcm@REDACTED,aes256-ctr,aes192-ctr,aes128-gcm@REDACTED > ,aes128-ctr,aes128-cbc,3des-cbc > encryption_algorithms_server_to_client length: 98 > encryption_algorithms_server_to_client string: > aes256-gcm@REDACTED,aes256-ctr,aes192-ctr,aes128-gcm@REDACTED > ,aes128-ctr,aes128-cbc,3des-cbc > mac_algorithms_client_to_server length: 37 > mac_algorithms_client_to_server string: > hmac-sha2-256,hmac-sha2-512,hmac-sha1 > mac_algorithms_server_to_client length: 37 > mac_algorithms_server_to_client string: > hmac-sha2-256,hmac-sha2-512,hmac-sha1 > compression_algorithms_client_to_server length: 26 > compression_algorithms_client_to_server string: none, > zlib@REDACTED,zlib > compression_algorithms_server_to_client length: 26 > compression_algorithms_server_to_client string: none, > zlib@REDACTED,zlib > languages_client_to_server length: 0 > languages_client_to_server string: [Empty] > languages_server_to_client length: 0 > languages_server_to_client string: [Empty] > First KEX Packet Follows: 0 > Reserved: 00000000 > Padding String: 21850013139a828f718a But the client has some values: kex_algorithms length: 257 > kex_algorithms string [truncated]: > ecdh-sha2-nistp384,ecdh-sha2-nistp521,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-grou > server_host_key_algorithms length: 101 > server_host_key_algorithms string: > ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ecdsa-sha2-nistp256,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss > encryption_algorithms_client_to_server length: 98 > encryption_algorithms_client_to_server string: > aes256-gcm@REDACTED,aes256-ctr,aes192-ctr,aes128-gcm@REDACTED > ,aes128-ctr,aes128-cbc,3des-cbc > encryption_algorithms_server_to_client length: 98 > encryption_algorithms_server_to_client string: > aes256-gcm@REDACTED,aes256-ctr,aes192-ctr,aes128-gcm@REDACTED > ,aes128-ctr,aes128-cbc,3des-cbc > mac_algorithms_client_to_server length: 37 > mac_algorithms_client_to_server string: > hmac-sha2-256,hmac-sha2-512,hmac-sha1 > mac_algorithms_server_to_client length: 37 > mac_algorithms_server_to_client string: > hmac-sha2-256,hmac-sha2-512,hmac-sha1 > compression_algorithms_client_to_server length: 26 > compression_algorithms_client_to_server string: none, > zlib@REDACTED,zlib > compression_algorithms_server_to_client length: 26 > compression_algorithms_server_to_client string: none, > zlib@REDACTED,zlib > languages_client_to_server length: 0 > languages_client_to_server string: [Empty] > languages_server_to_client length: 0 > languages_server_to_client string: [Empty] > First KEX Packet Follows: 0 > Reserved: 00000000 > Padding String: 49945334a432cfa4a0371700f6 Could someone help me please resolve this problem? -- ?????????? ????????? / Alexander Petrovsky, Skype: askjuise Phone: +7 931 9877991 -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans.r.nilsson@REDACTED Fri Oct 5 09:00:28 2018 From: hans.r.nilsson@REDACTED (Hans Nilsson R) Date: Fri, 5 Oct 2018 09:00:28 +0200 Subject: [erlang-questions] sshd self connect problems In-Reply-To: References: Message-ID: <2c8ad1bf-e2de-838f-590d-2bc1ae1b1dd6@ericsson.com> Hi, 1) Are there host keys in /etc/ssh ? 2) Are the *private* keys in /etc/ssh and that directory readable by the user running erl ? Note that it is potentially dangerous to make the private keys world readable. I would recommend you to generate new host keys (ssh-keygen) in a separate directory readable only by the user running erlang. /Hans On 10/04/2018 11:13 PM, Alexander Petrovsky wrote: > Hello, I've some strange problem, when I run ssh server and try to connect > to it from code on the same machine I've got an error: > > Selection of key exchange algorithm failed > > Server: > >> ssh:daemon(Port, [{system_dir, "/etc/ssh"}, >> {subsystems, >> [wm_ssh_sftp_ext:subsystem_spec(), >> >> ssh_sftpd:subsystem_spec([{cwd, _CWD = "/"}])]}, >> {user_passwords, [{"user", "pass"}]}]). > > > Client: > >> Opts = [{user, "user"}, >> {password, "pass"}, >> {silently_accept_hosts, true}], >> ssh:connect(Node, Port, Opts, _Timeout = 5000). > > > When I capture ssh traffic I find out that the server doesn't suggest > `host_key_algorithms` > > kex_algorithms length: 257 >> kex_algorithms string [truncated]: >> ecdh-sha2-nistp384,ecdh-sha2-nistp521,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-grou >> server_host_key_algorithms length: 0 >> server_host_key_algorithms string: [Empty] >> encryption_algorithms_client_to_server length: 98 >> encryption_algorithms_client_to_server string: >> aes256-gcm@REDACTED,aes256-ctr,aes192-ctr,aes128-gcm@REDACTED >> ,aes128-ctr,aes128-cbc,3des-cbc >> encryption_algorithms_server_to_client length: 98 >> encryption_algorithms_server_to_client string: >> aes256-gcm@REDACTED,aes256-ctr,aes192-ctr,aes128-gcm@REDACTED >> ,aes128-ctr,aes128-cbc,3des-cbc >> mac_algorithms_client_to_server length: 37 >> mac_algorithms_client_to_server string: >> hmac-sha2-256,hmac-sha2-512,hmac-sha1 >> mac_algorithms_server_to_client length: 37 >> mac_algorithms_server_to_client string: >> hmac-sha2-256,hmac-sha2-512,hmac-sha1 >> compression_algorithms_client_to_server length: 26 >> compression_algorithms_client_to_server string: none, >> zlib@REDACTED,zlib >> compression_algorithms_server_to_client length: 26 >> compression_algorithms_server_to_client string: none, >> zlib@REDACTED,zlib >> languages_client_to_server length: 0 >> languages_client_to_server string: [Empty] >> languages_server_to_client length: 0 >> languages_server_to_client string: [Empty] >> First KEX Packet Follows: 0 >> Reserved: 00000000 >> Padding String: 21850013139a828f718a > > > But the client has some values: > > kex_algorithms length: 257 >> kex_algorithms string [truncated]: >> ecdh-sha2-nistp384,ecdh-sha2-nistp521,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-grou >> server_host_key_algorithms length: 101 >> server_host_key_algorithms string: >> ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ecdsa-sha2-nistp256,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss >> encryption_algorithms_client_to_server length: 98 >> encryption_algorithms_client_to_server string: >> aes256-gcm@REDACTED,aes256-ctr,aes192-ctr,aes128-gcm@REDACTED >> ,aes128-ctr,aes128-cbc,3des-cbc >> encryption_algorithms_server_to_client length: 98 >> encryption_algorithms_server_to_client string: >> aes256-gcm@REDACTED,aes256-ctr,aes192-ctr,aes128-gcm@REDACTED >> ,aes128-ctr,aes128-cbc,3des-cbc >> mac_algorithms_client_to_server length: 37 >> mac_algorithms_client_to_server string: >> hmac-sha2-256,hmac-sha2-512,hmac-sha1 >> mac_algorithms_server_to_client length: 37 >> mac_algorithms_server_to_client string: >> hmac-sha2-256,hmac-sha2-512,hmac-sha1 >> compression_algorithms_client_to_server length: 26 >> compression_algorithms_client_to_server string: none, >> zlib@REDACTED,zlib >> compression_algorithms_server_to_client length: 26 >> compression_algorithms_server_to_client string: none, >> zlib@REDACTED,zlib >> languages_client_to_server length: 0 >> languages_client_to_server string: [Empty] >> languages_server_to_client length: 0 >> languages_server_to_client string: [Empty] >> First KEX Packet Follows: 0 >> Reserved: 00000000 >> Padding String: 49945334a432cfa4a0371700f6 > > > Could someone help me please resolve this problem? > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4161 bytes Desc: S/MIME Cryptographic Signature URL: From askjuise@REDACTED Fri Oct 5 10:39:33 2018 From: askjuise@REDACTED (Alexander Petrovsky) Date: Fri, 5 Oct 2018 11:39:33 +0300 Subject: [erlang-questions] sshd self connect problems In-Reply-To: <2c8ad1bf-e2de-838f-590d-2bc1ae1b1dd6@ericsson.com> References: <2c8ad1bf-e2de-838f-590d-2bc1ae1b1dd6@ericsson.com> Message-ID: Oh, you are absolutely right, the problem was in user permission. Thanks a lot ??, 5 ???. 2018 ?. ? 10:00, Hans Nilsson R : > Hi, > > 1) Are there host keys in /etc/ssh ? > 2) Are the *private* keys in /etc/ssh and that directory readable by the > user running erl ? > > Note that it is potentially dangerous to make the private keys world > readable. I would > recommend you to generate new host keys (ssh-keygen) in a separate > directory readable only by the user > running erlang. > > /Hans > > On 10/04/2018 11:13 PM, Alexander Petrovsky wrote: > > Hello, I've some strange problem, when I run ssh server and try to > connect > > to it from code on the same machine I've got an error: > > > > Selection of key exchange algorithm failed > > > > Server: > > > >> ssh:daemon(Port, [{system_dir, "/etc/ssh"}, > >> {subsystems, > >> [wm_ssh_sftp_ext:subsystem_spec(), > >> > >> ssh_sftpd:subsystem_spec([{cwd, _CWD = "/"}])]}, > >> {user_passwords, [{"user", "pass"}]}]). > > > > > > Client: > > > >> Opts = [{user, "user"}, > >> {password, "pass"}, > >> {silently_accept_hosts, true}], > >> ssh:connect(Node, Port, Opts, _Timeout = 5000). > > > > > > When I capture ssh traffic I find out that the server doesn't suggest > > `host_key_algorithms` > > > > kex_algorithms length: 257 > >> kex_algorithms string [truncated]: > >> > ecdh-sha2-nistp384,ecdh-sha2-nistp521,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-grou > >> server_host_key_algorithms length: 0 > >> server_host_key_algorithms string: [Empty] > >> encryption_algorithms_client_to_server length: 98 > >> encryption_algorithms_client_to_server string: > >> aes256-gcm@REDACTED,aes256-ctr,aes192-ctr,aes128-gcm@REDACTED > >> ,aes128-ctr,aes128-cbc,3des-cbc > >> encryption_algorithms_server_to_client length: 98 > >> encryption_algorithms_server_to_client string: > >> aes256-gcm@REDACTED,aes256-ctr,aes192-ctr,aes128-gcm@REDACTED > >> ,aes128-ctr,aes128-cbc,3des-cbc > >> mac_algorithms_client_to_server length: 37 > >> mac_algorithms_client_to_server string: > >> hmac-sha2-256,hmac-sha2-512,hmac-sha1 > >> mac_algorithms_server_to_client length: 37 > >> mac_algorithms_server_to_client string: > >> hmac-sha2-256,hmac-sha2-512,hmac-sha1 > >> compression_algorithms_client_to_server length: 26 > >> compression_algorithms_client_to_server string: none, > >> zlib@REDACTED,zlib > >> compression_algorithms_server_to_client length: 26 > >> compression_algorithms_server_to_client string: none, > >> zlib@REDACTED,zlib > >> languages_client_to_server length: 0 > >> languages_client_to_server string: [Empty] > >> languages_server_to_client length: 0 > >> languages_server_to_client string: [Empty] > >> First KEX Packet Follows: 0 > >> Reserved: 00000000 > >> Padding String: 21850013139a828f718a > > > > > > But the client has some values: > > > > kex_algorithms length: 257 > >> kex_algorithms string [truncated]: > >> > ecdh-sha2-nistp384,ecdh-sha2-nistp521,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-grou > >> server_host_key_algorithms length: 101 > >> server_host_key_algorithms string: > >> > ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ecdsa-sha2-nistp256,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss > >> encryption_algorithms_client_to_server length: 98 > >> encryption_algorithms_client_to_server string: > >> aes256-gcm@REDACTED,aes256-ctr,aes192-ctr,aes128-gcm@REDACTED > >> ,aes128-ctr,aes128-cbc,3des-cbc > >> encryption_algorithms_server_to_client length: 98 > >> encryption_algorithms_server_to_client string: > >> aes256-gcm@REDACTED,aes256-ctr,aes192-ctr,aes128-gcm@REDACTED > >> ,aes128-ctr,aes128-cbc,3des-cbc > >> mac_algorithms_client_to_server length: 37 > >> mac_algorithms_client_to_server string: > >> hmac-sha2-256,hmac-sha2-512,hmac-sha1 > >> mac_algorithms_server_to_client length: 37 > >> mac_algorithms_server_to_client string: > >> hmac-sha2-256,hmac-sha2-512,hmac-sha1 > >> compression_algorithms_client_to_server length: 26 > >> compression_algorithms_client_to_server string: none, > >> zlib@REDACTED,zlib > >> compression_algorithms_server_to_client length: 26 > >> compression_algorithms_server_to_client string: none, > >> zlib@REDACTED,zlib > >> languages_client_to_server length: 0 > >> languages_client_to_server string: [Empty] > >> languages_server_to_client length: 0 > >> languages_server_to_client string: [Empty] > >> First KEX Packet Follows: 0 > >> Reserved: 00000000 > >> Padding String: 49945334a432cfa4a0371700f6 > > > > > > Could someone help me please resolve this problem? > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- ?????????? ????????? / Alexander Petrovsky, Skype: askjuise Phone: +7 931 9877991 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Dinislam.Salikhov@REDACTED Fri Oct 5 16:52:34 2018 From: Dinislam.Salikhov@REDACTED (Salikhov Dinislam) Date: Fri, 5 Oct 2018 17:52:34 +0300 Subject: [erlang-questions] spec of erlang:open_port/2 Message-ID: <26f18d36-76b2-b09b-33e7-314c1c0a2667@kaspersky.com> Hello. erlang:open_port/2 has following spec (not related parts are omitted): ??? -spec open_port(PortName, PortSettings) -> port() when PortName :: {spawn, Command :: string() | binary()} | ... , so Command can be either string() or binary(). On the other hand, the name of a driver is extracted as follows (erts/emulator/beam/erl_bif_port.c): ??? if ((name_buf = erts_convert_filename_to_encoding(name, NULL, 0, ERTS_ALC_T_TMP,0,1, encoding, NULL, 0)) The argument 1, before encoding, is an allow_atom flag, so there is no runtime error when Command being an atom is passed (of course, if the driver exists). Is there a rationale for such limits of Command's type? For me, it seems logical if Command would have type driver: ??? driver() = iolist() | atom() Dinislam Salikhov -------------- next part -------------- An HTML attachment was scrubbed... URL: From christopher.meiklejohn@REDACTED Sat Oct 6 20:56:39 2018 From: christopher.meiklejohn@REDACTED (Christopher Meiklejohn) Date: Sat, 6 Oct 2018 14:56:39 -0400 Subject: [erlang-questions] [ANN] Partisan, v3.0.0: Optimized, topology-independent message passing for Erlang and Elixir Message-ID: Faster dispatch for HyParView, addressed bugs related to message acknowledgements, broadcast tree forwarding with transitive delivery, performance issues, added additional optional tracing and ability to interpose on messages for fault injection. https://hex.pm/packages/partisan We're looking for Erlang and Elixir developers to help with a few things, if you are interested in joining the Partisan effort. 1.) Help us bring together an industrial grade library in Elixir that, in idiomatic Elixir, maps to Partisan's Erlang API, allowing Elixir developers to interact with Partisan without having to use the interop API -- this will assist in easing adoption using Elixir conventions and provide an idiomatic way to write programs using it. 2.) Testing and fault-injection: adapting applications to Partisan so we can try out our fault-injection support. This would be in conjunction with an on-going research project at Carnegie Mellon University. Reach out if you are interested! Cheers, Christopher From yestin@REDACTED Mon Oct 8 05:29:09 2018 From: yestin@REDACTED (Yestin L Harrison) Date: Sun, 7 Oct 2018 20:29:09 -0700 Subject: [erlang-questions] I'm impressed, but how on earth did Dialyzer figure this out? Message-ID: Right, so, I have a module with a big important central function that takes a proplist of options, and I have a product type annotated representing valid options, opt(). Then, I've got: -type opts() :: [opt()]. I've got functions: -spec default_options() -> opts(). %% you can imagine what this looks like -spec options(opts()) -> opts(). options(Options) -> Default = maps:from_list(proplists:unfold(default_options())), New = maps:from_list(proplists:unfold(Options)), proplists:compact(maps:to_list(maps:merge(Default, New))). I run Dialyzer on my project, and... this typechecks just fine? It was my understanding that Dialyzer spits errors on a potential violation of stated success typing, and I figured that after going through all the functions in the maps and proplists module, that static analysis would only be able to determine that the output of maps:to_list/1 would be {term(), term()}? Or am I not giving Dialyzer enough credit? Is this what the PLT is for, statically stepping through the modules it contains? Really, in any case, a) This is amazing, b) I would love any resources anyone is aware of on the workings of Dialyzer, besides the obvious look through the source code, which I might attempt after getting a bit of a better feel for what it does. From ben.browitt@REDACTED Mon Oct 8 06:50:33 2018 From: ben.browitt@REDACTED (Ben Browitt) Date: Mon, 8 Oct 2018 07:50:33 +0300 Subject: [erlang-questions] use_srtp extension for DTLS In-Reply-To: References: Message-ID: USE_SRTP is defined in dtls_handshake.hrl [1] but it says it's not supported. Are there plans to support it? [1] https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_handshake.hrl#L64 On Mon, Oct 1, 2018 at 11:27 AM Ben Browitt wrote: > DTLS is missing the use_srtp extension required for DTLS-SRTP [1]. > What's the best way to add it? > > We need to encode the extension in ssl_handshake.erl > encode_hello_extensions([use_srtp | Rest], Acc) -> > ExtData = <<0,2,0,1,0>>, > Len = byte_size(ExtData), > encode_hello_extensions(Rest, < ExtData/binary, Acc/binary>>). > > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L657 > > Define USE_SRTP_EXT in ssl_handshake.hrl > -define(USE_SRTP_EXT, 14). > > Add use_srtp to the hello_extensions record: > > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.hrl#L100 > > Add use_srtp to hello_extensions_list > > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L1826 > > Add use_srtp to client_hello_extensions > > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L968 > > Add use_srtp to the #ssl_options record > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_internal.hrl#L111 > > [1] https://tools.ietf.org/html/rfc5764#section-4.1 > > Thanks > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kostis@REDACTED Mon Oct 8 10:30:52 2018 From: kostis@REDACTED (Kostis Sagonas) Date: Mon, 8 Oct 2018 10:30:52 +0200 Subject: [erlang-questions] I'm impressed, but how on earth did Dialyzer figure this out? In-Reply-To: References: Message-ID: <6154a476-8527-8461-802b-e8cb0e0ec5fa@cs.ntua.gr> On 10/08/2018 05:29 AM, Yestin L Harrison wrote: > Right, so, I have a module with a big important central function that takes a > proplist of options, and I have a product type annotated representing valid > options, opt(). Then, I've got: > > -type opts() :: [opt()]. > > I've got functions: > > -spec default_options() -> opts(). > %% you can imagine what this looks like > > -spec options(opts()) -> opts(). > options(Options) -> > Default = maps:from_list(proplists:unfold(default_options())), > New = maps:from_list(proplists:unfold(Options)), > proplists:compact(maps:to_list(maps:merge(Default, New))). > > I run Dialyzer on my project, and... this typechecks just fine? I am not sure what your point is, but note that Dialyzer (Discrepancy Analyzer of Erlang programs) is NOT a static type checker (i.e., a tool that is sound for correctness), but is a tool that is sound for defect detection. As the slogan goes "a tool whose warnings are never wrong". So, what you write below is not accurate: > It was my understanding that Dialyzer spits errors on a potential violation of > stated success typing, Dialyzer spits warnings on *definite* (not potential!) violations of success typings. > and I figured that after going through all the > functions in the maps and proplists module, that static analysis would only > be able to determine that the output of maps:to_list/1 would be > {term(), term()}? Well, no. It should be able to determine that the output of maps:to_list/1 would be at least [{term(), term()}], i.e., that it is a list of 2-tuples. > Or am I not giving Dialyzer enough credit? Is this what the > PLT is for, statically stepping through the modules it contains? > > Really, in any case, > a) This is amazing, > b) I would love any resources anyone is aware of on the workings of Dialyzer, > besides the obvious look through the source code, which I might attempt > after getting a bit of a better feel for what it does. I suggest you start from reading the Dialyzer description in the Learn You Some Erlang book https://learnyousomeerlang.com/dialyzer and then, if you want to find out more, read the "success typings" paper Practical Type Inference Based on Success Typings https://it.uu.se/research/group/hipe/papers/succ_types.pdf Kostis From ingela.andin@REDACTED Mon Oct 8 12:26:42 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 8 Oct 2018 12:26:42 +0200 Subject: [erlang-questions] use_srtp extension for DTLS In-Reply-To: References: Message-ID: Hi! Sorry for late answer. Yes there are plans to include it. It extension is also part of TLS-1.3 that has priority over DTLS at the moment. We have already done some internal changes to extension handling to facilitate the implementation of TLS-1.3 and its co-existing with previous versions. This is in first hand planned for OTP-22. Regards Ingela Erlang/OTP Team - Ericsson AB Den m?n 8 okt. 2018 kl 06:58 skrev Ben Browitt : > USE_SRTP is defined in dtls_handshake.hrl [1] but it says it's not > supported. > Are there plans to support it? > > [1] > https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_handshake.hrl#L64 > > On Mon, Oct 1, 2018 at 11:27 AM Ben Browitt wrote: > >> DTLS is missing the use_srtp extension required for DTLS-SRTP [1]. >> What's the best way to add it? >> >> We need to encode the extension in ssl_handshake.erl >> encode_hello_extensions([use_srtp | Rest], Acc) -> >> ExtData = <<0,2,0,1,0>>, >> Len = byte_size(ExtData), >> encode_hello_extensions(Rest, <> ExtData/binary, Acc/binary>>). >> >> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L657 >> >> Define USE_SRTP_EXT in ssl_handshake.hrl >> -define(USE_SRTP_EXT, 14). >> >> Add use_srtp to the hello_extensions record: >> >> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.hrl#L100 >> >> Add use_srtp to hello_extensions_list >> >> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L1826 >> >> Add use_srtp to client_hello_extensions >> >> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L968 >> >> Add use_srtp to the #ssl_options record >> >> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_internal.hrl#L111 >> >> [1] https://tools.ietf.org/html/rfc5764#section-4.1 >> >> Thanks >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.schultz@REDACTED Mon Oct 8 12:48:03 2018 From: andreas.schultz@REDACTED (Andreas Schultz) Date: Mon, 8 Oct 2018 12:48:03 +0200 Subject: [erlang-questions] use_srtp extension for DTLS In-Reply-To: References: Message-ID: Hi Ingela, Ingela Andin schrieb am Mo., 8. Okt. 2018 um 12:27 Uhr: > Hi! > > Sorry for late answer. Yes there are plans to include it. It extension is > also part of TLS-1.3 that has priority over DTLS at the moment. We have > already done > Can't speak for others, but I would prefer if DTLS-1.3 where give the same priority as TLS-1.3. Regards Andreas some internal changes to extension handling to facilitate the > implementation of TLS-1.3 and its co-existing with previous versions. This > is in first hand planned for OTP-22. > > Regards Ingela Erlang/OTP Team - Ericsson AB > > > Den m?n 8 okt. 2018 kl 06:58 skrev Ben Browitt : > >> USE_SRTP is defined in dtls_handshake.hrl [1] but it says it's not >> supported. >> Are there plans to support it? >> >> [1] >> https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_handshake.hrl#L64 >> >> On Mon, Oct 1, 2018 at 11:27 AM Ben Browitt >> wrote: >> >>> DTLS is missing the use_srtp extension required for DTLS-SRTP [1]. >>> What's the best way to add it? >>> >>> We need to encode the extension in ssl_handshake.erl >>> encode_hello_extensions([use_srtp | Rest], Acc) -> >>> ExtData = <<0,2,0,1,0>>, >>> Len = byte_size(ExtData), >>> encode_hello_extensions(Rest, <>> ?UINT16(Len), ExtData/binary, Acc/binary>>). >>> >>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L657 >>> >>> Define USE_SRTP_EXT in ssl_handshake.hrl >>> -define(USE_SRTP_EXT, 14). >>> >>> Add use_srtp to the hello_extensions record: >>> >>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.hrl#L100 >>> >>> Add use_srtp to hello_extensions_list >>> >>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L1826 >>> >>> Add use_srtp to client_hello_extensions >>> >>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L968 >>> >>> Add use_srtp to the #ssl_options record >>> >>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_internal.hrl#L111 >>> >>> [1] https://tools.ietf.org/html/rfc5764#section-4.1 >>> >>> Thanks >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- -- Dipl.-Inform. Andreas Schultz ----------------------- enabling your networks ---------------------- Travelping GmbH Phone: +49-391-81 90 99 0 Roentgenstr. 13 Fax: +49-391-81 90 99 299 39108 Magdeburg Email: info@REDACTED GERMANY Web: http://www.travelping.com Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 Geschaeftsfuehrer: Holger Winkelmann VAT ID No.: DE236673780 --------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.browitt@REDACTED Mon Oct 8 13:08:45 2018 From: ben.browitt@REDACTED (Ben Browitt) Date: Mon, 8 Oct 2018 14:08:45 +0300 Subject: [erlang-questions] use_srtp extension for DTLS In-Reply-To: References: Message-ID: What about being able to handle DTLS, STRP and STUN packets on the same UDP socket? It will be best if I could create a UDP socket in my app, filter packets and pass only DTLS packets to the ssl socket/process. Without this, DTLS in the ssl app can't be used for WebRTC connections. Is this also planned? On Mon, Oct 8, 2018 at 1:48 PM Andreas Schultz < andreas.schultz@REDACTED> wrote: > Hi Ingela, > > Ingela Andin schrieb am Mo., 8. Okt. 2018 um > 12:27 Uhr: > >> Hi! >> >> Sorry for late answer. Yes there are plans to include it. It extension is >> also part of TLS-1.3 that has priority over DTLS at the moment. We have >> already done >> > > Can't speak for others, but I would prefer if DTLS-1.3 where give the same > priority as TLS-1.3. > > Regards > Andreas > > some internal changes to extension handling to facilitate the >> implementation of TLS-1.3 and its co-existing with previous versions. This >> is in first hand planned for OTP-22. >> >> Regards Ingela Erlang/OTP Team - Ericsson AB >> >> >> Den m?n 8 okt. 2018 kl 06:58 skrev Ben Browitt : >> >>> USE_SRTP is defined in dtls_handshake.hrl [1] but it says it's not >>> supported. >>> Are there plans to support it? >>> >>> [1] >>> https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_handshake.hrl#L64 >>> >>> On Mon, Oct 1, 2018 at 11:27 AM Ben Browitt >>> wrote: >>> >>>> DTLS is missing the use_srtp extension required for DTLS-SRTP [1]. >>>> What's the best way to add it? >>>> >>>> We need to encode the extension in ssl_handshake.erl >>>> encode_hello_extensions([use_srtp | Rest], Acc) -> >>>> ExtData = <<0,2,0,1,0>>, >>>> Len = byte_size(ExtData), >>>> encode_hello_extensions(Rest, <>>> ?UINT16(Len), ExtData/binary, Acc/binary>>). >>>> >>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L657 >>>> >>>> Define USE_SRTP_EXT in ssl_handshake.hrl >>>> -define(USE_SRTP_EXT, 14). >>>> >>>> Add use_srtp to the hello_extensions record: >>>> >>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.hrl#L100 >>>> >>>> Add use_srtp to hello_extensions_list >>>> >>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L1826 >>>> >>>> Add use_srtp to client_hello_extensions >>>> >>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L968 >>>> >>>> Add use_srtp to the #ssl_options record >>>> >>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_internal.hrl#L111 >>>> >>>> [1] https://tools.ietf.org/html/rfc5764#section-4.1 >>>> >>>> Thanks >>>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -- > -- > Dipl.-Inform. Andreas Schultz > > ----------------------- enabling your networks ---------------------- > Travelping GmbH Phone: +49-391-81 90 99 0 > Roentgenstr. 13 Fax: +49-391-81 90 99 299 > 39108 Magdeburg Email: info@REDACTED > GERMANY Web: http://www.travelping.com > > Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 > Geschaeftsfuehrer: Holger Winkelmann VAT ID No.: DE236673780 > --------------------------------------------------------------------- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Mon Oct 8 13:38:50 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 8 Oct 2018 13:38:50 +0200 Subject: [erlang-questions] use_srtp extension for DTLS In-Reply-To: References: Message-ID: This seems to be a similar issue to the one I have about tunneling TLS connections through TLS proxies (particularly the HTTP/2 case), although my proposed solution would probably not work in your case: https://bugs.erlang.org/browse/ERL-728 Perhaps we need some kind of socket-less ssl connection process that we feed directly and that sends us back whatever encrypted data needs to be sent. On 10/8/18 1:08 PM, Ben Browitt wrote: > What about being able to handle DTLS, STRP and STUN packets on the same > UDP socket? > It will be best if I could create a UDP socket in my app, filter packets > and pass only DTLS packets to the ssl socket/process. > Without this, DTLS in the ssl app can't be used for WebRTC connections. > Is this also planned? > > On Mon, Oct 8, 2018 at 1:48 PM Andreas Schultz > > > wrote: > > Hi Ingela, > > Ingela Andin > schrieb am Mo., 8. Okt. 2018 um > 12:27?Uhr: > > Hi! > > Sorry for late answer. Yes there are plans to include it. It > extension is also part of TLS-1.3 that has priority over DTLS at > the moment. We have already? done > > > Can't speak for others, but I would prefer if DTLS-1.3 where give > the same priority as TLS-1.3. > > Regards > Andreas > > some internal changes to extension handling to facilitate the > implementation of TLS-1.3 and its co-existing with previous > versions.? This is in first hand planned for OTP-22. > > Regards Ingela Erlang/OTP Team - Ericsson AB > > > Den m?n 8 okt. 2018 kl 06:58 skrev Ben Browitt > >: > > USE_SRTP is defined in dtls_handshake.hrl [1] but it says > it's not supported. > Are there plans to support it? > > [1] > https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_handshake.hrl#L64 > > On Mon, Oct 1, 2018 at 11:27 AM Ben Browitt > > wrote: > > DTLS is missing the use_srtp extension required for > DTLS-SRTP [1]. > What's the best way to add it? > > We need to encode the extension in ssl_handshake.erl > encode_hello_extensions([use_srtp | Rest], Acc) -> > ??? ExtData = <<0,2,0,1,0>>, > ??? Len = byte_size(ExtData), > ??? encode_hello_extensions(Rest, > < Acc/binary>>). > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L657 > > Define USE_SRTP_EXT in ssl_handshake.hrl > -define(USE_SRTP_EXT, 14). > > Add use_srtp to the hello_extensions record: > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.hrl#L100 > > Add use_srtp to hello_extensions_list > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L1826 > > Add use_srtp to client_hello_extensions > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L968 > > Add use_srtp to the #ssl_options record > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_internal.hrl#L111 > > [1] https://tools.ietf.org/html/rfc5764#section-4.1 > > Thanks > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- > -- > Dipl.-Inform. Andreas Schultz > > ----------------------- enabling your networks ---------------------- > Travelping GmbH ? ? ? ? ? ? ? ? ? ? Phone: ?+49-391-81 90 99 0 > Roentgenstr. 13 ? ? ? ? ? ? ? ? ? ? Fax: ? ?+49-391-81 90 99 299 > 39108 Magdeburg ? ? ? ? ? ? ? ? ? ? Email: info@REDACTED > > GERMANY ? ? ? ? ? ? ? ? ? ? ? ? ? ? Web: http://www.travelping.com > > Company Registration: Amtsgericht Stendal ? ? ? ?Reg No.: ? HRB 10578 > Geschaeftsfuehrer: Holger Winkelmann ? ? ? ? ?VAT ID No.: DE236673780 > --------------------------------------------------------------------- > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin https://ninenines.eu From andreas.schultz@REDACTED Mon Oct 8 13:49:00 2018 From: andreas.schultz@REDACTED (Andreas Schultz) Date: Mon, 8 Oct 2018 13:49:00 +0200 Subject: [erlang-questions] use_srtp extension for DTLS In-Reply-To: References: Message-ID: Lo?c Hoguin schrieb am Mo., 8. Okt. 2018 um 13:39 Uhr: > This seems to be a similar issue to the one I have about tunneling TLS > connections through TLS proxies (particularly the HTTP/2 case), although > my proposed solution would probably not work in your case: > https://bugs.erlang.org/browse/ERL-728 You can already use the cb_info option with a custom transport module to build that. In theory, the STRP and STUN over DTLS use case should be doable with that as well. Ingela recently fixed a few things in the DTLS module recently [1] to make this work. I always meant to port my CAPWAP DTLS use case to this, but havn't gotten the time to actually to it. Andreas [1]: https://github.com/erlang/otp/commit/72aaa1bb0cd2352fc8708a1a89b44e5791f49356 > > Perhaps we need some kind of socket-less ssl connection process that we > feed directly and that sends us back whatever encrypted data needs to be > sent. > > On 10/8/18 1:08 PM, Ben Browitt wrote: > > What about being able to handle DTLS, STRP and STUN packets on the same > > UDP socket? > > It will be best if I could create a UDP socket in my app, filter packets > > and pass only DTLS packets to the ssl socket/process. > > Without this, DTLS in the ssl app can't be used for WebRTC connections. > > Is this also planned? > > > > On Mon, Oct 8, 2018 at 1:48 PM Andreas Schultz > > > > > > wrote: > > > > Hi Ingela, > > > > Ingela Andin > > schrieb am Mo., 8. Okt. 2018 um > > 12:27 Uhr: > > > > Hi! > > > > Sorry for late answer. Yes there are plans to include it. It > > extension is also part of TLS-1.3 that has priority over DTLS at > > the moment. We have already done > > > > > > Can't speak for others, but I would prefer if DTLS-1.3 where give > > the same priority as TLS-1.3. > > > > Regards > > Andreas > > > > some internal changes to extension handling to facilitate the > > implementation of TLS-1.3 and its co-existing with previous > > versions. This is in first hand planned for OTP-22. > > > > Regards Ingela Erlang/OTP Team - Ericsson AB > > > > > > Den m?n 8 okt. 2018 kl 06:58 skrev Ben Browitt > > >: > > > > USE_SRTP is defined in dtls_handshake.hrl [1] but it says > > it's not supported. > > Are there plans to support it? > > > > [1] > > > https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_handshake.hrl#L64 > > > > On Mon, Oct 1, 2018 at 11:27 AM Ben Browitt > > > > wrote: > > > > DTLS is missing the use_srtp extension required for > > DTLS-SRTP [1]. > > What's the best way to add it? > > > > We need to encode the extension in ssl_handshake.erl > > encode_hello_extensions([use_srtp | Rest], Acc) -> > > ExtData = <<0,2,0,1,0>>, > > Len = byte_size(ExtData), > > encode_hello_extensions(Rest, > > < > Acc/binary>>). > > > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L657 > > > > Define USE_SRTP_EXT in ssl_handshake.hrl > > -define(USE_SRTP_EXT, 14). > > > > Add use_srtp to the hello_extensions record: > > > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.hrl#L100 > > > > Add use_srtp to hello_extensions_list > > > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L1826 > > > > Add use_srtp to client_hello_extensions > > > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L968 > > > > Add use_srtp to the #ssl_options record > > > https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_internal.hrl#L111 > > > > [1] https://tools.ietf.org/html/rfc5764#section-4.1 > > > > Thanks > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED erlang-questions@REDACTED> > > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > > -- > > Dipl.-Inform. Andreas Schultz > > > > ----------------------- enabling your networks ---------------------- > > Travelping GmbH Phone: +49-391-81 90 99 0 > > Roentgenstr. 13 Fax: +49-391-81 90 99 299 > <+49%20391%20819099299> > > 39108 Magdeburg Email: info@REDACTED > > > > GERMANY Web: http://www.travelping.com > > > > Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 > > Geschaeftsfuehrer: Holger Winkelmann VAT ID No.: DE236673780 > > --------------------------------------------------------------------- > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > Lo?c Hoguin > https://ninenines.eu > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- -- Dipl.-Inform. Andreas Schultz ----------------------- enabling your networks ---------------------- Travelping GmbH Phone: +49-391-81 90 99 0 Roentgenstr. 13 Fax: +49-391-81 90 99 299 39108 Magdeburg Email: info@REDACTED GERMANY Web: http://www.travelping.com Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 Geschaeftsfuehrer: Holger Winkelmann VAT ID No.: DE236673780 --------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.browitt@REDACTED Mon Oct 8 13:53:43 2018 From: ben.browitt@REDACTED (Ben Browitt) Date: Mon, 8 Oct 2018 14:53:43 +0300 Subject: [erlang-questions] use_srtp extension for DTLS In-Reply-To: References: Message-ID: Andreas, any chance for a simple code showing how to handle SRTP/STUN/DTLS with client and server? On Mon, Oct 8, 2018 at 2:49 PM Andreas Schultz < andreas.schultz@REDACTED> wrote: > Lo?c Hoguin schrieb am Mo., 8. Okt. 2018 um > 13:39 Uhr: > >> This seems to be a similar issue to the one I have about tunneling TLS >> connections through TLS proxies (particularly the HTTP/2 case), although >> my proposed solution would probably not work in your case: >> https://bugs.erlang.org/browse/ERL-728 > > > You can already use the cb_info option with a custom transport module to > build that. > > In theory, the STRP and STUN over DTLS use case should be doable with that > as well. > Ingela recently fixed a few things in the DTLS module recently [1] to make > this work. > > I always meant to port my CAPWAP DTLS use case to this, but havn't gotten > the > time to actually to it. > > Andreas > > [1]: > https://github.com/erlang/otp/commit/72aaa1bb0cd2352fc8708a1a89b44e5791f49356 > > >> >> Perhaps we need some kind of socket-less ssl connection process that we >> feed directly and that sends us back whatever encrypted data needs to be >> sent. >> >> On 10/8/18 1:08 PM, Ben Browitt wrote: >> > What about being able to handle DTLS, STRP and STUN packets on the same >> > UDP socket? >> > It will be best if I could create a UDP socket in my app, filter >> packets >> > and pass only DTLS packets to the ssl socket/process. >> > Without this, DTLS in the ssl app can't be used for WebRTC connections. >> > Is this also planned? >> > >> > On Mon, Oct 8, 2018 at 1:48 PM Andreas Schultz >> > > >> >> > wrote: >> > >> > Hi Ingela, >> > >> > Ingela Andin > > > schrieb am Mo., 8. Okt. 2018 um >> > 12:27 Uhr: >> > >> > Hi! >> > >> > Sorry for late answer. Yes there are plans to include it. It >> > extension is also part of TLS-1.3 that has priority over DTLS at >> > the moment. We have already done >> > >> > >> > Can't speak for others, but I would prefer if DTLS-1.3 where give >> > the same priority as TLS-1.3. >> > >> > Regards >> > Andreas >> > >> > some internal changes to extension handling to facilitate the >> > implementation of TLS-1.3 and its co-existing with previous >> > versions. This is in first hand planned for OTP-22. >> > >> > Regards Ingela Erlang/OTP Team - Ericsson AB >> > >> > >> > Den m?n 8 okt. 2018 kl 06:58 skrev Ben Browitt >> > >: >> > >> > USE_SRTP is defined in dtls_handshake.hrl [1] but it says >> > it's not supported. >> > Are there plans to support it? >> > >> > [1] >> > >> https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_handshake.hrl#L64 >> > >> > On Mon, Oct 1, 2018 at 11:27 AM Ben Browitt >> > > >> wrote: >> > >> > DTLS is missing the use_srtp extension required for >> > DTLS-SRTP [1]. >> > What's the best way to add it? >> > >> > We need to encode the extension in ssl_handshake.erl >> > encode_hello_extensions([use_srtp | Rest], Acc) -> >> > ExtData = <<0,2,0,1,0>>, >> > Len = byte_size(ExtData), >> > encode_hello_extensions(Rest, >> > <> > Acc/binary>>). >> > >> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L657 >> > >> > Define USE_SRTP_EXT in ssl_handshake.hrl >> > -define(USE_SRTP_EXT, 14). >> > >> > Add use_srtp to the hello_extensions record: >> > >> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.hrl#L100 >> > >> > Add use_srtp to hello_extensions_list >> > >> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L1826 >> > >> > Add use_srtp to client_hello_extensions >> > >> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L968 >> > >> > Add use_srtp to the #ssl_options record >> > >> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_internal.hrl#L111 >> > >> > [1] https://tools.ietf.org/html/rfc5764#section-4.1 >> > >> > Thanks >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED > erlang-questions@REDACTED> >> > http://erlang.org/mailman/listinfo/erlang-questions >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED > > >> > http://erlang.org/mailman/listinfo/erlang-questions >> > >> > -- >> > -- >> > Dipl.-Inform. Andreas Schultz >> > >> > ----------------------- enabling your networks >> ---------------------- >> > Travelping GmbH Phone: +49-391-81 90 99 0 >> > Roentgenstr. 13 Fax: +49-391-81 90 99 299 >> <+49%20391%20819099299> >> > 39108 Magdeburg Email: info@REDACTED >> > >> > GERMANY Web: http://www.travelping.com >> > >> > Company Registration: Amtsgericht Stendal Reg No.: HRB >> 10578 >> > Geschaeftsfuehrer: Holger Winkelmann VAT ID No.: >> DE236673780 >> > >> --------------------------------------------------------------------- >> > >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > >> >> -- >> Lo?c Hoguin >> https://ninenines.eu >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -- > -- > Dipl.-Inform. Andreas Schultz > > ----------------------- enabling your networks ---------------------- > Travelping GmbH Phone: +49-391-81 90 99 0 > Roentgenstr. 13 Fax: +49-391-81 90 99 299 > 39108 Magdeburg Email: info@REDACTED > GERMANY Web: http://www.travelping.com > > Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 > Geschaeftsfuehrer: Holger Winkelmann VAT ID No.: DE236673780 > --------------------------------------------------------------------- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Mon Oct 8 14:05:14 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 8 Oct 2018 14:05:14 +0200 Subject: [erlang-questions] use_srtp extension for DTLS In-Reply-To: References: Message-ID: On 10/8/18 1:49 PM, Andreas Schultz wrote: > Lo?c Hoguin > schrieb am > Mo., 8. Okt. 2018 um 13:39?Uhr: > > This seems to be a similar issue to the one I have about tunneling TLS > connections through TLS proxies (particularly the HTTP/2 case), > although > my proposed solution would probably not work in your case: > https://bugs.erlang.org/browse/ERL-728 > > > You can already use the cb_info option with a custom transport module to > build that. Glad I posted. Thanks for the heads up, I'll experiment. -- Lo?c Hoguin https://ninenines.eu From andreas.schultz@REDACTED Mon Oct 8 14:30:10 2018 From: andreas.schultz@REDACTED (Andreas Schultz) Date: Mon, 8 Oct 2018 14:30:10 +0200 Subject: [erlang-questions] use_srtp extension for DTLS In-Reply-To: References: Message-ID: Ben Browitt schrieb am Mo., 8. Okt. 2018 um 13:54 Uhr: > Andreas, any chance for a simple code showing how to handle SRTP/STUN/DTLS > with client and server? > No, sorry. I don't even have the time to convert my own code to the new DTLS module, let alone to work on something else. Andreas On Mon, Oct 8, 2018 at 2:49 PM Andreas Schultz < > andreas.schultz@REDACTED> wrote: > >> Lo?c Hoguin schrieb am Mo., 8. Okt. 2018 um >> 13:39 Uhr: >> >>> This seems to be a similar issue to the one I have about tunneling TLS >>> connections through TLS proxies (particularly the HTTP/2 case), although >>> my proposed solution would probably not work in your case: >>> https://bugs.erlang.org/browse/ERL-728 >> >> >> You can already use the cb_info option with a custom transport module to >> build that. >> >> In theory, the STRP and STUN over DTLS use case should be doable with >> that as well. >> Ingela recently fixed a few things in the DTLS module recently [1] to >> make this work. >> >> I always meant to port my CAPWAP DTLS use case to this, but havn't gotten >> the >> time to actually to it. >> >> Andreas >> >> [1]: >> https://github.com/erlang/otp/commit/72aaa1bb0cd2352fc8708a1a89b44e5791f49356 >> >> >>> >>> Perhaps we need some kind of socket-less ssl connection process that we >>> feed directly and that sends us back whatever encrypted data needs to be >>> sent. >>> >>> On 10/8/18 1:08 PM, Ben Browitt wrote: >>> > What about being able to handle DTLS, STRP and STUN packets on the >>> same >>> > UDP socket? >>> > It will be best if I could create a UDP socket in my app, filter >>> packets >>> > and pass only DTLS packets to the ssl socket/process. >>> > Without this, DTLS in the ssl app can't be used for WebRTC connections. >>> > Is this also planned? >>> > >>> > On Mon, Oct 8, 2018 at 1:48 PM Andreas Schultz >>> > > >>> >>> > wrote: >>> > >>> > Hi Ingela, >>> > >>> > Ingela Andin >> > > schrieb am Mo., 8. Okt. 2018 um >>> > 12:27 Uhr: >>> > >>> > Hi! >>> > >>> > Sorry for late answer. Yes there are plans to include it. It >>> > extension is also part of TLS-1.3 that has priority over DTLS >>> at >>> > the moment. We have already done >>> > >>> > >>> > Can't speak for others, but I would prefer if DTLS-1.3 where give >>> > the same priority as TLS-1.3. >>> > >>> > Regards >>> > Andreas >>> > >>> > some internal changes to extension handling to facilitate the >>> > implementation of TLS-1.3 and its co-existing with previous >>> > versions. This is in first hand planned for OTP-22. >>> > >>> > Regards Ingela Erlang/OTP Team - Ericsson AB >>> > >>> > >>> > Den m?n 8 okt. 2018 kl 06:58 skrev Ben Browitt >>> > >: >>> > >>> > USE_SRTP is defined in dtls_handshake.hrl [1] but it says >>> > it's not supported. >>> > Are there plans to support it? >>> > >>> > [1] >>> > >>> https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_handshake.hrl#L64 >>> > >>> > On Mon, Oct 1, 2018 at 11:27 AM Ben Browitt >>> > > >>> wrote: >>> > >>> > DTLS is missing the use_srtp extension required for >>> > DTLS-SRTP [1]. >>> > What's the best way to add it? >>> > >>> > We need to encode the extension in ssl_handshake.erl >>> > encode_hello_extensions([use_srtp | Rest], Acc) -> >>> > ExtData = <<0,2,0,1,0>>, >>> > Len = byte_size(ExtData), >>> > encode_hello_extensions(Rest, >>> > <>> > Acc/binary>>). >>> > >>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L657 >>> > >>> > Define USE_SRTP_EXT in ssl_handshake.hrl >>> > -define(USE_SRTP_EXT, 14). >>> > >>> > Add use_srtp to the hello_extensions record: >>> > >>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.hrl#L100 >>> > >>> > Add use_srtp to hello_extensions_list >>> > >>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L1826 >>> > >>> > Add use_srtp to client_hello_extensions >>> > >>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L968 >>> > >>> > Add use_srtp to the #ssl_options record >>> > >>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_internal.hrl#L111 >>> > >>> > [1] https://tools.ietf.org/html/rfc5764#section-4.1 >>> > >>> > Thanks >>> > >>> > _______________________________________________ >>> > erlang-questions mailing list >>> > erlang-questions@REDACTED >> erlang-questions@REDACTED> >>> > http://erlang.org/mailman/listinfo/erlang-questions >>> > >>> > _______________________________________________ >>> > erlang-questions mailing list >>> > erlang-questions@REDACTED >> erlang-questions@REDACTED> >>> > http://erlang.org/mailman/listinfo/erlang-questions >>> > >>> > -- >>> > -- >>> > Dipl.-Inform. Andreas Schultz >>> > >>> > ----------------------- enabling your networks >>> ---------------------- >>> > Travelping GmbH Phone: +49-391-81 90 99 0 >>> > Roentgenstr. 13 Fax: +49-391-81 90 99 299 >>> <+49%20391%20819099299> >>> > 39108 Magdeburg Email: info@REDACTED >>> > >>> > GERMANY Web: http://www.travelping.com >>> > >>> > Company Registration: Amtsgericht Stendal Reg No.: HRB >>> 10578 >>> > Geschaeftsfuehrer: Holger Winkelmann VAT ID No.: >>> DE236673780 >>> > >>> --------------------------------------------------------------------- >>> > >>> > >>> > _______________________________________________ >>> > erlang-questions mailing list >>> > erlang-questions@REDACTED >>> > http://erlang.org/mailman/listinfo/erlang-questions >>> > >>> >>> -- >>> Lo?c Hoguin >>> https://ninenines.eu >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> -- >> -- >> Dipl.-Inform. Andreas Schultz >> >> ----------------------- enabling your networks ---------------------- >> Travelping GmbH Phone: +49-391-81 90 99 0 >> Roentgenstr. 13 Fax: +49-391-81 90 99 299 >> <+49%20391%20819099299> >> 39108 Magdeburg Email: info@REDACTED >> GERMANY Web: http://www.travelping.com >> >> Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 >> Geschaeftsfuehrer: Holger Winkelmann VAT ID No.: DE236673780 >> --------------------------------------------------------------------- >> > -- -- Dipl.-Inform. Andreas Schultz ----------------------- enabling your networks ---------------------- Travelping GmbH Phone: +49-391-81 90 99 0 Roentgenstr. 13 Fax: +49-391-81 90 99 299 39108 Magdeburg Email: info@REDACTED GERMANY Web: http://www.travelping.com Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 Geschaeftsfuehrer: Holger Winkelmann VAT ID No.: DE236673780 --------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Mon Oct 8 18:03:47 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 8 Oct 2018 18:03:47 +0200 Subject: [erlang-questions] use_srtp extension for DTLS In-Reply-To: References: Message-ID: Hi! Den m?n 8 okt. 2018 kl 12:48 skrev Andreas Schultz < andreas.schultz@REDACTED>: > Hi Ingela, > > Ingela Andin schrieb am Mo., 8. Okt. 2018 um > 12:27 Uhr: > >> Hi! >> >> Sorry for late answer. Yes there are plans to include it. It extension is >> also part of TLS-1.3 that has priority over DTLS at the moment. We have >> already done >> > > Can't speak for others, but I would prefer if DTLS-1.3 where give the same > priority as TLS-1.3. > > Well as DTLS is described as a diff against TLS we kind of need the original first. Regards Ingela Erlang/OTP team - Ericsson AB > Regards > Andreas > > some internal changes to extension handling to facilitate the >> implementation of TLS-1.3 and its co-existing with previous versions. This >> is in first hand planned for OTP-22. >> >> Regards Ingela Erlang/OTP Team - Ericsson AB >> >> >> Den m?n 8 okt. 2018 kl 06:58 skrev Ben Browitt : >> >>> USE_SRTP is defined in dtls_handshake.hrl [1] but it says it's not >>> supported. >>> Are there plans to support it? >>> >>> [1] >>> https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_handshake.hrl#L64 >>> >>> On Mon, Oct 1, 2018 at 11:27 AM Ben Browitt >>> wrote: >>> >>>> DTLS is missing the use_srtp extension required for DTLS-SRTP [1]. >>>> What's the best way to add it? >>>> >>>> We need to encode the extension in ssl_handshake.erl >>>> encode_hello_extensions([use_srtp | Rest], Acc) -> >>>> ExtData = <<0,2,0,1,0>>, >>>> Len = byte_size(ExtData), >>>> encode_hello_extensions(Rest, <>>> ?UINT16(Len), ExtData/binary, Acc/binary>>). >>>> >>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L657 >>>> >>>> Define USE_SRTP_EXT in ssl_handshake.hrl >>>> -define(USE_SRTP_EXT, 14). >>>> >>>> Add use_srtp to the hello_extensions record: >>>> >>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.hrl#L100 >>>> >>>> Add use_srtp to hello_extensions_list >>>> >>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L1826 >>>> >>>> Add use_srtp to client_hello_extensions >>>> >>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L968 >>>> >>>> Add use_srtp to the #ssl_options record >>>> >>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_internal.hrl#L111 >>>> >>>> [1] https://tools.ietf.org/html/rfc5764#section-4.1 >>>> >>>> Thanks >>>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -- > -- > Dipl.-Inform. Andreas Schultz > > ----------------------- enabling your networks ---------------------- > Travelping GmbH Phone: +49-391-81 90 99 0 > Roentgenstr. 13 Fax: +49-391-81 90 99 299 > 39108 Magdeburg Email: info@REDACTED > GERMANY Web: http://www.travelping.com > > Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 > Geschaeftsfuehrer: Holger Winkelmann VAT ID No.: DE236673780 > --------------------------------------------------------------------- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.browitt@REDACTED Tue Oct 9 06:56:20 2018 From: ben.browitt@REDACTED (Ben Browitt) Date: Tue, 9 Oct 2018 07:56:20 +0300 Subject: [erlang-questions] use_srtp extension for DTLS In-Reply-To: References: Message-ID: I'm trying to do something similar to what suggested in this thread [1]. The suggested API from Andreas was: > %% 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()} > Is there a plan to support a this API? If not, how can I use cb_info option with a custom transport module to be able to handle DTLS with other protocols on the same socket? [1] https://groups.google.com/d/msg/erlang-programming/AQk5qGHahyw/toK8UD9PAgAJ On Mon, Oct 8, 2018 at 7:04 PM Ingela Andin wrote: > Hi! > > Den m?n 8 okt. 2018 kl 12:48 skrev Andreas Schultz < > andreas.schultz@REDACTED>: > >> Hi Ingela, >> >> Ingela Andin schrieb am Mo., 8. Okt. 2018 um >> 12:27 Uhr: >> >>> Hi! >>> >>> Sorry for late answer. Yes there are plans to include it. It extension >>> is also part of TLS-1.3 that has priority over DTLS at the moment. We have >>> already done >>> >> >> Can't speak for others, but I would prefer if DTLS-1.3 where give the >> same priority as TLS-1.3. >> >> > Well as DTLS is described as a diff against TLS we kind of need the > original first. > > Regards Ingela Erlang/OTP team - Ericsson AB > > > > >> Regards >> Andreas >> >> some internal changes to extension handling to facilitate the >>> implementation of TLS-1.3 and its co-existing with previous versions. This >>> is in first hand planned for OTP-22. >>> >>> Regards Ingela Erlang/OTP Team - Ericsson AB >>> >>> >>> Den m?n 8 okt. 2018 kl 06:58 skrev Ben Browitt : >>> >>>> USE_SRTP is defined in dtls_handshake.hrl [1] but it says it's not >>>> supported. >>>> Are there plans to support it? >>>> >>>> [1] >>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/dtls_handshake.hrl#L64 >>>> >>>> On Mon, Oct 1, 2018 at 11:27 AM Ben Browitt >>>> wrote: >>>> >>>>> DTLS is missing the use_srtp extension required for DTLS-SRTP [1]. >>>>> What's the best way to add it? >>>>> >>>>> We need to encode the extension in ssl_handshake.erl >>>>> encode_hello_extensions([use_srtp | Rest], Acc) -> >>>>> ExtData = <<0,2,0,1,0>>, >>>>> Len = byte_size(ExtData), >>>>> encode_hello_extensions(Rest, <>>>> ?UINT16(Len), ExtData/binary, Acc/binary>>). >>>>> >>>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L657 >>>>> >>>>> Define USE_SRTP_EXT in ssl_handshake.hrl >>>>> -define(USE_SRTP_EXT, 14). >>>>> >>>>> Add use_srtp to the hello_extensions record: >>>>> >>>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.hrl#L100 >>>>> >>>>> Add use_srtp to hello_extensions_list >>>>> >>>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L1826 >>>>> >>>>> Add use_srtp to client_hello_extensions >>>>> >>>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L968 >>>>> >>>>> Add use_srtp to the #ssl_options record >>>>> >>>>> https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_internal.hrl#L111 >>>>> >>>>> [1] https://tools.ietf.org/html/rfc5764#section-4.1 >>>>> >>>>> Thanks >>>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> -- >> -- >> Dipl.-Inform. Andreas Schultz >> >> ----------------------- enabling your networks ---------------------- >> Travelping GmbH Phone: +49-391-81 90 99 0 >> Roentgenstr. 13 Fax: +49-391-81 90 99 299 >> 39108 Magdeburg Email: info@REDACTED >> GERMANY Web: http://www.travelping.com >> >> Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 >> Geschaeftsfuehrer: Holger Winkelmann VAT ID No.: DE236673780 >> --------------------------------------------------------------------- >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gattushivakrishna@REDACTED Tue Oct 9 11:49:45 2018 From: gattushivakrishna@REDACTED (shiva) Date: Tue, 9 Oct 2018 15:19:45 +0530 Subject: [erlang-questions] Issue in killing the process Message-ID: <4f9e347f-a9e8-f422-bcf9-9916581e4a45@utl.in> Hi all, ??? In my application, I spawned a process and registered with a name. That process will do multiple rpc async calls. After making async calls, I tried to kill the process using exit(whereis(process_name), normal) but process is still existing and results of async call are yielded.? Can you please suggest how can I kill the process and results should not be yielded? Regards, Gattu shivakrishna. From zxq9@REDACTED Tue Oct 9 12:15:31 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Tue, 09 Oct 2018 19:15:31 +0900 Subject: [erlang-questions] Issue in killing the process In-Reply-To: <4f9e347f-a9e8-f422-bcf9-9916581e4a45@utl.in> References: <4f9e347f-a9e8-f422-bcf9-9916581e4a45@utl.in> Message-ID: <3591191.U5Mu9ugfT7@takoyaki> On 2018?10?9???? 15?19?45? JST shiva wrote: > In my application, I spawned a process and registered with a name. > That process will do multiple rpc async calls. After making async calls, > I tried to kill the process using exit(whereis(process_name), normal) > but process is still existing and results of async call are yielded. > Can you please suggest how can I kill the process and results should not > be yielded? There are two main ways processes are terminated normally: 1- Simply don't loop. This gives an implicit `exit(normal)`. For example: loop() -> receive {print, Value} -> ok = io:format("Printing value: ~tp~n", [Value]), loop(); retire -> io:format("Bye!~n"); Unexpected -> ok = io:format("Unexpected message: ~tp~n", [Unexpected]), loop() end. If you send this process a message {print, Something} it will print Something. If you send this process a message 'retire' it will exit with the exit message 'normal' by simply failing to call loop/0 again. If you send it anything else it will execute the unexpected message handler. As you can see, you have all the freedom you want to write a vanilla, boring exit simply by not recursing. If you are using gen_server (or any other OTP behavior) then you can have your handle_*/2,3 function return a tuple starting with 'stop'. 2- Have the process explicitly exit on its own by: * Have it call `exit(Reason)` on its own (note that the value of Reason has a system-wide meaning) * If the process is supervised, have it call its supervisor to terminate self(): supervisor:terminate_child(ParentPid, self()) Consider the snippet above can become: loop() -> receive {print, Value} -> ok = io:format("Printing value: ~tp~n", [Value]), loop(); {retire, Reason} -> io:format("Bye!~n"), exit(Reason); Unexpected -> ok = io:format("Unexpected message: ~tp~n", [Unexpected]), loop() end. You *can* kill processes with exit/2, of course, but that is generally reserved for special circumstances. All that said, the most common two ways are to have processes simply run until their tasks are complete (they end without looping or with an explicit call of `exit(normal)`) OR they run forever because they are central to the system and therefore can be left up to their supervisor to handle. Writing projects in accordance with OTP tends to handle the second case for you. Ephemeral job workers tend to not loop if they are simply one-off parallel tasks, and if they are things like socket client handlers (or similar) then tend to explicitly terminate either with a return value of `{stop, _, _}` or exit(Reason) after doing whatever tidying up needs to be done. Sorry, writing this in a bit of a hurry. Hopefully I explained more than I confused. Termination tends to either get a LOT of attention in cases where the details of it matter or no thought at all in the cases where it doesn't (by far the majority). -Craig From prakash.parmar@REDACTED Tue Oct 9 12:18:20 2018 From: prakash.parmar@REDACTED (Prakash Parmar) Date: Tue, 9 Oct 2018 10:18:20 +0000 Subject: [erlang-questions] Issue in killing the process In-Reply-To: <4f9e347f-a9e8-f422-bcf9-9916581e4a45@utl.in> References: <4f9e347f-a9e8-f422-bcf9-9916581e4a45@utl.in> Message-ID: As mentioned in exit/2 doc, "... If Reason is the atom normal, Pid does not exit. If it is trapping exits, the exit signal is transformed into a message {'EXIT', From, normal} and delivered to its message queue. ..." use exit(whereis(Pid), Reason), where Reason will be anything than normal . /Cheers Prakash ________________________________ From: erlang-questions-bounces@REDACTED on behalf of shiva Sent: Tuesday, October 9, 2018 3:19:45 PM To: Joe Armstrong; Erlang Questions Subject: [erlang-questions] Issue in killing the process Hi all, In my application, I spawned a process and registered with a name. That process will do multiple rpc async calls. After making async calls, I tried to kill the process using exit(whereis(process_name), normal) but process is still existing and results of async call are yielded. Can you please suggest how can I kill the process and results should not be yielded? Regards, Gattu shivakrishna. _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Tue Oct 9 12:21:38 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Tue, 09 Oct 2018 19:21:38 +0900 Subject: [erlang-questions] Issue in killing the process In-Reply-To: References: <4f9e347f-a9e8-f422-bcf9-9916581e4a45@utl.in> Message-ID: <1709680.6mHy58tJl4@takoyaki> On 2018?10?9???? 10?18?20? JST Prakash Parmar wrote: > As mentioned in exit/2 doc, > > > "... If Reason is the atom normal, Pid does not exit. If it is trapping exits, the exit signal is transformed into a message {'EXIT', From, normal} and delivered to its message queue. ..." > > > use exit(whereis(Pid), Reason), where Reason will be anything than normal . Indeed. Nice catch. I didn't even address the case where the process is trapping exits. Like the old Raid commercial: "A call to `exit(Pid, kill)` kills bugs dead." -Craig From raimo+erlang-questions@REDACTED Tue Oct 9 14:54:27 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Tue, 9 Oct 2018 14:54:27 +0200 Subject: [erlang-questions] Issue in killing the process In-Reply-To: <1709680.6mHy58tJl4@takoyaki> References: <4f9e347f-a9e8-f422-bcf9-9916581e4a45@utl.in> <1709680.6mHy58tJl4@takoyaki> Message-ID: <20181009125427.GA2884@erix.ericsson.se> On Tue, Oct 09, 2018 at 07:21:38PM +0900, zxq9@REDACTED wrote: > On 2018?10?9???? 10?18?20? JST Prakash Parmar wrote: > > As mentioned in exit/2 doc, > > > > > > "... If Reason is the atom normal, Pid does not exit. If it is trapping exits, the exit signal is transformed into a message {'EXIT', From, normal} and delivered to its message queue. ..." > > > > > > use exit(whereis(Pid), Reason), where Reason will be anything than normal . > > Indeed. Nice catch. I didn't even address the case where the process is trapping exits. > > Like the old Raid commercial: "A call to `exit(Pid, kill)` kills bugs dead." > > -Craig Do remember that all signals (and messages) are asynchronous, so if you send exit(Pid, kill) the process Pid will eventually cease to exist, albeit probably sooner than with exit(Pid, die). To be certain that the target process no longer exists you need to monitor its state: Mref = erlang:monitor(process, Pid), exit(Pid, die), receive {'DOWN',Mref,_,_,_} -> ok end, There you have a synchronous exit, which at least in theory also should be used for reason 'kill'... After this you can e.g spawn a new process that registers the same name. This is equivalent to what the supervisors and such does. Regards -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From ahe.sanath@REDACTED Wed Oct 10 13:19:55 2018 From: ahe.sanath@REDACTED (Sanath Prasanna) Date: Wed, 10 Oct 2018 16:49:55 +0530 Subject: [erlang-questions] Erlang Client for Aerospike Message-ID: Hi All, Any one have updated erlang client for aerospike ?? Br, Shehan Note: Seems below client is not support for user defined function with few arguments.. https://github.com/EnvisionX/erlang-aerospike -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Wed Oct 10 17:56:20 2018 From: comptekki@REDACTED (Wes James) Date: Wed, 10 Oct 2018 09:56:20 -0600 Subject: [erlang-questions] Erlang Client for Aerospike In-Reply-To: References: Message-ID: Fork it and add your own features. Need some help with that? https://learnyousomeerlang.com/content -wes On Wed, Oct 10, 2018 at 5:20 AM Sanath Prasanna wrote: > Hi All, > Any one have updated erlang client for aerospike ?? > Br, > Shehan > Note: Seems below client is not support for user defined function with few > arguments.. > https://github.com/EnvisionX/erlang-aerospike > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From silviu.cpp@REDACTED Thu Oct 11 12:06:02 2018 From: silviu.cpp@REDACTED (Caragea Silviu) Date: Thu, 11 Oct 2018 13:06:02 +0300 Subject: [erlang-questions] problems with rebar3 releases and on_load functions Message-ID: Hello, I have a project that compiles ok using both rebar and rebar3, also works ok with both If I start it from command line like: erl -pa _build/default/lib/*/ebin -config _build/configs/app.config But is not starting with a rebar3 release. I'm getting a crash like: =erl_crash_dump:0.3 Thu Oct 11 12:55:14 2018 Slogan: Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,erlpool_globals}}},{kernel,start,[normal,[] System version: Erlang/OTP 19 [erts-8.3.5.5] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:true] [dtrace] Compiled: Sat Aug 11 23:57:43 2018 The erlpool_globals code is : https://github.com/silviucpp/erlpool/blob/master/src/erlpool_globals.erl . Basically it's just a stub module that's compiled dynamically and replace at runtime . I created this to avoid static code analyzer errors in IntelliJ. Also it's strange because if I change do_not_load() to return ok it's working :) Any hints ? Silviu -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.a.vinogradov@REDACTED Thu Oct 11 12:12:37 2018 From: g.a.vinogradov@REDACTED (Gleb Vinogradov) Date: Thu, 11 Oct 2018 17:12:37 +0700 Subject: [erlang-questions] problems with rebar3 releases and on_load functions In-Reply-To: References: Message-ID: ??, 11 ???. 2018 ?. ? 17:06, Caragea Silviu : > > Also it's strange because if I change do_not_load() to return ok it's > working :) > > Nothing strange at all. It's documented behaviour: http://erlang.org/doc/reference_manual/code_loading.html "The function must return ok if the module is to become the new current code for the module and become callable. " Gleb -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Thu Oct 11 12:16:29 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Thu, 11 Oct 2018 12:16:29 +0200 Subject: [erlang-questions] problems with rebar3 releases and on_load functions In-Reply-To: References: Message-ID: <18f9c8ef-7b99-efd7-8ab0-e21eae192bb4@ninenines.eu> Presumably your rebar release is using interactive mode (your module isn't loaded at startup) while your rebar3 release is using embedded mode (your mode is loaded at startup). On 10/11/18 12:06 PM, Caragea Silviu wrote: > Hello, > > I have a project that compiles ok using both rebar and rebar3, also > works ok with both If I start it from command line like: > > erl -pa _build/default/lib/*/ebin -config _build/configs/app.config > > But is not starting with a rebar3 release. > > I'm getting a crash like: > > =erl_crash_dump:0.3 > Thu Oct 11 12:55:14 2018 > Slogan: Kernel pid terminated (application_controller) > ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,erlpool_globals}}},{kernel,start,[normal,[] > System version: Erlang/OTP 19 [erts-8.3.5.5] [source] [64-bit] [smp:8:8] > [async-threads:10] [hipe] [kernel-poll:true] [dtrace] > Compiled: Sat Aug 11 23:57:43 2018 > > The erlpool_globals code is : > https://github.com/silviucpp/erlpool/blob/master/src/erlpool_globals.erl > . Basically it's just a stub module that's compiled dynamically and > replace at runtime . I created this to avoid static code analyzer errors > in IntelliJ. > > Also it's strange because if I change do_not_load() to return ok it's > working :) > > Any hints ? > > Silviu > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin https://ninenines.eu From rickard@REDACTED Thu Oct 11 21:57:47 2018 From: rickard@REDACTED (Rickard Green) Date: Thu, 11 Oct 2018 21:57:47 +0200 Subject: [erlang-questions] Patch package OTP 17.5.6.10 released Message-ID: <3a03431e-dec4-2baf-af92-517b80bd40a1@erlang.org> Patch Package: OTP 17.5.6.10 Git Tag: OTP-17.5.6.10 Date: 2018-10-11 Trouble Report Id: OTP-13424, OTP-13866, OTP-13869, OTP-14159, OTP-14514, OTP-14590 Seq num: ERL-340, ERL-474 System: OTP Release: 17 Application: erts-6.4.1.7 Predecessor: OTP 17.5.6.9 Check out the git tag OTP-17.5.6.10, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- erts-6.4.1.7 ---------------------------------------------------- --------------------------------------------------------------------- The erts-6.4.1.7 application can be applied independently of other applications on a full OTP 17 installation. --- Fixed Bugs and Malfunctions --- OTP-13424 Application(s): erts Related Id(s): OTP-10336 A process communicating with a port via one of the erlang:port_* BIFs could potentially end up in an inconsistent state if the port terminated during the communication. When this occurred the process could later block in a receive even though it had messages matching in its message queue. This bug was introduced in erts version 5.10 (OTP R16A). OTP-13866 Application(s): erts Calls to erl_drv_send_term() or erl_drv_output_term() from a non-scheduler thread while the corresponding port was invalid caused the emulator to enter an inconsistent state which eventually caused an emulator crash. OTP-13869 Application(s): erts Driver and NIF operations accessing processes or ports could cause an emulator crash when used from non-scheduler threads. Those operations are: -- erl_drv_send_term() -- driver_send_term() -- erl_drv_output_term() -- driver_output_term() -- enif_send() -- enif_port_command() OTP-14159 Application(s): erts Related Id(s): ERL-340 Fix bug in binary_to_term for binaries created by term_to_binary with option compressed. The bug can cause badarg exception for a valid binary when Erlang VM is linked against a zlib library of version 1.2.9 or newer. Bug exists since OTP 17.0. OTP-14514 Application(s): erts Fixed bug in operator bxor causing erroneuos result when one operand is a big *negative* integer with the lowest N*W bits as zero and the other operand not larger than N*W bits. N is an integer of 1 or larger and W is 32 or 64 depending on word size. OTP-14590 Application(s): erts Related Id(s): ERL-474 Fixed bug in binary_to_term and binary_to_atom that could cause VM crash. Typically happens when the last character of an UTF8 string is in the range 128 to 255, but truncated to only one byte. Bug exists in binary_to_term since ERTS version 5.10.2 (OTP_R16B01) and binary_to_atom since ERTS version 9.0 (OTP-20.0). Full runtime dependencies of erts-6.4.1.7: kernel-3.0, sasl-2.4, stdlib-2.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From vincefoley@REDACTED Thu Oct 11 22:58:00 2018 From: vincefoley@REDACTED (Vince Foley) Date: Thu, 11 Oct 2018 13:58:00 -0700 Subject: [erlang-questions] Seeing inet:start_timer badarg crash Message-ID: Hello there, I'm seeing some crashes in my logs since updating to OTP 21 that I can't quite track down... The exit value looks like this: { :badarg, [ {:erlang, :start_timer, [:inet, #PID<0.17713.363>, :inet], []}, {:inet, :start_timer, 1, [file: 'inet.erl', line: 1763]}, {:inet, :getaddr, 3, [file: 'inet.erl', line: 591]}, {:inet_tcp_dist, :do_setup, 7, [file: 'inet_tcp_dist.erl', line: 289]} ] } It looks like something is going wrong in the distributed node connection system. The result that I can see from this is that the nodes are no longer able to connect to each other. I am using a mechanism other than the standard `epmd` to discover the other nodes, so I'm wondering if a detail changed that I have to adapt to. I'm using `-epmd_module`. The mechanism I'm using is described in this article: https://www.erlang-solutions.com/blog/erlang-and-elixir-distribution-without-epmd.html That might be related but I don't quite see how. Does anyone have any ideas what might be happening here? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From joagre@REDACTED Fri Oct 12 03:06:41 2018 From: joagre@REDACTED (=?utf-8?Q?Joacim_Greben=C3=B6?=) Date: Fri, 12 Oct 2018 03:06:41 +0200 Subject: [erlang-questions] File access in dirty NIFs? Message-ID: Hi, I tried to open some files from my dirty scheduler NIF code: FILE *file; if ((file = fopen(path, "r")) != NULL) { ? It fails. I know. This is probably something I should know about. I don't. Any hints? Cheers /Joakim From rickard@REDACTED Fri Oct 12 18:12:26 2018 From: rickard@REDACTED (Rickard Green) Date: Fri, 12 Oct 2018 18:12:26 +0200 Subject: [erlang-questions] Patch package OTP 21.1.1 released Message-ID: Patch Package: OTP 21.1.1 Git Tag: OTP-21.1.1 Date: 2018-10-12 Trouble Report Id: OTP-14297, OTP-15318, OTP-15333, OTP-15335, OTP-15337, OTP-15342, OTP-15348 Seq num: ERIERL-242, ERL-689, ERL-737, ERL-738, ERL-747 System: OTP Release: 21 Application: compiler-7.2.6, eldap-1.2.6, erts-10.1.1, ssl-9.0.3 Predecessor: OTP 21.1 Check out the git tag OTP-21.1.1, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- compiler-7.2.6 -------------------------------------------------- --------------------------------------------------------------------- The compiler-7.2.6 application can be applied independently of other applications on a full OTP 21 installation. --- Fixed Bugs and Malfunctions --- OTP-15335 Application(s): compiler Related Id(s): ERL-689, OTP-15219 In rare circumstances, the matched out tail of a binary could be the entire original binary. (There was partial correction to this problem in version 7.2.5 of the compiler application.) Full runtime dependencies of compiler-7.2.6: crypto-3.6, erts-9.0, hipe-3.12, kernel-4.0, stdlib-2.5 --------------------------------------------------------------------- --- eldap-1.2.6 ----------------------------------------------------- --------------------------------------------------------------------- The eldap-1.2.6 application can be applied independently of other applications on a full OTP 21 installation. --- Fixed Bugs and Malfunctions --- OTP-15342 Application(s): eldap Related Id(s): ERIERL-242 A race condition at close could cause the eldap client to exit with a badarg message as cause. Full runtime dependencies of eldap-1.2.6: asn1-3.0, erts-6.0, kernel-3.0, ssl-5.3.4, stdlib-2.0 --------------------------------------------------------------------- --- erts-10.1.1 ----------------------------------------------------- --------------------------------------------------------------------- Note! The erts-10.1.1 application can *not* be applied independently of other applications on an arbitrary OTP 21 installation. On a full OTP 21 installation, also the following runtime dependency has to be satisfied: -- kernel-6.1 (first satisfied in OTP 21.1) --- Fixed Bugs and Malfunctions --- OTP-14297 Application(s): erts Related Id(s): OTP-15141 A bug where the socket option 'pktoptions' caused a read of uninitialized memory has been fixed. Would cause malfunction on FreeBSD. OTP-15318 Application(s): erts Fixed a memory leak on errors when reading files. OTP-15333 Application(s): erts Related Id(s): ERL-737 File access through UNC paths works again on Windows. This regression was introduced in OTP 21. Full runtime dependencies of erts-10.1.1: kernel-6.1, sasl-3.0.1, stdlib-3.5 --------------------------------------------------------------------- --- ssl-9.0.3 ------------------------------------------------------- --------------------------------------------------------------------- The ssl-9.0.3 application can be applied independently of other applications on a full OTP 21 installation. --- Fixed Bugs and Malfunctions --- OTP-15337 Application(s): ssl Related Id(s): ERL-738 Correct alert handling with new TLS sender process, from ssl-9.0.2. CLOSE ALERTS could under some circumstances be encoded using an incorrect cipher state. This would cause the peer to regard them as unknown messages. OTP-15348 Application(s): ssl Related Id(s): ERL-747 Correct handling of socket packet option with new TLS sender process, from ssl-9.0.2. When changing the socket option {packet, 1|2|3|4} with ssl:setopts/2 the option must internally be propagated to the sender process as well as the reader process as this particular option also affects the data to be sent. Full runtime dependencies of ssl-9.0.3: crypto-4.2, erts-10.0, inets-5.10.7, kernel-6.0, public_key-1.5, stdlib-3.5 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From frank.muller.erl@REDACTED Fri Oct 12 22:59:22 2018 From: frank.muller.erl@REDACTED (Frank Muller) Date: Fri, 12 Oct 2018 22:59:22 +0200 Subject: [erlang-questions] Patch package OTP 21.1.1 released In-Reply-To: References: Message-ID: Hi Rickard Why it?s not available for download? ?kerl update releases? shows nothing new. /Frank Patch Package: OTP 21.1.1 > Git Tag: OTP-21.1.1 > Date: 2018-10-12 > Trouble Report Id: OTP-14297, OTP-15318, OTP-15333, OTP-15335, > OTP-15337, OTP-15342, OTP-15348 > Seq num: ERIERL-242, ERL-689, ERL-737, ERL-738, > ERL-747 > System: OTP > Release: 21 > Application: compiler-7.2.6, eldap-1.2.6, erts-10.1.1, > ssl-9.0.3 > Predecessor: OTP 21.1 > > Check out the git tag OTP-21.1.1, and build a full OTP system > including documentation. Apply one or more applications from this > build as patches to your installation using the 'otp_patch_apply' > tool. For information on install requirements, see descriptions for > each application version below. > > --------------------------------------------------------------------- > --- compiler-7.2.6 -------------------------------------------------- > --------------------------------------------------------------------- > > The compiler-7.2.6 application can be applied independently of other > applications on a full OTP 21 installation. > > --- Fixed Bugs and Malfunctions --- > > OTP-15335 Application(s): compiler > Related Id(s): ERL-689, OTP-15219 > > In rare circumstances, the matched out tail of a binary > could be the entire original binary. (There was partial > correction to this problem in version 7.2.5 of the > compiler application.) > > > Full runtime dependencies of compiler-7.2.6: crypto-3.6, erts-9.0, > hipe-3.12, kernel-4.0, stdlib-2.5 > > > --------------------------------------------------------------------- > --- eldap-1.2.6 ----------------------------------------------------- > --------------------------------------------------------------------- > > The eldap-1.2.6 application can be applied independently of other > applications on a full OTP 21 installation. > > --- Fixed Bugs and Malfunctions --- > > OTP-15342 Application(s): eldap > Related Id(s): ERIERL-242 > > A race condition at close could cause the eldap client > to exit with a badarg message as cause. > > > Full runtime dependencies of eldap-1.2.6: asn1-3.0, erts-6.0, > kernel-3.0, ssl-5.3.4, stdlib-2.0 > > > --------------------------------------------------------------------- > --- erts-10.1.1 ----------------------------------------------------- > --------------------------------------------------------------------- > > Note! The erts-10.1.1 application can *not* be applied independently > of other applications on an arbitrary OTP 21 installation. > > On a full OTP 21 installation, also the following runtime > dependency has to be satisfied: > -- kernel-6.1 (first satisfied in OTP 21.1) > > > --- Fixed Bugs and Malfunctions --- > > OTP-14297 Application(s): erts > Related Id(s): OTP-15141 > > A bug where the socket option 'pktoptions' caused a > read of uninitialized memory has been fixed. Would > cause malfunction on FreeBSD. > > > OTP-15318 Application(s): erts > > Fixed a memory leak on errors when reading files. > > > OTP-15333 Application(s): erts > Related Id(s): ERL-737 > > File access through UNC paths works again on Windows. > This regression was introduced in OTP 21. > > > Full runtime dependencies of erts-10.1.1: kernel-6.1, sasl-3.0.1, > stdlib-3.5 > > > --------------------------------------------------------------------- > --- ssl-9.0.3 ------------------------------------------------------- > --------------------------------------------------------------------- > > The ssl-9.0.3 application can be applied independently of other > applications on a full OTP 21 installation. > > --- Fixed Bugs and Malfunctions --- > > OTP-15337 Application(s): ssl > Related Id(s): ERL-738 > > Correct alert handling with new TLS sender process, > from ssl-9.0.2. CLOSE ALERTS could under some > circumstances be encoded using an incorrect cipher > state. This would cause the peer to regard them as > unknown messages. > > > OTP-15348 Application(s): ssl > Related Id(s): ERL-747 > > Correct handling of socket packet option with new TLS > sender process, from ssl-9.0.2. When changing the > socket option {packet, 1|2|3|4} with ssl:setopts/2 the > option must internally be propagated to the sender > process as well as the reader process as this > particular option also affects the data to be sent. > > > Full runtime dependencies of ssl-9.0.3: crypto-4.2, erts-10.0, > inets-5.10.7, kernel-6.0, public_key-1.5, stdlib-3.5 > > > --------------------------------------------------------------------- > --------------------------------------------------------------------- > --------------------------------------------------------------------- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Fri Oct 12 23:09:11 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Fri, 12 Oct 2018 23:09:11 +0200 Subject: [erlang-questions] Patch package OTP 21.1.1 released In-Reply-To: References: Message-ID: Patch releases are typically only available as git tags. You can use the git backend in kerl to build it, for example: kerl build git https://github.com/erlang/otp OTP-21.1.1 OTP-21.1.1 On 10/12/18 10:59 PM, Frank Muller wrote: > Hi Rickard > > Why it?s not available for download? > ?kerl update releases? shows nothing new. > > /Frank > > Patch Package:? ? ? ? ? ?OTP 21.1.1 > Git Tag:? ? ? ? ? ? ? ? ?OTP-21.1.1 > Date:? ? ? ? ? ? ? ? ? ? 2018-10-12 > Trouble Report Id:? ? ? ?OTP-14297, OTP-15318, OTP-15333, OTP-15335, > ? ? ? ? ? ? ? ? ? ? ? ? ? OTP-15337, OTP-15342, OTP-15348 > Seq num:? ? ? ? ? ? ? ? ?ERIERL-242, ERL-689, ERL-737, ERL-738, > ? ? ? ? ? ? ? ? ? ? ? ? ? ERL-747 > System:? ? ? ? ? ? ? ? ? OTP > Release:? ? ? ? ? ? ? ? ?21 > Application:? ? ? ? ? ? ?compiler-7.2.6, eldap-1.2.6, erts-10.1.1, > ? ? ? ? ? ? ? ? ? ? ? ? ? ssl-9.0.3 > Predecessor:? ? ? ? ? ? ?OTP 21.1 > > ? Check out the git tag OTP-21.1.1, and build a full OTP system > ? including documentation. Apply one or more applications from this > ? build as patches to your installation using the 'otp_patch_apply' > ? tool. For information on install requirements, see descriptions for > ? each application version below. > > ? --------------------------------------------------------------------- > ? --- compiler-7.2.6 -------------------------------------------------- > ? --------------------------------------------------------------------- > > ? The compiler-7.2.6 application can be applied independently of other > ? applications on a full OTP 21 installation. > > ? --- Fixed Bugs and Malfunctions --- > > ? ?OTP-15335? ? Application(s): compiler > ? ? ? ? ? ? ? ? Related Id(s): ERL-689, OTP-15219 > > ? ? ? ? ? ? ? ? In rare circumstances, the matched out tail of a binary > ? ? ? ? ? ? ? ? could be the entire original binary. (There was partial > ? ? ? ? ? ? ? ? correction to this problem in version 7.2.5 of the > ? ? ? ? ? ? ? ? compiler application.) > > > ? Full runtime dependencies of compiler-7.2.6: crypto-3.6, erts-9.0, > ? hipe-3.12, kernel-4.0, stdlib-2.5 > > > ? --------------------------------------------------------------------- > ? --- eldap-1.2.6 ----------------------------------------------------- > ? --------------------------------------------------------------------- > > ? The eldap-1.2.6 application can be applied independently of other > ? applications on a full OTP 21 installation. > > ? --- Fixed Bugs and Malfunctions --- > > ? ?OTP-15342? ? Application(s): eldap > ? ? ? ? ? ? ? ? Related Id(s): ERIERL-242 > > ? ? ? ? ? ? ? ? A race condition at close could cause the eldap client > ? ? ? ? ? ? ? ? to exit with a badarg message as cause. > > > ? Full runtime dependencies of eldap-1.2.6: asn1-3.0, erts-6.0, > ? kernel-3.0, ssl-5.3.4, stdlib-2.0 > > > ? --------------------------------------------------------------------- > ? --- erts-10.1.1 ----------------------------------------------------- > ? --------------------------------------------------------------------- > > ? Note! The erts-10.1.1 application can *not* be applied independently > ? ? ? ? of other applications on an arbitrary OTP 21 installation. > > ? ? ? ? On a full OTP 21 installation, also the following runtime > ? ? ? ? dependency has to be satisfied: > ? ? ? ? -- kernel-6.1 (first satisfied in OTP 21.1) > > > ? --- Fixed Bugs and Malfunctions --- > > ? ?OTP-14297? ? Application(s): erts > ? ? ? ? ? ? ? ? Related Id(s): OTP-15141 > > ? ? ? ? ? ? ? ? A bug where the socket option 'pktoptions' caused a > ? ? ? ? ? ? ? ? read of uninitialized memory has been fixed. Would > ? ? ? ? ? ? ? ? cause malfunction on FreeBSD. > > > ? ?OTP-15318? ? Application(s): erts > > ? ? ? ? ? ? ? ? Fixed a memory leak on errors when reading files. > > > ? ?OTP-15333? ? Application(s): erts > ? ? ? ? ? ? ? ? Related Id(s): ERL-737 > > ? ? ? ? ? ? ? ? File access through UNC paths works again on Windows. > ? ? ? ? ? ? ? ? This regression was introduced in OTP 21. > > > ? Full runtime dependencies of erts-10.1.1: kernel-6.1, sasl-3.0.1, > ? stdlib-3.5 > > > ? --------------------------------------------------------------------- > ? --- ssl-9.0.3 ------------------------------------------------------- > ? --------------------------------------------------------------------- > > ? The ssl-9.0.3 application can be applied independently of other > ? applications on a full OTP 21 installation. > > ? --- Fixed Bugs and Malfunctions --- > > ? ?OTP-15337? ? Application(s): ssl > ? ? ? ? ? ? ? ? Related Id(s): ERL-738 > > ? ? ? ? ? ? ? ? Correct alert handling with new TLS sender process, > ? ? ? ? ? ? ? ? from ssl-9.0.2. CLOSE ALERTS could under some > ? ? ? ? ? ? ? ? circumstances be encoded using an incorrect cipher > ? ? ? ? ? ? ? ? state. This would cause the peer to regard them as > ? ? ? ? ? ? ? ? unknown messages. > > > ? ?OTP-15348? ? Application(s): ssl > ? ? ? ? ? ? ? ? Related Id(s): ERL-747 > > ? ? ? ? ? ? ? ? Correct handling of socket packet option with new TLS > ? ? ? ? ? ? ? ? sender process, from ssl-9.0.2. When changing the > ? ? ? ? ? ? ? ? socket option {packet, 1|2|3|4} with ssl:setopts/2 the > ? ? ? ? ? ? ? ? option must internally be propagated to the sender > ? ? ? ? ? ? ? ? process as well as the reader process as this > ? ? ? ? ? ? ? ? particular option also affects the data to be sent. > > > ? Full runtime dependencies of ssl-9.0.3: crypto-4.2, erts-10.0, > ? inets-5.10.7, kernel-6.0, public_key-1.5, stdlib-3.5 > > > ? --------------------------------------------------------------------- > ? --------------------------------------------------------------------- > ? --------------------------------------------------------------------- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin https://ninenines.eu From lloyd@REDACTED Fri Oct 12 23:25:41 2018 From: lloyd@REDACTED (lloyd@REDACTED) Date: Fri, 12 Oct 2018 17:25:41 -0400 (EDT) Subject: [erlang-questions] Patch package OTP 21.1.1 released In-Reply-To: References: Message-ID: <1539379541.646928898@apps.rackspace.com> 'Lo all, I've been programming Erlang for some four years now. But I still don't understand how to keep up with and manage releases and patch packages. I worked a bit with kerl at one point thanks to help from a kind person on the list, but I still don't understand how best to integrate kerl into my day-to-day development workflow and so I'm still writing code based on Erlang/OTP 19. Is there anywhere in vast cyberspace a comprehensive tutorial that covers these fundamental issues and how best to keep applications up-to-date with latest and greatest versions of Erlang? Many thanks, LRP -----Original Message----- From: "Rickard Green" Sent: Friday, October 12, 2018 12:12pm To: "erlang-questions@REDACTED" Subject: [erlang-questions] Patch package OTP 21.1.1 released Patch Package: OTP 21.1.1 Git Tag: OTP-21.1.1 Date: 2018-10-12 Trouble Report Id: OTP-14297, OTP-15318, OTP-15333, OTP-15335, OTP-15337, OTP-15342, OTP-15348 Seq num: ERIERL-242, ERL-689, ERL-737, ERL-738, ERL-747 System: OTP Release: 21 Application: compiler-7.2.6, eldap-1.2.6, erts-10.1.1, ssl-9.0.3 Predecessor: OTP 21.1 Check out the git tag OTP-21.1.1, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- compiler-7.2.6 -------------------------------------------------- --------------------------------------------------------------------- The compiler-7.2.6 application can be applied independently of other applications on a full OTP 21 installation. --- Fixed Bugs and Malfunctions --- OTP-15335 Application(s): compiler Related Id(s): ERL-689, OTP-15219 In rare circumstances, the matched out tail of a binary could be the entire original binary. (There was partial correction to this problem in version 7.2.5 of the compiler application.) Full runtime dependencies of compiler-7.2.6: crypto-3.6, erts-9.0, hipe-3.12, kernel-4.0, stdlib-2.5 --------------------------------------------------------------------- --- eldap-1.2.6 ----------------------------------------------------- --------------------------------------------------------------------- The eldap-1.2.6 application can be applied independently of other applications on a full OTP 21 installation. --- Fixed Bugs and Malfunctions --- OTP-15342 Application(s): eldap Related Id(s): ERIERL-242 A race condition at close could cause the eldap client to exit with a badarg message as cause. Full runtime dependencies of eldap-1.2.6: asn1-3.0, erts-6.0, kernel-3.0, ssl-5.3.4, stdlib-2.0 --------------------------------------------------------------------- --- erts-10.1.1 ----------------------------------------------------- --------------------------------------------------------------------- Note! The erts-10.1.1 application can *not* be applied independently of other applications on an arbitrary OTP 21 installation. On a full OTP 21 installation, also the following runtime dependency has to be satisfied: -- kernel-6.1 (first satisfied in OTP 21.1) --- Fixed Bugs and Malfunctions --- OTP-14297 Application(s): erts Related Id(s): OTP-15141 A bug where the socket option 'pktoptions' caused a read of uninitialized memory has been fixed. Would cause malfunction on FreeBSD. OTP-15318 Application(s): erts Fixed a memory leak on errors when reading files. OTP-15333 Application(s): erts Related Id(s): ERL-737 File access through UNC paths works again on Windows. This regression was introduced in OTP 21. Full runtime dependencies of erts-10.1.1: kernel-6.1, sasl-3.0.1, stdlib-3.5 --------------------------------------------------------------------- --- ssl-9.0.3 ------------------------------------------------------- --------------------------------------------------------------------- The ssl-9.0.3 application can be applied independently of other applications on a full OTP 21 installation. --- Fixed Bugs and Malfunctions --- OTP-15337 Application(s): ssl Related Id(s): ERL-738 Correct alert handling with new TLS sender process, from ssl-9.0.2. CLOSE ALERTS could under some circumstances be encoded using an incorrect cipher state. This would cause the peer to regard them as unknown messages. OTP-15348 Application(s): ssl Related Id(s): ERL-747 Correct handling of socket packet option with new TLS sender process, from ssl-9.0.2. When changing the socket option {packet, 1|2|3|4} with ssl:setopts/2 the option must internally be propagated to the sender process as well as the reader process as this particular option also affects the data to be sent. Full runtime dependencies of ssl-9.0.3: crypto-4.2, erts-10.0, inets-5.10.7, kernel-6.0, public_key-1.5, stdlib-3.5 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- _______________________________________________ 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 Fri Oct 12 23:15:18 2018 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Fri, 12 Oct 2018 23:15:18 +0200 Subject: [erlang-questions] Patch package OTP 21.1.1 released In-Reply-To: References: Message-ID: By default kerl uses the erlang.org releases page. The patch tags are not listed there for some reason. To fetch this tag you need to use the fit backend so that kerl fetched things from github. export KERL_BUILD_BACKEND=git Then proceed as usual. I may not have remembered the variable?s name properly, it is described in kerl?s readme though. I opened a PR there so that the default backend be git but I think the argument is about breaking backwards compatibility. Maybe leave a comment there? Please? On Fri 12 Oct 2018 at 22:59, Frank Muller wrote: > Hi Rickard > > Why it?s not available for download? > ?kerl update releases? shows nothing new. > > /Frank > > Patch Package: OTP 21.1.1 >> Git Tag: OTP-21.1.1 >> Date: 2018-10-12 >> Trouble Report Id: OTP-14297, OTP-15318, OTP-15333, OTP-15335, >> OTP-15337, OTP-15342, OTP-15348 >> Seq num: ERIERL-242, ERL-689, ERL-737, ERL-738, >> ERL-747 >> System: OTP >> Release: 21 >> Application: compiler-7.2.6, eldap-1.2.6, erts-10.1.1, >> ssl-9.0.3 >> Predecessor: OTP 21.1 >> >> Check out the git tag OTP-21.1.1, and build a full OTP system >> including documentation. Apply one or more applications from this >> build as patches to your installation using the 'otp_patch_apply' >> tool. For information on install requirements, see descriptions for >> each application version below. >> >> --------------------------------------------------------------------- >> --- compiler-7.2.6 -------------------------------------------------- >> --------------------------------------------------------------------- >> >> The compiler-7.2.6 application can be applied independently of other >> applications on a full OTP 21 installation. >> >> --- Fixed Bugs and Malfunctions --- >> >> OTP-15335 Application(s): compiler >> Related Id(s): ERL-689, OTP-15219 >> >> In rare circumstances, the matched out tail of a binary >> could be the entire original binary. (There was partial >> correction to this problem in version 7.2.5 of the >> compiler application.) >> >> >> Full runtime dependencies of compiler-7.2.6: crypto-3.6, erts-9.0, >> hipe-3.12, kernel-4.0, stdlib-2.5 >> >> >> --------------------------------------------------------------------- >> --- eldap-1.2.6 ----------------------------------------------------- >> --------------------------------------------------------------------- >> >> The eldap-1.2.6 application can be applied independently of other >> applications on a full OTP 21 installation. >> >> --- Fixed Bugs and Malfunctions --- >> >> OTP-15342 Application(s): eldap >> Related Id(s): ERIERL-242 >> >> A race condition at close could cause the eldap client >> to exit with a badarg message as cause. >> >> >> Full runtime dependencies of eldap-1.2.6: asn1-3.0, erts-6.0, >> kernel-3.0, ssl-5.3.4, stdlib-2.0 >> >> >> --------------------------------------------------------------------- >> --- erts-10.1.1 ----------------------------------------------------- >> --------------------------------------------------------------------- >> >> Note! The erts-10.1.1 application can *not* be applied independently >> of other applications on an arbitrary OTP 21 installation. >> >> On a full OTP 21 installation, also the following runtime >> dependency has to be satisfied: >> -- kernel-6.1 (first satisfied in OTP 21.1) >> >> >> --- Fixed Bugs and Malfunctions --- >> >> OTP-14297 Application(s): erts >> Related Id(s): OTP-15141 >> >> A bug where the socket option 'pktoptions' caused a >> read of uninitialized memory has been fixed. Would >> cause malfunction on FreeBSD. >> >> >> OTP-15318 Application(s): erts >> >> Fixed a memory leak on errors when reading files. >> >> >> OTP-15333 Application(s): erts >> Related Id(s): ERL-737 >> >> File access through UNC paths works again on Windows. >> This regression was introduced in OTP 21. >> >> >> Full runtime dependencies of erts-10.1.1: kernel-6.1, sasl-3.0.1, >> stdlib-3.5 >> >> >> --------------------------------------------------------------------- >> --- ssl-9.0.3 ------------------------------------------------------- >> --------------------------------------------------------------------- >> >> The ssl-9.0.3 application can be applied independently of other >> applications on a full OTP 21 installation. >> >> --- Fixed Bugs and Malfunctions --- >> >> OTP-15337 Application(s): ssl >> Related Id(s): ERL-738 >> >> Correct alert handling with new TLS sender process, >> from ssl-9.0.2. CLOSE ALERTS could under some >> circumstances be encoded using an incorrect cipher >> state. This would cause the peer to regard them as >> unknown messages. >> >> >> OTP-15348 Application(s): ssl >> Related Id(s): ERL-747 >> >> Correct handling of socket packet option with new TLS >> sender process, from ssl-9.0.2. When changing the >> socket option {packet, 1|2|3|4} with ssl:setopts/2 the >> option must internally be propagated to the sender >> process as well as the reader process as this >> particular option also affects the data to be sent. >> >> >> Full runtime dependencies of ssl-9.0.3: crypto-4.2, erts-10.0, >> inets-5.10.7, kernel-6.0, public_key-1.5, stdlib-3.5 >> >> >> --------------------------------------------------------------------- >> --------------------------------------------------------------------- >> --------------------------------------------------------------------- >> _______________________________________________ >> 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 > -- Cheers, -- Pierre Fenoll -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.muller.erl@REDACTED Fri Oct 12 23:53:59 2018 From: frank.muller.erl@REDACTED (Frank Muller) Date: Fri, 12 Oct 2018 23:53:59 +0200 Subject: [erlang-questions] Patch package OTP 21.1.1 released In-Reply-To: References: Message-ID: Thanks Lo?c /Frank Patch releases are typically only available as git tags. You can use the > git backend in kerl to build it, for example: > > kerl build git https://github.com/erlang/otp OTP-21.1.1 OTP-21.1.1 > > On 10/12/18 10:59 PM, Frank Muller wrote: > > Hi Rickard > > > > Why it?s not available for download? > > ?kerl update releases? shows nothing new. > > > > /Frank > > > > Patch Package: OTP 21.1.1 > > Git Tag: OTP-21.1.1 > > Date: 2018-10-12 > > Trouble Report Id: OTP-14297, OTP-15318, OTP-15333, OTP-15335, > > OTP-15337, OTP-15342, OTP-15348 > > Seq num: ERIERL-242, ERL-689, ERL-737, ERL-738, > > ERL-747 > > System: OTP > > Release: 21 > > Application: compiler-7.2.6, eldap-1.2.6, erts-10.1.1, > > ssl-9.0.3 > > Predecessor: OTP 21.1 > > > > Check out the git tag OTP-21.1.1, and build a full OTP system > > including documentation. Apply one or more applications from this > > build as patches to your installation using the 'otp_patch_apply' > > tool. For information on install requirements, see descriptions > for > > each application version below. > > > > > --------------------------------------------------------------------- > > --- compiler-7.2.6 > -------------------------------------------------- > > > --------------------------------------------------------------------- > > > > The compiler-7.2.6 application can be applied independently of > other > > applications on a full OTP 21 installation. > > > > --- Fixed Bugs and Malfunctions --- > > > > OTP-15335 Application(s): compiler > > Related Id(s): ERL-689, OTP-15219 > > > > In rare circumstances, the matched out tail of a > binary > > could be the entire original binary. (There was > partial > > correction to this problem in version 7.2.5 of the > > compiler application.) > > > > > > Full runtime dependencies of compiler-7.2.6: crypto-3.6, erts-9.0, > > hipe-3.12, kernel-4.0, stdlib-2.5 > > > > > > > --------------------------------------------------------------------- > > --- eldap-1.2.6 > ----------------------------------------------------- > > > --------------------------------------------------------------------- > > > > The eldap-1.2.6 application can be applied independently of other > > applications on a full OTP 21 installation. > > > > --- Fixed Bugs and Malfunctions --- > > > > OTP-15342 Application(s): eldap > > Related Id(s): ERIERL-242 > > > > A race condition at close could cause the eldap > client > > to exit with a badarg message as cause. > > > > > > Full runtime dependencies of eldap-1.2.6: asn1-3.0, erts-6.0, > > kernel-3.0, ssl-5.3.4, stdlib-2.0 > > > > > > > --------------------------------------------------------------------- > > --- erts-10.1.1 > ----------------------------------------------------- > > > --------------------------------------------------------------------- > > > > Note! The erts-10.1.1 application can *not* be applied > independently > > of other applications on an arbitrary OTP 21 installation. > > > > On a full OTP 21 installation, also the following runtime > > dependency has to be satisfied: > > -- kernel-6.1 (first satisfied in OTP 21.1) > > > > > > --- Fixed Bugs and Malfunctions --- > > > > OTP-14297 Application(s): erts > > Related Id(s): OTP-15141 > > > > A bug where the socket option 'pktoptions' caused a > > read of uninitialized memory has been fixed. Would > > cause malfunction on FreeBSD. > > > > > > OTP-15318 Application(s): erts > > > > Fixed a memory leak on errors when reading files. > > > > > > OTP-15333 Application(s): erts > > Related Id(s): ERL-737 > > > > File access through UNC paths works again on > Windows. > > This regression was introduced in OTP 21. > > > > > > Full runtime dependencies of erts-10.1.1: kernel-6.1, sasl-3.0.1, > > stdlib-3.5 > > > > > > > --------------------------------------------------------------------- > > --- ssl-9.0.3 > ------------------------------------------------------- > > > --------------------------------------------------------------------- > > > > The ssl-9.0.3 application can be applied independently of other > > applications on a full OTP 21 installation. > > > > --- Fixed Bugs and Malfunctions --- > > > > OTP-15337 Application(s): ssl > > Related Id(s): ERL-738 > > > > Correct alert handling with new TLS sender process, > > from ssl-9.0.2. CLOSE ALERTS could under some > > circumstances be encoded using an incorrect cipher > > state. This would cause the peer to regard them as > > unknown messages. > > > > > > OTP-15348 Application(s): ssl > > Related Id(s): ERL-747 > > > > Correct handling of socket packet option with new > TLS > > sender process, from ssl-9.0.2. When changing the > > socket option {packet, 1|2|3|4} with ssl:setopts/2 > the > > option must internally be propagated to the sender > > process as well as the reader process as this > > particular option also affects the data to be sent. > > > > > > Full runtime dependencies of ssl-9.0.3: crypto-4.2, erts-10.0, > > inets-5.10.7, kernel-6.0, public_key-1.5, stdlib-3.5 > > > > > > > --------------------------------------------------------------------- > > > --------------------------------------------------------------------- > > > --------------------------------------------------------------------- > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > Lo?c Hoguin > https://ninenines.eu > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickard@REDACTED Sat Oct 13 02:54:58 2018 From: rickard@REDACTED (Rickard Green) Date: Sat, 13 Oct 2018 02:54:58 +0200 Subject: [erlang-questions] Patch package OTP 21.1.1 released In-Reply-To: References: Message-ID: fre 12 okt. 2018 kl. 23:42 skrev Pierre Fenoll : > By default kerl uses the erlang.org releases page. The patch tags are not > listed there for some reason. > You can find all OTP versions released since OTP 17.0 at: http://erlang.org/download/otp_versions_tree.html Regards, Rickard -- Rickard Green, Erlang/OTP, Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmorneau@REDACTED Sat Oct 13 03:39:48 2018 From: dmorneau@REDACTED (Dominic Morneau) Date: Sat, 13 Oct 2018 10:39:48 +0900 Subject: [erlang-questions] Seeing inet:start_timer badarg crash In-Reply-To: References: Message-ID: Hi Vince, That?s a bug introduced in: https://github.com/erlang/otp/pull/1694 It happens when using an epmd_module that doesn?t implement the optional address_please callback. You can work around it by implementing address_please inside your EpmdClient module exactly like this: https://github.com/erlang/otp/blob/OTP-21.0.3/lib/kernel/src/erl_epmd.erl#L174 Then inet_tcp_dist will pick up your implementation rather than the default case, which is broken because inet.getaddr/3?s last argument is not an address family, it?s a timeout: https://github.com/erlang/otp/blob/OTP-21.0.3/lib/kernel/src/inet_tcp_dist.erl#L450 https://github.com/erlang/otp/blob/OTP-21.0.3/lib/kernel/src/inet_tcp_dist.erl#L289 Dominic 2018?10?12?(?) 5:58 Vince Foley : > Hello there, I'm seeing some crashes in my logs since updating to OTP 21 > that I can't quite track down... > > The exit value looks like this: > > { > :badarg, > [ > {:erlang, :start_timer, [:inet, #PID<0.17713.363>, :inet], []}, > {:inet, :start_timer, 1, [file: 'inet.erl', line: 1763]}, > {:inet, :getaddr, 3, [file: 'inet.erl', line: 591]}, > {:inet_tcp_dist, :do_setup, 7, [file: 'inet_tcp_dist.erl', line: 289]} > ] > } > > It looks like something is going wrong in the distributed node connection > system. The result that I can see from this is that the nodes are no longer > able to connect to each other. > > I am using a mechanism other than the standard `epmd` to discover the > other nodes, so I'm wondering if a detail changed that I have to adapt to. > I'm using `-epmd_module`. The mechanism I'm using is described in this > article: > > > https://www.erlang-solutions.com/blog/erlang-and-elixir-distribution-without-epmd.html > > That might be related but I don't quite see how. Does anyone have any > ideas what might be happening here? > > Thanks! > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincefoley@REDACTED Sat Oct 13 04:54:08 2018 From: vincefoley@REDACTED (Vince Foley) Date: Fri, 12 Oct 2018 19:54:08 -0700 Subject: [erlang-questions] Seeing inet:start_timer badarg crash In-Reply-To: References: Message-ID: This is excellent info, thanks so much! On Fri, Oct 12, 2018 at 6:39 PM Dominic Morneau wrote: > Hi Vince, > > That?s a bug introduced in: > https://github.com/erlang/otp/pull/1694 > > It happens when using an epmd_module that doesn?t implement the optional > address_please callback. > > You can work around it by implementing address_please inside your > EpmdClient module exactly like this: > > https://github.com/erlang/otp/blob/OTP-21.0.3/lib/kernel/src/erl_epmd.erl#L174 > > Then inet_tcp_dist will pick up your implementation rather than the > default case, which is broken because inet.getaddr/3?s last argument is not > an address family, it?s a timeout: > > https://github.com/erlang/otp/blob/OTP-21.0.3/lib/kernel/src/inet_tcp_dist.erl#L450 > > https://github.com/erlang/otp/blob/OTP-21.0.3/lib/kernel/src/inet_tcp_dist.erl#L289 > > Dominic > > 2018?10?12?(?) 5:58 Vince Foley : > >> Hello there, I'm seeing some crashes in my logs since updating to OTP 21 >> that I can't quite track down... >> >> The exit value looks like this: >> >> { >> :badarg, >> [ >> {:erlang, :start_timer, [:inet, #PID<0.17713.363>, :inet], []}, >> {:inet, :start_timer, 1, [file: 'inet.erl', line: 1763]}, >> {:inet, :getaddr, 3, [file: 'inet.erl', line: 591]}, >> {:inet_tcp_dist, :do_setup, 7, [file: 'inet_tcp_dist.erl', line: 289]} >> ] >> } >> >> It looks like something is going wrong in the distributed node connection >> system. The result that I can see from this is that the nodes are no longer >> able to connect to each other. >> >> I am using a mechanism other than the standard `epmd` to discover the >> other nodes, so I'm wondering if a detail changed that I have to adapt to. >> I'm using `-epmd_module`. The mechanism I'm using is described in this >> article: >> >> >> https://www.erlang-solutions.com/blog/erlang-and-elixir-distribution-without-epmd.html >> >> That might be related but I don't quite see how. Does anyone have any >> ideas what might be happening here? >> >> Thanks! >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincefoley@REDACTED Sat Oct 13 07:20:06 2018 From: vincefoley@REDACTED (Vince Foley) Date: Fri, 12 Oct 2018 22:20:06 -0700 Subject: [erlang-questions] Seeing inet:start_timer badarg crash In-Reply-To: References: Message-ID: I'll use the workaround, but I went ahead and took a shot at fixing the bug in erlang here: https://github.com/erlang/otp/pull/1983 On Fri, Oct 12, 2018 at 7:54 PM Vince Foley wrote: > This is excellent info, thanks so much! > > On Fri, Oct 12, 2018 at 6:39 PM Dominic Morneau > wrote: > >> Hi Vince, >> >> That?s a bug introduced in: >> https://github.com/erlang/otp/pull/1694 >> >> It happens when using an epmd_module that doesn?t implement the optional >> address_please callback. >> >> You can work around it by implementing address_please inside your >> EpmdClient module exactly like this: >> >> https://github.com/erlang/otp/blob/OTP-21.0.3/lib/kernel/src/erl_epmd.erl#L174 >> >> Then inet_tcp_dist will pick up your implementation rather than the >> default case, which is broken because inet.getaddr/3?s last argument is not >> an address family, it?s a timeout: >> >> https://github.com/erlang/otp/blob/OTP-21.0.3/lib/kernel/src/inet_tcp_dist.erl#L450 >> >> https://github.com/erlang/otp/blob/OTP-21.0.3/lib/kernel/src/inet_tcp_dist.erl#L289 >> >> Dominic >> >> 2018?10?12?(?) 5:58 Vince Foley : >> >>> Hello there, I'm seeing some crashes in my logs since updating to OTP 21 >>> that I can't quite track down... >>> >>> The exit value looks like this: >>> >>> { >>> :badarg, >>> [ >>> {:erlang, :start_timer, [:inet, #PID<0.17713.363>, :inet], []}, >>> {:inet, :start_timer, 1, [file: 'inet.erl', line: 1763]}, >>> {:inet, :getaddr, 3, [file: 'inet.erl', line: 591]}, >>> {:inet_tcp_dist, :do_setup, 7, [file: 'inet_tcp_dist.erl', line: >>> 289]} >>> ] >>> } >>> >>> It looks like something is going wrong in the distributed node >>> connection system. The result that I can see from this is that the nodes >>> are no longer able to connect to each other. >>> >>> I am using a mechanism other than the standard `epmd` to discover the >>> other nodes, so I'm wondering if a detail changed that I have to adapt to. >>> I'm using `-epmd_module`. The mechanism I'm using is described in this >>> article: >>> >>> >>> https://www.erlang-solutions.com/blog/erlang-and-elixir-distribution-without-epmd.html >>> >>> That might be related but I don't quite see how. Does anyone have any >>> ideas what might be happening here? >>> >>> Thanks! >>> _______________________________________________ >>> 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 Oct 13 07:28:30 2018 From: frank.muller.erl@REDACTED (Frank Muller) Date: Sat, 13 Oct 2018 07:28:30 +0200 Subject: [erlang-questions] Patch package OTP 21.1.1 released In-Reply-To: References: Message-ID: Whenever I tried to compile Erlang from Git source (GitHub) it fails at some point (fails for me with 21.x,20.x). But it just works fine when I used tarballs from erlang.org. Any reason for that? Is there any command to run before compiling from GitHub? /Frank > fre 12 okt. 2018 kl. 23:42 skrev Pierre Fenoll : > >> By default kerl uses the erlang.org releases page. The patch tags are >> not listed there for some reason. >> > > You can find all OTP versions released since OTP 17.0 at: > http://erlang.org/download/otp_versions_tree.html > > Regards, > Rickard > > -- > Rickard Green, Erlang/OTP, Ericsson AB > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickard@REDACTED Sat Oct 13 12:11:45 2018 From: rickard@REDACTED (Rickard Green) Date: Sat, 13 Oct 2018 12:11:45 +0200 Subject: [erlang-questions] Patch package OTP 21.1.1 released In-Reply-To: References: Message-ID: Before compiling a github repo you need to execute ?./otp_build autoconf? in the top directory. Otherwise the same. Regards, Rickard l?r 13 okt. 2018 kl. 07:28 skrev Frank Muller : > Whenever I tried to compile Erlang from Git source (GitHub) it fails at > some point (fails for me with 21.x,20.x). > > But it just works fine when I used tarballs from erlang.org. > > Any reason for that? Is there any command to run before compiling from > GitHub? > > /Frank > > >> fre 12 okt. 2018 kl. 23:42 skrev Pierre Fenoll : >> >>> By default kerl uses the erlang.org releases page. The patch tags are >>> not listed there for some reason. >>> >> >> You can find all OTP versions released since OTP 17.0 at: >> http://erlang.org/download/otp_versions_tree.html >> >> Regards, >> Rickard >> >> -- >> Rickard Green, Erlang/OTP, Ericsson AB >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fly@REDACTED Sat Oct 13 12:24:46 2018 From: fly@REDACTED (Fred Youhanaie) Date: Sat, 13 Oct 2018 11:24:46 +0100 Subject: [erlang-questions] kerl usage (was Patch package OTP 21.1.1 released) In-Reply-To: <1539379541.646928898@apps.rackspace.com> References: <1539379541.646928898@apps.rackspace.com> Message-ID: Hi Lloyd I'm not aware of a tutorial, however, perhaps the following will help. Using kerl is pretty straightforward. Most of the time I use the following sequence to get a new release on my laptop, using Linux+bash. I am assuming that you have already downloaded kerl and it is in your shell path. # kerl keeps a list of the available releases locally, but you need to keep it up to date # this will also print the updated list of the available releases kerl update releases # pick a release from the list, e.g. 21.1 is the latest release as of today # choose a name for the build, e.g. r21.1 is my own convention. # The below command will download and build the 21.1 release. # on my laptop it takes just over 30 minutes. kerl build 21.1 r21.1 # decide on a fresh location for the install, e.g. /opt/erlang-21.1 kerl install r21.1 /opt/erlang-21.1 # once the installation has concluded, you'll see a message similar to the one below # you can use the activate/deactivate commands to switch between versions at will You can activate this installation running the following command: . /opt/erlang-21.1/activate Later on, you can leave the installation typing: kerl_deactivate I have some extra customizations for my needs, but the above should be sufficient to get you started. HTH :-) Cheers, Fred On 12/10/18 22:25, lloyd@REDACTED wrote: > 'Lo all, > > I've been programming Erlang for some four years now. But I still don't understand how to keep up with and manage releases and patch packages. > > I worked a bit with kerl at one point thanks to help from a kind person on the list, but I still don't understand how best to integrate kerl into my day-to-day development workflow and so I'm still > writing code based on Erlang/OTP 19. > > Is there? anywhere in vast cyberspace? a comprehensive tutorial that covers these fundamental issues and how best to keep applications up-to-date with latest and greatest versions of Erlang? > > Many thanks, > > LRP > > -----Original Message----- > From: "Rickard Green" > Sent: Friday, October 12, 2018 12:12pm > To: "erlang-questions@REDACTED" > Subject: [erlang-questions] Patch package OTP 21.1.1 released > > Patch Package: OTP 21.1.1 > Git Tag: OTP-21.1.1 > Date: 2018-10-12 > Trouble Report Id: OTP-14297, OTP-15318, OTP-15333, OTP-15335, > OTP-15337, OTP-15342, OTP-15348 > Seq num: ERIERL-242, ERL-689, ERL-737, ERL-738, > ERL-747 > System: OTP > Release: 21 > Application: compiler-7.2.6, eldap-1.2.6, erts-10.1.1, > ssl-9.0.3 > Predecessor: OTP 21.1 > > Check out the git tag OTP-21.1.1, and build a full OTP system > including documentation. Apply one or more applications from this > build as patches to your installation using the 'otp_patch_apply' > tool. For information on install requirements, see descriptions for > each application version below. > > --------------------------------------------------------------------- > --- compiler-7.2.6 -------------------------------------------------- > --------------------------------------------------------------------- > > The compiler-7.2.6 application can be applied independently of other > applications on a full OTP 21 installation. > > --- Fixed Bugs and Malfunctions --- > > OTP-15335 Application(s): compiler > Related Id(s): ERL-689, OTP-15219 > > In rare circumstances, the matched out tail of a binary > could be the entire original binary. (There was partial > correction to this problem in version 7.2.5 of the > compiler application.) > > > Full runtime dependencies of compiler-7.2.6: crypto-3.6, erts-9.0, > hipe-3.12, kernel-4.0, stdlib-2.5 > > > --------------------------------------------------------------------- > --- eldap-1.2.6 ----------------------------------------------------- > --------------------------------------------------------------------- > > The eldap-1.2.6 application can be applied independently of other > applications on a full OTP 21 installation. > > --- Fixed Bugs and Malfunctions --- > > OTP-15342 Application(s): eldap > Related Id(s): ERIERL-242 > > A race condition at close could cause the eldap client > to exit with a badarg message as cause. > > > Full runtime dependencies of eldap-1.2.6: asn1-3.0, erts-6.0, > kernel-3.0, ssl-5.3.4, stdlib-2.0 > > > --------------------------------------------------------------------- > --- erts-10.1.1 ----------------------------------------------------- > --------------------------------------------------------------------- > > Note! The erts-10.1.1 application can *not* be applied independently > of other applications on an arbitrary OTP 21 installation. > > On a full OTP 21 installation, also the following runtime > dependency has to be satisfied: > -- kernel-6.1 (first satisfied in OTP 21.1) > > > --- Fixed Bugs and Malfunctions --- > > OTP-14297 Application(s): erts > Related Id(s): OTP-15141 > > A bug where the socket option 'pktoptions' caused a > read of uninitialized memory has been fixed. Would > cause malfunction on FreeBSD. > > > OTP-15318 Application(s): erts > > Fixed a memory leak on errors when reading files. > > > OTP-15333 Application(s): erts > Related Id(s): ERL-737 > > File access through UNC paths works again on Windows. > This regression was introduced in OTP 21. > > > Full runtime dependencies of erts-10.1.1: kernel-6.1, sasl-3.0.1, > stdlib-3.5 > > > --------------------------------------------------------------------- > --- ssl-9.0.3 ------------------------------------------------------- > --------------------------------------------------------------------- > > The ssl-9.0.3 application can be applied independently of other > applications on a full OTP 21 installation. > > --- Fixed Bugs and Malfunctions --- > > OTP-15337 Application(s): ssl > Related Id(s): ERL-738 > > Correct alert handling with new TLS sender process, > from ssl-9.0.2. CLOSE ALERTS could under some > circumstances be encoded using an incorrect cipher > state. This would cause the peer to regard them as > unknown messages. > > > OTP-15348 Application(s): ssl > Related Id(s): ERL-747 > > Correct handling of socket packet option with new TLS > sender process, from ssl-9.0.2. When changing the > socket option {packet, 1|2|3|4} with ssl:setopts/2 the > option must internally be propagated to the sender > process as well as the reader process as this > particular option also affects the data to be sent. > > > Full runtime dependencies of ssl-9.0.3: crypto-4.2, erts-10.0, > inets-5.10.7, kernel-6.0, public_key-1.5, stdlib-3.5 > > > --------------------------------------------------------------------- > --------------------------------------------------------------------- > --------------------------------------------------------------------- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From rickard@REDACTED Sat Oct 13 14:28:27 2018 From: rickard@REDACTED (Rickard Green) Date: Sat, 13 Oct 2018 14:28:27 +0200 Subject: [erlang-questions] Patch package OTP 21.1.1 released In-Reply-To: References: Message-ID: On Sat, Oct 13, 2018 at 2:54 AM Rickard Green wrote: > > fre 12 okt. 2018 kl. 23:42 skrev Pierre Fenoll : > >> By default kerl uses the erlang.org releases page. The patch tags are >> not listed there for some reason. >> > > You can find all OTP versions released since OTP 17.0 at: > http://erlang.org/download/otp_versions_tree.html > > If you want to automate the detection of new OTP versions, it is better to retrieve the 'otp_versions.table' file from the master branch (for example via ) which always contains all released OTP versions. The format of the 'otp_versions.table' file is described in the documentation < http://erlang.org/doc/system_principles/versions.html#otp-versions-table>. Regards, Rickard -- Rickard Green, Erlang/OTP, Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From gomoripeti@REDACTED Sat Oct 13 15:01:21 2018 From: gomoripeti@REDACTED (=?UTF-8?B?UGV0aSBHw7Ztw7ZyaQ==?=) Date: Sat, 13 Oct 2018 15:01:21 +0200 Subject: [erlang-questions] How to force dialyzer that a function will return? Message-ID: Hi, Let's say I have a function that does a bad thing, but I now it will actually return. I can use the `-dialyzer` module attribute to silence the warning about the particular function, but is there any way to convince dialyzer to ignore that warning and assume that the function will return (and consequently all other functions calling it will also return). For example for the below module dialyzer still warns: dt.erl:6: Function outer/0 has no local return ``` -module(dt). -export([outer/0]). -dialyzer({nowarn_function, inner/0}). outer() -> inner(). inner() -> Dict = dict:new(), element(2, Dict). ``` (this is just an example, I dont want to decompose a dict) thanks Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: From rtrlists@REDACTED Sat Oct 13 16:57:02 2018 From: rtrlists@REDACTED (Robert Raschke) Date: Sat, 13 Oct 2018 16:57:02 +0200 Subject: [erlang-questions] How to force dialyzer that a function will return? In-Reply-To: References: Message-ID: Hi Peti, that dialyzer warning usually really means what it says, unfortunately without pointing out where exactly the path is that leads to "no return". In my experience, it is worth investigating where your code may end up with an error that leads to a crash. And not try to silence the warning. Cheers, Robby On Sat, 13 Oct 2018 15:01 Peti G?m?ri, wrote: > Hi, > > Let's say I have a function that does a bad thing, but I now it will > actually return. I can use the `-dialyzer` module attribute to silence the > warning about the particular function, but is there any way to convince > dialyzer to ignore that warning and assume that the function will return > (and consequently all other functions calling it will also return). > > For example for the below module dialyzer still warns: > dt.erl:6: Function outer/0 has no local return > > ``` > -module(dt). > -export([outer/0]). > > -dialyzer({nowarn_function, inner/0}). > > outer() -> > inner(). > > inner() -> > Dict = dict:new(), > element(2, Dict). > ``` > > (this is just an example, I dont want to decompose a dict) > > thanks > Peter > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Sat Oct 13 17:17:53 2018 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Sat, 13 Oct 2018 11:17:53 -0400 Subject: [erlang-questions] kerl usage (was Patch package OTP 21.1.1 released) In-Reply-To: References: <1539379541.646928898@apps.rackspace.com> Message-ID: <251D4A82-CEAE-4D7D-A735-6C0697702F37@writersglen.com> Big help! Do you bring a new release into kerl as soon as it?s announced? Or wait for it?s been in the field long enough to turn up bugs? Many thanks, Lloyd Sent from my iPad > On Oct 13, 2018, at 6:24 AM, Fred Youhanaie wrote: > > Hi Lloyd > > I'm not aware of a tutorial, however, perhaps the following will help. > > Using kerl is pretty straightforward. Most of the time I use the following sequence to get a new release on my laptop, using Linux+bash. > > I am assuming that you have already downloaded kerl and it is in your shell path. > > > # kerl keeps a list of the available releases locally, but you need to keep it up to date > # this will also print the updated list of the available releases > > kerl update releases > > # pick a release from the list, e.g. 21.1 is the latest release as of today > # choose a name for the build, e.g. r21.1 is my own convention. > # The below command will download and build the 21.1 release. > # on my laptop it takes just over 30 minutes. > > kerl build 21.1 r21.1 > > # decide on a fresh location for the install, e.g. /opt/erlang-21.1 > > kerl install r21.1 /opt/erlang-21.1 > > # once the installation has concluded, you'll see a message similar to the one below > # you can use the activate/deactivate commands to switch between versions at will > > You can activate this installation running the following command: > . /opt/erlang-21.1/activate > Later on, you can leave the installation typing: > kerl_deactivate > > I have some extra customizations for my needs, but the above should be sufficient to get you started. > > HTH :-) > > Cheers, > Fred > >> On 12/10/18 22:25, lloyd@REDACTED wrote: >> 'Lo all, >> I've been programming Erlang for some four years now. But I still don't understand how to keep up with and manage releases and patch packages. >> I worked a bit with kerl at one point thanks to help from a kind person on the list, but I still don't understand how best to integrate kerl into my day-to-day development workflow and so I'm still writing code based on Erlang/OTP 19. >> Is there anywhere in vast cyberspace a comprehensive tutorial that covers these fundamental issues and how best to keep applications up-to-date with latest and greatest versions of Erlang? >> Many thanks, >> LRP >> -----Original Message----- >> From: "Rickard Green" >> Sent: Friday, October 12, 2018 12:12pm >> To: "erlang-questions@REDACTED" >> Subject: [erlang-questions] Patch package OTP 21.1.1 released >> Patch Package: OTP 21.1.1 >> Git Tag: OTP-21.1.1 >> Date: 2018-10-12 >> Trouble Report Id: OTP-14297, OTP-15318, OTP-15333, OTP-15335, >> OTP-15337, OTP-15342, OTP-15348 >> Seq num: ERIERL-242, ERL-689, ERL-737, ERL-738, >> ERL-747 >> System: OTP >> Release: 21 >> Application: compiler-7.2.6, eldap-1.2.6, erts-10.1.1, >> ssl-9.0.3 >> Predecessor: OTP 21.1 >> Check out the git tag OTP-21.1.1, and build a full OTP system >> including documentation. Apply one or more applications from this >> build as patches to your installation using the 'otp_patch_apply' >> tool. For information on install requirements, see descriptions for >> each application version below. >> --------------------------------------------------------------------- >> --- compiler-7.2.6 -------------------------------------------------- >> --------------------------------------------------------------------- >> The compiler-7.2.6 application can be applied independently of other >> applications on a full OTP 21 installation. >> --- Fixed Bugs and Malfunctions --- >> OTP-15335 Application(s): compiler >> Related Id(s): ERL-689, OTP-15219 >> In rare circumstances, the matched out tail of a binary >> could be the entire original binary. (There was partial >> correction to this problem in version 7.2.5 of the >> compiler application.) >> Full runtime dependencies of compiler-7.2.6: crypto-3.6, erts-9.0, >> hipe-3.12, kernel-4.0, stdlib-2.5 >> --------------------------------------------------------------------- >> --- eldap-1.2.6 ----------------------------------------------------- >> --------------------------------------------------------------------- >> The eldap-1.2.6 application can be applied independently of other >> applications on a full OTP 21 installation. >> --- Fixed Bugs and Malfunctions --- >> OTP-15342 Application(s): eldap >> Related Id(s): ERIERL-242 >> A race condition at close could cause the eldap client >> to exit with a badarg message as cause. >> Full runtime dependencies of eldap-1.2.6: asn1-3.0, erts-6.0, >> kernel-3.0, ssl-5.3.4, stdlib-2.0 >> --------------------------------------------------------------------- >> --- erts-10.1.1 ----------------------------------------------------- >> --------------------------------------------------------------------- >> Note! The erts-10.1.1 application can *not* be applied independently >> of other applications on an arbitrary OTP 21 installation. >> On a full OTP 21 installation, also the following runtime >> dependency has to be satisfied: >> -- kernel-6.1 (first satisfied in OTP 21.1) >> --- Fixed Bugs and Malfunctions --- >> OTP-14297 Application(s): erts >> Related Id(s): OTP-15141 >> A bug where the socket option 'pktoptions' caused a >> read of uninitialized memory has been fixed. Would >> cause malfunction on FreeBSD. >> OTP-15318 Application(s): erts >> Fixed a memory leak on errors when reading files. >> OTP-15333 Application(s): erts >> Related Id(s): ERL-737 >> File access through UNC paths works again on Windows. >> This regression was introduced in OTP 21. >> Full runtime dependencies of erts-10.1.1: kernel-6.1, sasl-3.0.1, >> stdlib-3.5 >> --------------------------------------------------------------------- >> --- ssl-9.0.3 ------------------------------------------------------- >> --------------------------------------------------------------------- >> The ssl-9.0.3 application can be applied independently of other >> applications on a full OTP 21 installation. >> --- Fixed Bugs and Malfunctions --- >> OTP-15337 Application(s): ssl >> Related Id(s): ERL-738 >> Correct alert handling with new TLS sender process, >> from ssl-9.0.2. CLOSE ALERTS could under some >> circumstances be encoded using an incorrect cipher >> state. This would cause the peer to regard them as >> unknown messages. >> OTP-15348 Application(s): ssl >> Related Id(s): ERL-747 >> Correct handling of socket packet option with new TLS >> sender process, from ssl-9.0.2. When changing the >> socket option {packet, 1|2|3|4} with ssl:setopts/2 the >> option must internally be propagated to the sender >> process as well as the reader process as this >> particular option also affects the data to be sent. >> Full runtime dependencies of ssl-9.0.3: crypto-4.2, erts-10.0, >> inets-5.10.7, kernel-6.0, public_key-1.5, stdlib-3.5 >> --------------------------------------------------------------------- >> --------------------------------------------------------------------- >> --------------------------------------------------------------------- >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From fly@REDACTED Sat Oct 13 18:19:54 2018 From: fly@REDACTED (Fred Youhanaie) Date: Sat, 13 Oct 2018 17:19:54 +0100 Subject: [erlang-questions] kerl usage (was Patch package OTP 21.1.1 released) In-Reply-To: <251D4A82-CEAE-4D7D-A735-6C0697702F37@writersglen.com> References: <1539379541.646928898@apps.rackspace.com> <251D4A82-CEAE-4D7D-A735-6C0697702F37@writersglen.com> Message-ID: <0716cf88-607d-e9fa-30a0-94d1b25734ae@anydata.co.uk> No, I just install the next version as and when I get the time. Sometimes I skip a release, if there have been multiple releases since my last installation. Cheers, Fred On 13/10/18 16:17, Lloyd R. Prentice wrote: > Big help! > > Do you bring a new release into kerl as soon as it?s announced? Or wait for it?s been in the field long enough to turn up bugs? > > Many thanks, > > Lloyd > > Sent from my iPad > >> On Oct 13, 2018, at 6:24 AM, Fred Youhanaie wrote: >> >> Hi Lloyd >> >> I'm not aware of a tutorial, however, perhaps the following will help. >> >> Using kerl is pretty straightforward. Most of the time I use the following sequence to get a new release on my laptop, using Linux+bash. >> >> I am assuming that you have already downloaded kerl and it is in your shell path. >> >> >> # kerl keeps a list of the available releases locally, but you need to keep it up to date >> # this will also print the updated list of the available releases >> >> kerl update releases >> >> # pick a release from the list, e.g. 21.1 is the latest release as of today >> # choose a name for the build, e.g. r21.1 is my own convention. >> # The below command will download and build the 21.1 release. >> # on my laptop it takes just over 30 minutes. >> >> kerl build 21.1 r21.1 >> >> # decide on a fresh location for the install, e.g. /opt/erlang-21.1 >> >> kerl install r21.1 /opt/erlang-21.1 >> >> # once the installation has concluded, you'll see a message similar to the one below >> # you can use the activate/deactivate commands to switch between versions at will >> >> You can activate this installation running the following command: >> . /opt/erlang-21.1/activate >> Later on, you can leave the installation typing: >> kerl_deactivate >> >> I have some extra customizations for my needs, but the above should be sufficient to get you started. >> >> HTH :-) >> >> Cheers, >> Fred >> >>> On 12/10/18 22:25, lloyd@REDACTED wrote: >>> 'Lo all, >>> I've been programming Erlang for some four years now. But I still don't understand how to keep up with and manage releases and patch packages. >>> I worked a bit with kerl at one point thanks to help from a kind person on the list, but I still don't understand how best to integrate kerl into my day-to-day development workflow and so I'm still writing code based on Erlang/OTP 19. >>> Is there anywhere in vast cyberspace a comprehensive tutorial that covers these fundamental issues and how best to keep applications up-to-date with latest and greatest versions of Erlang? >>> Many thanks, >>> LRP >>> -----Original Message----- >>> From: "Rickard Green" >>> Sent: Friday, October 12, 2018 12:12pm >>> To: "erlang-questions@REDACTED" >>> Subject: [erlang-questions] Patch package OTP 21.1.1 released >>> Patch Package: OTP 21.1.1 >>> Git Tag: OTP-21.1.1 >>> Date: 2018-10-12 >>> Trouble Report Id: OTP-14297, OTP-15318, OTP-15333, OTP-15335, >>> OTP-15337, OTP-15342, OTP-15348 >>> Seq num: ERIERL-242, ERL-689, ERL-737, ERL-738, >>> ERL-747 >>> System: OTP >>> Release: 21 >>> Application: compiler-7.2.6, eldap-1.2.6, erts-10.1.1, >>> ssl-9.0.3 >>> Predecessor: OTP 21.1 >>> Check out the git tag OTP-21.1.1, and build a full OTP system >>> including documentation. Apply one or more applications from this >>> build as patches to your installation using the 'otp_patch_apply' >>> tool. For information on install requirements, see descriptions for >>> each application version below. >>> --------------------------------------------------------------------- >>> --- compiler-7.2.6 -------------------------------------------------- >>> --------------------------------------------------------------------- >>> The compiler-7.2.6 application can be applied independently of other >>> applications on a full OTP 21 installation. >>> --- Fixed Bugs and Malfunctions --- >>> OTP-15335 Application(s): compiler >>> Related Id(s): ERL-689, OTP-15219 >>> In rare circumstances, the matched out tail of a binary >>> could be the entire original binary. (There was partial >>> correction to this problem in version 7.2.5 of the >>> compiler application.) >>> Full runtime dependencies of compiler-7.2.6: crypto-3.6, erts-9.0, >>> hipe-3.12, kernel-4.0, stdlib-2.5 >>> --------------------------------------------------------------------- >>> --- eldap-1.2.6 ----------------------------------------------------- >>> --------------------------------------------------------------------- >>> The eldap-1.2.6 application can be applied independently of other >>> applications on a full OTP 21 installation. >>> --- Fixed Bugs and Malfunctions --- >>> OTP-15342 Application(s): eldap >>> Related Id(s): ERIERL-242 >>> A race condition at close could cause the eldap client >>> to exit with a badarg message as cause. >>> Full runtime dependencies of eldap-1.2.6: asn1-3.0, erts-6.0, >>> kernel-3.0, ssl-5.3.4, stdlib-2.0 >>> --------------------------------------------------------------------- >>> --- erts-10.1.1 ----------------------------------------------------- >>> --------------------------------------------------------------------- >>> Note! The erts-10.1.1 application can *not* be applied independently >>> of other applications on an arbitrary OTP 21 installation. >>> On a full OTP 21 installation, also the following runtime >>> dependency has to be satisfied: >>> -- kernel-6.1 (first satisfied in OTP 21.1) >>> --- Fixed Bugs and Malfunctions --- >>> OTP-14297 Application(s): erts >>> Related Id(s): OTP-15141 >>> A bug where the socket option 'pktoptions' caused a >>> read of uninitialized memory has been fixed. Would >>> cause malfunction on FreeBSD. >>> OTP-15318 Application(s): erts >>> Fixed a memory leak on errors when reading files. >>> OTP-15333 Application(s): erts >>> Related Id(s): ERL-737 >>> File access through UNC paths works again on Windows. >>> This regression was introduced in OTP 21. >>> Full runtime dependencies of erts-10.1.1: kernel-6.1, sasl-3.0.1, >>> stdlib-3.5 >>> --------------------------------------------------------------------- >>> --- ssl-9.0.3 ------------------------------------------------------- >>> --------------------------------------------------------------------- >>> The ssl-9.0.3 application can be applied independently of other >>> applications on a full OTP 21 installation. >>> --- Fixed Bugs and Malfunctions --- >>> OTP-15337 Application(s): ssl >>> Related Id(s): ERL-738 >>> Correct alert handling with new TLS sender process, >>> from ssl-9.0.2. CLOSE ALERTS could under some >>> circumstances be encoded using an incorrect cipher >>> state. This would cause the peer to regard them as >>> unknown messages. >>> OTP-15348 Application(s): ssl >>> Related Id(s): ERL-747 >>> Correct handling of socket packet option with new TLS >>> sender process, from ssl-9.0.2. When changing the >>> socket option {packet, 1|2|3|4} with ssl:setopts/2 the >>> option must internally be propagated to the sender >>> process as well as the reader process as this >>> particular option also affects the data to be sent. >>> Full runtime dependencies of ssl-9.0.3: crypto-4.2, erts-10.0, >>> inets-5.10.7, kernel-6.0, public_key-1.5, stdlib-3.5 >>> --------------------------------------------------------------------- >>> --------------------------------------------------------------------- >>> --------------------------------------------------------------------- >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From gomoripeti@REDACTED Sat Oct 13 18:37:07 2018 From: gomoripeti@REDACTED (=?UTF-8?B?UGV0aSBHw7Ztw7ZyaQ==?=) Date: Sat, 13 Oct 2018 18:37:07 +0200 Subject: [erlang-questions] How to force dialyzer that a function will return? In-Reply-To: References: Message-ID: Hi Robby, While violation of opacity of data types is a bad, bad thing to do, it wont necessarily result in a crash at runtime. I guess that dialyzer by default infers that inner() function's return success type is none() because of the opacity violation, but I would like to override this, to allow inner() to return something (any()). This way I could check discrepancies in other parts of outer() function (and transitively the whole application) thanks Peter On Sat, Oct 13, 2018 at 4:57 PM Robert Raschke wrote: > Hi Peti, > > that dialyzer warning usually really means what it says, unfortunately > without pointing out where exactly the path is that leads to "no return". > In my experience, it is worth investigating where your code may end up with > an error that leads to a crash. And not try to silence the warning. > > Cheers, > Robby > > > On Sat, 13 Oct 2018 15:01 Peti G?m?ri, wrote: > >> Hi, >> >> Let's say I have a function that does a bad thing, but I now it will >> actually return. I can use the `-dialyzer` module attribute to silence the >> warning about the particular function, but is there any way to convince >> dialyzer to ignore that warning and assume that the function will return >> (and consequently all other functions calling it will also return). >> >> For example for the below module dialyzer still warns: >> dt.erl:6: Function outer/0 has no local return >> >> ``` >> -module(dt). >> -export([outer/0]). >> >> -dialyzer({nowarn_function, inner/0}). >> >> outer() -> >> inner(). >> >> inner() -> >> Dict = dict:new(), >> element(2, Dict). >> ``` >> >> (this is just an example, I dont want to decompose a dict) >> >> thanks >> Peter >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andras.boroska@REDACTED Sat Oct 13 21:46:58 2018 From: andras.boroska@REDACTED (=?UTF-8?Q?Boroska_Andr=C3=A1s?=) Date: Sat, 13 Oct 2018 21:46:58 +0200 Subject: [erlang-questions] kerl usage (was Patch package OTP 21.1.1 released) In-Reply-To: <0716cf88-607d-e9fa-30a0-94d1b25734ae@anydata.co.uk> References: <1539379541.646928898@apps.rackspace.com> <251D4A82-CEAE-4D7D-A735-6C0697702F37@writersglen.com> <0716cf88-607d-e9fa-30a0-94d1b25734ae@anydata.co.uk> Message-ID: Hi! One can also use kerl with a local git repo, thus avoiding the large download before each build by using git fetch. When setting the default install directory in ~/.kerlrc as KERL_DEFAULT_INSTALL_DIR=~/myotpinst the following will install what you wanted: cd ~/github/otp # the git repo git fetch kerl build git ~/github/otp OTP-21.1.1 r21.1.1 kerl install r21.1.1 Andras From rtrlists@REDACTED Sat Oct 13 23:11:22 2018 From: rtrlists@REDACTED (Robert Raschke) Date: Sat, 13 Oct 2018 23:11:22 +0200 Subject: [erlang-questions] How to force dialyzer that a function will return? In-Reply-To: References: Message-ID: When you comment out your nowarn directive, you indeed get told dt.erl:11: The call erlang:element(2,Dict::dict:dict(_,_)) contains an opaque term as 2nd argument when terms of different types are expected in these positions which I'm guessing, is what your real code also gets? I don't think it will be possible to let dialyzer think otherwise. So I would suggest making whatever type you're dealing with non opaque. Or fix the code to not look inside an opaque type :-) Cheers, Robby On Sat, 13 Oct 2018 18:37 Peti G?m?ri, wrote: > Hi Robby, > > While violation of opacity of data types is a bad, bad thing to do, it > wont necessarily result in a crash at runtime. I guess that dialyzer by > default infers that inner() function's return success type is none() > because of the opacity violation, but I would like to override this, to > allow inner() to return something (any()). This way I could check > discrepancies in other parts of outer() function (and transitively the > whole application) > > thanks > Peter > > On Sat, Oct 13, 2018 at 4:57 PM Robert Raschke > wrote: > >> Hi Peti, >> >> that dialyzer warning usually really means what it says, unfortunately >> without pointing out where exactly the path is that leads to "no return". >> In my experience, it is worth investigating where your code may end up with >> an error that leads to a crash. And not try to silence the warning. >> >> Cheers, >> Robby >> >> >> On Sat, 13 Oct 2018 15:01 Peti G?m?ri, wrote: >> >>> Hi, >>> >>> Let's say I have a function that does a bad thing, but I now it will >>> actually return. I can use the `-dialyzer` module attribute to silence the >>> warning about the particular function, but is there any way to convince >>> dialyzer to ignore that warning and assume that the function will return >>> (and consequently all other functions calling it will also return). >>> >>> For example for the below module dialyzer still warns: >>> dt.erl:6: Function outer/0 has no local return >>> >>> ``` >>> -module(dt). >>> -export([outer/0]). >>> >>> -dialyzer({nowarn_function, inner/0}). >>> >>> outer() -> >>> inner(). >>> >>> inner() -> >>> Dict = dict:new(), >>> element(2, Dict). >>> ``` >>> >>> (this is just an example, I dont want to decompose a dict) >>> >>> thanks >>> Peter >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Sun Oct 14 02:08:13 2018 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Sat, 13 Oct 2018 20:08:13 -0400 Subject: [erlang-questions] kerl usage (was Patch package OTP 21.1.1 released) In-Reply-To: References: <1539379541.646928898@apps.rackspace.com> <251D4A82-CEAE-4D7D-A735-6C0697702F37@writersglen.com> <0716cf88-607d-e9fa-30a0-94d1b25734ae@anydata.co.uk> Message-ID: Thanks all for useful tips. Best wishes, LRP Sent from my iPad > On Oct 13, 2018, at 3:46 PM, Boroska Andr?s wrote: > > Hi! > > One can also use kerl with a local git repo, thus avoiding the large > download before each build by using git fetch. > > When setting the default install directory in ~/.kerlrc as > KERL_DEFAULT_INSTALL_DIR=~/myotpinst > > the following will install what you wanted: > > cd ~/github/otp # the git repo > git fetch > kerl build git ~/github/otp OTP-21.1.1 r21.1.1 > kerl install r21.1.1 > > Andras > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From roger@REDACTED Sun Oct 14 14:41:50 2018 From: roger@REDACTED (Roger Lipscombe) Date: Sun, 14 Oct 2018 13:41:50 +0100 Subject: [erlang-questions] Dirty NIF - classifying as CPU or I/O bound Message-ID: The documentation (http://erlang.org/doc/man/erl_nif.html#dirty_nifs) says: "It is important to classify the dirty job correct [sic]. An I/O bound job should be classified as such, and a CPU bound job should be classified as such. If you should classify CPU bound jobs as I/O bound jobs, dirty I/O schedulers might starve ordinary schedulers. I/O bound jobs are expected to either block waiting for I/O, and/or spend a limited amount of time moving data." If I *don't know* whether the job is going to be CPU bound or I/O bound (it executes arbitrary code provided by a third party), am I safest to just classify the dirty job as CPU-bound? Or is this warning hinting at a disaster of biblical proportions[1] if I even *think* about fudging the classification? Thanks, Roger. [1] Dr. Peter Venkman, 1984. -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang.org@REDACTED Sun Oct 14 14:49:26 2018 From: erlang.org@REDACTED (Stanislaw Klekot) Date: Sun, 14 Oct 2018 14:49:26 +0200 Subject: [erlang-questions] Dirty NIF - classifying as CPU or I/O bound In-Reply-To: References: Message-ID: <20181014124926.GA6468@jarowit.net> On Sun, Oct 14, 2018 at 01:41:50PM +0100, Roger Lipscombe wrote: > The documentation (http://erlang.org/doc/man/erl_nif.html#dirty_nifs) says: > > "It is important to classify the dirty job correct [sic]. An I/O bound job > should be classified as such, and a CPU bound job should be classified as > such. If you should classify CPU bound jobs as I/O bound jobs, dirty I/O > schedulers might starve ordinary schedulers. I/O bound jobs are expected to > either block waiting for I/O, and/or spend a limited amount of time moving > data." > > If I *don't know* whether the job is going to be CPU bound or I/O bound (it > executes arbitrary code provided by a third party), am I safest to just > classify the dirty job as CPU-bound? Or is this warning hinting at a > disaster of biblical proportions[1] if I even *think* about fudging the > classification? If you execute a third party code you have no control over, you don't execute it as NIF, but as a separate program through a port (or maybe as a C node). NIFs are not a solution for each and all problems in Erlang. -- Stanislaw Klekot From roger@REDACTED Sun Oct 14 15:03:21 2018 From: roger@REDACTED (Roger Lipscombe) Date: Sun, 14 Oct 2018 14:03:21 +0100 Subject: [erlang-questions] Dirty NIF - classifying as CPU or I/O bound In-Reply-To: <20181014124926.GA6468@jarowit.net> References: <20181014124926.GA6468@jarowit.net> Message-ID: On 14 October 2018 at 13:49, Stanislaw Klekot wrote: > If you execute a third party code you have no control over, you don't > execute it as NIF, but as a separate program through a port (or maybe as > a C node). NIFs are not a solution for each and all problems in Erlang. > I'm aware of the risks. Assume that I'm accepting them. -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang.org@REDACTED Sun Oct 14 15:44:48 2018 From: erlang.org@REDACTED (Stanislaw Klekot) Date: Sun, 14 Oct 2018 15:44:48 +0200 Subject: [erlang-questions] Dirty NIF - classifying as CPU or I/O bound In-Reply-To: References: <20181014124926.GA6468@jarowit.net> Message-ID: <20181014134448.GA12106@jarowit.net> On Sun, Oct 14, 2018 at 02:03:21PM +0100, Roger Lipscombe wrote: > On 14 October 2018 at 13:49, Stanislaw Klekot > wrote: > > > If you execute a third party code you have no control over, you don't > > execute it as NIF, but as a separate program through a port (or maybe as > > a C node). NIFs are not a solution for each and all problems in Erlang. > > > > I'm aware of the risks. Assume that I'm accepting them. Why do you insist on using ill-suited mechanism of NIFs that will most probably destablilize your BEAM machine? Ports were designed specifically so you can easily run foreign code without causing problems to the VM. -- Stanislaw Klekot From jesper.louis.andersen@REDACTED Sun Oct 14 16:46:47 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 14 Oct 2018 16:46:47 +0200 Subject: [erlang-questions] Dirty NIF - classifying as CPU or I/O bound In-Reply-To: References: Message-ID: On Sun, Oct 14, 2018 at 2:42 PM Roger Lipscombe wrote: > If I *don't know* whether the job is going to be CPU bound or I/O bound > (it executes arbitrary code provided by a third party), am I safest to just > classify the dirty job as CPU-bound? Or is this warning hinting at a > disaster of biblical proportions[1] if I even *think* about fudging the > classification? > > Either classification risks being wrong, so you can't really do any of them safely. The two classifications exist because IO resources and CPU resources tend to orthogonally consumed: If we have many IO bound jobs, we can still run CPU bound jobs and vice versa. But if you don't know what kind of job you are looking at a priori, you have no way to classify it correctly. You *could* run it with some kind of sandbox environment and then make a guess: If it were IO bound last time, it probably still is. But this is more involved. -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Sun Oct 14 16:58:43 2018 From: roger@REDACTED (Roger Lipscombe) Date: Sun, 14 Oct 2018 15:58:43 +0100 Subject: [erlang-questions] Dirty NIF - classifying as CPU or I/O bound In-Reply-To: <20181014134448.GA12106@jarowit.net> References: <20181014124926.GA6468@jarowit.net> <20181014134448.GA12106@jarowit.net> Message-ID: On 14 October 2018 at 14:44, Stanislaw Klekot wrote: > Why do you insist on using ill-suited mechanism of NIFs that will > most probably destablilize your BEAM machine? Ports were designed > specifically so you can easily run foreign code without causing problems > to the VM. Why do you insist on *telling me something that I already know*? Assume that there are other things going on (that I'm not going to tell you about, because they're not relevant to the question) that make using a NIF the right trade-off even with the stability risks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Sun Oct 14 17:07:54 2018 From: roger@REDACTED (Roger Lipscombe) Date: Sun, 14 Oct 2018 16:07:54 +0100 Subject: [erlang-questions] Dirty NIF - classifying as CPU or I/O bound In-Reply-To: References: Message-ID: On 14 October 2018 at 15:46, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > On Sun, Oct 14, 2018 at 2:42 PM Roger Lipscombe > wrote: > >> If I *don't know* whether the job is going to be CPU bound or I/O bound >> (it executes arbitrary code provided by a third party), am I safest to just >> classify the dirty job as CPU-bound? Or is this warning hinting at a >> disaster of biblical proportions[1] if I even *think* about fudging the >> classification? >> >> > Either classification risks being wrong, so you can't really do any of > them safely. The two classifications exist because IO resources and CPU > resources tend to orthogonally consumed: If we have many IO bound jobs, we > can still run CPU bound jobs and vice versa. But if you don't know what > kind of job you are looking at a priori, you have no way to classify it > correctly. > Thanks Jesper, I guess my question is rooted in this statement in the docs: "If you should classify CPU bound jobs as I/O bound jobs, dirty I/O schedulers might starve ordinary schedulers." This, to me, implies that I should probably classify unknown jobs as CPU bound, rather than I/O bound, because the documentation only mentions bad things happening one way round. Based on my limited knowledge of how dirty schedulers works, my instinct tells me that classifying jobs as CPU bound when they're I/O bound will probably just be less efficient, whereas classifying jobs as I/O bound when they're CPU bound will result in trying to run too many jobs at once. But I'm just guessing. Cheers, Roger. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Sun Oct 14 17:09:02 2018 From: vinoski@REDACTED (Steve Vinoski) Date: Sun, 14 Oct 2018 11:09:02 -0400 Subject: [erlang-questions] Dirty NIF - classifying as CPU or I/O bound In-Reply-To: References: Message-ID: On Sun, Oct 14, 2018 at 10:47 AM Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > On Sun, Oct 14, 2018 at 2:42 PM Roger Lipscombe > wrote: > >> If I *don't know* whether the job is going to be CPU bound or I/O bound >> (it executes arbitrary code provided by a third party), am I safest to just >> classify the dirty job as CPU-bound? Or is this warning hinting at a >> disaster of biblical proportions[1] if I even *think* about fudging the >> classification? >> >> > Either classification risks being wrong, so you can't really do any of > them safely. The two classifications exist because IO resources and CPU > resources tend to orthogonally consumed: If we have many IO bound jobs, we > can still run CPU bound jobs and vice versa. But if you don't know what > kind of job you are looking at a priori, you have no way to classify it > correctly. > > You *could* run it with some kind of sandbox environment and then make a > guess: If it were IO bound last time, it probably still is. But this is > more involved. > I agree with Jesper, and I'll add that to the best of my knowledge no disaster of biblical proportions will happen if you guess incorrectly. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Sun Oct 14 17:29:12 2018 From: vinoski@REDACTED (Steve Vinoski) Date: Sun, 14 Oct 2018 11:29:12 -0400 Subject: [erlang-questions] Dirty NIF - classifying as CPU or I/O bound In-Reply-To: References: Message-ID: On Sun, Oct 14, 2018 at 11:08 AM Roger Lipscombe wrote: > On 14 October 2018 at 15:46, Jesper Louis Andersen < > jesper.louis.andersen@REDACTED> wrote: > >> On Sun, Oct 14, 2018 at 2:42 PM Roger Lipscombe >> wrote: >> >>> If I *don't know* whether the job is going to be CPU bound or I/O bound >>> (it executes arbitrary code provided by a third party), am I safest to just >>> classify the dirty job as CPU-bound? Or is this warning hinting at a >>> disaster of biblical proportions[1] if I even *think* about fudging the >>> classification? >>> >>> >> Either classification risks being wrong, so you can't really do any of >> them safely. The two classifications exist because IO resources and CPU >> resources tend to orthogonally consumed: If we have many IO bound jobs, we >> can still run CPU bound jobs and vice versa. But if you don't know what >> kind of job you are looking at a priori, you have no way to classify it >> correctly. >> > > Thanks Jesper, I guess my question is rooted in this statement in the docs: > > "If you should classify CPU bound jobs as I/O bound jobs, dirty I/O > schedulers might starve ordinary schedulers." > According to git, Rickard Green wrote this, so I'd take it as advice you shouldn't ignore. This, to me, implies that I should probably classify unknown jobs as CPU > bound, rather than I/O bound, because the documentation only mentions bad > things happening one way round. > That's probably a good approach. One way to mitigate guessing incorrectly would be to teach your jobs to cooperatively yield, if possible. If there are points within the tasks where you can get them to reschedule themselves, then regardless of where they're running, they'll be giving other jobs a chance to run. Based on my limited knowledge of how dirty schedulers works, my instinct > tells me that classifying jobs as CPU bound when they're I/O bound will > probably just be less efficient, whereas classifying jobs as I/O bound when > they're CPU bound will result in trying to run too many jobs at once. But > I'm just guessing. > It would be good if Rickard or Sverker could weigh in here, as I think they know this code best. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Sun Oct 14 17:37:00 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 14 Oct 2018 17:37:00 +0200 Subject: [erlang-questions] Dirty NIF - classifying as CPU or I/O bound In-Reply-To: References: Message-ID: On Sun, Oct 14, 2018 at 5:29 PM Steve Vinoski wrote: > > > On Sun, Oct 14, 2018 at 11:08 AM Roger Lipscombe > wrote: > >> >> "If you should classify CPU bound jobs as I/O bound jobs, dirty I/O >> schedulers might starve ordinary schedulers." >> > > According to git, Rickard Green wrote this, so I'd take it as advice you > shouldn't ignore. > > If we think about the two kinds of jobs: CPU bound jobs will hog a CPU for their whole operation. Thus, we want them to live on their own threads next to the scheduler threads, so they can't stop the scheduler threads. IO bound jobs tend to use the CPU very little but hog the IO resources quite a lot (in particular the disk). Because of this, one might want to run many of these threads, far more than there are CPU cores in the machine, since they'll just block immediately and never use the CPU resources. However, if you accidentally or deliberately assign CPU bound jobs to the IO threads, you might have few scheduler threads and many IO threads in the system. In this case, the kernel might decide to give fair priority to all the threads, in which case the scheduler threads will suffer because of their fewer numbers. Rickard and Sverker will know if there are differences in the strategies of the two kinds of job types, but the above would happen even if they were treated the same. -------------- next part -------------- An HTML attachment was scrubbed... URL: From justin.k.wood@REDACTED Sun Oct 14 19:14:40 2018 From: justin.k.wood@REDACTED (Justin Wood) Date: Sun, 14 Oct 2018 17:14:40 +0000 Subject: [erlang-questions] Understanding which application a pid came from Message-ID: Hello list, I have a situation where I am finding a random pid and asking which application it came from using application:get_application/1. According to the documentation, that function will return undefined if the pid does not belong to any application. When my app runs it is returning undefined for a pid belonging to kernel. I know this because I am outputting erlang:process_info(Pid) and I am seeing registered names such as inet_db and file_server_2. When I check the shell for those applications, it is properly returning {ok, kernel}. I am wondering under what circumstances a pid does not belong to an application? If it makes a difference, I am testing this on OTP 21.0.9. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew@REDACTED Sun Oct 14 21:01:09 2018 From: andrew@REDACTED (Andrew Thompson) Date: Sun, 14 Oct 2018 15:01:09 -0400 Subject: [erlang-questions] [ANN] Alexander 0.1.0 - a call cycle detector for Erlang Message-ID: <20181014190108.GA25490@thecloud.hijacked.us> Here's a weekend project I've been meaning to try for a while. It uses a parse transform to keep track of what processes are blocked doing a synchronous call to another process. If it detects a loop it will throw an exception (with the information on the cycle attached). There's more documentation and background over on github: https://github.com/Vagabond/erlang-alexander I haven't used it in anger yet, but hopefully it proves useful to anyone dealing with mysteriously stuck OTP processes. Andrew From mjtruog@REDACTED Sun Oct 14 22:20:37 2018 From: mjtruog@REDACTED (Michael Truog) Date: Sun, 14 Oct 2018 13:20:37 -0700 Subject: [erlang-questions] Understanding which application a pid came from In-Reply-To: References: Message-ID: <43308259-4af7-f9f3-ce84-7574b91d1186@gmail.com> Hi Justin, Belonging to an application means the Erlang process has its group leader set to an application master that the kernel source code knows about (application_controller:get_application/1 does an ets lookup to find the application associated with the application master).? If you are running Erlang source code that isn't using an application at the top-level, Erlang processes will not have the group_leader set to refer to an application (for example, application:get_application(self()) in the shell).? It is possible to intentionally set the group leader with erlang:group_leader/2 to something that is not an application master, but there are warnings in the documentation about that. Best Regards, Michael On 10/14/2018 10:14 AM, Justin Wood wrote: > Hello list, > > I have a situation where I am finding a random pid and asking which > application it came from using application:get_application/1. > According to the documentation, that function will return undefinedif > the pid does not belong to any application. > > When my app runs it is returning undefinedfor a pid belonging to > kernel. I know this because I am outputting > erlang:process_info(Pid)and I am seeing registered names such as > inet_dband file_server_2. When I check the shell for those > applications, it is properly returning {ok, kernel}. > > I am wondering under what circumstances a pid does not belong to an > application? > > If it makes a difference, I am testing this on OTP 21.0.9. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From sperber@REDACTED Mon Oct 15 10:41:01 2018 From: sperber@REDACTED (Michael Sperber) Date: Mon, 15 Oct 2018 10:41:01 +0200 Subject: [erlang-questions] Call for Contributions: BOB 2019 - Berlin, Mar 22, 2019 Message-ID: Erlang contributions are very welcome at BOB! BOB Conference 2019 "What happens when we use what's best for a change?" http://bobkonf.de/2019/en/cfc.html Berlin, March 22 Call for Contributions Deadline: November 23, 2018 You are actively engaged in advanced software engineering methods, implement ambitious architectures and are open to cutting-edge innovation? Attend this conference, meet people that share your goals, and get to know the best software tools and technologies available today. We strive to offer a day full of new experiences and impressions that you can use to immediately improve your daily life as a software developer. If you share our vision and want to contribute, submit a proposal for a talk or tutorial! NOTE: The conference fee will be waived for presenters. Travel expenses will not be covered (for exceptions see "Speaker Grants"). Speaker Grants BOB has Speaker Grants available to support speakers from groups under-represented in technology. We specifically seek women speakers and speakers who are not be able to attend the conference for financial reasons. Shepherding The program committee offers shepherding to all speakers. Shepherding provides speakers assistance with preparing their sessions, as well as a review of the talk slides. Topics ------ We are looking for talks about best-of-breed software technology, e.g.: - functional programming - persistent data structures and databases - types - formal methods for correctness and robustness - abstractions for concurrency and parallelism - metaprogramming - probabilistic programming - math and programming - controlled side effects - beyond REST and SOAP - effective abstractions for data analytics - ... everything really that isn?t mainstream, but you think should be. Presenters should provide the audience with information that is practically useful for software developers. We're especially interested in experience reports. Other topics are also relevant, e.g.: - introductory talks on technical background - overviews of a given field - demos and how-tos Requirements ------------- We accept proposals for presentations of 45 minutes (40 minutes talk + 5 minutes questions), as well as 90 minute tutorials for beginners. The language of presentation should be either English or German. Your proposal should include (in your presentation language of choice): - An abstract of max. 1500 characters. - A short bio/cv - Contact information (including at least email address) - A list of 3-5 concrete ideas of how your work can be applied in a developer's daily life - additional material (websites, blogs, slides, videos of past presentations, ?) Submit here: https://bobcfc.active-group.de/en/bob2019/cfp Organisation ------------ - Direct questions to contact at bobkonf dot de - Proposal deadline: November 23, 2018 - Notification: December 7, 2018 - Program: December 21, 2018 Program Committee ----------------- (more information here: http://bobkonf.de/2019/en/programmkomitee.html) - Matthias Fischmann, zerobuzz UG - Matthias Neubauer, SICK AG - Nicole Rauch, Softwareentwicklung und Entwicklungscoaching - Michael Sperber, Active Group - Stefan Wehr, factis research Scientific Advisory Board - Annette Bieniusa, TU Kaiserslautern - Torsten Grust, Uni T?bingen - Peter Thiemann, Uni Freiburg From rickard@REDACTED Mon Oct 15 10:59:47 2018 From: rickard@REDACTED (Rickard Green) Date: Mon, 15 Oct 2018 10:59:47 +0200 Subject: [erlang-questions] Dirty NIF - classifying as CPU or I/O bound In-Reply-To: References: Message-ID: On Sun, Oct 14, 2018 at 5:37 PM Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > On Sun, Oct 14, 2018 at 5:29 PM Steve Vinoski wrote: > >> >> >> On Sun, Oct 14, 2018 at 11:08 AM Roger Lipscombe >> wrote: >> >>> >>> "If you should classify CPU bound jobs as I/O bound jobs, dirty I/O >>> schedulers might starve ordinary schedulers." >>> >> >> According to git, Rickard Green wrote this, so I'd take it as advice you >> shouldn't ignore. >> >> > If we think about the two kinds of jobs: > > CPU bound jobs will hog a CPU for their whole operation. Thus, we want > them to live on their own threads next to the scheduler threads, so they > can't stop the scheduler threads. > > IO bound jobs tend to use the CPU very little but hog the IO resources > quite a lot (in particular the disk). Because of this, one might want to > run many of these threads, far more than there are CPU cores in the > machine, since they'll just block immediately and never use the CPU > resources. > > However, if you accidentally or deliberately assign CPU bound jobs to the > IO threads, you might have few scheduler threads and many IO threads in the > system. In this case, the kernel might decide to give fair priority to all > the threads, in which case the scheduler threads will suffer because of > their fewer numbers. > > Rickard and Sverker will know if there are differences in the strategies > of the two kinds of job types, but the above would happen even if they were > treated the same. > > > The above is true. That is, if you are not sure of the jobs characteristics you want to classify it as CPU bound. If you are wrong, and it is actually IO bound and blocks for a very long time it might cause problems for dirty CPU bound jobs, but those problems are typically not as severe as the problems experienced the other way around. Regards, Rickard -- Rickard Green, Erlang/OTP, Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From pekadan@REDACTED Tue Oct 16 01:34:38 2018 From: pekadan@REDACTED (Peter Andersson) Date: Tue, 16 Oct 2018 01:34:38 +0200 Subject: [erlang-questions] Twitter Account Activity API (webhooks) problems Message-ID: Hi, I'm working on an Erlang app interfacing Twitter using the Account Activity API and I can't get the app and default user to pass authentication. I started out using the erlang-oauth lib on github ( https://github.com/tim/erlang-oauth) to generate a valid oauth 1.0 signature, but then Twitter authentication failed and I did my own oauth signing function. My function produced the exact same result as erlang-oauth though (go figure!), so the signature itself is probably not an issue. Maybe I'm not getting the parameters right, or the actual request. Anyone on the list been interfacing Twitter from an Erlang program using webhooks? If so, would you mind sharing some knowledge? I would really appreciate seeing an example of a working webhook URL registration (POST to the account_activity endpoint in user context). Thanks, Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Tue Oct 16 02:33:06 2018 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Mon, 15 Oct 2018 20:33:06 -0400 Subject: [erlang-questions] Twitter Account Activity API (webhooks) problems In-Reply-To: References: Message-ID: <95CACF83-2746-48C7-996F-0A86C9047166@writersglen.com> I?d be much interested in this as well. Best, LRP Sent from my iPad > On Oct 15, 2018, at 7:34 PM, Peter Andersson wrote: > > Hi, > > I'm working on an Erlang app interfacing Twitter using the Account Activity API and I can't get the app and default user to pass authentication. I started out using the erlang-oauth lib on github (https://github.com/tim/erlang-oauth) to generate a valid oauth 1.0 signature, but then Twitter authentication failed and I did my own oauth signing function. My function produced the exact same result as erlang-oauth though (go figure!), so the signature itself is probably not an issue. Maybe I'm not getting the parameters right, or the actual request. > > Anyone on the list been interfacing Twitter from an Erlang program using webhooks? If so, would you mind sharing some knowledge? I would really appreciate seeing an example of a working webhook URL registration (POST to the account_activity endpoint in user context). > > Thanks, > Peter > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan@REDACTED Tue Oct 16 07:25:25 2018 From: ivan@REDACTED (Ivan Uemlianin) Date: Tue, 16 Oct 2018 06:25:25 +0100 Subject: [erlang-questions] Twitter Account Activity API (webhooks) problems In-Reply-To: References: Message-ID: <05452BB7-91AB-4796-A010-093BAD17BE7F@llaisdy.com> Dear Peter I have an old erlang twitter client (using oauth) that used to work. When I get to the office I?ll see if it still works (twitter change their api regularly) & if so might be able to help. It began as a fork of twerl: https://github.com/lucaspiller/twerl Best wishes Ivan -- festina lente > On 16 Oct 2018, at 00:34, Peter Andersson wrote: > > Hi, > > I'm working on an Erlang app interfacing Twitter using the Account Activity API and I can't get the app and default user to pass authentication. I started out using the erlang-oauth lib on github (https://github.com/tim/erlang-oauth) to generate a valid oauth 1.0 signature, but then Twitter authentication failed and I did my own oauth signing function. My function produced the exact same result as erlang-oauth though (go figure!), so the signature itself is probably not an issue. Maybe I'm not getting the parameters right, or the actual request. > > Anyone on the list been interfacing Twitter from an Erlang program using webhooks? If so, would you mind sharing some knowledge? I would really appreciate seeing an example of a working webhook URL registration (POST to the account_activity endpoint in user context). > > Thanks, > Peter > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From pekadan@REDACTED Tue Oct 16 09:50:05 2018 From: pekadan@REDACTED (Peter Andersson) Date: Tue, 16 Oct 2018 09:50:05 +0200 Subject: [erlang-questions] Twitter Account Activity API (webhooks) problems In-Reply-To: <65367675-854E-4A87-82BE-4B70D9F501C1@pobox.com> References: <05452BB7-91AB-4796-A010-093BAD17BE7F@llaisdy.com> <65367675-854E-4A87-82BE-4B70D9F501C1@pobox.com> Message-ID: Excellent! Thanks a lot for the pointers guys! I'll go check it out! As far as I understand, Twitter changed the activity API from a streaming interface to webhooks earlier this year. Don't know if/how the method for authentication changed at the same time, but webhook registration must be new requirement. Peter On Tue, Oct 16, 2018 at 8:32 AM Marc Worrell wrote: > In Zotonic we are using a twerl fork. > > https://github.com/mworrell/twerl.git > > This works well, am on the road so can?t readily checked what we changed. > > - Marc > > > Sent from my iPhone > > On 16 Oct 2018, at 07:25, Ivan Uemlianin wrote: > > Dear Peter > > I have an old erlang twitter client (using oauth) that used to work. When > I get to the office I?ll see if it still works (twitter change their api > regularly) & if so might be able to help. > > It began as a fork of twerl: > > https://github.com/lucaspiller/twerl > > Best wishes > > Ivan > > > -- > festina lente > > > On 16 Oct 2018, at 00:34, Peter Andersson wrote: > > Hi, > > I'm working on an Erlang app interfacing Twitter using the Account > Activity API and I can't get the app and default user to pass > authentication. I started out using the erlang-oauth lib on github ( > https://github.com/tim/erlang-oauth) to generate a valid oauth 1.0 > signature, but then Twitter authentication failed and I did my own oauth > signing function. My function produced the exact same result as > erlang-oauth though (go figure!), so the signature itself is probably not > an issue. Maybe I'm not getting the parameters right, or the actual request. > > Anyone on the list been interfacing Twitter from an Erlang program using > webhooks? If so, would you mind sharing some knowledge? I would really > appreciate seeing an example of a working webhook URL registration (POST to > the account_activity endpoint in user context). > > Thanks, > Peter > > _______________________________________________ > 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 pekadan@REDACTED Tue Oct 16 10:27:53 2018 From: pekadan@REDACTED (Peter Andersson) Date: Tue, 16 Oct 2018 10:27:53 +0200 Subject: [erlang-questions] Twitter Account Activity API (webhooks) problems In-Reply-To: <65367675-854E-4A87-82BE-4B70D9F501C1@pobox.com> References: <05452BB7-91AB-4796-A010-093BAD17BE7F@llaisdy.com> <65367675-854E-4A87-82BE-4B70D9F501C1@pobox.com> Message-ID: Marc, Does your twerl fork actually still work?? If I'm not missing something, it's based on the streaming API that Twitter shut down in August. Is Zotonic using a different twerl fork, or a different Twitter client app altogether? Peter On Tue, Oct 16, 2018 at 8:32 AM Marc Worrell wrote: > In Zotonic we are using a twerl fork. > > https://github.com/mworrell/twerl.git > > This works well, am on the road so can?t readily checked what we changed. > > - Marc > > > Sent from my iPhone > > On 16 Oct 2018, at 07:25, Ivan Uemlianin wrote: > > Dear Peter > > I have an old erlang twitter client (using oauth) that used to work. When > I get to the office I?ll see if it still works (twitter change their api > regularly) & if so might be able to help. > > It began as a fork of twerl: > > https://github.com/lucaspiller/twerl > > Best wishes > > Ivan > > > -- > festina lente > > > On 16 Oct 2018, at 00:34, Peter Andersson wrote: > > Hi, > > I'm working on an Erlang app interfacing Twitter using the Account > Activity API and I can't get the app and default user to pass > authentication. I started out using the erlang-oauth lib on github ( > https://github.com/tim/erlang-oauth) to generate a valid oauth 1.0 > signature, but then Twitter authentication failed and I did my own oauth > signing function. My function produced the exact same result as > erlang-oauth though (go figure!), so the signature itself is probably not > an issue. Maybe I'm not getting the parameters right, or the actual request. > > Anyone on the list been interfacing Twitter from an Erlang program using > webhooks? If so, would you mind sharing some knowledge? I would really > appreciate seeing an example of a working webhook URL registration (POST to > the account_activity endpoint in user context). > > Thanks, > Peter > > _______________________________________________ > 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 marc@REDACTED Tue Oct 16 10:29:51 2018 From: marc@REDACTED (Marc Worrell) Date: Tue, 16 Oct 2018 10:29:51 +0200 Subject: [erlang-questions] Twitter Account Activity API (webhooks) problems In-Reply-To: References: <05452BB7-91AB-4796-A010-093BAD17BE7F@llaisdy.com> <65367675-854E-4A87-82BE-4B70D9F501C1@pobox.com> Message-ID: Yes, the streaming interface have been removed. You can use a free version of the webhooks which should allow you to ?follow? one account. For one of my customers I changed the ingest of tweets to periodic polling of a list of accounts. Which works quite well, if you keep track of the newest tweet id and request changes since that tweet. Still have to do that for the Twitter integration in Zotonic as well? the ingest is broken there since the Twitter API changes. BTW, requesting developer access to the new webhooks can take a while, multiple weeks, so do that soon. - Marc > On 16 Oct 2018, at 09:50, Peter Andersson wrote: > > Excellent! Thanks a lot for the pointers guys! I'll go check it out! > > As far as I understand, Twitter changed the activity API from a streaming interface to webhooks earlier this year. Don't know if/how the method for authentication changed at the same time, but webhook registration must be new requirement. > > Peter > > On Tue, Oct 16, 2018 at 8:32 AM Marc Worrell > wrote: > In Zotonic we are using a twerl fork. > > https://github.com/mworrell/twerl.git > > This works well, am on the road so can?t readily checked what we changed. > > - Marc > > > Sent from my iPhone > > On 16 Oct 2018, at 07:25, Ivan Uemlianin > wrote: > >> Dear Peter >> >> I have an old erlang twitter client (using oauth) that used to work. When I get to the office I?ll see if it still works (twitter change their api regularly) & if so might be able to help. >> >> It began as a fork of twerl: >> >> https://github.com/lucaspiller/twerl >> >> Best wishes >> >> Ivan >> >> >> -- >> festina lente >> >> >> On 16 Oct 2018, at 00:34, Peter Andersson > wrote: >> >>> Hi, >>> >>> I'm working on an Erlang app interfacing Twitter using the Account Activity API and I can't get the app and default user to pass authentication. I started out using the erlang-oauth lib on github (https://github.com/tim/erlang-oauth ) to generate a valid oauth 1.0 signature, but then Twitter authentication failed and I did my own oauth signing function. My function produced the exact same result as erlang-oauth though (go figure!), so the signature itself is probably not an issue. Maybe I'm not getting the parameters right, or the actual request. >>> >>> Anyone on the list been interfacing Twitter from an Erlang program using webhooks? If so, would you mind sharing some knowledge? I would really appreciate seeing an example of a working webhook URL registration (POST to the account_activity endpoint in user context). >>> >>> Thanks, >>> Peter >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc@REDACTED Tue Oct 16 10:34:44 2018 From: marc@REDACTED (Marc Worrell) Date: Tue, 16 Oct 2018 10:34:44 +0200 Subject: [erlang-questions] Twitter Account Activity API (webhooks) problems In-Reply-To: References: <05452BB7-91AB-4796-A010-093BAD17BE7F@llaisdy.com> <65367675-854E-4A87-82BE-4B70D9F501C1@pobox.com> Message-ID: Ah yes? was a bit confused. Forget about twerl and just poll the other Twitter APIs. We use oauth for the authentication and calls. Here are the controllers that do the ?OAuth dance?: https://github.com/zotonic/zotonic/tree/master/apps/zotonic_mod_twitter/src/controllers We use this oauth library (copied from rebar.config): {oauth, ".*", {git, "https://github.com/tim/erlang-oauth.git", {tag, "v1.6.0"}}} - Marc > On 16 Oct 2018, at 10:27, Peter Andersson wrote: > > Marc, > > Does your twerl fork actually still work?? If I'm not missing something, it's based on the streaming API that Twitter shut down in August. Is Zotonic using a different twerl fork, or a different Twitter client app altogether? > > Peter > > On Tue, Oct 16, 2018 at 8:32 AM Marc Worrell > wrote: > In Zotonic we are using a twerl fork. > > https://github.com/mworrell/twerl.git > > This works well, am on the road so can?t readily checked what we changed. > > - Marc > > > Sent from my iPhone > > On 16 Oct 2018, at 07:25, Ivan Uemlianin > wrote: > >> Dear Peter >> >> I have an old erlang twitter client (using oauth) that used to work. When I get to the office I?ll see if it still works (twitter change their api regularly) & if so might be able to help. >> >> It began as a fork of twerl: >> >> https://github.com/lucaspiller/twerl >> >> Best wishes >> >> Ivan >> >> >> -- >> festina lente >> >> >> On 16 Oct 2018, at 00:34, Peter Andersson > wrote: >> >>> Hi, >>> >>> I'm working on an Erlang app interfacing Twitter using the Account Activity API and I can't get the app and default user to pass authentication. I started out using the erlang-oauth lib on github (https://github.com/tim/erlang-oauth ) to generate a valid oauth 1.0 signature, but then Twitter authentication failed and I did my own oauth signing function. My function produced the exact same result as erlang-oauth though (go figure!), so the signature itself is probably not an issue. Maybe I'm not getting the parameters right, or the actual request. >>> >>> Anyone on the list been interfacing Twitter from an Erlang program using webhooks? If so, would you mind sharing some knowledge? I would really appreciate seeing an example of a working webhook URL registration (POST to the account_activity endpoint in user context). >>> >>> Thanks, >>> Peter >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From pekadan@REDACTED Tue Oct 16 14:59:14 2018 From: pekadan@REDACTED (Peter Andersson) Date: Tue, 16 Oct 2018 14:59:14 +0200 Subject: [erlang-questions] Twitter Account Activity API (webhooks) problems In-Reply-To: References: <05452BB7-91AB-4796-A010-093BAD17BE7F@llaisdy.com> <65367675-854E-4A87-82BE-4B70D9F501C1@pobox.com> Message-ID: Thanks a lot Marc for the help and pointers, much appreciated! I'll take a look at your oauth code. Maybe it can give me some new ideas. A polling solution could maybe be a workaround for me, at least until I manage to get that webhook up and running. Peter On Tue, Oct 16, 2018 at 10:34 AM Marc Worrell wrote: > Ah yes? was a bit confused. Forget about twerl and just poll the other > Twitter APIs. > > We use oauth for the authentication and calls. > > Here are the controllers that do the ?OAuth dance?: > > > https://github.com/zotonic/zotonic/tree/master/apps/zotonic_mod_twitter/src/controllers > > We use this oauth library (copied from rebar.config): > > {oauth, ".*", {git, "https://github.com/tim/erlang-oauth.git", {tag, > "v1.6.0"}}} > > > - Marc > > > On 16 Oct 2018, at 10:27, Peter Andersson wrote: > > Marc, > > Does your twerl fork actually still work?? If I'm not missing something, > it's based on the streaming API that Twitter shut down in August. Is > Zotonic using a different twerl fork, or a different Twitter client app > altogether? > > Peter > > On Tue, Oct 16, 2018 at 8:32 AM Marc Worrell wrote: > >> In Zotonic we are using a twerl fork. >> >> https://github.com/mworrell/twerl.git >> >> This works well, am on the road so can?t readily checked what we changed. >> >> - Marc >> >> >> Sent from my iPhone >> >> On 16 Oct 2018, at 07:25, Ivan Uemlianin wrote: >> >> Dear Peter >> >> I have an old erlang twitter client (using oauth) that used to work. When >> I get to the office I?ll see if it still works (twitter change their api >> regularly) & if so might be able to help. >> >> It began as a fork of twerl: >> >> https://github.com/lucaspiller/twerl >> >> Best wishes >> >> Ivan >> >> >> -- >> festina lente >> >> >> On 16 Oct 2018, at 00:34, Peter Andersson wrote: >> >> Hi, >> >> I'm working on an Erlang app interfacing Twitter using the Account >> Activity API and I can't get the app and default user to pass >> authentication. I started out using the erlang-oauth lib on github ( >> https://github.com/tim/erlang-oauth) to generate a valid oauth 1.0 >> signature, but then Twitter authentication failed and I did my own oauth >> signing function. My function produced the exact same result as >> erlang-oauth though (go figure!), so the signature itself is probably not >> an issue. Maybe I'm not getting the parameters right, or the actual request. >> >> Anyone on the list been interfacing Twitter from an Erlang program using >> webhooks? If so, would you mind sharing some knowledge? I would really >> appreciate seeing an example of a working webhook URL registration (POST to >> the account_activity endpoint in user context). >> >> Thanks, >> Peter >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Wed Oct 17 13:01:23 2018 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 17 Oct 2018 13:01:23 +0200 Subject: [erlang-questions] [ANN] rebar3_path_deps a plugin to specify path dependencies in rebar.config Message-ID: I've created a new rebar plugin to handle path dependencies in your projects. This plugin add to rebar the supports of path dependencies which are typically sub-applications that live within one repository. That is useful when you're project is growing over the time and requires to split the dependencies, but you still want to handle everything in one repository for some convenience. The source and full usage doc is there: https://github.com/benoitc/rebar3_path_deps It's already available on hex: https://hex.pm/packages/rebar3_path_deps Hope it helps, Beno?t. -------------- next part -------------- An HTML attachment was scrubbed... URL: From solvip@REDACTED Wed Oct 17 13:08:59 2018 From: solvip@REDACTED (=?UTF-8?B?U8O2bHZpIFDDoWxsIMOBc2dlaXJzc29u?=) Date: Wed, 17 Oct 2018 11:08:59 +0000 Subject: [erlang-questions] [ANN] rebar3_path_deps a plugin to specify path dependencies in rebar.config In-Reply-To: References: Message-ID: *bow* We're doing something similar by hackily abusing _checkouts. This looks much better Thanks for this! S?lvi On Wed, Oct 17, 2018 at 11:02 AM Benoit Chesneau wrote: > > I've created a new rebar plugin to handle path dependencies in your projects. > > This plugin add to rebar the supports of path dependencies which are typically sub-applications that live within one repository. > > That is useful when you're project is growing over the time and requires to split the dependencies, but you still want to handle everything in one repository for some convenience. > > The source and full usage doc is there: https://github.com/benoitc/rebar3_path_deps > > It's already available on hex: > https://hex.pm/packages/rebar3_path_deps > > > Hope it helps, > > > Beno?t. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From alin.popa@REDACTED Wed Oct 17 13:11:42 2018 From: alin.popa@REDACTED (Alin Popa) Date: Wed, 17 Oct 2018 12:11:42 +0100 Subject: [erlang-questions] [ANN] rebar3_path_deps a plugin to specify path dependencies in rebar.config In-Reply-To: References: Message-ID: We've been doing that as well, in a previous company, some time ago https://github.com/alinpopa/rebar3-localdep-plugin Indeed, this particular one looks better. Alin On Wed, Oct 17, 2018 at 12:09 PM S?lvi P?ll ?sgeirsson wrote: > *bow* > > We're doing something similar by hackily abusing _checkouts. > This looks much better > > Thanks for this! > > S?lvi > On Wed, Oct 17, 2018 at 11:02 AM Benoit Chesneau > wrote: > > > > I've created a new rebar plugin to handle path dependencies in your > projects. > > > > This plugin add to rebar the supports of path dependencies which are > typically sub-applications that live within one repository. > > > > That is useful when you're project is growing over the time and > requires to split the dependencies, but you still want to handle everything > in one repository for some convenience. > > > > The source and full usage doc is there: > https://github.com/benoitc/rebar3_path_deps > > > > It's already available on hex: > > https://hex.pm/packages/rebar3_path_deps > > > > > > Hope it helps, > > > > > > Beno?t. > > _______________________________________________ > > 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 pekadan@REDACTED Wed Oct 17 16:32:09 2018 From: pekadan@REDACTED (Peter Andersson) Date: Wed, 17 Oct 2018 16:32:09 +0200 Subject: [erlang-questions] Twitter Account Activity API (webhooks) problems In-Reply-To: References: <05452BB7-91AB-4796-A010-093BAD17BE7F@llaisdy.com> <65367675-854E-4A87-82BE-4B70D9F501C1@pobox.com> Message-ID: Hi Marc, Just wanted to let you know that I got my problem solved thanks to you. I used erlang-oauth to generate the signature, but not to create the POST request to Twitter. It looked to me like the form of the erlang-oauth request did not match the Twitter API spec. However, reading the Zotonic twitter client code I noticed that it uses oauth:post/5, so I checked the form of this POST request again, compared it to my own, and realized I had made mistakes (I must have misunderstood the Twitter API docs). Thanks again for helping! I truly appreciate it! Peter On Tue, Oct 16, 2018 at 2:59 PM Peter Andersson wrote: > Thanks a lot Marc for the help and pointers, much appreciated! > > I'll take a look at your oauth code. Maybe it can give me some new ideas. > > A polling solution could maybe be a workaround for me, at least until I > manage to get that webhook up and running. > > Peter > > On Tue, Oct 16, 2018 at 10:34 AM Marc Worrell wrote: > >> Ah yes? was a bit confused. Forget about twerl and just poll the other >> Twitter APIs. >> >> We use oauth for the authentication and calls. >> >> Here are the controllers that do the ?OAuth dance?: >> >> >> https://github.com/zotonic/zotonic/tree/master/apps/zotonic_mod_twitter/src/controllers >> >> We use this oauth library (copied from rebar.config): >> >> {oauth, ".*", {git, "https://github.com/tim/erlang-oauth.git", {tag, >> "v1.6.0"}}} >> >> >> - Marc >> >> >> On 16 Oct 2018, at 10:27, Peter Andersson wrote: >> >> Marc, >> >> Does your twerl fork actually still work?? If I'm not missing something, >> it's based on the streaming API that Twitter shut down in August. Is >> Zotonic using a different twerl fork, or a different Twitter client app >> altogether? >> >> Peter >> >> On Tue, Oct 16, 2018 at 8:32 AM Marc Worrell wrote: >> >>> In Zotonic we are using a twerl fork. >>> >>> https://github.com/mworrell/twerl.git >>> >>> This works well, am on the road so can?t readily checked what we changed. >>> >>> - Marc >>> >>> >>> Sent from my iPhone >>> >>> On 16 Oct 2018, at 07:25, Ivan Uemlianin wrote: >>> >>> Dear Peter >>> >>> I have an old erlang twitter client (using oauth) that used to work. >>> When I get to the office I?ll see if it still works (twitter change their >>> api regularly) & if so might be able to help. >>> >>> It began as a fork of twerl: >>> >>> https://github.com/lucaspiller/twerl >>> >>> Best wishes >>> >>> Ivan >>> >>> >>> -- >>> festina lente >>> >>> >>> On 16 Oct 2018, at 00:34, Peter Andersson wrote: >>> >>> Hi, >>> >>> I'm working on an Erlang app interfacing Twitter using the Account >>> Activity API and I can't get the app and default user to pass >>> authentication. I started out using the erlang-oauth lib on github ( >>> https://github.com/tim/erlang-oauth) to generate a valid oauth 1.0 >>> signature, but then Twitter authentication failed and I did my own oauth >>> signing function. My function produced the exact same result as >>> erlang-oauth though (go figure!), so the signature itself is probably not >>> an issue. Maybe I'm not getting the parameters right, or the actual request. >>> >>> Anyone on the list been interfacing Twitter from an Erlang program using >>> webhooks? If so, would you mind sharing some knowledge? I would really >>> appreciate seeing an example of a working webhook URL registration (POST to >>> the account_activity endpoint in user context). >>> >>> Thanks, >>> Peter >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From philippdumke@REDACTED Wed Oct 17 16:56:20 2018 From: philippdumke@REDACTED (symk) Date: Wed, 17 Oct 2018 16:56:20 +0200 Subject: [erlang-questions] Block cipher with custom encoding Message-ID: <4DA6F3EF-80DF-4037-B0E3-61D822A6B54C@symk.de> Hi, I'm quite new to programming and Erlang as well. I'm trying to implement a block cipher algorithm. My main problem is the mapping of characters to a corresponding integer value. I do know about the representation of strings in lists but my professor asked for a custom encoding of each character. I approached the problem with a map where I assigned numbers to a map, which I'm reading from the filesystem. I'm using this code to generate the map: build_map(A) -> {ok,Map} = file:consult(A), maps:from_list(Map). The file I'm consulting looks like this: {"A",0}. {"B",1}. {"C",2}. {"D",3}. {"E",4}. ... This function is used for the generation of an integer for the block which a length of K. toBlock(Input, K, Map, Result, Length) -> if K /= 0 -> Tail = tl(Input),NewK = K - 1, Char = string:slice(Input,0,1), TheChar = maps:get(Char,Map,""), Mult = fastExponentiation(Length,K), toBlock(Tail,NewK,Map,Result + (TheChar * Mult),Length); true -> [(Result + maps:get(string:slice(Input,0,1),Map,""))] end. But this approach has certain drawbacks as I'm not able to include all characters I need for this map to work. I?d like to cover at least all printable characters from the latin1 charset. A requirement for the map is, that after the encryption the cipher has to be converted to text again. So all code-points have to be printable. The conversion from String to Integer has to be like A * pow(Len,K) where A is the value of the character, Len the length of the map and K the position of the character inside of the block. Can someone please give me a hint how I could improve my approach? Thanks, Philipp From bchesneau@REDACTED Thu Oct 18 10:21:37 2018 From: bchesneau@REDACTED (Benoit Chesneau) Date: Thu, 18 Oct 2018 10:21:37 +0200 Subject: [erlang-questions] [ANN] rebar3_path_deps a plugin to specify path dependencies in rebar.config In-Reply-To: References: Message-ID: Thanks! To complete, as I was saying on slack I created this plugin with the following goals in mind: 1) having a way to handle dependencies inside a mono repo, which means something I can include and build by profile or another subproject inside of the mono repo. Something that `project_app_dirs` doesn't allow since all apps inside these folders are built (different purpose) 2) have something as simple as you could find in cargo (the rust packager) Ie. it's purpose is really for mono repos. I have updated the readme to reflect its usage. Other differences from `localdep` are: - it doesn't use an environment variables to find the dependencies, the dependencies are related to the rebar.config folder of the top project. - On compilation it checks if the sources have changed and if not will not rebuild the dependency. Hope it will be useful. Beno?t On Wed, Oct 17, 2018 at 1:12 PM Alin Popa wrote: > We've been doing that as well, in a previous company, some time ago > https://github.com/alinpopa/rebar3-localdep-plugin > Indeed, this particular one looks better. > > Alin > > On Wed, Oct 17, 2018 at 12:09 PM S?lvi P?ll ?sgeirsson > wrote: > >> *bow* >> >> We're doing something similar by hackily abusing _checkouts. >> This looks much better >> >> Thanks for this! >> >> S?lvi >> On Wed, Oct 17, 2018 at 11:02 AM Benoit Chesneau >> wrote: >> > >> > I've created a new rebar plugin to handle path dependencies in your >> projects. >> > >> > This plugin add to rebar the supports of path dependencies which are >> typically sub-applications that live within one repository. >> > >> > That is useful when you're project is growing over the time and >> requires to split the dependencies, but you still want to handle everything >> in one repository for some convenience. >> > >> > The source and full usage doc is there: >> https://github.com/benoitc/rebar3_path_deps >> > >> > It's already available on hex: >> > https://hex.pm/packages/rebar3_path_deps >> > >> > >> > Hope it helps, >> > >> > >> > Beno?t. >> > _______________________________________________ >> > 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 cean.ebengt@REDACTED Thu Oct 18 15:00:57 2018 From: cean.ebengt@REDACTED (bengt e) Date: Thu, 18 Oct 2018 15:00:57 +0200 Subject: [erlang-questions] gen_statem and returning {next_event, internal, astate} from init/1 Message-ID: Greetings, Running tests on a gen_statem application they all fail. Directly after callback init/1. I see ** Reason for termination = error:{bad_action_from_state_function, {next_events,internal,reconnect}} This is init, BTW: init() -> {ok, connect, #{}, {next_event, internal, reconnect}}. Looking in gen_statem.erl the calls after init() are (simplified): enter(), where we add a new variable TransOpts (map, is empty) loop_event_actions() loop_event_actions_list() parse_actions(), where if TransOpts is a map, we add a new variable StateCall (boolean, is false) parse_actions() parse_actions_next_event(), where StateCall must be true to actually do this. Is there a way to persuade gen_statem to do parse_actions_next_event(), even if TransOpts is a map? Erlang OTP 20.3 Ubuntu 18.04.1 LTS -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew@REDACTED Thu Oct 18 16:53:54 2018 From: andrew@REDACTED (Andrew Thompson) Date: Thu, 18 Oct 2018 10:53:54 -0400 Subject: [erlang-questions] gen_statem and returning {next_event, internal, astate} from init/1 In-Reply-To: References: Message-ID: <20181018145353.GB25490@thecloud.hijacked.us> On Thu, Oct 18, 2018 at 03:00:57PM +0200, bengt e wrote: > Greetings, > > Running tests on a gen_statem application they all fail. Directly after > callback init/1. I see > ** Reason for termination = error:{bad_action_from_state_function, > {next_events,internal,reconnect}} > This is init, BTW: > init() -> {ok, connect, #{}, {next_event, internal, reconnect}}. > I believe this will work on OTP 21.1, it might be worth trying it there. Andrew From cean.ebengt@REDACTED Thu Oct 18 17:04:17 2018 From: cean.ebengt@REDACTED (bengt e) Date: Thu, 18 Oct 2018 17:04:17 +0200 Subject: [erlang-questions] gen_statem and returning {next_event, internal, astate} from init/1 In-Reply-To: <20181018145353.GB25490@thecloud.hijacked.us> References: <20181018145353.GB25490@thecloud.hijacked.us> Message-ID: Upgrading to 20.3.8.6 solved it. On Thu, Oct 18, 2018 at 4:54 PM Andrew Thompson wrote: > On Thu, Oct 18, 2018 at 03:00:57PM +0200, bengt e wrote: > > Greetings, > > > > Running tests on a gen_statem application they all fail. Directly after > > callback init/1. I see > > ** Reason for termination = error:{bad_action_from_state_function, > > {next_events,internal,reconnect}} > > This is init, BTW: > > init() -> {ok, connect, #{}, {next_event, internal, reconnect}}. > > > > I believe this will work on OTP 21.1, it might be worth trying it there. > > Andrew > _______________________________________________ > 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 Thu Oct 18 17:38:32 2018 From: hans.r.nilsson@REDACTED (Hans Nilsson R) Date: Thu, 18 Oct 2018 15:38:32 +0000 Subject: [erlang-questions] Patch package OTP 20.3.8.10 released Message-ID: Patch Package: OTP 20.3.8.10 Git Tag: OTP-20.3.8.10 Date: 2018-10-18 Trouble Report Id: OTP-15342, OTP-15346 Seq num: ERIERL-242 System: OTP Release: 20 Application: eldap-1.2.3.1, erts-9.3.3.4 Predecessor: OTP 20.3.8.9 Check out the git tag OTP-20.3.8.10, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- eldap-1.2.3.1 --------------------------------------------------- --------------------------------------------------------------------- The eldap-1.2.3.1 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-15342 Application(s): eldap Related Id(s): ERIERL-242 A race condition at close could cause the eldap client to exit with a badarg message as cause. Full runtime dependencies of eldap-1.2.3.1: asn1-3.0, erts-6.0, kernel-3.0, ssl-5.3.4, stdlib-2.0 --------------------------------------------------------------------- --- erts-9.3.3.4 ---------------------------------------------------- --------------------------------------------------------------------- The erts-9.3.3.4 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-15346 Application(s): erts Fixed bug in ets:select_replace when called with a fully bound key could cause a following call to ets:next or ets:prev to crash the emulator or return invalid result. Full runtime dependencies of erts-9.3.3.4: kernel-5.0, sasl-3.0.1, stdlib-3.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: OpenPGP digital signature URL: From thomas.elsgaard@REDACTED Fri Oct 19 06:38:55 2018 From: thomas.elsgaard@REDACTED (Thomas Elsgaard) Date: Fri, 19 Oct 2018 06:38:55 +0200 Subject: [erlang-questions] leader election ? Message-ID: Hi list! I am running 2 instances of an application ( seperate datacenters), both receives indentical data on TCP sockets, but only one of the applications should process it further downstream. Any suggestions to what is the "simplest" way to have a kind of leader election ? Both applications must be running, but must have knowledge about their own role (active or passive) in order to decide if the data should be processed downstream. Should I use an external application like consul or etcd to implement leader election, or is there an better way via OTP or libraries ? It just seems a little "heavy" to use consul or etcd to elect an leader between two application instances. Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Fri Oct 19 09:25:01 2018 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Fri, 19 Oct 2018 10:25:01 +0300 Subject: [erlang-questions] leader election ? In-Reply-To: References: Message-ID: <643280BD-F0E1-4871-8C3C-171460B1795E@gmail.com> Hello, Fasters and easiest way to run a 3rd party service that would handle election/arbitration. However, that option does not give you any engineering challenge =). Unfortunately, you said nothing about your environment. I suspect that separate datacenter does not mean AWS availability zones. The biggest challenge to solve is splits. It is not recommended to run Erlang cluster accross data centres therefore majority or Erlang build-in solutions would not help you. Most of Erlang libraries relies on Erlang distribution. It is a challenge to build a consensus if you have only 2 nodes, it is impossible to make a quorum. Therefore, you need arbiter anyway. Once, I was ?lazy? to setup zookeeper for arbitration purposes then my simplest path was in-memory mnesia + simple REST API but it was way long ago before consul. If you can tolerate last-write-wins that you might do nothing =) Best Regards, Dmitry > On 19 Oct 2018, at 7.38, Thomas Elsgaard wrote: > > Hi list! > > I am running 2 instances of an application ( seperate datacenters), both receives indentical data on TCP sockets, but only one of the applications should process it further downstream. > > Any suggestions to what is the "simplest" way to have a kind of leader election ? Both applications must be running, but must have knowledge about their own role (active or passive) in order to decide if the data should be processed downstream. > > Should I use an external application like consul or etcd to implement leader election, or is there an better way via OTP or libraries ? > > It just seems a little "heavy" to use consul or etcd to elect an leader between two application instances. > > Thomas > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From thomas.elsgaard@REDACTED Fri Oct 19 10:14:07 2018 From: thomas.elsgaard@REDACTED (Thomas Elsgaard) Date: Fri, 19 Oct 2018 10:14:07 +0200 Subject: [erlang-questions] leader election ? In-Reply-To: <643280BD-F0E1-4871-8C3C-171460B1795E@gmail.com> References: <643280BD-F0E1-4871-8C3C-171460B1795E@gmail.com> Message-ID: Hi Dmitry Yeah no fancy cloud, just plain "old school" servers in two datacenters. I could add a third server, that is not an issue. My main concern is to find a reliable solution without too many dependencies or moving parts. In a weak moment i considered to do some pessimistic locking in a MongoDB replica set. But i am worried for strange scenarios which I haven?t thought about. Thomas On Fri, 19 Oct 2018 at 09:25 Dmitry Kolesnikov wrote: > Hello, > > Fasters and easiest way to run a 3rd party service that would handle > election/arbitration. However, that option does not give you any > engineering challenge =). > > Unfortunately, you said nothing about your environment. I suspect that > separate datacenter does not mean AWS availability zones. The biggest > challenge to solve is splits. It is not recommended to run Erlang cluster > accross data centres therefore majority or Erlang build-in solutions would > not help you. Most of Erlang libraries relies on Erlang distribution. > > It is a challenge to build a consensus if you have only 2 nodes, it is > impossible to make a quorum. Therefore, you need arbiter anyway. Once, I > was ?lazy? to setup zookeeper for arbitration purposes then my simplest > path was in-memory mnesia + simple REST API but it was way long ago before > consul. > > If you can tolerate last-write-wins that you might do nothing =) > > Best Regards, > Dmitry > > > On 19 Oct 2018, at 7.38, Thomas Elsgaard > wrote: > > > > Hi list! > > > > I am running 2 instances of an application ( seperate datacenters), both > receives indentical data on TCP sockets, but only one of the applications > should process it further downstream. > > > > Any suggestions to what is the "simplest" way to have a kind of leader > election ? Both applications must be running, but must have knowledge about > their own role (active or passive) in order to decide if the data should be > processed downstream. > > > > Should I use an external application like consul or etcd to implement > leader election, or is there an better way via OTP or libraries ? > > > > It just seems a little "heavy" to use consul or etcd to elect an leader > between two application instances. > > > > Thomas > > > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.r.nohl@REDACTED Fri Oct 19 10:22:44 2018 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Fri, 19 Oct 2018 10:22:44 +0200 Subject: [erlang-questions] leader election ? In-Reply-To: References: Message-ID: Thomas Elsgaard ezt ?rta (id?pont: 2018. okt. 19., P, 6:39): > > Hi list! > > I am running 2 instances of an application ( seperate datacenters), both receives indentical data on TCP sockets, but only one of the applications should process it further downstream. > > Any suggestions to what is the "simplest" way to have a kind of leader election ? Both applications must be running, but must have knowledge about their own role (active or passive) in order to decide if the data should be processed downstream. When the OSPF routing protocol selects a designated router on a broadcast network, it selects the router with the highest router ID (which is the highest IP address of the node, unless otherwise configured, if I remember correctly). So if both nodes are up, select the one with the higher IP address. From freza@REDACTED Fri Oct 19 11:01:12 2018 From: freza@REDACTED (Jachym Holecek) Date: Fri, 19 Oct 2018 05:01:12 -0400 Subject: [erlang-questions] leader election ? In-Reply-To: References: Message-ID: <20181019090112.GA14269@circlewave.net> Hi Thomas, # Thomas Elsgaard 2018-10-19: > I am running 2 instances of an application ( seperate datacenters), both > receives indentical data on TCP sockets, but only one of the applications > should process it further downstream. What does "process it further downstream" entail? Is persitent state being updated on the "primary" node? Are further "downstream" services involved and if so can they participate in your scheme? Do you control the nodes originating the data feeds? What are the worst-case consequences of processing the feed at both nodes for some period of time? What are the consequences of not processing the feed at all for some period of time? > Any suggestions to what is the "simplest" way to have a kind of leader > election ? Both applications must be running, but must have knowledge about > their own role (active or passive) in order to decide if the data should be > processed downstream. >From memory [*] solves this problem although I forgot the exact details of it. Depending on further details it might be that running periodic helthchecks between the two nodes and basing primary/standby roles on current liveness plus static priority suffices in practice (despite the obvious fragility). Or perhaps downstream nodes can advertise their perception of liveness of the two nodes to them and these then decide based on that. It may be that "primary/standby" isn't actually a property of those two nodes globally and that the decision is made for disjoint fragments of the objects involved depending on network conditions and downstream service status. It may be that the two processing nodes know whether they're currently eligible or not (depending on downstream service connectivity and liveness) and it may be that the data feed originator is best placed to instruct the processing nodes to act as primary / standby at the moment, depending on advertised eligibility. It's really hard to give a general answer. :-) > It just seems a little "heavy" to use consul or etcd to elect an leader > between two application instances. What if etcd tells you you're primary but whoops you don't have connection to etcd because somebody was playing with a firewall and cut you off for a few hours? Absent further details it is unclear whether involving an external arbiter even helps at all. BR, -- Jachym [*] https://www.researchgate.net/profile/David_Powell9/publication/3832120_PADRE_a_Protocol_for_Asymmetric_Duplex_REdundancy/links/0912f50d062f67bcba000000/PADRE-a-Protocol-for-Asymmetric-Duplex-REdundancy.pdf From dmkolesnikov@REDACTED Fri Oct 19 11:07:58 2018 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Fri, 19 Oct 2018 12:07:58 +0300 Subject: [erlang-questions] leader election ? In-Reply-To: References: <643280BD-F0E1-4871-8C3C-171460B1795E@gmail.com> Message-ID: <3671BDCB-E5C1-4D23-9807-19F4206DA270@gmail.com> Hello Thomas, Right, if you have MongoDB then most simplest way to use it as 3rd party. You can built variety of protocols on top of it to keep cluster state. Best Regards, Dmitry > On 19 Oct 2018, at 11.14, Thomas Elsgaard wrote: > > Hi Dmitry > > Yeah no fancy cloud, just plain "old school" servers in two datacenters. > > I could add a third server, that is not an issue. My main concern is to find a reliable solution without too many dependencies or moving parts. > > In a weak moment i considered to do some pessimistic locking in a MongoDB replica set. But i am worried for strange scenarios which I haven?t thought about. > > Thomas > > > > > > > On Fri, 19 Oct 2018 at 09:25 Dmitry Kolesnikov > wrote: > Hello, > > Fasters and easiest way to run a 3rd party service that would handle election/arbitration. However, that option does not give you any engineering challenge =). > > Unfortunately, you said nothing about your environment. I suspect that separate datacenter does not mean AWS availability zones. The biggest challenge to solve is splits. It is not recommended to run Erlang cluster accross data centres therefore majority or Erlang build-in solutions would not help you. Most of Erlang libraries relies on Erlang distribution. > > It is a challenge to build a consensus if you have only 2 nodes, it is impossible to make a quorum. Therefore, you need arbiter anyway. Once, I was ?lazy? to setup zookeeper for arbitration purposes then my simplest path was in-memory mnesia + simple REST API but it was way long ago before consul. > > If you can tolerate last-write-wins that you might do nothing =) > > Best Regards, > Dmitry > > > On 19 Oct 2018, at 7.38, Thomas Elsgaard > wrote: > > > > Hi list! > > > > I am running 2 instances of an application ( seperate datacenters), both receives indentical data on TCP sockets, but only one of the applications should process it further downstream. > > > > Any suggestions to what is the "simplest" way to have a kind of leader election ? Both applications must be running, but must have knowledge about their own role (active or passive) in order to decide if the data should be processed downstream. > > > > Should I use an external application like consul or etcd to implement leader election, or is there an better way via OTP or libraries ? > > > > It just seems a little "heavy" to use consul or etcd to elect an leader between two application instances. > > > > Thomas > > > > > > > > > > _______________________________________________ > > 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 Fri Oct 19 14:51:07 2018 From: hans.r.nilsson@REDACTED (Hans Nilsson R) Date: Fri, 19 Oct 2018 12:51:07 +0000 Subject: [erlang-questions] Patch Package OTP 19.3.6.12 Released Message-ID: Patch Package: OTP 19.3.6.12 Git Tag: OTP-19.3.6.12 Date: 2018-10-19 Trouble Report Id: OTP-15342 Seq num: ERIERL-242 System: OTP Release: 19 Application: eldap-1.2.2.1 Predecessor: OTP 19.3.6.11 Check out the git tag OTP-19.3.6.12, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- eldap-1.2.2.1 --------------------------------------------------- --------------------------------------------------------------------- The eldap-1.2.2.1 application can be applied independently of other applications on a full OTP 19 installation. --- Fixed Bugs and Malfunctions --- OTP-15342 Application(s): eldap Related Id(s): ERIERL-242 A race condition at close could cause the eldap client to exit with a badarg message as cause. Full runtime dependencies of eldap-1.2.2.1: asn1-3.0, erts-6.0, kernel-3.0, ssl-5.3.4, stdlib-2.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4161 bytes Desc: S/MIME Cryptographic Signature URL: From thomas.elsgaard@REDACTED Fri Oct 19 18:34:31 2018 From: thomas.elsgaard@REDACTED (Thomas Elsgaard) Date: Fri, 19 Oct 2018 18:34:31 +0200 Subject: [erlang-questions] leader election ? In-Reply-To: <20181019090112.GA14269@circlewave.net> References: <20181019090112.GA14269@circlewave.net> Message-ID: Hi Jachym Thanks for taking the time to provide me with some hints, and you are absolutely right. But unfortunately i do not have control of the feeds or the downstream nodes, but the status of the downstream nodes should be taken into consideration when deciding if my application should take the role of active or passive. Right now I am looking into a concept, where each application calculates a "health score" (based on various parameters like connection to downstream nodes, IP gateways etc). Then they should then exchange health scores, and the one with highest score is taking the role as active (if health score is identical, one of them is configured to be preferred active). Net split will still be an issue, but if it happens, it won't be a major issue. Thomas On Fri, 19 Oct 2018 at 10:58 Jachym Holecek wrote: > Hi Thomas, > > # Thomas Elsgaard 2018-10-19: > > I am running 2 instances of an application ( seperate datacenters), both > > receives indentical data on TCP sockets, but only one of the applications > > should process it further downstream. > > What does "process it further downstream" entail? Is persitent state being > updated on the "primary" node? Are further "downstream" services involved > and if so can they participate in your scheme? Do you control the nodes > originating the data feeds? What are the worst-case consequences of > processing the feed at both nodes for some period of time? What are the > consequences of not processing the feed at all for some period of time? > > > Any suggestions to what is the "simplest" way to have a kind of leader > > election ? Both applications must be running, but must have knowledge > about > > their own role (active or passive) in order to decide if the data should > be > > processed downstream. > > From memory [*] solves this problem although I forgot the exact details of > it. > > Depending on further details it might be that running periodic helthchecks > between the two nodes and basing primary/standby roles on current liveness > plus static priority suffices in practice (despite the obvious fragility). > > Or perhaps downstream nodes can advertise their perception of liveness of > the two nodes to them and these then decide based on that. > > It may be that "primary/standby" isn't actually a property of those two > nodes globally and that the decision is made for disjoint fragments of > the objects involved depending on network conditions and downstream service > status. > > It may be that the two processing nodes know whether they're currently > eligible or not (depending on downstream service connectivity and liveness) > and it may be that the data feed originator is best placed to instruct > the processing nodes to act as primary / standby at the moment, depending > on advertised eligibility. > > It's really hard to give a general answer. :-) > > > It just seems a little "heavy" to use consul or etcd to elect an leader > > between two application instances. > > What if etcd tells you you're primary but whoops you don't have connection > to etcd because somebody was playing with a firewall and cut you off for > a few hours? Absent further details it is unclear whether involving an > external arbiter even helps at all. > > BR, > -- Jachym > > [*] > https://www.researchgate.net/profile/David_Powell9/publication/3832120_PADRE_a_Protocol_for_Asymmetric_Duplex_REdundancy/links/0912f50d062f67bcba000000/PADRE-a-Protocol-for-Asymmetric-Duplex-REdundancy.pdf > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vans_163@REDACTED Tue Oct 23 12:32:29 2018 From: vans_163@REDACTED (Vans S) Date: Tue, 23 Oct 2018 10:32:29 +0000 (UTC) Subject: [erlang-questions] atomicity of spawn with global process registry? References: <1337501822.15411028.1540290749283.ref@mail.yahoo.com> Message-ID: <1337501822.15411028.1540290749283@mail.yahoo.com> What is the order of events/guarantees that happen with gen_server start + global name register? Does register happen before the init? If I do a normal spawn then do a register in 2 separate calls, I have a chance to call the register while init is already evaluating,? which triggers my race condition. As another process is sending a message to this process, and expects init to NOT start evaluating UNTIL the process is registered. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Tue Oct 23 14:51:17 2018 From: bchesneau@REDACTED (Benoit Chesneau) Date: Tue, 23 Oct 2018 14:51:17 +0200 Subject: [erlang-questions] some patterns in questions. Message-ID: Hi all, I'm polishing an api for a library that will be used by a lot of consumers. It seems important for me to respect much of the current expectations of Erlang developers, so I was wondering what people expect these days when using recent versions of Erlang > 20. * passing options to a function: would you still expect to use a `propslist` or a `map`? In which case are you using one or the other? * database names for database embedded in an Erlang VM: would you expect to still use atoms like for `ETS` or `Mnesia` or would you use any of the following types: atoms, strings, binary? I'm thinking atoms are more optimised in their usage, but is this still true? Any feedback is welcome :) Beno?t -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Tue Oct 23 15:12:30 2018 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Tue, 23 Oct 2018 16:12:30 +0300 Subject: [erlang-questions] some patterns in questions. In-Reply-To: References: Message-ID: <824C8CD0-108F-4B32-B027-FC5BEA8F8358@gmail.com> Hello, Thank you for asking ;-) I?ll put my comments in-line > > I'm polishing an api for a library that will be used by a lot of consumers. It seems important for me to respect much of the current expectations of Erlang developers, so I was wondering what people expect these days when using recent versions of Erlang > 20. > > * passing options to a function: would you still expect to use a `propslist` or a `map`? In which case are you using one or the other? I am still using `proplists` in few of public projects. However, internally I do have trend of switching to maps. Proplists has a good feature of supplying a boolean property, e.g. `read`. It might looks more awkward with maps #{read => true}. However, the usage of dict is preferable approached in competing languages (e.g. Go, Python, etc). > * database names for database embedded in an Erlang VM: would you expect to still use atoms like for `ETS` or `Mnesia` or would you use any of the following types: atoms, strings, binary? I'm thinking atoms are more optimised in their usage, but is this still true? I would like to see a support for binary at embedded database. Atoms works fine if database is global or node-wide defined at boot time. However, I am also dealing with use-case where I need to create databases dynamically based on external input. I would prefer to use binaries for this, instead of converting binary to atom and back. > > Any feedback is welcome :) > > Beno?t > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions I hope it helped! Best Regards, Dmitry From areege.alzubaidi@REDACTED Wed Oct 24 16:54:51 2018 From: areege.alzubaidi@REDACTED (Areege Al Zubaidi) Date: Wed, 24 Oct 2018 15:54:51 +0100 Subject: [erlang-questions] Code Mesh LDN 2018 & #OpenErlang London party! Message-ID: Hi all, I wanted to flag Code Mesh LDN 2018 to you. If you?re not already aware, Code Mesh LDN is a niche, alternative programming conference that brings academia and industry together under the ethos of share, learn, inspire. The conference covers a number of programming languages, namely Erlang, Haskell, Scala, Python, Clojure, LISP, Rust, Pony, etc over two days. The conference organisers have carefully curated the talks to firmly advocate using the right tool for the job. >From an Erlang and Elixir point of view, Code Mesh LDN 18 offers a tutorial with Erlang co-creator Joe Armstrong , who is also speaking at the conference. But that?s not all: - Maxim Fedorov will be speaking about his work with Erlang at WhatsApp - Ulf Wiger will be there with a talk on Erlang and blockchain - Natalia Chechina , one of the core writers of Erlang SD, will speak on co-operative robots sharing the load - Danil Fedotov , Erlang and Elixir contributor and RabbitMQ core contributor will be speaking about his work with RabbitMQ - Peter Saxton , Elixir developer will speak on his Raxx project - Last but not least, Carl Hewitt , founder of the Actor Model, is keynoting! Don?t forget, #OpenErlang, the campaign celebrating 20 years since Erlang was open sourced, is coming to London after a world tour, including San Francisco and Stockholm! The #OpenErlang party is free to attend and will take place on Thursday 08 November, at the Code Mesh LDN venue. RSVP here . Learn more about the conference, and the 2018 speakers: https://codesync.global/conferences/code-mesh-2018/ What: Code Mesh LDN 2018 When: 08-09 November 2018 Where: Ilec Conference Centre, Fulham, London *How to attend:* - Attend the conference Secure a standard rate ticket to the conference before 01 November. You can find out more and register here . - Volunteer Volunteer with the Code Mesh LDN team to get access to talks, networking opportunities and unlimited coffee! *Applications close today.* - Student tickets Code Mesh LDN offers a 50% discount to students. To learn more, email info@REDACTED from your academic email address to get a unique discount code. If you have any further questions, please don?t hesitate to let me know, I hope to see you there! Areege -- *Areege Al Zubaidi* *Conferences Marketing Executive* T: +44 (0) 2076550332 W: www.codesync.global A: Erlang Solutions Ltd, The Loom,14 Gower's Walk, London, E1 8PY *Code Sync & Erlang Solutions Conferences* Code Mesh LDN - London - 8-9 November 2018 RabbitMQ Summit - London - 12 November 2018 Code BEAM Lite - Amsterdam - 30 November 2018 Code BEAM Lite - Munich - 7 December 2018 Lambda Days - Krak?w - 21-22 February 2019 Code BEAM SF - San Francisco - 28 February - 1 March 2019 ElixirConf EU - Prague: 8-9 April 2019 Code BEAM STO - Stockholm: 16-17 May 2019 Code Elixir LDN - London: 18 July 2019 *Erlang Solutions and Code Sync care about your data and privacy; please find all details about the basis for communicating with you and the way we process your data in our Privacy Policy . You can update your email preferences or opt-out from receiving marketing emails here .* -------------- next part -------------- An HTML attachment was scrubbed... URL: From kuna.prime@REDACTED Wed Oct 24 20:57:36 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Wed, 24 Oct 2018 20:57:36 +0200 Subject: [erlang-questions] list type in syntax tools Message-ID: hello everyone, i'm trying to make list type in sytnax tools however i am running to some issues i need to make something that reverts to {type,1,list,[]} so for example how would one represent following via syntax tools? -type l() :: list(). type_application and user_type_application for list with no element does not revert to {type, _, list []} thak you -------------- next part -------------- An HTML attachment was scrubbed... URL: From kuna.prime@REDACTED Wed Oct 24 21:01:19 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Wed, 24 Oct 2018 21:01:19 +0200 Subject: [erlang-questions] list type in syntax tools In-Reply-To: References: Message-ID: is there any reason why something like list_type/0 and list_type/1 (like map_type) are missing from syntax tools? On Wed, Oct 24, 2018 at 8:57 PM Karlo Kuna wrote: > hello everyone, > > i'm trying to make list type in sytnax tools however i am running to some > issues > i need to make something that reverts to {type,1,list,[]} > > so for example how would one represent following via syntax tools? > > -type l() :: list(). > > type_application and user_type_application for list with no element does > not revert to > {type, _, list []} > > thak you > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kuna.prime@REDACTED Wed Oct 24 21:10:02 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Wed, 24 Oct 2018 21:10:02 +0200 Subject: [erlang-questions] list type in syntax tools In-Reply-To: References: Message-ID: i have found workaround: erl_syntax:type_application(erl_syntax:abstract(list), []). which yields to: {tree,type_application, {attr,0,[],none}, {type_application,{tree,atom,{attr,0,[],none},list},[]}} and then reverts to {type,0,list,[]} but i'm still wandering why are list_type funtions missing -------------- next part -------------- An HTML attachment was scrubbed... URL: From abel.ze.normand@REDACTED Thu Oct 25 00:08:55 2018 From: abel.ze.normand@REDACTED (Abel Normand) Date: Thu, 25 Oct 2018 01:08:55 +0300 Subject: [erlang-questions] RTMP streams number Message-ID: Hello everyone. Im currently investigating specification of RTMP protocol and also trying to understand of implementation of RTMP server/client in https://github.com/KallDrexx/elixir-media-libs/tree/amaster/apps/rtmp repo. I have a question about protocol specification: its mentioned that > protocol supports up to 65597 streams with IDs 3-65599. Then I dont understand how this protocol scales with high-amounts of one time concurrent users streaming with one centralized server. Am I missing something? Thanks. -- Best regards, Nail -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.schultz@REDACTED Fri Oct 26 12:03:45 2018 From: andreas.schultz@REDACTED (Andreas Schultz) Date: Fri, 26 Oct 2018 12:03:45 +0200 Subject: [erlang-questions] some patterns in questions. In-Reply-To: References: Message-ID: Benoit Chesneau schrieb am Di., 23. Okt. 2018 um 14:51 Uhr: > Hi all, > > I'm polishing an api for a library that will be used by a lot of > consumers. It seems important for me to respect much of the current > expectations of Erlang developers, so I was wondering what people expect > these days when using recent versions of Erlang > 20. > > * passing options to a function: would you still expect to use a > `propslist` or a `map`? In which case are you using one or the other? > I usually prefer the readability of a maps match in a function head or guard for options over the more complex use of proplists. However, for compatibility reason I tend to support proplist for options as well. Converting proplists to maps is straight forward, so the coast of supporting both should be quite low. Andreas > > -- -- Dipl.-Inform. Andreas Schultz ----------------------- enabling your networks ---------------------- Travelping GmbH Phone: +49-391-81 90 99 0 Roentgenstr. 13 Fax: +49-391-81 90 99 299 39108 Magdeburg Email: info@REDACTED GERMANY Web: http://www.travelping.com Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 Geschaeftsfuehrer: Holger Winkelmann VAT ID No.: DE236673780 --------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri Oct 26 21:21:13 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 26 Oct 2018 22:21:13 +0300 Subject: [erlang-questions] RTMP streams number In-Reply-To: References: Message-ID: This is not about erlang, but about rtmp, however I will try to help you. RTMP is a badly multiplexed protocol that is badly designed for delivering more than one audio/video stream to client. So you can send several audio-video streams to one flash player and it will play these videos like a mosaic. This is in theory. In practice just forget about it, nobody is using it, you will not find any support for this in any modern flash players. By saying "modern flash player" I mean only mobile players like Exoplayer, because in web browser flash is completely buried and you can just forget about flash player. You take just one stream id and use the same stream id for all users. Problem with RTMP is that it is impossible to prepare once and send the same data to many clients, you MUST prepare data for each client. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Sun Oct 28 23:39:11 2018 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sun, 28 Oct 2018 18:39:11 -0400 (EDT) Subject: [erlang-questions] Erlang checklists Message-ID: <1540766351.319712328@apps.rackspace.com> Hello, With the generous help of Frank Muller, I recently created the erlPress_core repository on GitHub. Make a few blunders along the way. Still feel shaky about my responsibilities for nurturing the repository. So I'd like to create and share a step_by_step checklist for other Erlang noobs preparing to share code on GitHub with the Erlang community. Please send my your ideas. I'd like to do the same for releasing Erlang applications into production, but I'll hold on that for another time. Many thanks, LRP ********************************************* My books: THE GOSPEL OF ASHES http://thegospelofashes.com Strength is not enough. Do they have the courage and the cunning? Can they survive long enough to save the lives of millions? FREEIN' PANCHO http://freeinpancho.com A community of misfits help a troubled boy find his way AYA TAKEO http://ayatakeo.com Star-crossed love, war and power in an alternative universe Available through Amazon or by request from your favorite bookstore ********************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickard@REDACTED Mon Oct 29 10:34:19 2018 From: rickard@REDACTED (Rickard Green) Date: Mon, 29 Oct 2018 10:34:19 +0100 Subject: [erlang-questions] Patch Package OTP 18.3.4.10 Released Message-ID: <19176e9e-7471-7b2a-fea4-7e8c86d698d2@erlang.org> Patch Package: OTP 18.3.4.10 Git Tag: OTP-18.3.4.10 Date: 2018-10-29 Trouble Report Id: OTP-14609 Seq num: ERIERL-238 System: OTP Release: 18 Application: erts-7.3.1.5 Predecessor: OTP 18.3.4.9 Check out the git tag OTP-18.3.4.10, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- erts-7.3.1.5 ---------------------------------------------------- --------------------------------------------------------------------- The erts-7.3.1.5 application can be applied independently of other applications on a full OTP 18 installation. --- Fixed Bugs and Malfunctions --- OTP-14609 Application(s): erts Related Id(s): ERIERL-238 Fixed small memory leak that could occur when sending to a terminating port. Full runtime dependencies of erts-7.3.1.5: kernel-4.0, sasl-2.4, stdlib-2.5 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From elbrujohalcon@REDACTED Mon Oct 29 13:04:48 2018 From: elbrujohalcon@REDACTED (Brujo Benavides) Date: Mon, 29 Oct 2018 09:04:48 -0300 Subject: [erlang-questions] Erlang checklists In-Reply-To: <1540766351.319712328@apps.rackspace.com> References: <1540766351.319712328@apps.rackspace.com> Message-ID: <8E6735BA-A284-44BF-B378-5EE4E1CBEAC6@gmail.com> Hi Lloyd, This is the checklist we have at Inaka: https://github.com/inaka/guidelines/blob/master/OPEN-SOURCE.md Cheers! Brujo Benavides > On 28 Oct 2018, at 19:39, lloyd@REDACTED wrote: > > Hello, > > With the generous help of Frank Muller, I recently created the erlPress_core repository on GitHub. > > Make a few blunders along the way. Still feel shaky about my responsibilities for nurturing the repository. > > So I'd like to create and share a step_by_step checklist for other Erlang noobs preparing to share code on GitHub with the Erlang community. > > Please send my your ideas. > > I'd like to do the same for releasing Erlang applications into production, but I'll hold on that for another time. > > Many thanks, > > LRP > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Mon Oct 29 13:12:19 2018 From: roger@REDACTED (Roger Lipscombe) Date: Mon, 29 Oct 2018 12:12:19 +0000 Subject: [erlang-questions] Erlang checklists In-Reply-To: <8E6735BA-A284-44BF-B378-5EE4E1CBEAC6@gmail.com> References: <1540766351.319712328@apps.rackspace.com> <8E6735BA-A284-44BF-B378-5EE4E1CBEAC6@gmail.com> Message-ID: On 29 October 2018 at 12:04, Brujo Benavides wrote: > > Hi Lloyd, > > This is the checklist we have at Inaka: https://github.com/inaka/guidelines/blob/master/OPEN-SOURCE.md > > It's has a clear and useful README.md *It* That aside ;-), one of my personal bugbears about README files is that not enough of them tell me what the project *is*. For example: "Project MooCow aims to be performant, extensible and simple to use." Great, but is it a database, an HTTP client, a BDD tool or what? Cheers, Roger. From essen@REDACTED Mon Oct 29 13:28:18 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 29 Oct 2018 13:28:18 +0100 Subject: [erlang-questions] Erlang checklists In-Reply-To: References: <1540766351.319712328@apps.rackspace.com> <8E6735BA-A284-44BF-B378-5EE4E1CBEAC6@gmail.com> Message-ID: <2fc86971-7105-8991-b77b-bf03960612eb@ninenines.eu> On 10/29/18 1:12 PM, Roger Lipscombe wrote: > On 29 October 2018 at 12:04, Brujo Benavides wrote: >> >> Hi Lloyd, >> >> This is the checklist we have at Inaka: https://github.com/inaka/guidelines/blob/master/OPEN-SOURCE.md >> > >> It's has a clear and useful README.md > > *It* > > That aside ;-), one of my personal bugbears about README files is that > not enough of them tell me what the project *is*. > > For example: > > "Project MooCow aims to be performant, extensible and simple to use." > Great, but is it a database, an HTTP client, a BDD tool or what? The first sentence of the README file should not only say what the project is, but also persuade people to use your project instead of one of the alternatives. In other words it should clarify who your project is for. For example: * MooCow is an HTTP client for Erlang. * MooCow is an enterprise-ready HTTP client for Erlang. This simple addition can be interpreted a number of ways, and sometimes users will misinterpret, but it suggests that it does more things than a plain HTTP client, for example export metrics and/or allow monitoring tools to be plugged into it. Don't make the sentence too long though, limit to 2 or 3 attributes that make the biggest difference compared to other projects, or that are the biggest strengths if there are no similar projects. That first sentence should be used everywhere where a short description is to be provided. Remember, we form our opinions on most things in a split second very early on when we are exposed to something new. The more alternatives there are the most important influencing that split second becomes. Cheers, -- Lo?c Hoguin https://ninenines.eu From roger@REDACTED Mon Oct 29 17:48:05 2018 From: roger@REDACTED (Roger Lipscombe) Date: Mon, 29 Oct 2018 16:48:05 +0000 Subject: [erlang-questions] Calling (equivalent of) erlang:send_after/3 from a NIF? Message-ID: I'd like to start a timer in my NIF. It should send a message to an Erlang process after a delay. There doesn't appear to be an enif_send_after. Is there any way to do this? (Obligatory "yes I know that NIFs are bad, mmkay..."). Regards, Roger. From nathaniel@REDACTED Mon Oct 29 20:38:37 2018 From: nathaniel@REDACTED (Nathaniel Waisbrot) Date: Mon, 29 Oct 2018 15:38:37 -0400 Subject: [erlang-questions] Calling (equivalent of) erlang:send_after/3 from a NIF? In-Reply-To: References: Message-ID: <1540841917.788285.1558725112.64A5494B@webmail.messagingengine.com> Is the idea that your NIF would pause the system for some time and then send its message and unpause the system? Is the NIF doing work during this time? If you're looking for enif_send_after my first thought would be that you should just wrap your NIF in an Erlang process and you NIF tells that process how and when to wait. But maybe I'm not understanding what you want this NIF to do. On Mon, Oct 29, 2018, at 12:48 PM, Roger Lipscombe wrote: > I'd like to start a timer in my NIF. It should send a message to an > Erlang process after a delay. There doesn't appear to be an > enif_send_after. > > Is there any way to do this? > > (Obligatory "yes I know that NIFs are bad, mmkay..."). > > Regards, > Roger. > _________________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor.clark@REDACTED Mon Oct 29 21:06:00 2018 From: igor.clark@REDACTED (Igor Clark) Date: Mon, 29 Oct 2018 20:06:00 +0000 Subject: [erlang-questions] Calling (equivalent of) erlang:send_after/3 from a NIF? In-Reply-To: References: Message-ID: <4599DD56-54E1-4C01-A38F-3BD8C1937D30@gmail.com> I'd love to know a "proper" way of doing this too. I did something like it once by using signal(3) to set a callback to handle SIGALRM, scheduling the SIGALRM to get sent by the OS kernel with ualarm(3), and then sending the message to the appropriate pid in the callback. It had to keep static pointers to the ErlNifPid & message content (which I set with NIF "setter" functions) so that the callback could see them, and it used a fair bit of CPU when I used it with a repeating alarm at a short interval (like 500?s) to create a timed pulse, but I guess it wouldn't be a big problem if it was just an occasional attach/schedule/send/clear. But it did feel like I was doing something pretty wrong (ill-advised/evil) in the BEAM context. > On 29 Oct 2018, at 16:48, Roger Lipscombe wrote: > > I'd like to start a timer in my NIF. It should send a message to an > Erlang process after a delay. There doesn't appear to be an > enif_send_after. > > Is there any way to do this? > > (Obligatory "yes I know that NIFs are bad, mmkay..."). > > Regards, > Roger. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From roger@REDACTED Mon Oct 29 22:24:49 2018 From: roger@REDACTED (Roger Lipscombe) Date: Mon, 29 Oct 2018 21:24:49 +0000 Subject: [erlang-questions] Calling (equivalent of) erlang:send_after/3 from a NIF? In-Reply-To: <1540841917.788285.1558725112.64A5494B@webmail.messagingengine.com> References: <1540841917.788285.1558725112.64A5494B@webmail.messagingengine.com> Message-ID: On 29 October 2018 at 19:38, Nathaniel Waisbrot wrote: > Is the idea that your NIF would pause the system for some time and then send > its message and unpause the system? I've got a reactor-style thing going on inside my NIF, where I service a large number of timers and sockets. We're hitting scalability issues with our current implementation, so I'm evaluating alternatives. Since this is already in a NIF, I'd like to experiment with replacing the socket polling with Erlang's enif_select, because I suspect it'll be more scalable -- I'd like to find out, anyway. The plan is that, on receiving the message from enif_select, I can quickly dip back into NIF-land and service the relevant socket. Some of these sockets are actually libcurl-driven, and one of the things that libcurl wants is for us to start a timer. I was hoping that there'd be an equivalent of enif_select, but for timers (i.e. enif_send_after). We also service a large number of non-curl timers, and so I was hoping to use Erlang's timer implementation for these as well. I found that erlang:send_after calls directly into the send_after_3 BIF, which calls setup_bif_timer, which manages Erlang's timers (it appears to use a pair of timer wheels for short and medium timeouts, and a red-black tree for longer timeouts). It'd fit my use-case perfectly if I could just use that directly from a NIF. > If you're looking for enif_send_after my first thought would be that you > should just wrap your NIF in an Erlang process and you NIF tells that > process how and when to wait. The timeouts could be as short as 1ms. It'd be way less overhead to just make use of Erlang's existing timer implementation, rather than enif_send to a process which would then call erlang:send_after. From roger@REDACTED Mon Oct 29 22:26:58 2018 From: roger@REDACTED (Roger Lipscombe) Date: Mon, 29 Oct 2018 21:26:58 +0000 Subject: [erlang-questions] Calling (equivalent of) erlang:send_after/3 from a NIF? In-Reply-To: <4599DD56-54E1-4C01-A38F-3BD8C1937D30@gmail.com> References: <4599DD56-54E1-4C01-A38F-3BD8C1937D30@gmail.com> Message-ID: On 29 October 2018 at 20:06, Igor Clark wrote: > I'd love to know a "proper" way of doing this too. I did something like it once by using signal(3) to set a callback to handle SIGALRM, scheduling the SIGALRM to get sent by the OS kernel with ualarm(3), and then sending the message to the appropriate pid in the callback. It had to keep static pointers to the ErlNifPid & message content (which I set with NIF "setter" functions) so that the callback could see them, and it used a fair bit of CPU when I used it with a repeating alarm at a short interval (like 500?s) to create a timed pulse, but I guess it wouldn't be a big problem if it was just an occasional attach/schedule/send/clear. But it did feel like I was doing something pretty wrong (ill-advised/evil) in the BEAM context. Yeah; I found timer_create and timer_start, which Linux implements, and apparently supports 1ms granularity, but they use signals, and it makes me uneasy to do signal-stuff inside the BEAM. From lloyd@REDACTED Mon Oct 29 23:27:47 2018 From: lloyd@REDACTED (lloyd@REDACTED) Date: Mon, 29 Oct 2018 18:27:47 -0400 (EDT) Subject: [erlang-questions] Erlang checklists In-Reply-To: <8E6735BA-A284-44BF-B378-5EE4E1CBEAC6@gmail.com> References: <1540766351.319712328@apps.rackspace.com> <8E6735BA-A284-44BF-B378-5EE4E1CBEAC6@gmail.com> Message-ID: <1540852067.690626568@apps.rackspace.com> Hi All, Terrific list, Brujo! Mind if I pare it down for Erlang and add a few very fundamental items that experienced Erlang programmers take for granted, but newcomers may miss: -- Nicely formatted module header (Is there a convention? Thoughts welcome) -- Uncomment -exort(xxx and and comment -configure(xxx lines -- @doc and -spec documentation of functions (Just exported or all in module?) -- Anything else we're missing? Among other things, how should versions be handled in module headers given that we have an application version and perhaps a mix of module versions? Roger and Lo?c: I couldn't agree with you more about specific statement of what the code does and who it would benefit. And Lo?c's other tips are well taken. I'll try to work them all in and send updated checklist anon. Thanks, Lloyd -----Original Message----- From: "Brujo Benavides" Sent: Monday, October 29, 2018 8:04am To: lloyd@REDACTED Cc: "erlang-questions@REDACTED" Subject: Re: [erlang-questions] Erlang checklists Hi Lloyd, This is the checklist we have at Inaka: [ https://github.com/inaka/guidelines/blob/master/OPEN-SOURCE.md ]( https://github.com/inaka/guidelines/blob/master/OPEN-SOURCE.md ) Cheers! [ Brujo Benavides ]( http://about.me/elbrujohalcon ) On 28 Oct 2018, at 19:39, [ lloyd@REDACTED ]( mailto:lloyd@REDACTED ) wrote: Hello, With the generous help of Frank Muller, I recently created the erlPress_core repository on GitHub. Make a few blunders along the way. Still feel shaky about my responsibilities for nurturing the repository. So I'd like to create and share a step_by_step checklist for other Erlang noobs preparing to share code on GitHub with the Erlang community. Please send my your ideas. I'd like to do the same for releasing Erlang applications into production, but I'll hold on that for another time. Many thanks, LRP *********************************************My books:THE GOSPEL OF ASHES[ http://thegospelofashes.com ]( http://thegospelofashes.com )Strength is not enough. Do they have the courage and the cunning? Can they survive long enough to save the lives of millions? FREEIN' PANCHOhttp://freeinpancho.comA community of misfits help a troubled boy find his way AYA TAKEOhttp://ayatakeo.comStar-crossed love, war and power in an alternative universeAvailable through Amazon or by request from your favorite bookstore**********************************************_______________________________________________erlang-questions mailing list[ erlang-questions@REDACTED ]( mailto:erlang-questions@REDACTED )http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmytro.lytovchenko@REDACTED Mon Oct 29 23:36:30 2018 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Mon, 29 Oct 2018 22:36:30 +0000 Subject: [erlang-questions] Erlang checklists In-Reply-To: <1540852067.690626568@apps.rackspace.com> References: <1540766351.319712328@apps.rackspace.com> <8E6735BA-A284-44BF-B378-5EE4E1CBEAC6@gmail.com> <1540852067.690626568@apps.rackspace.com> Message-ID: With all that is mentioned by Brujo before, ... Think about your future new user. Some empathy (i have empatic character, and i know this first hand you see). - What are your new user's first steps when he opened your library's web page? - Will he see a description? (many libraries have really bad descriptions) Some welcoming examples and a quick start? - What will he take as his first *hello_your_library*? And maybe some advanced examples too? - Where will he come to read the docs? - (bonus points) A community discussion board or something like that? Issues page on Github that is well maintained is a good first step. On Mon, 29 Oct 2018 at 22:28, wrote: > Hi All, > > > > Terrific list, Brujo! > > > > Mind if I pare it down for Erlang and add a few very fundamental items > that experienced Erlang programmers take for granted, but newcomers may > miss: > > > > -- Nicely formatted module header (Is there a convention? Thoughts > welcome) > > -- Uncomment -exort(xxx and and comment -configure(xxx lines > > -- @doc and -spec documentation of functions (Just exported or all in > module?) > > -- Anything else we're missing? > > > > Among other things, how should versions be handled in module headers given > that we have an application version and perhaps a mix of module versions? > > > > Roger and Lo?c: > > > > I couldn't agree with you more about specific statement of what the code > does and who it would benefit. And Lo?c's other tips are well taken. > > > > I'll try to work them all in and send updated checklist anon. > > > > Thanks, > > > > Lloyd > > > > -----Original Message----- > From: "Brujo Benavides" > Sent: Monday, October 29, 2018 8:04am > To: lloyd@REDACTED > Cc: "erlang-questions@REDACTED" > Subject: Re: [erlang-questions] Erlang checklists > > Hi Lloyd, > This is the checklist we have at Inaka: > https://github.com/inaka/guidelines/blob/master/OPEN-SOURCE.md > Cheers! > > ------------------------------ > *Brujo Benavides * > > > On 28 Oct 2018, at 19:39, lloyd@REDACTED wrote: > > Hello, > > > With the generous help of Frank Muller, I recently created the > erlPress_core repository on GitHub. > > > Make a few blunders along the way. Still feel shaky about my > responsibilities for nurturing the repository. > > > So I'd like to create and share a step_by_step checklist for other Erlang > noobs preparing to share code on GitHub with the Erlang community. > > > Please send my your ideas. > > > I'd like to do the same for releasing Erlang applications into production, > but I'll hold on that for another time. > > > Many thanks, > > > LRP > > > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From scott_ribe@REDACTED Mon Oct 29 23:49:15 2018 From: scott_ribe@REDACTED (Scott Ribe) Date: Mon, 29 Oct 2018 16:49:15 -0600 Subject: [erlang-questions] Erlang checklists In-Reply-To: References: <1540766351.319712328@apps.rackspace.com> <8E6735BA-A284-44BF-B378-5EE4E1CBEAC6@gmail.com> <1540852067.690626568@apps.rackspace.com> Message-ID: <516AD230-EFC1-4B4F-87F2-541A821B7C15@elevated-dev.com> On Oct 29, 2018, at 4:36 PM, Dmytro Lytovchenko wrote: > > Think about your future new user. Some empathy (i have empatic character, and i know this first hand you see). > > ? What are your new user's first steps when he opened your library's web page? > ? Will he see a description? (many libraries have really bad descriptions) Some welcoming examples and a quick start? > ? What will he take as his first hello_your_library? And maybe some advanced examples too? > ? Where will he come to read the docs? > ? (bonus points) A community discussion board or something like that? Issues page on Github that is well maintained is a good first step. - Follow your build instructions and verify that they actually work! I hit this one just today, 2 errors in the build instructions that could have stumped a newbie. (Not an Erlang project, FYI.) From elbrujohalcon@REDACTED Tue Oct 30 02:27:30 2018 From: elbrujohalcon@REDACTED (Brujo Benavides) Date: Mon, 29 Oct 2018 22:27:30 -0300 Subject: [erlang-questions] Erlang checklists In-Reply-To: <1540852067.690626568@apps.rackspace.com> References: <1540766351.319712328@apps.rackspace.com> <8E6735BA-A284-44BF-B378-5EE4E1CBEAC6@gmail.com> <1540852067.690626568@apps.rackspace.com> Message-ID: Of course, you are free to do whatever you want, Lloyd. PRs are also welcomed :P On Mon, 29 Oct 2018 at 19:27 wrote: > Hi All, > > > > Terrific list, Brujo! > > > > Mind if I pare it down for Erlang and add a few very fundamental items > that experienced Erlang programmers take for granted, but newcomers may > miss: > > > > -- Nicely formatted module header (Is there a convention? Thoughts > welcome) > > -- Uncomment -exort(xxx and and comment -configure(xxx lines > > -- @doc and -spec documentation of functions (Just exported or all in > module?) > > -- Anything else we're missing? > > > > Among other things, how should versions be handled in module headers given > that we have an application version and perhaps a mix of module versions? > > > > Roger and Lo?c: > > > > I couldn't agree with you more about specific statement of what the code > does and who it would benefit. And Lo?c's other tips are well taken. > > > > I'll try to work them all in and send updated checklist anon. > > > > Thanks, > > > > Lloyd > > > > -----Original Message----- > From: "Brujo Benavides" > Sent: Monday, October 29, 2018 8:04am > To: lloyd@REDACTED > Cc: "erlang-questions@REDACTED" > Subject: Re: [erlang-questions] Erlang checklists > > Hi Lloyd, > This is the checklist we have at Inaka: > https://github.com/inaka/guidelines/blob/master/OPEN-SOURCE.md > Cheers! > > ------------------------------ > *Brujo Benavides * > > > On 28 Oct 2018, at 19:39, lloyd@REDACTED wrote: > > Hello, > > > With the generous help of Frank Muller, I recently created the > erlPress_core repository on GitHub. > > > Make a few blunders along the way. Still feel shaky about my > responsibilities for nurturing the repository. > > > So I'd like to create and share a step_by_step checklist for other Erlang > noobs preparing to share code on GitHub with the Erlang community. > > > Please send my your ideas. > > > I'd like to do the same for releasing Erlang applications into production, > but I'll hold on that for another time. > > > Many thanks, > > > LRP > > > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- elbrujohalcon @ iPhone -------------- next part -------------- An HTML attachment was scrubbed... URL: From elbrujohalcon@REDACTED Tue Oct 30 02:31:51 2018 From: elbrujohalcon@REDACTED (Brujo Benavides) Date: Mon, 29 Oct 2018 22:31:51 -0300 Subject: [erlang-questions] Erlang checklists In-Reply-To: <1540852067.690626568@apps.rackspace.com> References: <1540766351.319712328@apps.rackspace.com> <8E6735BA-A284-44BF-B378-5EE4E1CBEAC6@gmail.com> <1540852067.690626568@apps.rackspace.com> Message-ID: About your items: - not sure about module headers. But yeah, @doc in every module is a good guideline - no idea what you mean by this. I've never seen a -configure line in an Erlang module - just for exported ones I would say On Mon, 29 Oct 2018 at 19:27 wrote: > Hi All, > > > > Terrific list, Brujo! > > > > Mind if I pare it down for Erlang and add a few very fundamental items > that experienced Erlang programmers take for granted, but newcomers may > miss: > > > > -- Nicely formatted module header (Is there a convention? Thoughts > welcome) > > -- Uncomment -exort(xxx and and comment -configure(xxx lines > > -- @doc and -spec documentation of functions (Just exported or all in > module?) > > -- Anything else we're missing? > > > > Among other things, how should versions be handled in module headers given > that we have an application version and perhaps a mix of module versions? > > > > Roger and Lo?c: > > > > I couldn't agree with you more about specific statement of what the code > does and who it would benefit. And Lo?c's other tips are well taken. > > > > I'll try to work them all in and send updated checklist anon. > > > > Thanks, > > > > Lloyd > > > > -----Original Message----- > From: "Brujo Benavides" > Sent: Monday, October 29, 2018 8:04am > To: lloyd@REDACTED > Cc: "erlang-questions@REDACTED" > Subject: Re: [erlang-questions] Erlang checklists > > Hi Lloyd, > This is the checklist we have at Inaka: > https://github.com/inaka/guidelines/blob/master/OPEN-SOURCE.md > Cheers! > > ------------------------------ > *Brujo Benavides * > > > On 28 Oct 2018, at 19:39, lloyd@REDACTED wrote: > > Hello, > > > With the generous help of Frank Muller, I recently created the > erlPress_core repository on GitHub. > > > Make a few blunders along the way. Still feel shaky about my > responsibilities for nurturing the repository. > > > So I'd like to create and share a step_by_step checklist for other Erlang > noobs preparing to share code on GitHub with the Erlang community. > > > Please send my your ideas. > > > I'd like to do the same for releasing Erlang applications into production, > but I'll hold on that for another time. > > > Many thanks, > > > LRP > > > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- elbrujohalcon @ iPhone -------------- next part -------------- An HTML attachment was scrubbed... URL: From icfp.publicity@REDACTED Tue Oct 30 02:56:03 2018 From: icfp.publicity@REDACTED (Sam Tobin-Hochstadt) Date: Mon, 29 Oct 2018 21:56:03 -0400 Subject: [erlang-questions] Call For Workshop Proposals Message-ID: <5bd7ba33ddcaa_407e12270d0621ef@hermes.mail> CALL FOR WORKSHOP AND CO-LOCATED EVENT PROPOSALS ICFP 2019 24th ACM SIGPLAN International Conference on Functional Programming August 18 - 23, 2019 Berlin, Germany https://icfp19.sigplan.org/ The 24th ACM SIGPLAN International Conference on Functional Programming will be held in Berlin, Germany on August 18-23, 2019. ICFP provides a forum for researchers and developers to hear about the latest work on the design, implementations, principles, and uses of functional programming. Proposals are invited for workshops (and other co-located events, such as symposiums) to be affiliated with ICFP 2019 and sponsored by SIGPLAN. These events should be less formal and more focused than ICFP itself, include sessions that enable interaction among the attendees, and foster the exchange of new ideas. The preference is for one-day events, but other schedules can also be considered. The workshops are scheduled to occur on August 18th (the day before ICFP) and 22-23th of August (the two days after ICFP). ---------------------------------------------------------------------- Submission details Deadline for submission: November 25, 2018 Notification of acceptance: December 23, 2018 Prospective organizers of workshops or other co-located events are invited to submit a completed workshop proposal form in plain text format to the ICFP 2019 workshop co-chairs (Jennifer Hackett and Christophe Scholliers), via email to icfp-workshops-2019@REDACTED by November 25, 2018. (For proposals of co-located events other than workshops, please fill in the workshop proposal form and just leave blank any sections that do not apply.) Please note that this is a firm deadline. Organizers will be notified if their event proposal is accepted by December 23, 2018, and if successful, depending on the event, they will be asked to produce a final report after the event has taken place that is suitable for publication in SIGPLAN Notices. The proposal form is available at: http://www.icfpconference.org/icfp2019-files/icfp19-workshops-form.txt Further information about SIGPLAN sponsorship is available at: http://www.sigplan.org/Resources/Proposals/Sponsored/ ---------------------------------------------------------------------- Selection committee The proposals will be evaluated by a committee comprising the following members of the ICFP 2019 organizing committee, together with the members of the SIGPLAN executive committee. Workshop Co-Chair: Jennifer Hackett (University of Nottingham) Workshop Co-Chair: Christophe Scholliers (University of Ghent) General Chair: Derek Dreyer (MPI-SWS) Program Chair: Fran?ois Potier (Inria) ---------------------------------------------------------------------- Further information Any queries should be addressed to the workshop co-chairs (Jennifer Hackett and Christophe Scholliers), via email to icfp-workshops-2019@REDACTED From roger@REDACTED Tue Oct 30 09:19:31 2018 From: roger@REDACTED (Roger Lipscombe) Date: Tue, 30 Oct 2018 08:19:31 +0000 Subject: [erlang-questions] Erlang checklists In-Reply-To: <1540852067.690626568@apps.rackspace.com> References: <1540766351.319712328@apps.rackspace.com> <8E6735BA-A284-44BF-B378-5EE4E1CBEAC6@gmail.com> <1540852067.690626568@apps.rackspace.com> Message-ID: On 29 October 2018 at 22:27, wrote: > Among other things, how should versions be handled in module headers given > that we have an application version and perhaps a mix of module versions? They shouldn't. There's no need for module versions to vary independently of the application version. And there's no need to have them (I assume you mean as comments) in module headers. That's what source control's for. Just generate the application version from the same source-control-derived value. For modules, you can just use Erlang's default MD5 scheme for module versions. Or you can make it the same as the application version. We use https://github.com/electricimp/vsn_transform, but note that -- depending on what you use to generate the version string -- you might end up with a non-reproducible build (see https://reproducible-builds.org/). From lukas@REDACTED Tue Oct 30 10:37:52 2018 From: lukas@REDACTED (Lukas Larsson) Date: Tue, 30 Oct 2018 10:37:52 +0100 Subject: [erlang-questions] Calling (equivalent of) erlang:send_after/3 from a NIF? In-Reply-To: References: Message-ID: On Mon, Oct 29, 2018 at 5:48 PM Roger Lipscombe wrote: > I'd like to start a timer in my NIF. It should send a message to an > Erlang process after a delay. There doesn't appear to be an > enif_send_after. > > Is there any way to do this? > No, there is no way to do this. One of the reasons this would be difficult to implement is because it is currently only possible to create timers on normal schedulers. So that functionality would have to be extended to be useable from dirty schedulers, which is no small task. If I were to do what you are after, I would first see if it is fast enough to setup timers as the nif returns, using a monotonic timestamp to adjust them for the time it took for the nif to return. Another idea would be to use timerfd_create and then do a enif_select on that. Or just roll your own thread, with a small enough number of counters it should be simple enough. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.muller.erl@REDACTED Tue Oct 30 10:40:45 2018 From: frank.muller.erl@REDACTED (Frank Muller) Date: Tue, 30 Oct 2018 10:40:45 +0100 Subject: [erlang-questions] PayPal client library? Message-ID: Hi, Is there any good PayPal api for Erlang our there? /Frank -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Tue Oct 30 11:15:25 2018 From: roger@REDACTED (Roger Lipscombe) Date: Tue, 30 Oct 2018 10:15:25 +0000 Subject: [erlang-questions] Calling (equivalent of) erlang:send_after/3 from a NIF? In-Reply-To: References: Message-ID: On 30 October 2018 at 09:37, Lukas Larsson wrote: > No, there is no way to do this. Pity. > One of the reasons this would be difficult > to implement is because it is currently only possible to create timers on > normal schedulers. So that functionality would have to be extended to be > useable from dirty schedulers, which is no small task. I'd be using it from a background thread -- cf enif_send(NULL, ...) -- rather than a dirty scheduler, but I imagine the same constraint applies? > If I were to do what you are after, I would first see if it is fast enough > to setup timers as the nif returns, using a monotonic timestamp to adjust > them for the time it took for the nif to return. Because this would potentially be from a background, arbitrary, thread -- as in: there's no well-defined place to return this from -- that's not gonna fly, unfortunately. > Another idea would be to use timerfd_create and then do a enif_select on > that. That involves a kernel-mode transition, which -- since Spectre/Meltdown -- is something we're trying to avoid, particularly since we're on VMs. I might try it for comparison, though. > Or just roll your own thread, with a small enough number of counters > it should be simple enough. We're potentially looking at ~20-25K timers (not just curl-required ones). I was hoping to leverage someone else's timer wheel implementation :) Thanks, Roger. From lukas@REDACTED Tue Oct 30 13:17:25 2018 From: lukas@REDACTED (Lukas Larsson) Date: Tue, 30 Oct 2018 13:17:25 +0100 Subject: [erlang-questions] Calling (equivalent of) erlang:send_after/3 from a NIF? In-Reply-To: References: Message-ID: On Tue, Oct 30, 2018 at 11:15 AM Roger Lipscombe wrote: > On 30 October 2018 at 09:37, Lukas Larsson wrote: > > One of the reasons this would be difficult > > to implement is because it is currently only possible to create timers on > > normal schedulers. So that functionality would have to be extended to be > > useable from dirty schedulers, which is no small task. > > I'd be using it from a background thread -- cf enif_send(NULL, ...) -- > rather than a dirty scheduler, but I imagine the same constraint > applies? > yes. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathaniel@REDACTED Tue Oct 30 15:03:16 2018 From: nathaniel@REDACTED (Nathaniel Waisbrot) Date: Tue, 30 Oct 2018 10:03:16 -0400 Subject: [erlang-questions] Calling (equivalent of) erlang:send_after/3 from a NIF? In-Reply-To: References: <1540841917.788285.1558725112.64A5494B@webmail.messagingengine.com> Message-ID: <1540908196.1769746.1559634216.18216A09@webmail.messagingengine.com> On Mon, Oct 29, 2018, at 5:24 PM, Roger Lipscombe wrote: > On 29 October 2018 at 19:38, Nathaniel Waisbrot > wrote:>> Is the idea that your NIF would pause the system for some time and >> then send>> its message and unpause the system? > > I've got a reactor-style thing going on inside my NIF, where I service> a large number of timers and sockets. We're hitting scalability issues> with our current implementation, so I'm evaluating alternatives. > > Since this is already in a NIF, I'd like to experiment with replacing> the socket polling with Erlang's enif_select, because I suspect it'll> be more scalable -- I'd like to find out, anyway. The plan is that, on> receiving the message from enif_select, I can quickly dip back into > NIF-land and service the relevant socket. > > Some of these sockets are actually libcurl-driven, and one of the > things that libcurl wants is for us to start a timer. I was hoping > that there'd be an equivalent of enif_select, but for timers (i.e. > enif_send_after). We also service a large number of non-curl timers, > and so I was hoping to use Erlang's timer implementation for these as> well. Maybe you could use a port driver for this. http://erlang.org/doc/man/erl_driver.html I played a little bit with creating a port driver to run Perl in a parallel thread, but I ultimately found it more trouble than I was willing to deal with. (The port driver code is complex and the documentation is difficult) I did not try creating a C node, but maybe that would actually have been easier; I assume that with a C node I wouldn't have been crashing my run- time as frequently. -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Tue Oct 30 16:04:30 2018 From: roger@REDACTED (Roger Lipscombe) Date: Tue, 30 Oct 2018 15:04:30 +0000 Subject: [erlang-questions] Calling (equivalent of) erlang:send_after/3 from a NIF? In-Reply-To: <1540908196.1769746.1559634216.18216A09@webmail.messagingengine.com> References: <1540841917.788285.1558725112.64A5494B@webmail.messagingengine.com> <1540908196.1769746.1559634216.18216A09@webmail.messagingengine.com> Message-ID: On 30 October 2018 at 14:03, Nathaniel Waisbrot wrote: > Maybe you could use a port driver for this. > http://erlang.org/doc/man/erl_driver.html The port driver API does appear to be slightly "richer" in the specific timer/select area, but the API looks kinda complicated, and we've already got a NIF, so... > I did not try creating a C node, but maybe that would actually have been > easier; I assume that with a C node I wouldn't have been crashing my > run-time as frequently. With a C node, I'd have to reimplement (or find) a suitable timer implementation. We've got a timer/select implementation; it just doesn't scale as well as I'd like, so I was hoping to use Erlang's (hopefully battle-hardened and scalable) implementation. I've got a couple more easy wins I can make to our existing implementation, but then we're going to have to take a long, hard look at it. As it is, our NIF is already running in its own Erlang node, so I'm not *that* bothered about crashing the runtime[1], not that we *do* crash the runtime (not since over a year ago, anyway). [1] See, I said I was aware of the risks of NIFs ;-) From garazdawi@REDACTED Tue Oct 30 16:19:11 2018 From: garazdawi@REDACTED (Lukas Larsson) Date: Tue, 30 Oct 2018 16:19:11 +0100 Subject: [erlang-questions] Calling (equivalent of) erlang:send_after/3 from a NIF? In-Reply-To: References: <1540841917.788285.1558725112.64A5494B@webmail.messagingengine.com> <1540908196.1769746.1559634216.18216A09@webmail.messagingengine.com> Message-ID: On Tue, Oct 30, 2018 at 4:04 PM Roger Lipscombe wrote: > On 30 October 2018 at 14:03, Nathaniel Waisbrot > wrote: > > Maybe you could use a port driver for this. > > http://erlang.org/doc/man/erl_driver.html > > The port driver API does appear to be slightly "richer" in the > specific timer/select area, but the API looks kinda complicated, and > we've already got a NIF, so... > >From the documentation: http://erlang.org/doc/man/erl_driver.html "Most functions in this API are *not* thread-safe, that is, they *cannot* be called from arbitrary threads. Functions that are not documented as thread-safe can only be called from driver callbacks or function calls descending from a driver callback call." So, you cannot use the driver timer functions in arbitrary threads either. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Tue Oct 30 16:32:18 2018 From: roger@REDACTED (Roger Lipscombe) Date: Tue, 30 Oct 2018 15:32:18 +0000 Subject: [erlang-questions] Calling (equivalent of) erlang:send_after/3 from a NIF? In-Reply-To: References: <1540841917.788285.1558725112.64A5494B@webmail.messagingengine.com> <1540908196.1769746.1559634216.18216A09@webmail.messagingengine.com> Message-ID: On 30 October 2018 at 15:19, Lukas Larsson wrote: > From the documentation: http://erlang.org/doc/man/erl_driver.html > > "Most functions in this API are not thread-safe, that is, they cannot be > called from arbitrary threads. Functions that are not documented as > thread-safe can only be called from driver callbacks or function calls > descending from a driver callback call." > > So, you cannot use the driver timer functions in arbitrary threads either. Plus there's that :-) Thanks, Roger. From codewiget95@REDACTED Tue Oct 30 16:41:31 2018 From: codewiget95@REDACTED (Code Wiget) Date: Tue, 30 Oct 2018 11:41:31 -0400 Subject: [erlang-questions] Modern Cuttlefish? Message-ID: <5c53485c-97a3-442d-b465-6735c2e3d09d@Spark> Hi everyone, Do any of you use/have/know of a ?modern? version of cuttlefish? Cuttlefish is great because it allows for easy user configuration, an advanced configuration, and easy mappings, but then you create a release and get errors like this with 0 context: > Cuttlefish failed! Oh no! You uncomment what you added, and still get a failure. Then you delete the commented section, and maybe it will decide to work. Is there a more modern version of this for Erlang? I see the last development for Cuttlefish was years ago. I?m sure the kids these days are using something -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Tue Oct 30 18:14:11 2018 From: lloyd@REDACTED (lloyd@REDACTED) Date: Tue, 30 Oct 2018 13:14:11 -0400 (EDT) Subject: [erlang-questions] Erlang checklists In-Reply-To: References: <1540766351.319712328@apps.rackspace.com> <8E6735BA-A284-44BF-B378-5EE4E1CBEAC6@gmail.com> <1540852067.690626568@apps.rackspace.com> Message-ID: <1540919651.664114311@apps.rackspace.com> Sorry, late night finger flub. I meant -compile(export all). Good ideas coming together. I'll try to summarize what we have so far anon. Best wishes to all. Lloyd -----Original Message----- From: "Brujo Benavides" Sent: Monday, October 29, 2018 9:31pm To: lloyd@REDACTED Cc: "erlang-questions@REDACTED" Subject: Re: [erlang-questions] Erlang checklists About your items: - not sure about module headers. But yeah, @doc in every module is a good guideline - no idea what you mean by this. I've never seen a -configure line in an Erlang module - just for exported ones I would say On Mon, 29 Oct 2018 at 19:27 <[ lloyd@REDACTED ]( mailto:lloyd@REDACTED )> wrote: Hi All, Terrific list, Brujo! Mind if I pare it down for Erlang and add a few very fundamental items that experienced Erlang programmers take for granted, but newcomers may miss: -- Nicely formatted module header (Is there a convention? Thoughts welcome) -- Uncomment -exort(xxx and and comment -configure(xxx lines -- @doc and -spec documentation of functions (Just exported or all in module?) -- Anything else we're missing? Among other things, how should versions be handled in module headers given that we have an application version and perhaps a mix of module versions? Roger and Lo?c: I couldn't agree with you more about specific statement of what the code does and who it would benefit. And Lo?c's other tips are well taken. I'll try to work them all in and send updated checklist anon. Thanks, Lloyd -----Original Message----- From: "Brujo Benavides" <[ elbrujohalcon@REDACTED ]( mailto:elbrujohalcon@REDACTED )> Sent: Monday, October 29, 2018 8:04am To: [ lloyd@REDACTED ]( mailto:lloyd@REDACTED ) Cc: "[ erlang-questions@REDACTED ]( mailto:erlang-questions@REDACTED )" <[ erlang-questions@REDACTED ]( mailto:erlang-questions@REDACTED )> Subject: Re: [erlang-questions] Erlang checklists Hi Lloyd, This is the checklist we have at Inaka: [ https://github.com/inaka/guidelines/blob/master/OPEN-SOURCE.md ]( https://github.com/inaka/guidelines/blob/master/OPEN-SOURCE.md ) Cheers! [ Brujo Benavides ]( http://about.me/elbrujohalcon ) On 28 Oct 2018, at 19:39, [ lloyd@REDACTED ]( mailto:lloyd@REDACTED ) wrote: Hello, With the generous help of Frank Muller, I recently created the erlPress_core repository on GitHub. Make a few blunders along the way. Still feel shaky about my responsibilities for nurturing the repository. So I'd like to create and share a step_by_step checklist for other Erlang noobs preparing to share code on GitHub with the Erlang community. Please send my your ideas. I'd like to do the same for releasing Erlang applications into production, but I'll hold on that for another time. Many thanks, LRP ********************************************* My books: THE GOSPEL OF ASHES [ http://thegospelofashes.com ]( http://thegospelofashes.com ) Strength is not enough. Do they have the courage and the cunning? Can they survive long enough to save the lives of millions? FREEIN' PANCHO [ http://freeinpancho.com ]( http://freeinpancho.com ) A community of misfits help a troubled boy find his way AYA TAKEO [ http://ayatakeo.com ]( http://ayatakeo.com ) Star-crossed love, war and power in an alternative universe Available through Amazon or by request from your favorite bookstore **********************************************_______________________________________________ erlang-questions mailing list [ erlang-questions@REDACTED ]( mailto:erlang-questions@REDACTED ) [ http://erlang.org/mailman/listinfo/erlang-questions ]( http://erlang.org/mailman/listinfo/erlang-questions )-- elbrujohalcon @ iPhone -------------- next part -------------- An HTML attachment was scrubbed... URL: From heturing@REDACTED Wed Oct 31 04:24:23 2018 From: heturing@REDACTED (=?UTF-8?B?44Kr44Kr44Kt?=) Date: Wed, 31 Oct 2018 12:24:23 +0900 Subject: [erlang-questions] Erlang Exercise 19-3 Message-ID: Hello, everyone. I'm a little confused with an Exercise, and I cannot understand the question. Here is the question. Write a program to detect plagiarisms in text. To do this, use a two-pass algorithm. In pass 1, break the text into 40-character blocks and compute a checksum for each 40-character block. Store the checksum and filename in an ETS table. In pass 2, compute the checksum of each 40-character block in the data and compare with the checksums in the ETS table. Hint: You will need to compute a "rolling checksum" to do this. For example, if C1 = B1 + B2 + ... + B40 and C2 = B2 + B3+ ... + B41, then C2 can be quickly computed by obversing that C2 = C1 + B41 - B1. What I've done is finding two files, say file1.txt and file2.txt. I want to check whether file2 plagiarizes file1. So I get first 40-characters of file1 and calculate the checksum of it. And then I move the block one character to the right and calculate the checksum. At last, I will get a list of checksum of file1, and I store them into an ETS table. On pass two, I do the same thing with file2 and get a list of checksum [C1, C2, ..., Cn]. For each element, I check whether it exists in ETS table or not. If exists, it means that there is a block with the same content in file 1. So it is plagiarism. Finally, I count the number of these blocks and output it. However, it seems that I haven't use the filename. So I am wondering that there is something wrong with my opinion. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From raoknz@REDACTED Wed Oct 31 09:29:10 2018 From: raoknz@REDACTED (Richard O'Keefe) Date: Wed, 31 Oct 2018 21:29:10 +1300 Subject: [erlang-questions] Erlang Exercise 19-3 In-Reply-To: References: Message-ID: The question means something like this. You are to construct and then use a table source : checksum -> set of filename by doing for each filename given open the file for each 40-character window of the contents of the file compute the checksum of the window add filename to source{checkum} close the file s := {} open the test data for each 40-character window of the contents of the testdata compute the checksum of the window let s' be source{checksum} with default {} s := s U s' close the test data report the set of possible source file names s Now the test is to accomplish, in Erlang, the same effect as that would, without necessarily doing it that way. This is actually a fairly simplistic version of an Information Retrieval task called Passage Retrieval. With a little more work, you can not only report that the test data may contain portions of various files, but *which* portions. With a bit more work than that, you can rank them, distinguishing files that contribute many passages from ones that contribute few. The neat thing here is that, done with care, you can handle very large document collections in Erlang without as much work as you might have to do in languages lacking a native-data-structures persistent store. When you look at this functionally, you see that this is basically a Map (over files) Reduce (the set unions) and that the index building could be done in a distributed way, again with relatively little effort. (The set unions I'm talking about are the "add ... to ..." ones. This is idempotent, so indexing the same document on two nodes is wasteful but not dangerous.) On Wed, 31 Oct 2018 at 18:55, ??? wrote: > Hello, everyone. > > I'm a little confused with an Exercise, and I cannot understand the > question. > > Here is the question. > > Write a program to detect plagiarisms in text. To do this, use a two-pass > algorithm. In pass 1, break the text into 40-character blocks and compute a > checksum for each 40-character block. Store the checksum and filename in an > ETS table. In pass 2, compute the checksum of each 40-character block in > the data and compare with the checksums in the ETS table. > > Hint: You will need to compute a "rolling checksum" to do this. For > example, if C1 = B1 + B2 + ... + B40 and C2 = B2 + B3+ ... + B41, then C2 > can be quickly computed by obversing that C2 = C1 + B41 - B1. > > What I've done is finding two files, say file1.txt and file2.txt. I want > to check whether file2 plagiarizes file1. So I get first 40-characters of > file1 and calculate the checksum of it. And then I move the block one > character to the right and calculate the checksum. At last, I will get a > list of checksum of file1, and I store them into an ETS table. > > On pass two, I do the same thing with file2 and get a list of checksum > [C1, C2, ..., Cn]. For each element, I check whether it exists in ETS table > or not. If exists, it means that there is a block with the same content in > file 1. So it is plagiarism. Finally, I count the number of these blocks > and output it. > > However, it seems that I haven't use the filename. So I am wondering that > there is something wrong with my opinion. > > Thanks. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Wed Oct 31 11:10:44 2018 From: erlang@REDACTED (Joe Armstrong) Date: Wed, 31 Oct 2018 11:10:44 +0100 Subject: [erlang-questions] Erlang Exercise 19-3 In-Reply-To: References: Message-ID: I'd have two types of entries in the ets table first a set of files {{file,1},"/path/to/file1"} {{file,2},"/path/to/file2"} and a set of hashes {{, {,}} is your 40 character Hash, is 1,... (ie one of the numbers in the table) is the offset in the file that has this hash. You compute this table in pass one iterating over all files in your collection In pass 2 you compute the rolling hash and look at each value in the ets table. Don't bother to store all the rolling hashes in a list. If you get a hit try to extend the match to see how much more data matches. The sum of bytes hash is actually rather bad and will give a lot of false hits (ie the hash agrees but the text differs) If you want a better rolling hash algorithm use one of the methods from this reference https://en.wikipedia.org/wiki/Rolling_hash Cheers /Joe On Wed, Oct 31, 2018 at 9:29 AM Richard O'Keefe wrote: > > The question means something like this. > You are to construct and then use a table > source : checksum -> set of filename > by doing > for each filename given > open the file > for each 40-character window of the contents of the file > compute the checksum of the window > add filename to source{checkum} > close the file > > s := {} > open the test data > for each 40-character window of the contents of the testdata > compute the checksum of the window > let s' be source{checksum} with default {} > s := s U s' > close the test data > report the set of possible source file names s > > Now the test is to accomplish, in Erlang, the same > effect as that would, without necessarily doing it > that way. > > This is actually a fairly simplistic version of an > Information Retrieval task called Passage Retrieval. > With a little more work, you can not only report > that the test data may contain portions of various > files, but *which* portions. With a bit more work > than that, you can rank them, distinguishing files > that contribute many passages from ones that contribute > few. The neat thing here is that, done with care, > you can handle very large document collections in > Erlang without as much work as you might have to do in > languages lacking a native-data-structures persistent store. > > When you look at this functionally, you see that this is > basically a Map (over files) Reduce (the set unions) and > that the index building could be done in a distributed > way, again with relatively little effort. (The set > unions I'm talking about are the "add ... to ..." ones. > This is idempotent, so indexing the same document on two > nodes is wasteful but not dangerous.) > > > On Wed, 31 Oct 2018 at 18:55, ??? wrote: >> >> Hello, everyone. >> >> I'm a little confused with an Exercise, and I cannot understand the question. >> >> Here is the question. >> >> Write a program to detect plagiarisms in text. To do this, use a two-pass algorithm. In pass 1, break the text into 40-character blocks and compute a checksum for each 40-character block. Store the checksum and filename in an ETS table. In pass 2, compute the checksum of each 40-character block in the data and compare with the checksums in the ETS table. >> >> Hint: You will need to compute a "rolling checksum" to do this. For example, if C1 = B1 + B2 + ... + B40 and C2 = B2 + B3+ ... + B41, then C2 can be quickly computed by obversing that C2 = C1 + B41 - B1. >> >> What I've done is finding two files, say file1.txt and file2.txt. I want to check whether file2 plagiarizes file1. So I get first 40-characters of file1 and calculate the checksum of it. And then I move the block one character to the right and calculate the checksum. At last, I will get a list of checksum of file1, and I store them into an ETS table. >> >> On pass two, I do the same thing with file2 and get a list of checksum [C1, C2, ..., Cn]. For each element, I check whether it exists in ETS table or not. If exists, it means that there is a block with the same content in file 1. So it is plagiarism. Finally, I count the number of these blocks and output it. >> >> However, it seems that I haven't use the filename. So I am wondering that there is something wrong with my opinion. >> >> Thanks. >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From codewiget95@REDACTED Wed Oct 31 15:01:49 2018 From: codewiget95@REDACTED (Code Wiget) Date: Wed, 31 Oct 2018 10:01:49 -0400 Subject: [erlang-questions] Modern Cuttlefish? In-Reply-To: References: <5c53485c-97a3-442d-b465-6735c2e3d09d@Spark> Message-ID: <455d80c6-0634-427c-b8f8-e1b2d7e5452d@Spark> Mariano, I have been using rebar3_cuttlefish for all of my projects, the issue is still there. It uses cuttlefish which is very out of date and doesn?t give any useful error information. Joe, Cuttlefish(https://github.com/tsloughter/rebar3_cuttlefish,?https://github.com/basho/cuttlefish)?is a tool that takes configuration parameters and converts them to an erlang config file. For example, you could have a simple(.conf) file: > host = 127.0.0.1 > Port = 8883 And using mappings in a schema, you can convert that to part of a system config file (.config) > {http_app, [ > ? ? ?{host, ?127.0.0.1?}, > ? ? ?{port, 8883} > ]}. It can also take multiple values from the .conf file into a larger .config file, and mutate them using translations. Its a cool tool. For example, I use it(in one use case)to set the log locations for lager using a translation. I set > log_file = /var/log/app1/console.log > log_level = debug And then I translate that into > {lager_file_backend, > ? ? ? ? ? [{file,"/var/log/app1/console.log"}, > ? ? ? ? ? ?{level,debug}, > ? ? ? ? ? ?{formatter,lager_default_formatter}, > ? ? ? ? ? ?{formatter_config, > ? ? ? ? ? ? ? ?[date," ",time," [",severity,"] ",pid," ",message, ? ? ? ? ? ? ? ? "\n"]}]} It makes for easy and dynamic configuration. The issue is that 1) it?s super old and unsupported, and 2) it gives no error information when there is an issue in configuration. On Oct 31, 2018, 5:19 AM -0400, Mariano Guerra , wrote: > On Wed, Oct 31, 2018 at 10:15 AM Mariano Guerra wrote: > > > > > > > On Tue, Oct 30, 2018 at 4:43 PM Code Wiget wrote: > > > > > Hi everyone, > > > > > > > > > > Do any of you use/have/know of a ?modern? version of cuttlefish? Cuttlefish is great because it allows for easy user configuration, an advanced configuration, and easy mappings, but then you create a release and get errors like this with 0 context: > > > > > > > > > > > > > hi, I use if for all my projects, it works pretty well with the rebar3_cuttlefish plugin (https://hex.pm/packages/rebar3_cuttlefish/) > > > > > > > > if you want to see a setup that works check the rebar3 riak-core template https://marianoguerra.github.io/riak-core-tutorial/setup.html#install-riak-core-rebar3-template you don't need to use it, just create the project and check rebar.config and the config folder > > > > I noticed that the next step is in a later section: https://marianoguerra.github.io/riak-core-tutorial/setup.html#test-that-everything-works > > > > to summarize here: > > > > mkdir -p ~/.config/rebar3/templates > > git clone https://github.com/marianoguerra/rebar3_template_riak_core.git ~/.config/rebar3/templates/rebar3_template_riak_core > > rebar3 new rebar3_riak_core name=akv > > cd akv > > make > > make console > > > > > > > > > > > > > > Cuttlefish failed! Oh no! > > > > > > > > > > > > > when I get that error I go to the script, add some prints and run the offending line by hand, usually it's some erlang version problem, format error or similar. > > > > > > > > that message doesn't come from cuttlefish itself but from the script that runs it, in my case it's this line: > > > > > > > > CUTTLEFISH_CONFIG=$($CUTTLEFISHCMD -e $RUNNER_ETC_DIR -d $RUNNER_GEN_DIR/generated.conf -s $RUNNER_BASE_DIR/share/schema/ -c $RUNNER_ETC_DIR/$CUTTLEFISH_CONF.new) > > > > > > > > which I print to the console > > > > > > > > echo "$CUTTLEFISHCMD -e $RUNNER_ETC_DIR -d $RUNNER_GEN_DIR/generated.conf -s $RUNNER_BASE_DIR/share/schema/ -c $RUNNER_ETC_DIR/$CUTTLEFISH_CONF.new" > > > > > > > > copy the output and run it manually to see the error details (it would be nice to print the error output with the "oh no" message, or at least a random http://webcomicname.com/ :P) > > > > > > > > > You uncomment what you added, and still get a failure. Then you delete the commented section, and maybe it will decide to work. > > > > > > > > > > Is there a more modern version of this for Erlang? I see the last development for Cuttlefish was years ago. I?m sure the kids these days are using something > > > > > _______________________________________________ > > > > > erlang-questions mailing list > > > > > erlang-questions@REDACTED > > > > > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew@REDACTED Wed Oct 31 15:19:29 2018 From: andrew@REDACTED (Andrew Thompson) Date: Wed, 31 Oct 2018 10:19:29 -0400 Subject: [erlang-questions] Modern Cuttlefish? In-Reply-To: <5c53485c-97a3-442d-b465-6735c2e3d09d@Spark> References: <5c53485c-97a3-442d-b465-6735c2e3d09d@Spark> Message-ID: <20181031141927.GC25490@thecloud.hijacked.us> On Tue, Oct 30, 2018 at 11:41:31AM -0400, Code Wiget wrote: > Hi everyone, > > Do any of you use/have/know of a ?modern? version of cuttlefish? Cuttlefish is great because it allows for easy user configuration, an advanced configuration, and easy mappings, but then you create a release and get errors like this with 0 context: > > > Cuttlefish failed! Oh no! > > You uncomment what you added, and still get a failure. Then you delete the commented section, and maybe it will decide to work. > > Is there a more modern version of this for Erlang? I see the last development for Cuttlefish was years ago. I?m sure the kids these days are using something There's several forks of cuttlefish on github that are more modern. Maybe we can get a bunch of interested parties together and update the basho version (I have commit access to the basho org) with the fixes needed to make it work on OTP 20/21 and start getting PRs flowing again. Andrew