From bchesneau@REDACTED Sun Apr 1 19:55:08 2018 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sun, 1 Apr 2018 19:55:08 +0200 Subject: [erlang-questions] ssl: Bad Certficate using file generated using mkcert.org Message-ID: I'm trying to connect to airbrake.io via ssl using the certificates generated by the website mkcert: https://mkcert.org/ which get the certificates from Mozilla but I get a "Bad certificat" error on latest release of erlang: 9> ssl:connect("airbrake.io", 443, [{cacertfile, CaCertFile}, {verify, verify_peer}, {depth, 99}]). =INFO REPORT==== 1-Apr-2018::19:45:51 === TLS client: In state certify at ssl_handshake.erl:1271 generated CLIENT ALERT: Fatal - Bad Certificate {error,{tls_alert,"bad certificate"}} where with google it worked: 10> ssl:connect("google.com", 443, [{cacertfile, CaCertFile}, {verify, verify_peer}, {depth, 99}]). {ok,{sslsocket,{gen_tcp,#Port<0.9355>,tls_connection, undefined}, <0.224.0>}} It used to work with previous versions of Erlang, did something changed in the validation in 20.x? Also how can I check what is the exact issue in the certificate that cause this error? According sslabs there are no issue in checking the certificate: https://www.ssllabs.com/ssltest/analyze.html?d=airbrake.io -------------- next part -------------- An HTML attachment was scrubbed... URL: From luke@REDACTED Sun Apr 1 21:07:00 2018 From: luke@REDACTED (Luke Bakken) Date: Sun, 01 Apr 2018 19:07:00 +0000 Subject: [erlang-questions] ssl: Bad Certficate using file generated using mkcert.org In-Reply-To: References: Message-ID: Try adding "digitalSignature" to the keyUsage field for the cert. Luke On Sun, Apr 1, 2018, 10:55 AM Benoit Chesneau wrote: > I'm trying to connect to airbrake.io via ssl using the certificates > generated by the website mkcert: https://mkcert.org/ which get the > certificates from Mozilla but I get a "Bad certificat" error on latest > release of erlang: > > 9> ssl:connect("airbrake.io", 443, [{cacertfile, CaCertFile}, {verify, > verify_peer}, {depth, 99}]). > > =INFO REPORT==== 1-Apr-2018::19:45:51 === > TLS client: In state certify at ssl_handshake.erl:1271 generated CLIENT > ALERT: Fatal - Bad Certificate > > {error,{tls_alert,"bad certificate"}} > > > where with google it worked: > > 10> ssl:connect("google.com", 443, [{cacertfile, CaCertFile}, {verify, > verify_peer}, {depth, 99}]). > {ok,{sslsocket,{gen_tcp,#Port<0.9355>,tls_connection, > undefined}, > <0.224.0>}} > > > > It used to work with previous versions of Erlang, did something changed in > the validation in 20.x? > > Also how can I check what is the exact issue in the certificate that cause > this error? According sslabs there are no issue in checking the certificate: > > https://www.ssllabs.com/ssltest/analyze.html?d=airbrake.io > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luke@REDACTED Sun Apr 1 21:23:04 2018 From: luke@REDACTED (Luke Bakken) Date: Sun, 1 Apr 2018 12:23:04 -0700 Subject: [erlang-questions] ssl: Bad Certficate using file generated using mkcert.org In-Reply-To: References: Message-ID: Oh, never mind, I thought you were responsible for the airbrake.io cert. I have seen the same behavior you report when using different CA certificate bundles. Using the default OS X bundle usually works, while recent Mozilla CA bundles don't. I did a bunch of diagnosis but never came to a definitive conclusion. I'll re-visit what I did and will see if I can figure out what exactly works and what doesn't. Luke On Sun, Apr 1, 2018 at 12:13 PM, Benoit Chesneau wrote: > hrm not sure i understand. You mean to the cacerts file or to the cert of > airbrake? I?m not responsible of the last one. > > Beno?t > > > On Sunday, April 1, 2018, Luke Bakken wrote: >> >> Try adding "digitalSignature" to the keyUsage field for the cert. >> >> Luke >> >> On Sun, Apr 1, 2018, 10:55 AM Benoit Chesneau wrote: >>> >>> I'm trying to connect to airbrake.io via ssl using the certificates >>> generated by the website mkcert: https://mkcert.org/ which get the >>> certificates from Mozilla but I get a "Bad certificat" error on latest >>> release of erlang: >>> >>> 9> ssl:connect("airbrake.io", 443, [{cacertfile, CaCertFile}, {verify, >>> verify_peer}, {depth, 99}]). >>> >>> =INFO REPORT==== 1-Apr-2018::19:45:51 === >>> TLS client: In state certify at ssl_handshake.erl:1271 generated CLIENT >>> ALERT: Fatal - Bad Certificate >>> >>> {error,{tls_alert,"bad certificate"}} >>> >>> >>> where with google it worked: >>> >>> 10> ssl:connect("google.com", 443, [{cacertfile, CaCertFile}, {verify, >>> verify_peer}, {depth, 99}]). >>> {ok,{sslsocket,{gen_tcp,#Port<0.9355>,tls_connection, >>> undefined}, >>> <0.224.0>}} >>> >>> >>> >>> It used to work with previous versions of Erlang, did something changed >>> in the validation in 20.x? >>> >>> Also how can I check what is the exact issue in the certificate that >>> cause this error? According sslabs there are no issue in checking the >>> certificate: >>> >>> https://www.ssllabs.com/ssltest/analyze.html?d=airbrake.io >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > Sent from my Mobile From bchesneau@REDACTED Sun Apr 1 22:06:49 2018 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sun, 1 Apr 2018 22:06:49 +0200 Subject: [erlang-questions] ssl: Bad Certficate using file generated using mkcert.org In-Reply-To: References: Message-ID: heh OK, no problem :) To be complete the chain retuned by openssl is : OpenSSL> s_client -connect airbrake.io:443 -showcerts CONNECTED(00000006) depth=3 C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = AddTrust External CA Root verify error:num=19:self signed certificate in certificate chain verify return:0 --- Certificate chain 0 s:/OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*.airbrake.io i:/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA -----BEGIN CERTIFICATE----- MIIEwTCCA6mgAwIBAgIRAKLxH0P8s499IyC7Gi9P0e8wDQYJKoZIhvcNAQELBQAw TTELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB1NTTC5jb20xFDASBgNVBAsTC3d3dy5z c2wuY29tMRYwFAYDVQQDEw1TU0wuY29tIERWIENBMB4XDTE2MTEwNDAwMDAwMFoX DTE4MTEyODIzNTk1OVowWzEhMB8GA1UECxMYRG9tYWluIENvbnRyb2wgVmFsaWRh dGVkMR4wHAYDVQQLExVFc3NlbnRpYWxTU0wgV2lsZGNhcmQxFjAUBgNVBAMMDSou YWlyYnJha2UuaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDXWXkQ kM5+hdRdZhWC3G+wjwpSF2GNLzEf27+3CQvZA8J7trZ/JdHTwIt6TPnq4igmE/XA Ej2mOEu2crzO+mVignSSPDItHVB8UenwNphguUskZPSDgVEi5a7rBscFWKkvWMEH W6vhbrpur+G1j0awhTn6hh++DYUUUl03hUPh6qNN+GQ/wPn+Tbgzw3obX4sE7Iel UePxeMpzv4rG9nZznStoXYlRFws3BaL8wTkL3G8wLVJndlIKTzMdfDCinvGpkV85 rdfm7UfsvFCdYKosOpbt5iRCJGTJvckFX4ih2MAC8mMP+bwzrNrNkPjuY8To+pVC F2rNvjRWJn+yTDdVAgMBAAGjggGMMIIBiDAfBgNVHSMEGDAWgBRGmv38UV58VFNS 4pnjszLvkxp/VjAdBgNVHQ4EFgQUkQAJSPUocFTrnPm4af+i76JscKkwDgYDVR0P AQH/BAQDAgWgMAwGA1UdEwEB/wQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG AQUFBwMCMEoGA1UdIARDMEEwNQYKKwYBBAGCqTABATAnMCUGCCsGAQUFBwIBFhlo dHRwczovL2Nwcy51c2VydHJ1c3QuY29tMAgGBmeBDAECATA0BgNVHR8ELTArMCmg J6AlhiNodHRwOi8vY3JsLnNzbC5jb20vU1NMY29tRFZDQV8yLmNybDBgBggrBgEF BQcBAQRUMFIwLwYIKwYBBQUHMAKGI2h0dHA6Ly9jcnQuc3NsLmNvbS9TU0xjb21E VkNBXzIuY3J0MB8GCCsGAQUFBzABhhNodHRwOi8vb2NzcC5zc2wuY29tMCUGA1Ud EQQeMByCDSouYWlyYnJha2UuaW+CC2FpcmJyYWtlLmlvMA0GCSqGSIb3DQEBCwUA A4IBAQBWDuO6czF5/CGPCuySdo9UGy7/Rj/oONzEPSJJcRZ1o6ix+RV7+dQBNBO0 SPuAkgH4k/Qbs75htpduWq+5hIfgYwSWvTW+2kcEZKgkPrg53n7cMT10MTg7I7oS qNvIpNh+2e6JwaFnM9pYSOSx01zh2HnCi8l+AQmVRdhxVDgOT+9SNcLC3+j/IuY6 iGnse7X4Q3diIMNxtPTdqfPsewLuWH7RJutwuLTIP5qL1R+AH0RmOGeX2K16rPLr 1GczOm5WnRyikYMjGW6llzS7RXgPfvdeU8mt4wK7fvZ9chMLNR7fpmEsWoejmN5P nqzjN5AKKgED5AjJ+DNtKzzEJqW0 -----END CERTIFICATE----- 1 s:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root -----BEGIN CERTIFICATE----- MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290 MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9 uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0 WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0 Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= -----END CERTIFICATE----- 2 s:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST Network/CN=USERTrust RSA Certification Authority i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root -----BEGIN CERTIFICATE----- MIIFdzCCBF+gAwIBAgIQE+oocFv07O0MNmMJgGFDNjANBgkqhkiG9w0BAQwFADBv MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF eHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFow gYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5MRQwEgYDVQQHEwtK ZXJzZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMS4wLAYD VQQDEyVVU0VSVHJ1c3QgUlNBIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjAN BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAgBJlFzYOw9sIs9CsVw127c0n00yt UINh4qogTQktZAnczomfzD2p7PbPwdzx07HWezcoEStH2jnGvDoZtF+mvX2do2NC tnbyqTsrkfjib9DsFiCQCT7i6HTJGLSR1GJk23+jBvGIGGqQIjy8/hPwhxR79uQf jtTkUcYRZ0YIUcuGFFQ/vDP+fmyc/xadGL1RjjWmp2bIcmfbIWax1Jt4A8BQOujM 8Ny8nkz+rwWWNR9XWrf/zvk9tyy29lTdyOcSOk2uTIq3XJq0tyA9yn8iNK5+O2hm AUTnAU5GU5szYPeUvlM3kHND8zLDU+/bqv50TmnHa4xgk97Exwzf4TKuzJM7UXiV Z4vuPVb+DNBpDxsP8yUmazNt925H+nND5X4OpWaxKXwyhGNVicQNwZNUMBkTrNN9 N6frXTpsNVzbQdcS2qlJC9/YgIoJk2KOtWbPJYjNhLixP6Q5D9kCnusSTJV882sF qV4Wg8y4Z+LoE53MW4LTTLPtW//e5XOsIzstAL81VXQJSdhJWBp/kjbmUZIO8yZ9 HE0XvMnsQybQv0FfQKlERPSZ51eHnlAfV1SoPv10Yy+xUGUJ5lhCLkMaTLTwJUdZ +gQek9QmRkpQgbLevni3/GcV4clXhB4PY9bpYrrWX1Uu6lzGKAgEJTm4Diup8kyX HAc/DVL17e8vgg8CAwEAAaOB9DCB8TAfBgNVHSMEGDAWgBStvZh6NLQm9/rEJlTv A73gJMtUGjAdBgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/ BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0gBAowCDAGBgRVHSAAMEQGA1Ud HwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9BZGRUcnVzdEV4 dGVybmFsQ0FSb290LmNybDA1BggrBgEFBQcBAQQpMCcwJQYIKwYBBQUHMAGGGWh0 dHA6Ly9vY3NwLnVzZXJ0cnVzdC5jb20wDQYJKoZIhvcNAQEMBQADggEBAJNl9jeD lQ9ew4IcH9Z35zyKwKoJ8OkLJvHgwmp1ocd5yblSYMgpEg7wrQPWCcR23+WmgZWn RtqCV6mVksW2jwMibDN3wXsyF24HzloUQToFJBv2FAY7qCUkDrvMKnXduXBBP3zQ YzYhBx9G/2CkkeFnvN4ffhkUyWNnkepnB2u0j4vAbkN9w6GAbLIevFOFfdyQoaS8 Le9Gclc1Bb+7RrtubTeZtv8jkpHGbkD4jylW6l/VXxRTrPBPYer3IsynVgviuDQf Jtl7GQVoP7o81DgGotPmjw7jtHFtQELFhLRAlSv0ZaBIefYdgWOWnU914Ph85I6p 0fKtirOMxyHNwu8= -----END CERTIFICATE----- 3 s:/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA i:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST Network/CN=USERTrust RSA Certification Authority -----BEGIN CERTIFICATE----- MIIF5jCCA86gAwIBAgIQEQDFvydYwZlp/Gjtcp381zANBgkqhkiG9w0BAQwFADCB iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTQw NzA0MDAwMDAwWhcNMjQwNzAzMjM1OTU5WjBNMQswCQYDVQQGEwJVUzEQMA4GA1UE ChMHU1NMLmNvbTEUMBIGA1UECxMLd3d3LnNzbC5jb20xFjAUBgNVBAMTDVNTTC5j b20gRFYgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDAJEcVY7NR 2qmRMLzC17tObKov3Jf1AQLOfZRfCi26JM4lYzJoW7uMO6RSwBJeP6pSBYthSWLc R+zd0bsQW5xKGITX51HYBH3daGWQEJIWVfL59cw3qhRsMQ5XP/IMZ15BOUxqGRVV 7NnCBBVcrWVhrEqSZbM6o61lMBU3sQQlYep/Ie3Ce6ca8oWfX5h4hrWtxuRCiBB4 EjxMB5KYOKJnQaOLEXaRhgr8cNHhzjl2KrKx/tCMtR/9pqy/+dOCKDiQWkg+hBoT D/hGc/B3x7KfHAbdLJTPrRdJrFnSwMWwPcrWGIrrud3w5VxzXBjPAzQn7Dg/hpGB NHEHBwKsLER3AgMBAAGjggGEMIIBgDAfBgNVHSMEGDAWgBRTeb9aqitKz1SA4dib wJ3ysgNmyzAdBgNVHQ4EFgQURpr9/FFefFRTUuKZ47My75Maf1YwDgYDVR0PAQH/ BAQDAgGGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG CCsGAQUFBwMCMCEGA1UdIAQaMBgwDAYKKwYBBAGCqTABATAIBgZngQwBAgEwVQYD VR0fBE4wTDBKoEigRoZEaHR0cDovL2NybC50cnVzdC1wcm92aWRlci5jb20vVVNF UlRydXN0UlNBQ2VydGlmaWNhdGlvbkF1dGhvcml0eS5jcmwwgYAGCCsGAQUFBwEB BHQwcjBEBggrBgEFBQcwAoY4aHR0cDovL2NydC50cnVzdC1wcm92aWRlci5jb20v VVNFUlRydXN0UlNBQWRkVHJ1c3RDQS5jcnQwKgYIKwYBBQUHMAGGHmh0dHA6Ly9v Y3NwLnRydXN0LXByb3ZpZGVyLmNvbTANBgkqhkiG9w0BAQwFAAOCAgEAB1RJZUdF d05ZN1SYdTZsDj9Rq9De097SCCWi0E97Ehc2MRQag98VqlZPrC2WM9q+C7Z5MvcM 1njs15p55YRJbHjjECgiabKEPsx3xXH+oTb4kKzQjqMZV5CNC7K+5H4OaCtNcFEZ E2vWRI9hunFjTfTJ9VrKjGIwcYz30VtdB1vtk0Jaf0lnC4H1GOAdw3IwJgbygOeu ACY/1RH5U0ai2e9wWXsiADjBtHbiFPEzt5Cmu2wag9fPrX663Xs5TqjDNCPAgCLm ijzyrCQmlCaug332cwnYI5dA0Oa/eIV6lYZTev143bZWs+A6dQhXDJUQzfSvPsQS Pu/W3QAkw4vuZ97mVvgzK5LiDWps2N9Fw9b5Et4Op+cuy27I48fG3bRH0dROJwYs w+MrMc5Sy/TOl9a5UUmtq2jEJbEv7xU5x1bvhaFfBtxoF36sLLuPf19Aev4n2Y46 Fou4Aup1eWVyS+XYKiaTGzxL5b4fbwhKItk8NptdrJ26YmdCl6cFNaabXHHak24W I0cF4+u8ATOxkdFkuLyWusWzfmfIMHX1ZHD3giYavooNnupzxnju58Tpc9AsCgyL rRxTbur5AscjOsHHfzeeTqflKtslTvJ9AvNkPLizR2cMk4+1h+6yDBHggsm0bZn0 AeY5kXGfjIimFcd00xvjkVn41em3We1sghs= -----END CERTIFICATE----- --- Server certificate subject=/OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*. airbrake.io issuer=/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA --- No client certificate CA names sent --- SSL handshake has read 5736 bytes and written 444 bytes --- New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session: Protocol : TLSv1.2 Cipher : ECDHE-RSA-AES128-GCM-SHA256 Session-ID: 62BF8A905F9DF278347423E70D100144AEB17B41C4BEB41FE8BC83512D8AE5C7 Session-ID-ctx: Master-Key: D3F6811B769DE3E5045BB386AE6CA561C272F44014A3F1DB8F8786B599D11015CE44AF5B8351CDD466EA7A02E764F78A Start Time: 1522613090 Timeout : 300 (sec) Verify return code: 0 (ok) --- HTTP/1.0 408 Request Time-out Cache-Control: no-cache Connection: close Content-Type: text/html

408 Request Time-out

Your browser didn't send a complete request in time. closed On Sun, Apr 1, 2018 at 9:23 PM, Luke Bakken wrote: > Oh, never mind, I thought you were responsible for the airbrake.io cert. > > I have seen the same behavior you report when using different CA > certificate bundles. Using the default OS X bundle usually works, > while recent Mozilla CA bundles don't. I did a bunch of diagnosis but > never came to a definitive conclusion. I'll re-visit what I did and > will see if I can figure out what exactly works and what doesn't. > > Luke > > On Sun, Apr 1, 2018 at 12:13 PM, Benoit Chesneau > wrote: > > hrm not sure i understand. You mean to the cacerts file or to the cert of > > airbrake? I?m not responsible of the last one. > > > > Beno?t > > > > > > On Sunday, April 1, 2018, Luke Bakken wrote: > >> > >> Try adding "digitalSignature" to the keyUsage field for the cert. > >> > >> Luke > >> > >> On Sun, Apr 1, 2018, 10:55 AM Benoit Chesneau > wrote: > >>> > >>> I'm trying to connect to airbrake.io via ssl using the certificates > >>> generated by the website mkcert: https://mkcert.org/ which get the > >>> certificates from Mozilla but I get a "Bad certificat" error on latest > >>> release of erlang: > >>> > >>> 9> ssl:connect("airbrake.io", 443, [{cacertfile, CaCertFile}, {verify, > >>> verify_peer}, {depth, 99}]). > >>> > >>> =INFO REPORT==== 1-Apr-2018::19:45:51 === > >>> TLS client: In state certify at ssl_handshake.erl:1271 generated CLIENT > >>> ALERT: Fatal - Bad Certificate > >>> > >>> {error,{tls_alert,"bad certificate"}} > >>> > >>> > >>> where with google it worked: > >>> > >>> 10> ssl:connect("google.com", 443, [{cacertfile, CaCertFile}, {verify, > >>> verify_peer}, {depth, 99}]). > >>> {ok,{sslsocket,{gen_tcp,#Port<0.9355>,tls_connection, > >>> undefined}, > >>> <0.224.0>}} > >>> > >>> > >>> > >>> It used to work with previous versions of Erlang, did something changed > >>> in the validation in 20.x? > >>> > >>> Also how can I check what is the exact issue in the certificate that > >>> cause this error? According sslabs there are no issue in checking the > >>> certificate: > >>> > >>> https://www.ssllabs.com/ssltest/analyze.html?d=airbrake.io > >>> > >>> > >>> _______________________________________________ > >>> erlang-questions mailing list > >>> erlang-questions@REDACTED > >>> http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > -- > > Sent from my Mobile > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Sun Apr 1 22:19:03 2018 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sun, 1 Apr 2018 22:19:03 +0200 Subject: [erlang-questions] ssl: Bad Certficate using file generated using mkcert.org In-Reply-To: References: Message-ID: err wrong coppy-paste. So using openssl the certidicate looks OK. So it seems an error in erlang. OpenSSL> s_client -connect airbrake.io:443 -CAfile /Users/benoitc/Misc/erlang-certifi/priv/cacerts.pem CONNECTED(00000006) depth=3 C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = AddTrust External CA Root verify return:1 depth=2 C = US, ST = New Jersey, L = Jersey City, O = The USERTRUST Network, CN = USERTrust RSA Certification Authority verify return:1 depth=1 C = US, O = SSL.com, OU = www.ssl.com, CN = SSL.com DV CA verify return:1 depth=0 OU = Domain Control Validated, OU = EssentialSSL Wildcard, CN = *. airbrake.io verify return:1 --- Certificate chain 0 s:/OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*.airbrake.io i:/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA 1 s:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root 2 s:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST Network/CN=USERTrust RSA Certification Authority i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root 3 s:/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA i:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST Network/CN=USERTrust RSA Certification Authority --- Server certificate -----BEGIN CERTIFICATE----- MIIEwTCCA6mgAwIBAgIRAKLxH0P8s499IyC7Gi9P0e8wDQYJKoZIhvcNAQELBQAw TTELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB1NTTC5jb20xFDASBgNVBAsTC3d3dy5z c2wuY29tMRYwFAYDVQQDEw1TU0wuY29tIERWIENBMB4XDTE2MTEwNDAwMDAwMFoX DTE4MTEyODIzNTk1OVowWzEhMB8GA1UECxMYRG9tYWluIENvbnRyb2wgVmFsaWRh dGVkMR4wHAYDVQQLExVFc3NlbnRpYWxTU0wgV2lsZGNhcmQxFjAUBgNVBAMMDSou YWlyYnJha2UuaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDXWXkQ kM5+hdRdZhWC3G+wjwpSF2GNLzEf27+3CQvZA8J7trZ/JdHTwIt6TPnq4igmE/XA Ej2mOEu2crzO+mVignSSPDItHVB8UenwNphguUskZPSDgVEi5a7rBscFWKkvWMEH W6vhbrpur+G1j0awhTn6hh++DYUUUl03hUPh6qNN+GQ/wPn+Tbgzw3obX4sE7Iel UePxeMpzv4rG9nZznStoXYlRFws3BaL8wTkL3G8wLVJndlIKTzMdfDCinvGpkV85 rdfm7UfsvFCdYKosOpbt5iRCJGTJvckFX4ih2MAC8mMP+bwzrNrNkPjuY8To+pVC F2rNvjRWJn+yTDdVAgMBAAGjggGMMIIBiDAfBgNVHSMEGDAWgBRGmv38UV58VFNS 4pnjszLvkxp/VjAdBgNVHQ4EFgQUkQAJSPUocFTrnPm4af+i76JscKkwDgYDVR0P AQH/BAQDAgWgMAwGA1UdEwEB/wQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG AQUFBwMCMEoGA1UdIARDMEEwNQYKKwYBBAGCqTABATAnMCUGCCsGAQUFBwIBFhlo dHRwczovL2Nwcy51c2VydHJ1c3QuY29tMAgGBmeBDAECATA0BgNVHR8ELTArMCmg J6AlhiNodHRwOi8vY3JsLnNzbC5jb20vU1NMY29tRFZDQV8yLmNybDBgBggrBgEF BQcBAQRUMFIwLwYIKwYBBQUHMAKGI2h0dHA6Ly9jcnQuc3NsLmNvbS9TU0xjb21E VkNBXzIuY3J0MB8GCCsGAQUFBzABhhNodHRwOi8vb2NzcC5zc2wuY29tMCUGA1Ud EQQeMByCDSouYWlyYnJha2UuaW+CC2FpcmJyYWtlLmlvMA0GCSqGSIb3DQEBCwUA A4IBAQBWDuO6czF5/CGPCuySdo9UGy7/Rj/oONzEPSJJcRZ1o6ix+RV7+dQBNBO0 SPuAkgH4k/Qbs75htpduWq+5hIfgYwSWvTW+2kcEZKgkPrg53n7cMT10MTg7I7oS qNvIpNh+2e6JwaFnM9pYSOSx01zh2HnCi8l+AQmVRdhxVDgOT+9SNcLC3+j/IuY6 iGnse7X4Q3diIMNxtPTdqfPsewLuWH7RJutwuLTIP5qL1R+AH0RmOGeX2K16rPLr 1GczOm5WnRyikYMjGW6llzS7RXgPfvdeU8mt4wK7fvZ9chMLNR7fpmEsWoejmN5P nqzjN5AKKgED5AjJ+DNtKzzEJqW0 -----END CERTIFICATE----- subject=/OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*. airbrake.io issuer=/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA --- No client certificate CA names sent --- SSL handshake has read 5736 bytes and written 444 bytes --- New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session: Protocol : TLSv1.2 Cipher : ECDHE-RSA-AES128-GCM-SHA256 Session-ID: 2CA3877657CF653D2885B34218AC09ECA30A9E125AC0556D749E359F3A6822F7 Session-ID-ctx: Master-Key: 2D3A255FF47D44AAD4CA06024149B9538819A0C832426B69B83EFE76E5404BC87790360A2F4FFC9933DB76816555C6B1 Start Time: 1522613874 Timeout : 300 (sec) Verify return code: 0 (ok) --- HTTP/1.0 408 Request Time-out Cache-Control: no-cache Connection: close Content-Type: text/html

408 Request Time-out

Your browser didn't send a complete request in time. closed On Sun, Apr 1, 2018 at 10:06 PM, Benoit Chesneau wrote: > heh OK, no problem :) > > To be complete the chain retuned by openssl is : > > OpenSSL> s_client -connect airbrake.io:443 -showcerts > CONNECTED(00000006) > depth=3 C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = > AddTrust External CA Root > verify error:num=19:self signed certificate in certificate chain > verify return:0 > --- > Certificate chain > 0 s:/OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*. > airbrake.io > i:/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA > -----BEGIN CERTIFICATE----- > MIIEwTCCA6mgAwIBAgIRAKLxH0P8s499IyC7Gi9P0e8wDQYJKoZIhvcNAQELBQAw > TTELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB1NTTC5jb20xFDASBgNVBAsTC3d3dy5z > c2wuY29tMRYwFAYDVQQDEw1TU0wuY29tIERWIENBMB4XDTE2MTEwNDAwMDAwMFoX > DTE4MTEyODIzNTk1OVowWzEhMB8GA1UECxMYRG9tYWluIENvbnRyb2wgVmFsaWRh > dGVkMR4wHAYDVQQLExVFc3NlbnRpYWxTU0wgV2lsZGNhcmQxFjAUBgNVBAMMDSou > YWlyYnJha2UuaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDXWXkQ > kM5+hdRdZhWC3G+wjwpSF2GNLzEf27+3CQvZA8J7trZ/JdHTwIt6TPnq4igmE/XA > Ej2mOEu2crzO+mVignSSPDItHVB8UenwNphguUskZPSDgVEi5a7rBscFWKkvWMEH > W6vhbrpur+G1j0awhTn6hh++DYUUUl03hUPh6qNN+GQ/wPn+Tbgzw3obX4sE7Iel > UePxeMpzv4rG9nZznStoXYlRFws3BaL8wTkL3G8wLVJndlIKTzMdfDCinvGpkV85 > rdfm7UfsvFCdYKosOpbt5iRCJGTJvckFX4ih2MAC8mMP+bwzrNrNkPjuY8To+pVC > F2rNvjRWJn+yTDdVAgMBAAGjggGMMIIBiDAfBgNVHSMEGDAWgBRGmv38UV58VFNS > 4pnjszLvkxp/VjAdBgNVHQ4EFgQUkQAJSPUocFTrnPm4af+i76JscKkwDgYDVR0P > AQH/BAQDAgWgMAwGA1UdEwEB/wQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG > AQUFBwMCMEoGA1UdIARDMEEwNQYKKwYBBAGCqTABATAnMCUGCCsGAQUFBwIBFhlo > dHRwczovL2Nwcy51c2VydHJ1c3QuY29tMAgGBmeBDAECATA0BgNVHR8ELTArMCmg > J6AlhiNodHRwOi8vY3JsLnNzbC5jb20vU1NMY29tRFZDQV8yLmNybDBgBggrBgEF > BQcBAQRUMFIwLwYIKwYBBQUHMAKGI2h0dHA6Ly9jcnQuc3NsLmNvbS9TU0xjb21E > VkNBXzIuY3J0MB8GCCsGAQUFBzABhhNodHRwOi8vb2NzcC5zc2wuY29tMCUGA1Ud > EQQeMByCDSouYWlyYnJha2UuaW+CC2FpcmJyYWtlLmlvMA0GCSqGSIb3DQEBCwUA > A4IBAQBWDuO6czF5/CGPCuySdo9UGy7/Rj/oONzEPSJJcRZ1o6ix+RV7+dQBNBO0 > SPuAkgH4k/Qbs75htpduWq+5hIfgYwSWvTW+2kcEZKgkPrg53n7cMT10MTg7I7oS > qNvIpNh+2e6JwaFnM9pYSOSx01zh2HnCi8l+AQmVRdhxVDgOT+9SNcLC3+j/IuY6 > iGnse7X4Q3diIMNxtPTdqfPsewLuWH7RJutwuLTIP5qL1R+AH0RmOGeX2K16rPLr > 1GczOm5WnRyikYMjGW6llzS7RXgPfvdeU8mt4wK7fvZ9chMLNR7fpmEsWoejmN5P > nqzjN5AKKgED5AjJ+DNtKzzEJqW0 > -----END CERTIFICATE----- > 1 s:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust > External CA Root > i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust > External CA Root > -----BEGIN CERTIFICATE----- > MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU > MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs > IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290 > MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux > FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h > bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v > dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt > H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9 > uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX > mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX > a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN > E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0 > WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD > VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0 > Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU > cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx > IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN > AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH > YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 > 6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC > Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX > c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a > mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= > -----END CERTIFICATE----- > 2 s:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST > Network/CN=USERTrust RSA Certification Authority > i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust > External CA Root > -----BEGIN CERTIFICATE----- > MIIFdzCCBF+gAwIBAgIQE+oocFv07O0MNmMJgGFDNjANBgkqhkiG9w0BAQwFADBv > MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk > ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF > eHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFow > gYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5MRQwEgYDVQQHEwtK > ZXJzZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMS4wLAYD > VQQDEyVVU0VSVHJ1c3QgUlNBIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjAN > BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAgBJlFzYOw9sIs9CsVw127c0n00yt > UINh4qogTQktZAnczomfzD2p7PbPwdzx07HWezcoEStH2jnGvDoZtF+mvX2do2NC > tnbyqTsrkfjib9DsFiCQCT7i6HTJGLSR1GJk23+jBvGIGGqQIjy8/hPwhxR79uQf > jtTkUcYRZ0YIUcuGFFQ/vDP+fmyc/xadGL1RjjWmp2bIcmfbIWax1Jt4A8BQOujM > 8Ny8nkz+rwWWNR9XWrf/zvk9tyy29lTdyOcSOk2uTIq3XJq0tyA9yn8iNK5+O2hm > AUTnAU5GU5szYPeUvlM3kHND8zLDU+/bqv50TmnHa4xgk97Exwzf4TKuzJM7UXiV > Z4vuPVb+DNBpDxsP8yUmazNt925H+nND5X4OpWaxKXwyhGNVicQNwZNUMBkTrNN9 > N6frXTpsNVzbQdcS2qlJC9/YgIoJk2KOtWbPJYjNhLixP6Q5D9kCnusSTJV882sF > qV4Wg8y4Z+LoE53MW4LTTLPtW//e5XOsIzstAL81VXQJSdhJWBp/kjbmUZIO8yZ9 > HE0XvMnsQybQv0FfQKlERPSZ51eHnlAfV1SoPv10Yy+xUGUJ5lhCLkMaTLTwJUdZ > +gQek9QmRkpQgbLevni3/GcV4clXhB4PY9bpYrrWX1Uu6lzGKAgEJTm4Diup8kyX > HAc/DVL17e8vgg8CAwEAAaOB9DCB8TAfBgNVHSMEGDAWgBStvZh6NLQm9/rEJlTv > A73gJMtUGjAdBgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/ > BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0gBAowCDAGBgRVHSAAMEQGA1Ud > HwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9BZGRUcnVzdEV4 > dGVybmFsQ0FSb290LmNybDA1BggrBgEFBQcBAQQpMCcwJQYIKwYBBQUHMAGGGWh0 > dHA6Ly9vY3NwLnVzZXJ0cnVzdC5jb20wDQYJKoZIhvcNAQEMBQADggEBAJNl9jeD > lQ9ew4IcH9Z35zyKwKoJ8OkLJvHgwmp1ocd5yblSYMgpEg7wrQPWCcR23+WmgZWn > RtqCV6mVksW2jwMibDN3wXsyF24HzloUQToFJBv2FAY7qCUkDrvMKnXduXBBP3zQ > YzYhBx9G/2CkkeFnvN4ffhkUyWNnkepnB2u0j4vAbkN9w6GAbLIevFOFfdyQoaS8 > Le9Gclc1Bb+7RrtubTeZtv8jkpHGbkD4jylW6l/VXxRTrPBPYer3IsynVgviuDQf > Jtl7GQVoP7o81DgGotPmjw7jtHFtQELFhLRAlSv0ZaBIefYdgWOWnU914Ph85I6p > 0fKtirOMxyHNwu8= > -----END CERTIFICATE----- > 3 s:/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA > i:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST > Network/CN=USERTrust RSA Certification Authority > -----BEGIN CERTIFICATE----- > MIIF5jCCA86gAwIBAgIQEQDFvydYwZlp/Gjtcp381zANBgkqhkiG9w0BAQwFADCB > iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl > cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV > BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTQw > NzA0MDAwMDAwWhcNMjQwNzAzMjM1OTU5WjBNMQswCQYDVQQGEwJVUzEQMA4GA1UE > ChMHU1NMLmNvbTEUMBIGA1UECxMLd3d3LnNzbC5jb20xFjAUBgNVBAMTDVNTTC5j > b20gRFYgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDAJEcVY7NR > 2qmRMLzC17tObKov3Jf1AQLOfZRfCi26JM4lYzJoW7uMO6RSwBJeP6pSBYthSWLc > R+zd0bsQW5xKGITX51HYBH3daGWQEJIWVfL59cw3qhRsMQ5XP/IMZ15BOUxqGRVV > 7NnCBBVcrWVhrEqSZbM6o61lMBU3sQQlYep/Ie3Ce6ca8oWfX5h4hrWtxuRCiBB4 > EjxMB5KYOKJnQaOLEXaRhgr8cNHhzjl2KrKx/tCMtR/9pqy/+dOCKDiQWkg+hBoT > D/hGc/B3x7KfHAbdLJTPrRdJrFnSwMWwPcrWGIrrud3w5VxzXBjPAzQn7Dg/hpGB > NHEHBwKsLER3AgMBAAGjggGEMIIBgDAfBgNVHSMEGDAWgBRTeb9aqitKz1SA4dib > wJ3ysgNmyzAdBgNVHQ4EFgQURpr9/FFefFRTUuKZ47My75Maf1YwDgYDVR0PAQH/ > BAQDAgGGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG > CCsGAQUFBwMCMCEGA1UdIAQaMBgwDAYKKwYBBAGCqTABATAIBgZngQwBAgEwVQYD > VR0fBE4wTDBKoEigRoZEaHR0cDovL2NybC50cnVzdC1wcm92aWRlci5jb20vVVNF > UlRydXN0UlNBQ2VydGlmaWNhdGlvbkF1dGhvcml0eS5jcmwwgYAGCCsGAQUFBwEB > BHQwcjBEBggrBgEFBQcwAoY4aHR0cDovL2NydC50cnVzdC1wcm92aWRlci5jb20v > VVNFUlRydXN0UlNBQWRkVHJ1c3RDQS5jcnQwKgYIKwYBBQUHMAGGHmh0dHA6Ly9v > Y3NwLnRydXN0LXByb3ZpZGVyLmNvbTANBgkqhkiG9w0BAQwFAAOCAgEAB1RJZUdF > d05ZN1SYdTZsDj9Rq9De097SCCWi0E97Ehc2MRQag98VqlZPrC2WM9q+C7Z5MvcM > 1njs15p55YRJbHjjECgiabKEPsx3xXH+oTb4kKzQjqMZV5CNC7K+5H4OaCtNcFEZ > E2vWRI9hunFjTfTJ9VrKjGIwcYz30VtdB1vtk0Jaf0lnC4H1GOAdw3IwJgbygOeu > ACY/1RH5U0ai2e9wWXsiADjBtHbiFPEzt5Cmu2wag9fPrX663Xs5TqjDNCPAgCLm > ijzyrCQmlCaug332cwnYI5dA0Oa/eIV6lYZTev143bZWs+A6dQhXDJUQzfSvPsQS > Pu/W3QAkw4vuZ97mVvgzK5LiDWps2N9Fw9b5Et4Op+cuy27I48fG3bRH0dROJwYs > w+MrMc5Sy/TOl9a5UUmtq2jEJbEv7xU5x1bvhaFfBtxoF36sLLuPf19Aev4n2Y46 > Fou4Aup1eWVyS+XYKiaTGzxL5b4fbwhKItk8NptdrJ26YmdCl6cFNaabXHHak24W > I0cF4+u8ATOxkdFkuLyWusWzfmfIMHX1ZHD3giYavooNnupzxnju58Tpc9AsCgyL > rRxTbur5AscjOsHHfzeeTqflKtslTvJ9AvNkPLizR2cMk4+1h+6yDBHggsm0bZn0 > AeY5kXGfjIimFcd00xvjkVn41em3We1sghs= > -----END CERTIFICATE----- > --- > Server certificate > subject=/OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*. > airbrake.io > issuer=/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA > --- > No client certificate CA names sent > --- > SSL handshake has read 5736 bytes and written 444 bytes > --- > New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256 > Server public key is 2048 bit > Secure Renegotiation IS supported > Compression: NONE > Expansion: NONE > No ALPN negotiated > SSL-Session: > Protocol : TLSv1.2 > Cipher : ECDHE-RSA-AES128-GCM-SHA256 > Session-ID: 62BF8A905F9DF278347423E70D1001 > 44AEB17B41C4BEB41FE8BC83512D8AE5C7 > Session-ID-ctx: > Master-Key: D3F6811B769DE3E5045BB386AE6CA5 > 61C272F44014A3F1DB8F8786B599D11015CE44AF5B8351CDD466EA7A02E764F78A > Start Time: 1522613090 > Timeout : 300 (sec) > Verify return code: 0 (ok) > --- > HTTP/1.0 408 Request Time-out > Cache-Control: no-cache > Connection: close > Content-Type: text/html > >

408 Request Time-out

> Your browser didn't send a complete request in time. > > closed > > > On Sun, Apr 1, 2018 at 9:23 PM, Luke Bakken wrote: > >> Oh, never mind, I thought you were responsible for the airbrake.io cert. >> >> I have seen the same behavior you report when using different CA >> certificate bundles. Using the default OS X bundle usually works, >> while recent Mozilla CA bundles don't. I did a bunch of diagnosis but >> never came to a definitive conclusion. I'll re-visit what I did and >> will see if I can figure out what exactly works and what doesn't. >> >> Luke >> >> On Sun, Apr 1, 2018 at 12:13 PM, Benoit Chesneau >> wrote: >> > hrm not sure i understand. You mean to the cacerts file or to the cert >> of >> > airbrake? I?m not responsible of the last one. >> > >> > Beno?t >> > >> > >> > On Sunday, April 1, 2018, Luke Bakken wrote: >> >> >> >> Try adding "digitalSignature" to the keyUsage field for the cert. >> >> >> >> Luke >> >> >> >> On Sun, Apr 1, 2018, 10:55 AM Benoit Chesneau >> wrote: >> >>> >> >>> I'm trying to connect to airbrake.io via ssl using the certificates >> >>> generated by the website mkcert: https://mkcert.org/ which get the >> >>> certificates from Mozilla but I get a "Bad certificat" error on latest >> >>> release of erlang: >> >>> >> >>> 9> ssl:connect("airbrake.io", 443, [{cacertfile, CaCertFile}, >> {verify, >> >>> verify_peer}, {depth, 99}]). >> >>> >> >>> =INFO REPORT==== 1-Apr-2018::19:45:51 === >> >>> TLS client: In state certify at ssl_handshake.erl:1271 generated >> CLIENT >> >>> ALERT: Fatal - Bad Certificate >> >>> >> >>> {error,{tls_alert,"bad certificate"}} >> >>> >> >>> >> >>> where with google it worked: >> >>> >> >>> 10> ssl:connect("google.com", 443, [{cacertfile, CaCertFile}, >> {verify, >> >>> verify_peer}, {depth, 99}]). >> >>> {ok,{sslsocket,{gen_tcp,#Port<0.9355>,tls_connection, >> >>> undefined}, >> >>> <0.224.0>}} >> >>> >> >>> >> >>> >> >>> It used to work with previous versions of Erlang, did something >> changed >> >>> in the validation in 20.x? >> >>> >> >>> Also how can I check what is the exact issue in the certificate that >> >>> cause this error? According sslabs there are no issue in checking the >> >>> certificate: >> >>> >> >>> https://www.ssllabs.com/ssltest/analyze.html?d=airbrake.io >> >>> >> >>> >> >>> _______________________________________________ >> >>> erlang-questions mailing list >> >>> erlang-questions@REDACTED >> >>> http://erlang.org/mailman/listinfo/erlang-questions >> > >> > >> > >> > -- >> > Sent from my Mobile >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Mon Apr 2 10:11:17 2018 From: bchesneau@REDACTED (Benoit Chesneau) Date: Mon, 2 Apr 2018 10:11:17 +0200 Subject: [erlang-questions] ssl: Bad Certficate using file generated using mkcert.org In-Reply-To: References: Message-ID: It seems according ssllabs there is a problem with the chain: "Incorrect order, Contains anchor" which is probably the root issue: https://github.com/benoitc/hackney/issues/490#issuecomment-377873484 I'm now wondering if there is any possibility to fix it in recent Erlang versions. Did anyone already encounter such issue? - benoit On Sun, Apr 1, 2018 at 10:19 PM, Benoit Chesneau wrote: > err wrong coppy-paste. So using openssl the certidicate looks OK. So it > seems an error in erlang. > > OpenSSL> s_client -connect airbrake.io:443 -CAfile > /Users/benoitc/Misc/erlang-certifi/priv/cacerts.pem > CONNECTED(00000006) > depth=3 C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = > AddTrust External CA Root > verify return:1 > depth=2 C = US, ST = New Jersey, L = Jersey City, O = The USERTRUST > Network, CN = USERTrust RSA Certification Authority > verify return:1 > depth=1 C = US, O = SSL.com, OU = www.ssl.com, CN = SSL.com DV CA > verify return:1 > depth=0 OU = Domain Control Validated, OU = EssentialSSL Wildcard, CN = *. > airbrake.io > verify return:1 > --- > Certificate chain > 0 s:/OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*. > airbrake.io > i:/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA > 1 s:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust > External CA Root > i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust > External CA Root > 2 s:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST > Network/CN=USERTrust RSA Certification Authority > i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust > External CA Root > 3 s:/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA > i:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST > Network/CN=USERTrust RSA Certification Authority > --- > Server certificate > > -----BEGIN CERTIFICATE----- > MIIEwTCCA6mgAwIBAgIRAKLxH0P8s499IyC7Gi9P0e8wDQYJKoZIhvcNAQELBQAw > TTELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB1NTTC5jb20xFDASBgNVBAsTC3d3dy5z > c2wuY29tMRYwFAYDVQQDEw1TU0wuY29tIERWIENBMB4XDTE2MTEwNDAwMDAwMFoX > DTE4MTEyODIzNTk1OVowWzEhMB8GA1UECxMYRG9tYWluIENvbnRyb2wgVmFsaWRh > dGVkMR4wHAYDVQQLExVFc3NlbnRpYWxTU0wgV2lsZGNhcmQxFjAUBgNVBAMMDSou > YWlyYnJha2UuaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDXWXkQ > kM5+hdRdZhWC3G+wjwpSF2GNLzEf27+3CQvZA8J7trZ/JdHTwIt6TPnq4igmE/XA > Ej2mOEu2crzO+mVignSSPDItHVB8UenwNphguUskZPSDgVEi5a7rBscFWKkvWMEH > W6vhbrpur+G1j0awhTn6hh++DYUUUl03hUPh6qNN+GQ/wPn+Tbgzw3obX4sE7Iel > UePxeMpzv4rG9nZznStoXYlRFws3BaL8wTkL3G8wLVJndlIKTzMdfDCinvGpkV85 > rdfm7UfsvFCdYKosOpbt5iRCJGTJvckFX4ih2MAC8mMP+bwzrNrNkPjuY8To+pVC > F2rNvjRWJn+yTDdVAgMBAAGjggGMMIIBiDAfBgNVHSMEGDAWgBRGmv38UV58VFNS > 4pnjszLvkxp/VjAdBgNVHQ4EFgQUkQAJSPUocFTrnPm4af+i76JscKkwDgYDVR0P > AQH/BAQDAgWgMAwGA1UdEwEB/wQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG > AQUFBwMCMEoGA1UdIARDMEEwNQYKKwYBBAGCqTABATAnMCUGCCsGAQUFBwIBFhlo > dHRwczovL2Nwcy51c2VydHJ1c3QuY29tMAgGBmeBDAECATA0BgNVHR8ELTArMCmg > J6AlhiNodHRwOi8vY3JsLnNzbC5jb20vU1NMY29tRFZDQV8yLmNybDBgBggrBgEF > BQcBAQRUMFIwLwYIKwYBBQUHMAKGI2h0dHA6Ly9jcnQuc3NsLmNvbS9TU0xjb21E > VkNBXzIuY3J0MB8GCCsGAQUFBzABhhNodHRwOi8vb2NzcC5zc2wuY29tMCUGA1Ud > EQQeMByCDSouYWlyYnJha2UuaW+CC2FpcmJyYWtlLmlvMA0GCSqGSIb3DQEBCwUA > A4IBAQBWDuO6czF5/CGPCuySdo9UGy7/Rj/oONzEPSJJcRZ1o6ix+RV7+dQBNBO0 > SPuAkgH4k/Qbs75htpduWq+5hIfgYwSWvTW+2kcEZKgkPrg53n7cMT10MTg7I7oS > qNvIpNh+2e6JwaFnM9pYSOSx01zh2HnCi8l+AQmVRdhxVDgOT+9SNcLC3+j/IuY6 > iGnse7X4Q3diIMNxtPTdqfPsewLuWH7RJutwuLTIP5qL1R+AH0RmOGeX2K16rPLr > 1GczOm5WnRyikYMjGW6llzS7RXgPfvdeU8mt4wK7fvZ9chMLNR7fpmEsWoejmN5P > nqzjN5AKKgED5AjJ+DNtKzzEJqW0 > -----END CERTIFICATE----- > subject=/OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*. > airbrake.io > issuer=/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA > --- > No client certificate CA names sent > --- > SSL handshake has read 5736 bytes and written 444 bytes > --- > New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256 > Server public key is 2048 bit > Secure Renegotiation IS supported > Compression: NONE > Expansion: NONE > No ALPN negotiated > SSL-Session: > Protocol : TLSv1.2 > Cipher : ECDHE-RSA-AES128-GCM-SHA256 > Session-ID: 2CA3877657CF653D2885B34218AC09 > ECA30A9E125AC0556D749E359F3A6822F7 > Session-ID-ctx: > Master-Key: 2D3A255FF47D44AAD4CA06024149B9 > 538819A0C832426B69B83EFE76E5404BC87790360A2F4FFC9933DB76816555C6B1 > Start Time: 1522613874 > Timeout : 300 (sec) > Verify return code: 0 (ok) > --- > > HTTP/1.0 408 Request Time-out > Cache-Control: no-cache > Connection: close > Content-Type: text/html > >

408 Request Time-out

> Your browser didn't send a complete request in time. > > closed > > > > On Sun, Apr 1, 2018 at 10:06 PM, Benoit Chesneau > wrote: > >> heh OK, no problem :) >> >> To be complete the chain retuned by openssl is : >> >> OpenSSL> s_client -connect airbrake.io:443 -showcerts >> CONNECTED(00000006) >> depth=3 C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = >> AddTrust External CA Root >> verify error:num=19:self signed certificate in certificate chain >> verify return:0 >> --- >> Certificate chain >> 0 s:/OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*. >> airbrake.io >> i:/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA >> -----BEGIN CERTIFICATE----- >> MIIEwTCCA6mgAwIBAgIRAKLxH0P8s499IyC7Gi9P0e8wDQYJKoZIhvcNAQELBQAw >> TTELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB1NTTC5jb20xFDASBgNVBAsTC3d3dy5z >> c2wuY29tMRYwFAYDVQQDEw1TU0wuY29tIERWIENBMB4XDTE2MTEwNDAwMDAwMFoX >> DTE4MTEyODIzNTk1OVowWzEhMB8GA1UECxMYRG9tYWluIENvbnRyb2wgVmFsaWRh >> dGVkMR4wHAYDVQQLExVFc3NlbnRpYWxTU0wgV2lsZGNhcmQxFjAUBgNVBAMMDSou >> YWlyYnJha2UuaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDXWXkQ >> kM5+hdRdZhWC3G+wjwpSF2GNLzEf27+3CQvZA8J7trZ/JdHTwIt6TPnq4igmE/XA >> Ej2mOEu2crzO+mVignSSPDItHVB8UenwNphguUskZPSDgVEi5a7rBscFWKkvWMEH >> W6vhbrpur+G1j0awhTn6hh++DYUUUl03hUPh6qNN+GQ/wPn+Tbgzw3obX4sE7Iel >> UePxeMpzv4rG9nZznStoXYlRFws3BaL8wTkL3G8wLVJndlIKTzMdfDCinvGpkV85 >> rdfm7UfsvFCdYKosOpbt5iRCJGTJvckFX4ih2MAC8mMP+bwzrNrNkPjuY8To+pVC >> F2rNvjRWJn+yTDdVAgMBAAGjggGMMIIBiDAfBgNVHSMEGDAWgBRGmv38UV58VFNS >> 4pnjszLvkxp/VjAdBgNVHQ4EFgQUkQAJSPUocFTrnPm4af+i76JscKkwDgYDVR0P >> AQH/BAQDAgWgMAwGA1UdEwEB/wQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG >> AQUFBwMCMEoGA1UdIARDMEEwNQYKKwYBBAGCqTABATAnMCUGCCsGAQUFBwIBFhlo >> dHRwczovL2Nwcy51c2VydHJ1c3QuY29tMAgGBmeBDAECATA0BgNVHR8ELTArMCmg >> J6AlhiNodHRwOi8vY3JsLnNzbC5jb20vU1NMY29tRFZDQV8yLmNybDBgBggrBgEF >> BQcBAQRUMFIwLwYIKwYBBQUHMAKGI2h0dHA6Ly9jcnQuc3NsLmNvbS9TU0xjb21E >> VkNBXzIuY3J0MB8GCCsGAQUFBzABhhNodHRwOi8vb2NzcC5zc2wuY29tMCUGA1Ud >> EQQeMByCDSouYWlyYnJha2UuaW+CC2FpcmJyYWtlLmlvMA0GCSqGSIb3DQEBCwUA >> A4IBAQBWDuO6czF5/CGPCuySdo9UGy7/Rj/oONzEPSJJcRZ1o6ix+RV7+dQBNBO0 >> SPuAkgH4k/Qbs75htpduWq+5hIfgYwSWvTW+2kcEZKgkPrg53n7cMT10MTg7I7oS >> qNvIpNh+2e6JwaFnM9pYSOSx01zh2HnCi8l+AQmVRdhxVDgOT+9SNcLC3+j/IuY6 >> iGnse7X4Q3diIMNxtPTdqfPsewLuWH7RJutwuLTIP5qL1R+AH0RmOGeX2K16rPLr >> 1GczOm5WnRyikYMjGW6llzS7RXgPfvdeU8mt4wK7fvZ9chMLNR7fpmEsWoejmN5P >> nqzjN5AKKgED5AjJ+DNtKzzEJqW0 >> -----END CERTIFICATE----- >> 1 s:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust >> External CA Root >> i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust >> External CA Root >> -----BEGIN CERTIFICATE----- >> MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU >> MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs >> IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290 >> MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux >> FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h >> bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v >> dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt >> H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9 >> uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX >> mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX >> a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN >> E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0 >> WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD >> VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0 >> Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU >> cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx >> IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN >> AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH >> YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 >> 6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC >> Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX >> c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a >> mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= >> -----END CERTIFICATE----- >> 2 s:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST >> Network/CN=USERTrust RSA Certification Authority >> i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust >> External CA Root >> -----BEGIN CERTIFICATE----- >> MIIFdzCCBF+gAwIBAgIQE+oocFv07O0MNmMJgGFDNjANBgkqhkiG9w0BAQwFADBv >> MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk >> ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF >> eHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFow >> gYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5MRQwEgYDVQQHEwtK >> ZXJzZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMS4wLAYD >> VQQDEyVVU0VSVHJ1c3QgUlNBIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjAN >> BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAgBJlFzYOw9sIs9CsVw127c0n00yt >> UINh4qogTQktZAnczomfzD2p7PbPwdzx07HWezcoEStH2jnGvDoZtF+mvX2do2NC >> tnbyqTsrkfjib9DsFiCQCT7i6HTJGLSR1GJk23+jBvGIGGqQIjy8/hPwhxR79uQf >> jtTkUcYRZ0YIUcuGFFQ/vDP+fmyc/xadGL1RjjWmp2bIcmfbIWax1Jt4A8BQOujM >> 8Ny8nkz+rwWWNR9XWrf/zvk9tyy29lTdyOcSOk2uTIq3XJq0tyA9yn8iNK5+O2hm >> AUTnAU5GU5szYPeUvlM3kHND8zLDU+/bqv50TmnHa4xgk97Exwzf4TKuzJM7UXiV >> Z4vuPVb+DNBpDxsP8yUmazNt925H+nND5X4OpWaxKXwyhGNVicQNwZNUMBkTrNN9 >> N6frXTpsNVzbQdcS2qlJC9/YgIoJk2KOtWbPJYjNhLixP6Q5D9kCnusSTJV882sF >> qV4Wg8y4Z+LoE53MW4LTTLPtW//e5XOsIzstAL81VXQJSdhJWBp/kjbmUZIO8yZ9 >> HE0XvMnsQybQv0FfQKlERPSZ51eHnlAfV1SoPv10Yy+xUGUJ5lhCLkMaTLTwJUdZ >> +gQek9QmRkpQgbLevni3/GcV4clXhB4PY9bpYrrWX1Uu6lzGKAgEJTm4Diup8kyX >> HAc/DVL17e8vgg8CAwEAAaOB9DCB8TAfBgNVHSMEGDAWgBStvZh6NLQm9/rEJlTv >> A73gJMtUGjAdBgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/ >> BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0gBAowCDAGBgRVHSAAMEQGA1Ud >> HwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9BZGRUcnVzdEV4 >> dGVybmFsQ0FSb290LmNybDA1BggrBgEFBQcBAQQpMCcwJQYIKwYBBQUHMAGGGWh0 >> dHA6Ly9vY3NwLnVzZXJ0cnVzdC5jb20wDQYJKoZIhvcNAQEMBQADggEBAJNl9jeD >> lQ9ew4IcH9Z35zyKwKoJ8OkLJvHgwmp1ocd5yblSYMgpEg7wrQPWCcR23+WmgZWn >> RtqCV6mVksW2jwMibDN3wXsyF24HzloUQToFJBv2FAY7qCUkDrvMKnXduXBBP3zQ >> YzYhBx9G/2CkkeFnvN4ffhkUyWNnkepnB2u0j4vAbkN9w6GAbLIevFOFfdyQoaS8 >> Le9Gclc1Bb+7RrtubTeZtv8jkpHGbkD4jylW6l/VXxRTrPBPYer3IsynVgviuDQf >> Jtl7GQVoP7o81DgGotPmjw7jtHFtQELFhLRAlSv0ZaBIefYdgWOWnU914Ph85I6p >> 0fKtirOMxyHNwu8= >> -----END CERTIFICATE----- >> 3 s:/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA >> i:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST >> Network/CN=USERTrust RSA Certification Authority >> -----BEGIN CERTIFICATE----- >> MIIF5jCCA86gAwIBAgIQEQDFvydYwZlp/Gjtcp381zANBgkqhkiG9w0BAQwFADCB >> iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl >> cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV >> BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTQw >> NzA0MDAwMDAwWhcNMjQwNzAzMjM1OTU5WjBNMQswCQYDVQQGEwJVUzEQMA4GA1UE >> ChMHU1NMLmNvbTEUMBIGA1UECxMLd3d3LnNzbC5jb20xFjAUBgNVBAMTDVNTTC5j >> b20gRFYgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDAJEcVY7NR >> 2qmRMLzC17tObKov3Jf1AQLOfZRfCi26JM4lYzJoW7uMO6RSwBJeP6pSBYthSWLc >> R+zd0bsQW5xKGITX51HYBH3daGWQEJIWVfL59cw3qhRsMQ5XP/IMZ15BOUxqGRVV >> 7NnCBBVcrWVhrEqSZbM6o61lMBU3sQQlYep/Ie3Ce6ca8oWfX5h4hrWtxuRCiBB4 >> EjxMB5KYOKJnQaOLEXaRhgr8cNHhzjl2KrKx/tCMtR/9pqy/+dOCKDiQWkg+hBoT >> D/hGc/B3x7KfHAbdLJTPrRdJrFnSwMWwPcrWGIrrud3w5VxzXBjPAzQn7Dg/hpGB >> NHEHBwKsLER3AgMBAAGjggGEMIIBgDAfBgNVHSMEGDAWgBRTeb9aqitKz1SA4dib >> wJ3ysgNmyzAdBgNVHQ4EFgQURpr9/FFefFRTUuKZ47My75Maf1YwDgYDVR0PAQH/ >> BAQDAgGGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG >> CCsGAQUFBwMCMCEGA1UdIAQaMBgwDAYKKwYBBAGCqTABATAIBgZngQwBAgEwVQYD >> VR0fBE4wTDBKoEigRoZEaHR0cDovL2NybC50cnVzdC1wcm92aWRlci5jb20vVVNF >> UlRydXN0UlNBQ2VydGlmaWNhdGlvbkF1dGhvcml0eS5jcmwwgYAGCCsGAQUFBwEB >> BHQwcjBEBggrBgEFBQcwAoY4aHR0cDovL2NydC50cnVzdC1wcm92aWRlci5jb20v >> VVNFUlRydXN0UlNBQWRkVHJ1c3RDQS5jcnQwKgYIKwYBBQUHMAGGHmh0dHA6Ly9v >> Y3NwLnRydXN0LXByb3ZpZGVyLmNvbTANBgkqhkiG9w0BAQwFAAOCAgEAB1RJZUdF >> d05ZN1SYdTZsDj9Rq9De097SCCWi0E97Ehc2MRQag98VqlZPrC2WM9q+C7Z5MvcM >> 1njs15p55YRJbHjjECgiabKEPsx3xXH+oTb4kKzQjqMZV5CNC7K+5H4OaCtNcFEZ >> E2vWRI9hunFjTfTJ9VrKjGIwcYz30VtdB1vtk0Jaf0lnC4H1GOAdw3IwJgbygOeu >> ACY/1RH5U0ai2e9wWXsiADjBtHbiFPEzt5Cmu2wag9fPrX663Xs5TqjDNCPAgCLm >> ijzyrCQmlCaug332cwnYI5dA0Oa/eIV6lYZTev143bZWs+A6dQhXDJUQzfSvPsQS >> Pu/W3QAkw4vuZ97mVvgzK5LiDWps2N9Fw9b5Et4Op+cuy27I48fG3bRH0dROJwYs >> w+MrMc5Sy/TOl9a5UUmtq2jEJbEv7xU5x1bvhaFfBtxoF36sLLuPf19Aev4n2Y46 >> Fou4Aup1eWVyS+XYKiaTGzxL5b4fbwhKItk8NptdrJ26YmdCl6cFNaabXHHak24W >> I0cF4+u8ATOxkdFkuLyWusWzfmfIMHX1ZHD3giYavooNnupzxnju58Tpc9AsCgyL >> rRxTbur5AscjOsHHfzeeTqflKtslTvJ9AvNkPLizR2cMk4+1h+6yDBHggsm0bZn0 >> AeY5kXGfjIimFcd00xvjkVn41em3We1sghs= >> -----END CERTIFICATE----- >> --- >> Server certificate >> subject=/OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*. >> airbrake.io >> issuer=/C=US/O=SSL.com/OU=www.ssl.com/CN=SSL.com DV CA >> --- >> No client certificate CA names sent >> --- >> SSL handshake has read 5736 bytes and written 444 bytes >> --- >> New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256 >> Server public key is 2048 bit >> Secure Renegotiation IS supported >> Compression: NONE >> Expansion: NONE >> No ALPN negotiated >> SSL-Session: >> Protocol : TLSv1.2 >> Cipher : ECDHE-RSA-AES128-GCM-SHA256 >> Session-ID: 62BF8A905F9DF278347423E70D1001 >> 44AEB17B41C4BEB41FE8BC83512D8AE5C7 >> Session-ID-ctx: >> Master-Key: D3F6811B769DE3E5045BB386AE6CA5 >> 61C272F44014A3F1DB8F8786B599D11015CE44AF5B8351CDD466EA7A02E764F78A >> Start Time: 1522613090 >> Timeout : 300 (sec) >> Verify return code: 0 (ok) >> --- >> HTTP/1.0 408 Request Time-out >> Cache-Control: no-cache >> Connection: close >> Content-Type: text/html >> >>

408 Request Time-out

>> Your browser didn't send a complete request in time. >> >> closed >> >> >> On Sun, Apr 1, 2018 at 9:23 PM, Luke Bakken wrote: >> >>> Oh, never mind, I thought you were responsible for the airbrake.io cert. >>> >>> I have seen the same behavior you report when using different CA >>> certificate bundles. Using the default OS X bundle usually works, >>> while recent Mozilla CA bundles don't. I did a bunch of diagnosis but >>> never came to a definitive conclusion. I'll re-visit what I did and >>> will see if I can figure out what exactly works and what doesn't. >>> >>> Luke >>> >>> On Sun, Apr 1, 2018 at 12:13 PM, Benoit Chesneau >>> wrote: >>> > hrm not sure i understand. You mean to the cacerts file or to the cert >>> of >>> > airbrake? I?m not responsible of the last one. >>> > >>> > Beno?t >>> > >>> > >>> > On Sunday, April 1, 2018, Luke Bakken wrote: >>> >> >>> >> Try adding "digitalSignature" to the keyUsage field for the cert. >>> >> >>> >> Luke >>> >> >>> >> On Sun, Apr 1, 2018, 10:55 AM Benoit Chesneau >>> wrote: >>> >>> >>> >>> I'm trying to connect to airbrake.io via ssl using the certificates >>> >>> generated by the website mkcert: https://mkcert.org/ which get the >>> >>> certificates from Mozilla but I get a "Bad certificat" error on >>> latest >>> >>> release of erlang: >>> >>> >>> >>> 9> ssl:connect("airbrake.io", 443, [{cacertfile, CaCertFile}, >>> {verify, >>> >>> verify_peer}, {depth, 99}]). >>> >>> >>> >>> =INFO REPORT==== 1-Apr-2018::19:45:51 === >>> >>> TLS client: In state certify at ssl_handshake.erl:1271 generated >>> CLIENT >>> >>> ALERT: Fatal - Bad Certificate >>> >>> >>> >>> {error,{tls_alert,"bad certificate"}} >>> >>> >>> >>> >>> >>> where with google it worked: >>> >>> >>> >>> 10> ssl:connect("google.com", 443, [{cacertfile, CaCertFile}, >>> {verify, >>> >>> verify_peer}, {depth, 99}]). >>> >>> {ok,{sslsocket,{gen_tcp,#Port<0.9355>,tls_connection, >>> >>> undefined}, >>> >>> <0.224.0>}} >>> >>> >>> >>> >>> >>> >>> >>> It used to work with previous versions of Erlang, did something >>> changed >>> >>> in the validation in 20.x? >>> >>> >>> >>> Also how can I check what is the exact issue in the certificate that >>> >>> cause this error? According sslabs there are no issue in checking the >>> >>> certificate: >>> >>> >>> >>> https://www.ssllabs.com/ssltest/analyze.html?d=airbrake.io >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> erlang-questions mailing list >>> >>> erlang-questions@REDACTED >>> >>> http://erlang.org/mailman/listinfo/erlang-questions >>> > >>> > >>> > >>> > -- >>> > Sent from my Mobile >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew@REDACTED Mon Apr 2 18:09:24 2018 From: andrew@REDACTED (Andrew Thompson) Date: Mon, 2 Apr 2018 12:09:24 -0400 Subject: [erlang-questions] ssl: Bad Certficate using file generated using mkcert.org In-Reply-To: References: Message-ID: <20180402160924.GC29047@thecloud.hijacked.us> On Mon, Apr 02, 2018 at 10:11:17AM +0200, Benoit Chesneau wrote: > It seems according ssllabs there is a problem with the chain: "Incorrect > order, Contains anchor" which is probably the root issue: > https://github.com/benoitc/hackney/issues/490#issuecomment-377873484 > > I'm now wondering if there is any possibility to fix it in recent Erlang > versions. Did anyone already encounter such issue? > I believe you can supply a custom verify_fun to the ssl application that can, sometimes, let you fix some of these issues. You might be able to handle the bad_cert case and fix up the ordering and verify it by hand. There's some old code I wrote that uses this to do something similar (except with CRLs) here: https://github.com/Vagabond/erl_crl_example/blob/master/src/client.erl Andrew From publicityifl@REDACTED Tue Apr 3 09:10:58 2018 From: publicityifl@REDACTED (Jurriaan Hage) Date: Tue, 3 Apr 2018 09:10:58 +0200 Subject: [erlang-questions] 2nd CfP: IFL 2018 (30th Symposium on Implementation and Application of Functional Languages) Message-ID: Hello, Please, find below the second call for papers for IFL 2018. Please forward these to anyone you think may be interested. Apologies for any duplicates you may receive. best regards, Jurriaan Hage Publicity Chair of IFL --- ================================================================================ IFL 2018 30th Symposium on Implementation and Application of Functional Languages University of Massachusetts Lowell, MA, USA September 5th-7th, 2018 http://iflconference.org ================================================================================ ### Scope The goal of the IFL symposia is to bring together researchers actively engaged in the implementation and application of functional and function-based programming languages. IFL 2018 will be a venue for researchers to present and discuss new ideas and concepts, work in progress, and publication-ripe results related to the implementation and application of functional languages and function-based programming. Topics of interest to IFL include, but are not limited to: - language concepts - type systems, type checking, type inferencing - compilation techniques - staged compilation - run-time function specialization - run-time code generation - partial evaluation - (abstract) interpretation - metaprogramming - generic programming - automatic program generation - array processing - concurrent/parallel programming - concurrent/parallel program execution - embedded systems - web applications - (embedded) domain specific languages - security - novel memory management techniques - run-time profiling performance measurements - debugging and tracing - virtual/abstract machine architectures - validation, verification of functional programs - tools and programming techniques - (industrial) applications ### Keynote Speakers * Adam Chlipala, Massachusetts Institute of Technology CSAIL * Arjun Guha, University of Massachusetts Amherst ### Submissions and peer-review Differently from previous editions of IFL, IFL 2018 solicits two kinds of submissions: * Regular papers (12 pages including references) * Draft papers for presentations ('weak' limit between 8 and 15 pages) Regular papers will undergo a rigorous review by the program committee, and will be evaluated according to their correctness, novelty, originality, relevance, significance, and clarity. A set of regular papers will be conditionally accepted for publication. Authors of conditionally accepted papers will be provided with committee reviews along with a set of mandatory revisions. Regular papers not accepted for publication will be considered as draft papers, at the request of the author. Draft papers will be screened to make sure that they are within the scope of IFL, and will be accepted for presentation or rejected accordingly. Prior to the symposium: Authors of conditionally accepted papers and accepted presentations will submit a pre-proceedings version of their work that will appear in the draft proceedings distributed at the symposium. The draft proceedings does not constitute a formal publication. We require that at least one of the authors present the work at IFL 2018. After the symposium: Authors of conditionally accepted papers will submit a revised versions of their paper for the formal post-proceedings. The program committee will assess whether the mandatory revisions have been adequately addressed by the authors and thereby determines the final accept/reject status of the paper. Our interest is to ultimately accept all conditionally accepted papers. If you are an author of a conditionally accepted paper, please make sure that you address all the concerns of the reviewers. Authors of accepted presentations will be given the opportunity to incorporate the feedback from discussions at the symposium and will be invited to submit a revised full article for the formal post-proceedings. The program committee will evaluate these submissions according to their correctness, novelty, originality, relevance, significance, and clarity, and will thereby determine whether the paper is accepted or rejected. ### Publication The formal proceedings will appear in the International Conference Proceedings Series of the ACM Digital Library. At no time may work submitted to IFL be simultaneously submitted to other venues; submissions must adhere to ACM SIGPLAN's republication policy: http://www.sigplan.org/Resources/Policies/Republication ### Important dates Submission of regular papers: May 25, 2018 Submission of draft papers: July 17, 2018 Regular and draft papers notification: July 20, 2018 Deadline for early registration: August 8, 2018 Submission of pre-proceedings version: August 29, 2018 IFL Symposium: September 5-7, 2018 Submission of papers for post-proceedings: November 7, 2018 Notification of acceptance: December 22, 2018 Camera-ready version: February 10, 2019 ### Submission details All contributions must be written in English. Papers must use the ACM two columns conference format, which can be found at: http://www.acm.org/publications/proceedings-template Authors submit through EasyChair: https://easychair.org/conferences/?conf=ifl2018 ### Peter Landin Prize The Peter Landin Prize is awarded to the best paper presented at the symposium every year. The honored article is selected by the program committee based on the submissions received for the formal review process. The prize carries a cash award equivalent to 150 Euros. ### Organization and Program committee Chairs: Jay McCarthy & Matteo Cimini, University of Massachusetts Lowell, USA Program Committee: * Arthur Chargueraud, Inria, FR * Ben Delaware, Purdue University, USA * Christos Dimoulas, Northwestern University, USA * David Darais, University of Vermont, USA * Dominic Orchard, University of Kent, UK * Ekaterina Komendantskaya, Heriot-Watt University, UK * Garrett Morris, University of Kansas, USA * Heather Miller, EPFL & Northeastern University, CH & USA * Jeremy Yallop, University of Cambridge, UK * Keiko Nakata, SAP Innovation Center Potsdam, DE * Laura Castro, University of A Coruna, ESP * Magnus Myreen, Chalmers University of Technology, SWE * Natalia Chechina, Bournemouth University, UK * Peter Achten, Radboud Universiteit Nijmegen, NL * Peter-Michael Osera, Grinnell College, USA * Richard Eisenberg, Bryn Mawr College, USA * Trevor McDonell, University of New South Wales, AUS * Yukiyoshi Kameyama, University of Tsukuba, JAP ### Venue The 30th IFL is organized by the University of Massachusetts Lowell. The City of Lowell is located at the heart of the Merrimack Valley just 30 miles northwest of Boston. Lowell can be easily reached by train or taxi. See the website for more information on the venue. ### Acknowledgments This call-for-papers is an adaptation and evolution of content from previous instances of IFL. We are grateful to prior organizers for their work, which is reused here. A part of IFL 2018 format and CFP language that describes conditionally accepted papers has been adapted from call-for-papers of OOPSLA conferences. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew@REDACTED Wed Apr 4 05:00:48 2018 From: andrew@REDACTED (Andrew McIntyre) Date: Wed, 4 Apr 2018 13:00:48 +1000 Subject: [erlang-questions] Job Opening in Australia Message-ID: <1168525464.20180404130048@Medical-Objects.com.au> Hello All, We are trying to build an erlang based team on the Sunshine Coast, Queensland Australia. Medical-Objects is a small establish eHealth company doing secure messaging and Clinical Decision Support and this is for an R&D project. At this stage we are not looking for remote developers but are planning professional training in erlang in the next few months, so extensive experience is not required, but a passion is. If you know any talented people interested in learning erlang and able to relocate to the Sunshine Coast (which is a pretty pleasant place) please alert them to this add. Thanks https://www.seek.com.au/job/35699742?_ga=2.130243853.365707872.1522798563-435003729.1511388802 -- Best regards, Andrew McIntyre mailto:andrew@REDACTED sent from a real computer R&D Director Medical-Objects 4/102 Wises Road MAROOCHYDORE Q 4558 AUSTRALIA www.medical-objects.com.au From fxn@REDACTED Wed Apr 4 14:32:52 2018 From: fxn@REDACTED (Xavier Noria) Date: Wed, 4 Apr 2018 14:32:52 +0200 Subject: [erlang-questions] docs on group leaders? Message-ID: I have read descriptions about what is a group leader and understand the concept, but don't know which role plays exactly in the grand schema of things. I have checked books and online resources but don't get pass their functional description. For example, what is the point of having each application master become the group leader of its application? When do you change group leaders in an Erlang/Elixir application? Any pointers appreciated! -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Wed Apr 4 22:02:41 2018 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Wed, 4 Apr 2018 23:02:41 +0300 Subject: [erlang-questions] [ANN] datum 4.3.2 release Message-ID: <3C79492F-49A1-4568-A96C-F9269A73F065@gmail.com> Hello Community, datum is a pure functional and generic programming for Erlang. It implementing a various higher rank functional abstractions and patterns. It also testing the limits of functional abstractions in Erlang. Recently, 4.3.2 has been released, it includes various improvements and bug fixes. Please find * Release notes: https://github.com/fogfish/datum/blob/master/CHANGELOG.md * Source code: https://github.com/fogfish/datum * Features overview: https://github.com/fogfish/datum/blob/master/doc/features.md * Hex: https://hex.pm/packages/datum I?ll be glad to address your questions at gitter community, slack or email. Best Regards, Dmitry -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Wed Apr 4 23:48:11 2018 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 4 Apr 2018 17:48:11 -0400 Subject: [erlang-questions] docs on group leaders? In-Reply-To: References: Message-ID: <20180404214809.GF30808@ferdmbp.local> On 04/04, Xavier Noria wrote: >I have read descriptions about what is a group leader and understand the >concept, but don't know which role plays exactly in the grand schema of >things. > >I have checked books and online resources but don't get pass their >functional description. For example, what is the point of having each >application master become the group leader of its application? When do you >change group leaders in an Erlang/Elixir application? > >Any pointers appreciated! Group leaders let you redirect I/O to the right endpoint. It is one of the few properties that is inherited by one process to the other, creating a chain. By default, an Erlang node has one group leader called 'user'. This process owns communication with the stdio channels, and all input requests and output messages transit through that one. Then, each shell you start becomes its own group leader. This means that any function you run from the shell will send all its IO data to that shell process. When you enter the job mode with ^G and pick a shell (c ), what this does is let a special shell-handling process (usr_drv if memory serves) to pick which input and output to show. If you have 50 shells from 50 different users, each one has to send their traffic to the right endpoint. As such, a slave node, or a shell from a remote node will set its group leader to a foreign pid and automatically get all its descendent processes' IO data rerouted to the right place automatically. So that handles it for the very interactive side of things. Each OTP application also has its own process--the application master--becoming a group leader. By default this has no apparent use, except for two things. The first one is allowing each process to know which app it belongs to, cheating with `application:get_env(Var)', as a shorter form than `application:get_env(App, Var)`. If the process is started within the app, it has access to the config; if not, it doesn't have it. This is the only reason documented in a code comment for the usage of group leaders. The second usage is for when the application stops. This starts from the otp-level, shutting down the supervision tree as normal. Then there's one final step. Once the whole tree is shut down, the application master calles 'processes()' to get all the pids on the node, and then scans their group leaders to find out which pids belong to this specific application, and then it kills them. This is a final "garbage collecting" step for application processes. Both usages are hijacking (or so it seems) the inheritance of group leaders to track unsupervised children that are running wild out there, and grouping them within the application family. I don't know or remember if there's any use for them there aside from that. It would be easy to imagine redirecting the output of some applications to remote nodes specifically, on a per-app basis, but currently the structure of things does not allow that as far as I can tell. Regards, Fred. From fxn@REDACTED Thu Apr 5 00:26:41 2018 From: fxn@REDACTED (Xavier Noria) Date: Thu, 5 Apr 2018 00:26:41 +0200 Subject: [erlang-questions] docs on group leaders? In-Reply-To: <20180404214809.GF30808@ferdmbp.local> References: <20180404214809.GF30808@ferdmbp.local> Message-ID: Awesome Fred!!! I was precisely right now thinking about that grouping usage, since application_controller.erl has code like ets:match(ac_tab, {{application_master, '$1'}, Master}) used by application.erl as in application_controller:get_pid_all_env(group_leader()) which is like grepping based on the group leader. I think I read about this trick somewhere, but has checked several of the resources I normally consult and have failed to find it. Perhaps it was that code comment you mentioned. The strange thing for someone like me studying this is that this use case seems unrelated to I/O, it is like hijacking the idea of group leader for something entirely different, so your confirmation helps. Indeed, application masters seem to be just delegating to their previous group leader since it seems all I/O messages get forwarded up as in receive IoReq when element(1, IoReq) =:= io_request -> State#state.gleader ! IoReq, ... Also, if some subtree of the application changed the group leader, that grouping trick wouldn't work. Since the trick is in place in such a core module, I guess the conclusion is that you are generally not supposed to do that unless you know very well what you are doing. Jos? Valim also explained to me the use case of shells a while back. Thanks a lot Fred!!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From fxn@REDACTED Thu Apr 5 00:47:09 2018 From: fxn@REDACTED (Xavier Noria) Date: Thu, 5 Apr 2018 00:47:09 +0200 Subject: [erlang-questions] docs on group leaders? In-Reply-To: References: <20180404214809.GF30808@ferdmbp.local> Message-ID: There it is, in application_master.erl kill_children(Children) -> lists:foreach(fun(Pid) -> exit(Pid, kill) end, Children), kill_all_procs(). kill_all_procs() -> kill_all_procs_1(processes(), self(), 0). kill_all_procs_1([Self|Ps], Self, N) -> kill_all_procs_1(Ps, Self, N); kill_all_procs_1([P|Ps], Self, N) -> case process_info(P, group_leader) of {group_leader,Self} -> exit(P, kill), kill_all_procs_1(Ps, Self, N+1); _ -> kill_all_procs_1(Ps, Self, N) end; kill_all_procs_1([], _, 0) -> ok; kill_all_procs_1([], _, _) -> kill_all_procs(). I read this file from top to bottom in the last months to do some groundwork, perhaps it was there that I saw the grouping trick instead of reading it in prose. -------------- next part -------------- An HTML attachment was scrubbed... URL: From entermosjava@REDACTED Thu Apr 5 14:06:15 2018 From: entermosjava@REDACTED (En Termos Java) Date: Thu, 5 Apr 2018 14:06:15 +0200 Subject: [erlang-questions] Description of initial shell prompt Message-ID: Hi List ! Where can I find a description of whats what in the first line printed when the Erlang shell is started ? I.e: "Erlang/OTP 20 [erts-9.3] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10]" Regards BAE Per PS. I have had a look in the documentation and the web in general. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cean.ebengt@REDACTED Thu Apr 5 15:23:45 2018 From: cean.ebengt@REDACTED (bengt) Date: Thu, 5 Apr 2018 15:23:45 +0200 Subject: [erlang-questions] Description of initial shell prompt In-Reply-To: References: Message-ID: Greetings Most seem ??obvious?? except for ds. The others are: Erlang/OTP 20: Version number erts-9.3: Version number smp:4:4: As described on http://erlang.org/doc/man/erl.html, +S Schedulers:SchedulerOnline async-threads:10: As described on http://erlang.org/doc/man/erl.html, +A size bengt > > On 5 Apr 2018, at 14:06, En Termos Java wrote: > > > Hi List ! > > Where can I find a description of whats what in the first line printed > when the Erlang shell is started ? > > I.e: > "Erlang/OTP 20 [erts-9.3] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10]" > > > Regards BAE Per > > PS. I have had a look in the documentation and the web in general. > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From vinoski@REDACTED Thu Apr 5 15:43:33 2018 From: vinoski@REDACTED (Steve Vinoski) Date: Thu, 5 Apr 2018 09:43:33 -0400 Subject: [erlang-questions] Description of initial shell prompt In-Reply-To: References: Message-ID: ds:DirtyCPUSchedulers:DirtyCPUSchedulersOnline:DirtyIOSchedulers --steve On Thu, Apr 5, 2018 at 9:23 AM, bengt wrote: > Greetings > > Most seem ??obvious?? except for ds. The others are: > Erlang/OTP 20: Version number > erts-9.3: Version number > smp:4:4: As described on http://erlang.org/doc/man/erl.html, +S > Schedulers:SchedulerOnline > async-threads:10: As described on http://erlang.org/doc/man/erl.html, +A > size > > > bengt > > > > > > On 5 Apr 2018, at 14:06, En Termos Java wrote: > > > > > > Hi List ! > > > > Where can I find a description of whats what in the first line printed > > when the Erlang shell is started ? > > > > I.e: > > "Erlang/OTP 20 [erts-9.3] [64-bit] [smp:4:4] [ds:4:4:10] > [async-threads:10]" > > > > > > Regards BAE Per > > > > PS. I have had a look in the documentation and the web in general. > > > > > > > > > > > > _______________________________________________ > > 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 bob@REDACTED Thu Apr 5 17:29:52 2018 From: bob@REDACTED (Robert Wilkinson) Date: Thu, 5 Apr 2018 17:29:52 +0200 Subject: [erlang-questions] Description of initial shell prompt In-Reply-To: References: Message-ID: <20180405152952.GB10622@fourtheye.org> On Thu, Apr 05, 2018 at 09:43:33AM -0400, Steve Vinoski wrote: > ds:DirtyCPUSchedulers:DirtyCPUSchedulersOnline:DirtyIOSchedulers If there were DirtyRottenSchedulers, they would make a film about it? Sorry :-) > --steve Bob -- The difference between a good haircut and a bad one is seven days. From hans.r.nilsson@REDACTED Fri Apr 6 14:14:55 2018 From: hans.r.nilsson@REDACTED (Hans Nilsson R) Date: Fri, 6 Apr 2018 14:14:55 +0200 Subject: [erlang-questions] Patch package OTP 19.3.6.8 released Message-ID: Patch Package: OTP 19.3.6.8 Git Tag: OTP-19.3.6.8 Date: 2018-04-06 Trouble Report Id: OTP-15004 Seq num: System: OTP Release: 19 Application: ssh-4.4.2.3 Predecessor: OTP 19.3.6.7 Check out the git tag OTP-19.3.6.8, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- ssh-4.4.2.3 ----------------------------------------------------- --------------------------------------------------------------------- Note! The ssh-4.4.2.3 application can *not* be applied independently of other applications on an arbitrary OTP 19 installation. On a full OTP 19 installation, also the following runtime dependencies have to be satisfied: -- crypto-3.7.3 (first satisfied in OTP 19.3) -- public_key-1.4 (first satisfied in OTP 19.3) -- stdlib-3.3 (first satisfied in OTP 19.3) --- Fixed Bugs and Malfunctions --- OTP-15004 Application(s): ssh An ssh_sftp server (running version 6) could fail if it is told to remove a file which in fact is a directory. Full runtime dependencies of ssh-4.4.2.3: crypto-3.7.3, erts-6.0, kernel-3.0, public_key-1.4, stdlib-3.3 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4101 bytes Desc: S/MIME Cryptographic Signature URL: From gattushivakrishna@REDACTED Fri Apr 6 14:47:08 2018 From: gattushivakrishna@REDACTED (shiva) Date: Fri, 6 Apr 2018 18:17:08 +0530 Subject: [erlang-questions] Issue in searching element in mnesia table Message-ID: Hi all, ??? I have requirement of storing list of tuple of elements in record fields of a table in mnesia. This is the record defined for the table, ??? record( test_info, { test_id:: integer(), username::atom(), test_details::list(), dut_card_details::list(), ats_card_details::list(), test_result::list()}). example: ?? This is the 'test_info' table with data, ??? {test_info,3,kavi123, ?????????? ["#102","09:45","11:55",pass], ?????????? [ommp82_plus,12775,'1_4_3','0.1','0.0.1',123458889], ?????????? [ats_card,12790,'1_7_5','1.1','0.1.1',123775777], ?????????? [{port1,{sfp,185,wqc,*wxt193*,1905,80,no,pass,pass,pass,pass,pass, ??????????????????????? pass,pass,pass,pass}}, {port2,{sfp,174,was,zte142,1960,80,no,pass,pass,pass,pass,pass, ??????????????????????? pass,pass,pass,pass}}, {port3,{sfp,189,wsc,svz77,2306,80,no,pass,pass,pass,pass,pass, ??????????????????????? pass,pass,pass,pass}}, {port4,{xfp,134,was,xtg142,2560,80,no,fail,pass,pass,pass,fail, ??????????????????????? pass,pass,pass,pass}}]} i have an issue, how to search a record, which contains specific element from the list of tuple from mnesia table? example: ??? i need list of all the records containing 'wxt193' element in it. Can you please suggest if any solution to resolve my issue, Regards, Gattu ShivaKrishna -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikpelinux@REDACTED Fri Apr 6 19:43:47 2018 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Fri, 6 Apr 2018 19:43:47 +0200 Subject: [erlang-questions] Issue in searching element in mnesia table In-Reply-To: References: Message-ID: You want an index, but not mnesia's but a special-purpose one maintained by yourself. In this case, a mapping from these elements (wxt193 etc) to the test_id:s of the test_info records containing said elements. Whenever you add, delete, or update a test_info record you'll also have to perform the appropriate adjustments to your index table. But you should probably take a closer look at your requirements and try to find another data model that better suits these operations (finding a record from such an element), if they're frequent. On Fri, Apr 6, 2018 at 2:47 PM, shiva wrote: > Hi all, > > I have requirement of storing list of tuple of elements in record fields > of a table in mnesia. > > This is the record defined for the table, > > record( test_info, { test_id:: integer(), username::atom(), > test_details::list(), dut_card_details::list(), ats_card_details::list(), > test_result::list()}). > > example: > > This is the 'test_info' table with data, > > {test_info,3,kavi123, > ["#102","09:45","11:55",pass], > [ommp82_plus,12775,'1_4_3','0.1','0.0.1',123458889], > [ats_card,12790,'1_7_5','1.1','0.1.1',123775777], > [{port1,{sfp,185,wqc,wxt193,1905,80,no,pass,pass,pass,pass,pass, > pass,pass,pass,pass}}, > {port2,{sfp,174,was,zte142,1960,80,no,pass,pass,pass,pass,pass, > pass,pass,pass,pass}}, > {port3,{sfp,189,wsc,svz77,2306,80,no,pass,pass,pass,pass,pass, > pass,pass,pass,pass}}, > {port4,{xfp,134,was,xtg142,2560,80,no,fail,pass,pass,pass,fail, > pass,pass,pass,pass}}]} > > i have an issue, how to search a record, which contains specific element > from the list of tuple from mnesia table? > > example: > > i need list of all the records containing 'wxt193' element in it. > > Can you please suggest if any solution to resolve my issue, > > > Regards, > > Gattu ShivaKrishna > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From rohinton.kazak@REDACTED Sun Apr 8 00:40:13 2018 From: rohinton.kazak@REDACTED (Rohinton Kazak (rkazak)) Date: Sat, 7 Apr 2018 15:40:13 -0700 Subject: [erlang-questions] Valid Erlang module? Message-ID: Hi, Just curious to know if this is a valid Erlang module. ?8< > cat mirror.erl -module(mirror). -export([mirror/1]). mirror(Anything) -> Anything. As when I try and compile it I get 1> c(mirror). mirror.erl: internal error in lint_module; crash reason: undef in function sets:to_list/1 called as sets:to_list([]) in call from erl_lint:check_unused_records/2 (erl_lint.erl, line 1211) in call from erl_lint:post_traversal_check/2 (erl_lint.erl, line 901) in call from erl_lint:module/3 (erl_lint.erl, line 534) in call from compile:lint_module/2 (compile.erl, line 1111) in call from compile:'-internal_comp/5-anonymous-1-'/3 (compile.erl, line 342) in call from compile:fold_comp/4 (compile.erl, line 369) in call from compile:internal_comp/5 (compile.erl, line 353) error Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: From hugo@REDACTED Sun Apr 8 01:21:00 2018 From: hugo@REDACTED (Hugo Mills) Date: Sat, 7 Apr 2018 23:21:00 +0000 Subject: [erlang-questions] Valid Erlang module? In-Reply-To: References: Message-ID: <20180407232100.GL17966@carfax.org.uk> On Sat, Apr 07, 2018 at 03:40:13PM -0700, Rohinton Kazak (rkazak) wrote: > Hi, > > Just curious to know if this is a valid Erlang module. > > ?8< > > cat mirror.erl > -module(mirror). > > -export([mirror/1]). > > mirror(Anything) -> Anything. Compiles and runs OK for me on (I think) Erlang 19.2.1. What version of erlang and what platform are you using? Also, are you sure that (a) you're actually compiling the file you think you are, and (b) there's no spurious control characters, invisible text, or unexpected unicode in the source file? For (a), try introducing a known error into the source (like "Foo@" after the "-module()." directive) and see if the compiler picks up on that. If it doesn't, you're not compiling the file you thought you were. I'm not really expecting (b) to be an issue, but it's worth mentioning. (I've seen people with compile failures in other languages due to copy-pasting curly quotes from someone else's over-formatted website before...) Hugo. > As when I try and compile it I get > > 1> c(mirror). > mirror.erl: internal error in lint_module; > crash reason: undef > > in function sets:to_list/1 > called as sets:to_list([]) > in call from erl_lint:check_unused_records/2 (erl_lint.erl, line 1211) > in call from erl_lint:post_traversal_check/2 (erl_lint.erl, line 901) > in call from erl_lint:module/3 (erl_lint.erl, line 534) > in call from compile:lint_module/2 (compile.erl, line 1111) > in call from compile:'-internal_comp/5-anonymous-1-'/3 (compile.erl, line 342) > in call from compile:fold_comp/4 (compile.erl, line 369) > in call from compile:internal_comp/5 (compile.erl, line 353) > error > > Thanks in advance! > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Hugo Mills | We believe in free will because we have no choice. hugo@REDACTED carfax.org.uk | http://carfax.org.uk/ | PGP: E2AB1DE4 | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: From gordon@REDACTED Sun Apr 8 01:30:06 2018 From: gordon@REDACTED (Gordon Guthrie) Date: Sat, 07 Apr 2018 23:30:06 +0000 Subject: [erlang-questions] Valid Erlang module? In-Reply-To: <20180407232100.GL17966@carfax.org.uk> References: <20180407232100.GL17966@carfax.org.uk> Message-ID: I cut'n'paste a curly quote into the shell just yesterday :-) On Sun, 8 Apr 2018, 00:21 Hugo Mills, wrote: > On Sat, Apr 07, 2018 at 03:40:13PM -0700, Rohinton Kazak (rkazak) wrote: > > Hi, > > > > Just curious to know if this is a valid Erlang module. > > > > ?8< > > > cat mirror.erl > > -module(mirror). > > > > -export([mirror/1]). > > > > mirror(Anything) -> Anything. > > Compiles and runs OK for me on (I think) Erlang 19.2.1. What > version of erlang and what platform are you using? > > Also, are you sure that (a) you're actually compiling the file you > think you are, and (b) there's no spurious control characters, > invisible text, or unexpected unicode in the source file? > > For (a), try introducing a known error into the source (like "Foo@" > after the "-module()." directive) and see if the compiler picks up on > that. If it doesn't, you're not compiling the file you thought you > were. > > I'm not really expecting (b) to be an issue, but it's worth > mentioning. (I've seen people with compile failures in other languages > due to copy-pasting curly quotes from someone else's over-formatted > website before...) > > Hugo. > > > As when I try and compile it I get > > > > 1> c(mirror). > > mirror.erl: internal error in lint_module; > > crash reason: undef > > > > in function sets:to_list/1 > > called as sets:to_list([]) > > in call from erl_lint:check_unused_records/2 (erl_lint.erl, line 1211) > > in call from erl_lint:post_traversal_check/2 (erl_lint.erl, line 901) > > in call from erl_lint:module/3 (erl_lint.erl, line 534) > > in call from compile:lint_module/2 (compile.erl, line 1111) > > in call from compile:'-internal_comp/5-anonymous-1-'/3 (compile.erl, > line 342) > > in call from compile:fold_comp/4 (compile.erl, line 369) > > in call from compile:internal_comp/5 (compile.erl, line 353) > > error > > > > Thanks in advance! > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > -- > Hugo Mills | We believe in free will because we have no choice. > hugo@REDACTED carfax.org.uk | > http://carfax.org.uk/ | > PGP: E2AB1DE4 | > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenji@REDACTED Sun Apr 8 08:45:11 2018 From: kenji@REDACTED (Kenji Rikitake) Date: Sun, 8 Apr 2018 15:45:11 +0900 Subject: [erlang-questions] [ANN] tinymt-erlang is no longer maintained Message-ID: The following TinyMT random number generator software repositories for Erlang/Elixir are no longer maintained and put into archive mode immediately (as of 0640UTC 8-APR-2018): https://github.com/jj1bdx/tinymt-erlang https://github.com/jj1bdx/tinymtdc-longbatch The last official version of hex.pm tinymt package is: https://hex.pm/packages/tinymt/0.3.2 I suggest that you should update your software to use the rand module of OTP 18 or later ASAP for using a better and a faster algorithm. I appreciate your support during the development of the software, and at ACM SIGPLAN Erlang Workshop 2012 when I made the presentation of the TinyMT implementation. Regards, Kenji Rikitake -------------- next part -------------- An HTML attachment was scrubbed... URL: From ppe+erlang@REDACTED Sun Apr 8 16:38:03 2018 From: ppe+erlang@REDACTED (Petri Pellinen) Date: Sun, 8 Apr 2018 17:38:03 +0300 Subject: [erlang-questions] Framework / library for at-least-once execution? Message-ID: Hello everybody, I'm a new subscriber to the list and new to the Erlang world. I have read a couple of books on Erlang and OTP and, as a long-time Java programmer, am very excited by all the concurrency and high availability features that come out of the box. Tried searching the archives for answers but am not sure if I came up with the correct search terms and ended up empty-handed. I'm curious if there is an existing library or framework that would let me submit a "job" and the framework makes sure that the job is run *at least once* to completion in an OTP cluster even if the machine running the submitted job dies during execution. If a machine/node dies during execution of the job then another node should restart the job as soon as possible. So, from a client perspective, if I get an acknowledgment that a job was successfully received then I can rest assured that the job runs to completion. If any of you are familiar with Spring Batch in the Java world then this is something similar but not really ETL orientated or for heavy batches - when I say "job" here I really mean any piece of code, even a very lightweight function. I'm trying to come up with an extremely reliable backend solution for delivering and processing messages between parties. Any information or pointers to relevant existing solutions would be greatly appreciated. Thanks in advance for any help you may be able to provide! Kind regards, Petri -------------- next part -------------- An HTML attachment was scrubbed... URL: From heather.miller@REDACTED Sun Apr 8 23:34:39 2018 From: heather.miller@REDACTED (Heather Miller) Date: Sun, 8 Apr 2018 17:34:39 -0400 Subject: [erlang-questions] TFPIE 2018: First Call for Papers Message-ID: ====================================================================== TFPIE 2018: First Call for Papers ====================================================================== Trends in Functional Programming in Education Gothenburg, Sweden, 14 June 2018 http://www.ccs.neu.edu/home/heather/tfpie2018/ (co-located with TFP 2018) http://www.cse.chalmers.se/~myreen/tfp2018/ ====================================================================== The goal of TFPIE is to gather researchers, teachers and professionals that use, or are interested in the use of, functional programming in education. TFPIE aims to be a venue where novel ideas, classroom-tested ideas and work-in-progress on the use of functional programming in education are discussed. The one-day workshop will foster a spirit of open discussion by having a review process for publication after the workshop. The program chair of TFPIE 2018 will screen submissions to ensure that all presentations are within scope and are of interest to participants. After the workshop, presenters will be invited to submit revised versions of their articles for publication in the journal Electronic Proceedings in Theoretical Computer Science (EPTCS). Scope ===== TFPIE 2018 welcomes submissions describing techniques used in the classroom, tools used in and/or developed for the classroom and any creative use of functional programming (FP) to aid education in or outside Computer Science. Topics of interest include, but are not limited to: - FP and beginning CS students - FP and Computational Thinking - FP and Artificial Intelligence - FP in Robotics - FP and Music - Advanced FP for undergraduates - FP in graduate education - Engaging students in research using FP - FP in Programming Languages - FP in the high school curriculum - FP as a stepping stone to other CS topics - FP and Philosophy - The pedagogy of teaching FP - FP and e-learning: MOOCs, automated assessment etc. - Best Lectures ? more details below In addition to papers, we are requesting best lecture presentations. What?s your best lecture topic in an FP related course? Do you have a fun way to present FP concepts to novices or perhaps an especially interesting presentation of a difficult topic? In either case, please consider sharing it. Best lecture topics will be selected for presentation based on a short abstract describing the lecture and its interest to TFPIE attendees. Submissions =========== Potential presenters are invited to submit an extended abstract (4-6 pages) or a draft paper (up to 16 pages) in EPTCS style. The authors of accepted presentations will have their preprints and their slides made available on the workshop's website. Papers and abstracts can be submitted via EasyChair at the link below. After the workshop, presenters will be invited to submit (a revised version of) their article for review. The PC will select the best articles for publication in the journal Electronic Proceedings in Theoretical Computer Science (EPTCS). Articles rejected for presentation and extended abstracts will not be formally reviewed by the PC. Submission page: https://easychair.org/conferences/?conf=tfpie2018 Important dates =============== - Submission deadline: May 15th, Anywhere on Earth. - Notification: May 21st - Workshop: June 14th - Submission for formal review: August 17th - Notification of full article: October 5th - Camera ready: November 2nd -- Heather Miller EPFL, Scala Center Executive Director, Research Scientist http://people.epfl.ch/heather.miller +41 21 693 64 83 +41 78 625 20 23 From fxn@REDACTED Mon Apr 9 14:25:57 2018 From: fxn@REDACTED (Xavier Noria) Date: Mon, 9 Apr 2018 14:25:57 +0200 Subject: [erlang-questions] late on_loads on init Message-ID: I have observed that on_load handlers happen late in the init process. I would have expected that an on_load handler ran when the module is loaded into the VM as primLoads are processed . But, it turns out they do not run at that point. Before on load handlers run, all applications are loaded, and kernel started. Only later does the hook get executed, and boot continues starting the rest of applications. In a production Distilley release for example (embedded mode, in particular), this is easy to see passing ERL_OPTS=-init_debug to a command. You'll see {`running_on_load_handler`, Module} printed when the hook is invoked. Two questions here: 1) Is this done because starting kernel is needed to have a minimum of things setup in order to run code, do I/O etc. in the on_load handler? If yes, is application:load/1 carefully written to not depend on such setup? (since it runs before kernel starts). 2) On the other hand, if you load a module on demand in interactive mode, the hook is executed right away. That says primLoad has to load modules in a different way somehow. Do you know which is the difference? -------------- next part -------------- An HTML attachment was scrubbed... URL: From samwar@REDACTED Tue Apr 10 22:14:38 2018 From: samwar@REDACTED (Samuel Warters) Date: Tue, 10 Apr 2018 15:14:38 -0500 Subject: [erlang-questions] SNMPv3 AES Auth Fix Message-ID: The project I work on does extensive SNMPv2c reads from network devices, as part of a PCI requirement, we need to migrate to using SNMPv3. While researching the upgrade path, I stumbled upon this mailing list post: http://erlang.org/pipermail/erlang-questions/2017-June/092546.html, which basically states AES auth is broken. Having AES encryption/authentication is a must as many network devices use it. I was wondering has the AES auth fix ever gone out in an official OTP release? Looking at the main OTP source, It doesn't look like it, but I wanted to confirm. Thanks. --- Sam -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.goertzen@REDACTED Wed Apr 11 16:50:37 2018 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Wed, 11 Apr 2018 14:50:37 +0000 Subject: [erlang-questions] SNMPv3 AES Auth Fix In-Reply-To: References: Message-ID: Github says the last work done in that part of the code was 2013, so no. SNMPv3 agent does work (I use it), but it looks like the manager is still picking the wrong engineid/boots. https://github.com/erlang/otp/commits/master/lib/snmp/src/manager/snmpm_usm.erl On Tue, 10 Apr 2018 at 15:25 Samuel Warters wrote: > The project I work on does extensive SNMPv2c reads from network devices, > as part of a PCI requirement, we need to migrate to using SNMPv3. While > researching the upgrade path, I stumbled upon this mailing list post: > http://erlang.org/pipermail/erlang-questions/2017-June/092546.html, which > basically states AES auth is broken. > > Having AES encryption/authentication is a must as many network devices use > it. I was wondering has the AES auth fix ever gone out in an official OTP > release? Looking at the main OTP source, It doesn't look like it, but I > wanted to confirm. > > Thanks. > --- > Sam > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.whealy@REDACTED Wed Apr 11 16:44:29 2018 From: chris.whealy@REDACTED (Whealy, Chris) Date: Wed, 11 Apr 2018 14:44:29 +0000 Subject: [erlang-questions] Network connections fail when starting rebar app using "console" parameter Message-ID: Hi All I have a Cowboy app that at startup time, downloads various files from another web server. I?m using rebar to create a release, and this all works fine when I start the app using the ?start? parameter $ _build/default/rel/geo_server/bin/geo_server start But all the downloads fail when I use the ?console? parameter $ _build/default/rel/geo_server/bin/geo_server console No other network conditions have changed, but now all the HTTP connections fail with {conn_failed,{error,ehostdown}} which clearly is not the case... Are extra parameters needed when starting the app using ?console?? Thanks Chris Whealy SAP Cloud Platform | Strategy & Product Management | Team SAP UK Ltd, Clockhouse Place, Bedfont Rd, Feltham, Middx, TW14 8HA, England M +44 (0)7808 575377 Find out more on the Strategy & Product Management Wiki page (SAP internal) Follow our latest activities in SAP CP User Community Jam Group Please consider the impact on the environment before printing this e-mail. Twitter: @LogaRhythm "The voice of ignorance speaks loud and long, but the words of the wise are quiet and few" Ancient Proverb -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Wed Apr 11 18:07:34 2018 From: roger@REDACTED (Roger Lipscombe) Date: Wed, 11 Apr 2018 17:07:34 +0100 Subject: [erlang-questions] Network connections fail when starting rebar app using "console" parameter In-Reply-To: References: Message-ID: On 11 April 2018 at 15:44, Whealy, Chris wrote: > Hi All > > I have a Cowboy app that at startup time, downloads various files from > another web server. I?m using rebar to create a release, and this all > works fine when I start the app using the ?start? parameter > > $ _build/default/rel/geo_server/bin/geo_server start > > But all the downloads fail when I use the ?console? parameter > > $ _build/default/rel/geo_server/bin/geo_server console > > No other network conditions have changed, but now all the HTTP connections > fail with {conn_failed,{error,ehostdown}} which clearly is not the case... > > Are extra parameters needed when starting the app using ?console?? > Not usually. What are you using to download the files from the other web server? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.whealy@REDACTED Wed Apr 11 18:29:08 2018 From: chris.whealy@REDACTED (Whealy, Chris) Date: Wed, 11 Apr 2018 16:29:08 +0000 Subject: [erlang-questions] Network connections fail when starting rebar app using "console" parameter In-Reply-To: References: Message-ID: <2075DDE5-CE90-436E-94CF-63FC8F013A23@sap.com> Hi Roger My Cowboy app has a dependency on iBrowse - which has been working fine up until trying to start the app using ?console?. ibrowse:start(), ibrowse:set_dest("download.geonames.org", 80, [{max_sessions, 10}, {max_pipeline_size, 25}]), Then I spawn another process to fetch some files from genomes.org and wait for the results. The spawned process is just a wrapper around ibrowse:send_req(Url, [{"If-None-Match", Etag}], get) that fires off an HTTP GET request to Url for a given Etag. This all works fine when using the ?start" parameter, but fails when using ?console?? Regards Chris Whealy SAP Cloud Platform | Strategy & Product Management | Team SAP UK Ltd, Clockhouse Place, Bedfont Rd, Feltham, Middx, TW14 8HA, England M +44 (0)7808 575377 Find out more on the Strategy & Product Management Wiki page (SAP internal) Follow our latest activities in SAP CP User Community Jam Group Please consider the impact on the environment before printing this e-mail. Twitter: @LogaRhythm "The voice of ignorance speaks loud and long, but the words of the wise are quiet and few" Ancient Proverb On 11 Apr 2018, at 17:07, Roger Lipscombe > wrote: On 11 April 2018 at 15:44, Whealy, Chris > wrote: Hi All I have a Cowboy app that at startup time, downloads various files from another web server. I?m using rebar to create a release, and this all works fine when I start the app using the ?start? parameter $ _build/default/rel/geo_server/bin/geo_server start But all the downloads fail when I use the ?console? parameter $ _build/default/rel/geo_server/bin/geo_server console No other network conditions have changed, but now all the HTTP connections fail with {conn_failed,{error,ehostdown}} which clearly is not the case... Are extra parameters needed when starting the app using ?console?? Not usually. What are you using to download the files from the other web server? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan4984@REDACTED Wed Apr 11 19:58:38 2018 From: jan4984@REDACTED (YD Jiang) Date: Wed, 11 Apr 2018 17:58:38 +0000 Subject: [erlang-questions] Network connections fail when starting rebar app using "console" parameter In-Reply-To: <2075DDE5-CE90-436E-94CF-63FC8F013A23@sap.com> References: <2075DDE5-CE90-436E-94CF-63FC8F013A23@sap.com> Message-ID: Maybe have a network capture to determine why the ehostdown happen. especially you can compare the worked capture with the failed one. On Thu, Apr 12, 2018 at 12:29 AM Whealy, Chris wrote: > Hi Roger > > My Cowboy app has a dependency on iBrowse - which has been working fine up > until trying to start the app using ?console?. > > ibrowse:start(), > ibrowse:set_dest("download.geonames.org", 80, [{max_sessions, 10}, > {max_pipeline_size, 25}]), > > Then I spawn another process to fetch some files from genomes.org and > wait for the results. The spawned process is just a wrapper around ibrowse:send_req(Url, > [{"If-None-Match", Etag}], get) that fires off an HTTP GET request to Url > for a given Etag. > > This all works fine when using the ?start" parameter, but fails when using > ?console?? > > Regards > > *Chris Whealy* > > SAP Cloud Platform | Strategy & Product Management | Team > *SAP UK Ltd,* Clockhouse Place, Bedfont Rd, Feltham, Middx, TW14 8HA, > England > > M +44 (0)7808 575377 <+44%207808%20575377> > > Find out more on the Strategy & Product Management *Wiki page* > (SAP > internal) > Follow our latest activities in SAP CP User Community *Jam Group > * > > Please consider the impact on the environment before printing this e-mail. > Twitter: @LogaRhythm > *"The voice of ignorance speaks loud and long,* > * but the words of the wise are quiet and few"* > * Ancient Proverb* > > > > > > On 11 Apr 2018, at 17:07, Roger Lipscombe wrote: > > On 11 April 2018 at 15:44, Whealy, Chris wrote: > >> Hi All >> >> I have a Cowboy app that at startup time, downloads various files from >> another web server. I?m using rebar to create a release, and this all >> works fine when I start the app using the ?start? parameter >> >> $ _build/default/rel/geo_server/bin/geo_server start >> >> But all the downloads fail when I use the ?console? parameter >> >> $ _build/default/rel/geo_server/bin/geo_server console >> >> No other network conditions have changed, but now all the HTTP >> connections fail with {conn_failed,{error,ehostdown}} which clearly is >> not the case... >> >> Are extra parameters needed when starting the app using ?console?? >> > > Not usually. What are you using to download the files from the other web > server? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Wed Apr 11 20:35:30 2018 From: mjtruog@REDACTED (Michael Truog) Date: Wed, 11 Apr 2018 11:35:30 -0700 Subject: [erlang-questions] Framework / library for at-least-once execution? In-Reply-To: References: Message-ID: On 04/08/2018 07:38 AM, Petri Pellinen wrote: > Hello everybody, > > I'm a new subscriber to the list and new to the Erlang world. I have read a couple of books on Erlang and OTP and, as a long-time Java programmer, am very excited by all the concurrency and high availability features that come out of the box. > > Tried searching the archives for answers but am not sure if I came up with the correct search terms and ended up empty-handed. > > I'm curious if there is an existing library or framework that would let me submit a "job" and the framework makes sure that the job is run *at least once* to completion in an OTP cluster even if the machine running the submitted job dies during execution. If a machine/node dies during execution of the job then another node should restart the job as soon as possible. > > So, from a client perspective, if I get an acknowledgment that a job was successfully received then I can rest assured that the job runs to completion. > > If any of you are familiar with Spring Batch in the Java world then this is something similar but not really ETL orientated or for heavy batches - when I say "job" here I really mean any piece of code, even a very lightweight function. I'm trying to come up with an extremely reliable backend solution for delivering and processing messages between parties. > > Any information or pointers to relevant existing solutions would be greatly appreciated. > > Thanks in advance for any help you may be able to provide! > > Kind regards, > Petri > For real-time at-least-once processing you have two basic high-level abstract choices: 1) Treat a job as a piece of data you put in queue data to process at least once, with distributed consensus to ensure it can be fault-tolerant 2) Treat a job as source code in a service that receives task messages, so the concept of a job is abstract, allowing the algorithm and input/output of the job to change separately #2 is similar to #1 because the tasks are still queued to get handled by the service.? However, #2 is clearly different by allowing hot-code upgrades/downgrades without extra complexity (i.e., task messages are using a protocol that is clearly defined and you don't need to be concerned about data structures changing, since they are isolated in the source code as a separate entity). CloudI (https://cloudi.org) provides the #2 approach which is a natural way to approach the problem in Erlang, though you may be expecting to see the #1 approach.? If you were using CloudI to solve this problem, you could use the cloudi_service_quorum source code as a proxy to achieve consensus among different "job" services on separate machines that process the same task message concurrently, though something similar could be done with the CloudI API function mcast_async. Best Regards, Michael From seriy.pr@REDACTED Thu Apr 12 12:38:59 2018 From: seriy.pr@REDACTED (=?UTF-8?B?0KHQtdGA0LPQtdC5INCf0YDQvtGF0L7RgNC+0LI=?=) Date: Thu, 12 Apr 2018 12:38:59 +0200 Subject: [erlang-questions] [ANN] epgsql 4.0.0 - new magor release of PostgreSQL connector Message-ID: Hi, list, I'm glad to announce that we just tagged a next major release of epgsql - PostgreSQL driver / connector for Erlang. https://github.com/epgsql/epgsql/releases/tag/4.0.0 We tried to maintain backward-compatibility as much as possible, so, current users of basic epgsql features shouldn't notice any difference. If you use some advanced features, please consult "Incompatibilities" section and do some extra testing. Changes: * Make epgsql commands pluggable (see pluggable_commands.md). Now we are not limited only by API functions provided by epgsql (equery/squery/prepared_query etc), but may create own commands as a plugins. Still, understanding of PostgreSQL network protocol needed to be able to do so. * Make epgsql datatype encoding/decdoding pluggable (see pluggable_types.md). Now we are able to add or tweak codecs for existing as well as custom PostgreSQL datatypes (like datetime, varchar, enum, arrays etc). XXX: Highly recommend to add `{codecs, []}` option to your epgsql:connect/X calls if you don't use PostGIS and hstore datatypes: this will reduce connection setup time. * epgsql internals had a huge refactoring (4,000 additions and 1,750 deletions for ~5500 LOC project). Code now is much more modular, documented and have a lot of internal typespecs. Performance improvements are also expected. * Now we try to use iolists as much as possible and avoid binary and string concatenations when ever possible. Expect noticeable performance improvements for large BYTEA / TEXT / VARCHAR / JSON / JSONB etc fields. * Extended and documented epgsql:with_transaction/3. Now it's possible to preserve original exception's stacktrace, finally! * macaddr and macaddr8 datatypes support added * Float datatype support was extended with `nan`, `minus_infinity`, `plus_infinity` * elvis code style check was added to our travis pipeline * Brand-new PostgreSQL 10 scram-sha-256 auth method added (see https://www.postgresql.org/docs/10/static/auth-methods.html#AUTH-PASSWORD and https://www.postgresql.org/docs/current/static/sasl-authentication.html) * A lot of typespecs were rewritten and lots of internal typespecs were added Incompatibilities: * Some unexpected performance issues may appear, but we expect performance improvements, especially for a large result sets (when a lot of rows are returned by a query) and for large string/json/blob query parameters * Undocumented epgsql:update_type_cache/2 API was changed * A lot of typespecs were updated. Some typespecs were deprecated or moved from epgsql.erl to other modules. So, some new dialyzer warnings might pop-up * Some new error messages might be returned, especially from epgsql:connect/X functions * Memory consumption per-connection might slightly grow because we maintain per-connection OID<->codec mapping table, which might be quite big in some cases. This also may produce bigger error_logger reports in case of epgsql connection process crashes. * Some exported .hrl files have been changed. #column{} and #statement{} record definitions were extended. * PostGIS users might be affected by cleanup of ewkb.erl and epgsql_geometry.hrl * Streaming replication users should pay extra attention. No tests were broken, but a lot of modifications were made to this code. * Passing integer / atom / float as a value of a text / varchar / bytea query parameter is now deprecated (so, `epgsql:equery(C, "SELECT $1::text", [my_atom])` will still work but is not recommended) * Redshift and CockroachDB users might expirience some problems. Please, report bugs! And I want to say thanks for all who was involved in this work, special thanks goes to @davidw. Regards, epgsql dev deam -------------- next part -------------- An HTML attachment was scrubbed... URL: From torben.lehoff@REDACTED Thu Apr 12 14:45:48 2018 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Thu, 12 Apr 2018 12:45:48 +0000 Subject: [erlang-questions] Stopping a master process and all its workers Message-ID: Hi, I am a bit in doubt about what would be the cleanest way to stop a part of my supervision tree. The tree looks like this: top_sup ?? master ?? worker_sup ?? worker I have multiple instances of the top_sup supervisor, one for each master. So when I need to stop a master and all its workers I would have to stop its top_sup and everything below it. Controlled stopping needs to be different from a crash as a controlled stop should remove some persistent data for the master and workers. Should I just do an exit(top_sup, normal) for the controlled stop? Or should I implement a stop function all the way down? Are there any subtleties that I need to cater for? Have I given enough information for this question to make sense? Either will do the job. Just wondering what experience others have on this. Cheers, Torben -- https://www.linkedin.com/in/torbenhoffmann/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Thu Apr 12 17:20:15 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 12 Apr 2018 15:20:15 +0000 Subject: [erlang-questions] Stopping a master process and all its workers In-Reply-To: References: Message-ID: On Thu, Apr 12, 2018 at 4:47 PM Torben Hoffmann wrote: > Are there any subtleties that I need to cater for? Have I given enough > information for this question to make sense? > > Yes: * What is the API accessing this tree? If we start stopping the tree, how are those API calls going to behave while the tree is being closed down? * Many such trees needs some kind of "connection draining phase" where they finish their current work, but doesn't start up new work while they are being drained. * If you dynamically start/stop workers, then you might be able to set the number of workers to the special case of 0 and then stop the tree. * Surely, there is a supervisor on top of `top_sup` and it it the one who needs to terminate its child. Consider that some supervisor in your application has to be "permanent/persistent" over the lifetime of the application, so you always have a point to which you can "hang" your workers. This allows you to use supervisor:terminate_child/2, but do note its documentation about restarting: your child is likely to be temporary, which means you need to have some kind of management for this if restarts happen in the system. * Dynamic alteration of the state should be logged: "worker state was changed from 8 workers to 0", but it shouldn't report such an event as an ERROR in the syslog sense. This is INFO/NOTICE level. Final important comment: Do extensive tests of the failure scenario! Graceful recovery is nice, but if you don't test it somewhat, you are essentially sacrificing a goat on the altar of the god of your choice and you pray to said god that things end up being nice for you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan4984@REDACTED Thu Apr 12 17:04:32 2018 From: jan4984@REDACTED (YD Jiang) Date: Thu, 12 Apr 2018 15:04:32 +0000 Subject: [erlang-questions] Stopping a master process and all its workers In-Reply-To: References: Message-ID: yes just exit the top supervisor. any cleanup can be done in {:EXIT ...} message, or handle_info({:EXIT ...} if a gen_server. On Thu, Apr 12, 2018 at 10:47 PM Torben Hoffmann wrote: > Hi, > > I am a bit in doubt about what would be the cleanest way to stop a part of > my supervision tree. > > The tree looks like this: > top_sup > ?? master > ?? worker_sup > ?? worker > > I have multiple instances of the top_sup supervisor, one for each master. > So when I need to stop a master and all its workers I would have to stop > its top_sup and everything below it. > > Controlled stopping needs to be different from a crash as a controlled > stop should remove some persistent data for the master and workers. > > Should I just do an exit(top_sup, normal) for the controlled stop? > Or should I implement a stop function all the way down? > Are there any subtleties that I need to cater for? Have I given enough > information for this question to make sense? > > Either will do the job. Just wondering what experience others have on this. > > Cheers, > Torben > > -- > https://www.linkedin.com/in/torbenhoffmann/ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From torben.lehoff@REDACTED Thu Apr 12 22:38:03 2018 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Thu, 12 Apr 2018 20:38:03 +0000 Subject: [erlang-questions] Stopping a master process and all its workers In-Reply-To: References: Message-ID: I omitted a detail: all of the processes are proxies for external resources that they manage, ie, they simply have to start and stop them and respond to monitoring events from the resources. So no real work is actually being done in the processes. This simplifies things and I should have added that in the first place. I have a supervisor above the top_sup and that is indeed the one that will kill top_sup - I framed the question to get a focus on what happens from top_sup and down. Given that my "worker" monitor external resources they are all transient - if my program crashes the external resources may be around after I restart, so I am currently building persistence to handle this. All of this will be tested quite heavily. The correspondence to the external resources will be funny to deal with, eg, what if an external resource has died while my program was doing a reset? Fun times ahead. Cheers, Torben p.s. sorry about the top reply, but Gmail's Inbox has removed that feature or I'm too stupid to figure it out. On Thu, Apr 12, 2018 at 5:20 PM Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > On Thu, Apr 12, 2018 at 4:47 PM Torben Hoffmann > wrote: > >> Are there any subtleties that I need to cater for? Have I given enough >> information for this question to make sense? >> >> > Yes: > > * What is the API accessing this tree? If we start stopping the tree, how > are those API calls going to behave while the tree is being closed down? > > * Many such trees needs some kind of "connection draining phase" where > they finish their current work, but doesn't start up new work while they > are being drained. > > * If you dynamically start/stop workers, then you might be able to set the > number of workers to the special case of 0 and then stop the tree. > > * Surely, there is a supervisor on top of `top_sup` and it it the one who > needs to terminate its child. Consider that some supervisor in your > application has to be "permanent/persistent" over the lifetime of the > application, so you always have a point to which you can "hang" your > workers. This allows you to use supervisor:terminate_child/2, but do note > its documentation about restarting: your child is likely to be temporary, > which means you need to have some kind of management for this if restarts > happen in the system. > > * Dynamic alteration of the state should be logged: "worker state was > changed from 8 workers to 0", but it shouldn't report such an event as an > ERROR in the syslog sense. This is INFO/NOTICE level. > > Final important comment: > > Do extensive tests of the failure scenario! Graceful recovery is nice, but > if you don't test it somewhat, you are essentially sacrificing a goat on > the altar of the god of your choice and you pray to said god that things > end up being nice for you. > > > -- https://www.linkedin.com/in/torbenhoffmann/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.whealy@REDACTED Fri Apr 13 11:18:27 2018 From: chris.whealy@REDACTED (Whealy, Chris) Date: Fri, 13 Apr 2018 09:18:27 +0000 Subject: [erlang-questions] Network connections fail when starting rebar app using "console" parameter In-Reply-To: References: <2075DDE5-CE90-436E-94CF-63FC8F013A23@sap.com> Message-ID: <2D60CB43-3D6A-4F1D-B9EA-01C5F5A229C4@sap.com> Found the problem? For some reason I had a highly specific firewall rule that blocked outgoing network access by the BEAM, but only when run from within Terminal. Deleted that rule and everything works fine now Chris Whealy SAP Cloud Platform | Strategy & Product Management | Team SAP UK Ltd, Clockhouse Place, Bedfont Rd, Feltham, Middx, TW14 8HA, England M +44 (0)7808 575377 Find out more on the Strategy & Product Management Wiki page (SAP internal) Follow our latest activities in SAP CP User Community Jam Group Please consider the impact on the environment before printing this e-mail. Twitter: @LogaRhythm "The voice of ignorance speaks loud and long, but the words of the wise are quiet and few" Ancient Proverb On 11 Apr 2018, at 18:58, YD Jiang > wrote: Maybe have a network capture to determine why the ehostdown happen. especially you can compare the worked capture with the failed one. On Thu, Apr 12, 2018 at 12:29 AM Whealy, Chris > wrote: Hi Roger My Cowboy app has a dependency on iBrowse - which has been working fine up until trying to start the app using ?console?. ibrowse:start(), ibrowse:set_dest("download.geonames.org", 80, [{max_sessions, 10}, {max_pipeline_size, 25}]), Then I spawn another process to fetch some files from genomes.org and wait for the results. The spawned process is just a wrapper around ibrowse:send_req(Url, [{"If-None-Match", Etag}], get) that fires off an HTTP GET request to Url for a given Etag. This all works fine when using the ?start" parameter, but fails when using ?console?? Regards Chris Whealy SAP Cloud Platform | Strategy & Product Management | Team SAP UK Ltd, Clockhouse Place, Bedfont Rd, Feltham, Middx, TW14 8HA, England M +44 (0)7808 575377 Find out more on the Strategy & Product Management Wiki page (SAP internal) Follow our latest activities in SAP CP User Community Jam Group Please consider the impact on the environment before printing this e-mail. Twitter: @LogaRhythm "The voice of ignorance speaks loud and long, but the words of the wise are quiet and few" Ancient Proverb On 11 Apr 2018, at 17:07, Roger Lipscombe > wrote: On 11 April 2018 at 15:44, Whealy, Chris > wrote: Hi All I have a Cowboy app that at startup time, downloads various files from another web server. I?m using rebar to create a release, and this all works fine when I start the app using the ?start? parameter $ _build/default/rel/geo_server/bin/geo_server start But all the downloads fail when I use the ?console? parameter $ _build/default/rel/geo_server/bin/geo_server console No other network conditions have changed, but now all the HTTP connections fail with {conn_failed,{error,ehostdown}} which clearly is not the case... Are extra parameters needed when starting the app using ?console?? Not usually. What are you using to download the files from the other web server? _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From silas@REDACTED Fri Apr 13 17:18:58 2018 From: silas@REDACTED (Silas) Date: Fri, 13 Apr 2018 12:18:58 -0300 Subject: [erlang-questions] Checking if the keys of a list of tuples match a list Message-ID: <20180413151858.GA1520@auron> Sorry for the confusing subject. I couldn't find another way to explain this simple problem. Before just making the question, I'll ask you about the architecture of the system because it is probably the root of the doubt. I'm making a small bookmark tag system. The user adds some information about a URL (url, title, etc.) and its corresponding tags. I have two dets tables that use the records: -record(url, {url, title, date, description, refs, tags}). -record(tag, {tag, url}). The url record is stored in a "urls" table. You see that the url record has some information and also a list of tags these bookmark has. To speed up tags lookup I created the "tags" table that stores tag records. So I have something like this: #url{url="wikipedia.org", title="Wikipedia", ... , tags=["internet","documentation"]} #url{url="erlang.org", title="Erlang", ... , tags=["documentation","programming"]} #tag{tag="internet", url="wikipedia.org"} #tag{tag="documentation", url="wikipedia.org"} #tag{tag="documentation", url="erlang.org"} #tag{tag="programming", url="erlang.org"} (Note I also have tags information in #url record). It works pretty fine for one tag: I just have to lookup at the tags table, retrieve all urls related to that tag and make a lookup for each url at the "urls" table. The problem arises when I tried to implement more than one tag lookup with AND, so when searching for "documentation" and "programming" it would return "erlang.org" only. The solution I found works, but it doesn't look quite elegant for me: a. I first lookup one of the tags the user provided (in the example above, "documentation". b. I then retrieve all urls matching that that. c. I then filter out all urls that don't have ALL the remaining tags (in the example above, just "programming"). I do this by looking at the "tags" field of the "url" record. d. I print all the remaining urls records. Although it works, I see two problems/questions: 1. Retrieving all urls information and discarding then looks just waste of processing. I may fix this over a rather complex (and slow) algorithm over "tags" table or using a third table to speed this (maybe {url, tag}?). Any sugestions? 2. Now a question about Erlang data structures: To check if a list has all elements of another list (regardless of the order), I'm using this: % This function returns true if all elements in List2 are in List1, regardless % of the order. sublistmember(_, []) -> true; sublistmember(List1, List2) -> [Head|Tail] = List2, case lists:member(Head, List1) of true -> sublistmember(List1, Tail); false -> false end. Its complexity is O(len(List1)) * O(len(List2)) which is not actually a problem for small lists (I can limit the number of tags the user may provide) but I was wondering if there is a more effective way. I thought about using sets to simplify but list -> set -> list conversion may be even slower, right? Any suggestions on this? Thanks! -- Silas From alex@REDACTED Fri Apr 13 19:13:40 2018 From: alex@REDACTED (Alex Alvarez) Date: Fri, 13 Apr 2018 13:13:40 -0400 Subject: [erlang-questions] module reloading Message-ID: <20180413171340.C7409E0153@smtp.hushmail.com> Sorry if this was already asked and I missed it... While using v20.3.2, after I load a module... 11> l(math). {module,math} ...if I try to reload it again with the same command... 12> l(math). =ERROR REPORT==== 13-Apr-2018::13:09:15 === Can't load module 'math' that resides in sticky dir {error,sticky_directory} ...I get this error message. It's not particular to any module. From the error, there seems to be a problem with a stcky bit somewhere. Although I don't remember having this problem before, who knows, maybe it's just my install. Has anyone run into this issue recently? Thanks,Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikpelinux@REDACTED Fri Apr 13 19:17:21 2018 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Fri, 13 Apr 2018 19:17:21 +0200 Subject: [erlang-questions] Checking if the keys of a list of tuples match a list In-Reply-To: <20180413151858.GA1520@auron> References: <20180413151858.GA1520@auron> Message-ID: On Fri, Apr 13, 2018 at 5:18 PM, Silas wrote: > 2. Now a question about Erlang data structures: To check if a list has all > elements of another list (regardless of the order), I'm using this: > > % This function returns true if all elements in List2 are in List1, > regardless > % of the order. > sublistmember(_, []) -> true; > sublistmember(List1, List2) -> > [Head|Tail] = List2, > case lists:member(Head, List1) of > true -> sublistmember(List1, Tail); > false -> false > end. > > Its complexity is O(len(List1)) * O(len(List2)) which is not actually a > problem for small lists (I can limit the number of tags the user may > provide) but I was wondering if there is a more effective way. I thought > about using sets to simplify but list -> set -> list conversion may be even > slower, right? Any suggestions on this? lists:member/2 is a BIF, so implemented by C code in the VM. For short lists this is going to be pretty much optimal. I'd move the [Head|Tail] extraction into the function head however. You can easily do the check in linear time if the lists are sorted; otherwise you may pre-sort for O(N*logN) overall cost. But this is only worthwhile for longer lists, so you'd have to run some measurements to determine a suitable cut-off point. From cean.ebengt@REDACTED Fri Apr 13 19:33:03 2018 From: cean.ebengt@REDACTED (bengt) Date: Fri, 13 Apr 2018 19:33:03 +0200 Subject: [erlang-questions] module reloading In-Reply-To: <20180413171340.C7409E0153@smtp.hushmail.com> References: <20180413171340.C7409E0153@smtp.hushmail.com> Message-ID: <787C4A1C-9156-403D-A7A5-74AE5111958D@gmail.com> Greetings, This is one explanation of *sticky directory*: http://erlang.org/pipermail/erlang-questions/2002-October/005908.html bengt > On 13 Apr 2018, at 19:13, Alex Alvarez wrote: > > Sorry if this was already asked and I missed it... While using v20.3.2, after I load a module... > > 11> l(math). > {module,math} > > ...if I try to reload it again with the same command... > > 12> l(math). > > =ERROR REPORT==== 13-Apr-2018::13:09:15 === > Can't load module 'math' that resides in sticky dir > {error,sticky_directory} > > ...I get this error message. It's not particular to any module. From the error, there seems to be a problem with a stcky bit somewhere. Although I don't remember having this problem before, who knows, maybe it's just my install. Has anyone run into this issue recently? > > Thanks, > Alex > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From cchalasani@REDACTED Sat Apr 14 11:55:28 2018 From: cchalasani@REDACTED (Chaitanya Chalasani) Date: Sat, 14 Apr 2018 15:25:28 +0530 Subject: [erlang-questions] Erlang node memory consumption grows to 18GB in few seconds Message-ID: <1656E73A-663B-427F-9602-C2386F8BFFB3@me.com> Hi, I see the memory consumption of an erlang node grows exponentially and quickly when I was sending binary data of about 700 MB from shell to a simple erlang listener process and the shell process is stuck. -module(strange). -export([start/0, listener/0, send/1, stop/0]). start() -> register(?MODULE, spawn(?MODULE, listener, [])). listener() -> receive {send, Data} -> io:format("Received Data ~p ~n", [Data]), listener(); stop -> io:format("Stopping listener ~n") end. send(Data) -> ?MODULE ! {send, Data}. stop() -> ?MODULE ! stop. $ uname -a Darwin Chaitanyas-MacBook-Pro.local 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64 $ erl Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] Eshell V9.3 (abort with ^G) 1> c(strange). {ok,strange} 2> {ok, Data} = file:read_file("centos.iso"). {ok,<<51,237,144,144,144,144,144,144,144,144,144,144,144, 144,144,144,144,144,144,144,144,144,144,144,144, 144,144,...>>} 3> strange:start(). true 4> strange:send(Data). BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution The observer says - <0.53.0> group:server/3 93980000 17957208520 1 erlang:integer_to_list/1 The Mac activity monitor shows Erlang consuming 18GB of RAM. Kindly, help me understand what is happening. /Chaitanya -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Sun Apr 15 13:15:06 2018 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Sun, 15 Apr 2018 14:15:06 +0300 Subject: [erlang-questions] Erlang node memory consumption grows to 18GB in few seconds In-Reply-To: <1656E73A-663B-427F-9602-C2386F8BFFB3@me.com> References: <1656E73A-663B-427F-9602-C2386F8BFFB3@me.com> Message-ID: Hello, `io:format(?)` is your problem in this example. Best Regards, Dmitry > On 14 Apr 2018, at 12.55, Chaitanya Chalasani wrote: > > Hi, > > I see the memory consumption of an erlang node grows exponentially and quickly when I was sending binary data of about 700 MB from shell to a simple erlang listener process and the shell process is stuck. > > -module(strange). > -export([start/0, listener/0, send/1, stop/0]). > > start() -> > register(?MODULE, spawn(?MODULE, listener, [])). > > listener() -> > receive > {send, Data} -> > io:format("Received Data ~p ~n", [Data]), > listener(); > stop -> > io:format("Stopping listener ~n") > end. > > send(Data) -> > ?MODULE ! {send, Data}. > > stop() -> > ?MODULE ! stop. > > $ uname -a > Darwin Chaitanyas-MacBook-Pro.local 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64 > > $ erl > Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] > > Eshell V9.3 (abort with ^G) > 1> c(strange). > {ok,strange} > 2> {ok, Data} = file:read_file("centos.iso"). > {ok,<<51,237,144,144,144,144,144,144,144,144,144,144,144, > 144,144,144,144,144,144,144,144,144,144,144,144, > 144,144,...>>} > 3> strange:start(). > true > 4> strange:send(Data). > > BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded > (v)ersion (k)ill (D)b-tables (d)istribution > > The observer says - > <0.53.0> group:server/3 93980000 17957208520 1 erlang:integer_to_list/1 > > The Mac activity monitor shows Erlang consuming 18GB of RAM. > > Kindly, help me understand what is happening. > > /Chaitanya > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: Message signed with OpenPGP URL: From igor.clark@REDACTED Sat Apr 14 17:17:09 2018 From: igor.clark@REDACTED (Igor Clark) Date: Sat, 14 Apr 2018 16:17:09 +0100 Subject: [erlang-questions] Where to configure & start mnesia in a release? Message-ID: <622dcb27-4fc2-53a4-a73d-23941f21ecf9@gmail.com> Hi list, I have an OTP application which uses mnesia. It checks/ensures the schema and table files exist and then calls application:ensure_started( mnesia ) in its application:start/2 callback. It works fine when I run the application on its own under rebar3 shell, but it doesn't work when I try to run it from an OTP release: - When I run the OTP app under rebar3 shell in its own separate directory, with { mnesia, [ { dir, "/tmp/my_db_dir" } ] } in priv/sys.config, it works fine and application:get_env( mnesia, dir ) returns /tmp/my_db_dir as normal/expected - If I set { mnesia, [ { dir, "/tmp/my_db_dir" } ] } in /config/sys.config, then: ??? - under rebar3 shell --name=myapp@REDACTED, calling application:get_env( mnesia, dir ) succeeds (returns /tmp/my_db_dir) , and the app uses reads/writes mnesia tables successfully ??? - under_build//rel//bin/ console it fails (returns undefined), so the app crashes on start, regardless of whether is prod or default How do I set mnesia application environment variables in the release project? (Or, maybe, how do I get the OTP application to be able to access the release project's application environment variables?) Also, I realise I could be going about this the wrong way - maybe mnesia should be configured inside the specific OTP app, even under a release? Apart from the fact that that doesn't seem to work (as I have it set up, anyway), I'm aware I should steer clear of "included applications" - not least because I want to be able to use the OTP app in other projects - so I guess there's a broader question of how to configure mnesia in general, in how & when to create schema and tables, if it could be used by multiple OTP apps in a release? Bit puzzled, appreciate any advice! Cheers, Igor From erlang@REDACTED Fri Apr 13 22:26:24 2018 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 13 Apr 2018 22:26:24 +0200 Subject: [erlang-questions] module reloading In-Reply-To: <20180413171340.C7409E0153@smtp.hushmail.com> References: <20180413171340.C7409E0153@smtp.hushmail.com> Message-ID: The module called 'math' is a pre-defined system module, and redefining it might have unpleasant and unpredictable consequences - so you really should not do this unless you know exactly what you are doing. Best is to just change the name. If you know what you're doing you can call unstick_dir on the directory where math.beam was loaded from and then you will be able to change the code - again this is not a good idea if you don't really understand the consequences of doing this. System modules are 'sticky' by default to stop you from accidentally shooting yourself in the foot. If you get this warning just change the module name. Cheers /Joe On Fri, Apr 13, 2018 at 7:13 PM, Alex Alvarez wrote: > Sorry if this was already asked and I missed it... While using v20.3.2, > after I load a module... > > 11> l(math). > {module,math} > > ...if I try to reload it again with the same command... > > 12> l(math). > > =ERROR REPORT==== 13-Apr-2018::13:09:15 === > Can't load module 'math' that resides in sticky dir > {error,sticky_directory} > > ...I get this error message. It's not particular to any module. From the > error, there seems to be a problem with a stcky bit somewhere. Although I > don't remember having this problem before, who knows, maybe it's just my > install. Has anyone run into this issue recently? > > Thanks, > Alex > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From donpedrothird@REDACTED Sat Apr 14 21:11:31 2018 From: donpedrothird@REDACTED (John Doe) Date: Sat, 14 Apr 2018 22:11:31 +0300 Subject: [erlang-questions] code:load_binary - why there's module as argument Message-ID: Hi all, I wonder why code:load_binary() requires module name as one of the arguments? The function would fail if this name is not equal to the real module name from the binary, so it can deduce the correct name. Why it does not allow loading just whatever module from a given binary and return something like {ok, moduleName} as the result? -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Sun Apr 15 15:10:27 2018 From: z@REDACTED (Danil Zagoskin) Date: Sun, 15 Apr 2018 16:10:27 +0300 Subject: [erlang-questions] Erlang node memory consumption grows to 18GB in few seconds In-Reply-To: <1656E73A-663B-427F-9602-C2386F8BFFB3@me.com> References: <1656E73A-663B-427F-9602-C2386F8BFFB3@me.com> Message-ID: Never use io:format("~p") on large data. Simple solution is to limit depth: io:format("~P~n", [Data, 30]) On Sat, Apr 14, 2018 at 12:55 PM, Chaitanya Chalasani wrote: > Hi, > > I see the memory consumption of an erlang node grows exponentially and > quickly when I was sending binary data of about 700 MB from shell to a > simple erlang listener process and the shell process is stuck. > > -module(strange). > -export([start/0, listener/0, send/1, stop/0]). > > start() -> > register(?MODULE, spawn(?MODULE, listener, [])). > > listener() -> > receive > {send, Data} -> > io:format("Received Data ~p ~n", [Data]), > listener(); > stop -> > io:format("Stopping listener ~n") > end. > > send(Data) -> > ?MODULE ! {send, Data}. > > stop() -> > ?MODULE ! stop. > > $ uname -a > Darwin Chaitanyas-MacBook-Pro.local 17.5.0 Darwin Kernel Version 17.5.0: Mon > Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64 > > $ erl > Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] > [async-threads:10] [hipe] [kernel-poll:false] [dtrace] > > Eshell V9.3 (abort with ^G) > 1> c(strange). > {ok,strange} > 2> {ok, Data} = file:read_file("centos.iso"). > {ok,<<51,237,144,144,144,144,144,144,144,144,144,144,144, > 144,144,144,144,144,144,144,144,144,144,144,144, > 144,144,...>>} > 3> strange:start(). > true > 4> strange:send(Data). > > BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded > (v)ersion (k)ill (D)b-tables (d)istribution > > The observer says - > <0.53.0> group:server/3 93980000 17957208520 1 erlang:integer_to_list/1 > > The Mac activity monitor shows Erlang consuming 18GB of RAM. > > Kindly, help me understand what is happening. > > /Chaitanya > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Danil Zagoskin | z@REDACTED From cchalasani@REDACTED Sun Apr 15 15:17:19 2018 From: cchalasani@REDACTED (Chaitanya Chalasani) Date: Sun, 15 Apr 2018 18:47:19 +0530 Subject: [erlang-questions] Erlang node memory consumption grows to 18GB in few seconds In-Reply-To: References: <1656E73A-663B-427F-9602-C2386F8BFFB3@me.com> Message-ID: <2325240A-19C9-48EA-BF18-49BCE2DF5B6F@me.com> Thank you for that suggestion, Danil. However, removing the io:format alone didn?t solve the problem. I had to change the send function too. From: send(Data) -> ?MODULE ! {send, Data}. To: send(Data) -> ?MODULE ! {send, Data}, ok. Does the shell also use io:format to show the function return value? > On 15-Apr-2018, at 18:40, Danil Zagoskin wrote: > > Never use io:format("~p") on large data. > Simple solution is to limit depth: io:format("~P~n", [Data, 30]) > > On Sat, Apr 14, 2018 at 12:55 PM, Chaitanya Chalasani wrote: >> Hi, >> >> I see the memory consumption of an erlang node grows exponentially and >> quickly when I was sending binary data of about 700 MB from shell to a >> simple erlang listener process and the shell process is stuck. >> >> -module(strange). >> -export([start/0, listener/0, send/1, stop/0]). >> >> start() -> >> register(?MODULE, spawn(?MODULE, listener, [])). >> >> listener() -> >> receive >> {send, Data} -> >> io:format("Received Data ~p ~n", [Data]), >> listener(); >> stop -> >> io:format("Stopping listener ~n") >> end. >> >> send(Data) -> >> ?MODULE ! {send, Data}. >> >> stop() -> >> ?MODULE ! stop. >> >> $ uname -a >> Darwin Chaitanyas-MacBook-Pro.local 17.5.0 Darwin Kernel Version 17.5.0: Mon >> Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64 >> >> $ erl >> Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] >> [async-threads:10] [hipe] [kernel-poll:false] [dtrace] >> >> Eshell V9.3 (abort with ^G) >> 1> c(strange). >> {ok,strange} >> 2> {ok, Data} = file:read_file("centos.iso"). >> {ok,<<51,237,144,144,144,144,144,144,144,144,144,144,144, >> 144,144,144,144,144,144,144,144,144,144,144,144, >> 144,144,...>>} >> 3> strange:start(). >> true >> 4> strange:send(Data). >> >> BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded >> (v)ersion (k)ill (D)b-tables (d)istribution >> >> The observer says - >> <0.53.0> group:server/3 93980000 17957208520 1 erlang:integer_to_list/1 >> >> The Mac activity monitor shows Erlang consuming 18GB of RAM. >> >> Kindly, help me understand what is happening. >> >> /Chaitanya >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > > -- > Danil Zagoskin | z@REDACTED From nayibor@REDACTED Sun Apr 15 17:06:30 2018 From: nayibor@REDACTED (Nuku Ameyibor) Date: Sun, 15 Apr 2018 15:06:30 +0000 Subject: [erlang-questions] Where to configure & start mnesia in a release? In-Reply-To: <622dcb27-4fc2-53a4-a73d-23941f21ecf9@gmail.com> References: <622dcb27-4fc2-53a4-a73d-23941f21ecf9@gmail.com> Message-ID: > - under_build//rel//bin/ console it fails > (returns undefined), so the app crashes on start, regardless of whether > is prod or default it may or may not be crashing due the mnesia configuration . you may have to check the the erl_crash.dump to see the cause of the crash . How do I set mnesia application environment variables in the release > project? (Or, maybe, how do I get the OTP application to be able to access > the release project's application environment variables?) in the relx section of your rebar.config you can set a sys_config to be used {relx, [ {sys_config,"config/sys.config"} ] in that sys.config you can setup environmental variables to be used by your applications including an entry for mnesia. [ {mnesia, [{dir,"/tmp/my_db_dir"}] }, {app1,[{a,1},{b,2}], {app2,[{a,3},{b,4}] } ] this will be used by your release system when the release is created . check out http://www.rebar3.org/docs/releases . On Sat, Apr 14, 2018 at 3:17 PM, Igor Clark wrote: > Hi list, > > I have an OTP application which uses mnesia. It checks/ensures the schema > and table files exist and then calls application:ensure_started( mnesia ) > in its application:start/2 callback. It works fine when I run the > application on its own under rebar3 shell, but it doesn't work when I try > to run it from an OTP release: > > - When I run the OTP app under rebar3 shell in its own separate directory, > with { mnesia, [ { dir, "/tmp/my_db_dir" } ] } in priv/sys.config, it works > fine and application:get_env( mnesia, dir ) returns /tmp/my_db_dir as > normal/expected > > - If I set { mnesia, [ { dir, "/tmp/my_db_dir" } ] } in > /config/sys.config, then: > > - under rebar3 shell --name=myapp@REDACTED, calling > application:get_env( mnesia, dir ) succeeds (returns /tmp/my_db_dir) , and > the app uses reads/writes mnesia tables successfully > > - under_build//rel//bin/ console it fails > (returns undefined), so the app crashes on start, regardless of whether > is prod or default > > How do I set mnesia application environment variables in the release > project? (Or, maybe, how do I get the OTP application to be able to access > the release project's application environment variables?) > > Also, I realise I could be going about this the wrong way - maybe mnesia > should be configured inside the specific OTP app, even under a release? > Apart from the fact that that doesn't seem to work (as I have it set up, > anyway), I'm aware I should steer clear of "included applications" - not > least because I want to be able to use the OTP app in other projects - so I > guess there's a broader question of how to configure mnesia in general, in > how & when to create schema and tables, if it could be used by multiple OTP > apps in a release? > > Bit puzzled, appreciate any advice! > > Cheers, > Igor > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cchalasani@REDACTED Sat Apr 14 16:22:45 2018 From: cchalasani@REDACTED (Chaitanya Chalasani) Date: Sat, 14 Apr 2018 19:52:45 +0530 Subject: [erlang-questions] Erlang node memory consumption grows to 18GB in few seconds In-Reply-To: <1656E73A-663B-427F-9602-C2386F8BFFB3@me.com> References: <1656E73A-663B-427F-9602-C2386F8BFFB3@me.com> Message-ID: I suppose it is the io:format which is causing the issue. Removed the io:format and it works well now. > On 14-Apr-2018, at 15:25, Chaitanya Chalasani wrote: > > Hi, > > I see the memory consumption of an erlang node grows exponentially and quickly when I was sending binary data of about 700 MB from shell to a simple erlang listener process and the shell process is stuck. > > -module(strange). > -export([start/0, listener/0, send/1, stop/0]). > > start() -> > register(?MODULE, spawn(?MODULE, listener, [])). > > listener() -> > receive > {send, Data} -> > io:format("Received Data ~p ~n", [Data]), > listener(); > stop -> > io:format("Stopping listener ~n") > end. > > send(Data) -> > ?MODULE ! {send, Data}. > > stop() -> > ?MODULE ! stop. > > $ uname -a > Darwin Chaitanyas-MacBook-Pro.local 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64 > > $ erl > Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] > > Eshell V9.3 (abort with ^G) > 1> c(strange). > {ok,strange} > 2> {ok, Data} = file:read_file("centos.iso"). > {ok,<<51,237,144,144,144,144,144,144,144,144,144,144,144, > 144,144,144,144,144,144,144,144,144,144,144,144, > 144,144,...>>} > 3> strange:start(). > true > 4> strange:send(Data). > > BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded > (v)ersion (k)ill (D)b-tables (d)istribution > > The observer says - > <0.53.0> group:server/3 93980000 17957208520 1 erlang:integer_to_list/1 > > The Mac activity monitor shows Erlang consuming 18GB of RAM. > > Kindly, help me understand what is happening. > > /Chaitanya -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor.clark@REDACTED Sun Apr 15 17:50:05 2018 From: igor.clark@REDACTED (Igor Clark) Date: Sun, 15 Apr 2018 16:50:05 +0100 Subject: [erlang-questions] Where to configure & start mnesia in a release? In-Reply-To: References: <622dcb27-4fc2-53a4-a73d-23941f21ecf9@gmail.com> Message-ID: <4db77dfc-c2bf-12a8-7ec8-b95e79ee750e@gmail.com> Thanks Nuku, - It's definitely crashing due to the mnesia configuration - it shows a {badmatch,undefined} error on the line where I call { ok, MnesiaDir } = application:get_env( mnesia, dir ), and I've tried io:format()'ing the result of application:get_env( mnesia, dir ), which shows 'undefined' when running as a release - relx section of rebar.config is set up exactly like that - I used rebar3 to generate the release - sys.config has exactly that mnesia entry It all works as expected with 'rebar3 shell', environment variable is found, mnesia starts, it all works fine - but when I run 'rebar3 release' and try to run the generated startup script, either with 'console' or with 'start' and looking in the log file, the OTP application included in the release gets 'undefined' from application:get_env( mnesia, dir ). From your sys.config example I realise I could say for example [ { my_app, [ { mnesia_dir, "/tmp/my_db_dir" } ] } ], and use application:get_env( my_app, mnesia_dir ) to initialise; this works and returns { ok, "/tmp/my_db_dir" }, which is great, but then ok = application:ensure_started( mnesia ) fails with {{badmatch, {error,{"no such file or directory","mnesia.app"}}}. I have no idea where mnesia.app should go, and I haven't been able to find any references to this file in docs or online that explain where it should go or what should be in it, except that it exists in the mnesia package under the OTP source tree. So still pretty unclear how to proceed, pointers welcome! Thanks, Igor On 15/04/2018 16:06, Nuku Ameyibor wrote: > > - under_build//rel//bin/ console it > fails (returns undefined), so the app crashes on start, regardless > of whether is prod or default > > it may or may not be crashing due the mnesia configuration . > you may have to check the the erl_crash.dump to see the cause of the > crash . > > > How do I set mnesia application environment variables in the > release project? (Or, maybe, how do I get the OTP application to > be able to access the release project's application environment > variables?) > > in the relx section of your rebar.config you can set a sys_config to > be used > {relx, > [ > {sys_config,"config/sys.config"} > ? ? ? ?] > in that sys.config you can setup environmental variables to be used by > your applications including an entry for mnesia. > [ > {mnesia, > [{dir,"/tmp/my_db_dir"}] > }, > {app1,[{a,1},{b,2}], > {app2,[{a,3},{b,4}] > } > ] > this will be used by your release system when the release is created . > check out http://www.rebar3.org/docs/releases?. > > > > On Sat, Apr 14, 2018 at 3:17 PM, Igor Clark > wrote: > > Hi list, > > I have an OTP application which uses mnesia. It checks/ensures the > schema and table files exist and then calls > application:ensure_started( mnesia ) in its application:start/2 > callback. It works fine when I run the application on its own > under rebar3 shell, but it doesn't work when I try to run it from > an OTP release: > > - When I run the OTP app under rebar3 shell in its own separate > directory, with { mnesia, [ { dir, "/tmp/my_db_dir" } ] } in > priv/sys.config, it works fine and application:get_env( mnesia, > dir ) returns /tmp/my_db_dir as normal/expected > > - If I set { mnesia, [ { dir, "/tmp/my_db_dir" } ] } in > /config/sys.config, then: > > ??? - under rebar3 shell --name=myapp@REDACTED, calling > application:get_env( mnesia, dir ) succeeds (returns > /tmp/my_db_dir) , and the app uses reads/writes mnesia tables > successfully > > ??? - under_build//rel//bin/ console it > fails (returns undefined), so the app crashes on start, regardless > of whether is prod or default > > How do I set mnesia application environment variables in the > release project? (Or, maybe, how do I get the OTP application to > be able to access the release project's application environment > variables?) > > Also, I realise I could be going about this the wrong way - maybe > mnesia should be configured inside the specific OTP app, even > under a release? Apart from the fact that that doesn't seem to > work (as I have it set up, anyway), I'm aware I should steer clear > of "included applications" - not least because I want to be able > to use the OTP app in other projects - so I guess there's a > broader question of how to configure mnesia in general, in how & > when to create schema and tables, if it could be used by multiple > OTP apps in a release? > > Bit puzzled, appreciate any advice! > > Cheers, > Igor > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nayibor@REDACTED Sun Apr 15 22:01:35 2018 From: nayibor@REDACTED (Nuku Ameyibor) Date: Sun, 15 Apr 2018 20:01:35 +0000 Subject: [erlang-questions] Where to configure & start mnesia in a release? In-Reply-To: <4db77dfc-c2bf-12a8-7ec8-b95e79ee750e@gmail.com> References: <622dcb27-4fc2-53a4-a73d-23941f21ecf9@gmail.com> <4db77dfc-c2bf-12a8-7ec8-b95e79ee750e@gmail.com> Message-ID: mnesia is not included as part of the release . when rebar3 shell command is run the path to mnesia is added automatically to the code paths . in a release environment however its not copied over into the release libs unless specified in one of your .app.src files. in your app.src file check to see if mnesia is one of the applications which has to be started before the main application is started. On Sun, Apr 15, 2018 at 3:50 PM, Igor Clark wrote: > Thanks Nuku, > > - It's definitely crashing due to the mnesia configuration - it shows a > {badmatch,undefined} error on the line where I call { ok, MnesiaDir } = > application:get_env( mnesia, dir ), and I've tried io:format()'ing the > result of application:get_env( mnesia, dir ), which shows 'undefined' > when running as a release > > - relx section of rebar.config is set up exactly like that - I used rebar3 > to generate the release > > - sys.config has exactly that mnesia entry > > It all works as expected with 'rebar3 shell', environment variable is > found, mnesia starts, it all works fine - but when I run 'rebar3 release' > and try to run the generated startup script, either with 'console' or with > 'start' and looking in the log file, the OTP application included in the > release gets 'undefined' from application:get_env( mnesia, dir ). > > From your sys.config example I realise I could say for example [ { > my_app, [ { mnesia_dir, "/tmp/my_db_dir" } ] } ], and use > application:get_env( my_app, mnesia_dir ) to initialise; this works and > returns { ok, "/tmp/my_db_dir" }, which is great, but then ok = > application:ensure_started( mnesia ) fails with {{badmatch, {error,{"no > such file or directory","mnesia.app"}}}. I have no idea where mnesia.app > should go, and I haven't been able to find any references to this file in > docs or online that explain where it should go or what should be in it, > except that it exists in the mnesia package under the OTP source tree. > > So still pretty unclear how to proceed, pointers welcome! > > Thanks, > Igor > > > On 15/04/2018 16:06, Nuku Ameyibor wrote: > > > - under_build//rel//bin/ console it fails >> (returns undefined), so the app crashes on start, regardless of whether >> is prod or default > > it may or may not be crashing due the mnesia configuration . > you may have to check the the erl_crash.dump to see the cause of the crash > . > > > How do I set mnesia application environment variables in the release >> project? (Or, maybe, how do I get the OTP application to be able to access >> the release project's application environment variables?) > > > in the relx section of your rebar.config you can set a sys_config to be > used > {relx, > [ > {sys_config,"config/sys.config"} > ] > > in that sys.config you can setup environmental variables to be used by > your applications including an entry for mnesia. > [ > {mnesia, > [{dir,"/tmp/my_db_dir"}] > }, > {app1,[{a,1},{b,2}], > {app2,[{a,3},{b,4}] > } > ] > this will be used by your release system when the release is created . > check out http://www.rebar3.org/docs/releases . > > > > > On Sat, Apr 14, 2018 at 3:17 PM, Igor Clark wrote: > >> Hi list, >> >> I have an OTP application which uses mnesia. It checks/ensures the schema >> and table files exist and then calls application:ensure_started( mnesia ) >> in its application:start/2 callback. It works fine when I run the >> application on its own under rebar3 shell, but it doesn't work when I try >> to run it from an OTP release: >> >> - When I run the OTP app under rebar3 shell in its own separate >> directory, with { mnesia, [ { dir, "/tmp/my_db_dir" } ] } in >> priv/sys.config, it works fine and application:get_env( mnesia, dir ) >> returns /tmp/my_db_dir as normal/expected >> >> - If I set { mnesia, [ { dir, "/tmp/my_db_dir" } ] } in >> /config/sys.config, then: >> >> - under rebar3 shell --name=myapp@REDACTED, calling >> application:get_env( mnesia, dir ) succeeds (returns /tmp/my_db_dir) , and >> the app uses reads/writes mnesia tables successfully >> >> - under_build//rel//bin/ console it fails >> (returns undefined), so the app crashes on start, regardless of whether >> is prod or default >> >> How do I set mnesia application environment variables in the release >> project? (Or, maybe, how do I get the OTP application to be able to access >> the release project's application environment variables?) >> >> Also, I realise I could be going about this the wrong way - maybe mnesia >> should be configured inside the specific OTP app, even under a release? >> Apart from the fact that that doesn't seem to work (as I have it set up, >> anyway), I'm aware I should steer clear of "included applications" - not >> least because I want to be able to use the OTP app in other projects - so I >> guess there's a broader question of how to configure mnesia in general, in >> how & when to create schema and tables, if it could be used by multiple OTP >> apps in a release? >> >> Bit puzzled, appreciate any advice! >> >> Cheers, >> Igor >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From arif@REDACTED Sun Apr 15 22:02:44 2018 From: arif@REDACTED (arif@REDACTED) Date: Sun, 15 Apr 2018 13:02:44 -0700 Subject: [erlang-questions] GUI development with Erlang In-Reply-To: <000201d380cb$54724e10$fd56ea30$@comcast.net> References: <3589a8eb738ed5801027fac6ec225bcf@riseup.net> <000501d370ea$cde23ad0$69a6b070$@comcast.net> <000201d380cb$54724e10$fd56ea30$@comcast.net> Message-ID: <9d1ff54235e9bdfc4fd0bf7e7b8246ee@riseup.net> Hi, I have written a follow up to the getting started piece. It may not be enough to write your chart widgets, but I hope it gives you some more insights into the workings of wxErlang. https://arifishaq.files.wordpress.com/2018/04/wxerlang-speeding-up.pdf Best regards Arif From igor.clark@REDACTED Sun Apr 15 23:01:32 2018 From: igor.clark@REDACTED (Igor Clark) Date: Sun, 15 Apr 2018 22:01:32 +0100 Subject: [erlang-questions] Where to configure & start mnesia in a release? In-Reply-To: References: <622dcb27-4fc2-53a4-a73d-23941f21ecf9@gmail.com> <4db77dfc-c2bf-12a8-7ec8-b95e79ee750e@gmail.com> Message-ID: <0d62cb57-dc6e-a204-2eba-efabed3fd5c1@gmail.com> Thanks very much Nuku, that's the piece of the puzzle I was missing. I hadn't understood properly about the release packaging - I thought that if I added mnesia into the relx config, it would automatically start the mnesia app too, and I wanted to do that manually in my app. But after reading your email I added it into the relx/release section, and as you said, the mnesia package is now included in the release, but I can still start it manually, and the console boots correctly and accesses the mnesia data. Thank you! Best, Igor On 15/04/2018 21:01, Nuku Ameyibor wrote: > ?mnesia is not? included as part of the release . > when rebar3 shell command is run? the path to mnesia is added > automatically to the code paths . > in? a release environment however its not copied? over into the > release libs unless specified in one of your .app.src files. > in your app.src? file check to see if mnesia is one? of the > applications which has to? be started before the main application is > started. > > > On Sun, Apr 15, 2018 at 3:50 PM, Igor Clark > wrote: > > Thanks Nuku, > > - It's definitely crashing due to the mnesia configuration - it > shows a {badmatch,undefined} error on the line where I call { ok, > MnesiaDir } = application:get_env( mnesia, dir ), and I've tried > io:format()'ing the result of application:get_env( mnesia, dir ), > which shows 'undefined' when running as a release > > - relx section of rebar.config is set up exactly like that - I > used rebar3 to generate the release > > - sys.config has exactly that mnesia entry > > It all works as expected with 'rebar3 shell', environment variable > is found, mnesia starts, it all works fine - but when I run > 'rebar3 release' and try to run the generated startup script, > either with 'console' or with 'start' and looking in the log file, > the OTP application included in the release gets 'undefined' from > application:get_env( mnesia, dir ). > > From your sys.config example I realise I could say for example [ { > my_app, [ { mnesia_dir, "/tmp/my_db_dir" } ] } ], and use > application:get_env( my_app, mnesia_dir ) to initialise; this > works and returns { ok, "/tmp/my_db_dir" }, which is great, but > then ok = application:ensure_started( mnesia ) fails with > {{badmatch, {error,{"no such file or directory","mnesia.app"}}}. I > have no idea where mnesia.app should go, and I haven't been able > to find any references to this file in docs or online that explain > where it should go or what should be in it, except that it exists > in the mnesia package under the OTP source tree. > > So still pretty unclear how to proceed, pointers welcome! > > Thanks, > Igor > > > On 15/04/2018 16:06, Nuku Ameyibor wrote: >> >> - under_build//rel//bin/ console >> it fails (returns undefined), so the app crashes on start, >> regardless of whether is prod or default >> >> it may or may not be crashing due the mnesia configuration . >> you may have to check the the erl_crash.dump to see the cause of >> the crash . >> >> >> How do I set mnesia application environment variables in the >> release project? (Or, maybe, how do I get the OTP application >> to be able to access the release project's application >> environment variables?) >> >> in the relx section of your rebar.config you can set a sys_config >> to be used >> {relx, >> [ >> {sys_config,"config/sys.config"} >> ? ? ? ?] >> in that sys.config you can setup environmental variables to be >> used by your applications including an entry for mnesia. >> [ >> {mnesia, >> [{dir,"/tmp/my_db_dir"}] >> }, >> {app1,[{a,1},{b,2}], >> {app2,[{a,3},{b,4}] >> } >> ] >> this will be used by your release system when the release is >> created . >> check out http://www.rebar3.org/docs/releases >> ?. >> >> >> >> On Sat, Apr 14, 2018 at 3:17 PM, Igor Clark > > wrote: >> >> Hi list, >> >> I have an OTP application which uses mnesia. It >> checks/ensures the schema and table files exist and then >> calls application:ensure_started( mnesia ) in its >> application:start/2 callback. It works fine when I run the >> application on its own under rebar3 shell, but it doesn't >> work when I try to run it from an OTP release: >> >> - When I run the OTP app under rebar3 shell in its own >> separate directory, with { mnesia, [ { dir, "/tmp/my_db_dir" >> } ] } in priv/sys.config, it works fine and >> application:get_env( mnesia, dir ) returns /tmp/my_db_dir as >> normal/expected >> >> - If I set { mnesia, [ { dir, "/tmp/my_db_dir" } ] } in >> /config/sys.config, then: >> >> ??? - under rebar3 shell --name=myapp@REDACTED, calling >> application:get_env( mnesia, dir ) succeeds (returns >> /tmp/my_db_dir) , and the app uses reads/writes mnesia tables >> successfully >> >> ??? - under_build//rel//bin/ >> console it fails (returns undefined), so the app crashes on >> start, regardless of whether is prod or default >> >> How do I set mnesia application environment variables in the >> release project? (Or, maybe, how do I get the OTP application >> to be able to access the release project's application >> environment variables?) >> >> Also, I realise I could be going about this the wrong way - >> maybe mnesia should be configured inside the specific OTP >> app, even under a release? Apart from the fact that that >> doesn't seem to work (as I have it set up, anyway), I'm aware >> I should steer clear of "included applications" - not least >> because I want to be able to use the OTP app in other >> projects - so I guess there's a broader question of how to >> configure mnesia in general, in how & when to create schema >> and tables, if it could be used by multiple OTP apps in a >> release? >> >> Bit puzzled, appreciate any advice! >> >> Cheers, >> Igor >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nayibor@REDACTED Sun Apr 15 23:39:16 2018 From: nayibor@REDACTED (Nuku Ameyibor) Date: Sun, 15 Apr 2018 21:39:16 +0000 Subject: [erlang-questions] Where to configure & start mnesia in a release? In-Reply-To: <0d62cb57-dc6e-a204-2eba-efabed3fd5c1@gmail.com> References: <622dcb27-4fc2-53a4-a73d-23941f21ecf9@gmail.com> <4db77dfc-c2bf-12a8-7ec8-b95e79ee750e@gmail.com> <0d62cb57-dc6e-a204-2eba-efabed3fd5c1@gmail.com> Message-ID: you are welcome iggor but i think we may be talking about two different things the relx section like below > {release, {"app_release", "0.3.3"},[app_name,mnesia]}, would be one way to include mnesia and to have libs added as part of the release and mnesia started when your application is started . another way which is what i was talking about would be to add it in the .app.src file like this > {applications,[kernel,stdlib,mnesia ]} you may want mnesia to be started only when specific applications are started not when the whole release is started . cheers!! On Sun, Apr 15, 2018 at 9:01 PM, Igor Clark wrote: > Thanks very much Nuku, that's the piece of the puzzle I was missing. I > hadn't understood properly about the release packaging - I thought that if > I added mnesia into the relx config, it would automatically start the > mnesia app too, and I wanted to do that manually in my app. But after > reading your email I added it into the relx/release section, and as you > said, the mnesia package is now included in the release, but I can still > start it manually, and the console boots correctly and accesses the mnesia > data. > > Thank you! > > Best, > Igor > > > On 15/04/2018 21:01, Nuku Ameyibor wrote: > > mnesia is not included as part of the release . > when rebar3 shell command is run the path to mnesia is added > automatically to the code paths . > in a release environment however its not copied over into the release > libs unless specified in one of your .app.src files. > in your app.src file check to see if mnesia is one of the applications > which has to be started before the main application is started. > > > On Sun, Apr 15, 2018 at 3:50 PM, Igor Clark wrote: > >> Thanks Nuku, >> >> - It's definitely crashing due to the mnesia configuration - it shows a >> {badmatch,undefined} error on the line where I call { ok, MnesiaDir } = >> application:get_env( mnesia, dir ), and I've tried io:format()'ing the >> result of application:get_env( mnesia, dir ), which shows 'undefined' >> when running as a release >> >> - relx section of rebar.config is set up exactly like that - I used >> rebar3 to generate the release >> >> - sys.config has exactly that mnesia entry >> >> It all works as expected with 'rebar3 shell', environment variable is >> found, mnesia starts, it all works fine - but when I run 'rebar3 release' >> and try to run the generated startup script, either with 'console' or with >> 'start' and looking in the log file, the OTP application included in the >> release gets 'undefined' from application:get_env( mnesia, dir ). >> >> From your sys.config example I realise I could say for example [ { >> my_app, [ { mnesia_dir, "/tmp/my_db_dir" } ] } ], and use >> application:get_env( my_app, mnesia_dir ) to initialise; this works and >> returns { ok, "/tmp/my_db_dir" }, which is great, but then ok = >> application:ensure_started( mnesia ) fails with {{badmatch, {error,{"no >> such file or directory","mnesia.app"}}}. I have no idea where mnesia.app >> should go, and I haven't been able to find any references to this file in >> docs or online that explain where it should go or what should be in it, >> except that it exists in the mnesia package under the OTP source tree. >> >> So still pretty unclear how to proceed, pointers welcome! >> >> Thanks, >> Igor >> >> >> On 15/04/2018 16:06, Nuku Ameyibor wrote: >> >> >> - under_build//rel//bin/ console it fails >>> (returns undefined), so the app crashes on start, regardless of whether >>> is prod or default >> >> it may or may not be crashing due the mnesia configuration . >> you may have to check the the erl_crash.dump to see the cause of the >> crash . >> >> >> How do I set mnesia application environment variables in the release >>> project? (Or, maybe, how do I get the OTP application to be able to access >>> the release project's application environment variables?) >> >> >> in the relx section of your rebar.config you can set a sys_config to be >> used >> {relx, >> [ >> {sys_config,"config/sys.config"} >> ] >> >> in that sys.config you can setup environmental variables to be used by >> your applications including an entry for mnesia. >> [ >> {mnesia, >> [{dir,"/tmp/my_db_dir"}] >> }, >> {app1,[{a,1},{b,2}], >> {app2,[{a,3},{b,4}] >> } >> ] >> this will be used by your release system when the release is created . >> check out http://www.rebar3.org/docs/releases . >> >> >> >> >> On Sat, Apr 14, 2018 at 3:17 PM, Igor Clark wrote: >> >>> Hi list, >>> >>> I have an OTP application which uses mnesia. It checks/ensures the >>> schema and table files exist and then calls application:ensure_started( >>> mnesia ) in its application:start/2 callback. It works fine when I run the >>> application on its own under rebar3 shell, but it doesn't work when I try >>> to run it from an OTP release: >>> >>> - When I run the OTP app under rebar3 shell in its own separate >>> directory, with { mnesia, [ { dir, "/tmp/my_db_dir" } ] } in >>> priv/sys.config, it works fine and application:get_env( mnesia, dir ) >>> returns /tmp/my_db_dir as normal/expected >>> >>> - If I set { mnesia, [ { dir, "/tmp/my_db_dir" } ] } in >>> /config/sys.config, then: >>> >>> - under rebar3 shell --name=myapp@REDACTED, calling >>> application:get_env( mnesia, dir ) succeeds (returns /tmp/my_db_dir) , and >>> the app uses reads/writes mnesia tables successfully >>> >>> - under_build//rel//bin/ console it >>> fails (returns undefined), so the app crashes on start, regardless of >>> whether is prod or default >>> >>> How do I set mnesia application environment variables in the release >>> project? (Or, maybe, how do I get the OTP application to be able to access >>> the release project's application environment variables?) >>> >>> Also, I realise I could be going about this the wrong way - maybe mnesia >>> should be configured inside the specific OTP app, even under a release? >>> Apart from the fact that that doesn't seem to work (as I have it set up, >>> anyway), I'm aware I should steer clear of "included applications" - not >>> least because I want to be able to use the OTP app in other projects - so I >>> guess there's a broader question of how to configure mnesia in general, in >>> how & when to create schema and tables, if it could be used by multiple OTP >>> apps in a release? >>> >>> Bit puzzled, appreciate any advice! >>> >>> Cheers, >>> Igor >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex@REDACTED Mon Apr 16 04:06:04 2018 From: alex@REDACTED (Alex Alvarez) Date: Sun, 15 Apr 2018 22:06:04 -0400 Subject: [erlang-questions] module reloading In-Reply-To: <787C4A1C-9156-403D-A7A5-74AE5111958D@gmail.com> References: <20180413171340.C7409E0153@smtp.hushmail.com> <787C4A1C-9156-403D-A7A5-74AE5111958D@gmail.com> Message-ID: <20180416020604.8BE82E0153@smtp.hushmail.com> Thanks for your response and the referenced link! What called my attention about this is that according to the c:help() function c:l() is for both loading and reloading. Now, I see that from the documentation this is only the case if the given module (e.g., math) is marked/identified as old. Hence, this reloading is only for module upgrades, as need be. AFAIK now, then the only way to manually reload any module is to first use code:delete/1 and then c:l/1 again or code:load_file/1. What do you know! Then again, if you know of a one step way, please let me know. Cheers, Alex On 4/15/2018 at 7:34 AM, "bengt" wrote:code:load_fileGreetings, This is one explanation of *sticky directory*: http://erlang.org/pipermail/erlang-questions/2002-October/005908.html bengt On 13 Apr 2018, at 19:13, Alex Alvarez wrote: Sorry if this was already asked and I missed it... While using v20.3.2, after I load a module... 11> l(math). {module,math} ...if I try to reload it again with the same command... 12> l(math). =ERROR REPORT==== 13-Apr-2018::13:09:15 === Can't load module 'math' that resides in sticky dir {error,sticky_directory} ...I get this error message. It's not particular to any module. From the error, there seems to be a problem with a stcky bit somewhere. Although I don't remember having this problem before, who knows, maybe it's just my install. Has anyone run into this issue recently? Thanks,Alex _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex@REDACTED Mon Apr 16 04:24:37 2018 From: alex@REDACTED (Alex Alvarez) Date: Sun, 15 Apr 2018 22:24:37 -0400 Subject: [erlang-questions] module reloading In-Reply-To: References: <20180413171340.C7409E0153@smtp.hushmail.com> Message-ID: <20180416022438.624B5E0153@smtp.hushmail.com> Thanks for your reply! I can certainly understand that and appreciate the system would be letting me know if I was trying to do that. But the issue is that I was not trying to load any code of mine with the same module name, I just tried reloading the same (e.g., math) module. Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.3 (abort with ^G) 1> l(math). {module,math} 2> l(math). {error,sticky_directory} 3> =ERROR REPORT==== 15-Apr-2018::22:09:00 === Can't load module 'math' that resides in sticky dir As mentioned in my last email, the issue seems to be with the fact that the module was not marked old... 3> code:purge(math). false Now, I just thought that c:l() would load and reload any module regardless, but that doesn't seem to be the case. http://erlang.org/doc/man/c.html#l-1 http://erlang.org/doc/man/code.html#purge-1 Thanks, Alex On 4/13/2018 at 4:26 PM, "Joe Armstrong" wrote:The module called 'math' is a pre-defined system module, and redefining it might have unpleasant and unpredictable consequences - so you really should not do this unless you know exactly what you are doing. Best is to just change the name. If you know what you're doing you can call unstick_dir on the directory where math.beam was loaded from and then you will be able to change the code - again this is not a good idea if you don't really understand the consequences of doing this. System modules are 'sticky' by default to stop you from accidentally shooting yourself in the foot. If you get this warning just change the module name. Cheers /Joe On Fri, Apr 13, 2018 at 7:13 PM, Alex Alvarez wrote: > Sorry if this was already asked and I missed it... While using v20.3.2, > after I load a module... > > 11> l(math). > {module,math} > > ...if I try to reload it again with the same command... > > 12> l(math). > > =ERROR REPORT==== 13-Apr-2018::13:09:15 === > Can't load module 'math' that resides in sticky dir > {error,sticky_directory} > > ...I get this error message. It's not particular to any module. >From the > error, there seems to be a problem with a stcky bit somewhere. Although I > don't remember having this problem before, who knows, maybe it's just my > install. Has anyone run into this issue recently? > > Thanks, > Alex > > _______________________________________________ > 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 Mon Apr 16 11:05:19 2018 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Mon, 16 Apr 2018 11:05:19 +0200 Subject: [erlang-questions] code:load_binary - why there's module as argument In-Reply-To: References: Message-ID: 2018-04-14 21:11 GMT+02:00 John Doe : > Hi all, > I wonder why code:load_binary() requires module name as one of the > arguments? The function would fail if this name is not equal to the real > module name from the binary, so it can deduce the correct name. Why it does > not allow loading just whatever module from a given binary and return > something like {ok, moduleName} as the result? > ?I guess to avoid overwriting an unexpected module. The input binary can contain any code, if it pretends to be the list module, but the caller thinks its the strings module, that could be a problem.? -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Mon Apr 16 11:51:26 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Mon, 16 Apr 2018 11:51:26 +0200 Subject: [erlang-questions] Erlang node memory consumption grows to 18GB in few seconds In-Reply-To: <2325240A-19C9-48EA-BF18-49BCE2DF5B6F@me.com> References: <1656E73A-663B-427F-9602-C2386F8BFFB3@me.com> <2325240A-19C9-48EA-BF18-49BCE2DF5B6F@me.com> Message-ID: <20180416095126.GA96327@erix.ericsson.se> On Sun, Apr 15, 2018 at 06:47:19PM +0530, Chaitanya Chalasani wrote: > Thank you for that suggestion, Danil. > > However, removing the io:format alone didn?t solve the problem. I had to change the send function too. > > From: > > send(Data) -> > ?MODULE ! {send, Data}. > > To: > > send(Data) -> > ?MODULE ! {send, Data}, > ok. > > Does the shell also use io:format to show the function return value? The return value from all shell commands are saved in the shell history. / Raimo > > > On 15-Apr-2018, at 18:40, Danil Zagoskin wrote: > > > > Never use io:format("~p") on large data. > > Simple solution is to limit depth: io:format("~P~n", [Data, 30]) > > > > On Sat, Apr 14, 2018 at 12:55 PM, Chaitanya Chalasani wrote: > >> Hi, > >> > >> I see the memory consumption of an erlang node grows exponentially and > >> quickly when I was sending binary data of about 700 MB from shell to a > >> simple erlang listener process and the shell process is stuck. > >> > >> -module(strange). > >> -export([start/0, listener/0, send/1, stop/0]). > >> > >> start() -> > >> register(?MODULE, spawn(?MODULE, listener, [])). > >> > >> listener() -> > >> receive > >> {send, Data} -> > >> io:format("Received Data ~p ~n", [Data]), > >> listener(); > >> stop -> > >> io:format("Stopping listener ~n") > >> end. > >> > >> send(Data) -> > >> ?MODULE ! {send, Data}. > >> > >> stop() -> > >> ?MODULE ! stop. > >> > >> $ uname -a > >> Darwin Chaitanyas-MacBook-Pro.local 17.5.0 Darwin Kernel Version 17.5.0: Mon > >> Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64 > >> > >> $ erl > >> Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] > >> [async-threads:10] [hipe] [kernel-poll:false] [dtrace] > >> > >> Eshell V9.3 (abort with ^G) > >> 1> c(strange). > >> {ok,strange} > >> 2> {ok, Data} = file:read_file("centos.iso"). > >> {ok,<<51,237,144,144,144,144,144,144,144,144,144,144,144, > >> 144,144,144,144,144,144,144,144,144,144,144,144, > >> 144,144,...>>} > >> 3> strange:start(). > >> true > >> 4> strange:send(Data). > >> > >> BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded > >> (v)ersion (k)ill (D)b-tables (d)istribution > >> > >> The observer says - > >> <0.53.0> group:server/3 93980000 17957208520 1 erlang:integer_to_list/1 > >> > >> The Mac activity monitor shows Erlang consuming 18GB of RAM. > >> > >> Kindly, help me understand what is happening. > >> > >> /Chaitanya > >> > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-questions > >> > > > > > > > > -- > > Danil Zagoskin | z@REDACTED > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From jesper.louis.andersen@REDACTED Mon Apr 16 11:55:54 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 16 Apr 2018 09:55:54 +0000 Subject: [erlang-questions] Where to configure & start mnesia in a release? In-Reply-To: <622dcb27-4fc2-53a4-a73d-23941f21ecf9@gmail.com> References: <622dcb27-4fc2-53a4-a73d-23941f21ecf9@gmail.com> Message-ID: On Sun, Apr 15, 2018 at 1:48 PM Igor Clark wrote: > How do I set mnesia application environment variables in the release > project? (Or, maybe, how do I get the OTP application to be able to > access the release project's application environment variables?) > > [..] > Also, I realise I could be going about this the wrong way - maybe mnesia > should be configured inside the specific OTP app, even under a release? > One way of going at it, written some time ago when I wrote the GraphQL tutorial: https://shopgun.github.io/graphql-erlang-tutorial/#_plan [Quote] A common problem people run into with Mnesia is how to ?get started?. What people often resort to are solutions where an initial database is created if it doesn?t exist. These solutions are often brittle. Here, we pick another solution. A helper can create a database schema for us, with all the necessary tables. The real release *assumes* the presence of an initial database and won?t boot without one. This means the Erlang release is simpler. There is always some database from which it can boot and operate. That database might be the empty database since we are just starting out. But in particular, the release won?t concern itself with creating an initial database. Rather it will assume one is already existing. The situation is not much different than using a traditional schema-oriented database. Usually, you have to create the database first, and then populate the schema with some initial data. It is just because of Rails/Django like systems in which databases are migrate-established, we?ve started using different models. [EndQuote] Mnesia is part of your release and is started as part of your release, but its configuration is embedded within the release. This avoids the whole problem of creation-if-not-exist, which is probably not a good solution for a database schema, I think. It is convenient... until it accidentally the whole database you had. -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik.x.nord@REDACTED Mon Apr 16 15:03:33 2018 From: henrik.x.nord@REDACTED (Henrik Nord X) Date: Mon, 16 Apr 2018 13:03:33 +0000 Subject: [erlang-questions] Erlang OTP 21 release candidate Message-ID: <1523883812.5855.8.camel@ericsson.com> Hi! As you might know, the planned release date for Erlang OTP 21 is coming closer. The planned release date for OTP 21 is June 20th As usual we will do a few release candidates before that time. The first is planned May 2ond. If you tinkering with a pull request that might be of interest for the next major release of Erlang now is the time to send it! There is still time for that next big thing to make it in to the repository! /Henrik Nord Erlang OTP From erlang@REDACTED Mon Apr 16 15:54:57 2018 From: erlang@REDACTED (Joe Armstrong) Date: Mon, 16 Apr 2018 15:54:57 +0200 Subject: [erlang-questions] module reloading In-Reply-To: <20180416022438.624B5E0153@smtp.hushmail.com> References: <20180413171340.C7409E0153@smtp.hushmail.com> <20180416022438.624B5E0153@smtp.hushmail.com> Message-ID: I see :-) But why I ask do you do "l(math)" ? This loads or reloads a module - but modules are autoloaded on demand the first time the module is called, so really there is almost [1] no need to do ever do this. Cheers /Joe [1] there is actually but the use cases are rather obscure On Mon, Apr 16, 2018 at 4:24 AM, Alex Alvarez wrote: > Thanks for your reply! I can certainly understand that and appreciate the > system would be letting me know if I was trying to do that. But the issue > is that I was not trying to load any code of mine with the same module name, > I just tried reloading the same (e.g., math) module. > > Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.3 (abort with ^G) > 1> l(math). > {module,math} > 2> l(math). > {error,sticky_directory} > 3> > =ERROR REPORT==== 15-Apr-2018::22:09:00 === > Can't load module 'math' that resides in sticky dir > > As mentioned in my last email, the issue seems to be with the fact that the > module was not marked old... > > 3> code:purge(math). > false > > Now, I just thought that c:l() would load and reload any module regardless, > but that doesn't seem to be the case. > > http://erlang.org/doc/man/c.html#l-1 > http://erlang.org/doc/man/code.html#purge-1 > > Thanks, > Alex > > > > On 4/13/2018 at 4:26 PM, "Joe Armstrong" wrote: > > The module called 'math' is a pre-defined system module, and > redefining it might have > unpleasant and unpredictable consequences - so you really should not > do this unless you > know exactly what you are doing. Best is to just change the name. > > If you know what you're doing you can call unstick_dir on the > directory where math.beam was loaded from > and then you will be able to change the code - again this is not a > good idea if you don't > really understand the consequences of doing this. > > System modules are 'sticky' by default to stop you from accidentally > shooting yourself in the foot. > > If you get this warning just change the module name. > > Cheers > > /Joe > > On Fri, Apr 13, 2018 at 7:13 PM, Alex Alvarez wrote: >> Sorry if this was already asked and I missed it... While using v20.3.2, >> after I load a module... >> >> 11> l(math). >> {module,math} >> >> ...if I try to reload it again with the same command... >> >> 12> l(math). >> >> =ERROR REPORT==== 13-Apr-2018::13:09:15 === >> Can't load module 'math' that resides in sticky dir >> {error,sticky_directory} >> >> ...I get this error message. It's not particular to any module. From the >> error, there seems to be a problem with a stcky bit somewhere. Although I >> don't remember having this problem before, who knows, maybe it's just my >> install. Has anyone run into this issue recently? >> >> Thanks, >> Alex >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> From donpedrothird@REDACTED Mon Apr 16 20:05:25 2018 From: donpedrothird@REDACTED (John Doe) Date: Mon, 16 Apr 2018 21:05:25 +0300 Subject: [erlang-questions] code:load_binary - why there's module as argument In-Reply-To: References: Message-ID: Fair enough, but it would be nice to have a version without such limitation. 2018-04-16 12:05 GMT+03:00 Attila Rajmund Nohl : > 2018-04-14 21:11 GMT+02:00 John Doe : > >> Hi all, >> I wonder why code:load_binary() requires module name as one of the >> arguments? The function would fail if this name is not equal to the real >> module name from the binary, so it can deduce the correct name. Why it does >> not allow loading just whatever module from a given binary and return >> something like {ok, moduleName} as the result? >> > > ?I guess to avoid overwriting an unexpected module. The input binary can > contain any code, if it pretends to be the list module, but the caller > thinks its the strings module, that could be a problem.? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierrefenoll@REDACTED Mon Apr 16 20:57:10 2018 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Mon, 16 Apr 2018 18:57:10 +0000 Subject: [erlang-questions] code:load_binary - why there's module as argument In-Reply-To: References: Message-ID: Semantically it ensures that the atom is already in the atom table. Now I didn?t look at the code but maybe there is an assumption on this. Send a PR maybe? On Mon 16 Apr 2018 at 20:05, John Doe wrote: > Fair enough, but it would be nice to have a version without such > limitation. > > 2018-04-16 12:05 GMT+03:00 Attila Rajmund Nohl : > >> 2018-04-14 21:11 GMT+02:00 John Doe : >> >>> Hi all, >>> I wonder why code:load_binary() requires module name as one of the >>> arguments? The function would fail if this name is not equal to the real >>> module name from the binary, so it can deduce the correct name. Why it does >>> not allow loading just whatever module from a given binary and return >>> something like {ok, moduleName} as the result? >>> >> >> ?I guess to avoid overwriting an unexpected module. The input binary can >> contain any code, if it pretends to be the list module, but the caller >> thinks its the strings module, that could be a 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 > -- Cheers, -- Pierre Fenoll -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor.clark@REDACTED Tue Apr 17 00:30:32 2018 From: igor.clark@REDACTED (Igor Clark) Date: Mon, 16 Apr 2018 23:30:32 +0100 Subject: [erlang-questions] Where to configure & start mnesia in a release? In-Reply-To: References: <622dcb27-4fc2-53a4-a73d-23941f21ecf9@gmail.com> Message-ID: <4cf6ac2b-a4b1-e1b9-b7d0-e80e8b594bfa@gmail.com> Thanks Jesper, that makes sense. So people tend to use a helper (I guess an escript?) which sets up the database schema & tables and then they start the app. When you say "configuration is embedded in the release", do you mean the mnesia conf goes in the config/sys.config at the top level of the release? Does that mean that all the OTP apps included in the release have to use the same mnesia conf? Cheers, Igor On 16/04/2018 10:55, Jesper Louis Andersen wrote: > On Sun, Apr 15, 2018 at 1:48 PM Igor Clark > wrote: > > How do I set mnesia application environment variables in the release > project? (Or, maybe, how do I get the OTP application to be able to > access the release project's application environment variables?) > > > [..] > > Also, I realise I could be going about this the wrong way - maybe > mnesia > should be configured inside the specific OTP app, even under a > release? > > > One way of going at it, written some time ago when I wrote the GraphQL > tutorial: https://shopgun.github.io/graphql-erlang-tutorial/#_plan > > [Quote] > > A common problem people run into with Mnesia is how to ?get started?. > What people often resort to are solutions where an initial database is > created if it doesn?t exist. These solutions are often brittle. > > Here, we pick another solution. A helper can create a database schema > for us, with all the necessary tables. The real release /assumes/ the > presence of an initial database and won?t boot without one. This means > the Erlang release is simpler. There is always some database from > which it can boot and operate. That database might be the empty > database since we are just starting out. But in particular, the > release won?t concern itself with creating an initial database. Rather > it will assume one is already existing. > > The situation is not much different than using a traditional > schema-oriented database. Usually, you have to create the database > first, and then populate the schema with some initial data. It is just > because of Rails/Django like systems in which databases are > migrate-established, we?ve started using different models. > > [EndQuote] > > Mnesia is part of your release and is started as part of your release, > but its configuration is embedded within the release. This avoids the > whole problem of creation-if-not-exist, which is probably not a good > solution for a database schema, I think. It is convenient... until it > accidentally the whole database you had. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor.clark@REDACTED Tue Apr 17 00:30:44 2018 From: igor.clark@REDACTED (Igor Clark) Date: Mon, 16 Apr 2018 23:30:44 +0100 Subject: [erlang-questions] Where to configure & start mnesia in a release? In-Reply-To: References: <622dcb27-4fc2-53a4-a73d-23941f21ecf9@gmail.com> <4db77dfc-c2bf-12a8-7ec8-b95e79ee750e@gmail.com> <0d62cb57-dc6e-a204-2eba-efabed3fd5c1@gmail.com> Message-ID: <546f0285-47ff-fcd7-fafc-0ff1afedbc0a@gmail.com> Got it. Thanks Nuku. On 15/04/2018 22:39, Nuku Ameyibor wrote: > you are welcome iggor but i think we may be talking about two > different things > the relx section like below > > {release, {"app_release", "0.3.3"},[app_name,mnesia]}, > > would be one way to include mnesia and to have libs added as part of > the release and? ?mnesia started when your application is started . > another way which is? what i was talking about would be to add it in > the .app.src file like this > > {applications,[kernel,stdlib,mnesia ]} > > you may want mnesia to be started only when specific applications are > started not when the whole release is started . > > cheers!! > > > On Sun, Apr 15, 2018 at 9:01 PM, Igor Clark > wrote: > > Thanks very much Nuku, that's the piece of the puzzle I was > missing. I hadn't understood properly about the release packaging > - I thought that if I added mnesia into the relx config, it would > automatically start the mnesia app too, and I wanted to do that > manually in my app. But after reading your email I added it into > the relx/release section, and as you said, the mnesia package is > now included in the release, but I can still start it manually, > and the console boots correctly and accesses the mnesia data. > > Thank you! > > Best, > Igor > > > On 15/04/2018 21:01, Nuku Ameyibor wrote: >> ?mnesia is not? included as part of the release . >> when rebar3 shell command is run? the path to mnesia is added >> automatically to the code paths . >> in? a release environment however its not copied? over into the >> release libs unless specified in one of your .app.src files. >> in your app.src? file check to see if mnesia is one? of the >> applications which has to? be started before the main application >> is started. >> >> >> On Sun, Apr 15, 2018 at 3:50 PM, Igor Clark > > wrote: >> >> Thanks Nuku, >> >> - It's definitely crashing due to the mnesia configuration - >> it shows a {badmatch,undefined} error on the line where I >> call { ok, MnesiaDir } = application:get_env( mnesia, dir ), >> and I've tried io:format()'ing the result of >> application:get_env( mnesia, dir ), which shows 'undefined' >> when running as a release >> >> - relx section of rebar.config is set up exactly like that - >> I used rebar3 to generate the release >> >> - sys.config has exactly that mnesia entry >> >> It all works as expected with 'rebar3 shell', environment >> variable is found, mnesia starts, it all works fine - but >> when I run 'rebar3 release' and try to run the generated >> startup script, either with 'console' or with 'start' and >> looking in the log file, the OTP application included in the >> release gets 'undefined' from application:get_env( mnesia, dir ). >> >> From your sys.config example I realise I could say for >> example [ { my_app, [ { mnesia_dir, "/tmp/my_db_dir" } ] } ], >> and use application:get_env( my_app, mnesia_dir ) to >> initialise; this works and returns { ok, "/tmp/my_db_dir" }, >> which is great, but then ok = application:ensure_started( >> mnesia ) fails with {{badmatch, {error,{"no such file or >> directory","mnesia.app"}}}. I have no idea where mnesia.app >> should go, and I haven't been able to find any references to >> this file in docs or online that explain where it should go >> or what should be in it, except that it exists in the mnesia >> package under the OTP source tree. >> >> So still pretty unclear how to proceed, pointers welcome! >> >> Thanks, >> Igor >> >> >> On 15/04/2018 16:06, Nuku Ameyibor wrote: >>> >>> - under_build//rel//bin/ >>> console it fails (returns undefined), so the app crashes >>> on start, regardless of whether is prod or default >>> >>> it may or may not be crashing due the mnesia configuration . >>> you may have to check the the erl_crash.dump to see the >>> cause of the crash . >>> >>> >>> How do I set mnesia application environment variables in >>> the release project? (Or, maybe, how do I get the OTP >>> application to be able to access the release project's >>> application environment variables?) >>> >>> in the relx section of your rebar.config you can set a >>> sys_config to be used >>> {relx, >>> [ >>> {sys_config,"config/sys.config"} >>> ? ? ? ?] >>> in that sys.config you can setup environmental variables to >>> be used by your applications including an entry for mnesia. >>> [ >>> {mnesia, >>> [{dir,"/tmp/my_db_dir"}] >>> }, >>> {app1,[{a,1},{b,2}], >>> {app2,[{a,3},{b,4}] >>> } >>> ] >>> this will be used by your release system when the release is >>> created . >>> check out http://www.rebar3.org/docs/releases >>> ?. >>> >>> >>> >>> On Sat, Apr 14, 2018 at 3:17 PM, Igor Clark >>> > wrote: >>> >>> Hi list, >>> >>> I have an OTP application which uses mnesia. It >>> checks/ensures the schema and table files exist and then >>> calls application:ensure_started( mnesia ) in its >>> application:start/2 callback. It works fine when I run >>> the application on its own under rebar3 shell, but it >>> doesn't work when I try to run it from an OTP release: >>> >>> - When I run the OTP app under rebar3 shell in its own >>> separate directory, with { mnesia, [ { dir, >>> "/tmp/my_db_dir" } ] } in priv/sys.config, it works fine >>> and application:get_env( mnesia, dir ) returns >>> /tmp/my_db_dir as normal/expected >>> >>> - If I set { mnesia, [ { dir, "/tmp/my_db_dir" } ] } in >>> /config/sys.config, then: >>> >>> ??? - under rebar3 shell --name=myapp@REDACTED, calling >>> application:get_env( mnesia, dir ) succeeds (returns >>> /tmp/my_db_dir) , and the app uses reads/writes mnesia >>> tables successfully >>> >>> ??? - under_build//rel//bin/ >>> console it fails (returns undefined), so the app crashes >>> on start, regardless of whether is prod or default >>> >>> How do I set mnesia application environment variables in >>> the release project? (Or, maybe, how do I get the OTP >>> application to be able to access the release project's >>> application environment variables?) >>> >>> Also, I realise I could be going about this the wrong >>> way - maybe mnesia should be configured inside the >>> specific OTP app, even under a release? Apart from the >>> fact that that doesn't seem to work (as I have it set >>> up, anyway), I'm aware I should steer clear of "included >>> applications" - not least because I want to be able to >>> use the OTP app in other projects - so I guess there's a >>> broader question of how to configure mnesia in general, >>> in how & when to create schema and tables, if it could >>> be used by multiple OTP apps in a release? >>> >>> Bit puzzled, appreciate any advice! >>> >>> Cheers, >>> Igor >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >>> >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From entermosjava@REDACTED Tue Apr 17 14:35:31 2018 From: entermosjava@REDACTED (En Termos Java) Date: Tue, 17 Apr 2018 14:35:31 +0200 Subject: [erlang-questions] Description of initial shell prompt In-Reply-To: References: <20180405152952.GB10622@fourtheye.org> Message-ID: Thanks for the replies. I tried to summarize the answers a bit further to make some more sense but it wasn't as simple as I thought. I didn't find the DirtyRottenSchedulers film :) The following are attempts on character-art tables, the first one looks good in (if copied into) Notepad++ and in Emacs: |<--- Depends on distribution package --->| |<--- Set when starting the erlang node --->| |<--- or your build --->| |<--- see documentation for: erl --->| |<--- --->| |<--- http: erlang.org/doc/man/erl.html --->| | | | | | | | Symmetric | | 32 bit | | Multi- | |OTP-main- erlang or | | processing Dirty Threads in | |version runtime 64 bit | | Schedulers: CPU async | | version OS | | SchedulerOnline Schedulers thread pool | |____________________________________________| |_______________________________________________________| |"Erlang/OTP 20 [erts-9.3] [64-bit ] | | [smp:4:4] [ds:4:4:10] [async-threads:10]"| <-----Row printed in shell |____________________________________________| |_______________________________________________________| | | | +S +SDcpu +A | | | | | The second is edited in/looks (almost) good in a Chrome GMAIL window: |<--- Depends on distribution package --->| |<--- Set when starting the erlang node --->| |<--- --->| |<--- see documentation for: erl --->| |<--- --->| |<--- http:erlang.org/doc/man/erl.html --->| | | | | | | | Symmetric | | 32 bit | | Multi- | |OTP-main- erlang or | | processing Dirty Threads in | |version runtime 64 bit | | Schedulers: CPU async | | version OS | | SchedulerOnline Schedulers thread pool | |____________________________________________| |_______________________________________________________| |"Erlang/OTP 20 [erts-9.3] [64-bit ] | | [smp:4:4] [ds:4:4:10] [async-threads:10]" | <-----Row printed in shell |____________________________________________| |_______________________________________________________| | | | +S +SDcpu +A | Regards BAE Per 2018-04-16 13:47 GMT+02:00 En Termos Java : > Thanks for the replies. > I tried to summarize the answers a bit further to make some more sense but > it wasn't as simple as I thought. > I didn't find the DirtyRottenSchedulers film :) > > The following are attempts on character-art tables, > the first one looks good in (if copied into) Notepad++ and in Emacs: > > > |<--- Depends on distribution package --->| |<--- Set when starting > the erlang node --->| > |<--- or your build --->| |<--- see documentation > for: erl --->| > |<--- --->| |<--- http: > erlang.org/doc/man/erl.html --->| > | | | > | > | | | Symmetric > | > | 32 bit | | Multi- > | > |OTP-main- erlang or | | processing > Dirty Threads in | > |version runtime 64 bit | | Schedulers: CPU > async | > | version OS | | SchedulerOnline > Schedulers thread pool | > |____________________________________________| > |_______________________________________________________| > |"Erlang/OTP 20 [erts-9.3] [64-bit ] | | [smp:4:4] > [ds:4:4:10] [async-threads:10]"| <-----Row printed in shell > |____________________________________________| > |_______________________________________________________| > | | | +S > +SDcpu +A | > | | | > | > > > > The second is edited in/looks (almost) good in a Chrome GMAIL window: > > |<--- Depends on distribution package --->| |<--- > Set when starting the erlang node > --->| > |<--- > --->| |<--- see documentation for: erl > --->| > |<--- > --->| |<--- http:erlang.org/doc/man/erl.html > --->| > | > | | > | > | > | | Symmetric > | > | 32 bit > | | Multi- > | > |OTP-main- erlang or > | | processing Dirty Threads in > | > |version runtime 64 bit > | | Schedulers: CPU async > | > | version OS > | | SchedulerOnline Schedulers thread pool > | > |____________________________________________| > |_______________________________________________________| > |"Erlang/OTP 20 [erts-9.3] [64-bit ] | > | [smp:4:4] [ds:4:4:10] [async-threads:10]" > | <-----Row printed in shell > |____________________________________________| > |_______________________________________________________| > | > | | +S +SDcpu > +A | > > > > > Regards BAE Per > > > > > > > > 2018-04-05 17:29 GMT+02:00 Robert Wilkinson : > >> On Thu, Apr 05, 2018 at 09:43:33AM -0400, Steve Vinoski wrote: >> > ds:DirtyCPUSchedulers:DirtyCPUSchedulersOnline:DirtyIOSchedulers >> >> If there were DirtyRottenSchedulers, they would make a film about >> it? >> >> Sorry :-) >> >> > --steve >> >> Bob >> -- >> The difference between a good haircut and a bad one is seven days. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth@REDACTED Tue Apr 17 18:01:09 2018 From: kenneth@REDACTED (Kenneth Lundin) Date: Tue, 17 Apr 2018 18:01:09 +0200 Subject: [erlang-questions] Celebrating 20 years as Open Source with a new blog! Message-ID: This year it is 20 years since Erlang/OTP was released as Open Source and we thought it was a good idea to celebrate with a new blog from the OTP team. Check out http://blog.erlang.org /Regards Kenneth, Erlang/OTP Ericsson -------------- next part -------------- An HTML attachment was scrubbed... URL: From list1@REDACTED Tue Apr 17 21:43:22 2018 From: list1@REDACTED (Grzegorz Junka) Date: Tue, 17 Apr 2018 19:43:22 +0000 Subject: [erlang-questions] Celebrating 20 years as Open Source with a new blog! In-Reply-To: References: Message-ID: On 17/04/2018 16:01, Kenneth Lundin wrote: > This year it is 20 years since Erlang/OTP was released as Open Source and > we thought it was a good idea to celebrate with a new blog from the > OTP team. > > Check out http://blog.erlang.org > > /Regards Kenneth, Erlang/OTP Ericsson > Thank you Kenneth for sharing the link. I think it's a very cool idea. Interesting reading about the new pooling. Please keep posting! GrzegorzJ From alex@REDACTED Wed Apr 18 00:18:25 2018 From: alex@REDACTED (Alex Alvarez) Date: Tue, 17 Apr 2018 18:18:25 -0400 Subject: [erlang-questions] module reloading In-Reply-To: References: <20180413171340.C7409E0153@smtp.hushmail.com> <20180416022438.624B5E0153@smtp.hushmail.com> Message-ID: <20180417221825.CB328E0153@smtp.hushmail.com> Thanks Joe! LOL!!! Might sound silly, but it's very useful to be able to load/reload modules manually. At the very least, it'd be great to at least get something like {error, module_loaded}, instead of the current "error report" message Ok, so, why don't I just enter a : and allow the module to autoload. That's great for source code, but not that great in the command line. The problem is that I, as I suppose most folks, don't know the function names (or even a function name) in every module, which is why I tend to manually load them when I'm in Erlang's REPL. As we know, once a module is loaded, you can type the module name, press the key and get a list of the function names + arity. This is very powerful. If you don't know the exact name of a function, but do know the name of a few modules where it might be, you can try loading them, pressing and see if you can find it before having to consult the documentation. Thanks, Alex On 4/16/2018 at 9:55 AM, "Joe Armstrong" wrote:I see :-) But why I ask do you do "l(math)" ? This loads or reloads a module - but modules are autoloaded on demand the first time the module is called, so really there is almost [1] no need to do ever do this. Cheers /Joe [1] there is actually but the use cases are rather obscure On Mon, Apr 16, 2018 at 4:24 AM, Alex Alvarez wrote: > Thanks for your reply! I can certainly understand that and appreciate the > system would be letting me know if I was trying to do that. But the issue > is that I was not trying to load any code of mine with the same module name, > I just tried reloading the same (e.g., math) module. > > Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.3 (abort with ^G) > 1> l(math). > {module,math} > 2> l(math). > {error,sticky_directory} > 3> > =ERROR REPORT==== 15-Apr-2018::22:09:00 === > Can't load module 'math' that resides in sticky dir > > As mentioned in my last email, the issue seems to be with the fact that the > module was not marked old... > > 3> code:purge(math). > false > > Now, I just thought that c:l() would load and reload any module regardless, > but that doesn't seem to be the case. > > http://erlang.org/doc/man/c.html#l-1 > http://erlang.org/doc/man/code.html#purge-1 > > Thanks, > Alex > > > > On 4/13/2018 at 4:26 PM, "Joe Armstrong" wrote: > > The module called 'math' is a pre-defined system module, and > redefining it might have > unpleasant and unpredictable consequences - so you really should not > do this unless you > know exactly what you are doing. Best is to just change the name. > > If you know what you're doing you can call unstick_dir on the > directory where math.beam was loaded from > and then you will be able to change the code - again this is not a > good idea if you don't > really understand the consequences of doing this. > > System modules are 'sticky' by default to stop you from accidentally > shooting yourself in the foot. > > If you get this warning just change the module name. > > Cheers > > /Joe > > On Fri, Apr 13, 2018 at 7:13 PM, Alex Alvarez wrote: >> Sorry if this was already asked and I missed it... While using v20.3.2, >> after I load a module... >> >> 11> l(math). >> {module,math} >> >> ...if I try to reload it again with the same command... >> >> 12> l(math). >> >> =ERROR REPORT==== 13-Apr-2018::13:09:15 === >> Can't load module 'math' that resides in sticky dir >> {error,sticky_directory} >> >> ...I get this error message. It's not particular to any module. >From the >> error, there seems to be a problem with a stcky bit somewhere. Although I >> don't remember having this problem before, who knows, maybe it's just my >> install. Has anyone run into this issue recently? >> >> Thanks, >> Alex >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex@REDACTED Wed Apr 18 00:30:11 2018 From: alex@REDACTED (Alex Alvarez) Date: Tue, 17 Apr 2018 18:30:11 -0400 Subject: [erlang-questions] Celebrating 20 years as Open Source with a new blog! In-Reply-To: References: Message-ID: <20180417223011.947C2E0153@smtp.hushmail.com> Great idea and very nice post! Thanks, Alex On 4/17/2018 at 3:43 PM, "Grzegorz Junka" wrote:On 17/04/2018 16:01, Kenneth Lundin wrote: > This year it is 20 years since Erlang/OTP was released as Open Source and > we thought it was a good idea to celebrate with a new blog from the > OTP team. > > Check out http://blog.erlang.org > > /Regards Kenneth, Erlang/OTP Ericsson > Thank you Kenneth for sharing the link. I think it's a very cool idea. Interesting reading about the new pooling. Please keep posting! GrzegorzJ _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From bombadil@REDACTED Wed Apr 18 00:44:21 2018 From: bombadil@REDACTED (Manuel A. Rubio) Date: Wed, 18 Apr 2018 00:44:21 +0200 Subject: [erlang-questions] binary_to_float changes between OTP 19 and OTP 20 Message-ID: Hello, I was trying this code: float_to_binary(2.7182818284590452354, [{decimals, 14}, compact]). And I've realized that in OTP 19.3 I have this value: <<"2.71828182845905">> While in OTP 20.3 I've this other value: <<"2.71828182845904">> Even I was checking since OTP 17 until OTP 20.3 and looks like the change was in OTP 20.3 only. Why this change? Was it not correct in the previous versions or is it not correct now? Thanks. Manuel Rubio. From g@REDACTED Wed Apr 18 00:55:06 2018 From: g@REDACTED (Guilherme Andrade) Date: Tue, 17 Apr 2018 23:55:06 +0100 Subject: [erlang-questions] binary_to_float changes between OTP 19 and OTP 20 In-Reply-To: References: Message-ID: On 17 April 2018 at 23:44, Manuel A. Rubio wrote: > Even I was checking since OTP 17 until OTP 20.3 and looks like the change > was in OTP 20.3 only. Why this change? Was it not correct in the previous > versions or is it not correct now? > Perhaps this is a consequence of PR #1684[1]. [1]: https://github.com/erlang/otp/pull/1684 > > Thanks. > Manuel Rubio. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidnwelton@REDACTED Wed Apr 18 01:46:03 2018 From: davidnwelton@REDACTED (David Welton) Date: Tue, 17 Apr 2018 16:46:03 -0700 Subject: [erlang-questions] C nodes and message sending slowness Message-ID: Hi, I've been looking at the system I'm working on to see how things will look if the C node is down: timer:tc(fun() -> {any, 'cnode@REDACTED'} ! {level, 50} end). It takes something like 7 seconds! This shouldn't happen often, but it'd be nice if it didn't gum everything up. I guess it's easy enough to wrap that in a spawn, but it just seemed a bit odd. Thanks -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From elbrujohalcon@REDACTED Wed Apr 18 03:27:02 2018 From: elbrujohalcon@REDACTED (Fernando Benavides) Date: Wed, 18 Apr 2018 01:27:02 +0000 Subject: [erlang-questions] module reloading In-Reply-To: <20180417221825.CB328E0153@smtp.hushmail.com> References: <20180413171340.C7409E0153@smtp.hushmail.com> <20180416022438.624B5E0153@smtp.hushmail.com> <20180417221825.CB328E0153@smtp.hushmail.com> Message-ID: Well... You might not realize but you do know _a_ function: your_module:module_info/0 always exists, for every module ;) Also... Just trying to evaluate _any_ function, loads the module. That's why instead of loading modules manually, when in the shell, I tend to write the module name and :, press tab, if nothing pops up, I type x(). and press enter. Either the module loads and I have autocomplete next time I press tab, or I can't load the module. I bet one day I'll find a module that defines x/0 and I will be in trouble... On Tue, 17 Apr 2018 at 19:18 Alex Alvarez wrote: > Thanks Joe! LOL!!! Might sound silly, but it's very useful to be able to > load/reload modules manually. At the very least, it'd be great to at least > get something like {error, module_loaded}, instead of the current "error > report" message > > Ok, so, why don't I just enter a : and allow > the module to autoload. That's great for source code, but not that great > in the command line. The problem is that I, as I suppose most folks, don't > know the function names (or even a function name) in every module, which is > why I tend to manually load them when I'm in Erlang's REPL. As we know, > once a module is loaded, you can type the module name, press the key > and get a list of the function names + arity. This is very powerful. If > you don't know the exact name of a function, but do know the name of a few > modules where it might be, you can try loading them, pressing and see > if you can find it before having to consult the documentation. > > Thanks, > Alex > > > On 4/16/2018 at 9:55 AM, "Joe Armstrong" wrote: > > I see :-) > > But why I ask do you do "l(math)" ? > > This loads or reloads a module - but modules are autoloaded on demand > the first time the module > is called, so really there is almost [1] no need to do ever do this. > > Cheers > > /Joe > > [1] there is actually but the use cases are rather obscure > > > > > On Mon, Apr 16, 2018 at 4:24 AM, Alex Alvarez wrote: > > Thanks for your reply! I can certainly understand that and appreciate the > > system would be letting me know if I was trying to do that. But the issue > > is that I was not trying to load any code of mine with the same module > name, > > I just tried reloading the same (e.g., math) module. > > > > Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] > > [async-threads:10] [hipe] [kernel-poll:false] > > > > Eshell V9.3 (abort with ^G) > > 1> l(math). > > {module,math} > > 2> l(math). > > {error,sticky_directory} > > 3> > > =ERROR REPORT==== 15-Apr-2018::22:09:00 === > > Can't load module 'math' that resides in sticky dir > > > > As mentioned in my last email, the issue seems to be with the fact that > the > > module was not marked old... > > > > 3> code:purge(math). > > false > > > > Now, I just thought that c:l() would load and reload any module > regardless, > > but that doesn't seem to be the case. > > > > http://erlang.org/doc/man/c.html#l-1 > > http://erlang.org/doc/man/code.html#purge-1 > > > > Thanks, > > Alex > > > > > > > > On 4/13/2018 at 4:26 PM, "Joe Armstrong" wrote: > > > > The module called 'math' is a pre-defined system module, and > > redefining it might have > > unpleasant and unpredictable consequences - so you really should not > > do this unless you > > know exactly what you are doing. Best is to just change the name. > > > > If you know what you're doing you can call unstick_dir on the > > directory where math.beam was loaded from > > and then you will be able to change the code - again this is not a > > good idea if you don't > > really understand the consequences of doing this. > > > > System modules are 'sticky' by default to stop you from accidentally > > shooting yourself in the foot. > > > > If you get this warning just change the module name. > > > > Cheers > > > > /Joe > > > > On Fri, Apr 13, 2018 at 7:13 PM, Alex Alvarez wrote: > >> Sorry if this was already asked and I missed it... While using v20.3.2, > >> after I load a module... > >> > >> 11> l(math). > >> {module,math} > >> > >> ...if I try to reload it again with the same command... > >> > >> 12> l(math). > >> > >> =ERROR REPORT==== 13-Apr-2018::13:09:15 === > >> Can't load module 'math' that resides in sticky dir > >> {error,sticky_directory} > >> > >> ...I get this error message. It's not particular to any module. From the > >> error, there seems to be a problem with a stcky bit somewhere. Although > I > >> don't remember having this problem before, who knows, maybe it's just my > >> install. Has anyone run into this issue recently? > >> > >> Thanks, > >> Alex > >> > >> _______________________________________________ > >> 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 > -- elbrujohalcon @ iPhone -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex@REDACTED Wed Apr 18 07:39:07 2018 From: alex@REDACTED (Alex Alvarez) Date: Wed, 18 Apr 2018 01:39:07 -0400 Subject: [erlang-questions] module reloading In-Reply-To: References: <20180413171340.C7409E0153@smtp.hushmail.com> <20180416022438.624B5E0153@smtp.hushmail.com> <20180417221825.CB328E0153@smtp.hushmail.com> Message-ID: <20180418053908.1E4E5E0154@smtp.hushmail.com> Thanks for your response! I did find interesting the :() trick. Didn't know about it! Thanks, Alex On 4/17/2018 at 9:27 PM, "Fernando Benavides" wrote:Well... You might not realize but you do know _a_ function: your_module:module_info/0 always exists, for every module ;) Also... Just trying to evaluate _any_ function, loads the module. That's why instead of loading modules manually, when in the shell, I tend to write the module name and :, press tab, if nothing pops up, I type x(). and press enter. Either the module loads and I have autocomplete next time I press tab, or I can't load the module. I bet one day I'll find a module that defines x/0 and I will be in trouble... On Tue, 17 Apr 2018 at 19:18 Alex Alvarez wrote: Thanks Joe! LOL!!! Might sound silly, but it's very useful to be able to load/reload modules manually. At the very least, it'd be great to at least get something like {error, module_loaded}, instead of the current "error report" message Ok, so, why don't I just enter a : and allow the module to autoload. That's great for source code, but not that great in the command line. The problem is that I, as I suppose most folks, don't know the function names (or even a function name) in every module, which is why I tend to manually load them when I'm in Erlang's REPL. As we know, once a module is loaded, you can type the module name, press the key and get a list of the function names + arity. This is very powerful. If you don't know the exact name of a function, but do know the name of a few modules where it might be, you can try loading them, pressing and see if you can find it before having to consult the documentation. Thanks, Alex On 4/16/2018 at 9:55 AM, "Joe Armstrong" wrote:I see :-) But why I ask do you do "l(math)" ? This loads or reloads a module - but modules are autoloaded on demand the first time the module is called, so really there is almost [1] no need to do ever do this. Cheers /Joe [1] there is actually but the use cases are rather obscure On Mon, Apr 16, 2018 at 4:24 AM, Alex Alvarez wrote: > Thanks for your reply! I can certainly understand that and appreciate the > system would be letting me know if I was trying to do that. But the issue > is that I was not trying to load any code of mine with the same module name, > I just tried reloading the same (e.g., math) module. > > Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.3 (abort with ^G) > 1> l(math). > {module,math} > 2> l(math). > {error,sticky_directory} > 3> > =ERROR REPORT==== 15-Apr-2018::22:09:00 === > Can't load module 'math' that resides in sticky dir > > As mentioned in my last email, the issue seems to be with the fact that the > module was not marked old... > > 3> code:purge(math). > false > > Now, I just thought that c:l() would load and reload any module regardless, > but that doesn't seem to be the case. > > http://erlang.org/doc/man/c.html#l-1 > http://erlang.org/doc/man/code.html#purge-1 > > Thanks, > Alex > > > > On 4/13/2018 at 4:26 PM, "Joe Armstrong" wrote: > > The module called 'math' is a pre-defined system module, and > redefining it might have > unpleasant and unpredictable consequences - so you really should not > do this unless you > know exactly what you are doing. Best is to just change the name. > > If you know what you're doing you can call unstick_dir on the > directory where math.beam was loaded from > and then you will be able to change the code - again this is not a > good idea if you don't > really understand the consequences of doing this. > > System modules are 'sticky' by default to stop you from accidentally > shooting yourself in the foot. > > If you get this warning just change the module name. > > Cheers > > /Joe > > On Fri, Apr 13, 2018 at 7:13 PM, Alex Alvarez wrote: >> Sorry if this was already asked and I missed it... While using v20.3.2, >> after I load a module... >> >> 11> l(math). >> {module,math} >> >> ...if I try to reload it again with the same command... >> >> 12> l(math). >> >> =ERROR REPORT==== 13-Apr-2018::13:09:15 === >> Can't load module 'math' that resides in sticky dir >> {error,sticky_directory} >> >> ...I get this error message. It's not particular to any module. >From the >> error, there seems to be a problem with a stcky bit somewhere. Although I >> don't remember having this problem before, who knows, maybe it's just my >> install. Has anyone run into this issue recently? >> >> Thanks, >> Alex >> >> _______________________________________________ >> 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 -- elbrujohalcon @ iPhone -------------- next part -------------- An HTML attachment was scrubbed... URL: From per@REDACTED Wed Apr 18 08:05:46 2018 From: per@REDACTED (Per Hedeland) Date: Wed, 18 Apr 2018 08:05:46 +0200 Subject: [erlang-questions] module reloading In-Reply-To: References: <20180413171340.C7409E0153@smtp.hushmail.com> <20180416022438.624B5E0153@smtp.hushmail.com> <20180417221825.CB328E0153@smtp.hushmail.com> Message-ID: <462dc8d6-d2ac-5ae9-83cb-904ef7ad0199@hedeland.org> On 2018-04-18 03:27, Fernando Benavides wrote: > > Also... Just trying to evaluate _any_ function, loads the module. That's why instead of loading modules manually, when in the shell, I tend to write the module name and :, press tab, if nothing pops > up, I type x(). and press enter. I tend to do the same, even down to the "arbitrary function name", but it *is* rather quirky, and there is a hint for an obvious and probably straightforward-to-implement (I haven't looked at the relevant code) enhancement in your description: why not have the sequence : do a code:ensure_loaded() before it (tries to) look up the function list? > I bet one day I'll find a module that defines x/0 and I will be in trouble... That too.:-) --Per Hedeland From per@REDACTED Wed Apr 18 08:28:33 2018 From: per@REDACTED (Per Hedeland) Date: Wed, 18 Apr 2018 08:28:33 +0200 Subject: [erlang-questions] module reloading In-Reply-To: <462dc8d6-d2ac-5ae9-83cb-904ef7ad0199@hedeland.org> References: <20180413171340.C7409E0153@smtp.hushmail.com> <20180416022438.624B5E0153@smtp.hushmail.com> <20180417221825.CB328E0153@smtp.hushmail.com> <462dc8d6-d2ac-5ae9-83cb-904ef7ad0199@hedeland.org> Message-ID: On 2018-04-18 08:05, Per Hedeland wrote: > On 2018-04-18 03:27, Fernando Benavides wrote: >> >> Also... Just trying to evaluate _any_ function, loads the module. That's why instead of loading modules manually, when in the shell, I tend to write the module name and :, press tab, if nothing pops >> up, I type x(). and press enter. > > I tend to do the same, even down to the "arbitrary function name", but > it *is* rather quirky, and there is a hint for an obvious and probably > straightforward-to-implement (I haven't looked at the relevant code) > enhancement in your description: why not have the sequence : > do a code:ensure_loaded() before it (tries to) look up the > function list? OK, so I looked at the code, and the change (see below) is so trivial that there is probably a good reason it doesn't already do that - I don't know what that reason might be though... --Per diff --git a/lib/stdlib/src/edlin_expand.erl b/lib/stdlib/src/edlin_expand.erl index bdcefda..4b3e0cc 100644 --- a/lib/stdlib/src/edlin_expand.erl +++ b/lib/stdlib/src/edlin_expand.erl @@ -49,8 +49,8 @@ expand_module_name(Prefix) -> expand_function_name(ModStr, FuncPrefix) -> case to_atom(ModStr) of {ok, Mod} -> - case erlang:module_loaded(Mod) of - true -> + case code:ensure_loaded(Mod) of + {module, Mod} -> L = Mod:module_info(), case lists:keyfind(exports, 1, L) of {_, Exports} -> @@ -58,7 +58,7 @@ expand_function_name(ModStr, FuncPrefix) -> _ -> {no, [], []} end; - false -> + {error, _What} -> {no, [], []} end; error -> From arif@REDACTED Wed Apr 18 12:06:30 2018 From: arif@REDACTED (arif@REDACTED) Date: Wed, 18 Apr 2018 03:06:30 -0700 Subject: [erlang-questions] GUI development with Erlang Message-ID: <40c9672decf0aaa382eeba0f6c5c4d08@riseup.net> To answer a colleague, no, you don't _have_ to run the arbiter and the player processes on different hosts. To go through the examples, you can run them all on a single node, as long as it is a distributed node. Of course the fun in atually playing a game is lost if the two players are sitting on the same host :) Best regards Arif Date: Sun, 15 Apr 2018 13:02:44 -0700 From: arif@REDACTED To: Alan Gingras Cc: 'Leo Liu' , erlang-questions@REDACTED Subject: Re: [erlang-questions] GUI development with Erlang Message-ID: <9d1ff54235e9bdfc4fd0bf7e7b8246ee@REDACTED> Content-Type: text/plain; charset=US-ASCII Hi, I have written a follow up to the getting started piece. It may not be enough to write your chart widgets, but I hope it gives you some more insights into the workings of wxErlang. https://arifishaq.files.wordpress.com/2018/04/wxerlang-speeding-up.pdf Best regards Arif From attila.r.nohl@REDACTED Wed Apr 18 13:19:25 2018 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Wed, 18 Apr 2018 13:19:25 +0200 Subject: [erlang-questions] Fwd: module reloading In-Reply-To: References: <20180413171340.C7409E0153@smtp.hushmail.com> <20180416022438.624B5E0153@smtp.hushmail.com> <20180417221825.CB328E0153@smtp.hushmail.com> <462dc8d6-d2ac-5ae9-83cb-904ef7ad0199@hedeland.org> Message-ID: 2018-04-18 8:28 GMT+02:00 Per Hedeland : [...] > > OK, so I looked at the code, and the change (see below) is so trivial > that there is probably a good reason it doesn't already do that - I > don't know what that reason might be though... > ?If someone accidentally mistypes a module name (to an other, existing module name), it might be unwise to load that different module?. Especially that the different module might have some code that executes at load time... -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Wed Apr 18 13:25:56 2018 From: erlang@REDACTED (Joe Armstrong) Date: Wed, 18 Apr 2018 13:25:56 +0200 Subject: [erlang-questions] module reloading In-Reply-To: <20180417221825.CB328E0153@smtp.hushmail.com> References: <20180413171340.C7409E0153@smtp.hushmail.com> <20180416022438.624B5E0153@smtp.hushmail.com> <20180417221825.CB328E0153@smtp.hushmail.com> Message-ID: On Wed, Apr 18, 2018 at 12:18 AM, Alex Alvarez wrote: > Thanks Joe! LOL!!! Might sound silly, but it's very useful to be able to > load/reload modules manually. At the very least, it'd be great to at least > get something like {error, module_loaded}, instead of the current "error > report" message > > Ok, so, why don't I just enter a : and allow the > module to autoload. That's great for source code, but not that great in the > command line. The problem is that I, as I suppose most folks, don't know > the function names (or even a function name) in every module, which is why I > tend to manually load them when I'm in Erlang's REPL. I have the same problem - so I say > m('modname'). Which autoloads the module if it's not loaded and prints a list of the functions in the module. After this expansion works. This has non of the problems you've see with load :-) /Joe > As we know, once a > module is loaded, you can type the module name, press the key and get > a list of the function names + arity. This is very powerful. If you don't > know the exact name of a function, but do know the name of a few modules > where it might be, you can try loading them, pressing and see if you > can find it before having to consult the documentation. > > Thanks, > Alex > > > > On 4/16/2018 at 9:55 AM, "Joe Armstrong" wrote: > > I see :-) > > But why I ask do you do "l(math)" ? > > This loads or reloads a module - but modules are autoloaded on demand > the first time the module > is called, so really there is almost [1] no need to do ever do this. > > Cheers > > /Joe > > [1] there is actually but the use cases are rather obscure > > > > > On Mon, Apr 16, 2018 at 4:24 AM, Alex Alvarez wrote: >> Thanks for your reply! I can certainly understand that and appreciate the >> system would be letting me know if I was trying to do that. But the issue >> is that I was not trying to load any code of mine with the same module >> name, >> I just tried reloading the same (e.g., math) module. >> >> Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] >> [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V9.3 (abort with ^G) >> 1> l(math). >> {module,math} >> 2> l(math). >> {error,sticky_directory} >> 3> >> =ERROR REPORT==== 15-Apr-2018::22:09:00 === >> Can't load module 'math' that resides in sticky dir >> >> As mentioned in my last email, the issue seems to be with the fact that >> the >> module was not marked old... >> >> 3> code:purge(math). >> false >> >> Now, I just thought that c:l() would load and reload any module >> regardless, >> but that doesn't seem to be the case. >> >> http://erlang.org/doc/man/c.html#l-1 >> http://erlang.org/doc/man/code.html#purge-1 >> >> Thanks, >> Alex >> >> >> >> On 4/13/2018 at 4:26 PM, "Joe Armstrong" wrote: >> >> The module called 'math' is a pre-defined system module, and >> redefining it might have >> unpleasant and unpredictable consequences - so you really should not >> do this unless you >> know exactly what you are doing. Best is to just change the name. >> >> If you know what you're doing you can call unstick_dir on the >> directory where math.beam was loaded from >> and then you will be able to change the code - again this is not a >> good idea if you don't >> really understand the consequences of doing this. >> >> System modules are 'sticky' by default to stop you from accidentally >> shooting yourself in the foot. >> >> If you get this warning just change the module name. >> >> Cheers >> >> /Joe >> >> On Fri, Apr 13, 2018 at 7:13 PM, Alex Alvarez wrote: >>> Sorry if this was already asked and I missed it... While using v20.3.2, >>> after I load a module... >>> >>> 11> l(math). >>> {module,math} >>> >>> ...if I try to reload it again with the same command... >>> >>> 12> l(math). >>> >>> =ERROR REPORT==== 13-Apr-2018::13:09:15 === >>> Can't load module 'math' that resides in sticky dir >>> {error,sticky_directory} >>> >>> ...I get this error message. It's not particular to any module. From the >>> error, there seems to be a problem with a stcky bit somewhere. Although I >>> don't remember having this problem before, who knows, maybe it's just my >>> install. Has anyone run into this issue recently? >>> >>> Thanks, >>> Alex >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From lukas@REDACTED Wed Apr 18 13:26:48 2018 From: lukas@REDACTED (Lukas Larsson) Date: Wed, 18 Apr 2018 13:26:48 +0200 Subject: [erlang-questions] C nodes and message sending slowness In-Reply-To: References: Message-ID: Hello, On Wed, Apr 18, 2018 at 1:46 AM, David Welton wrote: > Hi, > > I've been looking at the system I'm working on to see how things will > look if the C node is down: > > timer:tc(fun() -> {any, 'cnode@REDACTED'} ! {level, 50} end). > > It takes something like 7 seconds! This shouldn't happen often, but > it'd be nice if it didn't gum everything up. I guess it's easy enough > to wrap that in a spawn, but it just seemed a bit odd. > This behavior has been fixed in the upcoming OTP-21 release so that operations to unconnected remote nodes no longer block until the connection has been established. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Wed Apr 18 13:28:26 2018 From: erlang@REDACTED (Joe Armstrong) Date: Wed, 18 Apr 2018 13:28:26 +0200 Subject: [erlang-questions] module reloading In-Reply-To: References: <20180413171340.C7409E0153@smtp.hushmail.com> <20180416022438.624B5E0153@smtp.hushmail.com> <20180417221825.CB328E0153@smtp.hushmail.com> <462dc8d6-d2ac-5ae9-83cb-904ef7ad0199@hedeland.org> Message-ID: You're on the sticky slope to DWIM :-) /Joe On Wed, Apr 18, 2018 at 8:28 AM, Per Hedeland wrote: > On 2018-04-18 08:05, Per Hedeland wrote: >> >> On 2018-04-18 03:27, Fernando Benavides wrote: >>> >>> >>> Also... Just trying to evaluate _any_ function, loads the module. That's >>> why instead of loading modules manually, when in the shell, I tend to write >>> the module name and :, press tab, if nothing pops up, I type x(). and press >>> enter. >> >> >> I tend to do the same, even down to the "arbitrary function name", but >> it *is* rather quirky, and there is a hint for an obvious and probably >> straightforward-to-implement (I haven't looked at the relevant code) >> enhancement in your description: why not have the sequence : >> do a code:ensure_loaded() before it (tries to) look up the >> function list? > > > OK, so I looked at the code, and the change (see below) is so trivial > that there is probably a good reason it doesn't already do that - I > don't know what that reason might be though... > > --Per > > diff --git a/lib/stdlib/src/edlin_expand.erl > b/lib/stdlib/src/edlin_expand.erl > index bdcefda..4b3e0cc 100644 > --- a/lib/stdlib/src/edlin_expand.erl > +++ b/lib/stdlib/src/edlin_expand.erl > @@ -49,8 +49,8 @@ expand_module_name(Prefix) -> > expand_function_name(ModStr, FuncPrefix) -> > case to_atom(ModStr) of > {ok, Mod} -> > - case erlang:module_loaded(Mod) of > - true -> > + case code:ensure_loaded(Mod) of > + {module, Mod} -> > L = Mod:module_info(), > case lists:keyfind(exports, 1, L) of > {_, Exports} -> > @@ -58,7 +58,7 @@ expand_function_name(ModStr, FuncPrefix) -> > _ -> > {no, [], []} > end; > - false -> > + {error, _What} -> > {no, [], []} > end; > error -> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From sverker.eriksson@REDACTED Wed Apr 18 13:29:44 2018 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Wed, 18 Apr 2018 11:29:44 +0000 Subject: [erlang-questions] C nodes and message sending slowness In-Reply-To: References: Message-ID: <1524050984.31580.10.camel@ericsson.com> In OTP-21 node distribution auto-connect will be truly asynchronous, which means your example will complete in microseconds. You can test it out on master branch. /Sverker, Erlang/OTP On tis, 2018-04-17 at 16:46 -0700, David Welton wrote: > Hi, > > I've been looking at the system I'm working on to see how things will > look if the C node is down: > > timer:tc(fun() -> {any, 'cnode@REDACTED'}??! {level, 50} end). > > It takes something like 7 seconds!??This shouldn't happen often, but > it'd be nice if it didn't gum everything up.??I guess it's easy > enough > to wrap that in a spawn, but it just seemed a bit odd. > > Thanks From erlang@REDACTED Wed Apr 18 13:33:57 2018 From: erlang@REDACTED (Joe Armstrong) Date: Wed, 18 Apr 2018 13:33:57 +0200 Subject: [erlang-questions] GUI development with Erlang In-Reply-To: <9d1ff54235e9bdfc4fd0bf7e7b8246ee@riseup.net> References: <3589a8eb738ed5801027fac6ec225bcf@riseup.net> <000501d370ea$cde23ad0$69a6b070$@comcast.net> <000201d380cb$54724e10$fd56ea30$@comcast.net> <9d1ff54235e9bdfc4fd0bf7e7b8246ee@riseup.net> Message-ID: Excellent - thanks a lot .Joe On Sun, Apr 15, 2018 at 10:02 PM, wrote: > Hi, > > I have written a follow up to the getting started piece. > > It may not be enough to write your chart widgets, but I hope it gives > you some more insights into the workings of wxErlang. > > https://arifishaq.files.wordpress.com/2018/04/wxerlang-speeding-up.pdf > > Best regards > Arif > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From per@REDACTED Wed Apr 18 13:35:50 2018 From: per@REDACTED (Per Hedeland) Date: Wed, 18 Apr 2018 13:35:50 +0200 Subject: [erlang-questions] module reloading In-Reply-To: References: <20180413171340.C7409E0153@smtp.hushmail.com> <20180416022438.624B5E0153@smtp.hushmail.com> <20180417221825.CB328E0153@smtp.hushmail.com> <462dc8d6-d2ac-5ae9-83cb-904ef7ad0199@hedeland.org> Message-ID: <32bc3dba-fe86-e96c-9619-545d6be942c9@hedeland.org> On 2018-04-18 13:19, Attila Rajmund Nohl wrote: > 2018-04-18 8:28 GMT+02:00 Per Hedeland >: > [...] > > > OK, so I looked at the code, and the change (see below) is so trivial > that there is probably a good reason it doesn't already do that - I > don't know what that reason might be though... > > > If someone accidentally mistypes a module name (to an other, existing module name), it might be unwise to load that different module . Especially that the different module might have some code that > executes at load time... Well, yes, but there's lots of damage you can do by accidental mistyping... And if you want to be able to get function-name completion *at all* for a not-yet-loaded module, you will *have* to type its name, hopefully correctly. See also the workaround for the lack of auto-loading on completion-request that Fernando described earlier - I suspect we're not alone in using it, and it's actually worse than accidentally just loading the wrong module, since it also attempts to call a function in the module... --Per From davidnwelton@REDACTED Wed Apr 18 21:10:20 2018 From: davidnwelton@REDACTED (David Welton) Date: Wed, 18 Apr 2018 12:10:20 -0700 Subject: [erlang-questions] C nodes and message sending slowness In-Reply-To: <1524050984.31580.10.camel@ericsson.com> References: <1524050984.31580.10.camel@ericsson.com> Message-ID: > In OTP-21 node distribution auto-connect will be truly asynchronous, > which means your example will complete in microseconds. Not a possibility for the system I'm working on, but I'm glad I wasn't just imagining things. spawn() works fine as a workaround. Fred Hebert also mentioned that it's possible to add a 'noconnect' option to send, but that would require handling the connectivity elsewhere. That may be an option for future work on this system. Thanks! -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From donpedrothird@REDACTED Wed Apr 18 23:57:19 2018 From: donpedrothird@REDACTED (John Doe) Date: Thu, 19 Apr 2018 00:57:19 +0300 Subject: [erlang-questions] replace bug or error in the documentation Message-ID: According to the docs re:replace returns iodata | list | binary But sometimes with I think invalid unicode (see below) it returns {error, binary(), binary()} - the same error which would return unicode:characters_to_list(Binary, utf8). I would say that it is an error in the docs, but it happens only when the Search parameter is a compiled regexp. With regexp as string it returns binary. So I think it is a bug. 1> S = <<"fml.?lm vcrd rd hb kh ouniun">>. <<"fml.?lm vcrd rd hb kh ouniun">> 2> {ok, Re} = re:compile(<<>>, [unicode, caseless]). {ok,{re_pattern,0,1,0, <<69,82,67,80,71,0,0,0,1,8,0,0,1,0,0,0,255,255,255,255, 255,255,...>>}} 3> re:replace(S, Re, <<>>, [global, {return, binary}]). {error,<<"fml.">>,<<"?lm vcrd rd hb kh ouniun">>} 4> re:replace(S, <<>>, <<>>, [global, {return, binary}]). <<"fml.?lm vcrd rd hb kh ouniun">> -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Thu Apr 19 02:05:37 2018 From: g@REDACTED (Guilherme Andrade) Date: Thu, 19 Apr 2018 01:05:37 +0100 Subject: [erlang-questions] replace bug or error in the documentation In-Reply-To: References: Message-ID: On 18 April 2018 at 22:57, John Doe wrote: > > S = <<"fml.?lm vcrd rd hb kh ouniun">>. > It seems to work properly when one declares the proper encoding of the string literal, e.g.: <<"fml.?lm vcrd rd hb kh ouniun"/utf8>> In any case, the error is reproducible with the non-compiled regex if you pass 'unicode' option when calling :replace. re:replace(S, <<>>, <<>>, [unicode, global, {return, binary}]) That is: the non-compiled call wasn't interpreting the input as UTF8. Which is why it worked. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex@REDACTED Thu Apr 19 04:55:27 2018 From: alex@REDACTED (Alex Alvarez) Date: Wed, 18 Apr 2018 22:55:27 -0400 Subject: [erlang-questions] module reloading In-Reply-To: References: <20180413171340.C7409E0153@smtp.hushmail.com> <20180416022438.624B5E0153@smtp.hushmail.com> <20180417221825.CB328E0153@smtp.hushmail.com> <462dc8d6-d2ac-5ae9-83cb-904ef7ad0199@hedeland.org> Message-ID: <20180419025528.55516E015B@smtp.hushmail.com> That's awesome! Thanks; I'll try the patch out! Cheers,Alex On 4/18/2018 at 2:28 AM, "Per Hedeland" wrote:On 2018-04-18 08:05, Per Hedeland wrote: > On 2018-04-18 03:27, Fernando Benavides wrote: >> >> Also... Just trying to evaluate _any_ function, loads the module. That's why instead of loading modules manually, when in the shell, I tend to write the module name and :, press tab, if nothing pops >> up, I type x(). and press enter. > > I tend to do the same, even down to the "arbitrary function name", but > it *is* rather quirky, and there is a hint for an obvious and probably > straightforward-to-implement (I haven't looked at the relevant code) > enhancement in your description: why not have the sequence : > do a code:ensure_loaded() before it (tries to) look up the > function list? OK, so I looked at the code, and the change (see below) is so trivial that there is probably a good reason it doesn't already do that - I don't know what that reason might be though... --Per diff --git a/lib/stdlib/src/edlin_expand.erl b/lib/stdlib/src/edlin_expand.erl index bdcefda..4b3e0cc 100644 --- a/lib/stdlib/src/edlin_expand.erl +++ b/lib/stdlib/src/edlin_expand.erl @@ -49,8 +49,8 @@ expand_module_name(Prefix) -> expand_function_name(ModStr, FuncPrefix) -> case to_atom(ModStr) of {ok, Mod} -> - case erlang:module_loaded(Mod) of - true -> + case code:ensure_loaded(Mod) of + {module, Mod} -> L = Mod:module_info(), case lists:keyfind(exports, 1, L) of {_, Exports} -> @@ -58,7 +58,7 @@ expand_function_name(ModStr, FuncPrefix) -> _ -> {no, [], []} end; - false -> + {error, _What} -> {no, [], []} end; error -> _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex@REDACTED Thu Apr 19 04:56:30 2018 From: alex@REDACTED (Alex Alvarez) Date: Wed, 18 Apr 2018 22:56:30 -0400 Subject: [erlang-questions] module reloading In-Reply-To: References: <20180413171340.C7409E0153@smtp.hushmail.com> <20180416022438.624B5E0153@smtp.hushmail.com> <20180417221825.CB328E0153@smtp.hushmail.com> Message-ID: <20180419025631.873DEE015B@smtp.hushmail.com> Thanks! That definitely also works! Cheers,Alex On 4/18/2018 at 7:25 AM, "Joe Armstrong" wrote:On Wed, Apr 18, 2018 at 12:18 AM, Alex Alvarez wrote: > Thanks Joe! LOL!!! Might sound silly, but it's very useful to be able to > load/reload modules manually. At the very least, it'd be great to at least > get something like {error, module_loaded}, instead of the current "error > report" message > > Ok, so, why don't I just enter a : and allow the > module to autoload. That's great for source code, but not that great in the > command line. The problem is that I, as I suppose most folks, don't know > the function names (or even a function name) in every module, which is why I > tend to manually load them when I'm in Erlang's REPL. I have the same problem - so I say > m('modname'). Which autoloads the module if it's not loaded and prints a list of the functions in the module. After this expansion works. This has non of the problems you've see with load :-) /Joe > As we know, once a > module is loaded, you can type the module name, press the key and get > a list of the function names + arity. This is very powerful. If you don't > know the exact name of a function, but do know the name of a few modules > where it might be, you can try loading them, pressing and see if you > can find it before having to consult the documentation. > > Thanks, > Alex > > > > On 4/16/2018 at 9:55 AM, "Joe Armstrong" wrote: > > I see :-) > > But why I ask do you do "l(math)" ? > > This loads or reloads a module - but modules are autoloaded on demand > the first time the module > is called, so really there is almost [1] no need to do ever do this. > > Cheers > > /Joe > > [1] there is actually but the use cases are rather obscure > > > > > On Mon, Apr 16, 2018 at 4:24 AM, Alex Alvarez wrote: >> Thanks for your reply! I can certainly understand that and appreciate the >> system would be letting me know if I was trying to do that. But the issue >> is that I was not trying to load any code of mine with the same module >> name, >> I just tried reloading the same (e.g., math) module. >> >> Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] >> [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V9.3 (abort with ^G) >> 1> l(math). >> {module,math} >> 2> l(math). >> {error,sticky_directory} >> 3> >> =ERROR REPORT==== 15-Apr-2018::22:09:00 === >> Can't load module 'math' that resides in sticky dir >> >> As mentioned in my last email, the issue seems to be with the fact that >> the >> module was not marked old... >> >> 3> code:purge(math). >> false >> >> Now, I just thought that c:l() would load and reload any module >> regardless, >> but that doesn't seem to be the case. >> >> http://erlang.org/doc/man/c.html#l-1 >> http://erlang.org/doc/man/code.html#purge-1 >> >> Thanks, >> Alex >> >> >> >> On 4/13/2018 at 4:26 PM, "Joe Armstrong" wrote: >> >> The module called 'math' is a pre-defined system module, and >> redefining it might have >> unpleasant and unpredictable consequences - so you really should not >> do this unless you >> know exactly what you are doing. Best is to just change the name. >> >> If you know what you're doing you can call unstick_dir on the >> directory where math.beam was loaded from >> and then you will be able to change the code - again this is not a >> good idea if you don't >> really understand the consequences of doing this. >> >> System modules are 'sticky' by default to stop you from accidentally >> shooting yourself in the foot. >> >> If you get this warning just change the module name. >> >> Cheers >> >> /Joe >> >> On Fri, Apr 13, 2018 at 7:13 PM, Alex Alvarez wrote: >>> Sorry if this was already asked and I missed it... While using v20.3.2, >>> after I load a module... >>> >>> 11> l(math). >>> {module,math} >>> >>> ...if I try to reload it again with the same command... >>> >>> 12> l(math). >>> >>> =ERROR REPORT==== 13-Apr-2018::13:09:15 === >>> Can't load module 'math' that resides in sticky dir >>> {error,sticky_directory} >>> >>> ...I get this error message. It's not particular to any module. >From the >>> error, there seems to be a problem with a stcky bit somewhere. Although I >>> don't remember having this problem before, who knows, maybe it's just my >>> install. Has anyone run into this issue recently? >>> >>> Thanks, >>> Alex >>> >>> _______________________________________________ >>> 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 fchschneider@REDACTED Thu Apr 19 10:39:20 2018 From: fchschneider@REDACTED (Frans Schneider) Date: Thu, 19 Apr 2018 10:39:20 +0200 Subject: [erlang-questions] gen_statem, postpone and repeat_state Message-ID: <012231f0-79a8-d9dd-9b32-1827834bb45c@gmail.com> Hi list, I was assuming that with a repeat_state in gen_statem, all postponed events would be re-evaluated. The docs give no explicit details about this as far as I know. So, was my assumption wrong or would it be logical for postponed events to be re-evaluated in this situation? Frans From alanrevans@REDACTED Thu Apr 19 11:15:05 2018 From: alanrevans@REDACTED (Alan Evans) Date: Thu, 19 Apr 2018 10:15:05 +0100 Subject: [erlang-questions] Can anyone help with this irksome erlsom problem? Message-ID: <7630db8c-e85e-6f0c-c124-49961a0185fd@gmail.com> Hello Erlang experts, I'm having? a problem trying to parse some XML using the excellent erlsom tool, I don't know if it's me, erlsom, XML, XSD or something else that's giving me issues. The XML I'm trying to parse looks like this and the problem I have is with the xsi:type attribute on the Value element, oh and by the way, I can't change the XML as it coming from a 3rd party. 1410271757429_7070_2008420083 Device.ManagementServer.URL http://10.255.249.122/acs 1155965801 The error I get is: 34> erlsom:scan_file(Xml, ModelIn). {error,[{exception,{error,"Type not found in hierarchy: in:ValueElement"}}, {stack,['in:ParameterValueStruct','in:ParameterValueList', 'in:SetParameterValues','P:Body','P:Envelope']}, ??????? {received,{startElement,[],"Value",[], ??????????????????????????????? [{attribute,"type","xsi", "http://www.w3.org/2001/XMLSchema-instance", "xsd:string"}]}}]} The XSD I'm using is here: https://pastebin.com/VrBx0j0f It is based of the the standard TR069 XSD but I had to modify it to make the Value element a complexType in order to add the attribute. Value was defined as ? and is now defined as ? ??? ????? ??????? ??????? ????? ??? ? A session showing the problem is here: https://pastebin.com/APSLK4ry Many thanks for reading this far. Thanks Alan --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangsiri@REDACTED Thu Apr 19 12:46:15 2018 From: erlangsiri@REDACTED (Siri Hansen) Date: Thu, 19 Apr 2018 12:46:15 +0200 Subject: [erlang-questions] Patch package OTP 20.3.3 released Message-ID: Patch Package: OTP 20.3.3 Git Tag: OTP-20.3.3 Date: 2018-04-19 Trouble Report Id: OTP-15017 Seq num: System: OTP Release: 20 Application: sasl-3.1.2 Predecessor: OTP 20.3.2 Check out the git tag OTP-20.3.3, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- sasl-3.1.2 ------------------------------------------------------ --------------------------------------------------------------------- The sasl-3.1.2 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-15017 Application(s): sasl When upgrading with instruction 'restart_new_emulator', the generated temporary boot file used 'kernelProcess' statements from the old release instead of the new release. This is now corrected. This correction is needed for upgrade to OTP-21. Full runtime dependencies of sasl-3.1.2: erts-9.0, kernel-5.3, stdlib-3.4, tools-2.6.14 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Thu Apr 19 13:23:55 2018 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 19 Apr 2018 07:23:55 -0400 Subject: [erlang-questions] gen_statem, postpone and repeat_state In-Reply-To: <012231f0-79a8-d9dd-9b32-1827834bb45c@gmail.com> References: <012231f0-79a8-d9dd-9b32-1827834bb45c@gmail.com> Message-ID: <20180419112354.GF1219@ferdmbp.local> On 04/19, Frans Schneider wrote: >Hi list, > >I was assuming that with a repeat_state in gen_statem, all postponed >events would be re-evaluated. The docs give no explicit details about >this as far as I know. So, was my assumption wrong or would it be >logical for postponed events to be re-evaluated in this situation? > Postponed events are only replayed once the state has changed. repeating a state is not very different than something like handle_event(..., ..., current_state, Data) -> {next_state, current_state, Data}. As such I think it's the right thing that postponed events are not replayed. Regards, Fred. From fchschneider@REDACTED Thu Apr 19 14:47:48 2018 From: fchschneider@REDACTED (Frans Schneider) Date: Thu, 19 Apr 2018 14:47:48 +0200 Subject: [erlang-questions] gen_statem, postpone and repeat_state In-Reply-To: <20180419112354.GF1219@ferdmbp.local> References: <012231f0-79a8-d9dd-9b32-1827834bb45c@gmail.com> <20180419112354.GF1219@ferdmbp.local> Message-ID: <4e407782-99ba-7ce9-7f1d-fe8d2d69a107@gmail.com> It was because with repeat_state the enter state call is triggered which suggests a start from fresh state entry. It makes sense to me to replay postponed events in this situation. Frans On 04/19/2018 01:23 PM, Fred Hebert wrote: > On 04/19, Frans Schneider wrote: >> Hi list, >> >> I was assuming that with a repeat_state in gen_statem, all postponed >> events would be re-evaluated. The docs give no explicit details about >> this as far as I know. So, was my assumption wrong or would it be >> logical for postponed events to be re-evaluated in this situation? >> > > Postponed events are only replayed once the state has changed. repeating > a state is not very different than something like > > ?? handle_event(..., ..., current_state, Data) -> > ?????? {next_state, current_state, Data}. > > As such I think it's the right thing that postponed events are not > replayed. > > Regards, > Fred. From raimo+erlang-questions@REDACTED Thu Apr 19 15:24:53 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 19 Apr 2018 15:24:53 +0200 Subject: [erlang-questions] gen_statem, postpone and repeat_state In-Reply-To: <4e407782-99ba-7ce9-7f1d-fe8d2d69a107@gmail.com> References: <012231f0-79a8-d9dd-9b32-1827834bb45c@gmail.com> <20180419112354.GF1219@ferdmbp.local> <4e407782-99ba-7ce9-7f1d-fe8d2d69a107@gmail.com> Message-ID: <20180419132453.GA90463@erix.ericsson.se> On Thu, Apr 19, 2018 at 02:47:48PM +0200, Frans Schneider wrote: > It was because with repeat_state the enter state call is triggered which > suggests a start from fresh state entry. It makes sense to me to replay > postponed events in this situation. Well, maybe... Now repeat_state is defined as keep_state + repeat state enter call, and also repeating postponed events could have been an option. But that would break the underlying assumption of what is a state change: The idea behind for postponing events and re-trying them after a state change is that the code that handles events should change for a re-try to be worth doing. And if you stay in the same state you stay in the same event handler (for callback mode state_functions), so the only way the event handler could handle any events differently would be by using values from the server Data to affect event matching, which makes those server Data items in effect part of the actual State. So you should have a complex state instead with callback mode handle_event_function, and then you would have a real state change. In short: Postponed event shall only be retried if State =/= OldState. State enter calls are often used to start timers and other side effects, so there is a need to be able to repeat them. > > On 04/19/2018 01:23 PM, Fred Hebert wrote: > > On 04/19, Frans Schneider wrote: > >> Hi list, > >> > >> I was assuming that with a repeat_state in gen_statem, all postponed > >> events would be re-evaluated. The docs give no explicit details about > >> this as far as I know. So, was my assumption wrong or would it be > >> logical for postponed events to be re-evaluated in this situation? > >> > > > > Postponed events are only replayed once the state has changed. repeating > > a state is not very different than something like > > > > ?? handle_event(..., ..., current_state, Data) -> > > ?????? {next_state, current_state, Data}. > > > > As such I think it's the right thing that postponed events are not > > replayed. > > > > Regards, > > Fred. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From max.lapshin@REDACTED Thu Apr 19 21:08:53 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 19 Apr 2018 22:08:53 +0300 Subject: [erlang-questions] Celebrating 20 years as Open Source with a new blog! In-Reply-To: <20180417223011.947C2E0153@smtp.hushmail.com> References: <20180417223011.947C2E0153@smtp.hushmail.com> Message-ID: Great! Thank you! On Wed, Apr 18, 2018 at 1:30 AM, Alex Alvarez wrote: > Great idea and very nice post! > > Thanks, > Alex > > > On 4/17/2018 at 3:43 PM, "Grzegorz Junka" wrote: > > On 17/04/2018 16:01, Kenneth Lundin wrote: > > This year it is 20 years since Erlang/OTP was released as Open Source and > > we thought it was a good idea to celebrate with a new blog from the > > OTP team. > > > > Check out http://blog.erlang.org > > > > /Regards Kenneth, Erlang/OTP Ericsson > > > > Thank you Kenneth for sharing the link. I think it's a very cool idea. > Interesting reading about the new pooling. Please keep posting! > GrzegorzJ > _______________________________________________ > 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 lankeanandrao@REDACTED Fri Apr 20 12:07:44 2018 From: lankeanandrao@REDACTED (lankeanandrao) Date: Fri, 20 Apr 2018 15:37:44 +0530 Subject: [erlang-questions] Mnesia crash, when node name changes Message-ID: <58215f89-06dd-911d-ddb0-43483fb2f266@utl.in> Hi All, I have an application, which is running in distributed way. When first time the application is getting started the mnesia is created based on the node name which is created dynamically (for example; sample@REDACTED). The mnesia data is persistent data. When the node name is changed (for example; sample@REDACTED) the *mnesia is not getting started* in the node. Here in code I am trying to *modify / replace* the node name with new node name created dynamically. Here I have attached the *erl_crash.dump* file. Anyone have idea, why the mnesia is not getting started & erlang is crashing ? regards, Anand Rao L -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- =erl_crash_dump:0.3 Sat May 26 06:28:30 2001 Slogan: Kernel pid terminated (application_controller) ({application_start_failure,mnesia,{{shutdown,{failed_to_start_child,mnesia_kernel_sup,killed}},{mnesia_sup,start,[normal,[]]}}}) System version: Erlang/OTP 19 [erts-8.0] [source] [async-threads:10] [kernel-poll:false] Compiled: Fri Nov 11 01:04:28 2016 Taints: asn1rt_nif,crypto,erl_tracer Atoms: 33118 Calling Thread: scheduler:1 =scheduler:1 Scheduler Sleep Info Aux Work: Current Port: Run Queue Max Length: 0 Run Queue High Length: 0 Run Queue Normal Length: 0 Run Queue Low Length: 0 Run Queue Port Length: 0 Run Queue Flags: OUT_OF_WORK | HALFTIME_OUT_OF_WORK | NONEMPTY | UNKNOWN(134217728) Current Process: <0.0.0> Current Process State: Running Current Process Internal State: ACT_PRIO_NORMAL | USR_PRIO_NORMAL | PRQ_PRIO_NORMAL | ACTIVE | RUNNING | TRAP_EXIT | ON_HEAP_MSGQ Current Process Program counter: 0x48259710 (init:sleep/1 + 32) Current Process CP: 0x00000000 (invalid) Current Process Limited Stack Trace: 0x491fd5f4:SReturn addr 0x48257764 (init:boot_loop/2 + 1860) 0x491fd5f8:SReturn addr 0x1026AE58 () =memory total: 26597192 processes: 3215036 processes_used: 3199488 system: 23382156 atom: 1090205 atom_used: 1086027 binary: 292848 code: 12968865 ets: 26948 =hash_table:atom_tab size: 25717 used: 18614 objs: 33118 depth: 8 =index_table:atom_tab size: 33792 limit: 1048576 entries: 33118 =hash_table:module_code size: 397 used: 397 objs: 447 depth: 3 =index_table:module_code size: 1024 limit: 65536 entries: 447 =hash_table:export_list size: 12853 used: 9196 objs: 15863 depth: 8 =index_table:export_list size: 16384 limit: 524288 entries: 15863 =hash_table:export_list size: 6421 used: 4797 objs: 8538 depth: 7 =hash_table:process_reg size: 23 used: 4 objs: 5 depth: 2 =hash_table:fun_table size: 2411 used: 1603 objs: 2709 depth: 7 =hash_table:node_table size: 11 used: 2 objs: 2 depth: 1 =hash_table:dist_table size: 11 used: 2 objs: 2 depth: 1 =allocated_areas sys_misc: 49928 static: 262752 atom_space: 852072 847894 atom_table: 238133 module_table: 93328 export_table: 242344 export_list: 1395944 register_table: 172 fun_table: 9722 module_refs: 9040 loaded_code: 11218487 dist_table: 355 node_table: 171 bits_bufs_size: 0 bif_timer: 0 link_lh: 0 process_table: 2097152 port_table: 524288 ets_misc: 24596 =allocator:sys_alloc option e: true option m: libc option tt: 131072 option tp: 0 =allocator:temp_alloc versions: 0.9 3.0 option e: true option t: false option ramv: false option sbct: 524288 option asbcst: 4145152 option rsbcst: 90 option rsbcmt: 80 option rmbcmt: 100 option mmbcs: 131072 option mmsbc: 256 option mmmbc: 4294967295 option lmbcs: 10485760 option smbcs: 1048576 option mbcgs: 10 option acul: 0 option as: af mbcs blocks: 0 4 4 mbcs blocks size: 0 300816 300816 mbcs carriers: 1 2 2 mbcs mseg carriers: 0 mbcs sys_alloc carriers: 1 mbcs carriers size: 131072 1179648 1179648 mbcs mseg carriers size: 0 mbcs sys_alloc carriers size: 131072 sbcs blocks: 0 0 0 sbcs blocks size: 0 0 0 sbcs carriers: 0 0 0 sbcs mseg carriers: 0 sbcs sys_alloc carriers: 0 sbcs carriers size: 0 0 0 sbcs mseg carriers size: 0 sbcs sys_alloc carriers size: 0 temp_alloc calls: 103921 temp_free calls: 103921 temp_realloc calls: 30 mseg_alloc calls: 5 mseg_dealloc calls: 5 mseg_realloc calls: 0 sys_alloc calls: 1 sys_free calls: 0 sys_realloc calls: 0 =allocator:sl_alloc versions: 2.1 3.0 option e: true option t: false option ramv: false option sbct: 524288 option asbcst: 4145152 option rsbcst: 80 option rsbcmt: 80 option rmbcmt: 50 option mmbcs: 131072 option mmsbc: 256 option mmmbc: 4294967295 option lmbcs: 10485760 option smbcs: 1048576 option mbcgs: 10 option acul: 0 option mbsd: 3 option as: gf mbcs blocks: 1 53485 53485 mbcs blocks size: 520 7858992 7858992 mbcs carriers: 1 5 5 mbcs mseg carriers: 0 mbcs sys_alloc carriers: 1 mbcs carriers size: 131072 11665408 11665408 mbcs mseg carriers size: 0 mbcs sys_alloc carriers size: 131072 sbcs blocks: 0 0 0 sbcs blocks size: 0 0 0 sbcs carriers: 0 0 0 sbcs mseg carriers: 0 sbcs sys_alloc carriers: 0 sbcs carriers size: 0 0 0 sbcs mseg carriers size: 0 sbcs sys_alloc carriers size: 0 sl_alloc calls: 81822 sl_free calls: 81821 sl_realloc calls: 66 mseg_alloc calls: 13 mseg_dealloc calls: 13 mseg_realloc calls: 0 sys_alloc calls: 1 sys_free calls: 0 sys_realloc calls: 0 =allocator:std_alloc versions: 0.9 3.0 option e: true option t: false option ramv: false option sbct: 524288 option asbcst: 4145152 option rsbcst: 20 option rsbcmt: 80 option rmbcmt: 50 option mmbcs: 131072 option mmsbc: 256 option mmmbc: 4294967295 option lmbcs: 10485760 option smbcs: 1048576 option mbcgs: 10 option acul: 0 option as: bf mbcs blocks: 21 107 107 mbcs blocks size: 150704 171128 171128 mbcs carriers: 2 2 2 mbcs mseg carriers: 1 mbcs sys_alloc carriers: 1 mbcs carriers size: 1179648 1179648 1179648 mbcs mseg carriers size: 1048576 mbcs sys_alloc carriers size: 131072 sbcs blocks: 0 0 0 sbcs blocks size: 0 0 0 sbcs carriers: 0 0 0 sbcs mseg carriers: 0 sbcs sys_alloc carriers: 0 sbcs carriers size: 0 0 0 sbcs mseg carriers size: 0 sbcs sys_alloc carriers size: 0 std_alloc calls: 155 std_free calls: 134 std_realloc calls: 0 mseg_alloc calls: 1 mseg_dealloc calls: 0 mseg_realloc calls: 0 sys_alloc calls: 1 sys_free calls: 0 sys_realloc calls: 0 =allocator:ll_alloc versions: 0.9 3.0 option e: true option t: false option ramv: false option sbct: 8388573 option asbcst: 0 option rsbcst: 0 option rsbcmt: 0 option rmbcmt: 0 option mmbcs: 2097152 option mmsbc: 0 option mmmbc: 4294967295 option lmbcs: 10485760 option smbcs: 1048576 option mbcgs: 10 option acul: 0 option as: aobf mbcs blocks: 53400 53402 53402 mbcs blocks size: 18406816 18406992 18406992 mbcs carriers: 6 6 6 mbcs mseg carriers: 5 mbcs sys_alloc carriers: 1 mbcs carriers size: 25165824 25165824 25165824 mbcs mseg carriers size: 23068672 mbcs sys_alloc carriers size: 2097152 sbcs blocks: 0 0 0 sbcs blocks size: 0 0 0 sbcs carriers: 0 0 0 sbcs mseg carriers: 0 sbcs sys_alloc carriers: 0 sbcs carriers size: 0 0 0 sbcs mseg carriers size: 0 sbcs sys_alloc carriers size: 0 ll_alloc calls: 53432 ll_free calls: 32 ll_realloc calls: 889 mseg_alloc calls: 6 mseg_dealloc calls: 1 mseg_realloc calls: 0 sys_alloc calls: 1 sys_free calls: 0 sys_realloc calls: 0 =allocator:eheap_alloc versions: 2.1 3.0 option e: true option t: false option ramv: false option sbct: 524288 option asbcst: 4145152 option rsbcst: 50 option rsbcmt: 80 option rmbcmt: 50 option mmbcs: 524288 option mmsbc: 256 option mmmbc: 4294967295 option lmbcs: 10485760 option smbcs: 1048576 option mbcgs: 10 option acul: 0 option mbsd: 3 option as: gf mbcs blocks: 10 98 98 mbcs blocks size: 1100448 3176768 3176768 mbcs carriers: 3 4 4 mbcs mseg carriers: 2 mbcs sys_alloc carriers: 1 mbcs carriers size: 3670016 7864320 7864320 mbcs mseg carriers size: 3145728 mbcs sys_alloc carriers size: 524288 sbcs blocks: 0 1 1 sbcs blocks size: 0 786608 786608 sbcs carriers: 0 1 1 sbcs mseg carriers: 0 sbcs sys_alloc carriers: 0 sbcs carriers size: 0 790528 790528 sbcs mseg carriers size: 0 sbcs sys_alloc carriers size: 0 eheap_alloc calls: 2375 eheap_free calls: 2365 eheap_realloc calls: 28 mseg_alloc calls: 4 mseg_dealloc calls: 2 mseg_realloc calls: 0 sys_alloc calls: 1 sys_free calls: 0 sys_realloc calls: 0 =allocator:ets_alloc versions: 0.9 3.0 option e: true option t: false option ramv: false option sbct: 524288 option asbcst: 4145152 option rsbcst: 20 option rsbcmt: 80 option rmbcmt: 50 option mmbcs: 131072 option mmsbc: 256 option mmmbc: 4294967295 option lmbcs: 10485760 option smbcs: 1048576 option mbcgs: 10 option acul: 0 option as: bf mbcs blocks: 4 911 911 mbcs blocks size: 2352 334584 334584 mbcs carriers: 1 2 2 mbcs mseg carriers: 0 mbcs sys_alloc carriers: 1 mbcs carriers size: 131072 1179648 1179648 mbcs mseg carriers size: 0 mbcs sys_alloc carriers size: 131072 sbcs blocks: 0 0 0 sbcs blocks size: 0 0 0 sbcs carriers: 0 0 0 sbcs mseg carriers: 0 sbcs sys_alloc carriers: 0 sbcs carriers size: 0 0 0 sbcs mseg carriers size: 0 sbcs sys_alloc carriers size: 0 ets_alloc calls: 996 ets_free calls: 992 ets_realloc calls: 19 mseg_alloc calls: 1 mseg_dealloc calls: 1 mseg_realloc calls: 0 sys_alloc calls: 1 sys_free calls: 0 sys_realloc calls: 0 =allocator:fix_alloc versions: 0.9 3.0 option e: true option t: false option ramv: false option sbct: 524288 option asbcst: 4145152 option rsbcst: 20 option rsbcmt: 80 option rmbcmt: 50 option mmbcs: 131072 option mmsbc: 256 option mmmbc: 4294967295 option lmbcs: 10485760 option smbcs: 1048576 option mbcgs: 10 option acul: 0 option as: aobf fix type: driver_select_data_state 24 24 fix type: driver_event_data_state 0 0 fix type: nlink_sh 1180 120 fix type: monitor_sh 440 0 fix type: bif_timer 288 0 fix type: hl_ptimer 48 48 fix type: ll_ptimer 0 0 fix type: msg_ref 0 0 fix type: proc 15480 1720 mbcs blocks: 120 275 275 mbcs blocks size: 18744 28720 28720 mbcs carriers: 1 1 1 mbcs mseg carriers: 0 mbcs sys_alloc carriers: 1 mbcs carriers size: 131072 131072 131072 mbcs mseg carriers size: 0 mbcs sys_alloc carriers size: 131072 sbcs blocks: 0 0 0 sbcs blocks size: 0 0 0 sbcs carriers: 0 0 0 sbcs mseg carriers: 0 sbcs sys_alloc carriers: 0 sbcs carriers size: 0 0 0 sbcs mseg carriers size: 0 sbcs sys_alloc carriers size: 0 fix_alloc calls: 3335 fix_free calls: 3322 fix_realloc calls: 0 mseg_alloc calls: 0 mseg_dealloc calls: 0 mseg_realloc calls: 0 sys_alloc calls: 1 sys_free calls: 0 sys_realloc calls: 0 =allocator:literal_alloc versions: 0.9 3.0 option e: true option t: false option ramv: false option sbct: 8388573 option asbcst: 0 option rsbcst: 0 option rsbcmt: 0 option rmbcmt: 0 option mmbcs: 1048576 option mmsbc: 0 option mmmbc: 4294967295 option lmbcs: 10485760 option smbcs: 1048576 option mbcgs: 10 option acul: 0 option as: aobf mbcs blocks: 448 448 448 mbcs blocks size: 6621552 6621552 6621552 mbcs carriers: 4 4 4 mbcs mseg carriers: 3 mbcs sys_alloc carriers: 1 mbcs carriers size: 8388608 8388608 8388608 mbcs mseg carriers size: 7340032 mbcs sys_alloc carriers size: 1048576 sbcs blocks: 0 0 0 sbcs blocks size: 0 0 0 sbcs carriers: 0 0 0 sbcs mseg carriers: 0 sbcs sys_alloc carriers: 0 sbcs carriers size: 0 0 0 sbcs mseg carriers size: 0 sbcs sys_alloc carriers size: 0 literal_alloc calls: 450 literal_free calls: 2 literal_realloc calls: 0 mseg_alloc calls: 3 mseg_dealloc calls: 0 mseg_realloc calls: 0 sys_alloc calls: 1 sys_free calls: 0 sys_realloc calls: 0 =allocator:binary_alloc versions: 0.9 3.0 option e: true option t: false option ramv: false option sbct: 524288 option asbcst: 4145152 option rsbcst: 20 option rsbcmt: 80 option rmbcmt: 50 option mmbcs: 131072 option mmsbc: 256 option mmmbc: 4294967295 option lmbcs: 10485760 option smbcs: 1048576 option mbcgs: 10 option acul: 0 option as: bf mbcs blocks: 1018 1201 1201 mbcs blocks size: 292848 1880568 1880568 mbcs carriers: 3 3 3 mbcs mseg carriers: 2 mbcs sys_alloc carriers: 1 mbcs carriers size: 3276800 3276800 3276800 mbcs mseg carriers size: 3145728 mbcs sys_alloc carriers size: 131072 sbcs blocks: 0 3 3 sbcs blocks size: 0 2162704 2162704 sbcs carriers: 0 3 3 sbcs mseg carriers: 0 sbcs sys_alloc carriers: 0 sbcs carriers size: 0 2170880 2170880 sbcs mseg carriers size: 0 sbcs sys_alloc carriers size: 0 binary_alloc calls: 2888 binary_free calls: 1870 binary_realloc calls: 5 mseg_alloc calls: 7 mseg_dealloc calls: 5 mseg_realloc calls: 0 sys_alloc calls: 1 sys_free calls: 0 sys_realloc calls: 0 =allocator:driver_alloc versions: 0.9 3.0 option e: true option t: false option ramv: false option sbct: 524288 option asbcst: 4145152 option rsbcst: 20 option rsbcmt: 80 option rmbcmt: 50 option mmbcs: 131072 option mmsbc: 256 option mmmbc: 4294967295 option lmbcs: 10485760 option smbcs: 1048576 option mbcgs: 10 option acul: 0 option as: bf mbcs blocks: 31 127 127 mbcs blocks size: 3208 83008 83008 mbcs carriers: 1 1 1 mbcs mseg carriers: 0 mbcs sys_alloc carriers: 1 mbcs carriers size: 131072 131072 131072 mbcs mseg carriers size: 0 mbcs sys_alloc carriers size: 131072 sbcs blocks: 0 0 0 sbcs blocks size: 0 0 0 sbcs carriers: 0 0 0 sbcs mseg carriers: 0 sbcs sys_alloc carriers: 0 sbcs carriers size: 0 0 0 sbcs mseg carriers size: 0 sbcs sys_alloc carriers size: 0 driver_alloc calls: 4862 driver_free calls: 4831 driver_realloc calls: 0 mseg_alloc calls: 0 mseg_dealloc calls: 0 mseg_realloc calls: 0 sys_alloc calls: 1 sys_free calls: 0 sys_realloc calls: 0 =allocator:test_alloc option e: false =allocator:mseg_alloc[0] version: 0.9 option amcbf: 4194304 option rmcbf: 20 option mcs: 10 memory kind: all memory cached_segments: 2 cache_hits: 13 segments: 13 17 17 segments_watermark: 14 segments_size: 37748736 49283072 49283072 mseg_alloc calls: 40 mseg_dealloc calls: 27 mseg_realloc calls: 0 mseg_create calls: 27 mseg_create_resize calls: 0 mseg_destroy calls: 14 mseg_recreate calls: 0 mseg_clear_cache calls: 0 mseg_check_cache calls: 16 =allocator:erts_mmap.default_mmap option scs: 0 os mmap size used: 39587840 =allocator:alloc_util option mmc: 4294967295 option ycs: 1048576 option sac: true =allocator:instr option m: false option s: false option t: false =proc:<0.0.0> State: Running Name: init Spawned as: otp_ring0:start/2 Spawned by: [] Started: Sat May 26 06:28:05 2001 Message queue length: 1 Number of heap fragments: 0 Heap fragment data: 0 Link list: [<0.453.0>, <0.4.0>] Reductions: 3843 Stack+heap: 2586 OldHeap: 4185 Heap unused: 1916 OldHeap unused: 3645 Memory: 27524 Program counter: 0x48259710 (init:sleep/1 + 32) CP: 0x00000000 (invalid) Internal State: ACT_PRIO_NORMAL | USR_PRIO_NORMAL | PRQ_PRIO_NORMAL | ACTIVE | RUNNING | TRAP_EXIT | ON_HEAP_MSGQ =proc:<0.1.0> State: Waiting Name: erts_code_purger Spawned as: erts_code_purger:start/0 Current call: erts_code_purger:loop/0 Spawned by: <0.0.0> Started: Sat May 26 06:28:05 2001 Message queue length: 0 Number of heap fragments: 0 Heap fragment data: 0 Reductions: 4 Stack+heap: 233 OldHeap: 0 Heap unused: 233 OldHeap unused: 0 Memory: 1276 Program counter: 0x4824bf20 (erts_code_purger:loop/0 + 12) CP: 0x00000000 (invalid) arity = 0 Internal State: ACT_PRIO_NORMAL | USR_PRIO_NORMAL | PRQ_PRIO_NORMAL | TRAP_EXIT | ON_HEAP_MSGQ =proc:<0.4.0> State: Waiting Name: erl_prim_loader Spawned as: erlang:apply/2 Current call: erl_prim_loader:loop/3 Spawned by: <0.3.0> Started: Sat May 26 06:28:05 2001 Message queue length: 0 Number of heap fragments: 0 Heap fragment data: 0 Link list: [<0.0.0>, #Port<0.1>] Reductions: 19371 Stack+heap: 75113 OldHeap: 46422 Heap unused: 30470 OldHeap unused: 46418 Memory: 486524 Program counter: 0x4828f51c (erl_prim_loader:loop/3 + 80) CP: 0x00000000 (invalid) arity = 0 Internal State: ACT_PRIO_NORMAL | USR_PRIO_NORMAL | PRQ_PRIO_NORMAL | TRAP_EXIT | ON_HEAP_MSGQ =proc:<0.453.0> State: Waiting Name: error_logger Spawned as: proc_lib:init_p/5 Spawned by: <0.3.0> Started: Sat May 26 06:28:18 2001 Message queue length: 0 Number of heap fragments: 0 Heap fragment data: 0 Link list: [<0.0.0>] Reductions: 475 Stack+heap: 4185 OldHeap: 0 Heap unused: 2103 OldHeap unused: 0 Memory: 17156 Program counter: 0x48a40bbc (gen_event:fetch_msg/5 + 24) CP: 0x00000000 (invalid) arity = 0 Internal State: ACT_PRIO_NORMAL | USR_PRIO_NORMAL | PRQ_PRIO_NORMAL | TRAP_EXIT | ON_HEAP_MSGQ =proc:<0.497.0> State: Waiting Name: mnesia_tm Spawned as: proc_lib:init_p/5 Spawned by: <0.492.0> Started: Sat May 26 06:28:18 2001 Message queue length: 1 Number of heap fragments: 0 Heap fragment data: 0 Reductions: 25912 Stack+heap: 17731 OldHeap: 121536 Heap unused: 3880 OldHeap unused: 57561 Memory: 557520 Program counter: 0x4921e6e4 (mnesia_tm:get_info/1 + 140) CP: 0x00000000 (invalid) arity = 0 Internal State: ACT_PRIO_NORMAL | USR_PRIO_NORMAL | PRQ_PRIO_NORMAL | TRAP_EXIT | ON_HEAP_MSGQ =port:#Port<0.0> Slot: 0 Connected: <0.0.0> Port controls forker process: forker =port:#Port<0.1> Slot: 16 Connected: <0.4.0> Links: <0.4.0> Port controls linked-in driver: efile =node:'nonode@REDACTED' =no_distribution =loaded_modules Current code: 11218487 Old code: 0 =mod:otp_ring0 Current size: 460 =mod:erts_code_purger Current size: 5808 =mod:init Current size: 33980 =mod:prim_eval Current size: 328 =mod:prim_inet Current size: 55821 =mod:prim_file Current size: 31047 =mod:zlib Current size: 7252 =mod:prim_zip Current size: 14840 =mod:erl_prim_loader Current size: 39420 =mod:erlang Current size: 45849 =mod:erts_internal Current size: 4024 =mod:erl_tracer Current size: 392 =mod:lists Current size: 56205 From prakashkumar_parmar@REDACTED Fri Apr 20 12:16:51 2018 From: prakashkumar_parmar@REDACTED (Prakash Parmar) Date: Fri, 20 Apr 2018 15:46:51 +0530 (IST) Subject: [erlang-questions] Mnesia crash, when node name changes In-Reply-To: <58215f89-06dd-911d-ddb0-43483fb2f266@utl.in> References: <58215f89-06dd-911d-ddb0-43483fb2f266@utl.in> Message-ID: <1524219411.403528661@webmail.thbs.com> Are you trying to replace node name in schema ? -cheers Prakash -----Original Message----- From: "lankeanandrao" Sent: Friday, April 20, 2018 3:37pm To: erlang-questions@REDACTED Subject: [erlang-questions] Mnesia crash, when node name changes Hi All, I have an application, which is running in distributed way. When first time the application is getting started the mnesia is created based on the node name which is created dynamically (for example; [ sample@REDACTED ]( mailto:sample@REDACTED )). The mnesia data is persistent data. When the node name is changed (for example; [ sample@REDACTED ]( mailto:sample@REDACTED )) the mnesia is not getting started in the node. Here in code I am trying to modify / replace the node name with new node name created dynamically. Here I have attached the erl_crash.dump file. Anyone have idea, why the mnesia is not getting started & erlang is crashing ?regards, Anand Rao L ******* DISCLAIMER: This email and any files transmitted with it are privileged and confidential information and intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Torry Harris Business Solutions has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. The recipient should check this email and any attachments for the presence of viruses. THBS reserves the right to monitor and review the content of all messages sent to or from this e-mail address******** ******* DISCLAIMER: This email and any files transmitted with it are privileged and confidential information and intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Torry Harris Business Solutions has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. The recipient should check this email and any attachments for the presence of viruses. THBS reserves the right to monitor and review the content of all messages sent to or from this e-mail address.******** -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans.r.nilsson@REDACTED Fri Apr 20 12:24:01 2018 From: hans.r.nilsson@REDACTED (Hans Nilsson R) Date: Fri, 20 Apr 2018 12:24:01 +0200 Subject: [erlang-questions] Patch package OTP 20.3.4 released Message-ID: Patch Package: OTP 20.3.4 Git Tag: OTP-20.3.4 Date: 2018-04-20 Trouble Report Id: OTP-15004, OTP-15007, OTP-15018, OTP-15022, OTP-15023 Seq num: ERIERL-150, ERIERL-163 System: OTP Release: 20 Application: erl_interface-3.10.2, ic-4.4.4, inets-6.5.1, ssh-4.6.8 Predecessor: OTP 20.3.3 Check out the git tag OTP-20.3.4, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- erl_interface-3.10.2 -------------------------------------------- --------------------------------------------------------------------- The erl_interface-3.10.2 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-15022 Application(s): erl_interface Related Id(s): ERIERL-163 Fix bug in ei_connect functions that may cause failure due to insufficient buffer space for gethostbyname_r. OTP-15023 Application(s): erl_interface, ic Related Id(s): ERIERL-150 Optimize encoding/decoding for pure 7-bit ascii atoms. --------------------------------------------------------------------- --- ic-4.4.4 -------------------------------------------------------- --------------------------------------------------------------------- The ic-4.4.4 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-15023 Application(s): erl_interface, ic Related Id(s): ERIERL-150 Optimize encoding/decoding for pure 7-bit ascii atoms. Full runtime dependencies of ic-4.4.4: erts-6.0, kernel-3.0, stdlib-2.0 --------------------------------------------------------------------- --- inets-6.5.1 ----------------------------------------------------- --------------------------------------------------------------------- The inets-6.5.1 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-15007 Application(s): inets Fix broken options handling in httpc (ERL-441). Full runtime dependencies of inets-6.5.1: erts-6.0, kernel-3.0, mnesia-4.12, runtime_tools-1.8.14, ssl-5.3.4, stdlib-2.0 --------------------------------------------------------------------- --- ssh-4.6.8 ------------------------------------------------------- --------------------------------------------------------------------- Note! The ssh-4.6.8 application can *not* be applied independently of other applications on an arbitrary OTP 20 installation. On a full OTP 20 installation, also the following runtime dependencies have to be satisfied: -- crypto-4.2 (first satisfied in OTP 20.2) -- public_key-1.5.2 (first satisfied in OTP 20.2) --- Fixed Bugs and Malfunctions --- OTP-15004 Application(s): ssh An ssh_sftp server (running version 6) could fail if it is told to remove a file which in fact is a directory. OTP-15018 Application(s): ssh Fix rare spurios shutdowns of ssh servers when receiveing {'EXIT',_,normal} messages. Full runtime dependencies of ssh-4.6.8: crypto-4.2, erts-6.0, kernel-3.0, public_key-1.5.2, stdlib-3.3 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From lankeanandrao@REDACTED Fri Apr 20 12:37:13 2018 From: lankeanandrao@REDACTED (lankeanandrao) Date: Fri, 20 Apr 2018 16:07:13 +0530 Subject: [erlang-questions] Mnesia crash, when node name changes In-Reply-To: <1524219411.403528661@webmail.thbs.com> References: <58215f89-06dd-911d-ddb0-43483fb2f266@utl.in> <1524219411.403528661@webmail.thbs.com> Message-ID: <2acf5cbb-b1eb-7100-f1cc-69282a4f41c5@utl.in> Yes, I am updating the schema.DAT file when node name is different. - Anand Rao L On Friday 20 April 2018 03:46 PM, Prakash Parmar wrote: > > Are you trying to replace node name in schema ? > > -cheers > > Prakash > > -----Original Message----- > From: "lankeanandrao" > Sent: Friday, April 20, 2018 3:37pm > To: erlang-questions@REDACTED > Subject: [erlang-questions] Mnesia crash, when node name changes > > Hi All, > > I have an application, which is running in distributed way. When > first time the application is getting started the mnesia is created > based on the node name which is created dynamically (for example; > sample@REDACTED). The mnesia data is persistent data. When the node > name is changed (for example; sample@REDACTED) the *mnesia is not > getting started* in the node. Here in code I am trying to *modify / > replace* the node name with new node name created dynamically. > > Here I have attached the *erl_crash.dump* file. > > Anyone have idea, why the mnesia is not getting started & erlang > is crashing ? > > regards, > Anand Rao L > > > > ******* DISCLAIMER: This email and any files transmitted with it are > privileged and confidential information and intended solely for the > use of the individual or entity to which they are addressed. If you > are not the intended recipient, please notify the sender by e-mail and > delete the original message. Further, you are not to copy, disclose, > or distribute this e-mail or its contents to any other person and any > such actions are unlawful. This e-mail may contain viruses. Torry > Harris Business Solutions has taken every reasonable precaution to > minimize this risk, but is not liable for any damage you may sustain > as a result of any virus in this e-mail. The recipient should check > this email and any attachments for the presence of viruses. THBS > reserves the right to monitor and review the content of all messages > sent to or from this e-mail address******** > ******* DISCLAIMER: This email and any files transmitted with it are privileged and confidential information and intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Torry Harris Business Solutions has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. The recipient should check this email and any attachments for the presence of viruses. THBS reserves the right to monitor and review the content of all messages sent to or from this e-mail address.******** -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierrefenoll@REDACTED Fri Apr 20 12:51:21 2018 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Fri, 20 Apr 2018 12:51:21 +0200 Subject: [erlang-questions] [ANN] otp_vsn 1.0.0 - ?OTP_VSN Message-ID: Howdy people, I just released a library called otp_vsn which defines helpful macros if you write code that spans multiple OTP releases. This saves you the copy/pasting/tweaking of erl_opts's platform_define. Header-only, no dependencies. Supports releases from R16B01 to latest. For example if you want to use the #{maps => syntax} but still be able to compile your code on releases earlier than 17.5 you can use ifdef(OTP_VSN_17_AND_ABOVE). This release is super fresh (published 15 minutes ago) and feedback is welcomed! I'm looking for macros that are re-defined often such as * the maps thing I mention above * stdlib types getting renamed * functions being moved/renamed I think this library could be the place to put them in & help the community write code that still compiles on newer releases of Erlang :) https://hex.pm/packages/otp_vsn https://github.com/fenollp/otp_vsn Thanks & have a nice day -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc@REDACTED Fri Apr 20 13:08:33 2018 From: marc@REDACTED (Marc Worrell) Date: Fri, 20 Apr 2018 13:08:33 +0200 Subject: [erlang-questions] [ANN] otp_vsn 1.0.0 - ?OTP_VSN In-Reply-To: References: Message-ID: > On 20 Apr 2018, at 12:51, Pierre Fenoll wrote: > > I just released a library called otp_vsn which defines helpful macros if you write code that spans multiple OTP releases. > > For example if you want to use the #{maps => syntax} but still be able to compile your code on releases earlier than 17.5 you can use ifdef(OTP_VSN_17_AND_ABOVE). Nice work, I especially like that it is only a header file. I have an idea, might be somethiing to add. Instead of relying on the OTP version for some features. Maybe add a macro like ?OTP_SUPPORT_MAPS? ? Another we often define is for the changes in the dict() type, which became dict:dict() at some point. In our rebar files we currently have definitions for this kind of defines. Would be very convenient to have those at a more central place, and one that is consistent between projects. Thank you for your library! Marc Worrell From vances@REDACTED Fri Apr 20 13:25:42 2018 From: vances@REDACTED (Vance Shipley) Date: Fri, 20 Apr 2018 16:55:42 +0530 Subject: [erlang-questions] Mnesia crash, when node name changes In-Reply-To: <2acf5cbb-b1eb-7100-f1cc-69282a4f41c5@utl.in> References: <58215f89-06dd-911d-ddb0-43483fb2f266@utl.in> <1524219411.403528661@webmail.thbs.com> <2acf5cbb-b1eb-7100-f1cc-69282a4f41c5@utl.in> Message-ID: On Fri, Apr 20, 2018 at 4:07 PM, lankeanandrao wrote: > Yes, I am updating the schema.DAT file when node name is different. The procedure for renaming a node is here: http://erlang.org/doc/apps/mnesia/Mnesia_chap7.html#id85020 -- -Vance From natalia.chechina@REDACTED Fri Apr 20 14:52:20 2018 From: natalia.chechina@REDACTED (Natalia Chechina) Date: Fri, 20 Apr 2018 13:52:20 +0100 Subject: [erlang-questions] [2nd CfP]: Erlang Workshop -- St. Louis, Missouri, US, 29 Sept 2018 -- Deadline: 15 June 2018 Message-ID: Dear all, Please, consider submitting your work to the Erlang Workshop 2018 that will take place in St. Louis, Missouri, US on the 29th of Sept 2018. Technical, practice, and application papers related to Erlang, BEAM, Elixir, Scala/Akka, CloudHaskell, Lisp Flavoured Erlang, OCaml, and functional programming in general are welcome and encouraged. Paper submission deadline is the 15th of June 2018. Best wishes, Erlang Workshop 2018 co-chairs Natalia and Adrian. ================== 2ND CALL FOR PAPERS ================== Seventeenth ACM SIGPLAN Erlang Workshop http://erlang.org/workshop/2018/ ----------------------------------------------------------- St. Louis, Missouri, United States, 29 September 2018 Satellite event of the 23rd ACM SIGPLAN International Conference on Functional Programming (ICFP 2018) 23 - 29 September, 2018 The Erlang Workshop aims to bring together the open source, academic, and industrial communities of Erlang, to discuss technologies and languages related to Erlang. The Erlang model of concurrent programming has been widely emulated, for example by Akka in Scala, and even new programming languages were designed atop of the Erlang VM, such as Elixir. Therefore we would like to broaden the scope of the workshop to include systems like those mentioned above. The workshop will enable participants to familiarize themselves with recent developments on new techniques and tools, novel applications, draw lessons from users' experiences and identify research problems and common areas relevant to the practice of Erlang, Erlang-like languages, functional programming, distribution, concurrency etc. We invite three types of submissions. 1. Technical papers describing language extensions, critical discussions of the status quo, formal semantics of language constructs, program analysis and transformation, virtual machine extensions and compilation techniques, implementations and interfaces of Erlang in/with other languages, and new tools (profilers, tracers, debuggers, testing frameworks, etc.). Submission related to Erlang, Elixir, Scala/Akka, CloudHaskell, Lisp Flavoured Erlang, OCaml, and functional programming are welcome and encouraged. The maximum length for technical papers is restricted to 12 pages. 2. Practice and application papers describing uses of Erlang in the "real-world", Erlang libraries for specific tasks, experiences from using Erlang in specific application domains, reusable programming idioms and elegant new ways of using Erlang to approach or solve a particular problem. The maximum length for the practice and application papers is restricted to 12 pages. 3. Poster presentations describing topics related to the workshop goals. Each includes a maximum of 2 pages of the abstract and summary. Presentations in this category will be given an hour of shared simultaneous demonstration time. Note that the above are maximum lengths; we welcome shorter papers also, and the program committee will evaluate all papers on an equal basis independent of their lengths. Workshop Co-Chairs --------------------------- Natalia Chechina, Bournemouth University, UK Adrian Francalanza, University of Malta, Malta Program Committee --------------------------- (Note: the Workshop Co-Chairs are also committee members) Scott Lystig Fritchie, Wallaroo, USA James S. Larson, Google, USA Richard Carlsson, Klarna, Sweden Laura M. Castro, University of A Coru?a Vikt?ria F?rd?s, Klarna, Sweden Laura Bocchi, University of Kent, UK Rumyana Neykova, Imperial College, UK Roland Kuhn, Actyx, Germany Rocco De Nicola, IMT Lucca, Italy Emanuele D?Osulado, Imperial College, UK Mark Sheldon, Tufts Univesrity, USA James Fish, Pinterest, USA Tam?s Kozsik, E?tv?s Lor?nd University, Hungary Important Dates ---------------------- Submission deadline: Fri June 15, 2018 Author notification: Fri July 13, 2018 Final submission for the publisher: Sat August 4, 2018 Workshop date: Sat September 29, 2018 Instructions to authors ------------------------------- Papers must be submitted online via EasyChair (via the "Erlang2018" event). The submission page is https://easychair.org/conferences/?conf=erlang18. Submitted papers should be in portable document format (PDF), formatted using the ACM SIGPLAN style guidelines http://sigplan.org/Resources/Author/#acmart-format Each submission must adhere to SIGPLAN's republication policy. Violation risks summary rejection of the offending submission. Accepted papers will be published by the ACM and will appear in the ACM Digital Library. The proceedings will be freely available for download from the ACM Digital Library from one week before the start of the conference until two weeks after the conference. The official publication date is the date the papers are made available in the ACM Digital Library. This date may be up to two weeks prior to the first day of the conference. The official publication date affects the deadline for any patent filings related to published work. Paper submissions will be considered for poster submission in the case they are not accepted as full papers. Venue & Registration Details --------------------------------------- For registration, please see the ICFP 2018 web site at: http://icfp18.sigplan.org/ Related Links -------------------- ICFP 2018 web site: http://icfp18.sigplan.org/ Past ACM SIGPLAN Erlang workshops: http://www.erlang.org/workshop/ Open Source Erlang: http://www.erlang.org/ EasyChair submission site: https://easychair.org/conferences/?conf=erlang18 ACM template: http://sigplan.org/Resources/Author/#acmart-format Author Information for SIGPLAN Conferences: https://www.acm.org/publications/gi-proceedings Atendee Information for SIGPLAN Events: http://www.sigplan.org/Resources/Policies/CodeOfConduct/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Fri Apr 20 15:57:12 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 20 Apr 2018 15:57:12 +0200 Subject: [erlang-questions] TLS Distribution Certificate Strategy Message-ID: <20180420135712.GA68520@erix.ericsson.se> Hello list! I am working on the task to get Erlang Distribution over TLS to be easy to use and flexible. :-/ So far I have tried to read up on the subject and messed up by misusing server_name_indication in inet_tls_dist.erl... The distribution protocol in itself has got two roles - the client and the server role. When node A connects to node B then A is the client and B is the server. All nodes are servers and any node can also be a client. When a node is client we can use the options [{verify,verify_peer}, {verify_fun,{VerifyFun,Data}}]. Then VerifyFun can verify that the certificate is valid for the Node we connect to. Remains to get the Node variable into the VerifyFun arguments - getting to that. When a node is server it is not possible to know which node that connects until after the TLS connection is up and while the ditribution handshake is performed. The there is a step to check that the connecting node is on the allowed list. This step takes a list of allowed nodes that currently is a net_kernel configuration parameter that can be modified by e.g inet_tls_dist. We can use that. So this boils down to parsing the certificate for a node name or a list thereof. My goal is that there should be a plugin function that does exactly that, that one can customize. An additional question about that certificate parsing function is whether it should return node name(s) or host name(s). Should a certificate be per node or per host or should both be possible? If a node certificate should contain host name(s) there seems to be agreement on that one could put this in the certificate's Subject field as a DistinguishedName containing a CommonName being the host name, or in an Extension subjectAltName containing a dNSName. If a node certificate should contain node name(s) I only have some half-good suggestions: * Store a node name node@REDACTED as a host name node.example.org in either of the above ways, i.e replace the `@` with `.`. * Store the node name as a CommonName as it is, either in DistinguishedName or in an Exension subjectAltName containing a directoryName that is another CommonName. * Use the DomainComponent field in DistinguishedName, multiple times, and CommonName for the node name as in "/DC=com=DC=example/CN=node". I think this maybe according to the standard's intent, but very odd. * There are lots of esoteric fields to use in a certificate, for example the Extension subjectAltName EmailAddress that syntactically fits a node name, but would that not be misuse? Related questions are: what kind of certificates can you get issued and do you want to use regular web certificates for this purpose? Should it be possible to use Let's Encrypt certificates for nodes/hosts in a cluster (you would need a node whitelist for this use case i guess)? For a cluster we can create tools that create local certificates, with any of the above content, but how general should the distribution protocol validation be? So what do people want? And what is appropriate for Cloud services? Anyone with an opinion and insight, please speak up! Best Regards -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From pierrefenoll@REDACTED Fri Apr 20 16:29:08 2018 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Fri, 20 Apr 2018 16:29:08 +0200 Subject: [erlang-questions] [ANN] otp_vsn 1.0.0 - ?OTP_VSN In-Reply-To: References: Message-ID: @Marc Worrell Thanks for the kind words! The end goal is exactly that and I am working on defining the expected macros in a way that makes sense. Any input appreciated, notable edge cases, ... @Lo?c Hoguin Thanks for taking a look! So I think I have pushed a v1 too early: *_AND_ABOVE and *_AND_BELOW are both inclusive of the current OTP version. I'm thinking of dropping the *_AND_BELOW and using a common macro prefix anyway... It's already time for a v2! Cheers, -- Pierre Fenoll On 20 April 2018 at 13:08, Marc Worrell wrote: > > > On 20 Apr 2018, at 12:51, Pierre Fenoll wrote: > > > > I just released a library called otp_vsn which defines helpful macros if > you write code that spans multiple OTP releases. > > > > For example if you want to use the #{maps => syntax} but still be able > to compile your code on releases earlier than 17.5 you can use > ifdef(OTP_VSN_17_AND_ABOVE). > > Nice work, I especially like that it is only a header file. > > I have an idea, might be somethiing to add. > Instead of relying on the OTP version for some features. > Maybe add a macro like ?OTP_SUPPORT_MAPS? ? > > Another we often define is for the changes in the dict() type, which > became dict:dict() at some point. > > In our rebar files we currently have definitions for this kind of defines. > Would be very convenient to have those at a more central place, and one > that is consistent between projects. > > Thank you for your library! > > Marc Worrell > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Fri Apr 20 16:32:06 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Fri, 20 Apr 2018 16:32:06 +0200 Subject: [erlang-questions] [ANN] otp_vsn 1.0.0 - ?OTP_VSN In-Reply-To: References: Message-ID: <5fd68bcb-f114-7ac6-7ce0-4ed46e88883c@ninenines.eu> The problem with *_AND_BELOW is not that it's inclusive of the OTP version. It's that it only contains said OTP version. There's no -define(OTP_19_AND_BELOW, 1) for OTP-18 for example. On 04/20/2018 04:29 PM, Pierre Fenoll wrote: > @Marc Worrell > Thanks for the kind words! The end goal is exactly that and I am working > on defining the expected macros in a way that makes sense. > Any input appreciated, notable edge cases, ... > > @Lo?c Hoguin > Thanks for taking a look! So I think I have pushed a v1 too early: > *_AND_ABOVE and *_AND_BELOW are both inclusive of the current OTP version. > I'm thinking of dropping the *_AND_BELOW and using a common macro prefix > anyway... It's already time for a v2! > > > > Cheers, > -- > Pierre Fenoll > > > On 20 April 2018 at 13:08, Marc Worrell > wrote: > > > > On 20 Apr 2018, at 12:51, Pierre Fenoll > wrote: > > > > I just released a library called otp_vsn which defines helpful macros if you write code that spans multiple OTP releases. > > > > For example if you want to use the #{maps => syntax} but still be able to compile your code on releases earlier than 17.5 you can use ifdef(OTP_VSN_17_AND_ABOVE). > > Nice work, I especially like that it is only a header file. > > I have an idea, might be somethiing to add. > Instead of relying on the OTP version for some features. > Maybe add a macro like ?OTP_SUPPORT_MAPS? ? > > Another we often define is for the changes in the dict() type, which > became dict:dict() at some point. > > In our rebar files we currently have definitions for this kind of > defines. > Would be very convenient to have those at a more central place, and > one that is consistent between projects. > > Thank you for your library! > > Marc Worrell > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin https://ninenines.eu From heinz@REDACTED Fri Apr 20 17:19:50 2018 From: heinz@REDACTED (Heinz N. Gies) Date: Fri, 20 Apr 2018 17:19:50 +0200 Subject: [erlang-questions] [ANN] otp_vsn 1.0.0 - ?OTP_VSN In-Reply-To: References: Message-ID: Hey I?ve been maintaining a rebar plugin for this for quite a while https://github.com/project-fifo/rebar_erl_vsn I?m curious as to why a new library instead of contributing? Did it cause you problems or not solve a problem you encountered? Cheers, Heinz > On 20. Apr 2018, at 12:51, Pierre Fenoll wrote: > > Howdy people, > > I just released a library called otp_vsn which defines helpful macros if you write code that spans multiple OTP releases. > > This saves you the copy/pasting/tweaking of erl_opts's platform_define. > Header-only, no dependencies. Supports releases from R16B01 to latest. > > For example if you want to use the #{maps => syntax} but still be able to compile your code on releases earlier than 17.5 you can use ifdef(OTP_VSN_17_AND_ABOVE). > > This release is super fresh (published 15 minutes ago) and feedback is welcomed! > I'm looking for macros that are re-defined often such as > * the maps thing I mention above > * stdlib types getting renamed > * functions being moved/renamed > > I think this library could be the place to put them in & help the community write code that still compiles on newer releases of Erlang :) > > https://hex.pm/packages/otp_vsn > https://github.com/fenollp/otp_vsn > > Thanks & have a nice day > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: Message signed with OpenPGP URL: From pierrefenoll@REDACTED Fri Apr 20 18:49:14 2018 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Fri, 20 Apr 2018 16:49:14 +0000 Subject: [erlang-questions] [ANN] otp_vsn 1.0.0 - ?OTP_VSN In-Reply-To: References: Message-ID: Oh well I didn?t know about this! Sorry about that I?ll take a look and discuss there. I need to work on other.erldocs.com and add a real search engine... On Fri 20 Apr 2018 at 17:19, Heinz N. Gies wrote: > Hey I?ve been maintaining a rebar plugin for this for quite a while > https://github.com/project-fifo/rebar_erl_vsn I?m curious as to why a new > library instead of contributing? Did it cause you problems or not solve a > problem you encountered? > > Cheers, > Heinz > > On 20. Apr 2018, at 12:51, Pierre Fenoll wrote: > > Howdy people, > > I just released a library called otp_vsn which defines helpful macros if > you write code that spans multiple OTP releases. > > This saves you the copy/pasting/tweaking of erl_opts's platform_define. > Header-only, no dependencies. Supports releases from R16B01 to latest. > > For example if you want to use the #{maps => syntax} but still be able to > compile your code on releases earlier than 17.5 you can use > ifdef(OTP_VSN_17_AND_ABOVE). > > This release is super fresh (published 15 minutes ago) and feedback is > welcomed! > I'm looking for macros that are re-defined often such as > * the maps thing I mention above > * stdlib types getting renamed > * functions being moved/renamed > > I think this library could be the place to put them in & help the > community write code that still compiles on newer releases of Erlang :) > > https://hex.pm/packages/otp_vsn > https://github.com/fenollp/otp_vsn > > Thanks & have a nice day > > _______________________________________________ > 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 heinz@REDACTED Fri Apr 20 19:51:35 2018 From: heinz@REDACTED (Heinz N. Gies) Date: Fri, 20 Apr 2018 19:51:35 +0200 Subject: [erlang-questions] [ANN] otp_vsn 1.0.0 - ?OTP_VSN In-Reply-To: References: Message-ID: <047EB0D6-93C6-449D-8956-7644C9AF15C7@licenser.net> Ah no reason for being sorry, it?s super easy to miss existing stuff ;) I just was curious if it?s a ?I didn't find this? or a ?this is horrible!? Kind of new library :), cause I would have tried to fix #2! > On 20. Apr 2018, at 18:49, Pierre Fenoll wrote: > > Oh well I didn?t know about this! Sorry about that I?ll take a look and discuss there. > I need to work on other.erldocs.com and add a real search engine... > > On Fri 20 Apr 2018 at 17:19, Heinz N. Gies > wrote: > Hey I?ve been maintaining a rebar plugin for this for quite a while https://github.com/project-fifo/rebar_erl_vsn I?m curious as to why a new library instead of contributing? Did it cause you problems or not solve a problem you encountered? > > Cheers, > Heinz > > >> On 20. Apr 2018, at 12:51, Pierre Fenoll > wrote: >> > >> Howdy people, >> >> I just released a library called otp_vsn which defines helpful macros if you write code that spans multiple OTP releases. >> >> This saves you the copy/pasting/tweaking of erl_opts's platform_define. >> Header-only, no dependencies. Supports releases from R16B01 to latest. >> >> For example if you want to use the #{maps => syntax} but still be able to compile your code on releases earlier than 17.5 you can use ifdef(OTP_VSN_17_AND_ABOVE). >> >> This release is super fresh (published 15 minutes ago) and feedback is welcomed! >> I'm looking for macros that are re-defined often such as >> * the maps thing I mention above >> * stdlib types getting renamed >> * functions being moved/renamed >> >> I think this library could be the place to put them in & help the community write code that still compiles on newer releases of Erlang :) >> >> https://hex.pm/packages/otp_vsn >> https://github.com/fenollp/otp_vsn >> >> Thanks & have a nice day > >> _______________________________________________ >> 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: Message signed with OpenPGP URL: From wadt18@REDACTED Fri Apr 20 23:49:19 2018 From: wadt18@REDACTED (WADT 2018) Date: Fri, 20 Apr 2018 21:49:19 +0000 Subject: [erlang-questions] WADT 2018 - 3rd Call for Papers & Leverhulme School Message-ID: ====================================================================== THIRD CALL FOR PAPERS WADT 2018 24th International Workshop on Algebraic Development Techniques http://wadt18.cs.rhul.ac.uk July 2?5, 2018, Royal Holloway University of London, Egham, UK AND FIRST CALL FOR PARTICIPATION Leverhulme School on Graph Transformation Techniques 2018 http://wadt18.cs.rhul.ac.uk/lsgt June 29?July 1, 2018, Royal Holloway University of London, Egham, UK ====================================================================== AIMS AND SCOPE The algebraic approach to system specification encompasses many aspects of the formal design of software systems. Originally born as a formal method for reasoning about abstract data types, it now covers new specification frameworks and programming paradigms (such as object-oriented, aspect-oriented, agent-oriented, logic and higher-order functional programming) as well as a wide range of application areas (including information systems, concurrent, distributed and mobile systems). The workshop will provide an opportunity to present recent and ongoing work, to meet colleagues, and to discuss new ideas and future trends. TOPICS OF INTEREST Typical, but not exclusive topics of interest are: ? Foundations of algebraic specification ? Other approaches to formal specification, including process calculi and models of concurrent, distributed, and cyber-physical systems ? Specification languages, methods, and environments ? Semantics of conceptual modelling methods and techniques ? Model-driven development ? Graph transformations, term rewriting, and proof systems ? Integration of formal specification techniques ? Formal testing and quality assurance, validation, and verification ? Algebraic approaches to cognitive sciences, including computational creativity WORKSHOP FORMAT AND LOCATION The workshop will take place over four days, Monday to Thursday, at Royal Holloway University of London in Egham, UK (https://www.royalholloway.ac.uk). Presentations will be selected on the basis of submitted abstracts. This occurrence of the ADT workshop will be preceded by the Leverhulme School on Graph Transformation Techniques. The school will take place over three days, from Friday, June 29th, to Sunday, July 1st, and will comprise a self-contained series of invited lectures on graph transformation to be given by Reiko Heckel (University of Leicester, UK), Fernando Orejas (Technical University of Catalonia, Spain), and Detlef Plump (University of York, UK). INVITED SPEAKERS Artur d'Avila Garcez (City, University of London, UK) Rolf Hennicker (LMU Munich, Germany) Kai-Uwe K?hnberger (Osnabr?ck University, Germany) Fernando Orejas (Technical University of Catalonia, Spain) IMPORTANT DATES Submission deadline for abstracts: April 27th, 2018 Notification of acceptance: May 18th, 2018 Early registration: June 1st, 2018 Final abstract due: June 1st, 2018 Leverhulme School on Graph Transformation Techniques: June 29?July 1, 2018 ADT Workshop: July 2?5, 2018 SUBMISSIONS The scientific programme of the workshop will include presentations of recent results or ongoing research as well as invited talks. The presentations will be selected by the Steering Committee on the basis of submitted abstracts according to originality, significance and general interest. Abstracts must not exceed two pages including references; if a longer version of the contribution is available, it can be made accessible on the web and referenced in the abstract. Abstracts have to be submitted electronically via the EasyChair system at https://easychair.org/conferences/?conf=wadt18. PROCEEDINGS After the workshop, authors will be invited to submit full papers for the refereed proceedings. All submissions will be reviewed by the Programme Committee. Selection will be based on originality, soundness, and significance of the presented ideas and results. The proceedings will be published as a volume of Lecture Notes in Computer Science (Springer). The deadline for submissions will be September 3, 2018, with notifications by October 29. Camera-ready versions will be required by November 11. SPONSORSHIP The workshop takes place under the auspices of IFIP WG 1.3, while the series of graph-transformation lectures is supported by a Leverhulme Trust Visiting Professorship. WADT STEERING COMMITTEE Andrea Corradini (Italy) Jos? Fiadeiro (UK) [co-chair] Rolf Hennicker (Germany) Hans-J?rg Kreowski (Germany) Till Mossakowski (Germany) Fernando Orejas (Spain) Markus Roggenbach (UK) Grigore Ro?u (United States) PROGRAMME COMMITEE Paolo Baldan (Italy) Andrea Corradini (Italy) Artur d'Avila Garcez (UK) R?zvan Diaconescu (Romania) Jos? Fiadeiro (UK) [co-chair] Fabio Gadducci (Italy) Reiko Heckel (UK) Rolf Hennicker (Germany) Alexander Knapp (Germany) Barbara K?nig (Germany) Ant?nia Lopes (Portugal) Narciso Marti-Oliet (Spain) Till Mossakowski (Germany) Fernando Orejas (Spain) Leila Ribeiro (Brazil) Markus Roggenbach (UK) Pierre-Yves Schobbens (Belgium) Lutz Schr?der (Germany) Pawel Sobocinski (UK) Ionu? ?u?u (UK) [co-chair] Martin Wirsing (Germany) ORGANIZING COMMITTEE Claudia Chiri?? (UK) Jos? Fiadeiro (UK) Ionu? ?u?u (UK) CONTACT INFORMATION Email: wadt18@REDACTED Homepage: http://wadt18.cs.rhul.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincefoley@REDACTED Sat Apr 21 03:25:45 2018 From: vincefoley@REDACTED (Vince Foley) Date: Fri, 20 Apr 2018 18:25:45 -0700 Subject: [erlang-questions] Segfault in do_allocate_logger_message Message-ID: Hi folks, I recently encountered a pretty strange segfault, and I was wondering if anyone could provide any insight... The process is running just fine and then disappears. I grabbed the coredump and opened it up and found this output: ``` Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00000000004c9511 in do_allocate_logger_message (p=, sz=280577276613695, bp=, ohp=, hp=0x7f97ba57f7f0, gleader=128) at beam/utils.c:1958 ``` There's a little more context in the backtrace... ``` (gdb) backtrace #0 0x00000000004c9511 in do_allocate_logger_message (p=, sz=280577276613695, bp=, ohp=, hp=0x7f97ba57f7f0, gleader=128) at beam/utils.c:1958 #1 do_send_term_to_logger (tag=843, args=140289643116560, len=-966352886, buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2058 #2 send_error_term_to_logger (args=140289643116560, len=-966352886, buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2106 #3 erts_send_error_term_to_logger (gleader=128, dsbufp=0x7f97c1f7db70, args=140289643116560) at beam/utils.c:2187 #4 0x000000000059d990 in erts_bs_put_utf8 (EBS=0x7f97c1f7db72, arg=140289845403658) at beam/erl_bits.c:850 #5 0x00007f97bfb79898 in ?? () #6 0x000000000000001e in ?? () #7 0x00007f97b5c675a8 in ?? () #8 0x00007f97bb25b5d8 in ?? () #9 0x00007f97b5c25ad8 in ?? () #10 0x00007f97c1f7b282 in ?? () #11 0x8450345d9c222796 in ?? () #12 0x00007f97bfc47008 in ?? () #13 0x00007f97bc8c3338 in ?? () #14 0x0000000000449c14 in process_main (x_reg_array=0x7f97b5c66d30, f_reg_array=0x7f97c666a00a) at x86_64-pc-linux-musl/opt/smp/beam_hot.h:943 #15 0x00007f97bba80100 in ?? () #16 0x0000000000000000 in ?? () ``` I do have an error_handler module added to the error_logger. Although there doesn't appear to be any noticable memory growth or message queue backup in the error_logger process before it dies. I can't quite trigger it myself but it does happen on a regular basis. Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:10] [hipe] [kernel-poll:false] Elixir 1.6.4 (compiled with OTP 20) Alpine 3.7 Anyone have any clues? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikpelinux@REDACTED Sat Apr 21 10:10:04 2018 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Sat, 21 Apr 2018 10:10:04 +0200 Subject: [erlang-questions] Segfault in do_allocate_logger_message In-Reply-To: References: Message-ID: On Sat, Apr 21, 2018 at 3:25 AM, Vince Foley wrote: > Hi folks, I recently encountered a pretty strange segfault, and I was > wondering if anyone could provide any insight... > > The process is running just fine and then disappears. I grabbed the coredump > and opened it up and found this output: > > ``` > Program terminated with signal SIGSEGV, Segmentation fault. > #0 0x00000000004c9511 in do_allocate_logger_message (p=, > sz=280577276613695, bp=, ohp=, > hp=0x7f97ba57f7f0, gleader=128) > at beam/utils.c:1958 > ``` > > There's a little more context in the backtrace... > > ``` > (gdb) backtrace > #0 0x00000000004c9511 in do_allocate_logger_message (p=, > sz=280577276613695, bp=, ohp=, > hp=0x7f97ba57f7f0, gleader=128) > at beam/utils.c:1958 > #1 do_send_term_to_logger (tag=843, args=140289643116560, len=-966352886, > buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2058 > #2 send_error_term_to_logger (args=140289643116560, len=-966352886, > buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2106 > #3 erts_send_error_term_to_logger (gleader=128, dsbufp=0x7f97c1f7db70, > args=140289643116560) at beam/utils.c:2187 First, you're clearly on a 64-bit machine, I'm going to assume Linux/x86-64. What I think happened here is that you generated an error term with an output representation larger than 2GB. In erts_send_error_term_to_logger() there is an unchecked narrowing conversion from size_t to int as dsbufp->str_len is passed to send_error_term_to_logger(). In the stack dump above, you see a large but negative 32-bit value in the "len" parameters -- that's a common sign of this kind of problem. If you can, please re-run gdb, "up" to the erts_send_error_term_to_logger() frame, and "print *dsbufp"; I suspect dsbufp->str_len will be >=2GB. Then in do_send_term_to_logger() the negative len is use to compute the size of the message buffer, which results in sz=280577276613695 which is bogus (it's about 261 GB). The actual SIGSEGV probably comes from the new_message_buffer() call on line 1956 returning NULL for this bogus size. Fixing this will require code changes in util.c and maybe elsewhere too. What you can do meanwhile is to try to limit the sizes of terms sent to the error logger so their output representation is less than 2GB. (As I type this I spot another bug in do_send_term_to_logger(), so you'll want to halve that limit to be less than 1GB.) /Mikael > #4 0x000000000059d990 in erts_bs_put_utf8 (EBS=0x7f97c1f7db72, > arg=140289845403658) at beam/erl_bits.c:850 > #5 0x00007f97bfb79898 in ?? () > #6 0x000000000000001e in ?? () > #7 0x00007f97b5c675a8 in ?? () > #8 0x00007f97bb25b5d8 in ?? () > #9 0x00007f97b5c25ad8 in ?? () > #10 0x00007f97c1f7b282 in ?? () > #11 0x8450345d9c222796 in ?? () > #12 0x00007f97bfc47008 in ?? () > #13 0x00007f97bc8c3338 in ?? () > #14 0x0000000000449c14 in process_main (x_reg_array=0x7f97b5c66d30, > f_reg_array=0x7f97c666a00a) at x86_64-pc-linux-musl/opt/smp/beam_hot.h:943 > #15 0x00007f97bba80100 in ?? () > #16 0x0000000000000000 in ?? () > ``` > > I do have an error_handler module added to the error_logger. Although there > doesn't appear to be any noticable memory growth or message queue backup in > the error_logger process before it dies. > > I can't quite trigger it myself but it does happen on a regular basis. > > Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] > [async-threads:10] [hipe] [kernel-poll:false] > Elixir 1.6.4 (compiled with OTP 20) > Alpine 3.7 > > Anyone have any clues? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From mikpelinux@REDACTED Sat Apr 21 14:23:41 2018 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Sat, 21 Apr 2018 14:23:41 +0200 Subject: [erlang-questions] Segfault in do_allocate_logger_message In-Reply-To: References: Message-ID: On Sat, Apr 21, 2018 at 10:10 AM, Mikael Pettersson wrote: > On Sat, Apr 21, 2018 at 3:25 AM, Vince Foley wrote: >> Hi folks, I recently encountered a pretty strange segfault, and I was >> wondering if anyone could provide any insight... >> >> The process is running just fine and then disappears. I grabbed the coredump >> and opened it up and found this output: >> >> ``` >> Program terminated with signal SIGSEGV, Segmentation fault. >> #0 0x00000000004c9511 in do_allocate_logger_message (p=, >> sz=280577276613695, bp=, ohp=, >> hp=0x7f97ba57f7f0, gleader=128) >> at beam/utils.c:1958 >> ``` >> >> There's a little more context in the backtrace... >> >> ``` >> (gdb) backtrace >> #0 0x00000000004c9511 in do_allocate_logger_message (p=, >> sz=280577276613695, bp=, ohp=, >> hp=0x7f97ba57f7f0, gleader=128) >> at beam/utils.c:1958 >> #1 do_send_term_to_logger (tag=843, args=140289643116560, len=-966352886, >> buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2058 >> #2 send_error_term_to_logger (args=140289643116560, len=-966352886, >> buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2106 >> #3 erts_send_error_term_to_logger (gleader=128, dsbufp=0x7f97c1f7db70, >> args=140289643116560) at beam/utils.c:2187 > > First, you're clearly on a 64-bit machine, I'm going to assume Linux/x86-64. > > What I think happened here is that you generated an error term with an output > representation larger than 2GB. In erts_send_error_term_to_logger() there is an > unchecked narrowing conversion from size_t to int as dsbufp->str_len is passed > to send_error_term_to_logger(). In the stack dump above, you see a large but > negative 32-bit value in the "len" parameters -- that's a common sign > of this kind > of problem. If you can, please re-run gdb, "up" to the > erts_send_error_term_to_logger() > frame, and "print *dsbufp"; I suspect dsbufp->str_len will be >=2GB. > > Then in do_send_term_to_logger() the negative len is use to compute the size > of the message buffer, which results in sz=280577276613695 which is bogus > (it's about 261 GB). > > The actual SIGSEGV probably comes from the new_message_buffer() call on > line 1956 returning NULL for this bogus size. > > Fixing this will require code changes in util.c and maybe elsewhere too. Proposed fix: https://github.com/erlang/otp/pull/1795 > > What you can do meanwhile is to try to limit the sizes of terms sent to the > error logger so their output representation is less than 2GB. (As I type this I > spot another bug in do_send_term_to_logger(), so you'll want to halve that > limit to be less than 1GB.) > > /Mikael > >> #4 0x000000000059d990 in erts_bs_put_utf8 (EBS=0x7f97c1f7db72, >> arg=140289845403658) at beam/erl_bits.c:850 >> #5 0x00007f97bfb79898 in ?? () >> #6 0x000000000000001e in ?? () >> #7 0x00007f97b5c675a8 in ?? () >> #8 0x00007f97bb25b5d8 in ?? () >> #9 0x00007f97b5c25ad8 in ?? () >> #10 0x00007f97c1f7b282 in ?? () >> #11 0x8450345d9c222796 in ?? () >> #12 0x00007f97bfc47008 in ?? () >> #13 0x00007f97bc8c3338 in ?? () >> #14 0x0000000000449c14 in process_main (x_reg_array=0x7f97b5c66d30, >> f_reg_array=0x7f97c666a00a) at x86_64-pc-linux-musl/opt/smp/beam_hot.h:943 >> #15 0x00007f97bba80100 in ?? () >> #16 0x0000000000000000 in ?? () >> ``` >> >> I do have an error_handler module added to the error_logger. Although there >> doesn't appear to be any noticable memory growth or message queue backup in >> the error_logger process before it dies. >> >> I can't quite trigger it myself but it does happen on a regular basis. >> >> Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] >> [async-threads:10] [hipe] [kernel-poll:false] >> Elixir 1.6.4 (compiled with OTP 20) >> Alpine 3.7 >> >> Anyone have any clues? >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> From vincefoley@REDACTED Sat Apr 21 22:51:38 2018 From: vincefoley@REDACTED (Vince Foley) Date: Sat, 21 Apr 2018 13:51:38 -0700 Subject: [erlang-questions] Segfault in do_allocate_logger_message In-Reply-To: References: Message-ID: Thanks for taking a look and such a quick PR! Here's the output from the gdb commands: ``` Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00000000004c9511 in do_allocate_logger_message (p=, sz=280577276613695, bp=, ohp=, hp=0x7f97ba57f7f0, gleader=128) at beam/utils.c:1958 1958 *hp = (*bp)->mem; [Current thread is 1 (LWP 511)] (gdb) up #1 do_send_term_to_logger (tag=843, args=140289643116560, len=-966352886, buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2058 2058 gl = do_allocate_logger_message(gleader, &hp, &ohp, &bp, &p, sz); (gdb) up #2 send_error_term_to_logger (args=140289643116560, len=-966352886, buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2106 2106 return do_send_term_to_logger(am_error, gleader, buf, len, args); (gdb) up #3 erts_send_error_term_to_logger (gleader=128, dsbufp=0x7f97c1f7db70, args=140289643116560) at beam/utils.c:2187 2187 res = send_error_term_to_logger(gleader, dsbufp->str, dsbufp->str_len, args); (gdb) list 2182 2183 int 2184 erts_send_error_term_to_logger(Eterm gleader, erts_dsprintf_buf_t *dsbufp, Eterm args) 2185 { 2186 int res; 2187 res = send_error_term_to_logger(gleader, dsbufp->str, dsbufp->str_len, args); 2188 destroy_logger_dsbuf(dsbufp); 2189 return res; 2190 } 2191 (gdb) print *dsbufp $1 = {str = 0x80 , str_len = 1506955, size = 401995, grow = 0x30000000160} ``` I'm not sure if that confirms your hypothesis or not... I did find some huge size numbers in `args` though: ``` #1 do_send_term_to_logger (tag=843, args=140289643116560, len=-966352886, buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2058 2058 gl = do_allocate_logger_message(gleader, &hp, &ohp, &bp, &p, sz); (gdb) list 2053 args_sz = size_object(args); 2054 sz = len * 2 /* format */ + args_sz 2055 + 3 /*outer 2-tuple*/ + 4 /* middle 3-tuple */ + 4 /*inner 3-tuple */; 2056 2057 /* gleader size is accounted and allocated next */ 2058 gl = do_allocate_logger_message(gleader, &hp, &ohp, &bp, &p, sz); 2059 2060 if(is_nil(gl)) { 2061 /* buf *always* points to a null terminated string */ 2062 erts_fprintf(stderr, "(no error logger present) %T: \"%s\" %T\n", (gdb) print args_sz $1 = 140289566202896 (gdb) print sz $2 = 140287633497135 ``` Side question.. I am trying to use the etp commands to print out the Erlang terms ( https://github.com/erlang/otp/blob/master/erts/etc/unix/etp-commands.in) I keep getting this error: ``` (gdb) etp *bp Cannot access memory at address 0xb974e0 ``` And this kind of thing: ``` (gdb) etp-processes No processes, since system isn't initialized! ``` Am I doing something wrong, or is this just not possible with my coredump? On Sat, Apr 21, 2018 at 1:10 AM, Mikael Pettersson wrote: > On Sat, Apr 21, 2018 at 3:25 AM, Vince Foley wrote: > > Hi folks, I recently encountered a pretty strange segfault, and I was > > wondering if anyone could provide any insight... > > > > The process is running just fine and then disappears. I grabbed the > coredump > > and opened it up and found this output: > > > > ``` > > Program terminated with signal SIGSEGV, Segmentation fault. > > #0 0x00000000004c9511 in do_allocate_logger_message (p= pointer>, > > sz=280577276613695, bp=, ohp=, > > hp=0x7f97ba57f7f0, gleader=128) > > at beam/utils.c:1958 > > ``` > > > > There's a little more context in the backtrace... > > > > ``` > > (gdb) backtrace > > #0 0x00000000004c9511 in do_allocate_logger_message (p= pointer>, > > sz=280577276613695, bp=, ohp=, > > hp=0x7f97ba57f7f0, gleader=128) > > at beam/utils.c:1958 > > #1 do_send_term_to_logger (tag=843, args=140289643116560, > len=-966352886, > > buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2058 > > #2 send_error_term_to_logger (args=140289643116560, len=-966352886, > > buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2106 > > #3 erts_send_error_term_to_logger (gleader=128, dsbufp=0x7f97c1f7db70, > > args=140289643116560) at beam/utils.c:2187 > > First, you're clearly on a 64-bit machine, I'm going to assume > Linux/x86-64. > > What I think happened here is that you generated an error term with an > output > representation larger than 2GB. In erts_send_error_term_to_logger() > there is an > unchecked narrowing conversion from size_t to int as dsbufp->str_len is > passed > to send_error_term_to_logger(). In the stack dump above, you see a large > but > negative 32-bit value in the "len" parameters -- that's a common sign > of this kind > of problem. If you can, please re-run gdb, "up" to the > erts_send_error_term_to_logger() > frame, and "print *dsbufp"; I suspect dsbufp->str_len will be >=2GB. > > Then in do_send_term_to_logger() the negative len is use to compute the > size > of the message buffer, which results in sz=280577276613695 which is bogus > (it's about 261 GB). > > The actual SIGSEGV probably comes from the new_message_buffer() call on > line 1956 returning NULL for this bogus size. > > Fixing this will require code changes in util.c and maybe elsewhere too. > > What you can do meanwhile is to try to limit the sizes of terms sent to the > error logger so their output representation is less than 2GB. (As I type > this I > spot another bug in do_send_term_to_logger(), so you'll want to halve that > limit to be less than 1GB.) > > /Mikael > > > #4 0x000000000059d990 in erts_bs_put_utf8 (EBS=0x7f97c1f7db72, > > arg=140289845403658) at beam/erl_bits.c:850 > > #5 0x00007f97bfb79898 in ?? () > > #6 0x000000000000001e in ?? () > > #7 0x00007f97b5c675a8 in ?? () > > #8 0x00007f97bb25b5d8 in ?? () > > #9 0x00007f97b5c25ad8 in ?? () > > #10 0x00007f97c1f7b282 in ?? () > > #11 0x8450345d9c222796 in ?? () > > #12 0x00007f97bfc47008 in ?? () > > #13 0x00007f97bc8c3338 in ?? () > > #14 0x0000000000449c14 in process_main (x_reg_array=0x7f97b5c66d30, > > f_reg_array=0x7f97c666a00a) at x86_64-pc-linux-musl/opt/smp/ > beam_hot.h:943 > > #15 0x00007f97bba80100 in ?? () > > #16 0x0000000000000000 in ?? () > > ``` > > > > I do have an error_handler module added to the error_logger. Although > there > > doesn't appear to be any noticable memory growth or message queue backup > in > > the error_logger process before it dies. > > > > I can't quite trigger it myself but it does happen on a regular basis. > > > > Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] > > [async-threads:10] [hipe] [kernel-poll:false] > > Elixir 1.6.4 (compiled with OTP 20) > > Alpine 3.7 > > > > Anyone have any clues? > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Sun Apr 22 10:40:49 2018 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Sun, 22 Apr 2018 10:40:49 +0200 Subject: [erlang-questions] [ANN] otp_vsn 1.0.0 - ?OTP_VSN In-Reply-To: References: Message-ID: Hi Pierre, > I'm looking for macros that are re-defined often such as > * the maps thing I mention above > * stdlib types getting renamed > * functions being moved/renamed As en entry point, you can have a look to release diffs I did for geas tool. in Yaml format : https://github.com/crownedgrouse/geas_devel/tree/master/doc/reldiffs/yaml as well Erlang term format : https://github.com/crownedgrouse/geas_devel/tree/master/doc/reldiffs/term This will tell you what module/function was added/removed between two subsequent releases. This may help to create missing macros, possibly by automatic process... regards From technion@REDACTED Sun Apr 22 13:53:24 2018 From: technion@REDACTED (Technion) Date: Sun, 22 Apr 2018 11:53:24 +0000 Subject: [erlang-questions] Backreferences with re module Message-ID: Hi, I seem to be having some issues with the re: module any time a back reference is introduced. (yes, I ideally wouldn't use a regex, I have one place I really need to) Referencing the module manual here: http://erlang.org/doc/man/re.html A specific example is given: Consider, for example: (.*)abc\1 If the subject is "xyz123abc123", the match point is the fourth character. However, I've simplified my code down to that exact example and I can't make it match: 46> {ok, MP} = re:compile("(.*)abc\1"). {ok,{re_pattern,1,0,0, <<69,82,67,80,89,0,0,0,0,0,0,0,65,1,0,0,255,255,255,255, 255,255,...>>}} 47> re:run("xyz123abc123", MP, [{capture,all_names,binary}]). nomatch I have written all manner of patterns without a back reference that return a match fine: 48> {ok, MP2} = re:compile("(.*)abc123"). {ok,{re_pattern,1,0,0, <<69,82,67,80,93,0,0,0,0,0,0,0,65,1,0,0,255,255,255,255, 255,255,...>>}} 50> re:run("xyz123abc123", MP2, [{capture,all,binary}]). {match,[<<"xyz123abc123">>,<<"xyz123">>]} My platform: Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.3 (abort with ^G) The presented syntax works perfectly fine in Ruby, further suggesting the regex is correct: irb(main):001:0> /(.*)abc\1/.match("xyz123abc123") => # Any assistance on this is appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Sun Apr 22 14:12:02 2018 From: vinoski@REDACTED (Steve Vinoski) Date: Sun, 22 Apr 2018 08:12:02 -0400 Subject: [erlang-questions] Backreferences with re module In-Reply-To: References: Message-ID: On Sun, Apr 22, 2018 at 7:53 AM, Technion wrote: > Hi, > > > I seem to be having some issues with the re: module any time a back > reference is introduced. > > > (yes, I ideally wouldn't use a regex, I have one place I really need to) > > > Referencing the module manual here: > > http://erlang.org/doc/man/re.html > > > A specific example is given: > > > *Consider, for example:* > > *(.*)abc\1 If the subject is "xyz123abc123", the match point is the fourth > character. * > > However, I've simplified my code down to that exact example and I can't > make it match: > > > 46> {ok, MP} = re:compile("(.*)abc\1"). > You need a double backslash here instead: {ok, MP} = re:compile("(.*)abc\\1"). Look at the note near the top of the re man page http://erlang.org/doc/man/re.html : 'The Erlang literal syntax for strings uses the "\" (backslash) character as an escape code. You need to escape backslashes in literal strings, both in your code and in the shell, with an extra backslash, that is, "\\".' --steve {ok,{re_pattern,1,0,0, > <<69,82,67,80,89,0,0,0,0,0,0,0,65,1,0,0,255,255,255,255, > 255,255,...>>}} > 47> re:run("xyz123abc123", MP, [{capture,all_names,binary}]). > nomatch > > I have written all manner of patterns without a back reference that return > a match fine: > > > 48> {ok, MP2} = re:compile("(.*)abc123"). > {ok,{re_pattern,1,0,0, > <<69,82,67,80,93,0,0,0,0,0,0,0,65,1,0,0,255,255,255,255, > 255,255,...>>}} > 50> re:run("xyz123abc123", MP2, [{capture,all,binary}]). > {match,[<<"xyz123abc123">>,<<"xyz123">>]} > > My platform: > > Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:1:1] [ds:1:1:10] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.3 (abort with ^G) > > The presented syntax works perfectly fine in Ruby, further suggesting the > regex is correct: > > irb(main):001:0> /(.*)abc\1/.match("xyz123abc123") > => # > > > Any assistance on this is appreciated. > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From technion@REDACTED Sun Apr 22 14:21:24 2018 From: technion@REDACTED (Technion) Date: Sun, 22 Apr 2018 12:21:24 +0000 Subject: [erlang-questions] Backreferences with re module In-Reply-To: References: , Message-ID: Thanks a heap Steve. I must have read that man page a dozen times but that two liner escaped me every time. ________________________________ From: vinoski@REDACTED on behalf of Steve Vinoski Sent: Sunday, 22 April 2018 10:12:02 PM To: Technion Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] Backreferences with re module On Sun, Apr 22, 2018 at 7:53 AM, Technion > wrote: Hi, I seem to be having some issues with the re: module any time a back reference is introduced. (yes, I ideally wouldn't use a regex, I have one place I really need to) Referencing the module manual here: http://erlang.org/doc/man/re.html A specific example is given: Consider, for example: (.*)abc\1 If the subject is "xyz123abc123", the match point is the fourth character. However, I've simplified my code down to that exact example and I can't make it match: 46> {ok, MP} = re:compile("(.*)abc\1"). You need a double backslash here instead: {ok, MP} = re:compile("(.*)abc\\1"). Look at the note near the top of the re man page http://erlang.org/doc/man/re.html : 'The Erlang literal syntax for strings uses the "\" (backslash) character as an escape code. You need to escape backslashes in literal strings, both in your code and in the shell, with an extra backslash, that is, "\\".' --steve {ok,{re_pattern,1,0,0, <<69,82,67,80,89,0,0,0,0,0,0,0,65,1,0,0,255,255,255,255, 255,255,...>>}} 47> re:run("xyz123abc123", MP, [{capture,all_names,binary}]). nomatch I have written all manner of patterns without a back reference that return a match fine: 48> {ok, MP2} = re:compile("(.*)abc123"). {ok,{re_pattern,1,0,0, <<69,82,67,80,93,0,0,0,0,0,0,0,65,1,0,0,255,255,255,255, 255,255,...>>}} 50> re:run("xyz123abc123", MP2, [{capture,all,binary}]). {match,[<<"xyz123abc123">>,<<"xyz123">>]} My platform: Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.3 (abort with ^G) The presented syntax works perfectly fine in Ruby, further suggesting the regex is correct: irb(main):001:0> /(.*)abc\1/.match("xyz123abc123") => # Any assistance on this is appreciated. _______________________________________________ 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 Sun Apr 22 22:33:55 2018 From: cean.ebengt@REDACTED (bengt) Date: Sun, 22 Apr 2018 22:33:55 +0200 Subject: [erlang-questions] Wanted: A method to find all paths from V1 to V2 using digraph module Message-ID: <33DD8E57-644C-477E-A70A-199988FDC7EC@gmail.com> Greetings, The digraph module has get_path/3 to find one path from V1 to V2. Is there a way to find all paths? I considered removing the found path and trying again, but that does not work when paths overlap. Best Wishes, bengt From vladdu55@REDACTED Sun Apr 22 23:44:33 2018 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Sun, 22 Apr 2018 23:44:33 +0200 Subject: [erlang-questions] Wanted: A method to find all paths from V1 to V2 using digraph module In-Reply-To: <33DD8E57-644C-477E-A70A-199988FDC7EC@gmail.com> References: <33DD8E57-644C-477E-A70A-199988FDC7EC@gmail.com> Message-ID: Hi Bengt, The solution is to do a search starting from one of the vertices and keep track of the found paths (saving a stack of already traversed vertices and watching out for cycles), but in the worst case it is an O(n!) algorithm. Even in non-pathological cases, it is easy to get an untractable number of solutions as the complexity is exponential. Someone asked the same thing before at https://stackoverflow.com/questions/7834702/find-all-possible-paths-from-one-vertex-in-a-directed-cyclic-graph-in-erlang best regards, Vlad On Sun, Apr 22, 2018 at 10:33 PM, bengt wrote: > Greetings, > > The digraph module has get_path/3 to find one path from V1 to V2. Is there > a way to find all paths? > I considered removing the found path and trying again, but that does not > work when paths overlap. > > Best Wishes, > bengt > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vdasari@REDACTED Sun Apr 22 23:49:59 2018 From: vdasari@REDACTED (Vasu Dasari) Date: Sun, 22 Apr 2018 17:49:59 -0400 Subject: [erlang-questions] Wanted: A method to find all paths from V1 to V2 using digraph module In-Reply-To: References: <33DD8E57-644C-477E-A70A-199988FDC7EC@gmail.com> Message-ID: Hi Bengt, Can you check digraph.erl source code for function get_short_path/1, which might give you some ideas of retrieving list of paths between vertices: -Vasu -spec get_short_path(G, V1, V2) -> Vertices | 'false' when G :: graph(), V1 :: vertex(), V2 :: vertex(), Vertices :: [vertex(),...]. get_short_path(G, V1, V2) -> T = new(), add_vertex(T, V1), Q = queue:new(), Q1 = queue_out_neighbours(V1, G, Q), L = spath(Q1, G, V2, T), delete(T), L. *Vasu Dasari* On Sun, Apr 22, 2018 at 5:44 PM, Vlad Dumitrescu wrote: > Hi Bengt, > > The solution is to do a search starting from one of the vertices and keep > track of the found paths (saving a stack of already traversed vertices and > watching out for cycles), but in the worst case it is an O(n!) algorithm. > Even in non-pathological cases, it is easy to get an untractable number of > solutions as the complexity is exponential. > > Someone asked the same thing before at https://stackoverflow.com/ > questions/7834702/find-all-possible-paths-from-one- > vertex-in-a-directed-cyclic-graph-in-erlang > > best regards, > Vlad > > > On Sun, Apr 22, 2018 at 10:33 PM, bengt wrote: > >> Greetings, >> >> The digraph module has get_path/3 to find one path from V1 to V2. Is >> there a way to find all paths? >> I considered removing the found path and trying again, but that does not >> work when paths overlap. >> >> Best Wishes, >> bengt >> _______________________________________________ >> 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 mikpelinux@REDACTED Mon Apr 23 11:14:29 2018 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Mon, 23 Apr 2018 11:14:29 +0200 Subject: [erlang-questions] Segfault in do_allocate_logger_message In-Reply-To: References: Message-ID: On Sat, Apr 21, 2018 at 10:51 PM, Vince Foley wrote: > Thanks for taking a look and such a quick PR! Here's the output from the gdb > commands: > > ``` > Program terminated with signal SIGSEGV, Segmentation fault. > #0 0x00000000004c9511 in do_allocate_logger_message (p=, > sz=280577276613695, bp=, ohp=, > hp=0x7f97ba57f7f0, gleader=128) at beam/utils.c:1958 > 1958 *hp = (*bp)->mem; > [Current thread is 1 (LWP 511)] > (gdb) up > #1 do_send_term_to_logger (tag=843, args=140289643116560, len=-966352886, > buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2058 > 2058 gl = do_allocate_logger_message(gleader, &hp, &ohp, &bp, &p, sz); > (gdb) up > #2 send_error_term_to_logger (args=140289643116560, len=-966352886, > buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2106 > 2106 return do_send_term_to_logger(am_error, gleader, buf, len, args); > (gdb) up > #3 erts_send_error_term_to_logger (gleader=128, dsbufp=0x7f97c1f7db70, > args=140289643116560) at beam/utils.c:2187 > 2187 res = send_error_term_to_logger(gleader, dsbufp->str, > dsbufp->str_len, args); > (gdb) list > 2182 > 2183 int > 2184 erts_send_error_term_to_logger(Eterm gleader, erts_dsprintf_buf_t > *dsbufp, Eterm args) > 2185 { > 2186 int res; > 2187 res = send_error_term_to_logger(gleader, dsbufp->str, > dsbufp->str_len, args); > 2188 destroy_logger_dsbuf(dsbufp); > 2189 return res; > 2190 } > 2191 > (gdb) print *dsbufp > $1 = {str = 0x80 , str_len = > 1506955, size = 401995, grow = 0x30000000160} > ``` > > I'm not sure if that confirms your hypothesis or not... The values look weird, I'm pretty sure that *dsbufp got overwritten at some point. (My analysis about potential misbehaviour still holds though, just not confirmed by your core.) > > I did find some huge size numbers in `args` though: "args" is an Eterm encoding a pointer to a list in the heap, so it's expected to be large. > > > ``` > #1 do_send_term_to_logger (tag=843, args=140289643116560, len=-966352886, > buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2058 > 2058 gl = do_allocate_logger_message(gleader, &hp, &ohp, &bp, &p, sz); > (gdb) list > 2053 args_sz = size_object(args); > 2054 sz = len * 2 /* format */ + args_sz > 2055 + 3 /*outer 2-tuple*/ + 4 /* middle 3-tuple */ + 4 /*inner 3-tuple */; > 2056 > 2057 /* gleader size is accounted and allocated next */ > 2058 gl = do_allocate_logger_message(gleader, &hp, &ohp, &bp, &p, sz); > 2059 > 2060 if(is_nil(gl)) { > 2061 /* buf *always* points to a null terminated string */ > 2062 erts_fprintf(stderr, "(no error logger present) %T: \"%s\" %T\n", > (gdb) print args_sz > $1 = 140289566202896 > (gdb) print sz > $2 = 140287633497135 > ``` > > > Side question.. I am trying to use the etp commands to print out the Erlang > terms > (https://github.com/erlang/otp/blob/master/erts/etc/unix/etp-commands.in) > > I keep getting this error: > ``` > (gdb) etp *bp > Cannot access memory at address 0xb974e0 > ``` > > And this kind of thing: > ``` > (gdb) etp-processes > No processes, since system isn't initialized! > ``` > > Am I doing something wrong, or is this just not possible with my coredump? > > > On Sat, Apr 21, 2018 at 1:10 AM, Mikael Pettersson > wrote: >> >> On Sat, Apr 21, 2018 at 3:25 AM, Vince Foley wrote: >> > Hi folks, I recently encountered a pretty strange segfault, and I was >> > wondering if anyone could provide any insight... >> > >> > The process is running just fine and then disappears. I grabbed the >> > coredump >> > and opened it up and found this output: >> > >> > ``` >> > Program terminated with signal SIGSEGV, Segmentation fault. >> > #0 0x00000000004c9511 in do_allocate_logger_message (p=> > pointer>, >> > sz=280577276613695, bp=, ohp=, >> > hp=0x7f97ba57f7f0, gleader=128) >> > at beam/utils.c:1958 >> > ``` >> > >> > There's a little more context in the backtrace... >> > >> > ``` >> > (gdb) backtrace >> > #0 0x00000000004c9511 in do_allocate_logger_message (p=> > pointer>, >> > sz=280577276613695, bp=, ohp=, >> > hp=0x7f97ba57f7f0, gleader=128) >> > at beam/utils.c:1958 >> > #1 do_send_term_to_logger (tag=843, args=140289643116560, >> > len=-966352886, >> > buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2058 >> > #2 send_error_term_to_logger (args=140289643116560, len=-966352886, >> > buf=0x7f97c1f7db72 "", gleader=128) at beam/utils.c:2106 >> > #3 erts_send_error_term_to_logger (gleader=128, dsbufp=0x7f97c1f7db70, >> > args=140289643116560) at beam/utils.c:2187 >> >> First, you're clearly on a 64-bit machine, I'm going to assume >> Linux/x86-64. >> >> What I think happened here is that you generated an error term with an >> output >> representation larger than 2GB. In erts_send_error_term_to_logger() there >> is an >> unchecked narrowing conversion from size_t to int as dsbufp->str_len is >> passed >> to send_error_term_to_logger(). In the stack dump above, you see a large >> but >> negative 32-bit value in the "len" parameters -- that's a common sign >> of this kind >> of problem. If you can, please re-run gdb, "up" to the >> erts_send_error_term_to_logger() >> frame, and "print *dsbufp"; I suspect dsbufp->str_len will be >=2GB. >> >> Then in do_send_term_to_logger() the negative len is use to compute the >> size >> of the message buffer, which results in sz=280577276613695 which is bogus >> (it's about 261 GB). >> >> The actual SIGSEGV probably comes from the new_message_buffer() call on >> line 1956 returning NULL for this bogus size. >> >> Fixing this will require code changes in util.c and maybe elsewhere too. >> >> What you can do meanwhile is to try to limit the sizes of terms sent to >> the >> error logger so their output representation is less than 2GB. (As I type >> this I >> spot another bug in do_send_term_to_logger(), so you'll want to halve that >> limit to be less than 1GB.) >> >> /Mikael >> >> > #4 0x000000000059d990 in erts_bs_put_utf8 (EBS=0x7f97c1f7db72, >> > arg=140289845403658) at beam/erl_bits.c:850 >> > #5 0x00007f97bfb79898 in ?? () >> > #6 0x000000000000001e in ?? () >> > #7 0x00007f97b5c675a8 in ?? () >> > #8 0x00007f97bb25b5d8 in ?? () >> > #9 0x00007f97b5c25ad8 in ?? () >> > #10 0x00007f97c1f7b282 in ?? () >> > #11 0x8450345d9c222796 in ?? () >> > #12 0x00007f97bfc47008 in ?? () >> > #13 0x00007f97bc8c3338 in ?? () >> > #14 0x0000000000449c14 in process_main (x_reg_array=0x7f97b5c66d30, >> > f_reg_array=0x7f97c666a00a) at >> > x86_64-pc-linux-musl/opt/smp/beam_hot.h:943 >> > #15 0x00007f97bba80100 in ?? () >> > #16 0x0000000000000000 in ?? () >> > ``` >> > >> > I do have an error_handler module added to the error_logger. Although >> > there >> > doesn't appear to be any noticable memory growth or message queue backup >> > in >> > the error_logger process before it dies. >> > >> > I can't quite trigger it myself but it does happen on a regular basis. >> > >> > Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] >> > [async-threads:10] [hipe] [kernel-poll:false] >> > Elixir 1.6.4 (compiled with OTP 20) >> > Alpine 3.7 >> > >> > Anyone have any clues? >> > >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > > > From gattushivakrishna@REDACTED Mon Apr 23 15:29:47 2018 From: gattushivakrishna@REDACTED (shiva) Date: Mon, 23 Apr 2018 18:59:47 +0530 Subject: [erlang-questions] Mnesia start Message-ID: Hi all, ??? How to pass a default node name to start mnesia database on that default node. ??? Already in mnesia? database directory i have a schema file and which contains a different node name, but i want to start mnesia application on default node name. ??? can anyone please suggest solution for this. Regards, Gattu shivakrishna From jesper.louis.andersen@REDACTED Mon Apr 23 15:56:58 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 23 Apr 2018 13:56:58 +0000 Subject: [erlang-questions] Wanted: A method to find all paths from V1 to V2 using digraph module In-Reply-To: References: <33DD8E57-644C-477E-A70A-199988FDC7EC@gmail.com> Message-ID: On Sun, Apr 22, 2018 at 11:45 PM Vlad Dumitrescu wrote: > Hi Bengt, > > The solution is to do a search starting from one of the vertices and keep > track of the found paths (saving a stack of already traversed vertices and > watching out for cycles), but in the worst case it is an O(n!) algorithm. > Even in non-pathological cases, it is easy to get an untractable number of > solutions as the complexity is exponential. > > The obvious algorithm is a breadth-first-search keeping track of the possible paths in each vertex. But if the number of edges are high, then this has to visit all the edges. It might be possible, given assumptions about cycles, to use a variant of (Floyd-)Warshall's algorithm. Build an "ascendancy matrix", but rather than processing boolean bits in each matrix cell, track the (number of) paths. If you can pull this off, then we are closer to something like O(n^3), though there are obvious flaws given cycles. So it may be you would need to analyze the incoming data and make sure the graph has a certain structure. Is the graph directed or undirected? Are all the paths simple (i.e., they are not allowed to cycle?). I'd also look into graph cuts where you can divide the graph into two halves, one containing S and one containing T. It could be the solution count can be based on that number. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cean.ebengt@REDACTED Mon Apr 23 16:36:15 2018 From: cean.ebengt@REDACTED (bengt) Date: Mon, 23 Apr 2018 16:36:15 +0200 Subject: [erlang-questions] Wanted: A method to find all paths from V1 to V2 using digraph module In-Reply-To: References: <33DD8E57-644C-477E-A70A-199988FDC7EC@gmail.com> Message-ID: <0A41D946-B9BB-4A93-8999-5D09D801AD42@gmail.com> The origin of this is the problem https://leetcode.com/problems/cheapest-flights-within-k-stops/description/ so yes it is a very simple structure with lots of assumptions that can be made. Since it should be possible to write the code in 30 minutes I thought there might be a short-cut (Professor Layton solution :-) I will do it the long way instead. Hopefully in just one day. Should be good for me anyway. bengt > On 23 Apr 2018, at 15:56, Jesper Louis Andersen wrote: > > On Sun, Apr 22, 2018 at 11:45 PM Vlad Dumitrescu > wrote: > Hi Bengt, > > The solution is to do a search starting from one of the vertices and keep track of the found paths (saving a stack of already traversed vertices and watching out for cycles), but in the worst case it is an O(n!) algorithm. Even in non-pathological cases, it is easy to get an untractable number of solutions as the complexity is exponential. > > > The obvious algorithm is a breadth-first-search keeping track of the possible paths in each vertex. But if the number of edges are high, then this has to visit all the edges. > > It might be possible, given assumptions about cycles, to use a variant of (Floyd-)Warshall's algorithm. Build an "ascendancy matrix", but rather than processing boolean bits in each matrix cell, track the (number of) paths. If you can pull this off, then we are closer to something like O(n^3), though there are obvious flaws given cycles. So it may be you would need to analyze the incoming data and make sure the graph has a certain structure. > > Is the graph directed or undirected? Are all the paths simple (i.e., they are not allowed to cycle?). I'd also look into graph cuts where you can divide the graph into two halves, one containing S and one containing T. It could be the solution count can be based on that number. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Mon Apr 23 16:56:02 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 23 Apr 2018 14:56:02 +0000 Subject: [erlang-questions] Wanted: A method to find all paths from V1 to V2 using digraph module In-Reply-To: <0A41D946-B9BB-4A93-8999-5D09D801AD42@gmail.com> References: <33DD8E57-644C-477E-A70A-199988FDC7EC@gmail.com> <0A41D946-B9BB-4A93-8999-5D09D801AD42@gmail.com> Message-ID: That problem is just Floyd-Warshall for O(n^3) runtime. If you accept O(n^3 * lg n) then there is a brilliant algorithm based on successive matrix multiplication (power ranking) in a matrix multiplication in which the +/2 operation is min/2. and the */2 operation is +/2. See for instance the code in Paulson's ML for the working programmer, Chapter 7: http://www.cl.cam.ac.uk/~lp15/MLbook/programs/sample7.sml Look for MatrixZSP, ZSP and PathZSP in that code listing. On Mon, Apr 23, 2018 at 4:36 PM bengt wrote: > The origin of this is the problem > https://leetcode.com/problems/cheapest-flights-within-k-stops/description/ > so yes it is a very simple structure with lots of assumptions that can be > made. > Since it should be possible to write the code in 30 minutes I thought > there might be a short-cut (Professor Layton solution :-) > I will do it the long way instead. Hopefully in just one day. Should be > good for me anyway. > > > bengt > > > On 23 Apr 2018, at 15:56, Jesper Louis Andersen < > jesper.louis.andersen@REDACTED> wrote: > > On Sun, Apr 22, 2018 at 11:45 PM Vlad Dumitrescu > wrote: > >> Hi Bengt, >> >> The solution is to do a search starting from one of the vertices and keep >> track of the found paths (saving a stack of already traversed vertices and >> watching out for cycles), but in the worst case it is an O(n!) algorithm. >> Even in non-pathological cases, it is easy to get an untractable number of >> solutions as the complexity is exponential. >> >> > The obvious algorithm is a breadth-first-search keeping track of the > possible paths in each vertex. But if the number of edges are high, then > this has to visit all the edges. > > It might be possible, given assumptions about cycles, to use a variant of > (Floyd-)Warshall's algorithm. Build an "ascendancy matrix", but rather than > processing boolean bits in each matrix cell, track the (number of) paths. > If you can pull this off, then we are closer to something like O(n^3), > though there are obvious flaws given cycles. So it may be you would need to > analyze the incoming data and make sure the graph has a certain structure. > > Is the graph directed or undirected? Are all the paths simple (i.e., they > are not allowed to cycle?). I'd also look into graph cuts where you can > divide the graph into two halves, one containing S and one containing T. It > could be the solution count can be based on that number. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fred@REDACTED Mon Apr 23 18:02:39 2018 From: fred@REDACTED (Fred Dushin) Date: Mon, 23 Apr 2018 12:02:39 -0400 Subject: [erlang-questions] TLS Distribution Certificate Strategy In-Reply-To: <20180420135712.GA68520@erix.ericsson.se> References: <20180420135712.GA68520@erix.ericsson.se> Message-ID: > On Apr 20, 2018, at 9:57 AM, Raimo Niskanen wrote: > > Hello list! > > I am working on the task to get Erlang Distribution over TLS to be easy to > use and flexible. :-/ Lucky you! > > So far I have tried to read up on the subject and messed up by misusing > server_name_indication in inet_tls_dist.erl... > > The distribution protocol in itself has got two roles - the client and the > server role. When node A connects to node B then A is the client > and B is the server. All nodes are servers and any node can also be a > client. > > When a node is client we can use the options [{verify,verify_peer}, > {verify_fun,{VerifyFun,Data}}]. Then VerifyFun can verify that the > certificate is valid for the Node we connect to. Remains to get the Node > variable into the VerifyFun arguments - getting to that. > > When a node is server it is not possible to know which node that connects > until after the TLS connection is up and while the ditribution handshake is > performed. The there is a step to check that the connecting node is on the > allowed list. This step takes a list of allowed nodes that currently is a > net_kernel configuration parameter that can be modified by e.g > inet_tls_dist. We can use that. How does the connecting (client) node tell the server its own name (say, in the non-TLS use case). Is this part of the disterl protocol? I would think it has to be, and not some magic conjured by the underlying TCP or TLS protocol. (Sorry, I don't currently have time to dig into the code and research this myself) > > So this boils down to parsing the certificate for a node name or a list > thereof. My goal is that there should be a plugin function that does > exactly that, that one can customize. > > An additional question about that certificate parsing function is whether > it should return node name(s) or host name(s). Should a certificate be per > node or per host or should both be possible? If we are talking about the disterl protocol, I would keep it to node names, and keep host names out of it. There is no guarantee that two nodes would be running on the same host (Riak devrels!), where each has different security requirements. (to your flexibility point) I also think host names are impossible to manage, no less manage securely, whereas presumably node names are under some semblance of control by the application, and therefore hopefully the application operator. Host names might be managed by other teams in distant lands. > > If a node certificate should contain host name(s) there seems to be > agreement on that one could put this in the certificate's Subject field as > a DistinguishedName containing a CommonName being the host name, or in an > Extension subjectAltName containing a dNSName. "there seems to be agreement" Well, not universally. I can get on my soap box and say why hostname validation is a hoax, if you like :) > > If a node certificate should contain node name(s) I only have some > half-good suggestions: > * Store a node name node@REDACTED as a host name node.example.org in > either of the above ways, i.e replace the `@` with `.`. > * Store the node name as a CommonName as it is, either in DistinguishedName > or in an Exension subjectAltName containing a directoryName that is > another CommonName. ^^ common in most TLS deployments, but only for server certs, i.e., when clients authenticate servers. I think authenticating clients via DNs or SubjectAltNames is somewhat non-standard, but useful. I would NOT use a hostname in that case, however (to the same point above). I would say that if you trust the client, via whatever ordinary PKIX certificate chain validation at your disposal, the additional requirement of matching the CN with the node name could be an onerous burden, when the node name is already published over the disterl protocol, and is therefore shipped over an authenticated/trustorthy channel. What sort of attack would you be thwarting, by adding that requirement? > * Use the DomainComponent field in DistinguishedName, multiple times, and > CommonName for the node name as in "/DC=com=DC=example/CN=node". I think > this maybe according to the standard's intent, but very odd. yes, odd. > * There are lots of esoteric fields to use in a certificate, for example > the Extension subjectAltName EmailAddress that syntactically fits a node > name, but would that not be misuse? I believe there is just a URI type for SubjectAltName https://tools.ietf.org/html/rfc5280#section-4.2.1.6 > > Related questions are: what kind of certificates can you get issued and do > you want to use regular web certificates for this purpose? Should it be > possible to use Let's Encrypt certificates for nodes/hosts in a cluster > (you would need a node whitelist for this use case i guess)? For a cluster > we can create tools that create local certificates, with any of the above > content, but how general should the distribution protocol validation be? > > So what do people want? I think a reference architecture, that includes TLS-enabling epmd, and the disterl communication paths between nodes, would be good. I mean, I have a sense of what that is, but it is likely incomplete and has holes. So having a document that states or illustrates use cases would be helpful. Is there a platform for collaboration on this? > And what is appropriate for Cloud services? I think cloud services are going to be a special case of enterprise (when cloud == IAAS). I don't think we are talking about PAAS, are we? (I wish!) As such, I think most PKI deployments will resemble the kind of thing you see (or should see) in a enterprise deployment, though perhaps at a slightly larger scale, depending on the growth trajectory of the folks paying the cloud bill. > > Anyone with an opinion and insight, please speak up! > > Best Regards > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From roger@REDACTED Tue Apr 24 09:33:06 2018 From: roger@REDACTED (Roger Lipscombe) Date: Tue, 24 Apr 2018 08:33:06 +0100 Subject: [erlang-questions] gdb questions (was Segfault in do_allocate_logger_message) Message-ID: On 21 April 2018 at 21:51, Vince Foley wrote: > Side question.. I am trying to use the etp commands to print out the Erlang > terms > (https://github.com/erlang/otp/blob/master/erts/etc/unix/etp-commands.in) > > I keep getting this error: > ``` > (gdb) etp *bp > Cannot access memory at address 0xb974e0 > ``` > > And this kind of thing: > ``` > (gdb) etp-processes > No processes, since system isn't initialized! > ``` > > Am I doing something wrong, or is this just not possible with my coredump? I've found that success with gdb requires: - An exactly matching beam. I have to keep an appropriate VM around for debugging core dumps from production. - An *unstripped* beam loaded into gdb. Deb packages generally have stripped binaries, which breaks a bunch of debugging scenarios. We build our Erlang releases with kerl; we have to keep the unstripped copies around. From jesper.louis.andersen@REDACTED Tue Apr 24 12:02:37 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Tue, 24 Apr 2018 10:02:37 +0000 Subject: [erlang-questions] TLS Distribution Certificate Strategy In-Reply-To: <20180420135712.GA68520@erix.ericsson.se> References: <20180420135712.GA68520@erix.ericsson.se> Message-ID: On Fri, Apr 20, 2018 at 3:57 PM Raimo Niskanen < raimo+erlang-questions@REDACTED> wrote: > Hello list! > > I am working on the task to get Erlang Distribution over TLS to be easy to > use and flexible. :-/ > > You know what I am going to say: "What are NOT part of this task?" I have a general toxic reaction to words such as "easy to use" and "flexible" because the former can hide important details in the name of easy, but then make more intricate setups impossible; and the latter often risks making the core of the system bad as a sacrifice for being able to do anything. For cloud services, the general rules are: * Machines are brought up and down at a whim, they usually change IP addresses, some times also networks. * Machines can have stable DNS names where the underlying IP change, so be prepared for that setting. * Some systems don't have stable DNS either * The network, cluster size, etc are all dynamic and will scale up and down depending on load. * The network is highly unreliable. Weekly disconnects are commonplace for any point-to-point connection. In larger clusters, assume daily TCP disconnects. * The network is likely to deliberately fault-inject to verify the system is robust under noise (Chaos-monkey strategies). In this setting, the lure of having TLS would be that you don't have to build a virtual network which also encrypts. Rather, you can just have the Erlang nodes connect by TLS. It also simplifies the notion of connecting "into" the cluster from the outside. The Erlang distribution protocol is quite the contrary to the typical cloud network though: * Assumes a mostly stable static network * Assumes a few static machines * Assigns names to everything, in a somewhat static way * Assumes you know every node "beforehand" in many situations I feel this is the impedance mismatch which is present. Hence my original pet-peeve: define the scope :) My own solution would definitely be "screw you, TLS, here is my own public key registry, vault, and libsodium/enacl :)" -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans.r.nilsson@REDACTED Tue Apr 24 13:11:22 2018 From: hans.r.nilsson@REDACTED (Hans Nilsson R) Date: Tue, 24 Apr 2018 13:11:22 +0200 Subject: [erlang-questions] Patch package OTP 18.3.4.9 released Message-ID: Patch Package: OTP 18.3.4.9 Git Tag: OTP-18.3.4.9 Date: 2018-04-24 Trouble Report Id: OTP-15018 Seq num: System: OTP Release: 18 Application: ssh-4.2.2.6 Predecessor: OTP 18.3.4.8 Check out the git tag OTP-18.3.4.9, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- ssh-4.2.2.6 ----------------------------------------------------- --------------------------------------------------------------------- Note! The ssh-4.2.2.6 application can *not* be applied independently of other applications on an arbitrary OTP 18 installation. On a full OTP 18 installation, also the following runtime dependency has to be satisfied: -- crypto-3.6.3.1 (first satisfied in OTP 18.3.4.5) --- Fixed Bugs and Malfunctions --- OTP-15018 Application(s): ssh Fix rare spurios shutdowns of ssh servers when receiveing {'EXIT',_,normal} messages. Full runtime dependencies of ssh-4.2.2.6: crypto-3.6.3.1, erts-6.0, kernel-3.0, public_key-0.22, stdlib-2.3 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From vincefoley@REDACTED Tue Apr 24 15:20:51 2018 From: vincefoley@REDACTED (Vince Foley) Date: Tue, 24 Apr 2018 06:20:51 -0700 Subject: [erlang-questions] gdb questions (was Segfault in do_allocate_logger_message) In-Reply-To: References: Message-ID: I think you are right here.. I've been experimenting with running gdb with the exact beam file from the dump and getting better results. This is my first time using gdb for anything :) Do you know of any documentation around building "unstripped" erlang releases? This is my next step... I'm going to post a new analysis soon. On Tue, Apr 24, 2018 at 12:33 AM, Roger Lipscombe wrote: > On 21 April 2018 at 21:51, Vince Foley wrote: > > Side question.. I am trying to use the etp commands to print out the > Erlang > > terms > > (https://github.com/erlang/otp/blob/master/erts/etc/unix/etp-commands.in > ) > > > > I keep getting this error: > > ``` > > (gdb) etp *bp > > Cannot access memory at address 0xb974e0 > > ``` > > > > And this kind of thing: > > ``` > > (gdb) etp-processes > > No processes, since system isn't initialized! > > ``` > > > > Am I doing something wrong, or is this just not possible with my > coredump? > > I've found that success with gdb requires: > > - An exactly matching beam. I have to keep an appropriate VM around > for debugging core dumps from production. > - An *unstripped* beam loaded into gdb. Deb packages generally have > stripped binaries, which breaks a bunch of debugging scenarios. We > build our Erlang releases with kerl; we have to keep the unstripped > copies around. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Tue Apr 24 16:27:10 2018 From: roger@REDACTED (Roger Lipscombe) Date: Tue, 24 Apr 2018 15:27:10 +0100 Subject: [erlang-questions] gdb questions (was Segfault in do_allocate_logger_message) In-Reply-To: References: Message-ID: On 24 April 2018 at 14:20, Vince Foley wrote: > Do you know of any documentation around building "unstripped" erlang > releases? This is my next step... Don't strip them in the first place :) We build our Erlang/OTP using kerl, which we then embed into our release, which is then packaged as a .deb file, using the Debian tools (debbuild, etc.). It's the debbuild step that strips the binaries as they're put in the .deb file. We simply keep the unstripped beam.smp binary from before this happens. Do the ESL .deb files (assuming that's how you're installing Erlang) also contain stripped binaries? From vincefoley@REDACTED Tue Apr 24 16:37:16 2018 From: vincefoley@REDACTED (Vince Foley) Date: Tue, 24 Apr 2018 07:37:16 -0700 Subject: [erlang-questions] gdb questions (was Segfault in do_allocate_logger_message) In-Reply-To: References: Message-ID: I'm using Docker to build and run my release (my company has tons of docker infrastructure).. The official docker image looks like it builds erlang from source with `./otp_build autoconf` https://github.com/c0b/docker-erlang-otp/blob/master/20/Dockerfile https://hub.docker.com/_/erlang/ On Tue, Apr 24, 2018 at 7:27 AM, Roger Lipscombe wrote: > On 24 April 2018 at 14:20, Vince Foley wrote: > > Do you know of any documentation around building "unstripped" erlang > > releases? This is my next step... > > Don't strip them in the first place :) > > We build our Erlang/OTP using kerl, which we then embed into our > release, which is then packaged as a .deb file, using the Debian tools > (debbuild, etc.). > > It's the debbuild step that strips the binaries as they're put in the > .deb file. We simply keep the unstripped beam.smp binary from before > this happens. Do the ESL .deb files (assuming that's how you're > installing Erlang) also contain stripped binaries? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Tue Apr 24 17:13:31 2018 From: donpedrothird@REDACTED (John Doe) Date: Tue, 24 Apr 2018 18:13:31 +0300 Subject: [erlang-questions] {some,term} = [] ++ {some, term}. Message-ID: Hi, is this normal? {some,term} = [] ++ {some, term}. %% list vanishes [1,2,3|{some,term}] = [1,2,3] ++ {some, term}. %% improper list -------------- next part -------------- An HTML attachment was scrubbed... URL: From elbrujohalcon@REDACTED Tue Apr 24 17:15:33 2018 From: elbrujohalcon@REDACTED (Brujo Benavides) Date: Tue, 24 Apr 2018 12:15:33 -0300 Subject: [erlang-questions] {some,term} = [] ++ {some, term}. In-Reply-To: References: Message-ID: Hi John, See here: https://medium.com/erlang-battleground/the-asymmetry-of-validations-1ccdf2457293 Hope this helps :) Brujo Benavides > On 24 Apr 2018, at 12:13, John Doe wrote: > > Hi, > is this normal? > > {some,term} = [] ++ {some, term}. %% list vanishes > > [1,2,3|{some,term}] = [1,2,3] ++ {some, term}. %% improper list > _______________________________________________ > 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 Tue Apr 24 18:19:06 2018 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Tue, 24 Apr 2018 18:19:06 +0200 Subject: [erlang-questions] {some,term} = [] ++ {some, term}. In-Reply-To: References: Message-ID: Another funny thing: 1> {A,B} = {sets:from_list([-28]), sets:from_list([4])}. {{set,1,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, {{[],[],[],[],[],[],[],[],[],[],[],[],[-28],[],[],[]}}}, {set,1,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, {{[],[],[],[],[],[],[],[],[],[],[],[],[4],[],[],[]}}}} 2> sets:union(A,B) == sets:union(B,A). false Thomas Arts (of QuickCheck fame) showed this in 2005 I think! This is due to the sets underlying representation. I thought there was a PR to use maps instead but can't find it anymore. The corresponding PropEr property: -include_lib("proper/include/proper.hrl"). a_sets_generator() -> ?LET(SomeList, list(integer()) ,sets:from_list(SomeList) ). %% rebar3 as test proper -p prop_sets_union_is_commutative prop_sets_union_is_commutative() -> ?FORALL({SetA,SetB}, {a_sets_generator(),a_sets_generator()} ,?WHENFAIL(io:format("\nSetA = ~w\nSetB = ~w\n", [sets:to_list(SetA), sets:to_list(SetB)]) ,sets:union(SetA,SetB) =:= sets:union(SetB,SetA) ) ). Cheers, -- Pierre Fenoll On 24 April 2018 at 17:15, Brujo Benavides wrote: > Hi John, > > See here: https://medium.com/erlang-battleground/the- > asymmetry-of-validations-1ccdf2457293 > > Hope this helps :) > > ------------------------------ > *Brujo Benavides * > > > > On 24 Apr 2018, at 12:13, John Doe wrote: > > Hi, > is this normal? > > {some,term} = [] ++ {some, term}. %% list vanishes > > [1,2,3|{some,term}] = [1,2,3] ++ {some, term}. %% improper list > _______________________________________________ > 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 elbrujohalcon@REDACTED Tue Apr 24 18:35:40 2018 From: elbrujohalcon@REDACTED (Brujo Benavides) Date: Tue, 24 Apr 2018 13:35:40 -0300 Subject: [erlang-questions] {some,term} = [] ++ {some, term}. In-Reply-To: References: Message-ID: Maybe sets could provide a function like? is_equal(A, B) -> is_subset(A, B) andalso is_subset(B, A). Brujo Benavides > On 24 Apr 2018, at 13:19, Pierre Fenoll wrote: > > Another funny thing: > 1> {A,B} = {sets:from_list([-28]), sets:from_list([4])}. > {{set,1,16,16,8,80,48, > {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, > {{[],[],[],[],[],[],[],[],[],[],[],[],[-28],[],[],[]}}}, > {set,1,16,16,8,80,48, > {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, > {{[],[],[],[],[],[],[],[],[],[],[],[],[4],[],[],[]}}}} > 2> sets:union(A,B) == sets:union(B,A). > false > > Thomas Arts (of QuickCheck fame) showed this in 2005 I think! > This is due to the sets underlying representation. > I thought there was a PR to use maps instead but can't find it anymore. > > The corresponding PropEr property: > -include_lib("proper/include/proper.hrl"). > a_sets_generator() -> > ?LET(SomeList, list(integer()) > ,sets:from_list(SomeList) > ). > %% rebar3 as test proper -p prop_sets_union_is_commutative > prop_sets_union_is_commutative() -> > ?FORALL({SetA,SetB}, {a_sets_generator(),a_sets_generator()} > ,?WHENFAIL(io:format("\nSetA = ~w\nSetB = ~w\n", [sets:to_list(SetA), sets:to_list(SetB)]) > ,sets:union(SetA,SetB) =:= sets:union(SetB,SetA) > ) > ). > > > > Cheers, > -- > Pierre Fenoll > > > On 24 April 2018 at 17:15, Brujo Benavides > wrote: > Hi John, > > See here: https://medium.com/erlang-battleground/the-asymmetry-of-validations-1ccdf2457293 > > Hope this helps :) > > Brujo Benavides > > > >> On 24 Apr 2018, at 12:13, John Doe > wrote: >> >> Hi, >> is this normal? >> >> {some,term} = [] ++ {some, term}. %% list vanishes >> >> [1,2,3|{some,term}] = [1,2,3] ++ {some, term}. %% improper list >> _______________________________________________ >> 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 fred@REDACTED Tue Apr 24 18:51:14 2018 From: fred@REDACTED (Fred Dushin) Date: Tue, 24 Apr 2018 12:51:14 -0400 Subject: [erlang-questions] TLS Distribution Certificate Strategy In-Reply-To: References: <20180420135712.GA68520@erix.ericsson.se> Message-ID: <397B236A-9001-40F8-8DAB-9BD3A55FBA5A@dushin.net> > On Apr 24, 2018, at 6:02 AM, Jesper Louis Andersen wrote: > > On Fri, Apr 20, 2018 at 3:57 PM Raimo Niskanen > wrote: > Hello list! > > I am working on the task to get Erlang Distribution over TLS to be easy to > use and flexible. :-/ > > > You know what I am going to say: > > "What are NOT part of this task?" > > I have a general toxic reaction to words such as "easy to use" and "flexible" because the former can hide important details in the name of easy, but then make more intricate setups impossible; and the latter often risks making the core of the system bad as a sacrifice for being able to do anything. > > For cloud services, the general rules are: > > * Machines are brought up and down at a whim, they usually change IP addresses, some times also networks. > * Machines can have stable DNS names where the underlying IP change, so be prepared for that setting. > * Some systems don't have stable DNS either > * The network, cluster size, etc are all dynamic and will scale up and down depending on load. > * The network is highly unreliable. Weekly disconnects are commonplace for any point-to-point connection. In larger clusters, assume daily TCP disconnects. > * The network is likely to deliberately fault-inject to verify the system is robust under noise (Chaos-monkey strategies). So I agree with all of those, and I think it adds to the argument that any additional authentication over and above PKIX certificate validation should NOT use hostnames or IP addresses, or should not _require_ hostnames or IPs. I am still happy to rant about TLS hostname validation [sic], as it is complete and utter BS outside of the context of e-commerce, for which it was designed. Yet for some reason even intelligent people think it should make its way into RFCs. :head-bang: > > In this setting, the lure of having TLS would be that you don't have to build a virtual network which also encrypts. Rather, you can just have the Erlang nodes connect by TLS. It also simplifies the notion of connecting "into" the cluster from the outside. > > The Erlang distribution protocol is quite the contrary to the typical cloud network though: > > * Assumes a mostly stable static network > * Assumes a few static machines > * Assigns names to everything, in a somewhat static way > * Assumes you know every node "beforehand" in many situations > > I feel this is the impedance mismatch which is present. Hence my original pet-peeve: define the scope :) > > My own solution would definitely be "screw you, TLS, here is my own public key registry, vault, and libsodium/enacl :)" Um, no. Not that TLS is a panacea, but... https://github.com/saltstack/salt/commit/5dd304276ba5745ec21fc1e6686a0b28da29e6fc I think the larger question here is: why aren't you using TLS? I will warn you in advance that "because we're using ZeroMQ" is a silly answer. This is at least the third vulnerability that has been found in your homebrew transport encryption, after the lack of a MAC and a timing attack. I hope you now realize that homebrewing your own transport encryption is a bad idea and you should seriously consider switching to TLS at this point to avoid future attacks. -Fred > > _______________________________________________ > 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 Tue Apr 24 22:31:12 2018 From: vincefoley@REDACTED (Vince Foley) Date: Tue, 24 Apr 2018 13:31:12 -0700 Subject: [erlang-questions] gdb questions (was Segfault in do_allocate_logger_message) In-Reply-To: References: Message-ID: Ok, after a bit of learning how to use gdb, I now have a set of backtraces that point to a different piece of code. Also I have figured out the proximate condition for the issue to exist... Now that I have the matching beam file to go with the crash dump, I am consistently seeing the crash in this location: ``` Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00000000004c7f11 in eq (a=, b=) at beam/utils.c:2346 2346 if (!is_boxed(b) || *boxed_val(b) != *aa) [Current thread is 1 (Thread 0x7f6721931700 (LWP 515))] (gdb) backtrace #0 0x00000000004c7f11 in eq (a=, b=) at beam/utils.c:2346 #1 0x000000000044a15b in process_main (x_reg_array=0x7f672779c5c0, f_reg_array=0x7f672c07fb82) at beam/beam_emu.c:1568 #2 0x00000000004f4b88 in sched_thread_func (vesdp=0x7f6723d47980) at beam/erl_process.c:8906 #3 0x0000000000675945 in thr_wrapper (vtwd=0x7ffdbbd3e4e0) at pthread/ethread.c:118 #4 0x00007f676acfb494 in start_thread (arg=0x7f6721931700) at pthread_create.c:333 #5 0x00007f676a835acf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97 ``` So the interesting thing is this: I can completely get rid of the crashes by disabling the feature that I have been working on that uses `seq_trace` We did a bit of googling and found a very old bug related to `seq_trace` and memory corruption... OTP-4222 Match spec 'set_seq_token' corrupts heap https://github.com/erlang/otp/blame/cf2df1b555072a1413f97259abec38b82513dbdc/lib/kernel/test/seq_trace_SUITE.erl#L512 I'm wondering if this issue still exists, and we are winding up with corrupted memory which then means that the `eq` check just blows up... FYI - Sorry I got the beam files mixed up earlier, but also glad that led to a bug fix of it's own!! On Tue, Apr 24, 2018 at 7:37 AM, Vince Foley wrote: > I'm using Docker to build and run my release (my company has tons of > docker infrastructure).. > > The official docker image looks like it builds erlang from source with > `./otp_build autoconf` > > https://github.com/c0b/docker-erlang-otp/blob/master/20/Dockerfile > https://hub.docker.com/_/erlang/ > > > On Tue, Apr 24, 2018 at 7:27 AM, Roger Lipscombe > wrote: > >> On 24 April 2018 at 14:20, Vince Foley wrote: >> > Do you know of any documentation around building "unstripped" erlang >> > releases? This is my next step... >> >> Don't strip them in the first place :) >> >> We build our Erlang/OTP using kerl, which we then embed into our >> release, which is then packaged as a .deb file, using the Debian tools >> (debbuild, etc.). >> >> It's the debbuild step that strips the binaries as they're put in the >> .deb file. We simply keep the unstripped beam.smp binary from before >> this happens. Do the ESL .deb files (assuming that's how you're >> installing Erlang) also contain stripped binaries? >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrtndimitrov@REDACTED Wed Apr 25 10:02:46 2018 From: mrtndimitrov@REDACTED (Martin Dimitrov) Date: Wed, 25 Apr 2018 11:02:46 +0300 Subject: [erlang-questions] Yaws and rebar3 Message-ID: <5ae03626.530a1c0a.32aa7.3836@mx.google.com> Hello, I am stuck with rebar3. It generates so many directories and files that I am kind of lost ?? Previously we were starting our app as: erl.exe -sname +A 1024 -setcookie -boot start_sasl -config harmony_DEV -pa "/ebin" -pa "../lib/rabbit_common-3.4.0\ebin" -pa "../lib/amqp_client-3.4.0/ebin" -pa "../lib/goldrush-0.1.8/ebin" -pa "../lib/lager-3.1.0/ebin" -pa "../lib/gen_smtp-0.9.0/ebin" -pa "../deps/inventory/ebin" -pa "../deps/oauth/ebin" -pa "../deps/rete/ebin" -conf "yaws_DEV.conf" -run yaws -i Now I?ve put lager and the rabbit libs as dependencies in the rebar3 config. But do I put yaws as a dependency as well and from where the run the above command? Thanks in advance, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Wed Apr 25 11:11:22 2018 From: lukas@REDACTED (Lukas Larsson) Date: Wed, 25 Apr 2018 11:11:22 +0200 Subject: [erlang-questions] gdb questions (was Segfault in do_allocate_logger_message) In-Reply-To: References: Message-ID: On Tue, Apr 24, 2018 at 10:31 PM, Vince Foley wrote: > Ok, after a bit of learning how to use gdb, I now have a set of backtraces > that point to a different piece of code. Also I have figured out the > proximate condition for the issue to exist... > > Now that I have the matching beam file to go with the crash dump, I am > consistently seeing the crash in this location: > > ``` > Program terminated with signal SIGSEGV, Segmentation fault. > #0 0x00000000004c7f11 in eq (a=, b=) at > beam/utils.c:2346 > 2346 if (!is_boxed(b) || *boxed_val(b) != *aa) > [Current thread is 1 (Thread 0x7f6721931700 (LWP 515))] > (gdb) backtrace > #0 0x00000000004c7f11 in eq (a=, b=) at > beam/utils.c:2346 > #1 0x000000000044a15b in process_main (x_reg_array=0x7f672779c5c0, > f_reg_array=0x7f672c07fb82) at beam/beam_emu.c:1568 > #2 0x00000000004f4b88 in sched_thread_func (vesdp=0x7f6723d47980) at > beam/erl_process.c:8906 > #3 0x0000000000675945 in thr_wrapper (vtwd=0x7ffdbbd3e4e0) at > pthread/ethread.c:118 > #4 0x00007f676acfb494 in start_thread (arg=0x7f6721931700) at > pthread_create.c:333 > #5 0x00007f676a835acf in clone () at ../sysdeps/unix/sysv/linux/ > x86_64/clone.S:97 > ``` > > So the interesting thing is this: I can completely get rid of the crashes > by disabling the feature that I have been working on that uses `seq_trace` > > We did a bit of googling and found a very old bug related to `seq_trace` > and memory corruption... > > OTP-4222 Match spec 'set_seq_token' corrupts heap > > https://github.com/erlang/otp/blame/cf2df1b555072a1413f97259abec38 > b82513dbdc/lib/kernel/test/seq_trace_SUITE.erl#L512 > > I'm wondering if this issue still exists, and we are winding up with > corrupted memory which then means that the `eq` check just blows up... > That specific issue has been fixed, but that doesn't mean that there aren't more similar ones. seq_trace does not get much usage, so there are bound to be a few bugs in there. Do you have a smallish testcase that can trigger the issue? > > > FYI - Sorry I got the beam files mixed up earlier, but also glad that led > to a bug fix of it's own!! > > > On Tue, Apr 24, 2018 at 7:37 AM, Vince Foley wrote: > >> I'm using Docker to build and run my release (my company has tons of >> docker infrastructure).. >> >> The official docker image looks like it builds erlang from source with >> `./otp_build autoconf` >> >> https://github.com/c0b/docker-erlang-otp/blob/master/20/Dockerfile >> https://hub.docker.com/_/erlang/ >> >> >> On Tue, Apr 24, 2018 at 7:27 AM, Roger Lipscombe >> wrote: >> >>> On 24 April 2018 at 14:20, Vince Foley wrote: >>> > Do you know of any documentation around building "unstripped" erlang >>> > releases? This is my next step... >>> >>> Don't strip them in the first place :) >>> >>> We build our Erlang/OTP using kerl, which we then embed into our >>> release, which is then packaged as a .deb file, using the Debian tools >>> (debbuild, etc.). >>> >>> It's the debbuild step that strips the binaries as they're put in the >>> .deb file. We simply keep the unstripped beam.smp binary from before >>> this happens. Do the ESL .deb files (assuming that's how you're >>> installing Erlang) also contain stripped binaries? >>> >> >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Wed Apr 25 15:42:25 2018 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 25 Apr 2018 09:42:25 -0400 Subject: [erlang-questions] Yaws and rebar3 In-Reply-To: <5ae03626.530a1c0a.32aa7.3836@mx.google.com> References: <5ae03626.530a1c0a.32aa7.3836@mx.google.com> Message-ID: By default, there's a kind of assumption in rebar3 that you'll use releases to deploy your systems. If you do not, you can use the `rebar3 path' to return a list of all paths, or use specific options: --app Comma separated list of applications to return paths for. --base Return the `base' path of the current profile. --bin Return the `bin' path of the current profile. --ebin Return all `ebin' paths of the current profile's applications. --lib Return the `lib' path of the current profile. --priv Return the `priv' path of the current profile's applications. -s, --separator In case of multiple return paths, the separator character to use to join them. --src Return the `src' path of the current profile's applications. --rel Return the `rel' path of the current profile. So for a command like yours, you could use something like -pa `rebar3 path --separator=" -pa " to generate explicit path additions for all dependencies, or use something like `erl -env ERL_LIBS `rebar3 path --lib` and get mostly the same result. When working under a different profile (i.e. tests with new dependencies) you can go `rebar3 as test path ...' and get it to work. The `path' task only relies on the 'app discovery' subtask, which basically means that it relies only on the ability of rebar3 to read the shape of your base repo to work. Using this task with `rebar3 get-deps' lets you use rebar3 as a tool solely dedicated to fetching and upgrading dependencies, without caring about the compilation or release phases if you were to use a different tool. On Wed, Apr 25, 2018 at 4:02 AM, Martin Dimitrov wrote: > > > Hello, > > > > I am stuck with rebar3. It generates so many directories and files that I > am kind of lost ?? Previously we were starting our app as: > > > > erl.exe -sname +A 1024 -setcookie -boot start_sasl -config > harmony_DEV -pa "/ebin" -pa "../lib/rabbit_common-3.4.0\ebin" > -pa "../lib/amqp_client-3.4.0/ebin" -pa "../lib/goldrush-0.1.8/ebin" -pa > "../lib/lager-3.1.0/ebin" -pa "../lib/gen_smtp-0.9.0/ebin" -pa > "../deps/inventory/ebin" -pa "../deps/oauth/ebin" -pa "../deps/rete/ebin" > -conf "yaws_DEV.conf" -run yaws -i > > > > Now I?ve put lager and the rabbit libs as dependencies in the rebar3 > config. But do I put yaws as a dependency as well and from where the run > the above command? > > > > Thanks in advance, > > Martin > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pouriya.jb@REDACTED Thu Apr 26 00:31:57 2018 From: pouriya.jb@REDACTED (Pouriya JahanBakhsh) Date: Thu, 26 Apr 2018 03:01:57 +0430 Subject: [erlang-questions] New awesome Erlang In-Reply-To: References: Message-ID: Hi. In Erlang github page, at the end of README file you mentioned https://github.com/drobakowski/awesome-erlang as a list of open source Erlang projects. But this repo did not update for 3 years ! And there are 10 new pull requests for adding new projects. Is it possible to create new repo under erlang github account ? for example github.com/erlang/awesome. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hello@REDACTED Thu Apr 26 10:46:40 2018 From: hello@REDACTED (Adam Lindberg) Date: Thu, 26 Apr 2018 10:46:40 +0200 Subject: [erlang-questions] New awesome Erlang In-Reply-To: References: Message-ID: <557A3710-055F-4597-94D1-EF9C3BFB5292@alind.io> It looks like it was updated 3 months ago. Cheers, Adam > On 26. Apr 2018, at 00:31, Pouriya JahanBakhsh wrote: > > Hi. In Erlang github page, at the end of README file you mentioned https://github.com/drobakowski/awesome-erlang as a list of open source Erlang projects. But this repo did not update for 3 years ! And there are 10 new pull requests for adding new projects. Is it possible to create new repo under erlang github account ? for example github.com/erlang/awesome. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: Message signed with OpenPGP URL: From karlsson.rm@REDACTED Thu Apr 26 22:34:23 2018 From: karlsson.rm@REDACTED (Mikael Karlsson) Date: Thu, 26 Apr 2018 22:34:23 +0200 Subject: [erlang-questions] Erlang on RISC-V In-Reply-To: References: <20180220104958.GA7895@hec.corelatus.se> Message-ID: Hi again, just an update on RISC-V and Erlang. It seems there is already a fedora project for RISC-V: https://fedoraproject.org/wiki/Architectures/RISC-V So following instructions from the wiki, downloading diskimage and getting a proper QEMU going one can install erlang after booting: [root@REDACTED ~]# dnf install erlang [root@REDACTED ~]# uname -a Linux stage4.fedoraproject.org 4.15.0-00044-g2b0aa1de45f6 #24 SMP Sat Apr 21 11:50:47 UTC 2018 riscv64 riscv64 riscv64 GNU/Linux [root@REDACTED ~]# erl Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [kernel-poll:false] Eshell V9.3 (abort with ^G) 1> 11.0 / 7. 1.5714285714285714 2> "Right out of the box". Best would of course be to burn your own FPGA, cross-compile complete nerves-project and install.... 2018-02-20 15:07 GMT+01:00 Mikael Karlsson : > Thanks for the info Mikael and Matthias. > >>> What do you mean by "the Erlang compiler"? > > I guess I meant the VM, I haven't posted to the posted to the list for > a while and so lost some of my stringency. > Thanks for setting me back on track. :-). > >>There is also that HiPE/LLVM thing which might be able to support RISC-V with less effort. > > OK, so maybe some involvement of the compiler anyway. > Seems there is a RISC-V backend for LLVM in the works. > https://github.com/lowRISC/riscv-llvm > > Mikael K From davidnwelton@REDACTED Fri Apr 27 17:49:29 2018 From: davidnwelton@REDACTED (David Welton) Date: Fri, 27 Apr 2018 08:49:29 -0700 Subject: [erlang-questions] erl_rpc hangs waiting for response Message-ID: Hi, >From an Erlang node, I can do: rpc:call('foo@REDACTED', foo, bar, []). and it returns a result immediately. However, result = erl_rpc(erlang_fd, "foo", "bar", erl_mk_empty_list()); Just hangs waiting for a response. I've strace'ed it, and I see it sending the data then waiting, running 'select', but nothing comes back. Any ideas what might cause that? Thank you, -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From wadt18@REDACTED Fri Apr 27 20:15:12 2018 From: wadt18@REDACTED (WADT 2018) Date: Fri, 27 Apr 2018 18:15:12 +0000 Subject: [erlang-questions] WADT 2018 - Extension to abstract submission deadline! Message-ID: <73325d27-b278-8524-cf85-72158b757d61@outlook.com> ====================================================================== FOURTH CALL FOR PAPERS - Extension to abstract submission deadline! WADT 2018 24th International Workshop on Algebraic Development Techniques http://wadt18.cs.rhul.ac.uk July 2?5, 2018, Royal Holloway University of London, Egham, UK ====================================================================== AIMS AND SCOPE The algebraic approach to system specification encompasses many aspects of the formal design of software systems. Originally born as a formal method for reasoning about abstract data types, it now covers new specification frameworks and programming paradigms (such as object-oriented, aspect-oriented, agent-oriented, logic and higher-order functional programming) as well as a wide range of application areas (including information systems, concurrent, distributed and mobile systems). The workshop will provide an opportunity to present recent and ongoing work, to meet colleagues, and to discuss new ideas and future trends. TOPICS OF INTEREST Typical, but not exclusive topics of interest are: ? Foundations of algebraic specification ? Other approaches to formal specification, including process calculi and models of concurrent, distributed, and cyber-physical systems ? Specification languages, methods, and environments ? Semantics of conceptual modelling methods and techniques ? Model-driven development ? Graph transformations, term rewriting, and proof systems ? Integration of formal specification techniques ? Formal testing and quality assurance, validation, and verification ? Algebraic approaches to cognitive sciences, including computational creativity WORKSHOP FORMAT AND LOCATION The workshop will take place over four days, Monday to Thursday, at Royal Holloway University of London in Egham, UK (https://www.royalholloway.ac.uk). Presentations will be selected on the basis of submitted abstracts. This occurrence of the ADT workshop will be preceded by the Leverhulme School on Graph Transformation Techniques. The school will take place over three days, from Friday, June 29th, to Sunday, July 1st, and will comprise a self-contained series of invited lectures on graph transformation to be given by Reiko Heckel (University of Leicester, UK), Fernando Orejas (Technical University of Catalonia, Spain), and Detlef Plump (University of York, UK). INVITED SPEAKERS Artur d'Avila Garcez (City, University of London, UK) Rolf Hennicker (LMU Munich, Germany) Kai-Uwe K?hnberger (Osnabr?ck University, Germany) Fernando Orejas (Technical University of Catalonia, Spain) IMPORTANT DATES Submission deadline for abstracts: May 11th, 2018 Notification of acceptance: May 25th, 2018 Early registration: June 1st, 2018 Final abstract due: June 8th, 2018 Leverhulme School on Graph Transformation Techniques: June 29?July 1, 2018 ADT Workshop: July 2?5, 2018 SUBMISSIONS The scientific programme of the workshop will include presentations of recent results or ongoing research as well as invited talks. The presentations will be selected by the Steering Committee on the basis of submitted abstracts according to originality, significance and general interest. Abstracts must not exceed two pages including references; if a longer version of the contribution is available, it can be made accessible on the web and referenced in the abstract. Abstracts have to be submitted electronically via the EasyChair system at https://easychair.org/conferences/?conf=wadt18. PROCEEDINGS After the workshop, authors will be invited to submit full papers for the refereed proceedings. All submissions will be reviewed by the Programme Committee. Selection will be based on originality, soundness, and significance of the presented ideas and results. The proceedings will be published as a volume of Lecture Notes in Computer Science (Springer). The deadline for submissions will be September 3, 2018, with notifications by October 29. Camera-ready versions will be required by November 11. SPONSORSHIP The workshop takes place under the auspices of IFIP WG 1.3, while the series of graph-transformation lectures is supported by a Leverhulme Trust Visiting Professorship. WADT STEERING COMMITTEE Andrea Corradini (Italy) Jos? Fiadeiro (UK) [co-chair] Rolf Hennicker (Germany) Hans-J?rg Kreowski (Germany) Till Mossakowski (Germany) Fernando Orejas (Spain) Markus Roggenbach (UK) Grigore Ro?u (United States) PROGRAMME COMMITEE Paolo Baldan (Italy) Andrea Corradini (Italy) Artur d'Avila Garcez (UK) R?zvan Diaconescu (Romania) Jos? Fiadeiro (UK) [co-chair] Fabio Gadducci (Italy) Reiko Heckel (UK) Rolf Hennicker (Germany) Alexander Knapp (Germany) Barbara K?nig (Germany) Ant?nia Lopes (Portugal) Narciso Marti-Oliet (Spain) Till Mossakowski (Germany) Fernando Orejas (Spain) Leila Ribeiro (Brazil) Markus Roggenbach (UK) Pierre-Yves Schobbens (Belgium) Lutz Schr?der (Germany) Pawel Sobocinski (UK) Ionu? ?u?u (UK) [co-chair] Martin Wirsing (Germany) ORGANIZING COMMITTEE Claudia Chiri?? (UK) Jos? Fiadeiro (UK) Ionu? ?u?u (UK) CONTACT INFORMATION Email: wadt18@REDACTED Homepage: http://wadt18.cs.rhul.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From me@REDACTED Fri Apr 27 21:38:39 2018 From: me@REDACTED (Nato) Date: Fri, 27 Apr 2018 12:38:39 -0700 Subject: [erlang-questions] state_timeout reset in gen_statem Message-ID: I may be muddled, but as far I can observe, my code seems correct, but am getting unexpected behavior from OTP 20's gen_statem behavior. I have a state that times out in, say, 3 seconds. I have a `bump' routine that casts to that state, and subsequently set it again to 3 seconds. In my tests, the initial timer holds fast, and despite my debugging efforts, the original timer isn't reset as the documentation says is ought to in the gen_statem manual (state_timeout() type section) : `... Setting this timer while it is running will restart it with the new time-out value. Therefore it is possible to cancel this time-out by setting it to infinity. ...' Some relevant code as follows: ... waiting({call, From}, {entry, Key}, #session{}=Ld) -> {ok, Ld1} = handle(start_session, {Key, Ld}), Reply = {reply, From, ok}, Timeout = session_duration(alive), {next_state, alive, Ld1, [ Reply, {state_timeout, Timeout, hard_stop}]}; ... alive(cast, bump, #session{}=Ld) -> ok = handle(bump_session, Ld), Timeout = session_duration(alive), {keep_state, Ld, [Timeout]}; ... session_duration(alive) -> timer:hms(0, 0, 3); ... Indeed, the new `bump' cast, never resets the original, extending the timeout to a fresh 3 second timeout. On a separate note, any best practices for putting together test code that juggles timeouts to validate such things, would be appreciate. From eric.pailleau@REDACTED Sun Apr 29 19:17:47 2018 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Sun, 29 Apr 2018 19:17:47 +0200 Subject: [erlang-questions] [ANN] jason 1.0.2 Message-ID: <139f0ee3-2170-5b8c-2409-1e5c659a2522@wanadoo.fr> Hi, Jason 1.O.2 has been released ! Jason is a JSON encode/decode library written in Erlang. This project was mainly created for *easy* handling of JSON from/to Erlang records, but allow more common binary struct, proplists and maps formats like many other projects. Jason create for you ad-hoc helper modules for records or can look into modules to extract record informations. No parse_transform, Jason is non intrusive in your code ! An example is better than a long speech, so have a look to https://github.com/crownedgrouse/jason/wiki/Examples jason offer also a rare feature : pretty printing JSON in several indentation styles. Enjoy ! Note: this project has nothing to do with Elixir project with same name. Project : https://github.com/crownedgrouse/jason Wiki : https://github.com/crownedgrouse/jason/wiki Cheers ! Eric From t@REDACTED Sun Apr 29 19:25:08 2018 From: t@REDACTED (Tristan Sloughter) Date: Sun, 29 Apr 2018 10:25:08 -0700 Subject: [erlang-questions] [ANN] jason 1.0.2 In-Reply-To: <139f0ee3-2170-5b8c-2409-1e5c659a2522@wanadoo.fr> References: <139f0ee3-2170-5b8c-2409-1e5c659a2522@wanadoo.fr> Message-ID: <1525022708.2635058.1354711824.162071BB@webmail.messagingengine.com> > Note: this project has nothing to do with Elixir project with same name. I was going to reply to bring that up. Especially since there is a hex package for jason, the Elixir app, it will be confusing. Even without a name change you should publish to hex though :), then at least people searching for jason will see both and pick the right one. You can publish with a different package name than the app name, so like jason_erl. Tristan From raimo+erlang-questions@REDACTED Mon Apr 30 08:49:33 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Mon, 30 Apr 2018 08:49:33 +0200 Subject: [erlang-questions] state_timeout reset in gen_statem In-Reply-To: <20180427210626.06EA45C079@hades.cslab.ericsson.net> References: <20180427210626.06EA45C079@hades.cslab.ericsson.net> Message-ID: <20180430064933.GA20645@erix.ericsson.se> On Fri, Apr 27, 2018 at 12:38:39PM -0700, Nato wrote: > I may be muddled, but as far I can observe, my > code seems correct, but am getting unexpected > behavior from OTP 20's gen_statem behavior. > > I have a state that times out in, say, 3 seconds. > I have a `bump' routine that casts to that state, > and subsequently set it again to 3 seconds. In my > tests, the initial timer holds fast, and despite > my debugging efforts, the original timer isn't > reset as the documentation says is ought to in > the gen_statem manual (state_timeout() type > section) : > > `... > > Setting this timer while it is running will > restart it with the new time-out value. > Therefore it is possible to cancel this > time-out by setting it to infinity. > > ...' > > Some relevant code as follows: > > ... > waiting({call, From}, {entry, Key}, #session{}=Ld) -> > {ok, Ld1} = handle(start_session, {Key, Ld}), > Reply = {reply, From, ok}, > Timeout = session_duration(alive), > {next_state, alive, Ld1, [ > Reply, {state_timeout, Timeout, hard_stop}]}; > ... > > alive(cast, bump, #session{}=Ld) -> > ok = handle(bump_session, Ld), > Timeout = session_duration(alive), > {keep_state, Ld, [Timeout]}; > ... > > session_duration(alive) -> > timer:hms(0, 0, 3); This function returns 3000, which, when returned in from alive/3 as {keep_state, Ld, [3000]]} is equivalent to {keep_state, Ld, [{timeout,3000,3000}]}. That sets the event timeout in addition to the running state timeout. With "this timer" the manual understands that there are different "this timer"s: The event timeour, the state timeout, and each generic timeout are all separate timers. You should return {keep_state, Ld, [{state_timeout,session_duration(alive),hard_stop}]} instead. / Raimo Niskanen > ... > > Indeed, the new `bump' cast, never resets the > original, extending the timeout to a fresh 3 > second timeout. > > On a separate note, any best practices for putting > together test code that juggles timeouts to > validate such things, would be appreciate. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB