From sdl.web@REDACTED Wed Oct 1 04:45:50 2014 From: sdl.web@REDACTED (Leo Liu) Date: Wed, 01 Oct 2014 10:45:50 +0800 Subject: [erlang-questions] tracer keep tracing after stopping dbg Message-ID: To reproduce in OTP 17.3: 1. dbg:tracer() 2. dbg:p(all, all) 3. dbg:stop() Tracing messages keep printing to the tty. Even though dbg is stopped the tracer is still alive. Bug? Leo From mjtruog@REDACTED Wed Oct 1 08:16:51 2014 From: mjtruog@REDACTED (Michael Truog) Date: Tue, 30 Sep 2014 23:16:51 -0700 Subject: [erlang-questions] [ANN] CloudI 1.3.3 Released! Message-ID: <542B9C53.9000808@gmail.com> Download 1.3.3 from http://sourceforge.net/projects/cloudi/files/latest/download (checksums at the bottom of this email) CloudI (http://cloudi.org/) is a "universal integrator" using an Erlang core, with its actor model, to pursue efficiency, fault-tolerance and scalability. The CloudI API provides a minimal interface to communicate among actors that are called services (long-lived processes), so programming language agnostic, database agnostic, and messaging bus agnostic integration can occur. CloudI currently integrates with the programming languages Erlang, Elixir, C/C++, Java, Python, and Ruby, the databases PostgreSQL, elasticsearch, Cassandra, MySQL, couchdb, memcached, riak, and tokyotyrant, the messaging bus ZeroMQ, websockets, and the internal CloudI service bus. HTTP is supported with both cowboy and elli integration. Thanks to Irina Guberman for the Cassandra CQL integration and everyone for the various feedback/issues/bugs that have been reported. The details for this release are below: * backwards compatibility difference: * Some minor functions were deprecated in the cloudi_service module and the source code was moved to separate modules (cloudi_environment, cloudi_service_name, cloudi_request, cloudi_request_info, cloudi_key_value) * The CloudI Service API had some functions renamed with the older name deprecated (loglevel_set became logging_level_set and log_redirect became logging_redirect_set) * In version 1.4.0 of CloudI the cloudi_service behaviour will have a Timeout parameter in both the cloudi_service_init callback and the cloudi_service_terminate callback (if you want to start using it now, make sure cloudi_core is compiled with the CLOUDI_SERVICE_NEW define, a CLOUDI_SERVICE_OLD macro will exist in version 1.4.0 to avoid the change so older services can run without modification) * cloudi_service_api_requests now provides simpler URL paths for the CloudI Service API (while continuing to support the older URL paths) (https://github.com/CloudI/CloudI/tree/master/src/service_api#api) * Python 3 usage requires that the request_info, request, response_info, and response data be bytes * Elixir is now supported officially and has an example at https://github.com/CloudI/CloudI/tree/master/examples/Elixir.HelloWorld1 * Python 3 is now supported by the Python CloudI API (both the cloudi module and the cloudi_c module) * queue_size is a service configuration option added so any service may limit their incoming service request queue by an amount of memory (in kB) (queue_limit provides a count limit and both can be used together) * Support for Aspects (from AOP, Aspect-Oriented Programming) were added as service configuration options (aspects_init_after, aspects_request_before, aspects_request_after, aspects_info_before, aspects_info_after, aspects_terminate_before) so a series of Erlang (or Elixir) functions can be executed before and/or after a cloudi_service behaviour function is executed and possibly modify the service state (for both internal and external services) (http://cloudi.org/api.html#2_services_add_config_opts_aspects_init_after) * Service initialization and termination are now enforced to be synchronous as described here (for both internal and external services): * initialization must be completed before the next service in a sequence (including the configuration file list of services) is started * termination causes the service to stop and terminate within the termination timeout defined by slightly less than MaxT/MaxR (clamped to [1..60] seconds) * lager formatters and lager backends are now supported as described at http://cloudi.org/api.html#2_logging_formatters_set * cassandra CQL support was added by Irina Guberman (as cloudi_service_db_cassandra_cql) * Added Riak support with the cloudi_service_db_riak service * Added OAuth v1 support with the cloudi_service_db_oauth1 service * The cloudi_service_db_pgsql service now supports 3 separate postgres drivers and provides common output for all 3 (wg epgsql, semiocast pgsql, and epgsql epgsql (new)) * The cloudi_service_db_mysql service was updated to use the Eonblast fork of emysql and supports the same common output as cloudi_service_db_pgsql * cloudi_service_http_cowboy was updated to use Cowboy 1.0.0 * cloudi_service_filesystem now supports write operations as append/insert or truncate with byte ranges that can also be used to read * Many bugfixes, other additions, and documentation improvements (see the ChangeLog for more detail) Please mention any problems, issues, or ideas! Thanks, Michael SHA256 CHECKSUMS cloudi-1.3.3.tar.bz2 (42296 bytes) badfbce926c627b862688ed5b7792f23099d123f013b87db331a3ca3e35deb18 cloudi-1.3.3.tar.gz (44220 bytes) 3dbbafed19f0ca693991939bbe5a58e53dec4b2fb5fabbee1e74e6c3e779e7b5 From ttom.kelly@REDACTED Wed Oct 1 14:25:58 2014 From: ttom.kelly@REDACTED (tom kelly) Date: Wed, 1 Oct 2014 13:25:58 +0100 Subject: [erlang-questions] phantom mnesia backup entries Message-ID: Hi list, I've been examining an mnesia backup from one of our production machines using the traverse_backup function and have found some strange entries. In one fragmented set table (with no secondary indexes) where the record structure is meant to be {tab_name, key, field1, field2} there exist entries like: {tab_name, key}. However I can't find the entries after loading the table fragment with mnesia:restore. I've been trawling through our app to find where these might get created but have drawn a blank and have come to the provisional conclusion that they're an internal mnesia quirk. Can any of the mnesia experts on the list confirm or deny? And if confirmed maybe provide a short explanation of their function to satisfy my curiosity? Many thanks. //TTom. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdl.web@REDACTED Wed Oct 1 14:46:32 2014 From: sdl.web@REDACTED (Leo Liu) Date: Wed, 01 Oct 2014 20:46:32 +0800 Subject: [erlang-questions] tracer keep tracing after stopping dbg References: Message-ID: Thanks to user fishcakez_ on the #erlang irc channel, the bug is here: The tracer is getting a garbage message {'EXIT', Pid, done}. The bug is that the tracer process won't exit with its parent if there are trace messages ahead of it in its message queue. The tracer (see dbg:tracer_loop/2) tries to receive an exit signal message or a trace message; if it's a trace it reads its whole message queue (see dbg:recv_all_traces/4); if one of those messages is an 'EXIT' message it's treated as "garbage" and not handled. Leo From tauceti100@REDACTED Wed Oct 1 15:13:17 2014 From: tauceti100@REDACTED (buddy) Date: Wed, 1 Oct 2014 17:13:17 +0400 Subject: [erlang-questions] The node (with release using ssl) does not shut down after calling init:stop/0 in Erlang 17.3 In-Reply-To: References: Message-ID: Hello, It seems the patch is not related to the issue. But I have tried your patch and it does not help. Moreover, I have tried the ssl_hello_world example (as mentioned below) in Erlang 17.0 and it works correctly. $ ./_rel/ssl_hello_world_example/bin/ssl_hello_world_example console Erlang/OTP 17 [erts-6.0] [source-07b8f44] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] Eshell V6.0 (abort with ^G) (ssl_hello_world_example@REDACTED)1> application:which_applications(). [{ssl_hello_world,"Cowboy Hello World example with SSL.", "1"}, {ssl,"Erlang/OTP SSL application","5.3.4"}, {cowboy,"Small, fast, modular HTTP server.","1.0.0"}, {cowlib,"Support library for manipulating Web protocols.", "1.0.0"}, {public_key,"Public key infrastructure","0.22"}, {crypto,"CRYPTO","3.3"}, {ranch,"Socket acceptor pool for TCP protocols.","1.0.0"}, {asn1,"The Erlang ASN1 compiler version 3.0","3.0"}, {stdlib,"ERTS CXC 138 10","2.0"}, {kernel,"ERTS CXC 138 10","3.0"}] (ssl_hello_world_example@REDACTED)2> init:stop(). ok (ssl_hello_world_example@REDACTED)3> % $ In 17.1 it failed on init:stop/0. The similar behaviour was in 17.3. Thus, the problem has occurred somewhere after 17.0. What else can I do to resolve this issue? 2014-09-30 18:35 GMT+04:00, Ingela Andin : > Hi! > > If you apply the following patch to 17.3 it might help. The > SNI-contribution that we included in this release had missed the detail, > that the server may optionally send a > SNI-extension that must be empty. > > diff --git a/lib/ssl/src/ssl_handshake. > erl b/lib/ssl/src/ssl_handshake.erl > index 22673e4..eee33ef 100644 > --- a/lib/ssl/src/ssl_handshake.erl > +++ b/lib/ssl/src/ssl_handshake.erl > @@ -1732,6 +1732,9 @@ > dec_hello_extensions(< #ec_point_formats{ec_point_format_list = > ECPointFormats}}); > > +dec_hello_extensions(<>, > Acc) when Len == 0 -> > + dec_hello_extensions(Rest, Acc#hello_extensions{sni = ""}); %% Server > may send an empy SNI > + > dec_hello_extensions(< ExtData:Len/binary, Rest/binary>>, Acc) -> > <> = ExtData, > > > 2014-09-30 16:10 GMT+02:00 a a : > >> Hello, >> >> I use Erlang 17.3 downloaded from >> https://www.erlang-solutions.com/downloads/download-erlang-otp >> >> When I am trying to stop the ssl_hello_world example from cowboy I have >> encountered a strange behaviour. >> >> $ git clone https://github.com/ninenines/cowboy >> $ cd cowboy >> $ git checkout 1.0.0 >> $ cd examples/ssl_hello_world >> $ make >> $ ./_rel/ssl_hello_world_example/bin/ssl_hello_world_example console >> >> Erlang/OTP 17 [erts-6.2] [source-5c974be] [64-bit] [smp:4:4] >> [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V6.2 (abort with ^G) >> (ssl_hello_world_example@REDACTED)1> application:which_applications(). >> [{ssl_hello_world,"Cowboy Hello World example with SSL.", >> "1"}, >> {ssl,"Erlang/OTP SSL application","5.3.6"}, >> {cowboy,"Small, fast, modular HTTP server.","1.0.0"}, >> {cowlib,"Support library for manipulating Web protocols.", >> "1.0.0"}, >> {public_key,"Public key infrastructure","0.22.1"}, >> {crypto,"CRYPTO","3.4.1"}, >> {ranch,"Socket acceptor pool for TCP protocols.","1.0.0"}, >> {asn1,"The Erlang ASN1 compiler version 3.0.2","3.0.2"}, >> {stdlib,"ERTS CXC 138 10","2.2"}, >> {kernel,"ERTS CXC 138 10","3.0.3"}] >> (ssl_hello_world_example@REDACTED)2> init:stop(). >> ok >> (ssl_hello_world_example@REDACTED)3> >> =ERROR REPORT==== 29-Sep-2014::16:49:15 === >> Error in process <0.69.0> on node 'ssl_hello_world_example@REDACTED' >> with exit value: >> {{case_clause,{error,closed}},[{ranch_acceptor,loop,3,[{file,"src/ranch_acceptor.erl"},{line,28}]}]} >> ... >> =ERROR REPORT==== 29-Sep-2014::16:49:15 === >> Error in process <0.164.0> on node 'ssl_hello_world_example@REDACTED' >> with exit value: >> {{case_clause,{error,closed}},[{ranch_acceptor,loop,3,[{file,"src/ranch_acceptor.erl"},{line,28}]}]} >> >> The listener socket has been closed. >> It seems the node is still running, but: >> >> (ssl_hello_world_example@REDACTED)3> application:which_applications(). >> ** exception exit: {timeout,{gen_server,call, >> >> [application_controller,which_applications]}} >> in function gen_server:call/2 (gen_server.erl, line 182) >> >> If I change this line >> https://github.com/ninenines/ranch/blob/1.0.0/src/ranch_acceptor.erl#L40 >> to >> {error, _Reason} -> ok >> the acceptor processes do not crash after calling init:stop/0, and the >> node shuts down correctly. >> >> This behavour appears only in Erlang 17.3 (I have tried it in Debian 7.6, >> Ubuntu 12.04.5, OS X 10.9.5). In Erlang R16B03 everything seems to work >> correctly. >> >> What else can I do to reveal the cause of this issue? >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > From dangud@REDACTED Wed Oct 1 20:18:38 2014 From: dangud@REDACTED (Dan Gudmundsson) Date: Wed, 1 Oct 2014 20:18:38 +0200 Subject: [erlang-questions] phantom mnesia backup entries In-Reply-To: References: Message-ID: >From memory and without checking I believe those are delete markers for that record entry. On Wed, Oct 1, 2014 at 2:25 PM, tom kelly wrote: > Hi list, > > I've been examining an mnesia backup from one of our production machines > using the traverse_backup function and have found some strange entries. In > one fragmented set table (with no secondary indexes) where the record > structure is meant to be {tab_name, key, field1, field2} there exist > entries like: {tab_name, key}. > However I can't find the entries after loading the table fragment with > mnesia:restore. > > I've been trawling through our app to find where these might get created > but have drawn a blank and have come to the provisional conclusion that > they're an internal mnesia quirk. > > Can any of the mnesia experts on the list confirm or deny? And if > confirmed maybe provide a short explanation of their function to satisfy my > curiosity? > > Many thanks. > > //TTom. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From steven.charles.davis@REDACTED Wed Oct 1 21:58:43 2014 From: steven.charles.davis@REDACTED (Steve Davis) Date: Wed, 1 Oct 2014 14:58:43 -0500 Subject: [erlang-questions] Crypto differences (Red Hat ECC support) Message-ID: <284F2B69-157D-43ED-9C9C-31D1F8A2EF2D@gmail.com> I'm running an app that uses ECC public keys and have discovered a problem that only appears to emerge on RedHat ... ...specifically I'm getting not_sup for crypto:generate_key for ecdh. I have built openssl 1.0.1h from source on the RH server, and 17.3 on top of that, but still I am missing ec_gf2m, ecdsa and ecdh support (see 'public_keys' section in the below repl, and the comparative from deploys on OS X and Windows). On RedHat Linux 1> crypto:supports(). [{hashs,[md4,md5,sha,ripemd160,sha224,sha256,sha384,sha512]}, {ciphers,[des_cbc,des_cfb,des3_cbc,des_ede3,blowfish_cbc, blowfish_cfb64,blowfish_ofb64,blowfish_ecb,aes_cbc128, aes_cfb8,aes_cfb128,aes_cbc256,rc2_cbc,aes_ctr,rc4,des3_cbf, aes_ige256]}, {public_keys,[rsa,dss,dh,srp]}] 2> crypto:ec_curves(). [secp112r1,secp112r2,secp128r1,secp128r2,secp160k1, secp160r1,secp160r2,secp192r1,secp192k1,secp224k1,secp224r1, secp256k1,secp256r1,secp384r1,secp521r1,prime192v1, prime192v2,prime192v3,prime239v1,prime239v2,prime239v3, prime256v1,wtls6,wtls7,wtls8,wtls9,wtls12,brainpoolP160r1, brainpoolP160t1|...] On OSX + Windows 1> crypto:supports(). [{hashs,[md4,md5,sha,ripemd160,sha224,sha256,sha384,sha512]}, {ciphers,[des_cbc,des_cfb,des3_cbc,des_ede3,blowfish_cbc, blowfish_cfb64,blowfish_ofb64,blowfish_ecb,aes_cbc128, aes_cfb8,aes_cfb128,aes_cbc256,rc2_cbc,aes_ctr,rc4,des3_cbf, aes_ige256]}, {public_keys,[rsa,dss,dh,srp,ec_gf2m,ecdsa,ecdh]}] 2> crypto:ec_curves(). [secp112r1,secp112r2,secp128r1,secp128r2,secp160k1, secp160r1,secp160r2,secp192r1,secp192k1,secp224k1,secp224r1, secp256k1,secp256r1,secp384r1,secp521r1,prime192v1, prime192v2,prime192v3,prime239v1,prime239v2,prime239v3, prime256v1,wtls6,wtls7,wtls8,wtls9,wtls12,brainpoolP160r1, brainpoolP160t1|...] I'm hoping somebody else has faced this frustration before and found a solution...? regs, /s -------------- next part -------------- An HTML attachment was scrubbed... URL: From hawk.mattsson@REDACTED Wed Oct 1 22:35:05 2014 From: hawk.mattsson@REDACTED (=?UTF-8?Q?H=C3=A5kan_Mattsson?=) Date: Wed, 1 Oct 2014 22:35:05 +0200 Subject: [erlang-questions] phantom mnesia backup entries In-Reply-To: References: Message-ID: Yes, they are. They are typically inserted if the table is being updated during the backup. You will probably see the old record(s), the delete marker and the new record(s) in the backup. In that order. /H?kan On Wed, Oct 1, 2014 at 8:18 PM, Dan Gudmundsson wrote: > From memory and without checking I believe those are delete markers for > that record entry. > > > > On Wed, Oct 1, 2014 at 2:25 PM, tom kelly wrote: > >> Hi list, >> >> I've been examining an mnesia backup from one of our production machines >> using the traverse_backup function and have found some strange entries. In >> one fragmented set table (with no secondary indexes) where the record >> structure is meant to be {tab_name, key, field1, field2} there exist >> entries like: {tab_name, key}. >> However I can't find the entries after loading the table fragment with >> mnesia:restore. >> >> I've been trawling through our app to find where these might get created >> but have drawn a blank and have come to the provisional conclusion that >> they're an internal mnesia quirk. >> >> Can any of the mnesia experts on the list confirm or deny? And if >> confirmed maybe provide a short explanation of their function to satisfy my >> curiosity? >> >> Many thanks. >> >> //TTom. >> >> >> _______________________________________________ >> 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 tauceti100@REDACTED Wed Oct 1 23:13:33 2014 From: tauceti100@REDACTED (buddy) Date: Thu, 2 Oct 2014 01:13:33 +0400 Subject: [erlang-questions] The node (with release using ssl) does not shut down after calling init:stop/0 in Erlang 17.3 In-Reply-To: References: Message-ID: It occurs the ssl listener socket now closes before the ranch application is shutdown. ?an this behaviour be considered as normal? From ingela.andin@REDACTED Wed Oct 1 23:30:51 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Wed, 1 Oct 2014 23:30:51 +0200 Subject: [erlang-questions] The node (with release using ssl) does not shut down after calling init:stop/0 in Erlang 17.3 In-Reply-To: References: Message-ID: Hi! 2014-10-01 23:13 GMT+02:00 buddy : > It occurs the ssl listener socket now closes before the ranch > application is shutdown. ?an this behaviour be considered as normal? > I am not so familiar with the ranch application, but as the ranch application uses the ssl application it sounds normal that a ssl listen socket can be closed before the ranch application has finished its shutdown. Timing of events of course can change between releases or platforms running the same release. Regards Ingela Erlang/OTP team - Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Thu Oct 2 09:36:06 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Thu, 2 Oct 2014 09:36:06 +0200 Subject: [erlang-questions] Fwd: Crypto differences (Red Hat ECC support) In-Reply-To: References: <284F2B69-157D-43ED-9C9C-31D1F8A2EF2D@gmail.com> <75FAD0CD-B368-4157-99CB-63DAC440E226@gmail.com> Message-ID: Hi! 2014-10-01 23:36 GMT+02:00 Steve Davis : > ...which doesn't address the issue? > > I think it does! It talks about problems that ECC, especially ECDH support, was not available in some Red Hat distributions, it talks about patent problems, and also about that the issue was resolved, and that software using OpenSSL needed be recompiled after taking the update. I do not know exactly what will solve your problem but upgrading your Red Hat distribution seems to be a good place to start! Regards Ingela Erlang/OTP team - Ericsson AB > On Oct 1, 2014, at 4:18 PM, Ingela Andin wrote: > > Hi! > > Google suggest the following link: > > https://bugzilla.redhat.com/show_bug.cgi?id=319901 > > > Regards Ingela Erlang/OTP Team - Ericsson AB > > 2014-10-01 21:58 GMT+02:00 Steve Davis : > >> I'm running an app that uses ECC public keys and have discovered a >> problem that only appears to emerge on RedHat ... >> >> ...specifically I'm getting not_sup for crypto:generate_key for ecdh. >> >> I have built openssl 1.0.1h from source on the RH server, and 17.3 on top >> of that, but still I am missing ec_gf2m, ecdsa and ecdh support (see >> 'public_keys' section in the below repl, and the comparative from deploys >> on OS X and Windows). >> >> On RedHat Linux >> 1> crypto:supports(). >> [{hashs,[md4,md5,sha,ripemd160,sha224,sha256,sha384,sha512]}, >> {ciphers,[des_cbc,des_cfb,des3_cbc,des_ede3,blowfish_cbc, >> blowfish_cfb64,blowfish_ofb64,blowfish_ecb,aes_cbc128, >> aes_cfb8,aes_cfb128,aes_cbc256,rc2_cbc,aes_ctr,rc4,des3_cbf, >> aes_ige256]}, >> {public_keys,[rsa,dss,dh,srp]}] >> 2> crypto:ec_curves(). >> [secp112r1,secp112r2,secp128r1,secp128r2,secp160k1, >> secp160r1,secp160r2,secp192r1,secp192k1,secp224k1,secp224r1, >> secp256k1,secp256r1,secp384r1,secp521r1,prime192v1, >> prime192v2,prime192v3,prime239v1,prime239v2,prime239v3, >> prime256v1,wtls6,wtls7,wtls8,wtls9,wtls12,brainpoolP160r1, >> brainpoolP160t1|...] >> >> On OSX + Windows >> 1> crypto:supports(). >> [{hashs,[md4,md5,sha,ripemd160,sha224,sha256,sha384,sha512]}, >> {ciphers,[des_cbc,des_cfb,des3_cbc,des_ede3,blowfish_cbc, >> blowfish_cfb64,blowfish_ofb64,blowfish_ecb,aes_cbc128, >> aes_cfb8,aes_cfb128,aes_cbc256,rc2_cbc,aes_ctr,rc4,des3_cbf, >> aes_ige256]}, >> {public_keys,[rsa,dss,dh,srp,ec_gf2m,ecdsa,ecdh]}] >> 2> crypto:ec_curves(). >> [secp112r1,secp112r2,secp128r1,secp128r2,secp160k1, >> secp160r1,secp160r2,secp192r1,secp192k1,secp224k1,secp224r1, >> secp256k1,secp256r1,secp384r1,secp521r1,prime192v1, >> prime192v2,prime192v3,prime239v1,prime239v2,prime239v3, >> prime256v1,wtls6,wtls7,wtls8,wtls9,wtls12,brainpoolP160r1, >> brainpoolP160t1|...] >> >> I'm hoping somebody else has faced this frustration before and found a >> solution...? >> >> regs, >> /s >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tauceti100@REDACTED Thu Oct 2 10:18:45 2014 From: tauceti100@REDACTED (buddy) Date: Thu, 2 Oct 2014 12:18:45 +0400 Subject: [erlang-questions] The node (with release using ssl) does not shut down after calling init:stop/0 in Erlang 17.3 In-Reply-To: References: Message-ID: Hello Ingela, Thank you for clarification! 2014-10-02 1:30 GMT+04:00, Ingela Andin : > Hi! > > 2014-10-01 23:13 GMT+02:00 buddy : > >> It occurs the ssl listener socket now closes before the ranch >> application is shutdown. ?an this behaviour be considered as normal? >> > > I am not so familiar with the ranch application, but as the ranch > application uses the ssl application it sounds normal that a ssl listen > socket can be closed before the ranch application has finished its > shutdown. Timing of events of course can change between releases or > platforms running the same release. > > Regards Ingela Erlang/OTP team - Ericsson AB > From joakim@REDACTED Thu Oct 2 10:30:46 2014 From: joakim@REDACTED (Joakim Hirsch) Date: Thu, 02 Oct 2014 10:30:46 +0200 Subject: [erlang-questions] Reading data from wxListCtrl In-Reply-To: <542A77F0.9060503@snookerhallen.se> References: <542A77F0.9060503@snookerhallen.se> Message-ID: <542D0D36.1010701@snookerhallen.se> I found the answer. To be able to read back data from a wxListCtrl, using wxListCtrl:getItem/2 you need to set the item mask using wxListItem:setMask/2. This is (indirectly) documented under getMask/1 in the external docs. To get the text you should call: wxListItem:new/0 wxListItem:setId/2 wxListItem:setColumn/2 wxListItem:setMask/2, with mask at least containing ?wxLIST_MASK_TEXT wxListCtrl:getItem/2 wxListItem:destroy/1 /Joakim Joakim Hirsch skrev 2014-09-30 11:29: > Hi, > > I'm having some trouble using wxListCtrl. I've created a table and > filled it with data. When a row is activated (2-click) I receive an > index into the table: the row number. I want to read (some of) the > data from that row, but I can't figure out how. > > To me it appears as if wxListCtrl:getItem/1 doesn't read the data into > the Item. Below is a minimal example. Where do I go wrong? > > Regs, > Joakim > > -module(test_gui). > > -behaviour(wx_object). > > %% Client API > -export([start/0]). > > %% wx_object callbacks > -export([init/1, terminate/2, code_change/3, > handle_info/2, handle_call/3, handle_cast/2, handle_event/2, > handle_sync_event/3]). > > -include_lib("wx/include/wx.hrl"). > > -record(state, > { > parent > }). > > > start() -> > Wx = wx:new(), > Size = {size, {500, 500}}, > Frame = wxFrame:new(Wx, ?wxID_ANY, "Title", [Size]), > Config = [{parent, Frame}], > wx_object:start_link(?MODULE, Config, []). > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > init(Config) -> > wx:batch(fun() -> do_init(Config) end). > > do_init(Config) -> > Parent = proplists:get_value(parent, Config), > > % Create panel and set up sizer. > Panel = wxPanel:new(Parent, []), > MainSizer = wxBoxSizer:new(?wxVERTICAL), > wxPanel:setSizer(Panel, MainSizer), > > LC = wxListCtrl:new(Panel, [{style, ?wxLC_REPORT bor > ?wxLC_SINGLE_SEL}]), > wxSizer:add(MainSizer, LC, [{flag, ?wxEXPAND}]), > > % Create columns > wxListCtrl:insertColumn(LC, 0, "name", []), > wxListCtrl:insertColumn(LC, 1, "address", []), > > % Create the row > wxListCtrl:insertItem(LC, 0, ""), > > % Write cell 0,0 > wxListCtrl:setItem(LC, 0, 0, "Bob"), > > % Write cell 0,1 > Item1 = wxListItem:new(), > wxListItem:setId(Item1, 0), > wxListItem:setColumn(Item1, 1), > wxListItem:setText(Item1, "Street"), > true = wxListCtrl:setItem(LC, Item1), > > wxFrame:show(Parent), > > % Read 0,0 > It0 = wxListItem:new(), > wxListItem:setId(It0, 0), > wxListItem:setColumn(It0, 0), > true = wxListCtrl:getItem(LC, It0), > > io:format("Row 0: ~p~n", [wxListItem:getId(It0)]), > io:format("Col 0: ~p~n", [wxListItem:getColumn(It0)]), > io:format("getText: ~p~n", [wxListItem:getText(It0)]), > > % Read 0,1 > It1 = wxListItem:new(), > wxListItem:setId(It1, 0), > wxListItem:setColumn(It1, 1), > true = wxListCtrl:getItem(LC, It1), > > io:format("Row 0: ~p~n", [wxListItem:getId(It1)]), > io:format("Col 1: ~p~n", [wxListItem:getColumn(It1)]), > io:format("getText: ~p~n", [wxListItem:getText(It1)]), > > wxWindow:connect(LC, command_list_item_activated), > > {Parent, #state{parent = Parent}}. > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > %% Sync events i.e. from callbacks must return ok, it can not return a > %% new state. Do the redrawing here. > handle_sync_event(#wx{event = #wxPaint{}},_, > #state{}) -> > ok. > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > %% Callbacks handled as normal gen_server callbacks > %% > > handle_event(#wx{obj = LC, > event = #wxList{type = command_list_item_activated, itemIndex > = Index}}, > State) -> > > It0 = wxListItem:new(), > wxListItem:setId(It0, Index), > wxListItem:setColumn(It0, 0), > true = wxListCtrl:getItem(LC, It0), > > io:format("Row 0: ~p~n", [wxListItem:getId(It0)]), > io:format("Col 0: ~p~n", [wxListItem:getColumn(It0)]), > io:format("getText: ~p~n", [wxListItem:getText(It0)]), > > It1 = wxListItem:new(), > wxListItem:setId(It1, Index), > wxListItem:setColumn(It1, 1), > true = wxListCtrl:getItem(LC, It1), > > io:format("Row 0: ~p~n", [wxListItem:getId(It1)]), > io:format("Col 1: ~p~n", [wxListItem:getColumn(It1)]), > io:format("getText: ~p~n", [wxListItem:getText(It1)]), > > {noreply, State}; > > %% Unknown event. > %% > handle_event(Ev = #wx{}, State) -> > io:format("Got event:~p\n", [Ev]), > {noreply, State}. > > handle_info(Msg, State) -> > io:format("Got Info ~p\n", [Msg]), > {noreply, State}. > > handle_call(shutdown, _From, State=#state{parent=Parent}) -> > io:format("Shutdown~n", []), > wxPanel:destroy(Parent), > {stop, normal, ok, State}; > > handle_call(Msg, _From, State) -> > io:format("Got Call ~p\n", [Msg]), > {reply, {error, unknown_call}, State}. > > handle_cast(Msg, State) -> > io:format("Got cast ~p~n",[Msg]), > {noreply, State}. > > code_change(_, _, State) -> > {stop, ignore, State}. > > terminate(_Reason, _State) -> > io:format("Stopping~n", []), > wx:destroy(), > ok. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Thu Oct 2 11:25:02 2014 From: donpedrothird@REDACTED (Evgeny M) Date: Thu, 2 Oct 2014 02:25:02 -0700 (PDT) Subject: [erlang-questions] Crypto differences (Red Hat ECC support) In-Reply-To: <284F2B69-157D-43ED-9C9C-31D1F8A2EF2D@gmail.com> References: <284F2B69-157D-43ED-9C9C-31D1F8A2EF2D@gmail.com> Message-ID: <189e11fe-19f7-460a-ad7e-59fc857b234a@googlegroups.com> It's not resolved in Centos 7, so I doubt it is resolved in the upstream. Some ECC methods are included, other are not, and what is included and what isn't varies between distributions and their versions. The only two ways I found so far are either to disable ECC altogether (configure Erlang with CFLAGS="-DOPENSSL_NO_EC=1" ./configure ) or to build openssl from sources which have ECC. From drormein@REDACTED Thu Oct 2 14:46:09 2014 From: drormein@REDACTED (Dror Mein) Date: Thu, 2 Oct 2014 12:46:09 +0000 (UTC) Subject: [erlang-questions] eprof crashes on start Message-ID: <128153035.125633.1412253969314.JavaMail.yahoo@jws10615.mail.bf1.yahoo.com> Hey all,trying to run eprof but fail. I have a simple module that runs on a large binary. 1>erlang:spawn(Mod, Fun, Args).{ok, <0.38.0>}2>eprof:start().{ok, <0.40.0>}3> eprof:start_profiling(pid(0,38,0)).=ERROR REPORT====** Generic server eprof terminating** Last message in was {profile_start,<0,40,0>, {'_','_','_'},undefuned,[{set_on_spawn,true}]}** When server state == {state,false,{'_','_','_'},[],[],undefined,undefined,undefined,{bpd,0,0,{0,nil},[]}}** Reason for termination ==** {function_clause,[{eprof,set_process_trace,[true,<0.38.0>,[set,on,spawn,call]],[{file,"eprof.erl"},{line,212}]}... what am i missing? both processes are alive before 3. -------------- next part -------------- An HTML attachment was scrubbed... URL: From steven.charles.davis@REDACTED Fri Oct 3 01:31:06 2014 From: steven.charles.davis@REDACTED (Steve Davis) Date: Thu, 2 Oct 2014 18:31:06 -0500 Subject: [erlang-questions] Crypto differences (Red Hat ECC support) In-Reply-To: References: <284F2B69-157D-43ED-9C9C-31D1F8A2EF2D@gmail.com> <75FAD0CD-B368-4157-99CB-63DAC440E226@gmail.com> Message-ID: <4AE82E1F-CED7-4A13-A30D-5A7F1C65F526@gmail.com> Hi Ingela, Thanks for your responses. I was aware of the claimed legal issue, so I had already built openssl on that server from a pristine tarball (rather than the supplied rpms). I was frustrated and I could not understand why these ciphers still weren't appearing. crypto:info_lib() supplied the answer... the erlang distro was still pointing at the FIPS compliant openssl libraries rather than the new openssl install... agh! If others face this issue: 1) before building openssl, export CFLAGS="-fDIC", at configure, invoke with the keyword "shared" then make and install as usual 2) once openssl is built and ec + ecparams commands are available, configure erlang with the explicit flag --with-ssl=/usr/local/ssl regs, /s On Oct 2, 2014, at 2:33 AM, Ingela Andin wrote: > Hi! > > 2014-10-01 23:36 GMT+02:00 Steve Davis : > ...which doesn't address the issue? > > > I think it does! It talks about problems that ECC, especially ECDH support, was not available in some Red Hat distributions, it talks about patent problems, and also > about that the issue was resolved, and that software using OpenSSL needed be recompiled after taking the update. I do not know exactly what will solve your problem but > upgrading your Red Hat distribution seems to be a good place to start! > > Regards Ingela Erlang/OTP team - Ericsson AB > > > > > On Oct 1, 2014, at 4:18 PM, Ingela Andin wrote: > >> Hi! >> >> Google suggest the following link: >> >> https://bugzilla.redhat.com/show_bug.cgi?id=319901 >> >> >> Regards Ingela Erlang/OTP Team - Ericsson AB >> >> 2014-10-01 21:58 GMT+02:00 Steve Davis : >> I'm running an app that uses ECC public keys and have discovered a problem that only appears to emerge on RedHat ... >> >> ...specifically I'm getting not_sup for crypto:generate_key for ecdh. >> >> I have built openssl 1.0.1h from source on the RH server, and 17.3 on top of that, but still I am missing ec_gf2m, ecdsa and ecdh support (see 'public_keys' section in the below repl, and the comparative from deploys on OS X and Windows). >> >> On RedHat Linux >> 1> crypto:supports(). >> [{hashs,[md4,md5,sha,ripemd160,sha224,sha256,sha384,sha512]}, >> {ciphers,[des_cbc,des_cfb,des3_cbc,des_ede3,blowfish_cbc, >> blowfish_cfb64,blowfish_ofb64,blowfish_ecb,aes_cbc128, >> aes_cfb8,aes_cfb128,aes_cbc256,rc2_cbc,aes_ctr,rc4,des3_cbf, >> aes_ige256]}, >> {public_keys,[rsa,dss,dh,srp]}] >> 2> crypto:ec_curves(). >> [secp112r1,secp112r2,secp128r1,secp128r2,secp160k1, >> secp160r1,secp160r2,secp192r1,secp192k1,secp224k1,secp224r1, >> secp256k1,secp256r1,secp384r1,secp521r1,prime192v1, >> prime192v2,prime192v3,prime239v1,prime239v2,prime239v3, >> prime256v1,wtls6,wtls7,wtls8,wtls9,wtls12,brainpoolP160r1, >> brainpoolP160t1|...] >> >> On OSX + Windows >> 1> crypto:supports(). >> [{hashs,[md4,md5,sha,ripemd160,sha224,sha256,sha384,sha512]}, >> {ciphers,[des_cbc,des_cfb,des3_cbc,des_ede3,blowfish_cbc, >> blowfish_cfb64,blowfish_ofb64,blowfish_ecb,aes_cbc128, >> aes_cfb8,aes_cfb128,aes_cbc256,rc2_cbc,aes_ctr,rc4,des3_cbf, >> aes_ige256]}, >> {public_keys,[rsa,dss,dh,srp,ec_gf2m,ecdsa,ecdh]}] >> 2> crypto:ec_curves(). >> [secp112r1,secp112r2,secp128r1,secp128r2,secp160k1, >> secp160r1,secp160r2,secp192r1,secp192k1,secp224k1,secp224r1, >> secp256k1,secp256r1,secp384r1,secp521r1,prime192v1, >> prime192v2,prime192v3,prime239v1,prime239v2,prime239v3, >> prime256v1,wtls6,wtls7,wtls8,wtls9,wtls12,brainpoolP160r1, >> brainpoolP160t1|...] >> >> I'm hoping somebody else has faced this frustration before and found a solution...? >> >> regs, >> /s >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Fri Oct 3 11:10:53 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Fri, 3 Oct 2014 11:10:53 +0200 Subject: [erlang-questions] Crypto differences (Red Hat ECC support) In-Reply-To: <4AE82E1F-CED7-4A13-A30D-5A7F1C65F526@gmail.com> References: <284F2B69-157D-43ED-9C9C-31D1F8A2EF2D@gmail.com> <75FAD0CD-B368-4157-99CB-63DAC440E226@gmail.com> <4AE82E1F-CED7-4A13-A30D-5A7F1C65F526@gmail.com> Message-ID: Hi! 2014-10-03 1:31 GMT+02:00 Steve Davis : > Hi Ingela, > > Thanks for your responses. I was aware of the claimed legal issue, so I > had already built openssl on that server from a pristine tarball (rather > than the supplied rpms). I was frustrated and I could not understand why > these ciphers still weren't appearing. > > crypto:info_lib() supplied the answer... the erlang distro was still > pointing at the FIPS compliant openssl libraries rather than the new > openssl install... agh! > > Ah, well that was that function is for. Thank you for sharing the solution. From the information I got from your first mail the only conclusion I could draw was that it seemed to be an OpenSSL issue on Redhat and not an Erlang issue, so I Googled that ... and the rest is history ;) Regards Ingela Erlang/OTP team - Ericsson AB If others face this issue: > 1) before building openssl, export CFLAGS="-fDIC", at configure, invoke > with the keyword "shared" then make and install as usual > 2) once openssl is built and ec + ecparams commands are available, > configure erlang with the explicit flag --with-ssl=/usr/local/ssl > > regs, > /s > > > On Oct 2, 2014, at 2:33 AM, Ingela Andin wrote: > > Hi! > > 2014-10-01 23:36 GMT+02:00 Steve Davis : > >> ...which doesn't address the issue? >> >> > I think it does! It talks about problems that ECC, especially ECDH > support, was not available in some Red Hat distributions, it talks about > patent problems, and also > about that the issue was resolved, and that software using OpenSSL needed > be recompiled after taking the update. I do not know exactly what will > solve your problem but > upgrading your Red Hat distribution seems to be a good place to start! > > Regards Ingela Erlang/OTP team - Ericsson AB > > > > > >> On Oct 1, 2014, at 4:18 PM, Ingela Andin wrote: >> >> Hi! >> >> Google suggest the following link: >> >> https://bugzilla.redhat.com/show_bug.cgi?id=319901 >> >> >> Regards Ingela Erlang/OTP Team - Ericsson AB >> >> 2014-10-01 21:58 GMT+02:00 Steve Davis : >> >>> I'm running an app that uses ECC public keys and have discovered a >>> problem that only appears to emerge on RedHat ... >>> >>> ...specifically I'm getting not_sup for crypto:generate_key for ecdh. >>> >>> I have built openssl 1.0.1h from source on the RH server, and 17.3 on >>> top of that, but still I am missing ec_gf2m, ecdsa and ecdh support (see >>> 'public_keys' section in the below repl, and the comparative from deploys >>> on OS X and Windows). >>> >>> On RedHat Linux >>> 1> crypto:supports(). >>> [{hashs,[md4,md5,sha,ripemd160,sha224,sha256,sha384,sha512]}, >>> {ciphers,[des_cbc,des_cfb,des3_cbc,des_ede3,blowfish_cbc, >>> blowfish_cfb64,blowfish_ofb64,blowfish_ecb,aes_cbc128, >>> aes_cfb8,aes_cfb128,aes_cbc256,rc2_cbc,aes_ctr,rc4,des3_cbf, >>> aes_ige256]}, >>> {public_keys,[rsa,dss,dh,srp]}] >>> 2> crypto:ec_curves(). >>> [secp112r1,secp112r2,secp128r1,secp128r2,secp160k1, >>> secp160r1,secp160r2,secp192r1,secp192k1,secp224k1,secp224r1, >>> secp256k1,secp256r1,secp384r1,secp521r1,prime192v1, >>> prime192v2,prime192v3,prime239v1,prime239v2,prime239v3, >>> prime256v1,wtls6,wtls7,wtls8,wtls9,wtls12,brainpoolP160r1, >>> brainpoolP160t1|...] >>> >>> On OSX + Windows >>> 1> crypto:supports(). >>> [{hashs,[md4,md5,sha,ripemd160,sha224,sha256,sha384,sha512]}, >>> {ciphers,[des_cbc,des_cfb,des3_cbc,des_ede3,blowfish_cbc, >>> blowfish_cfb64,blowfish_ofb64,blowfish_ecb,aes_cbc128, >>> aes_cfb8,aes_cfb128,aes_cbc256,rc2_cbc,aes_ctr,rc4,des3_cbf, >>> aes_ige256]}, >>> {public_keys,[rsa,dss,dh,srp,ec_gf2m,ecdsa,ecdh]}] >>> 2> crypto:ec_curves(). >>> [secp112r1,secp112r2,secp128r1,secp128r2,secp160k1, >>> secp160r1,secp160r2,secp192r1,secp192k1,secp224k1,secp224r1, >>> secp256k1,secp256r1,secp384r1,secp521r1,prime192v1, >>> prime192v2,prime192v3,prime239v1,prime239v2,prime239v3, >>> prime256v1,wtls6,wtls7,wtls8,wtls9,wtls12,brainpoolP160r1, >>> brainpoolP160t1|...] >>> >>> I'm hoping somebody else has faced this frustration before and found a >>> solution...? >>> >>> regs, >>> /s >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ali.yakout@REDACTED Fri Oct 3 13:15:04 2014 From: ali.yakout@REDACTED (Ali Yakout) Date: Fri, 3 Oct 2014 11:15:04 +0000 Subject: [erlang-questions] Interrupt ct_telnet expect Message-ID: <6F71304551DF7E4BA518D0366CE796131A125DFE@ESESSMB107.ericsson.se> Hi, Is there a way to interrupt a ct_telnet:expect with large timeout to make it stop? I tried ct_telnet:close but the process died with reason kill and that crashed my run. If I use several calls to ct_telnet:expect with smaller timeouts, I'm afraid I'm going to lose some output from the console that I'm watching. Thanks -Ali From essen@REDACTED Fri Oct 3 17:06:58 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Fri, 03 Oct 2014 18:06:58 +0300 Subject: [erlang-questions] The node (with release using ssl) does not shut down after calling init:stop/0 in Erlang 17.3 In-Reply-To: References: Message-ID: <542EBB92.8030709@ninenines.eu> Hi, On 10/02/2014 12:30 AM, Ingela Andin wrote: > Hi! > > 2014-10-01 23:13 GMT+02:00 buddy >: > > It occurs the ssl listener socket now closes before the ranch > application is shutdown. ?an this behaviour be considered as normal? > > > I am not so familiar with the ranch application, but as the ranch > application uses the ssl application it sounds normal that a ssl listen > socket can be closed before the ranch application has finished its > shutdown. Timing of events of course can change between releases or > platforms running the same release. It is not normal and there should be no timing issue involved. The processes are like this: supervisor owns the listening socket |-> children do the accept When the application is stopped, the children are killed with brutal_kill by the supervisor, which then proceeds to end (and thus closes the listening socket). So this is not a timing issue as the termination order does not allow for this scenario, or at least not one where the application closes the socket before the children who accept connections. On the other hand the supervisor has a terminate value set to infinity (the recommended for supervisors) so this might be part of the reason why it ends up causing errors/not stopping the VM, and could be unrelated to SSL (though it apparently only happens with SSL listeners from what I understand). Something else could prevent the application from stopping properly. A ticket has been open on the Ranch tracker so I will investigate further when I get the time. -- Lo?c Hoguin http://ninenines.eu From carlopires@REDACTED Fri Oct 3 21:14:07 2014 From: carlopires@REDACTED (Carlo Pires) Date: Fri, 3 Oct 2014 16:14:07 -0300 Subject: [erlang-questions] Starting application with dependences [newbie] Message-ID: Hello, I'm trying to start and application from erlang REPL and got the message: 2> application:start(echo_test). {error,{not_started,erlzmq}} But erlzmq is listed in applications section of OTP app file: {application, echo_test, [ {description, "Echo test with erlzmq2"}, {vsn, "1"}, {modules, [echo_test, echo_test_sup, echo_test_app]}, {registered, [echo_test_sup]}, {applications, [kernel, stdlib, erlzmq]}, {mod, {echo_test_app, []}}, {env, []} ]}. Looking at some apps from github I noticed the use of a mechanism like *ensure_app_start* in each app:start() function. So, Isn't supposed that erlang OTP app controller will start the dependent applications listed in app file? What am I missing here? -- Carlo Pires -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Fri Oct 3 22:18:41 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Fri, 3 Oct 2014 16:18:41 -0400 Subject: [erlang-questions] Starting application with dependences [newbie] In-Reply-To: References: Message-ID: On Fri, Oct 3, 2014 at 3:14 PM, Carlo Pires wrote: > Hello, > > I'm trying to start and application from erlang REPL and got the message: > > 2> application:start(echo_test). > {error,{not_started,erlzmq}} > Assuming you're using a recent version of Erlang, try application:ensure_all_started(echo_test) instead. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From prof3ta@REDACTED Fri Oct 3 22:20:45 2014 From: prof3ta@REDACTED (Roberto Aloi) Date: Fri, 3 Oct 2014 22:20:45 +0200 Subject: [erlang-questions] Starting application with dependences [newbie] In-Reply-To: References: Message-ID: Hi Carlo, Your interpretation is correct. The applications listed in the .app file are simply *required* to be started before the given application. They are not started automatically. You can create a "release" (i.e. wrap a set of applications into a single entity) and specify which applications to start there. See: http://learnyousomeerlang.com/release-is-the-word Or you can use the "ensure_all_started" approach, as Steve suggests while I'm still typing this. Cheers, Roberto On 3 October 2014 21:14, Carlo Pires wrote: > Hello, > > I'm trying to start and application from erlang REPL and got the message: > > 2> application:start(echo_test). > {error,{not_started,erlzmq}} > > But erlzmq is listed in applications section of OTP app file: > > {application, echo_test, > [ > {description, "Echo test with erlzmq2"}, > {vsn, "1"}, > {modules, [echo_test, echo_test_sup, echo_test_app]}, > {registered, [echo_test_sup]}, > {applications, [kernel, stdlib, erlzmq]}, > {mod, {echo_test_app, []}}, > {env, []} > ]}. > > Looking at some apps from github I noticed the use of a mechanism like > *ensure_app_start* in each app:start() function. > > So, Isn't supposed that erlang OTP app controller will start the dependent > applications listed in app file? What am I missing here? > > > -- > Carlo Pires > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Roberto Aloi --- Website: http://roberto-aloi.com Twitter: @robertoaloi -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Fri Oct 3 23:22:38 2014 From: mjtruog@REDACTED (Michael Truog) Date: Fri, 03 Oct 2014 14:22:38 -0700 Subject: [erlang-questions] Starting application with dependences [newbie] In-Reply-To: References: Message-ID: <542F139E.1060406@gmail.com> On 10/03/2014 01:18 PM, Steve Vinoski wrote: > > > On Fri, Oct 3, 2014 at 3:14 PM, Carlo Pires > wrote: > > Hello, > > I'm trying to start and application from erlang REPL and got the message: > > 2> application:start(echo_test). > {error,{not_started,erlzmq}} > > > Assuming you're using a recent version of Erlang, try application:ensure_all_started(echo_test) instead. If you aren't, use reltool_util:application_start/1 from https://github.com/okeuday/reltool_util . That route also handles module loading which isn't currently handled in the application module. It is better to use a release though, as was mentioned previously (normally starting an Erlang OTP application programmatically is only done for testing). > > --steve > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Sat Oct 4 00:43:05 2014 From: t@REDACTED (Tristan Sloughter) Date: Fri, 03 Oct 2014 17:43:05 -0500 Subject: [erlang-questions] Starting application with dependences [newbie] In-Reply-To: <542F139E.1060406@gmail.com> References: <542F139E.1060406@gmail.com> Message-ID: <1412376185.3316263.174966641.61EE2505@webmail.messagingengine.com> Or [1]http://relx.org/ -- Tristan Sloughter t@REDACTED On Fri, Oct 3, 2014, at 04:22 PM, Michael Truog wrote: On 10/03/2014 01:18 PM, Steve Vinoski wrote: On Fri, Oct 3, 2014 at 3:14 PM, Carlo Pires <[2]carlopires@REDACTED> wrote: Hello, I'm trying to start and application from erlang REPL and got the message: 2> application:start(echo_test). {error,{not_started,erlzmq}} Assuming you're using a recent version of Erlang, try application:ensure_all_started(echo_test) instead. If you aren't, use reltool_util:application_start/1 from [3]https://github.com/okeuday/reltool_util . That route also handles module loading which isn't currently handled in the application module. It is better to use a release though, as was mentioned previously (normally starting an Erlang OTP application programmatically is only done for testing). --steve _______________________________________________ erlang-questions mailing list [4]erlang-questions@REDACTED [5]http://erlang.org/mailman/listinfo/erl ang-questions _______________________________________________ erlang-questions mailing list [6]erlang-questions@REDACTED [7]http://erlang.org/mailman/listinfo/erlang-questions References 1. http://relx.org/ 2. mailto:carlopires@REDACTED 3. https://github.com/okeuday/reltool_util 4. mailto:erlang-questions@REDACTED 5. http://erlang.org/mailman/listinfo/erlang-questions 6. mailto:erlang-questions@REDACTED 7. http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From eranga.erl@REDACTED Sun Oct 5 09:27:41 2014 From: eranga.erl@REDACTED (Eranga Udesh) Date: Sun, 5 Oct 2014 12:57:41 +0530 Subject: [erlang-questions] Erlang Memory Question In-Reply-To: References: <9A5764B7-9252-4560-9AD6-BEC0DAE0305E@cs.otago.ac.nz> Message-ID: By doing forced garbage collection, I managed to reduce the overall system memory consumption from 1 GB to 190 MB in normal operation. That's over 420% memory saving. A single use session was taking 12 MB of memory at peak and holding for some time before are now getting released fast. I didn't notice much change in CPU usage. I found temporary variables, eg. binary_to_list of a XML data say 100 KB in size (Xmerl needs string), won't get freed for a long period of time without force garbage collection. Therefore when there are about 500 user sessions, each process consuming large memory blocks, makes the system memory usage extremely high. We plan to support a large number of user sessions, say 10000s and this memory consumption is a show stopper for us at the moment. Using erlang:process_info/2, I can get the total memory usage of a process. But, is there a method to get full breakdown of the memory allocation in a process in waiting state? Eg. if it can show the memory usage of each variable in the current scope of the process, pending for garbage collection, etc., wold be ideal. Are there any fast XML parsers that work with binary, instead of string? - Eranga On Sun, Sep 28, 2014 at 9:16 AM, Robert Virding wrote: > The obvious question is whether you are sure you actually need to optimise > to save memory? Premature optimisation and all that. (Actually sensible > advice) Maybe reviewing algorithms and datastructures will do the trick for > you. > > Robert > > From my Nexus > On Sep 24, 2014 7:37 PM, "Eranga Udesh" wrote: > >> Thanks all for your advice. Let me see how I can apply them to my >> program. It looks like my code/logic is going to get ugly and induce a >> performance penalty, in order to save memory. >> >> Cheers, >> - Eranga >> >> On Wed, Sep 24, 2014 at 7:58 PM, Robert Raschke >> wrote: >> >>> I always thought that is one of the reasons to have processes. >>> If you've got something big you want to throw away quickly, make a >>> process for it. >>> >>> $ erl >>> Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:8:8] >>> [async-threads:10] [hipe] [kernel-poll:false] >>> >>> Eshell V5.10.4 (abort with ^G) >>> 1> erlang:memory(). >>> [{total,14148416}, >>> {processes,4091608}, >>> {processes_used,4091488}, >>> {system,10056808}, >>> {atom,194289}, >>> {atom_used,172614}, >>> {binary,1514552}, >>> {code,4026600}, >>> {ets,262688}] >>> 2> Pid = spawn( >>> 2> fun () -> >>> 2> X = binary:copy(<<1,2,3,4,5,6,7,8>>, 1024), >>> 2> Y = binary:copy(X, 1024), >>> 2> receive stop -> ok end >>> 2> end >>> 2> ). >>> <0.35.0> >>> 3> erlang:memory(). >>> [{total,22643832}, >>> {processes,4203448}, >>> {processes_used,4203448}, >>> {system,18440384}, >>> {atom,194289}, >>> {atom_used,175110}, >>> {binary,9685320}, >>> {code,4221791}, >>> {ets,267056}] >>> 4> Pid ! stop. >>> stop >>> 5> erlang:memory(). >>> [{total,13587776}, >>> {processes,4084496}, >>> {processes_used,4084384}, >>> {system,9503280}, >>> {atom,194289}, >>> {atom_used,175110}, >>> {binary,748144}, >>> {code,4221791}, >>> {ets,267056}] >>> 6> >>> >>> >>> Regards, >>> Robby >>> >>> >>> On 24 September 2014 02:13, Eranga Udesh wrote: >>> >>>> Well, yes I may deliberately lie. >>>> >>>> However my suggestion is to, instead of doing a full sweep by the >>>> garbage collector (GC) to identify data going out of scope and reclaim, can >>>> the program (or rather I) deliberately say I (the calling process) is >>>> finished using the said data, so the GC may free that part. >>>> >>>> Then the GC may carry out it's own logic, which it currently does to >>>> verify if the same data is referenced by any other processes, etc., and >>>> decide if to GC or not. >>>> >>>> = Eranga >>>> >>>> On Tue, Sep 23, 2014 at 12:42 PM, Richard A. O'Keefe >>> > wrote: >>>> >>>>> >>>>> On 23/09/2014, at 2:24 PM, Eranga Udesh wrote: >>>>> >>>>> > Thanks for the information received so far. >>>>> > >>>>> > Wouldn't it be good for Erlang to have a single object garbage >>>>> collection function/bif? >>>>> >>>>> NO. In C it's called free() and it's a major cause of errors. >>>>> >>>>> > For example, when I no longer require a large object, I force to >>>>> garbage collect it, without making a full sweep? >>>>> >>>>> Why should the garbage collector *believe* you that the "object" >>>>> is free? You could be deliberately lying. You could (and >>>>> probably are) be mistaken. How is it to know which bits you >>>>> want to keep without doing its usual thing? In a shared heap >>>>> implementation (which Erlang has had and may have again) the >>>>> fact that *you've* finished with the object doesn't mean >>>>> everyone *else* has. A meaningful operation should not depend >>>>> on implementation details like that. >>>>> > >>>>> > As mentioned in the document, a full sweep may degrade the >>>>> performance. >>>>> >>>>> Not half as much as freeing too much would! >>>>> >>>>> This is micro-optimisation. Avoid passing around large >>>>> objects in the first place. >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Sun Oct 5 17:00:09 2014 From: zxq9@REDACTED (zxq9) Date: Mon, 06 Oct 2014 00:00:09 +0900 Subject: [erlang-questions] Subordinate processes and stdout Message-ID: <5184523.EJRZasLjGP@changa> I wrote a toy broadcast to pid example today with R17, and in it I had the spawned processes output with io:format/2 instead of returning a message to the caller. It turns out, though, that unless the caller prints to stdout after the subordinates should have executed their own io call nothing is displayed if this is run in the shell (I haven't tried it as a script). Here is a sample: % Elementary broadcasting. -module(bcast). -export([start/0]). start() -> Pids = [spawn(fun() -> listener() end) || _ <- lists:seq(1,3)], Message = "This is my message.", ok = bcast(Pids, Message), io:format("~p ~p: Weirdly initiates the first batch of messages.~n", [self(), now()]), io:format("~p ~p: Initiates the second batch.~n", [self(), now()]), [exit(P, kill) || P <- Pids], ok. listener() -> receive {bcast, Message} -> Now = now(), io:format(user, "~p: ~p~n", [self(), Now]), io:format(user, "~p ~p: Received: ~p~n", [self(), now(), Message]), listener() end. bcast(Pids, Message) -> [P ! {bcast, Message} || P <- Pids], ok. And in the shell: 24> c(bcast). {ok,bcast} 25> bcast:start(). <0.138.0>: {1412,520755,828598} <0.33.0> {1412,520755,828584}: Weirdly initiates the first batch of messages. <0.139.0>: {1412,520755,828682} <0.140.0>: {1412,520755,828690} <0.138.0> {1412,520755,828803}: Received: "This is my message." <0.33.0> {1412,520755,828812}: Initiates the second batch. <0.139.0> {1412,520755,828815}: Received: "This is my message." <0.140.0> {1412,520755,828845}: Received: "This is my message." ok 26> bcast:start(). <0.33.0> {1412,520757,650460}: Weirdly initiates the first batch of messages. <0.142.0>: {1412,520757,650474} <0.143.0>: {1412,520757,650482} <0.144.0>: {1412,520757,650486} <0.33.0> {1412,520757,650656}: Initiates the second batch. <0.142.0> {1412,520757,650665}: Received: "This is my message." <0.143.0> {1412,520757,650671}: Received: "This is my message." <0.144.0> {1412,520757,650676}: Received: "This is my message." ok The two io:format/2 calls in start/0 appear to be necessary to permit the subordinates to access stdout. If I comment out one, then only the first subordinate process' io:format/2 is displayed, if I comment out both bcast:start/0 quietly returns 'ok'. Even more weird, though, is that the timestamps demonstrate that the calls to now/0 are happening after start/0's calls to io -- which seems very odd. What is happening here? I understand the group leader thing with stdout (at least I think I do -- this is all on a single, local node, anyway), but am puzzled at this behavior. Regards, -Craig From g@REDACTED Sun Oct 5 17:20:58 2014 From: g@REDACTED (Guilherme Andrade) Date: Sun, 05 Oct 2014 16:20:58 +0100 Subject: [erlang-questions] Subordinate processes and stdout In-Reply-To: <5184523.EJRZasLjGP@changa> References: <5184523.EJRZasLjGP@changa> Message-ID: <543161DA.1020604@gandrade.net> Hi Craig, You're killing the children on line 14; I imagine that, given the simplicity of this piece of code, in most runs the children won't actually have time to be properly scheduled and executed before they are killed. Replacing the io:format/2 calls on the parent with a 'timer:sleep(100)' had the same desired effect (i.e. the children printing out their messages successfully.) It's just premature death. Cheers, On 05-10-2014 16:00, zxq9 wrote: > I wrote a toy broadcast to pid example today with R17, and in it I had the > spawned processes output with io:format/2 instead of returning a message to > the caller. It turns out, though, that unless the caller prints to stdout > after the subordinates should have executed their own io call nothing is > displayed if this is run in the shell (I haven't tried it as a script). > > Here is a sample: > > % Elementary broadcasting. > -module(bcast). > -export([start/0]). > > start() -> > Pids = [spawn(fun() -> listener() end) || _ <- lists:seq(1,3)], > Message = "This is my message.", > ok = bcast(Pids, Message), > io:format("~p ~p: Weirdly initiates the first batch of messages.~n", > [self(), now()]), > io:format("~p ~p: Initiates the second batch.~n", > [self(), now()]), > [exit(P, kill) || P <- Pids], > ok. > > listener() -> > receive > {bcast, Message} -> > Now = now(), > io:format(user, "~p: ~p~n", [self(), Now]), > io:format(user, "~p ~p: Received: ~p~n", [self(), now(), > Message]), > listener() > end. > > bcast(Pids, Message) -> > [P ! {bcast, Message} || P <- Pids], > ok. > > And in the shell: > > 24> c(bcast). > {ok,bcast} > 25> bcast:start(). > <0.138.0>: {1412,520755,828598} > <0.33.0> {1412,520755,828584}: Weirdly initiates the first batch of messages. > <0.139.0>: {1412,520755,828682} > <0.140.0>: {1412,520755,828690} > <0.138.0> {1412,520755,828803}: Received: "This is my message." > <0.33.0> {1412,520755,828812}: Initiates the second batch. > <0.139.0> {1412,520755,828815}: Received: "This is my message." > <0.140.0> {1412,520755,828845}: Received: "This is my message." > ok > 26> bcast:start(). > <0.33.0> {1412,520757,650460}: Weirdly initiates the first batch of messages. > <0.142.0>: {1412,520757,650474} > <0.143.0>: {1412,520757,650482} > <0.144.0>: {1412,520757,650486} > <0.33.0> {1412,520757,650656}: Initiates the second batch. > <0.142.0> {1412,520757,650665}: Received: "This is my message." > <0.143.0> {1412,520757,650671}: Received: "This is my message." > <0.144.0> {1412,520757,650676}: Received: "This is my message." > ok > > The two io:format/2 calls in start/0 appear to be necessary to permit the > subordinates to access stdout. If I comment out one, then only the first > subordinate process' io:format/2 is displayed, if I comment out both > bcast:start/0 quietly returns 'ok'. Even more weird, though, is that the > timestamps demonstrate that the calls to now/0 are happening after start/0's > calls to io -- which seems very odd. > > What is happening here? I understand the group leader thing with stdout (at > least I think I do -- this is all on a single, local node, anyway), but am > puzzled at this behavior. > > Regards, > -Craig > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Guilherme https://www.gandrade.net/ PGP: 0x35CB8191 / 1968 5252 3901 B40F ED8A D67A 9330 79B1 35CB 8191 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 455 bytes Desc: OpenPGP digital signature URL: From vladdu55@REDACTED Sun Oct 5 17:33:55 2014 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Sun, 5 Oct 2014 17:33:55 +0200 Subject: [erlang-questions] Subordinate processes and stdout In-Reply-To: <5184523.EJRZasLjGP@changa> References: <5184523.EJRZasLjGP@changa> Message-ID: Hi Craig, Without the io:formats, the main process kills the chidren before they manage to get executed. Try adding "receive after 3000 -> ok end" before killing the children. regards, Vlad On Sun, Oct 5, 2014 at 5:00 PM, zxq9 wrote: > I wrote a toy broadcast to pid example today with R17, and in it I had the > spawned processes output with io:format/2 instead of returning a message to > the caller. It turns out, though, that unless the caller prints to stdout > after the subordinates should have executed their own io call nothing is > displayed if this is run in the shell (I haven't tried it as a script). > > Here is a sample: > > % Elementary broadcasting. > -module(bcast). > -export([start/0]). > > start() -> > Pids = [spawn(fun() -> listener() end) || _ <- lists:seq(1,3)], > Message = "This is my message.", > ok = bcast(Pids, Message), > io:format("~p ~p: Weirdly initiates the first batch of messages.~n", > [self(), now()]), > io:format("~p ~p: Initiates the second batch.~n", > [self(), now()]), > [exit(P, kill) || P <- Pids], > ok. > > listener() -> > receive > {bcast, Message} -> > Now = now(), > io:format(user, "~p: ~p~n", [self(), Now]), > io:format(user, "~p ~p: Received: ~p~n", [self(), now(), > Message]), > listener() > end. > > bcast(Pids, Message) -> > [P ! {bcast, Message} || P <- Pids], > ok. > > And in the shell: > > 24> c(bcast). > {ok,bcast} > 25> bcast:start(). > <0.138.0>: {1412,520755,828598} > <0.33.0> {1412,520755,828584}: Weirdly initiates the first batch of > messages. > <0.139.0>: {1412,520755,828682} > <0.140.0>: {1412,520755,828690} > <0.138.0> {1412,520755,828803}: Received: "This is my message." > <0.33.0> {1412,520755,828812}: Initiates the second batch. > <0.139.0> {1412,520755,828815}: Received: "This is my message." > <0.140.0> {1412,520755,828845}: Received: "This is my message." > ok > 26> bcast:start(). > <0.33.0> {1412,520757,650460}: Weirdly initiates the first batch of > messages. > <0.142.0>: {1412,520757,650474} > <0.143.0>: {1412,520757,650482} > <0.144.0>: {1412,520757,650486} > <0.33.0> {1412,520757,650656}: Initiates the second batch. > <0.142.0> {1412,520757,650665}: Received: "This is my message." > <0.143.0> {1412,520757,650671}: Received: "This is my message." > <0.144.0> {1412,520757,650676}: Received: "This is my message." > ok > > The two io:format/2 calls in start/0 appear to be necessary to permit the > subordinates to access stdout. If I comment out one, then only the first > subordinate process' io:format/2 is displayed, if I comment out both > bcast:start/0 quietly returns 'ok'. Even more weird, though, is that the > timestamps demonstrate that the calls to now/0 are happening after > start/0's > calls to io -- which seems very odd. > > What is happening here? I understand the group leader thing with stdout (at > least I think I do -- this is all on a single, local node, anyway), but am > puzzled at this behavior. > > Regards, > -Craig > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Sun Oct 5 18:26:45 2014 From: zxq9@REDACTED (zxq9) Date: Mon, 06 Oct 2014 01:26:45 +0900 Subject: [erlang-questions] Subordinate processes and stdout In-Reply-To: <543161DA.1020604@gandrade.net> References: <5184523.EJRZasLjGP@changa> <543161DA.1020604@gandrade.net> Message-ID: <1764627.RPxERC0i7o@changa> On 2014?10?5? ??? 16:20:58 you wrote: > Hi Craig, > > You're killing the children on line 14; I imagine that, given the > simplicity of this piece of code, in most runs the children won't > actually have time to be properly scheduled and executed before they are > killed. Replacing the io:format/2 calls on the parent with a > 'timer:sleep(100)' had the same desired effect (i.e. the children > printing out their messages successfully.) > > It's just premature death. Hi Guilherme & Vlad, Bah! I'm kicking myself now for not realizing that. I didn't figure that a call to io:format once would be precisely (and rather consistently) enough time for three subsequent calls in subordinates but no more. Once again, I've demonstrated to myself that correlation is not causation. Thanks, fellas. I feel much more sane now. From tuncer.ayaz@REDACTED Sun Oct 5 20:57:36 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sun, 5 Oct 2014 20:57:36 +0200 Subject: [erlang-questions] Help find bugs before OTP-18.0 is released In-Reply-To: References: Message-ID: On Wed, Sep 24, 2014 at 12:11 AM, Tuncer Ayaz wrote: > On Wed, Sep 24, 2014 at 12:00 AM, Shayan Pooya wrote: > > I tried building the source code with gcc 4.8.3 and it complains: > > > > > > gcc: error: unrecognized command line option > > > ?-fsanitize=address,undefined? > > > > > > It seems like this option is added to gcc 4.9: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60275 > > Sorry about that, I've tested UBSan only with gcc 4.9, so that > information was incorrect. > > But ASan is available in 4.8.3, right? ASan and TSan were added to gcc 4.8, so both should work. Sorry that I was imprecise and you tried to use UBSan with gcc 4.8. From desired.mta@REDACTED Sun Oct 5 21:56:07 2014 From: desired.mta@REDACTED (=?UTF-8?Q?Motiejus_Jak=C5=A1tys?=) Date: Sun, 5 Oct 2014 21:56:07 +0200 Subject: [erlang-questions] Erlang Memory Question In-Reply-To: References: <9A5764B7-9252-4560-9AD6-BEC0DAE0305E@cs.otago.ac.nz> Message-ID: On Sun, Oct 5, 2014 at 9:27 AM, Eranga Udesh wrote: > > Are there any fast XML parsers that work with binary, instead of string? There are quite a few, but I heard good comments about this one: https://github.com/maxlapshin/parsexml Regards, Motiejus From jesper.louis.andersen@REDACTED Sun Oct 5 23:17:41 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 5 Oct 2014 23:17:41 +0200 Subject: [erlang-questions] Erlang Memory Question In-Reply-To: References: <9A5764B7-9252-4560-9AD6-BEC0DAE0305E@cs.otago.ac.nz> Message-ID: On Sun, Oct 5, 2014 at 9:27 AM, Eranga Udesh wrote: > I found temporary variables, eg. binary_to_list of a XML data say 100 KB > in size (Xmerl needs string), won't get freed for a long period of time > without force garbage collection. Therefore when there are about 500 user > sessions, each process consuming large memory blocks, makes the system > memory usage extremely high. We plan to support a large number of user > sessions, say 10000s and this memory consumption is a show stopper for us > at the moment. Hi! This is your problem in a nutshell. Calling binary_to_list/1 on a 100KB binary blows it up to at least 2.4 megabytes in size. When the process is done, it takes a bit of time for the heap to shrink down again. It will just get into a serious problem when your system is going to process XML documents for a large set of users at the same time. You have two general options, which should both be applied in a serious system: * xmerl is only useful for small configuration blocks of data. If you are processing larger amounts of data, you need an XML parser which operates directly on the binary representation. In addition, if you can find an XML parser which allows you to parse in SAX-style, so you don't have to form an intermediate structure will help a lot. In Haskell, particularly GHC, fusion optimizations would mostly take of these things, but it doesn't exist in the Erlang ecosystem, so you will have to approach it yourself. Unfortunately I don't have any suggestion handy, since it is too long since I've last worked with XML as a format. * Your Erlang node() needs to have a way to shed load once it reaches capacity. In other words, you design your system up to a certain amount of simultaneous users and then you make sure there is a limit to how much processing that can happen concurrently. This frames the erlang system so it does not break down under the stress if it gets loaded over capacity. Fred Hebert has written a book, "Erlang in Anger"[0] which touches on the subject in chapter 3 - "Planning for overload". You may have 20.000 users on the system, but if you make sure only 100 of those can process XML data at the same time, you can at most have 240 megabytes of outstanding memory space at the moment. Also, you may want to think about how much time it will take K cores to chew through 240 megabytes of data. Reading data is expensive. Irina Guberman (from Ubiquity networks if memory serves) recently had a very insightful (and funny!) talk[1] on how she employed the "jobs" framework in a situation which is slightly akin to yours. It is highly recommended, since she touches on the subject in far more depth than what I do here. For a production system I would recommend employing some kind of queueing framework early on. Otherwise, you system will just bow under the load once it gets deployed. [0] http://www.erlang-in-anger.com/ [1] https://www.youtube.com/watch?v=1Z_Z8aLIBQ8&list=UUQ7dFBzZGlBvtU2hCecsBBg -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksoe@REDACTED Sun Oct 5 23:37:44 2014 From: eriksoe@REDACTED (=?UTF-8?Q?Erik_S=C3=B8e_S=C3=B8rensen?=) Date: Sun, 5 Oct 2014 23:37:44 +0200 Subject: [erlang-questions] Erlang Memory Question In-Reply-To: References: <9A5764B7-9252-4560-9AD6-BEC0DAE0305E@cs.otago.ac.nz> Message-ID: Good advice. For the short term, I think the option of hibernating the processes should be mentioned as well - it ensures that dormant session processes don't take up more memory than necessary. /Erik Den 05/10/2014 23.18 skrev "Jesper Louis Andersen" < jesper.louis.andersen@REDACTED>: > > On Sun, Oct 5, 2014 at 9:27 AM, Eranga Udesh wrote: > >> I found temporary variables, eg. binary_to_list of a XML data say 100 KB >> in size (Xmerl needs string), won't get freed for a long period of time >> without force garbage collection. Therefore when there are about 500 user >> sessions, each process consuming large memory blocks, makes the system >> memory usage extremely high. We plan to support a large number of user >> sessions, say 10000s and this memory consumption is a show stopper for us >> at the moment. > > > Hi! > > This is your problem in a nutshell. Calling binary_to_list/1 on a 100KB > binary blows it up to at least 2.4 megabytes in size. When the process is > done, it takes a bit of time for the heap to shrink down again. It will > just get into a serious problem when your system is going to process XML > documents for a large set of users at the same time. You have two general > options, which should both be applied in a serious system: > > * xmerl is only useful for small configuration blocks of data. If you are > processing larger amounts of data, you need an XML parser which operates > directly on the binary representation. In addition, if you can find an XML > parser which allows you to parse in SAX-style, so you don't have to form an > intermediate structure will help a lot. In Haskell, particularly GHC, > fusion optimizations would mostly take of these things, but it doesn't > exist in the Erlang ecosystem, so you will have to approach it yourself. > Unfortunately I don't have any suggestion handy, since it is too long since > I've last worked with XML as a format. > > * Your Erlang node() needs to have a way to shed load once it reaches > capacity. In other words, you design your system up to a certain amount of > simultaneous users and then you make sure there is a limit to how much > processing that can happen concurrently. This frames the erlang system so > it does not break down under the stress if it gets loaded over capacity. > Fred Hebert has written a book, "Erlang in Anger"[0] which touches on the > subject in chapter 3 - "Planning for overload". You may have 20.000 users > on the system, but if you make sure only 100 of those can process XML data > at the same time, you can at most have 240 megabytes of outstanding memory > space at the moment. Also, you may want to think about how much time it > will take K cores to chew through 240 megabytes of data. Reading data is > expensive. > > Irina Guberman (from Ubiquity networks if memory serves) recently had a > very insightful (and funny!) talk[1] on how she employed the "jobs" > framework in a situation which is slightly akin to yours. It is highly > recommended, since she touches on the subject in far more depth than what I > do here. For a production system I would recommend employing some kind of > queueing framework early on. Otherwise, you system will just bow under the > load once it gets deployed. > > [0] http://www.erlang-in-anger.com/ > [1] > https://www.youtube.com/watch?v=1Z_Z8aLIBQ8&list=UUQ7dFBzZGlBvtU2hCecsBBg > > -- > J. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eranga.erl@REDACTED Mon Oct 6 03:38:32 2014 From: eranga.erl@REDACTED (Eranga Udesh) Date: Mon, 6 Oct 2014 07:08:32 +0530 Subject: [erlang-questions] Erlang Memory Question In-Reply-To: References: <9A5764B7-9252-4560-9AD6-BEC0DAE0305E@cs.otago.ac.nz> Message-ID: Parsexml benchmarks look promising. Thanks Motiejus. Will try that and give my feedback. - Eranga On Mon, Oct 6, 2014 at 1:26 AM, Motiejus Jak?tys wrote: > On Sun, Oct 5, 2014 at 9:27 AM, Eranga Udesh wrote: > > > > Are there any fast XML parsers that work with binary, instead of string? > > There are quite a few, but I heard good comments about this one: > > https://github.com/maxlapshin/parsexml > > Regards, > Motiejus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eranga.erl@REDACTED Mon Oct 6 03:41:50 2014 From: eranga.erl@REDACTED (Eranga Udesh) Date: Mon, 6 Oct 2014 07:11:50 +0530 Subject: [erlang-questions] Erlang Memory Question In-Reply-To: References: <9A5764B7-9252-4560-9AD6-BEC0DAE0305E@cs.otago.ac.nz> Message-ID: I thought of hibernation, but then I loose the Timeout feature of the gen_server/gen_fsm. But of course I can do my own timers. I didn't go there yet. Will do the same and give my feedback if that improves the system or not. Tks, - Eranga On Mon, Oct 6, 2014 at 3:07 AM, Erik S?e S?rensen wrote: > Good advice. > For the short term, I think the option of hibernating the processes should > be mentioned as well - it ensures that dormant session processes don't take > up more memory than necessary. > > /Erik > Den 05/10/2014 23.18 skrev "Jesper Louis Andersen" < > jesper.louis.andersen@REDACTED>: > >> >> On Sun, Oct 5, 2014 at 9:27 AM, Eranga Udesh >> wrote: >> >>> I found temporary variables, eg. binary_to_list of a XML data say 100 KB >>> in size (Xmerl needs string), won't get freed for a long period of time >>> without force garbage collection. Therefore when there are about 500 user >>> sessions, each process consuming large memory blocks, makes the system >>> memory usage extremely high. We plan to support a large number of user >>> sessions, say 10000s and this memory consumption is a show stopper for us >>> at the moment. >> >> >> Hi! >> >> This is your problem in a nutshell. Calling binary_to_list/1 on a 100KB >> binary blows it up to at least 2.4 megabytes in size. When the process is >> done, it takes a bit of time for the heap to shrink down again. It will >> just get into a serious problem when your system is going to process XML >> documents for a large set of users at the same time. You have two general >> options, which should both be applied in a serious system: >> >> * xmerl is only useful for small configuration blocks of data. If you are >> processing larger amounts of data, you need an XML parser which operates >> directly on the binary representation. In addition, if you can find an XML >> parser which allows you to parse in SAX-style, so you don't have to form an >> intermediate structure will help a lot. In Haskell, particularly GHC, >> fusion optimizations would mostly take of these things, but it doesn't >> exist in the Erlang ecosystem, so you will have to approach it yourself. >> Unfortunately I don't have any suggestion handy, since it is too long since >> I've last worked with XML as a format. >> >> * Your Erlang node() needs to have a way to shed load once it reaches >> capacity. In other words, you design your system up to a certain amount of >> simultaneous users and then you make sure there is a limit to how much >> processing that can happen concurrently. This frames the erlang system so >> it does not break down under the stress if it gets loaded over capacity. >> Fred Hebert has written a book, "Erlang in Anger"[0] which touches on the >> subject in chapter 3 - "Planning for overload". You may have 20.000 users >> on the system, but if you make sure only 100 of those can process XML data >> at the same time, you can at most have 240 megabytes of outstanding memory >> space at the moment. Also, you may want to think about how much time it >> will take K cores to chew through 240 megabytes of data. Reading data is >> expensive. >> >> Irina Guberman (from Ubiquity networks if memory serves) recently had a >> very insightful (and funny!) talk[1] on how she employed the "jobs" >> framework in a situation which is slightly akin to yours. It is highly >> recommended, since she touches on the subject in far more depth than what I >> do here. For a production system I would recommend employing some kind of >> queueing framework early on. Otherwise, you system will just bow under the >> load once it gets deployed. >> >> [0] http://www.erlang-in-anger.com/ >> [1] >> https://www.youtube.com/watch?v=1Z_Z8aLIBQ8&list=UUQ7dFBzZGlBvtU2hCecsBBg >> >> -- >> J. >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From eranga.erl@REDACTED Mon Oct 6 03:52:10 2014 From: eranga.erl@REDACTED (Eranga Udesh) Date: Mon, 6 Oct 2014 07:22:10 +0530 Subject: [erlang-questions] Erlang Memory Question In-Reply-To: References: <9A5764B7-9252-4560-9AD6-BEC0DAE0305E@cs.otago.ac.nz> Message-ID: Thanks Jesper.. good stuff/advice. Let me digest your suggestions and articles and re-think of better architecture. Will revert back with results soon. Cheers, - Eranga On Mon, Oct 6, 2014 at 2:47 AM, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > > On Sun, Oct 5, 2014 at 9:27 AM, Eranga Udesh wrote: > >> I found temporary variables, eg. binary_to_list of a XML data say 100 KB >> in size (Xmerl needs string), won't get freed for a long period of time >> without force garbage collection. Therefore when there are about 500 user >> sessions, each process consuming large memory blocks, makes the system >> memory usage extremely high. We plan to support a large number of user >> sessions, say 10000s and this memory consumption is a show stopper for us >> at the moment. > > > Hi! > > This is your problem in a nutshell. Calling binary_to_list/1 on a 100KB > binary blows it up to at least 2.4 megabytes in size. When the process is > done, it takes a bit of time for the heap to shrink down again. It will > just get into a serious problem when your system is going to process XML > documents for a large set of users at the same time. You have two general > options, which should both be applied in a serious system: > > * xmerl is only useful for small configuration blocks of data. If you are > processing larger amounts of data, you need an XML parser which operates > directly on the binary representation. In addition, if you can find an XML > parser which allows you to parse in SAX-style, so you don't have to form an > intermediate structure will help a lot. In Haskell, particularly GHC, > fusion optimizations would mostly take of these things, but it doesn't > exist in the Erlang ecosystem, so you will have to approach it yourself. > Unfortunately I don't have any suggestion handy, since it is too long since > I've last worked with XML as a format. > > * Your Erlang node() needs to have a way to shed load once it reaches > capacity. In other words, you design your system up to a certain amount of > simultaneous users and then you make sure there is a limit to how much > processing that can happen concurrently. This frames the erlang system so > it does not break down under the stress if it gets loaded over capacity. > Fred Hebert has written a book, "Erlang in Anger"[0] which touches on the > subject in chapter 3 - "Planning for overload". You may have 20.000 users > on the system, but if you make sure only 100 of those can process XML data > at the same time, you can at most have 240 megabytes of outstanding memory > space at the moment. Also, you may want to think about how much time it > will take K cores to chew through 240 megabytes of data. Reading data is > expensive. > > Irina Guberman (from Ubiquity networks if memory serves) recently had a > very insightful (and funny!) talk[1] on how she employed the "jobs" > framework in a situation which is slightly akin to yours. It is highly > recommended, since she touches on the subject in far more depth than what I > do here. For a production system I would recommend employing some kind of > queueing framework early on. Otherwise, you system will just bow under the > load once it gets deployed. > > [0] http://www.erlang-in-anger.com/ > [1] > https://www.youtube.com/watch?v=1Z_Z8aLIBQ8&list=UUQ7dFBzZGlBvtU2hCecsBBg > > -- > J. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bosky101@REDACTED Mon Oct 6 07:28:19 2014 From: bosky101@REDACTED (Bhasker Kode) Date: Mon, 6 Oct 2014 10:58:19 +0530 Subject: [erlang-questions] The history of recursion in languages. Any stories from erlang? Message-ID: We erlangers, have much to thank tail recursion for many of the benefits and constructs that it gives us. 1. Tail recursion after all is the foundation of processes. Without which the call stack would keep growing. 2. Processes are the foundation of implementing state machines 3. And it was Lesie Lamport "Turing Award" winner and considered the father of distributed computing, who said that distributed systems should be represented as state machines since they're so many unknowns and things are changing all the time. Which is why I thought I'd give a talk about tail recursion at FuConf, a functional programming conference next week. => http://functionalconf.com/ , ping me for a big discount or if you're travelling to Bangalore for the first time ) But I was also fascinated investigating the history of recursion and tail recursion itself. Arguably the first programming language in which recursive procedures were included was J. McCarthy?s LISP. However, it was added only 2/3 months before the first implementation of LISP was complete. During the 60's, stories and conspiracies around Algol-60 run like a bond-movie, from the accounts of Djikstra and P Naur many years later. Its committee members calling it the "Amsterdam Plot". Resignations, Secretly adding sentences to language drafts. Cross-country phone calls. Much of the controversy I believe stemmed from including recursion vs not. - C compilers are known to tail call optimize.Talking about relatively more modern languages: - Python still doesn't have tail recursion although map, reduce, and lambda's were introduced in 1994, through the work of an anonymous but prolific early contributor. - Java compiler doesn't tail call optimize. - But Scala does. In fact you can define functions to be tail recursive, and it won't compile until it "is" tail-recursive. Which brings me to erlang. To the esteemed members of this list: When was recursion or tail recursion introduced in erlang? Was it a controversial decision? Was it an easy one? Any anecdotes you'd like to share, even about inspirations for recursion in erlang? Thanks ~Bosky | @bhaskerkode From peterke@REDACTED Mon Oct 6 10:46:27 2014 From: peterke@REDACTED (=?UTF-8?B?UMOpdGVyIFN6aWzDoWd5aQ==?=) Date: Mon, 6 Oct 2014 11:46:27 +0300 Subject: [erlang-questions] Erlang and Akka In-Reply-To: References: <2ec11b1134cd6c8104ee3996bd75d475@webmail.webfaction.com> <3270b8a25ba1dd2d2686afeb0800cae3@webmail.webfaction.com> <5A3AC1B4-18C5-482B-B172-4BB6F9A72809@cs.otago.ac.nz> <78B008BE-7BC3-4B0B-BC61-9A1D1F9A9EE1@cs.otago.ac.nz> <1409314571.19205.YahooMailNeo@web163602.mail.gq1.yahoo.com> <5404DFBE.6040907@power.com.pl> <9BFFFD5F-9A8F-48AF-9DD5-AF2FEE14710D@lovely.email.ne.jp> Message-ID: Hey all, Sorry for resurrecting a one month old thread. I've been following this conversation and wanted to throw in an interesting project, but there was still work going into it so I held my tongue. However, today it went official so I can take the lid off it. The Iris project just gained official support for Java and Scala, meaning that beside Erlang (and Go btw), you can do fully decentralized cloud messaging through the JVM too (and of course, they can freely and natively interact with each other) :D If you'd like to take a glimpse at Iris, head over to the teaser presentation (all code executable online): - Erlang: http://play.iris.karalabe.com/talks/binds/erlang.v1.slide - Java: http://play.iris.karalabe.com/talks/binds/java.v1.slide - Scala: http://play.iris.karalabe.com/talks/binds/scala.v1.slide So to answer a question raised in this thread. If you're trying to figure out whether to go with Akka/Scala or Erlang, maybe Iris will get you both worlds and you can switch between the languages to your hearth content :) Cheers, Peter PS: Java and especially Scala takes a toll on the playground VM during compilation (3+ sec), so patience. Erlang compiles in a blink :) On Tue, Sep 2, 2014 at 9:52 PM, Vlad Dumitrescu wrote: > > On Tue, Sep 2, 2014 at 5:41 PM, Norton Joseph Wayne < > norton@REDACTED> wrote: > >> As an example, the implementation of UBF on GitHub ( >> http://ubf.github.io/ubf/ubf-user-guide.en.html) supports several >> network formats including UBF(A), Erlang binary format (a.k.a. EBF), and a >> local procedure call (a.k.a. LPC). The network formats share the same >> contract checker implementation. >> > > I saw later your note about the project. Great stuff! It would need a bit > more of marketing, though :-) > > best regards, > Vlad > > > > On Tue, Sep 2, 2014 at 5:41 PM, Norton Joseph Wayne < > norton@REDACTED> wrote: > >> >> A few comments. >> >> On 2014/09/02, at 21:13, Vlad Dumitrescu wrote: >> >> On Mon, Sep 1, 2014 at 11:06 PM, Wojtek Narczy?ski >> wrote: >> >> - should the contract checker be hard-linked to UBF(A), the wire >> format? If used only internally, it seems reasonable to let it understand >> the Erlang binary format >> >> As an example, the implementation of UBF on GitHub ( >> http://ubf.github.io/ubf/ubf-user-guide.en.html) supports several >> network formats including UBF(A), Erlang binary format (a.k.a. EBF), and a >> local procedure call (a.k.a. LPC). The network formats share the same >> contract checker implementation. >> >> This contract checker implementation operates directly on Erlang terms. >> There is a lot of surrounding code but the core of the checker is a >> function that checks Erlang terms against a contract ( >> https://github.com/ubf/ubf/blob/master/src/contracts.erl#L108). >> >> >> - since 2002, Erlang got type descriptions and specifications; should >> these be used for describing the protocols? Again, it seems reasonable to >> be able to refer to existing types from the source code. >> >> >> Yes, agreed. >> >> >> - should it be possible to turn the contract checker on and off, >> preferably without performance impact when off? >> >> Yes, agreed. >> >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gfborn@REDACTED Mon Oct 6 12:45:48 2014 From: gfborn@REDACTED (Grigory Fateyev) Date: Mon, 6 Oct 2014 14:45:48 +0400 Subject: [erlang-questions] Riak stats Message-ID: <20141006144548.4d666e22@gmail.com> Hello! In our project we need to collect statistics from riak ring. For example such stats: - VNode dispatch operations timings/success/failure counts; - VNodes message queue lengths; - Total VNodes; - Gossip VNodes; As I see in code, riak has the module riak_core_stats.erl that collects stats in folsom, but how it constructs metrics name is not very useful bc we planning to use graphite as DB with naming hierarchy[1]. I can use those ways: 1. Get stats from folsom, convert names and push into carbon; 2. Find breakpoints to collect events in own app and push into carbon. The First way is not so flexible, we can't control metrics types. The second gives us more freedom but have a potential problems in future upgrade. What do you think about this and which way do you prefer? [1] https://graphite.readthedocs.org/en/latest/feeding-carbon.html#step-1-plan-a-naming-hierarchy -- Best regards! gfborn [at] gmail [dot] com From sean@REDACTED Mon Oct 6 18:00:01 2014 From: sean@REDACTED (Functional Jobs) Date: Mon, 6 Oct 2014 12:00:01 -0400 Subject: [erlang-questions] New Functional Programming Job Opportunities Message-ID: <5432bc8394ce0@functionaljobs.com> Here are some functional programming job opportunities that were posted recently: Erlang Backend Engineer at IDMOG http://functionaljobs.com/jobs/8749-erlang-backend-engineer-at-idmog Senior Software Engineer at McGraw-Hill Education http://functionaljobs.com/jobs/8744-senior-software-engineer-at-mcgraw-hill-education Cheers, Sean Murphy FunctionalJobs.com From tuncer.ayaz@REDACTED Mon Oct 6 18:04:29 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Mon, 6 Oct 2014 18:04:29 +0200 Subject: [erlang-questions] isatty/1 [erlang/otp#480] Message-ID: Hi Lukas and Andrew, as the original ticket[1] was closed and it was suggested to continue the discussion on the mailing list, let's try to conclude the discussion regarding the usefulness of isatty/1 here. Lukas wrote: > The only check that I can think of that you can do with isatty is > checking if the IODevice definitely does not support any escape > sequences. Getting true back does (afaik) not give you any details > about how you can communicate with it. >From what I understood, detecting that it's not an interactive terminal is sufficient for Andrew to decide that the output should automatically go to a file. This appears to be reasonable and useful regardless of escape codes. Thoughts? [1] https://github.com/erlang/otp/pull/480 From ok@REDACTED Mon Oct 6 23:40:27 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 7 Oct 2014 10:40:27 +1300 Subject: [erlang-questions] The history of recursion in languages. Any stories from erlang? In-Reply-To: References: Message-ID: On 6/10/2014, at 6:28 PM, Bhasker Kode wrote: > > Which brings me to erlang. To the esteemed members of this list: > > When was recursion or tail recursion introduced in erlang? > Was it a controversial decision? Was it an easy one? > Any anecdotes you'd like to share, even about inspirations for > recursion in erlang? Erlang has always supported recursion. I don't know about the first interpreter, but at least since the first compiler (to JAM), Erlang has exploited tail recursion. What could possibly be controversial about it? If you have a strict functional language you are pretty much crippled without recursion and tail recursion. From sean@REDACTED Mon Oct 6 23:43:03 2014 From: sean@REDACTED (Sean Cribbs) Date: Mon, 6 Oct 2014 16:43:03 -0500 Subject: [erlang-questions] Fwd: The history of recursion in languages. Any stories from erlang? In-Reply-To: References: Message-ID: Woops, forgot reply-all. ---------- Forwarded message ---------- From: Sean Cribbs Date: Mon, Oct 6, 2014 at 8:31 AM Subject: Re: [erlang-questions] The history of recursion in languages. Any stories from erlang? To: Bhasker Kode This video [1] explains it in better detail than I can, but it seems to be that an early version was a term-rewriting interpreter. Basically it would apply (reduce?) functions to their base terms and then consume the terms. This means that as long as the recursive call is the last thing in the function, tail-recursion is nearly free, it just gets rewritten. The stack depth only increases when a caller uses the return value directly, otherwise tail-recursive calls incur constant space. [1] http://www.erlang-factory.com/conference/SFBay2010/speakers/joearmstrong On Mon, Oct 6, 2014 at 12:28 AM, Bhasker Kode wrote: > We erlangers, have much to thank tail recursion for many of the > benefits and constructs that it gives us. > > 1. Tail recursion after all is the foundation of processes. Without > which the call stack would keep growing. > 2. Processes are the foundation of implementing state machines > 3. And it was Lesie Lamport "Turing Award" winner and considered the > father of distributed computing, who said that distributed systems > should be represented as state machines since they're so many unknowns > and things are changing all the time. > > Which is why I thought I'd give a talk about tail recursion at FuConf, > a functional programming conference next week. > => http://functionalconf.com/ , ping me for a big discount or if > you're travelling to Bangalore for the first time ) > > But I was also fascinated investigating the history of recursion and > tail recursion itself. > > Arguably the first programming language in which recursive procedures > were included was J. McCarthy?s LISP. However, it was added only 2/3 > months before the first implementation of LISP was complete. > > During the 60's, stories and conspiracies around Algol-60 run like a > bond-movie, from the accounts of Djikstra and P Naur many years later. > Its committee members calling it the "Amsterdam Plot". Resignations, > Secretly adding sentences to language drafts. Cross-country phone > calls. Much of the controversy I believe stemmed from including > recursion vs not. > > - C compilers are known to tail call optimize.Talking about relatively > more modern languages: > - Python still doesn't have tail recursion although map, reduce, and > lambda's were introduced in 1994, through the work of an anonymous but > prolific early contributor. > - Java compiler doesn't tail call optimize. > - But Scala does. In fact you can define functions to be tail > recursive, and it won't compile until it "is" tail-recursive. > > Which brings me to erlang. To the esteemed members of this list: > > When was recursion or tail recursion introduced in erlang? > Was it a controversial decision? Was it an easy one? > Any anecdotes you'd like to share, even about inspirations for > recursion in erlang? > > Thanks > > ~Bosky | @bhaskerkode > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Sean Cribbs Software Engineer Basho Technologies, Inc. http://basho.com/ -- Sean Cribbs Sr. Software Engineer Basho Technologies, Inc. http://basho.com/ From zxq9@REDACTED Tue Oct 7 03:36:39 2014 From: zxq9@REDACTED (zxq9) Date: Tue, 07 Oct 2014 10:36:39 +0900 Subject: [erlang-questions] The history of recursion in languages. Any stories from erlang? In-Reply-To: References: Message-ID: <3633833.rQrAycq8SW@burrito> On Tuesday 07 October 2014 10:40:27 Richard A. O'Keefe wrote: > On 6/10/2014, at 6:28 PM, Bhasker Kode wrote: > > Which brings me to erlang. To the esteemed members of this list: > > > > When was recursion or tail recursion introduced in erlang? > > Was it a controversial decision? Was it an easy one? > > Any anecdotes you'd like to share, even about inspirations for > > recursion in erlang? > > Erlang has always supported recursion. > I don't know about the first interpreter, > but at least since the first compiler (to JAM), > Erlang has exploited tail recursion. > > What could possibly be controversial about it? > If you have a strict functional language you are > pretty much crippled without recursion and tail > recursion. A discussion of "tail call optimization" VS looping VS adding stack frames, etc. in the context of asking "what is the history of recursion" is perhaps a bit misplaced. The first processing systems were programmed the way developmental systems are today: by writing out raw instructions. A tiny step above that is translating the basic instruction codes to easier to remember symbols and formalizing a syntax for their notation, which results in a basic assembly language. At this level there are no loop constructs, just jump instructions. A GOTO is a thin wrapper around an addressed jump instruction. No optimization other than not messing with the stack is necessary to make this as efficient a cyclic processing instruction as possible. A function call (in fact, the whole concept of function+arg definition) is a wrapper around indexed calling that adds a handy way to assign symbols to arguments up front. A function calling itself is a way to make a GOTO that returns to the head of the same segment easier to write. These are the basics of dealing with sequential processing machines and came before the loop construct was invented. The controversial innovation (if anything here can be considered "controversial") would be the loop construct. This is a new idea that does not exist at the basic level of sequential processing. It wraps the idea of a GOTO together with the idea of condition checking to break the processing cycle. Hence it is possible to write a function loop() or assembler macro that behaves like a language primitive loop{};, but not the other way around. This permitted the "C calling convention" to be known to always push to the stack, and this rule greatly simplifies the number of cases you have to analyze when writing a compiler (and since goto exists in C you can still write a compiler in C that implements TCO). C-style function calls are always going to grow the stack, so loop primitives are ways to guarantee that one can perform iterative processing without growing the stack *and* without forcing the compiler to be smart enough to recognize recursive tail calls. With this in mind, it may be more interesting to give a history of "loop words" rather than a history of recursion, as C-derived looping constructs are the new, controversial thing here, not recursion. >From this perspective it may be easier to understand why your question about the "inclusion of recursion as a feature" isn't generating a lot of buzz. To an FP language designer recursive calls are the default, normal way of thinking of things and loop primitives are a complication to the language. An attempt to introduce a loop/while/for primitive would be controversial, not the other way around. -Craig From egarrulo@REDACTED Tue Oct 7 00:43:57 2014 From: egarrulo@REDACTED (egarrulo) Date: Tue, 07 Oct 2014 00:43:57 +0200 Subject: [erlang-questions] Emacs Erlang Mode: a different face for module and function name in external function calls Message-ID: <54331B2D.1040309@gmail.com> Hello everybody, Erlang Mode highlights both the module and the function name of an external function call (for instance "lists:map") with the same face (`font-lock-type-face'). I would like Erlang Mode to use two different faces. Apparently, this behaviour is determined by this code in "erlang.el": (defvar erlang-font-lock-keywords-ext-function-calls (list (list (concat erlang-atom-regexp "\\s-*:\\s-*" erlang-atom-regexp "\\s-*(") '(1 'font-lock-type-face) '(2 'font-lock-type-face))) "Font lock keyword highlighting an external function call.") I have modified the second face to `font-lock-function-name-face', like this: '(2 'font-lock-function-name-face))) saved "erlang.el" and restarted Emacs, but the highlighting hasn't changed. I have tried with "emacs -Q", too. Any help? Thanks. Software: - GNU Emacs 24.3.1 - Erlang Mode 2.7 From ok@REDACTED Tue Oct 7 07:14:32 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 7 Oct 2014 18:14:32 +1300 Subject: [erlang-questions] The history of recursion in languages. Any stories from erlang? In-Reply-To: <3633833.rQrAycq8SW@burrito> References: <3633833.rQrAycq8SW@burrito> Message-ID: <8F3BB766-33F9-4777-BC04-310F5BD04CAD@cs.otago.ac.nz> It is someone 'revisionist' to suggest that looping constructs are the innovation. For example, look at http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/650/28-4028_FOR_TRANSIT.pdf the reference manual for the FOR TRANSIT programming language on the IBM 650, developed in 1958. The control statements of FOR TRANSIT included GOTO label ! simple goto GOTO (label,...), index ! switch IF (expr) neg,zro,pos ! 3-way conditional (on sign) DO label var = first,last[,step] ! loop FOR TRANSIT could call functions written in SOAP, but you could not write subroutines or functions in FOR TRANSIT itself. To my astonishment, the same is true of IBM 650 FORTRAN. http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/650/29-4047_FORTRAN.pdf So, 1958 "high level language": subroutines no, loops yes. It's worse than that. On my reading of http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/650/22-6060-2_650_OperMan.pdf the IBM 650 doesn't strictly speaking *have* a procedure calling instruction. Remember, this is a machine from 1953. (The link above points to the 1955 revision of the manual.) Instructions had the form On later models of the machine, which had 3 index registers, I imagine you could do one level of procedure calling thus: L1: load index register 3 with contents of M1 goto L3 L2: L3: here is the procedure goto 0+Index3 M1: data word holding L2 (the return address) On earlier models of the machine, which had no index registers, I imagine doing procedure calls thus: L1: load accumulator with contents of M1 store accumulator into next instruction address field of L3 goto L3+1 L2: L3: goto 0 here is the procedure goto L3 M1: data word holding L2 (the return address) (If you have ever read Knuth's "The Art of Computer Programming", the MIX machine is *extremely* like an IBM 650.) Both of these sketches could in concrete contexts be improved in small ways. But heck, the machine only had 2,000 words of memory, so it was not as if you could _have_ lots of subroutines or nest calls to them deeply. The key thing is that you will notice that recursion would have been seriously impractical on this machine. The IBM 650 was arguably the Model T Ford of computers. The first computer in this country (used by the Treasury for several years) was an IBM 650. Algol 60 introduced recursion to many programmers, but it *also* had loop keywords. This is where we get 'while' from, though it was tangled up with other things, and it's also where we get 'Boolean' from, and it's definitely where we get the word "stack" from. The idea of tail recursion optimisation was published in the 1970s. > The controversial innovation (if anything here can be considered > "controversial") would be the loop construct. This is a new idea that does not > exist at the basic level of sequential processing. This is a dubious claim. Loop constructs were commonplace in the late 1950s, and some computers designed in the 1960s had special hardware support for loops (as for example z/Series and POWER still do, not to mention that other weirdo, x86). From zxq9@REDACTED Tue Oct 7 09:12:08 2014 From: zxq9@REDACTED (zxq9) Date: Tue, 07 Oct 2014 16:12:08 +0900 Subject: [erlang-questions] The history of recursion in languages. Any stories from erlang? In-Reply-To: <8F3BB766-33F9-4777-BC04-310F5BD04CAD@cs.otago.ac.nz> References: <3633833.rQrAycq8SW@burrito> <8F3BB766-33F9-4777-BC04-310F5BD04CAD@cs.otago.ac.nz> Message-ID: <2092095.KGrna6J6oX@burrito> Bah... forgot to send to list... On Tuesday 07 October 2014 18:14:32 Richard A. O'Keefe wrote: > It is someone 'revisionist' to suggest that looping constructs > are the innovation. For example, look at > http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/650/28-4028_FOR_TRANSIT > .pdf the reference manual for the FOR TRANSIT programming language > on the IBM 650, developed in 1958. > The control statements of FOR TRANSIT included > GOTO label ! simple goto > GOTO (label,...), index ! switch > IF (expr) neg,zro,pos ! 3-way conditional (on sign) > DO label var = first,last[,step] ! loop This (and your other) examples illustrate the exact point I am trying to make. The original demonstrations of what a computable thing is were recursive as per Church's work in 1936 -- before the machines even existed (but "computer" meant an office girl armed with a calculation machine who knew how to execute prose or formal algorithms). McCarthy published his LISP specification in 1958 (the same year as FOR TRANSIT which contains that DO instruction). Plankalk?l had procedure definitions in 1945. To say that Algol 60 "introduced recursion to many programmers" I think is a bit of a stretch. Recursion was very well established, even at the root of, computing theory. It seems, though, that while recursion is simply the way things were noted from very early on, with machines that lacked languages entirely one was forced to plot jumps manually, which I can easily see would lead directly to development of a GOTO as an early language construct before loop or procedure definitions came along. From there the common pattern of "GOTO label_a ... IF NOT b GOTO label_a" would quickly emerge -- not from the theoretical folks, but from the technical folks who are trying to abstract their most common patterns in complex control words within their early languages. >From there it probably *did* take some time before folks who worked with machines worked out a formal, reliable method for optimizing recursive calls outside of the lisp machines of the early 1970's. So I suppose its really a question of whether one approaches the OP's theme from a theoretical or technical perspective. Recursion has been around for a long time in the formal languages that prompted the development of the electric computer, but both loop constructs and recursive procedure definitions took a rather long time to finally be implemented on machines, with TCO outside of Lisp machines being the last to the party. I have been spoiled, being fortunate enough to start messing with computers in the 1980's, long after most of this was sorted. -Craig From roger@REDACTED Tue Oct 7 15:38:14 2014 From: roger@REDACTED (Roger Lipscombe) Date: Tue, 7 Oct 2014 14:38:14 +0100 Subject: [erlang-questions] 17.3, ssl and raw options? Message-ID: In Erlang R16B03-1, I've been passing raw options to ssl:listen as follows, and it's been working fine: % The constants are defined elsewhere. LOpts = [{raw, ?IPPROTO_TCP, ?TCP_MAXSEG, <>} | ...], {ok, LSocket} = ssl:listen(0, LOpts) In Erlang 17.3, this fails with {option_not_a_key_value_tuple,{raw,6,2,<<64,2,0,0>>}} How do I pass a raw option to ssl:listen in Erlang 17.3? From roger@REDACTED Tue Oct 7 16:33:28 2014 From: roger@REDACTED (Roger Lipscombe) Date: Tue, 7 Oct 2014 15:33:28 +0100 Subject: [erlang-questions] 17.3, ssl and raw options? In-Reply-To: References: Message-ID: On 7 October 2014 14:38, Roger Lipscombe wrote: > In Erlang R16B03-1, I've been passing raw options to ssl:listen as > follows, and it's been working fine: > > % The constants are defined elsewhere. > LOpts = [{raw, ?IPPROTO_TCP, ?TCP_MAXSEG, <>} | ...], > {ok, LSocket} = ssl:listen(0, LOpts) > > In Erlang 17.3, this fails with > {option_not_a_key_value_tuple,{raw,6,2,<<64,2,0,0>>}} > > How do I pass a raw option to ssl:listen in Erlang 17.3? Oh, and ssl:setopts doesn't appear to be sufficient. TCP_MAXSEG must be set when the socket is initially opened, before listen is called. From johanclaesson@REDACTED Tue Oct 7 22:24:37 2014 From: johanclaesson@REDACTED (Johan Claesson) Date: Tue, 07 Oct 2014 22:24:37 +0200 Subject: [erlang-questions] Emacs Erlang Mode: a different face for module and function name in external function calls References: <54331B2D.1040309@gmail.com> Message-ID: <87tx3fd3wa.fsf@bredband.net> Hi, The function name is also fontified by erlang-font-lock-keywords-int-function-calls. That can be prevented by pre-pending "[^:]" to it as below. (defvar erlang-font-lock-keywords-int-function-calls (list (list (concat "[^:]" erlang-atom-regexp "\\s-*(") 1 'font-lock-type-face)) "Font lock keyword highlighting an internal function call.") But if you later update erlang.el to a newer version this will of course be lost. Alternatively you could instead of editing erlang.el inserting something like the following in your .emacs before (require 'erlang) or whatever that is loading erlang.el: (setq erlang-font-lock-keywords-ext-function-calls (list (list (concat erlang-atom-regexp "\\s-*:\\s-*" erlang-atom-regexp "\\s-*(") '(1 'font-lock-type-face) '(2 'font-lock-function-name-face)))) (setq erlang-font-lock-keywords-int-function-calls (list (list (concat "[^:]" erlang-atom-regexp "\\s-*(") 1 'font-lock-type-face))) If you want to do it after erlang.el is loaded for some reason then the following is also needed: (setq erlang-font-lock-keywords-4 erlang-font-lock-keywords-ext-function-calls) (setq erlang-font-lock-keywords-4 (append erlang-font-lock-keywords-3 erlang-font-lock-keywords-exported-function-header erlang-font-lock-keywords-int-function-calls erlang-font-lock-keywords-ext-function-calls erlang-font-lock-keywords-fun-n erlang-font-lock-keywords-lc)) Regards, /Johan egarrulo writes: > Hello everybody, > > Erlang Mode highlights both the module and the function name of an > external function call (for instance "lists:map") with the same face > (`font-lock-type-face'). I would like Erlang Mode to use two > different faces. > > Apparently, this behaviour is determined by this code in "erlang.el": > > (defvar erlang-font-lock-keywords-ext-function-calls > (list > (list (concat erlang-atom-regexp "\\s-*:\\s-*" > erlang-atom-regexp "\\s-*(") > '(1 'font-lock-type-face) > '(2 'font-lock-type-face))) > "Font lock keyword highlighting an external function call.") > > I have modified the second face to `font-lock-function-name-face', > like this: > > '(2 'font-lock-function-name-face))) > > saved "erlang.el" and restarted Emacs, but the highlighting hasn't changed. > > I have tried with "emacs -Q", too. > > Any help? Thanks. > > Software: > - GNU Emacs 24.3.1 > - Erlang Mode 2.7 > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From z@REDACTED Tue Oct 7 22:52:42 2014 From: z@REDACTED (Danil Zagoskin) Date: Wed, 8 Oct 2014 00:52:42 +0400 Subject: [erlang-questions] Supervisor child stuck in 'restarting' state Message-ID: Hello! We have an application (well, it's some patched old ejabberd fork) running on OTP R16B (no digits after "B"). On one of our clusters sometimes appears a strange problem with supervisor ? a child does not restart after crash (one_for_one strategy): Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:16:16] [async-threads:10] [hipe] [kernel-poll:false] (ejabberd@REDACTED)1> f(State), f(Children), State = hd([S || {data, Data} <- lists:nth(5, element(4, sys:get_status(ejabberd_listeners))), {"State", S} <- Data]), Children = element(4, State), lists:keyfind(5223, 3, Children). {child,{restarting,<0.17921.2571>}, 5223, {ejabberd_listener,start, [5223,ejabberd_c2s, [{access,c2s}, {max_stanza_size,262144}, {sasl_mechs,[]}, {non_sasl_meths,[]}, zlib,tls, ....]]}, permanent,brutal_kill,worker, [ejabberd_listener]} Inspecting supervisor code gave a way to actually restart the child ? supervisor:try_again_restart/2 works well when called from REPL. As supervisor:restart/2 code says, try_again_restart is scheduled using timer:apply_after after a failed start attempt (just where 'restarting' tag appears). So it seems like lost event in timer server. Git showed no changes in this part of supervisor code since R16B to current maint branch. There are no considerable changes in timer module either. Also it's quite strange to me that other clusters (with other mods loaded but with a similar config of this supervisor) do not suffer of this problem. How do I avoid such problem or how can I get more information on it? -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From andre.graf@REDACTED Wed Oct 8 00:22:27 2014 From: andre.graf@REDACTED (Andre Graf) Date: Wed, 08 Oct 2014 00:22:27 +0200 Subject: [erlang-questions] SSL inconsistencies in expected return values of 'ssl:connect/2' Message-ID: <543467A3.20009@erl.io> Hi there, today I wrote a EUnit test suite that should check the SSL connection setup to an Erlang SSL server. Although the test cases are pretty simple and standard I stumbled upon various inconsistencies when testing against different OTP versions (R15B02, R16B03-1,OTP-17.3.1). I thought I share my findings. The different test cases are: 1. Connect No Client Auth (SUCCESS) 2. Connect No Client Auth (FAIL: wrong CA) 3. Connect Client Auth (SUCCESS) 4. Connect Client Auth (FAIL: no Client Cert provided) 5. Connect Client Auth (FAIL: Client Cert expired) 6. Connect Client Auth (FAIL: CRL check, Client Cert revoked) 7. Connect Client Auth (SUCCESS, CRL check) Inconsistencies in expected return of 'ssl:connect/2' in test case 2: - R15B02: {error,"unknown ca"}} - R16B03-1: {error,{tls_alert,"unknown ca"}} - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} Inconsistencies in expected return of 'ssl:connect/2' in test case 3: - R15B02: {ok, Sock} - R16B03-1: {ok, Sock} - OTP-17.3.1: {error,closed} Inconsistencies in expected return of 'ssl:connect/2' in test case 4: - R15B02: {error,esslconnect} - R16B03-1: {error,{tls_alert,"handshake failure"}} - OTP-17.3.1: {error,{tls_alert,"handshake failure"}} Inconsistencies in expected return of 'ssl:connect/2' in test case 5: - R15B02: {error,"certificate expired"} - R16B03-1: {error,{tls_alert,"certificate expired"}} - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} Inconsistencies in expected return of 'ssl:connect/2' in test case 6: - R15B02: SSL handshake process crashes - R16B03-1: {error,{tls_alert,"certificate revoked"}} - OTP-17.3.1: {error,closed} Inconsistencies in expected return of 'ssl:connect/2' in test case 7: - R15B02: {ok, Socket} - R16B03-1: {ok, Socket} - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} No inconsistencies in test case 1. :) The code is available on https://github.com/dergraf/erlang_ssl_tester. Cheers, Andr? From yueyoum@REDACTED Wed Oct 8 09:35:40 2014 From: yueyoum@REDACTED (=?UTF-8?B?5pyI5b+n6IyX?=) Date: Wed, 8 Oct 2014 15:35:40 +0800 Subject: [erlang-questions] Erlang 17.3, undefined function toolbar:start/0 Message-ID: Hi, I compile and install erlang 17.3 from source, (OS: ubuntu) when I start erl shell, and type toolbar:start(). something goes wrong! wang[15:33][~]$ erlErlang/OTP 17 [erts-6.2] [source] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.2 (abort with ^G)1> io:format("OK~n").OK ok2> toolbar:start(). ** exception error: undefined function toolbar:start/03> tv:start(). ** exception error: undefined function tv:start/04> appmon:start(). ** exception error: undefined function appmon:start/05> Why this? ? -- My GitHub https://github.com/yueyoum -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Wed Oct 8 09:38:45 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Wed, 8 Oct 2014 10:38:45 +0300 Subject: [erlang-questions] Erlang 17.3, undefined function toolbar:start/0 In-Reply-To: References: Message-ID: Hello, wx toolkit application are not compiled thus all other GUI tools are not available. You have to ensure that OTP is configured to use proper wx libraries. - Dmitry On 08 Oct 2014, at 10:35, ??? wrote: > Hi, I compile and install erlang 17.3 from source, (OS: ubuntu) > > when I start erl shell, and type toolbar:start(). something goes wrong! > > wang[15:33][~]$ erl > Erlang/OTP 17 [erts-6.2] [source] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.2 (abort with ^G) > 1> io:format("OK~n"). > OK > ok > 2> toolbar:start(). > ** exception error: undefined function toolbar:start/0 > 3> tv:start(). > ** exception error: undefined function tv:start/0 > 4> appmon:start(). > ** exception error: undefined function appmon:start/0 > 5> > Why this? > > ? > -- > My GitHub > https://github.com/yueyoum > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From ngocdaothanh@REDACTED Wed Oct 8 09:40:03 2014 From: ngocdaothanh@REDACTED (Ngoc Dao) Date: Wed, 8 Oct 2014 16:40:03 +0900 Subject: [erlang-questions] Erlang 17.3, undefined function toolbar:start/0 In-Reply-To: References: Message-ID: I guess you need to install wxWidgets 3.x development library: apt-cache search libwx | grep dev On Wed, Oct 8, 2014 at 4:35 PM, ??? wrote: > Hi, I compile and install erlang 17.3 from source, (OS: ubuntu) > > when I start erl shell, and type toolbar:start(). something goes wrong! > > wang[15:33][~]$ erl > Erlang/OTP 17 [erts-6.2] [source] [smp:4:4] [async-threads:10] [hipe] > [kernel-poll:false] > > Eshell V6.2 (abort with ^G) > 1> io:format("OK~n"). > OK > ok > 2> toolbar:start(). > ** exception error: undefined function toolbar:start/0 > 3> tv:start(). > ** exception error: undefined function tv:start/0 > 4> appmon:start(). > ** exception error: undefined function appmon:start/0 > 5> > > Why this? > > -- > My GitHub > https://github.com/yueyoum > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From ngocdaothanh@REDACTED Wed Oct 8 09:40:56 2014 From: ngocdaothanh@REDACTED (Ngoc Dao) Date: Wed, 8 Oct 2014 16:40:56 +0900 Subject: [erlang-questions] Erlang 17.3, undefined function toolbar:start/0 In-Reply-To: References: Message-ID: > I guess you need to install wxWidgets 3.x development library: > apt-cache search libwx | grep dev Install it, then compile Erlang from source code again. On Wed, Oct 8, 2014 at 4:40 PM, Ngoc Dao wrote: > I guess you need to install wxWidgets 3.x development library: > apt-cache search libwx | grep dev > > On Wed, Oct 8, 2014 at 4:35 PM, ??? wrote: >> Hi, I compile and install erlang 17.3 from source, (OS: ubuntu) >> >> when I start erl shell, and type toolbar:start(). something goes wrong! >> >> wang[15:33][~]$ erl >> Erlang/OTP 17 [erts-6.2] [source] [smp:4:4] [async-threads:10] [hipe] >> [kernel-poll:false] >> >> Eshell V6.2 (abort with ^G) >> 1> io:format("OK~n"). >> OK >> ok >> 2> toolbar:start(). >> ** exception error: undefined function toolbar:start/0 >> 3> tv:start(). >> ** exception error: undefined function tv:start/0 >> 4> appmon:start(). >> ** exception error: undefined function appmon:start/0 >> 5> >> >> Why this? >> >> -- >> My GitHub >> https://github.com/yueyoum >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> From z@REDACTED Wed Oct 8 09:43:28 2014 From: z@REDACTED (Danil Zagoskin) Date: Wed, 8 Oct 2014 11:43:28 +0400 Subject: [erlang-questions] Erlang 17.3, undefined function toolbar:start/0 In-Reply-To: References: Message-ID: Hi! All these applications are dropped from OTP. Use observer instead ? it includes their functionality: > observer:start(). On Wed, Oct 8, 2014 at 11:35 AM, ??? wrote: > Hi, I compile and install erlang 17.3 from source, (OS: ubuntu) > > when I start erl shell, and type toolbar:start(). something goes wrong! > > wang[15:33][~]$ erlErlang/OTP 17 [erts-6.2] [source] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] > Eshell V6.2 (abort with ^G)1> io:format("OK~n").OK > ok2> toolbar:start(). > ** exception error: undefined function toolbar:start/03> tv:start(). > ** exception error: undefined function tv:start/04> appmon:start(). > ** exception error: undefined function appmon:start/05> > > Why this? > ? > -- > My GitHub > https://github.com/yueyoum > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Wed Oct 8 10:18:33 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Wed, 8 Oct 2014 10:18:33 +0200 Subject: [erlang-questions] 17.3, ssl and raw options? In-Reply-To: References: Message-ID: Hi! Some time ago we added a check that the options list should be a kev-value list, as there where some pretty strange errors when using next protocol negotiation due to the fact that the input was incorrectly formated. Unrecognized options are assumed to be inet options and passed on to inet. We do have some special clauses for making exceptions for inet and inet6, so we will have to add a raw clause too. Regards Ingela Erlang/OTP Team - Ericsson AB 2014-10-07 16:33 GMT+02:00 Roger Lipscombe : > On 7 October 2014 14:38, Roger Lipscombe wrote: > > In Erlang R16B03-1, I've been passing raw options to ssl:listen as > > follows, and it's been working fine: > > > > % The constants are defined elsewhere. > > LOpts = [{raw, ?IPPROTO_TCP, ?TCP_MAXSEG, <>} | ...], > > {ok, LSocket} = ssl:listen(0, LOpts) > > > > In Erlang 17.3, this fails with > > {option_not_a_key_value_tuple,{raw,6,2,<<64,2,0,0>>}} > > > > How do I pass a raw option to ssl:listen in Erlang 17.3? > > Oh, and ssl:setopts doesn't appear to be sufficient. TCP_MAXSEG must > be set when the socket is initially opened, before listen is called. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yueyoum@REDACTED Wed Oct 8 10:45:52 2014 From: yueyoum@REDACTED (=?UTF-8?B?5pyI5b+n6IyX?=) Date: Wed, 8 Oct 2014 16:45:52 +0800 Subject: [erlang-questions] Erlang 17.3, undefined function toolbar:start/0 In-Reply-To: References: Message-ID: Yes, thanks. observer:start() works well. and this is more good GUI than old toolbar:start() 2014-10-08 15:43 GMT+08:00 Danil Zagoskin : > Hi! > All these applications are dropped from OTP. Use observer instead ? it > includes their functionality: > > > observer:start(). > > On Wed, Oct 8, 2014 at 11:35 AM, ??? wrote: > >> Hi, I compile and install erlang 17.3 from source, (OS: ubuntu) >> >> when I start erl shell, and type toolbar:start(). something goes wrong! >> >> wang[15:33][~]$ erlErlang/OTP 17 [erts-6.2] [source] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] >> Eshell V6.2 (abort with ^G)1> io:format("OK~n").OK >> ok2> toolbar:start(). >> ** exception error: undefined function toolbar:start/03> tv:start(). >> ** exception error: undefined function tv:start/04> appmon:start(). >> ** exception error: undefined function appmon:start/05> >> >> Why this? >> ? >> -- >> My GitHub >> https://github.com/yueyoum >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > > -- > Danil Zagoskin | z@REDACTED > -- My GitHub https://github.com/yueyoum -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Wed Oct 8 10:47:28 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Wed, 8 Oct 2014 10:47:28 +0200 Subject: [erlang-questions] SSL inconsistencies in expected return values of 'ssl:connect/2' In-Reply-To: <543467A3.20009@erl.io> References: <543467A3.20009@erl.io> Message-ID: Hi! 2014-10-08 0:22 GMT+02:00 Andre Graf : > Hi there, > > today I wrote a EUnit test suite that should check the SSL connection > setup to an Erlang SSL server. Although the test cases are pretty simple > and standard I stumbled upon various inconsistencies when testing > against different OTP versions (R15B02, R16B03-1,OTP-17.3.1). I thought > I share my findings. > > The different test cases are: > > 1. Connect No Client Auth (SUCCESS) > 2. Connect No Client Auth (FAIL: wrong CA) > 3. Connect Client Auth (SUCCESS) > 4. Connect Client Auth (FAIL: no Client Cert provided) > 5. Connect Client Auth (FAIL: Client Cert expired) > 6. Connect Client Auth (FAIL: CRL check, Client Cert revoked) > 7. Connect Client Auth (SUCCESS, CRL check) > > Inconsistencies in expected return of 'ssl:connect/2' in test case 2: > - R15B02: {error,"unknown ca"}} > - R16B03-1: {error,{tls_alert,"unknown ca"}} > - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} > > This is part of the documented potential incompatibility that we choose to do to to improve the quality of the error messages. > Inconsistencies in expected return of 'ssl:connect/2' in test case 3: > - R15B02: {ok, Sock} > - R16B03-1: {ok, Sock} > - OTP-17.3.1: {error,closed} > > Will try your test case when I get time. Seems strange. > Inconsistencies in expected return of 'ssl:connect/2' in test case 4: > - R15B02: {error,esslconnect} > - R16B03-1: {error,{tls_alert,"handshake failure"}} > - OTP-17.3.1: {error,{tls_alert,"handshake failure"}} > > This is also part of the documented potential incompatibility that we choose to do to to improve the quality of the error messages. Inconsistencies in expected return of 'ssl:connect/2' in test case 5: > - R15B02: {error,"certificate expired"} > - R16B03-1: {error,{tls_alert,"certificate expired"}} > - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} > > Will try your test case when I get time. Seems strange. Inconsistencies in expected return of 'ssl:connect/2' in test case 6: > - R15B02: SSL handshake process crashes > - R16B03-1: {error,{tls_alert,"certificate revoked"}} > - OTP-17.3.1: {error,closed} > > Alas you can never depend on getting the correct error message an not {error,closed} as tcp does note have a delivery guarantee on application level, only on transport level. So ssl sends its alert and then closes the socket, and with bad timing the application may receive the socket close before it receives the error message data. Inconsistencies in expected return of 'ssl:connect/2' in test case 7: > - R15B02: {ok, Socket} > - R16B03-1: {ok, Socket} > - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} > > Will try your test case when I get time. Seems strange. Regards Ingela Erlang/OTP team - Ericsson AB No inconsistencies in test case 1. :) > > The code is available on https://github.com/dergraf/erlang_ssl_tester. > > Cheers, > Andr? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andre.graf@REDACTED Wed Oct 8 10:55:15 2014 From: andre.graf@REDACTED (Andre Graf) Date: Wed, 08 Oct 2014 10:55:15 +0200 Subject: [erlang-questions] SSL inconsistencies in expected return values of 'ssl:connect/2' In-Reply-To: References: <543467A3.20009@erl.io> Message-ID: <5434FBF3.5060009@erl.io> On 10/08/2014 10:47 AM, Ingela Andin wrote: > Hi! > > 2014-10-08 0:22 GMT+02:00 Andre Graf >: > > Hi there, > > today I wrote a EUnit test suite that should check the SSL connection > setup to an Erlang SSL server. Although the test cases are pretty > simple > and standard I stumbled upon various inconsistencies when testing > against different OTP versions (R15B02, R16B03-1,OTP-17.3.1). I > thought > I share my findings. > > The different test cases are: > > 1. Connect No Client Auth (SUCCESS) > 2. Connect No Client Auth (FAIL: wrong CA) > 3. Connect Client Auth (SUCCESS) > 4. Connect Client Auth (FAIL: no Client Cert provided) > 5. Connect Client Auth (FAIL: Client Cert expired) > 6. Connect Client Auth (FAIL: CRL check, Client Cert revoked) > 7. Connect Client Auth (SUCCESS, CRL check) > > Inconsistencies in expected return of 'ssl:connect/2' in test case 2: > - R15B02: {error,"unknown ca"}} > - R16B03-1: {error,{tls_alert,"unknown ca"}} > - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} > > > This is part of the documented potential incompatibility that we > choose to do to to improve the quality of the error messages. > > > > Inconsistencies in expected return of 'ssl:connect/2' in test case 3: > - R15B02: {ok, Sock} > - R16B03-1: {ok, Sock} > - OTP-17.3.1: {error,closed} > > > Will try your test case when I get time. Seems strange. > > > > Inconsistencies in expected return of 'ssl:connect/2' in test case 4: > - R15B02: {error,esslconnect} > - R16B03-1: {error,{tls_alert,"handshake failure"}} > - OTP-17.3.1: {error,{tls_alert,"handshake failure"}} > > > This is also part of the documented potential incompatibility that we > choose to do to to improve the quality of the error messages. > > > Inconsistencies in expected return of 'ssl:connect/2' in test case 5: > - R15B02: {error,"certificate expired"} > - R16B03-1: {error,{tls_alert,"certificate expired"}} > - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} > > Will try your test case when I get time. Seems strange. > > > Inconsistencies in expected return of 'ssl:connect/2' in test case 6: > - R15B02: SSL handshake process crashes > - R16B03-1: {error,{tls_alert,"certificate revoked"}} > - OTP-17.3.1: {error,closed} > > > Alas you can never depend on getting the correct error message an not > {error,closed} as > tcp does note have a delivery guarantee on application level, only on > transport level. > So ssl sends its alert and then closes the socket, and with bad timing > the application may > receive the socket close before it receives the error message data. > > Inconsistencies in expected return of 'ssl:connect/2' in test case 7: > - R15B02: {ok, Socket} > - R16B03-1: {ok, Socket} > - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} > > > Will try your test case when I get time. Seems strange. > > > Regards Ingela Erlang/OTP team - Ericsson AB > > > No inconsistencies in test case 1. :) > > The code is available on https://github.com/dergraf/erlang_ssl_tester. > > Cheers, > Andr? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > Hello Ingela, Thanks for your reply. Please let me know if you need any help with the test case. The tests should pass on R16B03-1, just run 'rebar eunit'. Cheers, Andr? -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.youngkin@REDACTED Wed Oct 8 16:33:37 2014 From: richard.youngkin@REDACTED (Youngkin, Rich) Date: Wed, 8 Oct 2014 08:33:37 -0600 Subject: [erlang-questions] Unable to create Mnesia table Message-ID: Hi all, I recently converted an existing application to a release using relx. After that the application isn't able to create any Mnesia tables. I can't reproduce the problem in the Erlang shell (except by creating the table before creating the schema). This is confusing because the app code creates the schema prior to creating the table. Here is the error: 12:20:18.929 [info] Creating a new schema from scratch... 12:20:18.929 [info] Mnesia started, creating tables... 12:20:18.929 [info] Attempting to create table with TableDef {pe_properties,{disc_copies,[{attributes,[key,value]},{record_name,pe_kvpair}]}} 12:20:18.931 [error] gen_server pe_membership terminated with reason: bad return value: {error,{unable_to_init_schema,{aborted,{bad_type,pe_properties,disc_copies,' prospero@REDACTED'}}}} Here's the associated application code: error_logger:info_msg("Creating a new schema from scratch...~n"), %% TODO: TEMP WORKAROUND TO DEBUG MNESIA SCHEMA CREATION PROBLEM application:set_env(mnesia, dir, "/var/data/prospero"), mnesia:create_schema([node()]), mnesia:start(), error_logger:info_msg("Mnesia started, creating tables...", []), case create_tables(pe_migrate:get_schema()) of The line application:set_env(...) was added in case the Mnesia directory wasn't getting created properly due to the move to a relx-built release. I had a similar entry in vm.args that I may have gotten wrong (-mnesia dir '"/var/data/prospero"'). Interestingly enough, I don't see any artifacts associated with the schema creation in the Mnesia dir (e.g., schema.DAT). I'm wondering if this is a clue as to what the cause is. pe_migrate:get_schema()) returns a list of TableDefs. create_tables iterates through that list creating the tables one at a time. The failure occurs when attempting to create the first table. Thanks, Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From valery.meleshkin@REDACTED Wed Oct 8 14:09:16 2014 From: valery.meleshkin@REDACTED (Valery Meleshkin) Date: Wed, 8 Oct 2014 16:09:16 +0400 Subject: [erlang-questions] Riak stats Message-ID: <5C17F877-08E3-4B62-AAC8-8B96CF56301D@gmail.com> Hi Grigory, In out project we?ve chosen the first option and pretty happy with it. More specifically our metrics tool enumerate thru a list of folsom metrics obtained from folsom_metrics:get_metrics_info(), convert names, values, produce subtrees for histograms and meters then push it to the carbon. The only issue with that approach is that for some metrics riak stores {function, M, F} instead of value, for this kind of metrics we?ve rolled a separate poller process. -- Sincerely, (Mr.) Valery Meleshkin From raffaele.intorcia@REDACTED Wed Oct 8 15:54:06 2014 From: raffaele.intorcia@REDACTED (Raffaele Intorcia) Date: Wed, 8 Oct 2014 15:54:06 +0200 Subject: [erlang-questions] String and single quote escaping Message-ID: <001101cfe2ff$53e30b00$fba92100$@intorcia@cgn.it> Hi all, i'm getting crazy with string and quote escaping. I have a string like this: single quote ' etc... Now, i have to create a string that will be passed as query to a sqlserver so i need to escape the single quote. To do this i'm using re:replace for example with these syntax : 2> re:replace("single quote ' etc...", "'", "\'", [{return, list}]). "single quote ' etc..." 2> re:replace("single quote ' etc...", "'", "\\'", [{return, list}]). "single quote ' etc..." 2> re:replace("single quote ' etc...", "'", "\\\'", [{return, list}]). "single quote ' etc..." 2> re:replace("single quote ' etc...", "'", "\\\'", [{return, list}]). "single quote \\' etc..." All of these results is not what i want. I'm looking for this: "message with single quote \' etc..." Anyone knows how i can achieve this? Thank you!! Bye Raf -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidnwelton@REDACTED Wed Oct 8 16:57:52 2014 From: davidnwelton@REDACTED (David Welton) Date: Wed, 8 Oct 2014 16:57:52 +0200 Subject: [erlang-questions] Architectural quandaries - application supervisor? Message-ID: On Wed, Sep 17, 2014 at 11:54 AM, David Welton wrote: > On Tue, Sep 16, 2014 at 12:42 PM, Daniel Abrahamsson > wrote: >> To me it seems like what you want is a circuit breaker (like Jesper's fuse >> [0], or breaky [1]) in front of the hardware module. Construct your Erlang >> code so that it does not crash on hardware errors, but instead melts the >> fuse. The supervisor is thus only involved when something strange happens in >> your code and where a restart will bring you back to known state. We use >> something similar (managed by [2], the name collision with [0] is purely >> coincidental) for graceful degradation if our HSMs go down. We also use [2] >> for managing database connections. In fact, you can use this strategy for >> dealing with any kind of external service without risking taking down your >> supervision tree. >> >> //Daniel >> >> [0] https://github.com/jlouis/fuse >> [1] https://github.com/mmzeeman/breaky >> [2] https://github.com/ulfl/fuse-lb > > Aha! > > Yes, that's probably what I want, or very close to it. It's a pity > the concept is not more widely documented, as it's very important for > dealing with external services that may be down at some point that > should not, however, pull Erlang down with them. If it were up to me, > I'd even put something like it in OTP, because it seems very likely > that any large enough project will encounter a need like it. While a circuit breaker might have been a good thing to use while writing the original code, we didn't, and so we have a complete application, with a reasonably nice supervision tree. I'm experimenting with some code that manages applications: you tell it to start an application, and it adds it to a list. Then it listens on events utilizing error_logger:add_report_handler(?SERVER), and dispatches as a consequence. This could be used to restart the dead application, or simply to notify the user that things have gone really badly and perhaps they should contact someone for help. The system, will, however, not crash and restart as it would if the application were permanent, so the user could still access some diagnostic tools and continue to use the system in a limited way. In our case, the application would cover a large portion of the system that interacts with the specialized hardware - without it, the machine can't do its job. A circuit breaker could probably be employed too, but I like the idea of handling "the hardware" as a unit. The supervision tree in that application already does a good job of trying to restart individual pieces (there are a number of them) in an appropriate way. Thoughts? -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From sean@REDACTED Wed Oct 8 17:02:49 2014 From: sean@REDACTED (Sean Cribbs) Date: Wed, 8 Oct 2014 10:02:49 -0500 Subject: [erlang-questions] String and single quote escaping In-Reply-To: <543550e7.622b980a.65ad.53c5SMTPIN_ADDED_BROKEN@mx.google.com> References: <543550e7.622b980a.65ad.53c5SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Your last one is nearly correct. Try this: 3> io:format("~s~n", [re:replace("single quote ' etc...", "'", "\\\\&", [{return, list}])]). single quote \' etc... Note that I used io:format so you don't get Erlang's term representation but the literal string output. On Wed, Oct 8, 2014 at 8:54 AM, Raffaele Intorcia wrote: > Hi all, i?m getting crazy with string and quote escaping. > > I have a string like this: > > > > single quote ' etc... > > > > Now, i have to create a string that will be passed as query to a sqlserver > so i need to escape the single quote. To do this i?m using re:replace for > example with these syntax : > > > > 2> re:replace("single quote ' etc...", "'", "\'", [{return, list}]). > > "single quote ' etc..." > > > > 2> re:replace("single quote ' etc...", "'", "\\'", [{return, list}]). > > "single quote ' etc..." > > > > 2> re:replace("single quote ' etc...", "'", "\\\'", [{return, list}]). > > "single quote ' etc..." > > > > 2> re:replace("single quote ' etc...", "'", "\\\'", [{return, list}]). > > "single quote \\' etc..." > > > > All of these results is not what i want. I?m looking for this: > > > > "message with single quote \' etc..." > > > > Anyone knows how i can achieve this? > > > > Thank you!! > > > > Bye > > Raf > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Sean Cribbs Sr. Software Engineer Basho Technologies, Inc. http://basho.com/ From davidnwelton@REDACTED Wed Oct 8 17:10:18 2014 From: davidnwelton@REDACTED (David Welton) Date: Wed, 8 Oct 2014 17:10:18 +0200 Subject: [erlang-questions] String and single quote escaping In-Reply-To: <543550f2.0340700a.3b51.7beeSMTPIN_ADDED_BROKEN@mx.google.com> References: <543550f2.0340700a.3b51.7beeSMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: > Now, i have to create a string that will be passed as query to a sqlserver > so i need to escape the single quote. To do this i?m using re:replace for > example with these syntax : I would be careful with that. One approach might be to use something like Postgres' prepared statements, so you do: pgsql:equery(C, "select * from foobar where foo = $1", [Foo]) That way it's the database itself that handles any tricky quoting issues. I think most databases have something like this. Ciao, -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From mononcqc@REDACTED Wed Oct 8 17:16:25 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 8 Oct 2014 11:16:25 -0400 Subject: [erlang-questions] String and single quote escaping In-Reply-To: <543550d4.ea3d320a.63c7.ffffb01dSMTPIN_ADDED_BROKEN@mx.google.com> References: <543550d4.ea3d320a.63c7.ffffb01dSMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: <20141008151623.GD3743@ferdair.local> On 10/08, Raffaele Intorcia wrote: > Now, i have to create a string that will be passed as query to a sqlserver > so i need to escape the single quote. To do this i'm using re:replace for > example with these syntax : DO NOT DO THIS! DO NOT DO THIS! DO NOT DO THIS! Please, don't escape SQL strings yourself! That is not safe in general. Years of PHP with mysql_escape_string() and mysql_real_escape_string() have only helped prove that point (they have been supplanted by prepared statements in mysqli and PDO). Nothing good can happen with this. Try to use concepts such as prepared statements or extended queries. For example, using Emysql: https://github.com/Eonblast/Emysql#Executing_Prepared_Statements Or using epgsql: https://github.com/epgsql/epgsql/blob/master/README#L137-L145 Manual escaping of SQL queries is a recipe both for disaster and incommensurable pain, both for yourself and your users who tend to trust you to store their data properly. If your library doesn't support that kind of stuff, please use another library. Regards, Fred. From rainer.hansen@REDACTED Wed Oct 8 16:43:39 2014 From: rainer.hansen@REDACTED (Rainer Hansen) Date: Wed, 08 Oct 2014 16:43:39 +0200 Subject: [erlang-questions] How to build web chat in Erlang? Message-ID: <87k34ay63o.fsf@gmx.net> I want to create a web chat solution in Erlang. First I want to build a prototype to demonstrate a web chat idea. Hence, the first solution does not need to be very sophisticated (only 1-to-1 chat) and will probably need to handle less than 300 simultaneous connections. For this demonstration purpose I have been scanning the web for possible open-source projects and tutorials to help me get started quickly. I have found a tutorial about creating a basic web chat application with Cowboy: https://github.com/hcs42/cowboy_tutorial_webchat and basically using a XMPP-JavaScript library (Strophe.im or Converse.js) together with ejabberd. I have not yet tested any of these approaches. I wonder if someone knows about alternative approaches, tutorials or open-source projects. Regards, Rainer From jon@REDACTED Wed Oct 8 17:37:11 2014 From: jon@REDACTED (Jon Schneider) Date: Wed, 8 Oct 2014 16:37:11 +0100 Subject: [erlang-questions] String and single quote escaping In-Reply-To: <20141008151623.GD3743@ferdair.local> References: <543550d4.ea3d320a.63c7.ffffb01dSMTPIN_ADDED_BROKEN@mx.google.com> <20141008151623.GD3743@ferdair.local> Message-ID: <3924ba243769db4bfcaab700428c2991.squirrel@mail.jschneider.net> Raffaele is correct. Don't ever try to escape things yourself. Just don't. Really. On a related note I've quite recently seen authentication code in C trying to pass strings through the shell using system() or popen() to another executable by escaping it and that similarly goes wrong because the writer wasn't aware of the detailed rules (of single quotes in this case). The code should have been fork()...exec() and not touched the shell. Not that shells ever do bad things. Jon > On 10/08, Raffaele Intorcia wrote: >> Now, i have to create a string that will be passed as query to a >> sqlserver >> so i need to escape the single quote. To do this i'm using re:replace >> for >> example with these syntax : > > DO NOT DO THIS! > DO NOT DO THIS! > DO NOT DO THIS! > > Please, don't escape SQL strings yourself! That is not safe in general. > Years of PHP with mysql_escape_string() and mysql_real_escape_string() > have only helped prove that point (they have been supplanted by prepared > statements in mysqli and PDO). Nothing good can happen with this. > > Try to use concepts such as prepared statements or extended queries. > > For example, using Emysql: > https://github.com/Eonblast/Emysql#Executing_Prepared_Statements > Or using epgsql: > https://github.com/epgsql/epgsql/blob/master/README#L137-L145 > > Manual escaping of SQL queries is a recipe both for disaster and > incommensurable pain, both for yourself and your users who tend to trust > you to store their data properly. > > If your library doesn't support that kind of stuff, please use another > library. > > Regards, > Fred. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > From eric.pailleau@REDACTED Wed Oct 8 17:43:57 2014 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Wed, 08 Oct 2014 17:43:57 +0200 Subject: [erlang-questions] String and single quote escaping In-Reply-To: <001101cfe2ff$53e30b00$fba92100$@intorcia@cgn.it> References: <001101cfe2ff$53e30b00$fba92100$@intorcia@cgn.it> Message-ID: <54355BBD.3070106@wanadoo.fr> Hi, You should not do escape by yourself. Fred is right on this. Use functions or prepared statements. I personnaly use dollar quoting with Postgresql, as I already wrote in a former mail. This way, you don't have to bother with escaping, a kind of XML CDATA for SQL... Simply use $$ around your string, or better, with a dynamic random value between first and second $ , to avoid any SQL injections. $A12345T$ your string with annoying quotes like this : ' $A12345T$ Regards From tty.erlang@REDACTED Wed Oct 8 17:54:52 2014 From: tty.erlang@REDACTED (T Ty) Date: Wed, 8 Oct 2014 16:54:52 +0100 Subject: [erlang-questions] relx tutorial, usage information? In-Reply-To: <1411770994.72935.172254937.66CC1B86@webmail.messagingengine.com> References: <1411770994.72935.172254937.66CC1B86@webmail.messagingengine.com> Message-ID: Here is one I started and only completed recently. https://erlangcentral.org/topic/erlang-mk-and-relx/ Cheers, On Fri, Sep 26, 2014 at 11:36 PM, Tristan Sloughter wrote: > Sorry, no, we are terrible about doing documentation :(. The only > documentation is the wiki and README: > > > https://github.com/erlware/relx/wiki/configuration > > https://github.com/erlware/relx/blob/master/README.md > > Any specific questions you can bring to #erlware on freenode. > > -- > Tristan Sloughter > t@REDACTED > > > > On Fri, Sep 26, 2014, at 05:31 PM, Youngkin, Rich wrote: > > Hi all, > > I'm using relx in an application and I'm able to build a working release, > including a tarball version of the release. I think I understand the basics > after reading the relx readme on github, Fred Hebert's "How I Start - > Erlang", Brian Troutwine's "Making trivial ... with relx", and Eric > Merritt's presentation at Erlang Factory 2013, but I don't have a good > understanding of the broader capabilities of relx. There are several areas > I'd like to get more information such as: > > 1. I'm using "relx release tar", but I can't find any documentation that > documents the "release" and "tar" command line options. > 2. relx providers > 3. Other capabilities that are useful? > > Are there any more advanced and/or detailed sources of information on > these kinds of topics? > > Thanks, > Rich > *_______________________________________________* > 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 eric.pailleau@REDACTED Wed Oct 8 18:06:45 2014 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Wed, 08 Oct 2014 18:06:45 +0200 Subject: [erlang-questions] String and single quote escaping In-Reply-To: <54355BBD.3070106@wanadoo.fr> References: <001101cfe2ff$53e30b00$fba92100$@intorcia@cgn.it> <54355BBD.3070106@wanadoo.fr> Message-ID: <54356115.5010603@wanadoo.fr> Note this : re:replace("single quote ' etc...", "'", [92], [{return,list}]). "single quote \\ etc..." when replacing ' by \ , one for one, two \ are in the result string... regards From gumm@REDACTED Wed Oct 8 18:19:05 2014 From: gumm@REDACTED (Jesse Gumm) Date: Wed, 8 Oct 2014 11:19:05 -0500 Subject: [erlang-questions] How to build web chat in Erlang? In-Reply-To: <87k34ay63o.fsf@gmx.net> References: <87k34ay63o.fsf@gmx.net> Message-ID: Hi Rainer, Nitrogen has a pretty simple chat example: http://nitrogenproject.com/demos/comet2 (see the "View Source" link to see the code that makes that page work). Changing that page to use multiple chat rooms is about 5-6 more lines of code. Alternatively, you could look into Chicago Boss (go through the tutorial, and the ways of building a chat system with it should become rather clear). Anyway, good luck! -- Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm On Oct 8, 2014 10:35 AM, "Rainer Hansen" wrote: > I want to create a web chat solution in Erlang. First I want to build a > prototype to demonstrate a web chat idea. Hence, the first solution does > not need to be very sophisticated (only 1-to-1 chat) and will probably > need to handle less than 300 simultaneous connections. > > For this demonstration purpose I have been scanning the web for possible > open-source projects and tutorials to help me get started quickly. I > have found a tutorial about creating a basic web chat application with > Cowboy: https://github.com/hcs42/cowboy_tutorial_webchat > > and basically using a XMPP-JavaScript library (Strophe.im or > Converse.js) together with ejabberd. I have not yet tested any of these > approaches. > > I wonder if someone knows about alternative approaches, tutorials or > open-source projects. > > Regards, > Rainer > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rainer.hansen@REDACTED Wed Oct 8 18:55:54 2014 From: rainer.hansen@REDACTED (Rainer Hansen) Date: Wed, 08 Oct 2014 18:55:54 +0200 Subject: [erlang-questions] How to build web chat in Erlang? References: <87k34ay63o.fsf@gmx.net> Message-ID: <87bnpmxzz9.fsf@gmx.net> Jesse Gumm writes: > Hi Rainer, > > Nitrogen has a pretty simple chat example: > http://nitrogenproject.com/demos/comet2 > > (see the "View Source" link to see the code that makes that page > work). Changing that page to use multiple chat rooms is about 5-6 more > lines of code. > > Alternatively, you could look into Chicago Boss (go through the > tutorial, and the ways of building a chat system with it should become > rather clear). > > Anyway, good luck! > > -- > Jesse Gumm > Owner, Sigma Star Systems > 414.940.4866 || sigma-star.com || @jessegumm Hi Jesse, thanks for the fast answer and the link to the chat demo. It works great in the desktop browser (Firefox) but on my smartphone browser (also Firefox) I seem to get trouble with timeouts. My smartphone is not constantly connected to the Internet and this seems to cause some trouble. I can still post and others on the same page see the post but nothing is updated in my mobile browser window. I can also not see the updates of others after the connection is once interrupted. Any ideas on how to improve the Nitrogen example to handle this situation? I will also take a look at the Chicago Boss tutorial ... Rainer From gumm@REDACTED Wed Oct 8 19:08:35 2014 From: gumm@REDACTED (Jesse Gumm) Date: Wed, 8 Oct 2014 12:08:35 -0500 Subject: [erlang-questions] How to build web chat in Erlang? In-Reply-To: <87bnpmxzz9.fsf@gmx.net> References: <87k34ay63o.fsf@gmx.net> <87bnpmxzz9.fsf@gmx.net> Message-ID: Thanks for the heads up. There are some auto-reconnection capabilities built into Nitrogen, but they are a little nasty and undocumented and this particular page does not use them. I'm working to improve this in the upcoming 2.3 release (Which should be ready in the next couple of weeks). I'll do some playing around tonight and shoot you an email off-list tonight or tomorrow. -Jesse On Wed, Oct 8, 2014 at 11:55 AM, Rainer Hansen wrote: > > Jesse Gumm writes: > >> Hi Rainer, >> >> Nitrogen has a pretty simple chat example: >> http://nitrogenproject.com/demos/comet2 >> >> (see the "View Source" link to see the code that makes that page >> work). Changing that page to use multiple chat rooms is about 5-6 more >> lines of code. >> >> Alternatively, you could look into Chicago Boss (go through the >> tutorial, and the ways of building a chat system with it should become >> rather clear). >> >> Anyway, good luck! >> >> -- >> Jesse Gumm >> Owner, Sigma Star Systems >> 414.940.4866 || sigma-star.com || @jessegumm > > > Hi Jesse, > > thanks for the fast answer and the link to the chat demo. It works great > in the desktop browser (Firefox) but on my smartphone browser (also > Firefox) I seem to get trouble with timeouts. My smartphone is not > constantly connected to the Internet and this seems to cause some > trouble. I can still post and others on the same page see the post but > nothing is updated in my mobile browser window. I can also not see the > updates of others after the connection is once interrupted. > > Any ideas on how to improve the Nitrogen example to handle this situation? > > I will also take a look at the Chicago Boss tutorial ... > > Rainer > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm From kolorahl@REDACTED Wed Oct 8 23:52:06 2014 From: kolorahl@REDACTED (Tyler Margison) Date: Wed, 8 Oct 2014 14:52:06 -0700 Subject: [erlang-questions] How to build web chat in Erlang? In-Reply-To: References: <87k34ay63o.fsf@gmx.net> <87bnpmxzz9.fsf@gmx.net> Message-ID: I'm speaking somewhat in ignorance here, as I haven't looked comet2 or the nitrogen project recently, but there's bullet for cowboy(1). The JavaScript component(2) comes with fallback methods and auto-reconnect, so it might be worth at least looking at what the JavaScript code is doing, as you might be able to use those concepts in your own project. No guarantees, but just putting it out there. 1. https://github.com/extend/bullet 2. https://github.com/extend/bullet/blob/master/priv/bullet.js On Wed, Oct 8, 2014 at 10:08 AM, Jesse Gumm wrote: > Thanks for the heads up. There are some auto-reconnection > capabilities built into Nitrogen, but they are a little nasty and > undocumented and this particular page does not use them. I'm working > to improve this in the upcoming 2.3 release (Which should be ready in > the next couple of weeks). > > I'll do some playing around tonight and shoot you an email off-list > tonight or tomorrow. > > -Jesse > > > > On Wed, Oct 8, 2014 at 11:55 AM, Rainer Hansen > wrote: > > > > Jesse Gumm writes: > > > >> Hi Rainer, > >> > >> Nitrogen has a pretty simple chat example: > >> http://nitrogenproject.com/demos/comet2 > >> > >> (see the "View Source" link to see the code that makes that page > >> work). Changing that page to use multiple chat rooms is about 5-6 more > >> lines of code. > >> > >> Alternatively, you could look into Chicago Boss (go through the > >> tutorial, and the ways of building a chat system with it should become > >> rather clear). > >> > >> Anyway, good luck! > >> > >> -- > >> Jesse Gumm > >> Owner, Sigma Star Systems > >> 414.940.4866 || sigma-star.com || @jessegumm > > > > > > Hi Jesse, > > > > thanks for the fast answer and the link to the chat demo. It works great > > in the desktop browser (Firefox) but on my smartphone browser (also > > Firefox) I seem to get trouble with timeouts. My smartphone is not > > constantly connected to the Internet and this seems to cause some > > trouble. I can still post and others on the same page see the post but > > nothing is updated in my mobile browser window. I can also not see the > > updates of others after the connection is once interrupted. > > > > Any ideas on how to improve the Nitrogen example to handle this > situation? > > > > I will also take a look at the Chicago Boss tutorial ... > > > > Rainer > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > Jesse Gumm > Owner, Sigma Star Systems > 414.940.4866 || sigma-star.com || @jessegumm > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raould@REDACTED Wed Oct 8 23:56:17 2014 From: raould@REDACTED (Raoul Duke) Date: Wed, 8 Oct 2014 14:56:17 -0700 Subject: [erlang-questions] How to build web chat in Erlang? In-Reply-To: References: <87k34ay63o.fsf@gmx.net> <87bnpmxzz9.fsf@gmx.net> Message-ID: i haven't been paying attention, has nobody mentioned n2o at all?! https://github.com/5HT/n2o From maxim@REDACTED Thu Oct 9 00:22:50 2014 From: maxim@REDACTED (Maxim Sokhatsky) Date: Thu, 9 Oct 2014 01:22:50 +0300 Subject: [erlang-questions] How to build web chat in Erlang? In-Reply-To: References: <87k34ay63o.fsf@gmx.net> <87bnpmxzz9.fsf@gmx.net> Message-ID: Thanks, Raoul! It is better to go directly with N2O sample: ? ? ? ?https://synrc.com/apps/n2o/doc/web/setup.htm Also it includes desired Chat application. -- Maxim Sokhatsky From jlladono@REDACTED Thu Oct 9 00:00:00 2014 From: jlladono@REDACTED (Josep Lladonosa) Date: Thu, 9 Oct 2014 00:00:00 +0200 Subject: [erlang-questions] erlang-wx possible bug in 1:17.1-dfsg-7 Message-ID: Hello, I am an erlang student and we do a work based in a module which just creates a window with a frame and buttons inside by using wx. Well, this message is just to explain that module works with wheezy Debian packages Version: 1:15.b.1-dfsg-4+deb7u1 - Erlang R15B01 (erts-5.9.1) but does not work with jessie Version: 1:17.1-dfsg-7 - Erlang/OTP 17 (erts-5.9.1). What happens in jessie is that one only can see a very very small square in the top left corner of the window, as if some code about sizing was not initialized. -- -- Salutacions...Josep -- From sam@REDACTED Thu Oct 9 01:16:51 2014 From: sam@REDACTED (Sam Tavakoli) Date: Thu, 09 Oct 2014 00:16:51 +0100 Subject: [erlang-questions] fail_on_warnings, has it ever worked? Message-ID: <5435C5E3.9030002@tavakoli.se> Hi Today I saw a project where the erl_opts in rebar.config had fail_on_warning instead of warnings_as_errors. Since I've never seen fail_on_warning before I googled it and among other results I found http://stackoverflow.com/questions/9343630/command-generate-not-understood-or-not-applicable. Where someone comments that fail_on_warning is deprecated in R16. I checked the R15B03-1 code and couldn't find anything related to fail_on_warning. I also tried it out in the shell but it didn't fail a compilation with warnings. The second interesting link I found is http://erlang.org/pipermail/erlang-questions/2011-March/057130.html where fail_on_warning is shown again in a different example and R14B is mentioned. I tried it out on R14B but it doesn't work either. So my question is, has fail_on_warning ever worked? If so, which release introduced it and when was it removed? Thanks, Sam From vinoski@REDACTED Thu Oct 9 05:52:00 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Wed, 8 Oct 2014 23:52:00 -0400 Subject: [erlang-questions] fail_on_warnings, has it ever worked? In-Reply-To: <5435C5E3.9030002@tavakoli.se> References: <5435C5E3.9030002@tavakoli.se> Message-ID: On Wed, Oct 8, 2014 at 7:16 PM, Sam Tavakoli wrote: > Hi > > Today I saw a project where the erl_opts in rebar.config had > fail_on_warning instead of warnings_as_errors. Since I've never seen > fail_on_warning before I googled it and among other results I found > > http://stackoverflow.com/questions/9343630/command-generate-not-understood-or-not-applicable > . > Where someone comments that fail_on_warning is deprecated in R16. I > checked the R15B03-1 code and couldn't find anything related to > fail_on_warning. I also tried it out in the shell but it didn't fail a > compilation with warnings. > > The second interesting link I found is > http://erlang.org/pipermail/erlang-questions/2011-March/057130.html > where fail_on_warning is shown again in a different example and R14B is > mentioned. I tried it out on R14B but it doesn't work either. > > So my question is, has fail_on_warning ever worked? If so, which release > introduced it and when was it removed? Assuming I'm reading the rebar code correctly, fail_on_warning was rebar-specific, not something passed into the Erlang compiler. Rebar would compile the file and if any warnings resulted and fail_on_warning was enabled, it would fail the build. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From dangud@REDACTED Thu Oct 9 09:11:33 2014 From: dangud@REDACTED (Dan Gudmundsson) Date: Thu, 9 Oct 2014 09:11:33 +0200 Subject: [erlang-questions] erlang-wx possible bug in 1:17.1-dfsg-7 In-Reply-To: References: Message-ID: Jessie is using wxWidgets-3.0 (?) so you might have to change your code a bit to get it work with that backend. I.e. I had to tweak some things in observer to get it work with both wxWidgets-2.8 and wxWidgets-3.0 backends. /Dan On Thu, Oct 9, 2014 at 12:00 AM, Josep Lladonosa wrote: > jessie -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Thu Oct 9 11:23:18 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Thu, 9 Oct 2014 11:23:18 +0200 Subject: [erlang-questions] fail_on_warnings, has it ever worked? In-Reply-To: <5435C5E3.9030002@tavakoli.se> References: <5435C5E3.9030002@tavakoli.se> Message-ID: On Thu, Oct 9, 2014 at 1:16 AM, Sam Tavakoli wrote: > Hi > > Today I saw a project where the erl_opts in rebar.config had > fail_on_warning instead of warnings_as_errors. Since I've never seen > fail_on_warning before I googled it and among other results I found > http://stackoverflow.com/questions/9343630. Where someone comments > that fail_on_warning is deprecated in R16. I checked the R15B03-1 > code and couldn't find anything related to fail_on_warning. I also > tried it out in the shell but it didn't fail a compilation with > warnings. > > The second interesting link I found is > http://erlang.org/pipermail/erlang-questions/2011-March/057130.html > where fail_on_warning is shown again in a different example and R14B > is mentioned. I tried it out on R14B but it doesn't work either. > > So my question is, has fail_on_warning ever worked? As Steve said, fail_on_warning was a rebar specific option which was replaced with the standard warnings_as_errors. That means, if you use an old enough rebar version, it'll work as expected for Erlang sources. > If so, which release introduced it and when was it removed? fail_on_warning was added in 2009 and replaced with warnings_as_errors in 2011. Christopher Faulet added the -Werror (warnings_as_errors) option to erlc for .erl (compile:file/2) in R13B04 (2009). While replacing rebar's fail_on_warning with warnings_as_errors, I've refined compile:file/2's warnings_as_errors implementation to work the same as gcc/clang and also implemented the option in asn1ct, snmpc, yecc, leex, and systools. This was included in R14B04 (2011). So, while you could use an old rebar version for fail_on_warning, I'd suggest to use warnings_as_errors, as it works more like what you're used to from $CC and is supported for more than .erl files. Two OTP compilers still don't support -Werror: * Diameter was new and I was advised against adding support. Also, diameter isn't wired into stdlib/src/erl_compile.erl anyway. * I never got around to adding support to ic:compile (.idl files), and I suppose it's used seldom enough that nobody missed it yet. There are also three non-OTP compilers which could/should support warnings_as_errors, as rebar bundles compiler plugins for them: (status unknown) https://github.com/seancribbs/neotoma/issues/14 (status unknown) https://github.com/nygge/abnfc/issues/3 (maybe supported?) https://github.com/basho/erlang_protobuffs/issues/16 From bosky101@REDACTED Thu Oct 9 15:59:56 2014 From: bosky101@REDACTED (Bhasker Kode) Date: Thu, 9 Oct 2014 19:29:56 +0530 Subject: [erlang-questions] The history of recursion in languages. Any stories from erlang? In-Reply-To: <2092095.KGrna6J6oX@burrito> References: <3633833.rQrAycq8SW@burrito> <8F3BB766-33F9-4777-BC04-310F5BD04CAD@cs.otago.ac.nz> <2092095.KGrna6J6oX@burrito> Message-ID: another erlang specific question. foo()-> foo(). bar()-> receive X -> bar() end. both the above functions are tail-call optimized and happen to be recursive. if i run foo(), would its callstack remain unchanged? will beam bring it down? how does it compare with the procedural while (1) { //do something } ~B On Tue, Oct 7, 2014 at 12:42 PM, zxq9 wrote: > Bah... forgot to send to list... > > On Tuesday 07 October 2014 18:14:32 Richard A. O'Keefe wrote: >> It is someone 'revisionist' to suggest that looping constructs >> are the innovation. For example, look at >> http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/650/28-4028_FOR_TRANSIT >> .pdf the reference manual for the FOR TRANSIT programming language >> on the IBM 650, developed in 1958. >> The control statements of FOR TRANSIT included >> GOTO label ! simple goto >> GOTO (label,...), index ! switch >> IF (expr) neg,zro,pos ! 3-way conditional (on sign) >> DO label var = first,last[,step] ! loop > > This (and your other) examples illustrate the exact point I am trying to make. > The original demonstrations of what a computable thing is were recursive as > per Church's work in 1936 -- before the machines even existed (but "computer" > meant an office girl armed with a calculation machine who knew how to execute > prose or formal algorithms). McCarthy published his LISP specification in 1958 > (the same year as FOR TRANSIT which contains that DO instruction). Plankalk?l > had procedure definitions in 1945. > > To say that Algol 60 "introduced recursion to many programmers" I think is a > bit of a stretch. Recursion was very well established, even at the root of, > computing theory. > > It seems, though, that while recursion is simply the way things were noted > from very early on, with machines that lacked languages entirely one was > forced to plot jumps manually, which I can easily see would lead directly to > development of a GOTO as an early language construct before loop or procedure > definitions came along. From there the common pattern of "GOTO label_a ... IF > NOT b GOTO label_a" would quickly emerge -- not from the theoretical folks, > but from the technical folks who are trying to abstract their most common > patterns in complex control words within their early languages. > > From there it probably *did* take some time before folks who worked with > machines worked out a formal, reliable method for optimizing recursive calls > outside of the lisp machines of the early 1970's. > > So I suppose its really a question of whether one approaches the OP's theme > from a theoretical or technical perspective. Recursion has been around for a > long time in the formal languages that prompted the development of the > electric computer, but both loop constructs and recursive procedure definitions > took a rather long time to finally be implemented on machines, with TCO outside > of Lisp machines being the last to the party. > > I have been spoiled, being fortunate enough to start messing with computers in > the 1980's, long after most of this was sorted. > > -Craig > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From francesco@REDACTED Thu Oct 9 12:50:42 2014 From: francesco@REDACTED (Francesco Cesarini) Date: Thu, 09 Oct 2014 11:50:42 +0100 Subject: [erlang-questions] Looking for Erlang SPeakers in the finance sector Message-ID: <54366882.1050104@erlang-solutions.com> Hi, For the second year in a row, a conference on functional programming in finance is being held in London. Date is October 31st, website iswww.funcfi.com. They are looking for a talk on Erlang in highly transactional, high volume systems which might include exchanges or payment switches. Interest is also around big data and analytics. Drop me a line if you are interested and I will put you in touch with the organizers. Cheers, Francesco -- Founder & Technical Director Erlang Solutions Ltd. From maxim@REDACTED Thu Oct 9 19:21:30 2014 From: maxim@REDACTED (Maxim Sokhatsky) Date: Thu, 9 Oct 2014 20:21:30 +0300 Subject: [erlang-questions] Looking for Erlang SPeakers in the finance sector In-Reply-To: <54366882.1050104@erlang-solutions.com> References: <54366882.1050104@erlang-solutions.com> Message-ID: Hi, Francesco! We are using Erlang in Finance: UPL, BPE, FORMS,? Banking Schemas on top of KVS, N2O, and our stack. Please take a look onto: ? ? ? ? http://spawnproc.com -- Maxim Sokhatsky From sam@REDACTED Thu Oct 9 21:28:20 2014 From: sam@REDACTED (Sam Tavakoli) Date: Thu, 09 Oct 2014 20:28:20 +0100 Subject: [erlang-questions] fail_on_warnings, has it ever worked? In-Reply-To: References: <5435C5E3.9030002@tavakoli.se> Message-ID: <5436E1D4.4060205@tavakoli.se> On 2014-10-09 10:23, Tuncer Ayaz wrote: > On Thu, Oct 9, 2014 at 1:16 AM, Sam Tavakoli wrote: >> Hi >> >> Today I saw a project where the erl_opts in rebar.config had >> fail_on_warning instead of warnings_as_errors. Since I've never seen >> fail_on_warning before I googled it and among other results I found >> http://stackoverflow.com/questions/9343630. Where someone comments >> that fail_on_warning is deprecated in R16. I checked the R15B03-1 >> code and couldn't find anything related to fail_on_warning. I also >> tried it out in the shell but it didn't fail a compilation with >> warnings. >> >> The second interesting link I found is >> http://erlang.org/pipermail/erlang-questions/2011-March/057130.html >> where fail_on_warning is shown again in a different example and R14B >> is mentioned. I tried it out on R14B but it doesn't work either. >> >> So my question is, has fail_on_warning ever worked? > As Steve said, fail_on_warning was a rebar specific option which was > replaced with the standard warnings_as_errors. That means, if you use > an old enough rebar version, it'll work as expected for Erlang > sources. > >> If so, which release introduced it and when was it removed? > fail_on_warning was added in 2009 and replaced with > warnings_as_errors in 2011. > > Christopher Faulet added the -Werror (warnings_as_errors) option to > erlc for .erl (compile:file/2) in R13B04 (2009). > > While replacing rebar's fail_on_warning with warnings_as_errors, I've > refined compile:file/2's warnings_as_errors implementation to work the > same as gcc/clang and also implemented the option in asn1ct, snmpc, > yecc, leex, and systools. This was included in R14B04 (2011). > > So, while you could use an old rebar version for fail_on_warning, I'd > suggest to use warnings_as_errors, as it works more like what you're > used to from $CC and is supported for more than .erl files. > > Two OTP compilers still don't support -Werror: > > * Diameter was new and I was advised against adding support. Also, > diameter isn't wired into stdlib/src/erl_compile.erl anyway. > > * I never got around to adding support to ic:compile (.idl files), and > I suppose it's used seldom enough that nobody missed it yet. > > > There are also three non-OTP compilers which could/should support > warnings_as_errors, as rebar bundles compiler plugins for them: > > (status unknown) > https://github.com/seancribbs/neotoma/issues/14 > > (status unknown) > https://github.com/nygge/abnfc/issues/3 > > (maybe supported?) > https://github.com/basho/erlang_protobuffs/issues/16 Thanks for the answers and update on what more warnings_as_errors do. I didn't dig enough in the commit history of rebar to find the fail_on_warning, I ruled it out to quick :) It will definitely be changed be changed since the rebar version used isn't old enough to have the deprecated flag. This is the mentioned commit which removes it: https://github.com/rebar/rebar/commit/3a8b4d5e8fdd1155e15844e8a46dc2e6ccff9e38 if there is others who might want to take a peak. /Sam From icfp.publicity@REDACTED Fri Oct 10 00:30:17 2014 From: icfp.publicity@REDACTED (David Van Horn) Date: Thu, 9 Oct 2014 18:30:17 -0400 Subject: [erlang-questions] ICFP 2015 Call for Workshop and Co-located Event Proposals Message-ID: CALL FOR WORKSHOP AND CO-LOCATED EVENT PROPOSALS ICFP 2015 20th ACM SIGPLAN International Conference on Functional Programming August 30 - September 5, 2015 Vancouver, Canada http://icfpconference.org/icfp2015/ The 120th ACM SIGPLAN International Conference on Functional Programming will be held in Vancouver, British Columbia, Canada on August 30-September 5, 2015. ICFP provides a forum for researchers and developers to hear about the latest work on the design, implementations, principles, and uses of functional programming. Proposals are invited for workshops (and other co-located events, such as tutorials) to be affiliated with ICFP 2015 and sponsored by SIGPLAN. These events should be less formal and more focused than ICFP itself, include sessions that enable interaction among the attendees, and foster the exchange of new ideas. The preference is for one-day events, but other schedules can also be considered. The workshops are scheduled to occur on August 30 (the day before ICFP) and September 3-5 (the three days after ICFP). ---------------------------------------------------------------------- Submission details Deadline for submission: November 16, 2014 Notification of acceptance: December 15, 2014 Prospective organizers of workshops or other co-located events are invited to submit a completed workshop proposal form in plain text format to the ICFP 2015 workshop co-chairs (Tom Schrijvers and Nicolas Wu), via email to icfp2015-workshops@REDACTED by November 16, 2014. (For proposals of co-located events other than workshops, please fill in the workshop proposal form and just leave blank any sections that do not apply.) Please note that this is a firm deadline. Organizers will be notified if their event proposal is accepted by December 15, 2014, and if successful, depending on the event, they will be asked to produce a final report after the event has taken place that is suitable for publication in SIGPLAN Notices. The proposal form is available at: http://www.icfpconference.org/icfp2015/icfp15-workshops-form.txt Further information about SIGPLAN sponsorship is available at: http://www.sigplan.org/Resources/Guidelines/Workshops ---------------------------------------------------------------------- Selection committee The proposals will be evaluated by a committee comprising the following members of the ICFP 2015 organizing committee, together with the members of the SIGPLAN executive committee. Workshop Co-Chair: Tom Schrijvers (KU Leuven) Workshop Co-Chair: Nicolas Wu (University of Oxford) General Chair: Kathleen Fisher (Tufts University) Program Chair: John Reppy (University of Chicago) ---------------------------------------------------------------------- Further information Any queries should be addressed to the workshop co-chairs (Tom Schrijvers and Nicolas Wu), via email to icfp2015-workshops@REDACTED From zxq9@REDACTED Fri Oct 10 03:13:09 2014 From: zxq9@REDACTED (zxq9) Date: Fri, 10 Oct 2014 10:13:09 +0900 Subject: [erlang-questions] The history of recursion in languages. Any stories from erlang? In-Reply-To: References: <2092095.KGrna6J6oX@burrito> Message-ID: <7851791.PlVK11MAQs@burrito> On Thursday 09 October 2014 19:29:56 you wrote: > another erlang specific question. > > foo()-> > foo(). > > bar()-> > receive > X -> > bar() > end. > > both the above functions are tail-call optimized and happen to be recursive. > > if i run foo(), would its callstack remain unchanged? will beam bring it > down? how does it compare with the procedural while (1) { //do something } foo() -> foo(). behaves the same as while(1) {};. Testing just now, the stack indeed remains constant (at ~2.5k), and checking with Observer on the system I'm sitting at now shows around 4 billion reds per update. Beam will not bring down a simple infinite loop like this unless you tell it to (its performing as intended, why kill it if the user wanted it?). Its sort of interesting, with regard to scheduling not recursion, to spawn a few more of these than you have cores, and then run something else and watch the EVM schedule around all the blank load. With regard to the original line of this thread... Richard O'Keefe, in a line of private emails, has convinced me that while recursion is at the root of computing theory, the concept was almost completely unknown in commercial languages until sometime in the (probably very late) 60's, and still not very well accepted outside AI research until a bit later. He demonstrated to me that the world of computing theory and AI research, being full of recursive definitions from the beginning (Lovelace -- with a unique notation for "cycles of cycles", Church, G?del, etc.), had shockingly little impact on the tradition of language design that brought us to where we are today. In particular, it played no role in informing commercial hardware development and that led to an almost deliberate aversion to the subject by language designers working for those companies. Richard O'Keefe wrote: > APL (designed through 1960-1965) > could do recursion, but it was interpreted, and was and > remained, like Lisp, a niche language irrelevant to > nearly all programmers. PL/I supported recursion, which > like much else it copied from Algol 60, but it was > regarded as strange, scary, and rare, and you had to > explicitly write, e.g., > > factorial: > procedure (n) options (recursive); > > if n < 2 then return 1; > else return n * factorial (n-1); > > end; > > Programming textbooks warned people not to use this feature > because it was too inefficient This makes me feel that we are still only rediscovering ideal ways to communicate with our computers and haven't yet come up with anything really new (some of the ideal notational concepts go as far back as Ada Lovelace's notes!). I'd always thought that developments in theory/research were influential in industry, but this was clearly not the case. I'd like to thank Richard for taking the time to so thoroughly prove my assumptions wrong. It was really interesting! -Craig From achowdhury918@REDACTED Fri Oct 10 04:28:50 2014 From: achowdhury918@REDACTED (Akash Chowdhury) Date: Thu, 9 Oct 2014 22:28:50 -0400 Subject: [erlang-questions] Issue with failover/takeover Message-ID: I am using failover/takeover feature of distributed erlang. I have primary and secondary node in a group. Most of the times, my app is running on the primary node and secondary node is in-active. But sometimes, I am seeing that my app is running on both nodes simultaneously which is not expected behavior. I know this can happen when there is a netsplit (network disconnection) between two nodes. But that didn't happen in my case. From system stats, it was confirmed that network connection was intact. What can be other causes for this? I see the following error message in primary node log when this issue happened : *=ERROR REPORT==== ...*>>>* ** Node not responding ***>>>* ** Removing (timedout) connection ***>>> Any information/help regarding this will be highly appreciated. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Fri Oct 10 07:52:26 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Fri, 10 Oct 2014 08:52:26 +0300 Subject: [erlang-questions] Issue with failover/takeover In-Reply-To: References: Message-ID: <18EC90E4-8D14-49EC-9E7C-C8A286D83291@gmail.com> Hello, The error message explicitly says that Erlang distribution experience network split. There might be many reasons for that. Hard to say w/o knowing your env. Best Regards, Dmitry >-|-|-(*> > On 10.10.2014, at 5.28, Akash Chowdhury wrote: > > I am using failover/takeover feature of distributed erlang. I have primary and secondary node in a group. Most of the times, my app is running on the primary node and secondary node is in-active. But sometimes, I am seeing that my app is running on both nodes simultaneously which is not expected behavior. I know this can happen when there is a netsplit (network disconnection) between two nodes. But that didn't happen in my case. From system stats, it was confirmed that network connection was intact. What can be other causes for this? I see the following error message in primary node log when this issue happened : > > =ERROR REPORT==== ...>>> ** Node not responding **>>> ** Removing (timedout) connection **>>> > > Any information/help regarding this will be highly appreciated. > > Thanks. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From grahamrhay@REDACTED Fri Oct 10 08:48:20 2014 From: grahamrhay@REDACTED (Graham Hay) Date: Fri, 10 Oct 2014 07:48:20 +0100 Subject: [erlang-questions] Issue with failover/takeover In-Reply-To: <18EC90E4-8D14-49EC-9E7C-C8A286D83291@gmail.com> References: <18EC90E4-8D14-49EC-9E7C-C8A286D83291@gmail.com> Message-ID: http://kellabyte.com/2013/11/04/the-network-partitions-are-rare-fallacy/ On 10 October 2014 06:52, Dmitry Kolesnikov wrote: > Hello, > > The error message explicitly says that Erlang distribution experience > network split. There might be many reasons for that. Hard to say w/o > knowing your env. > > Best Regards, > Dmitry >-|-|-(*> > > > On 10.10.2014, at 5.28, Akash Chowdhury wrote: > > I am using failover/takeover feature of distributed erlang. I have primary > and secondary node in a group. Most of the times, my app is running on the > primary node and secondary node is in-active. But sometimes, I am seeing > that my app is running on both nodes simultaneously which is not expected > behavior. I know this can happen when there is a netsplit (network > disconnection) between two nodes. But that didn't happen in my case. From > system stats, it was confirmed that network connection was intact. What can > be other causes for this? I see the following error message in primary node > log when this issue happened : > > *=ERROR REPORT==== ...*>>>* ** Node not responding ***>>>* > ** Removing (timedout) connection ***>>> > > Any information/help regarding this will be highly appreciated. > > Thanks. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bosky101@REDACTED Fri Oct 10 11:45:05 2014 From: bosky101@REDACTED (Bhasker Kode) Date: Fri, 10 Oct 2014 15:15:05 +0530 Subject: [erlang-questions] The history of recursion in languages. Any stories from erlang? In-Reply-To: <7851791.PlVK11MAQs@burrito> References: <2092095.KGrna6J6oX@burrito> <7851791.PlVK11MAQs@burrito> Message-ID: yes, here the number of cores and schedulers comes in to play. foo()-> io:format("."), foo(). bar()-> io:format("x"), bar(). 1> [spawn(fun()-> fuconf:X() end) || X <- [foo,bar] ]. .x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.xxx..xx.x.x.xx.xxx.xxxx.xxx.xxxxx.x.xxx.xxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxx[<0.34.0>,<0.35.0>] x.xxxxxxxxxxxxxxxxxxxx.xxxxxx.x.x.x.x.x.x.x..x.xx.x.x.x.x.x.x..x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x................x..............x................x......................x.........................x..............x.............x...............x..............x..............x..x.x.x.x.x.x.x.x.xx.x.x.xxx.x.xx.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x. So the erlang scheduler did not choke. It split work between the two processes based on the number of reductions. You can test out ^ by calling https://github.com/bosky101/fuconf my slides are at http://www.slideshare.net/bosky101/recursion-and-erlang I'm done with my talk at FunctionalConf, there was also a talk on APL by Dyalog CTO Morten Kromberg. Thanks everyone :) This was very educational. ~Bosky | @bhaskerkode On Fri, Oct 10, 2014 at 6:43 AM, zxq9 wrote: > On Thursday 09 October 2014 19:29:56 you wrote: >> another erlang specific question. >> >> foo()-> >> foo(). >> >> bar()-> >> receive >> X -> >> bar() >> end. >> >> both the above functions are tail-call optimized and happen to be recursive. >> >> if i run foo(), would its callstack remain unchanged? will beam bring it >> down? how does it compare with the procedural while (1) { //do something } > > foo() -> foo(). behaves the same as while(1) {};. Testing just now, the stack > indeed remains constant (at ~2.5k), and checking with Observer on the system > I'm sitting at now shows around 4 billion reds per update. Beam will not bring > down a simple infinite loop like this unless you tell it to (its performing as > intended, why kill it if the user wanted it?). > > Its sort of interesting, with regard to scheduling not recursion, to spawn a > few more of these than you have cores, and then run something else and watch > the EVM schedule around all the blank load. > > With regard to the original line of this thread... > > Richard O'Keefe, in a line of private emails, has convinced me that while > recursion is at the root of computing theory, the concept was almost > completely unknown in commercial languages until sometime in the (probably > very late) 60's, and still not very well accepted outside AI research until a > bit later. > > He demonstrated to me that the world of computing theory and AI research, > being full of recursive definitions from the beginning (Lovelace -- with a > unique notation for "cycles of cycles", Church, G?del, etc.), had shockingly > little impact on the tradition of language design that brought us to where we > are today. In particular, it played no role in informing commercial hardware > development and that led to an almost deliberate aversion to the subject by > language designers working for those companies. > > Richard O'Keefe wrote: >> APL (designed through 1960-1965) >> could do recursion, but it was interpreted, and was and >> remained, like Lisp, a niche language irrelevant to >> nearly all programmers. PL/I supported recursion, which >> like much else it copied from Algol 60, but it was >> regarded as strange, scary, and rare, and you had to >> explicitly write, e.g., >> >> factorial: >> procedure (n) options (recursive); >> >> if n < 2 then return 1; >> else return n * factorial (n-1); >> >> end; >> >> Programming textbooks warned people not to use this feature >> because it was too inefficient > > This makes me feel that we are still only rediscovering ideal ways to > communicate with our computers and haven't yet come up with anything really > new (some of the ideal notational concepts go as far back as Ada Lovelace's > notes!). I'd always thought that developments in theory/research were > influential in industry, but this was clearly not the case. > > I'd like to thank Richard for taking the time to so thoroughly prove my > assumptions wrong. It was really interesting! > > -Craig > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From darach@REDACTED Fri Oct 10 12:18:38 2014 From: darach@REDACTED (Darach Ennis) Date: Fri, 10 Oct 2014 11:18:38 +0100 Subject: [erlang-questions] Issue with failover/takeover In-Reply-To: References: <18EC90E4-8D14-49EC-9E7C-C8A286D83291@gmail.com> Message-ID: Hi guys, To my knowledge there is no obvious way to tune the sensitivity of the failover detector in distributed erlang or replace the strategy used to determine when a node is considered down with distributed erlang, and hence when a takeover may occur or should not occur. If the strategy is based on timeouts then something as innocuous as a page fault could trigger a transparent huge page fault which in turn will trigger a synchronous compaction, all becuase of a little GC or memory churn in your IO intensive application. That can manifest as a timeout, which it seems could hit you as a distributed erlang netsplit. You could turn off transparent huge pages. But netsplit detection is as good as the failure detection strategy, the tuning and the qualify of the environment its running in... So your mileage will vary. You can argue successfully many things at this point: * A timeout occurred, its a netsplit, deal with it -> Hanging by a longer rope is still hanging... * The timeout is set too keen, widen it and try to avoid THP induced issues by disabling it. -> Cures the cold of a man condemned to death by hanging * The failure detector is broken. -> Can't tune it. Can't replace it. We have a problem. So, Akash has a very valid concern. Perhaps one of the gen_leader revival projects would work well here: https://github.com/KirinDave/gen_leader_revival Or even riak_core if a masterless strategy is preferential: https://github.com/basho/riak_core If you need active/active hot/hot or hot/warm or active/passive hot/cold standby then variations on the OpenCall SS7 Fault Tolerance Controller has been my starting point for HA pairs for years (careful to avoid the patented bits): http://www.hpl.hp.com/hpjournal/97aug/aug97a8.pdf Recent adaptive failure detectors such as phi-accrual in akka clustering: http://ddg.jaist.ac.jp/pub/HDY+04.pdf http://letitcrash.com/post/43480488964/the-new-cluster-metrics-aware-adaptive-load-balancing In a nutshell, you don't need to live with bad (not tunable) or badly tuned failure detectors. But, unfortunately, you won't find a perfect fit. There isn't any. HA is simply hard. And even carrier grade and battle hardened algorithms such as SS7 need considerable tuning to work well in a real environment. Back to Akash's original issue. I would have concerns with using distributed erlang in a production setting. On the one hand, the failover/takeover model is simple and attractive. The fact that TCP can be swapped out for another transport in ERTS to drive distributed erlang differently... well that seems like a lot of work for plugging in an alternate failure detector... Cheers, Darach. On Fri, Oct 10, 2014 at 7:48 AM, Graham Hay wrote: > http://kellabyte.com/2013/11/04/the-network-partitions-are-rare-fallacy/ > > On 10 October 2014 06:52, Dmitry Kolesnikov > wrote: > >> Hello, >> >> The error message explicitly says that Erlang distribution experience >> network split. There might be many reasons for that. Hard to say w/o >> knowing your env. >> >> Best Regards, >> Dmitry >-|-|-(*> >> >> >> On 10.10.2014, at 5.28, Akash Chowdhury wrote: >> >> I am using failover/takeover feature of distributed erlang. I have >> primary and secondary node in a group. Most of the times, my app is running >> on the primary node and secondary node is in-active. But sometimes, I am >> seeing that my app is running on both nodes simultaneously which is not >> expected behavior. I know this can happen when there is a netsplit (network >> disconnection) between two nodes. But that didn't happen in my case. From >> system stats, it was confirmed that network connection was intact. What can >> be other causes for this? I see the following error message in primary node >> log when this issue happened : >> >> *=ERROR REPORT==== ...*>>>* ** Node not responding ***>>>* >> ** Removing (timedout) connection ***>>> >> >> Any information/help regarding this will be highly appreciated. >> >> Thanks. >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tty.erlang@REDACTED Fri Oct 10 14:09:09 2014 From: tty.erlang@REDACTED (T Ty) Date: Fri, 10 Oct 2014 13:09:09 +0100 Subject: [erlang-questions] Issue with failover/takeover In-Reply-To: References: <18EC90E4-8D14-49EC-9E7C-C8A286D83291@gmail.com> Message-ID: Here is a possible non-code solution, network bond your server to server link with a dose of multihoming end-points would deal with some of this. On Fri, Oct 10, 2014 at 11:18 AM, Darach Ennis wrote: > Hi guys, > > To my knowledge there is no obvious way to tune the sensitivity of the > failover > detector in distributed erlang or replace the strategy used to determine > when a > node is considered down with distributed erlang, and hence when a takeover > may occur or should not occur. > > If the strategy is based on timeouts then something as innocuous as a page > fault could trigger a transparent huge page fault which in turn will > trigger a > synchronous compaction, all becuase of a little GC or memory churn in > your IO intensive application. That can manifest as a timeout, which it > seems > could hit you as a distributed erlang netsplit. > > You could turn off transparent huge pages. But netsplit detection is as > good > as the failure detection strategy, the tuning and the qualify of the > environment > its running in... So your mileage will vary. > > You can argue successfully many things at this point: > * A timeout occurred, its a netsplit, deal with it > -> Hanging by a longer rope is still hanging... > * The timeout is set too keen, widen it and try to avoid THP induced > issues by disabling it. > -> Cures the cold of a man condemned to death by hanging > * The failure detector is broken. > -> Can't tune it. Can't replace it. We have a problem. > > So, Akash has a very valid concern. > > Perhaps one of the gen_leader revival projects would work well here: > > https://github.com/KirinDave/gen_leader_revival > > Or even riak_core if a masterless strategy is preferential: > > https://github.com/basho/riak_core > > If you need active/active hot/hot or hot/warm or active/passive hot/cold > standby then variations on the OpenCall SS7 > Fault Tolerance Controller has been my starting point for HA pairs for > years (careful to avoid the patented bits): > > http://www.hpl.hp.com/hpjournal/97aug/aug97a8.pdf > > Recent adaptive failure detectors such as phi-accrual in akka clustering: > > http://ddg.jaist.ac.jp/pub/HDY+04.pdf > > > http://letitcrash.com/post/43480488964/the-new-cluster-metrics-aware-adaptive-load-balancing > > In a nutshell, you don't need to live with bad (not tunable) or badly > tuned failure detectors. > > But, unfortunately, you won't find a perfect fit. There isn't any. HA is > simply hard. And even > carrier grade and battle hardened algorithms such as SS7 need considerable > tuning to work > well in a real environment. > > Back to Akash's original issue. I would have concerns with using > distributed erlang > in a production setting. On the one hand, the failover/takeover model is > simple and > attractive. The fact that TCP can be swapped out for another transport in > ERTS to > drive distributed erlang differently... well that seems like a lot of work > for plugging in > an alternate failure detector... > > Cheers, > > Darach. > > On Fri, Oct 10, 2014 at 7:48 AM, Graham Hay wrote: > >> http://kellabyte.com/2013/11/04/the-network-partitions-are-rare-fallacy/ >> >> On 10 October 2014 06:52, Dmitry Kolesnikov >> wrote: >> >>> Hello, >>> >>> The error message explicitly says that Erlang distribution experience >>> network split. There might be many reasons for that. Hard to say w/o >>> knowing your env. >>> >>> Best Regards, >>> Dmitry >-|-|-(*> >>> >>> >>> On 10.10.2014, at 5.28, Akash Chowdhury wrote: >>> >>> I am using failover/takeover feature of distributed erlang. I have >>> primary and secondary node in a group. Most of the times, my app is running >>> on the primary node and secondary node is in-active. But sometimes, I am >>> seeing that my app is running on both nodes simultaneously which is not >>> expected behavior. I know this can happen when there is a netsplit (network >>> disconnection) between two nodes. But that didn't happen in my case. From >>> system stats, it was confirmed that network connection was intact. What can >>> be other causes for this? I see the following error message in primary node >>> log when this issue happened : >>> >>> *=ERROR REPORT==== ...*>>>* ** Node not responding *** >>> >>>* ** Removing (timedout) connection ***>>> >>> >>> Any information/help regarding this will be highly appreciated. >>> >>> Thanks. >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> >> _______________________________________________ >> 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 jose.pedro.magalhaes@REDACTED Fri Oct 10 15:59:29 2014 From: jose.pedro.magalhaes@REDACTED (=?UTF-8?Q?Jos=C3=A9_Pedro_Magalh=C3=A3es?=) Date: Fri, 10 Oct 2014 14:59:29 +0100 Subject: [erlang-questions] Mathematics of Program Construction (MPC 2015): first call for papers Message-ID: Apologies for multiple copies. FIRST CALL FOR PAPERS 12th International Conference on Mathematics of Program Construction, MPC 2015 K?nigswinter, Germany, 29 June - 1 July 2015 http://www.cs.ox.ac.uk/conferences/MPC2015/ BACKGROUND The MPC conferences aim to promote the development of mathematical principles and techniques that are demonstrably practical and effective in the process of constructing computer programs, broadly interpreted. The 2015 MPC conference will be held in K?nigswinter, Germany, from 29th June to 1st July 2015. The previous conferences were held in Twente, The Netherlands (1989), Oxford, UK (1992), Kloster Irsee, Germany (1995), Marstrand, Sweden (1998), Ponte de Lima, Portugal (2000), Dagstuhl, Germany (2002), Stirling, UK (2004, colocated with AMAST), Kuressaare, Estonia (2006, colocated with AMAST), Marseille, France (2008), Qu?bec City, Canada (2010, colocated with AMAST), and Madrid, Spain (2012). TOPICS Papers are solicited on mathematical methods and tools put to use in program construction. Topics of interest range from algorithmics to support for program construction in programming languages and systems. The notion of "program" is broad, from algorithms to hardware. Some typical areas are type systems, program analysis and transformation, programming-language semantics, security, and program logics. Theoretical contributions are welcome, provided that their relevance to program construction is clear. Reports on applications are welcome, provided that their mathematical basis is evident. We also encourage the submission of "pearls": elegant, instructive, and fun essays on the mathematics of program construction. IMPORTANT DATES * Submission of abstracts: 26 January 2015 * Submission of full papers: 2 February 2015 * Notification to authors: 16 March 2015 * Final version: 13 April 2015 SUBMISSION Submission is in two stages. Abstracts (plain text, 10 to 20 lines) must be submitted by 26 January 2015. Full papers (pdf) adhering to the LaTeX llncs style must be submitted by 2 February 2015. There is no official page limit, but authors should strive for brevity. The web-based system EasyChair will be used for submission (https://easychair.org/conferences/?conf=mpc2015). Papers must report previously unpublished work, and must not be submitted concurrently to a journal or to another conference with refereed proceedings. Accepted papers must be presented at the conference by one of the authors. Please feel free to write to mpc2015@REDACTED with any questions about academic matters. The proceedings of MPC 2015 will be published in Springer-Verlag's Lecture Notes in Computer Science series, as have all the previous editions. Authors of accepted papers will be expected to transfer copyright to Springer for this purpose. After the conference, authors of the best papers will be invited to submit revised versions to a special issue of the Elsevier journal Science of Computer Programming. PROGRAMME COMMITTEE Ralf Hinze University of Oxford, UK (chair) Eerke Boiten University of Kent, UK Jules Desharnais Universit? Laval, Canada Lindsay Groves Victoria University of Wellington, New Zealand Zhenjiang Hu National Institute of Informatics, Japan Graham Hutton University of Nottingham, UK Johan Jeuring Utrecht University and Open University, The Netherlands Jay McCarthy Vassar College, US Bernhard M?ller Universit?t Augsburg, Germany Shin-Cheng Mu Academia Sinica, Taiwan Dave Naumann Stevens Institute of Technology, US Pablo Nogueira Universidad Polit?cnica de Madrid, Spain Ulf Norell University of Gothenburg, Sweden Bruno C. d. S. Oliveira The University of Hong Kong, Hong Kong Jos? Nuno Oliveira Universidade do Minho, Portugal Alberto Pardo Universidad de la Rep?blica, Uruguay Christine Paulin-Mohring INRIA-Universit? Paris-Sud, France Tom Schrijvers KU Leuven, Belgium Emil Sekerinski McMaster University, Canada Tim Sheard Portland State University, US Anya Tafliovich University of Toronto Scarborough, Canada Tarmo Uustalu Institute of Cybernetics, Estonia Janis Voigtl?nder Universit?t Bonn, Germany VENUE The conference will take place in K?nigswinter, Maritim Hotel, where accommodation has been reserved. K?nigswinter is situated on the right bank of the river Rhine, opposite Germany's former capital Bonn, at the foot of the Siebengebirge. LOCAL ORGANIZERS Ralf Hinze University of Oxford, UK (co-chair) Janis Voigtl?nder Universit?t Bonn, Germany (co-chair) Jos? Pedro Magalh?es University of Oxford, UK Nicolas Wu University of Oxford, UK For queries about local matters, please write to jv@REDACTED From richard.youngkin@REDACTED Fri Oct 10 21:51:55 2014 From: richard.youngkin@REDACTED (Youngkin, Rich) Date: Fri, 10 Oct 2014 13:51:55 -0600 Subject: [erlang-questions] Unable to create Mnesia table In-Reply-To: References: Message-ID: Just in case it's helpful to anyone... I've discovered the error of my ways (but I'm still looking towards a solution). This application used to start Mnesia directly after creating the schema (only on the initial startup of course). When creating the release I changed this by adding the mnesia application to the {applications, [...]} tuple in the app.src file. I did this to fix another problem caused by the Mnesia beam files not being included as part of the Erlang distro created by relx. So in the release version, Mnesia is up and running before the schema is created. So I end up with a started Mnesia application without a schema, which of course is needed to define tables. So now on the my next question, how can I get the schema initialized if Mnesia is started prior to schema creation? Some guy who gives crappy answers :) had this post in StackOverflow that gave a partial answer - http://stackoverflow.com/questions/14083367/mnesia-doesnt-restart-with-supervisor. Is this really the preferred way of doing this? Seems like a bit of a hack to me (but I'm still a newbie, what do I know :>). Cheers, Rich On Wed, Oct 8, 2014 at 8:33 AM, Youngkin, Rich wrote: > Hi all, > > I recently converted an existing application to a release using relx. > After that the application isn't able to create any Mnesia tables. I can't > reproduce the problem in the Erlang shell (except by creating the table > before creating the schema). This is confusing because the app code creates > the schema prior to creating the table. > > Here is the error: > 12:20:18.929 [info] Creating a new schema from scratch... > 12:20:18.929 [info] Mnesia started, creating tables... > 12:20:18.929 [info] Attempting to create table with TableDef > {pe_properties,{disc_copies,[{attributes,[key,value]},{record_name,pe_kvpair}]}} > 12:20:18.931 [error] gen_server pe_membership terminated with reason: bad > return value: > {error,{unable_to_init_schema,{aborted,{bad_type,pe_properties,disc_copies,' > prospero@REDACTED'}}}} > > > Here's the associated application code: > > error_logger:info_msg("Creating a new schema from scratch...~n"), > > %% TODO: TEMP WORKAROUND TO DEBUG MNESIA SCHEMA CREATION PROBLEM > > application:set_env(mnesia, dir, "/var/data/prospero"), > > mnesia:create_schema([node()]), > > mnesia:start(), > > error_logger:info_msg("Mnesia started, creating tables...", []), > > case create_tables(pe_migrate:get_schema()) of > > > The line application:set_env(...) was added in case the Mnesia directory > wasn't getting created properly due to the move to a relx-built release. I > had a similar entry in vm.args that I may have gotten wrong (-mnesia dir > '"/var/data/prospero"'). Interestingly enough, I don't see any artifacts > associated with the schema creation in the Mnesia dir (e.g., schema.DAT). > I'm wondering if this is a clue as to what the cause is. > > pe_migrate:get_schema()) returns a list of TableDefs. create_tables > iterates through that list creating the tables one at a time. The failure > occurs when attempting to create the first table. > > Thanks, Rich > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf@REDACTED Fri Oct 10 22:54:29 2014 From: ulf@REDACTED (Ulf Wiger) Date: Fri, 10 Oct 2014 22:54:29 +0200 Subject: [erlang-questions] Issue with failover/takeover In-Reply-To: References: Message-ID: <570D4CEB-2B6C-466B-995B-9E619412E014@feuerlabs.com> On 10 Oct 2014, at 04:28, Akash Chowdhury wrote: > > =ERROR REPORT==== ...>>> ** Node not responding **>>> ** Removing (timedout) connection **>>> This message doesn?t in itself positively indicate a netsplit, but since you observe the app running on both nodes, this is what has happened. Specifically, the secondary node failed to send pings (or the pings got stuck/lost along the way) for four consecutive ping intervals. The length of the ping interval is set using: -kernel net_ticktime Seconds Default is 60 seconds. I would not set it to a value less than 10 seconds, except after rigorous testing under realistic conditions. There could be many reasons for the connection timing out, but the Erlang VM is usually not that unresponsive, if it has sufficient resources. You should investigate whether anything in your local environment blocks the VM schedulers or otherwise renders the VM unresponsive. If the network is flaky, or you?re pushing a lot of data, you might want to play with the +zdbbl size flag, which controls the buffer size for outgoing messages on Distributed Erlang. If this buffer becomes full, the VM will suspen any process that tries to send a message, and if this process is the ?tick? process, you have a problem. See the ?erl? man page for details. The problem of determining whether to start the application or not when you get a ?nodedown? indication is a hard one. Ideally, you should designate a third party: if you can talk to the third party, and it tells you you?re ok, you?re good to go. If the third party is able to deconflict between two nodes pinging it at the same time, great. A particular Erlang flavor of this problem is that the nodes may auto-connect again, which may, or may not, actually make things worse. One way to deal with that is to set -kernel dist_auto_connect once, which means that a node will only auto-connect with another node once in its life time; it needs to restart before it can auto-connect again. If you combine this with e.g. a UDP ping between the nodes, you can detect whether the nodes have lost contact, but are both still alive. If this occurs, you can decide (e.g. using the UDP messages) to restart one of the nodes. BR, Ulf W Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From darach@REDACTED Fri Oct 10 23:20:42 2014 From: darach@REDACTED (Darach Ennis) Date: Fri, 10 Oct 2014 22:20:42 +0100 Subject: [erlang-questions] Issue with failover/takeover In-Reply-To: <570D4CEB-2B6C-466B-995B-9E619412E014@feuerlabs.com> References: <570D4CEB-2B6C-466B-995B-9E619412E014@feuerlabs.com> Message-ID: Hi Ulf, Good to know the effect of +zddbl. I'm not sure a 3rd party will help deconflict in all cases though. A good example is the Ctrl-Z test. Suspending the Erlang VM (or any OS level process) for a reasonable period, say 5 or 15 seconds, then bringing it back to the foreground (eg: fg on linux) whilst under a reasonable production load is a great way to find issues here. Many failure detectors in commercial and open source projects fail this simple test and it sounds like distributed erlang, through actively suspending the tick process is also less than ideal, but with careful tuning to load it sounds reasonably manageable in practice. Cheers, Darach. On Fri, Oct 10, 2014 at 9:54 PM, Ulf Wiger wrote: > > On 10 Oct 2014, at 04:28, Akash Chowdhury wrote: > > > *=ERROR REPORT==== ...*>>>* ** Node not responding ***>>>* ** > Removing (timedout) connection ***>>> > > > This message doesn?t in itself positively indicate a netsplit, but since > you observe the app running on both nodes, this is what has happened. > > Specifically, the secondary node failed to send pings (or the pings got > stuck/lost along the way) for four consecutive ping intervals. The length > of the ping interval is set using: > > -kernel net_ticktime Seconds > > Default is 60 seconds. I would not set it to a value less than 10 seconds, > except after rigorous testing under realistic conditions. > > There could be many reasons for the connection timing out, but the Erlang > VM is usually not that unresponsive, if it has sufficient resources. You > should investigate whether anything in your local environment blocks the VM > schedulers or otherwise renders the VM unresponsive. > > If the network is flaky, or you?re pushing a lot of data, you might want > to play with the > > +zdbbl size > > flag, which controls the buffer size for outgoing messages on Distributed > Erlang. If this buffer becomes full, the VM will suspen any process that > tries to send a message, and if this process is the ?tick? process, you > have a problem. See the ?erl? man page for details. > > The problem of determining whether to start the application or not when > you get a ?nodedown? indication is a hard one. Ideally, you should > designate a third party: if you can talk to the third party, and it tells > you you?re ok, you?re good to go. If the third party is able to deconflict > between two nodes pinging it at the same time, great. > > A particular Erlang flavor of this problem is that the nodes may > auto-connect again, which may, or may not, actually make things worse. One > way to deal with that is to set -kernel dist_auto_connect once, which means > that a node will only auto-connect with another node once in its life time; > it needs to restart before it can auto-connect again. If you combine this > with e.g. a UDP ping between the nodes, you can detect whether the nodes > have lost contact, but are both still alive. If this occurs, you can decide > (e.g. using the UDP messages) to restart one of the nodes. > > BR, > Ulf W > > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. > http://feuerlabs.com > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.s.doane@REDACTED Sat Oct 11 02:34:43 2014 From: jay.s.doane@REDACTED (Jay Doane) Date: Fri, 10 Oct 2014 17:34:43 -0700 Subject: [erlang-questions] Unable to create Mnesia table In-Reply-To: References: Message-ID: What happens if you stop mnesia, create your schema, then restart mnesia? On Fri, Oct 10, 2014 at 12:51 PM, Youngkin, Rich < richard.youngkin@REDACTED> wrote: > Just in case it's helpful to anyone... I've discovered the error of my > ways (but I'm still looking towards a solution). This application used to > start Mnesia directly after creating the schema (only on the initial > startup of course). When creating the release I changed this by adding the > mnesia application to the {applications, [...]} tuple in the app.src file. > I did this to fix another problem caused by the Mnesia beam files not being > included as part of the Erlang distro created by relx. So in the release > version, Mnesia is up and running before the schema is created. So I end up > with a started Mnesia application without a schema, which of course is > needed to define tables. > > So now on the my next question, how can I get the schema initialized if > Mnesia is started prior to schema creation? Some guy who gives crappy > answers :) had this post in StackOverflow that gave a partial answer - > http://stackoverflow.com/questions/14083367/mnesia-doesnt-restart-with-supervisor. > Is this really the preferred way of doing this? Seems like a bit of a hack > to me (but I'm still a newbie, what do I know :>). > > Cheers, > Rich > > On Wed, Oct 8, 2014 at 8:33 AM, Youngkin, Rich < > richard.youngkin@REDACTED> wrote: > >> Hi all, >> >> I recently converted an existing application to a release using relx. >> After that the application isn't able to create any Mnesia tables. I can't >> reproduce the problem in the Erlang shell (except by creating the table >> before creating the schema). This is confusing because the app code creates >> the schema prior to creating the table. >> >> Here is the error: >> 12:20:18.929 [info] Creating a new schema from scratch... >> 12:20:18.929 [info] Mnesia started, creating tables... >> 12:20:18.929 [info] Attempting to create table with TableDef >> {pe_properties,{disc_copies,[{attributes,[key,value]},{record_name,pe_kvpair}]}} >> 12:20:18.931 [error] gen_server pe_membership terminated with reason: bad >> return value: >> {error,{unable_to_init_schema,{aborted,{bad_type,pe_properties,disc_copies,' >> prospero@REDACTED'}}}} >> >> >> Here's the associated application code: >> >> error_logger:info_msg("Creating a new schema from scratch...~n"), >> >> %% TODO: TEMP WORKAROUND TO DEBUG MNESIA SCHEMA CREATION PROBLEM >> >> application:set_env(mnesia, dir, "/var/data/prospero"), >> >> mnesia:create_schema([node()]), >> >> mnesia:start(), >> >> error_logger:info_msg("Mnesia started, creating tables...", []), >> >> case create_tables(pe_migrate:get_schema()) of >> >> >> The line application:set_env(...) was added in case the Mnesia directory >> wasn't getting created properly due to the move to a relx-built release. I >> had a similar entry in vm.args that I may have gotten wrong (-mnesia dir >> '"/var/data/prospero"'). Interestingly enough, I don't see any artifacts >> associated with the schema creation in the Mnesia dir (e.g., schema.DAT). >> I'm wondering if this is a clue as to what the cause is. >> >> pe_migrate:get_schema()) returns a list of TableDefs. create_tables >> iterates through that list creating the tables one at a time. The failure >> occurs when attempting to create the first table. >> >> Thanks, Rich >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tty.erlang@REDACTED Sat Oct 11 02:48:28 2014 From: tty.erlang@REDACTED (T Ty) Date: Sat, 11 Oct 2014 01:48:28 +0100 Subject: [erlang-questions] Unable to create Mnesia table In-Reply-To: References: Message-ID: The whole lets-create-schema-on-first-start-up-if-it-is-not-there is not worth the aggravation IMHO. Personally I would create the schema as a post-condition to installation or pre-condition to starting the application. On Fri, Oct 10, 2014 at 8:51 PM, Youngkin, Rich < richard.youngkin@REDACTED> wrote: > Just in case it's helpful to anyone... I've discovered the error of my > ways (but I'm still looking towards a solution). This application used to > start Mnesia directly after creating the schema (only on the initial > startup of course). When creating the release I changed this by adding the > mnesia application to the {applications, [...]} tuple in the app.src file. > I did this to fix another problem caused by the Mnesia beam files not being > included as part of the Erlang distro created by relx. So in the release > version, Mnesia is up and running before the schema is created. So I end up > with a started Mnesia application without a schema, which of course is > needed to define tables. > > So now on the my next question, how can I get the schema initialized if > Mnesia is started prior to schema creation? Some guy who gives crappy > answers :) had this post in StackOverflow that gave a partial answer - > http://stackoverflow.com/questions/14083367/mnesia-doesnt-restart-with-supervisor. > Is this really the preferred way of doing this? Seems like a bit of a hack > to me (but I'm still a newbie, what do I know :>). > > Cheers, > Rich > > On Wed, Oct 8, 2014 at 8:33 AM, Youngkin, Rich < > richard.youngkin@REDACTED> wrote: > >> Hi all, >> >> I recently converted an existing application to a release using relx. >> After that the application isn't able to create any Mnesia tables. I can't >> reproduce the problem in the Erlang shell (except by creating the table >> before creating the schema). This is confusing because the app code creates >> the schema prior to creating the table. >> >> Here is the error: >> 12:20:18.929 [info] Creating a new schema from scratch... >> 12:20:18.929 [info] Mnesia started, creating tables... >> 12:20:18.929 [info] Attempting to create table with TableDef >> {pe_properties,{disc_copies,[{attributes,[key,value]},{record_name,pe_kvpair}]}} >> 12:20:18.931 [error] gen_server pe_membership terminated with reason: bad >> return value: >> {error,{unable_to_init_schema,{aborted,{bad_type,pe_properties,disc_copies,' >> prospero@REDACTED'}}}} >> >> >> Here's the associated application code: >> >> error_logger:info_msg("Creating a new schema from scratch...~n"), >> >> %% TODO: TEMP WORKAROUND TO DEBUG MNESIA SCHEMA CREATION PROBLEM >> >> application:set_env(mnesia, dir, "/var/data/prospero"), >> >> mnesia:create_schema([node()]), >> >> mnesia:start(), >> >> error_logger:info_msg("Mnesia started, creating tables...", []), >> >> case create_tables(pe_migrate:get_schema()) of >> >> >> The line application:set_env(...) was added in case the Mnesia directory >> wasn't getting created properly due to the move to a relx-built release. I >> had a similar entry in vm.args that I may have gotten wrong (-mnesia dir >> '"/var/data/prospero"'). Interestingly enough, I don't see any artifacts >> associated with the schema creation in the Mnesia dir (e.g., schema.DAT). >> I'm wondering if this is a clue as to what the cause is. >> >> pe_migrate:get_schema()) returns a list of TableDefs. create_tables >> iterates through that list creating the tables one at a time. The failure >> occurs when attempting to create the first table. >> >> Thanks, Rich >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dgud@REDACTED Sat Oct 11 09:30:08 2014 From: dgud@REDACTED (Dan Gudmundsson) Date: Sat, 11 Oct 2014 09:30:08 +0200 Subject: [erlang-questions] Unable to create Mnesia table In-Reply-To: References: Message-ID: On Sat, Oct 11, 2014 at 2:48 AM, T Ty wrote: > The whole lets-create-schema-on-first-start-up-if-it-is-not-there is not > worth the aggravation IMHO. Personally I would create the schema as a > post-condition to installation or pre-condition to starting the > application. > That is the intention. Or otherwise do a test and create everything dynamically, an empty ram schema is always created if nothing on disc is found. Use mnesia:change_table_copy_type(schema, node(), disc_copies). to convert it. I believe (long time since I did this) you can even use mnesia:add_table_copy(schema, OtherNode, disc_copies) for the nodes that will start later. Create your tables with your distribution configuration. But do this only ONCE, mnesia will not accept/merge schemas created/modifed from different nodes. And when starting the empty 'OtherNode ' use the extra_db_nodes config param to initiate mnesia connection to the 'Nodes' with a valid schema. /Dan > > On Fri, Oct 10, 2014 at 8:51 PM, Youngkin, Rich < > richard.youngkin@REDACTED> wrote: > >> Just in case it's helpful to anyone... I've discovered the error of my >> ways (but I'm still looking towards a solution). This application used to >> start Mnesia directly after creating the schema (only on the initial >> startup of course). When creating the release I changed this by adding the >> mnesia application to the {applications, [...]} tuple in the app.src file. >> I did this to fix another problem caused by the Mnesia beam files not being >> included as part of the Erlang distro created by relx. So in the release >> version, Mnesia is up and running before the schema is created. So I end up >> with a started Mnesia application without a schema, which of course is >> needed to define tables. >> >> So now on the my next question, how can I get the schema initialized if >> Mnesia is started prior to schema creation? Some guy who gives crappy >> answers :) had this post in StackOverflow that gave a partial answer - >> http://stackoverflow.com/questions/14083367/mnesia-doesnt-restart-with-supervisor. >> Is this really the preferred way of doing this? Seems like a bit of a hack >> to me (but I'm still a newbie, what do I know :>). >> >> Cheers, >> Rich >> >> On Wed, Oct 8, 2014 at 8:33 AM, Youngkin, Rich < >> richard.youngkin@REDACTED> wrote: >> >>> Hi all, >>> >>> I recently converted an existing application to a release using relx. >>> After that the application isn't able to create any Mnesia tables. I can't >>> reproduce the problem in the Erlang shell (except by creating the table >>> before creating the schema). This is confusing because the app code creates >>> the schema prior to creating the table. >>> >>> Here is the error: >>> 12:20:18.929 [info] Creating a new schema from scratch... >>> 12:20:18.929 [info] Mnesia started, creating tables... >>> 12:20:18.929 [info] Attempting to create table with TableDef >>> {pe_properties,{disc_copies,[{attributes,[key,value]},{record_name,pe_kvpair}]}} >>> 12:20:18.931 [error] gen_server pe_membership terminated with reason: >>> bad return value: >>> {error,{unable_to_init_schema,{aborted,{bad_type,pe_properties,disc_copies,' >>> prospero@REDACTED'}}}} >>> >>> >>> Here's the associated application code: >>> >>> error_logger:info_msg("Creating a new schema from scratch...~n"), >>> >>> %% TODO: TEMP WORKAROUND TO DEBUG MNESIA SCHEMA CREATION PROBLEM >>> >>> application:set_env(mnesia, dir, "/var/data/prospero"), >>> >>> mnesia:create_schema([node()]), >>> >>> mnesia:start(), >>> >>> error_logger:info_msg("Mnesia started, creating tables...", []), >>> >>> case create_tables(pe_migrate:get_schema()) of >>> >>> >>> The line application:set_env(...) was added in case the Mnesia directory >>> wasn't getting created properly due to the move to a relx-built release. I >>> had a similar entry in vm.args that I may have gotten wrong (-mnesia dir >>> '"/var/data/prospero"'). Interestingly enough, I don't see any artifacts >>> associated with the schema creation in the Mnesia dir (e.g., schema.DAT). >>> I'm wondering if this is a clue as to what the cause is. >>> >>> pe_migrate:get_schema()) returns a list of TableDefs. create_tables >>> iterates through that list creating the tables one at a time. The failure >>> occurs when attempting to create the first table. >>> >>> Thanks, Rich >>> >> >> >> _______________________________________________ >> 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 rainer.hansen@REDACTED Sat Oct 11 16:28:13 2014 From: rainer.hansen@REDACTED (Rainer Hansen) Date: Sat, 11 Oct 2014 16:28:13 +0200 Subject: [erlang-questions] How to build web chat in Erlang? References: <87k34ay63o.fsf@gmx.net> <87bnpmxzz9.fsf@gmx.net> Message-ID: <871tqek7eq.fsf@gmx.net> Maxim Sokhatsky writes: > Thanks, Raoul! > > It is better to go directly with N2O sample: > > ? ? ? ?https://synrc.com/apps/n2o/doc/web/setup.htm > > Also it includes desired Chat application. > > -- > Maxim Sokhatsky Hi Maxim, thanks a lot for the link. I have tried the sample but somehow I got problems when the smartphone went to sleep. After activating the phone again I could send messages from the phone or the desktop browser but they were not shown on the phone screen, only in the desktop browser. The sample chat page seemed to be somehow broken, I don't know if that is the reason. See the red marked areas in the linked screenshot for what I mean: https://sharegallery.strato.com/u/md9XUsZ3/22lVNLZM#n2o/photo/35205696 Thanks Rainer From maxim@REDACTED Sat Oct 11 19:30:28 2014 From: maxim@REDACTED (Maxim Sokhatsky) Date: Sat, 11 Oct 2014 20:30:28 +0300 Subject: [erlang-questions] How to build web chat in Erlang? In-Reply-To: <871tqek7eq.fsf@gmx.net> References: <87k34ay63o.fsf@gmx.net> <87bnpmxzz9.fsf@gmx.net> <871tqek7eq.fsf@gmx.net> Message-ID: It?s ok. Everything is fine. If you want pretty pages try synrc/skyline instead n2o_sample. -- Maxim Sokhatsky From cole.fichter@REDACTED Sat Oct 11 20:23:04 2014 From: cole.fichter@REDACTED (Cole Fichter) Date: Sat, 11 Oct 2014 12:23:04 -0600 Subject: [erlang-questions] Erlang ODBC Tips Message-ID: Hi everyone, There isn't a lot of helpful information available about using ODBC to connect to SQL from Erlang, so I've written a short field guide with helpful advice and tips: http://erlang-odbc-tips.colefichter.ca/ I hope this helps others in the future, and would appreciate any feedback you can provide. Cheers, Cole Fichter -------------- next part -------------- An HTML attachment was scrubbed... URL: From rainer.hansen@REDACTED Sun Oct 12 13:15:20 2014 From: rainer.hansen@REDACTED (Rainer Hansen) Date: Sun, 12 Oct 2014 13:15:20 +0200 Subject: [erlang-questions] How to build web chat in Erlang? References: <87k34ay63o.fsf@gmx.net> <87bnpmxzz9.fsf@gmx.net> <871tqek7eq.fsf@gmx.net> Message-ID: <87tx39v8s7.fsf@gmx.net> Maxim Sokhatsky writes: > It?s ok. Everything is fine. > If you want pretty pages try synrc/skyline instead n2o_sample. > > -- > Maxim Sokhatsky Hi Maxim, thanks for the hint for the other demo. I have tested your skyline demo on my local server and on your web page: http://skyline.synrc.com/chat I get the same problems as before. If I lock the screen on my Android mobile with Firefox browser 32.0.3 for 2 minutes and after that type some chat message again, the message is send but the page viewed in the mobile browser is not updated. This problem is the same as I have had with the n2o sample page. I see it as a major problem for mobile chatting. Do you know of any workaround? Rainer From ok@REDACTED Mon Oct 13 00:51:30 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 13 Oct 2014 11:51:30 +1300 Subject: [erlang-questions] The history of recursion in languages. Any stories from erlang? In-Reply-To: References: <2092095.KGrna6J6oX@burrito> <7851791.PlVK11MAQs@burrito> Message-ID: On 10/10/2014, at 10:45 PM, Bhasker Kode wrote: > > You can test out ^ by calling https://github.com/bosky101/fuconf > my slides are at http://www.slideshare.net/bosky101/recursion-and-erlang The "concurrency existed before erlang" slide is very odd. It lists *late* languages, not mentioning - Burroughs Algol (~1965) - PL/I (~1965) - Simula 67 (cooperative threads, basically) - Algol 68 - Concurrent Pascal (1975) all of which pre-dated most if not all of the languages on that slide. Per Brinch Hansen has a list of key papers: http://brinch-hansen.net/papers/2002b.pdf From achowdhury918@REDACTED Mon Oct 13 03:36:28 2014 From: achowdhury918@REDACTED (Akash Chowdhury) Date: Sun, 12 Oct 2014 21:36:28 -0400 Subject: [erlang-questions] Issue with failover/takeover In-Reply-To: <18EC90E4-8D14-49EC-9E7C-C8A286D83291@gmail.com> References: <18EC90E4-8D14-49EC-9E7C-C8A286D83291@gmail.com> Message-ID: Thanks for replying me answers. Provided information was helpful. On Fri, Oct 10, 2014 at 1:52 AM, Dmitry Kolesnikov wrote: > Hello, > > The error message explicitly says that Erlang distribution experience > network split. There might be many reasons for that. Hard to say w/o > knowing your env. > > Best Regards, > Dmitry >-|-|-(*> > > > On 10.10.2014, at 5.28, Akash Chowdhury wrote: > > I am using failover/takeover feature of distributed erlang. I have primary > and secondary node in a group. Most of the times, my app is running on the > primary node and secondary node is in-active. But sometimes, I am seeing > that my app is running on both nodes simultaneously which is not expected > behavior. I know this can happen when there is a netsplit (network > disconnection) between two nodes. But that didn't happen in my case. From > system stats, it was confirmed that network connection was intact. What can > be other causes for this? I see the following error message in primary node > log when this issue happened : > > *=ERROR REPORT==== ...*>>>* ** Node not responding ***>>>* > ** Removing (timedout) connection ***>>> > > Any information/help regarding this will be highly appreciated. > > Thanks. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From achowdhury918@REDACTED Mon Oct 13 03:52:12 2014 From: achowdhury918@REDACTED (Akash Chowdhury) Date: Sun, 12 Oct 2014 21:52:12 -0400 Subject: [erlang-questions] Question about erlang garbage collection Message-ID: Hi, I have a question to experienced erlang developers/designers. Have you ever used or felt the need of using erlang:garbage_collect()? Or erlang's default garbage collection is good enough for all situations? Erlang man page says that -"This function forces an immediate garbage collection of the currently executing process. The function should not be used, unless it has been noticed -- or there are good reasons to suspect -- that the spontaneous garbage collection will occur too late or not at all. Improper use may seriously degrade system performance." Does using this seriously degrade system performance? Any one has experience of using this? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf@REDACTED Mon Oct 13 07:46:20 2014 From: ulf@REDACTED (Ulf Wiger) Date: Mon, 13 Oct 2014 07:46:20 +0200 Subject: [erlang-questions] The history of recursion in languages. Any stories from erlang? In-Reply-To: References: <2092095.KGrna6J6oX@burrito> <7851791.PlVK11MAQs@burrito> Message-ID: <2577D43D-2A88-4808-9797-98C8399E6319@feuerlabs.com> On 13 Oct 2014, at 00:51, Richard A. O'Keefe wrote: > The "concurrency existed before erlang" slide is very odd. I think it?s mainly the title that is odd. The languages listed are rather ?Concurrent languages considered, or designed, by Ericsson? BR, Ulf W Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com From ulf@REDACTED Mon Oct 13 08:06:21 2014 From: ulf@REDACTED (Ulf Wiger) Date: Mon, 13 Oct 2014 08:06:21 +0200 Subject: [erlang-questions] Question about erlang garbage collection In-Reply-To: References: Message-ID: <3F41D8D3-C852-45B3-B7D5-6CE568E06EF8@feuerlabs.com> Well, it *can* degrade system performance if it ends up being called very often. There are basically two cases where explicitly calling erlang:garbage_collect() might be warranted: - A process has performed some reasonably expansive operation, and will afterwards to basically nothing for a long time. This might happen in e.g. supervisors. - After an expansive operation, where memory profiling has shown that it actually improves characteristics to force a garbage collect right there. The most likely benefit, if there is one, is that the old_heap is reduced. Using explicit GCs should be seen as an optimization, pushing the garbage collector to work more aggressively than it otherwise would. As with all optimizations, you need to measure before and after to ensure that it actually _improves_ things, rather than make things worse. BR, Ulf W On 13 Oct 2014, at 03:52, Akash Chowdhury wrote: > Hi, > I have a question to experienced erlang developers/designers. Have you ever used or felt the need of using erlang:garbage_collect()? Or erlang's default garbage collection is good enough for all situations? > Erlang man page says that -"This function forces an immediate garbage collection of the currently executing process. The function should not be used, unless it has been noticed -- or there are good reasons to suspect -- that the spontaneous garbage collection will occur too late or not at all. Improper use may seriously degrade system performance." > Does using this seriously degrade system performance? Any one has experience of using this? > Thanks. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Ola.Backstrom@REDACTED Mon Oct 13 08:26:37 2014 From: Ola.Backstrom@REDACTED (=?utf-8?B?T2xhIELDpGNrc3Ryw7Zt?=) Date: Mon, 13 Oct 2014 06:26:37 +0000 Subject: [erlang-questions] Erlang ODBC Tips In-Reply-To: References: Message-ID: Nice! I?d suggest you to rename ?64-Bit/32-Bit Architecture Mismatch? by adding ?? in Windows?. Also there?s some typo: ?Canada? - it should be a string. /Ola From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Cole Fichter Sent: den 11 oktober 2014 20:23 To: erlang-questions@REDACTED Subject: [erlang-questions] Erlang ODBC Tips Hi everyone, There isn't a lot of helpful information available about using ODBC to connect to SQL from Erlang, so I've written a short field guide with helpful advice and tips: http://erlang-odbc-tips.colefichter.ca/ I hope this helps others in the future, and would appreciate any feedback you can provide. Cheers, Cole Fichter -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy.j.li@REDACTED Mon Oct 13 11:19:38 2014 From: andy.j.li@REDACTED (Andy Li J) Date: Mon, 13 Oct 2014 09:19:38 +0000 Subject: [erlang-questions] A lot of SCTP restart happen, and many TSN retransmition(using gen_sctp) Message-ID: <3657600B1AAAE34C9A9DABD197B9106B1C9F7989@ESGSCMB103.ericsson.se> Hi, ULP is Erlang fsm, using gen_sctp and LKSCTP. When I do our product test, I need to break all the SCTP association and re init the SCTP association. But from the log, I see that there are many assoc restart. From the wireshark, many SCTP INIT procedure happen, just INIT, INIT_ACK, COOKIE_ECHO, COOKIE_ACK, HEARTBEAT, HEARTBEAT, and then peer will send SGSAP-UPDATE-LOCATION_REQUEST(TSN is N), if in the normal situation, we will return SACK and SGSAP-UPDATE-LOCATION-ACCEPTED, but in the test situation, we only return SACK(and TSN is wrong, N - 1). And after a while, the peer retransmit the message for some times and do not receive the response and then return ABORT and re INIT again, and loop as above. B.R Andy Attach is the captured pcap file. Wireshark: (txt format) No. Time Source Destination Protocol Length Info 15 4.286932 2001:1b70:8288:a0a9::1 2001:1b70:8288:a060::2 SCTP 142 INIT Frame 15: 142 bytes on wire (1136 bits), 142 bytes captured (1136 bits) Ethernet II, Src: Ericsson_0e:15:32 (00:80:37:0e:15:32), Dst: Ericsson_0e:19:32 (00:80:37:0e:19:32) Internet Protocol Version 6, Src: 2001:1b70:8288:a0a9::1 (2001:1b70:8288:a0a9::1), Dst: 2001:1b70:8288:a060::2 (2001:1b70:8288:a060::2) Stream Control Transmission Protocol, Src Port: 29118 (29118), Dst Port: 29118 (29118) Source port: 29118 Destination port: 29118 Verification tag: 0x00000000 [Assocation index: 0] Checksum: 0xb4aefc98 [correct CRC32C] INIT chunk (Outbound streams: 17, inbound streams: 17) Chunk type: INIT (1) Chunk flags: 0x00 Chunk length: 74 Initiate tag: 0x1e71dd46 Advertised receiver window credit (a_rwnd): 32768 Number of outbound streams: 17 Number of inbound streams: 17 Initial TSN: 510778694 IPv6 address parameter (Address: 2001:1b70:8288:a0a9::1) IPv6 address parameter (Address: 2001:1b70:8288:a20e::1) Cookie preservative parameter (Increment :0 msec) Supported address types parameter (Supported types: IPv6) Chunk padding: 0000 No. Time Source Destination Protocol Length Info 16 4.287127 2001:1b70:8288:a060::2 2001:1b70:8288:a0a9::1 SCTP 350 INIT_ACK Frame 16: 350 bytes on wire (2800 bits), 350 bytes captured (2800 bits) Ethernet II, Src: Cisco_37:90:00 (00:22:bd:37:90:00), Dst: Ericsson_0e:15:32 (00:80:37:0e:15:32) Internet Protocol Version 6, Src: 2001:1b70:8288:a060::2 (2001:1b70:8288:a060::2), Dst: 2001:1b70:8288:a0a9::1 (2001:1b70:8288:a0a9::1) Stream Control Transmission Protocol, Src Port: 29118 (29118), Dst Port: 29118 (29118) Source port: 29118 Destination port: 29118 Verification tag: 0x1e71dd46 [Assocation index: 0] Checksum: 0xb78979da [correct CRC32C] INIT_ACK chunk (Outbound streams: 10, inbound streams: 17) Chunk type: INIT_ACK (2) Chunk flags: 0x00 Chunk length: 284 Initiate tag: 0xc30434de Advertised receiver window credit (a_rwnd): 200000 Number of outbound streams: 10 Number of inbound streams: 17 Initial TSN: 1056723666 State cookie parameter (Cookie length: 260 bytes) No. Time Source Destination Protocol Length Info 17 4.287193 2001:1b70:8288:a0a9::1 2001:1b70:8288:a060::2 SCTP 330 COOKIE_ECHO Frame 17: 330 bytes on wire (2640 bits), 330 bytes captured (2640 bits) Ethernet II, Src: Ericsson_0e:15:32 (00:80:37:0e:15:32), Dst: Ericsson_0e:19:32 (00:80:37:0e:19:32) Internet Protocol Version 6, Src: 2001:1b70:8288:a0a9::1 (2001:1b70:8288:a0a9::1), Dst: 2001:1b70:8288:a060::2 (2001:1b70:8288:a060::2) Stream Control Transmission Protocol, Src Port: 29118 (29118), Dst Port: 29118 (29118) Source port: 29118 Destination port: 29118 Verification tag: 0xc30434de [Assocation index: 0] Checksum: 0xaf869bee [correct CRC32C] COOKIE_ECHO chunk (Cookie length: 260 bytes) Chunk type: COOKIE_ECHO (10) Chunk flags: 0x00 Chunk length: 264 Cookie: 7213c3065f6ded4744dd76b474d058e20000000000000000... No. Time Source Destination Protocol Length Info 18 4.287275 2001:1b70:8288:a060::2 2001:1b70:8288:a0a9::1 SCTP 70 COOKIE_ACK Frame 18: 70 bytes on wire (560 bits), 70 bytes captured (560 bits) Ethernet II, Src: Cisco_37:90:00 (00:22:bd:37:90:00), Dst: Ericsson_0e:15:32 (00:80:37:0e:15:32) Internet Protocol Version 6, Src: 2001:1b70:8288:a060::2 (2001:1b70:8288:a060::2), Dst: 2001:1b70:8288:a0a9::1 (2001:1b70:8288:a0a9::1) Stream Control Transmission Protocol, Src Port: 29118 (29118), Dst Port: 29118 (29118) Source port: 29118 Destination port: 29118 Verification tag: 0x1e71dd46 [Assocation index: 0] Checksum: 0x0e168b07 [correct CRC32C] COOKIE_ACK chunk Chunk type: COOKIE_ACK (11) Chunk flags: 0x00 Chunk length: 4 No. Time Source Destination Protocol Length Info 19 4.287353 2001:1b70:8288:a20e::1 2001:1b70:8288:a060::2 SCTP 146 HEARTBEAT Frame 19: 146 bytes on wire (1168 bits), 146 bytes captured (1168 bits) Ethernet II, Src: Ericsson_0e:15:32 (00:80:37:0e:15:32), Dst: Ericsson_0e:1b:32 (00:80:37:0e:1b:32) Internet Protocol Version 6, Src: 2001:1b70:8288:a20e::1 (2001:1b70:8288:a20e::1), Dst: 2001:1b70:8288:a060::2 (2001:1b70:8288:a060::2) Stream Control Transmission Protocol, Src Port: 29118 (29118), Dst Port: 29118 (29118) Source port: 29118 Destination port: 29118 Verification tag: 0xc30434de [Assocation index: 0] Checksum: 0x1a5a0f5c [correct CRC32C] HEARTBEAT chunk (Information: 76 bytes) Chunk type: HEARTBEAT (4) Chunk flags: 0x00 Chunk length: 80 Heartbeat info parameter (Information: 72 bytes) No. Time Source Destination Protocol Length Info 20 4.287429 2001:1b70:8288:a060::2 2001:1b70:8288:a20e::1 SCTP 146 HEARTBEAT_ACK Frame 20: 146 bytes on wire (1168 bits), 146 bytes captured (1168 bits) Ethernet II, Src: Cisco_37:90:00 (00:22:bd:37:90:00), Dst: Ericsson_0e:15:32 (00:80:37:0e:15:32) Internet Protocol Version 6, Src: 2001:1b70:8288:a060::2 (2001:1b70:8288:a060::2), Dst: 2001:1b70:8288:a20e::1 (2001:1b70:8288:a20e::1) Stream Control Transmission Protocol, Src Port: 29118 (29118), Dst Port: 29118 (29118) Source port: 29118 Destination port: 29118 Verification tag: 0x1e71dd46 [Assocation index: 0] Checksum: 0xe0a8511b [correct CRC32C] HEARTBEAT_ACK chunk (Information: 76 bytes) Chunk type: HEARTBEAT_ACK (5) Chunk flags: 0x00 Chunk length: 80 Heartbeat info parameter (Information: 72 bytes) No. Time Source Destination Protocol Length Info 21 4.343644 2001:1b70:8288:a060::2 2001:1b70:8288:a0a9::1 SCTP 118 HEARTBEAT Frame 21: 118 bytes on wire (944 bits), 118 bytes captured (944 bits) Ethernet II, Src: Cisco_37:90:00 (00:22:bd:37:90:00), Dst: Ericsson_0e:15:32 (00:80:37:0e:15:32) Internet Protocol Version 6, Src: 2001:1b70:8288:a060::2 (2001:1b70:8288:a060::2), Dst: 2001:1b70:8288:a0a9::1 (2001:1b70:8288:a0a9::1) Stream Control Transmission Protocol, Src Port: 29118 (29118), Dst Port: 29118 (29118) Source port: 29118 Destination port: 29118 Verification tag: 0x1e71dd46 [Assocation index: 0] Checksum: 0x5d00d3b2 [correct CRC32C] HEARTBEAT chunk (Information: 48 bytes) Chunk type: HEARTBEAT (4) Chunk flags: 0x00 Chunk length: 52 Heartbeat info parameter (Information: 44 bytes) No. Time Source Destination Protocol Length Info 22 4.343691 2001:1b70:8288:a0a9::1 2001:1b70:8288:a060::2 SCTP 118 HEARTBEAT_ACK Frame 22: 118 bytes on wire (944 bits), 118 bytes captured (944 bits) Ethernet II, Src: Ericsson_0e:15:32 (00:80:37:0e:15:32), Dst: Ericsson_0e:19:32 (00:80:37:0e:19:32) Internet Protocol Version 6, Src: 2001:1b70:8288:a0a9::1 (2001:1b70:8288:a0a9::1), Dst: 2001:1b70:8288:a060::2 (2001:1b70:8288:a060::2) Stream Control Transmission Protocol, Src Port: 29118 (29118), Dst Port: 29118 (29118) Source port: 29118 Destination port: 29118 Verification tag: 0xc30434de [Assocation index: 0] Checksum: 0xf7d5f2d0 [correct CRC32C] HEARTBEAT_ACK chunk (Information: 48 bytes) Chunk type: HEARTBEAT_ACK (5) Chunk flags: 0x00 Chunk length: 52 Heartbeat info parameter (Information: 44 bytes) No. Time Source Destination Protocol Length Info 23 4.445784 2001:1b70:8288:a0a9::1 2001:1b70:8288:a060::2 SGSAP 174 SGsAP-LOCATION-UPDATE-REQUEST Frame 23: 174 bytes on wire (1392 bits), 174 bytes captured (1392 bits) Ethernet II, Src: Ericsson_0e:15:32 (00:80:37:0e:15:32), Dst: Ericsson_0e:19:32 (00:80:37:0e:19:32) Internet Protocol Version 6, Src: 2001:1b70:8288:a0a9::1 (2001:1b70:8288:a0a9::1), Dst: 2001:1b70:8288:a060::2 (2001:1b70:8288:a060::2) Stream Control Transmission Protocol, Src Port: 29118 (29118), Dst Port: 29118 (29118) Source port: 29118 Destination port: 29118 Verification tag: 0xc30434de [Assocation index: 0] Checksum: 0x119e6a6f [correct CRC32C] DATA chunk(ordered, complete segment, TSN: 510778694, SID: 1, SSN: 0, PPID: 0, payload length: 91 bytes) Chunk type: DATA (0) Chunk flags: 0x03 Chunk length: 107 TSN: 510778694 [This TSN was retransmitted 8 times] Stream Identifier: 0x0001 Stream sequence number: 0 Payload protocol identifier: not specified (0) Chunk padding: 00 SGs Application Part (SGsAP) No. Time Source Destination Protocol Length Info 24 4.445886 2001:1b70:8288:a060::2 2001:1b70:8288:a0a9::1 SCTP 82 SACK Frame 24: 82 bytes on wire (656 bits), 82 bytes captured (656 bits) Ethernet II, Src: Cisco_37:90:00 (00:22:bd:37:90:00), Dst: Ericsson_0e:15:32 (00:80:37:0e:15:32) Internet Protocol Version 6, Src: 2001:1b70:8288:a060::2 (2001:1b70:8288:a060::2), Dst: 2001:1b70:8288:a0a9::1 (2001:1b70:8288:a0a9::1) Stream Control Transmission Protocol, Src Port: 29118 (29118), Dst Port: 29118 (29118) Source port: 29118 Destination port: 29118 Verification tag: 0x1e71dd46 [Assocation index: 0] Checksum: 0xb4344ed7 [correct CRC32C] SACK chunk (Cumulative TSN: 510778693, a_rwnd: 200000, gaps: 0, duplicate TSNs: 0) Chunk type: SACK (3) Chunk flags: 0x00 Chunk length: 16 Cumulative TSN ACK: 510778693 Advertised receiver window credit (a_rwnd): 200000 Number of gap acknowledgement blocks: 0 Number of duplicated TSNs: 0 No. Time Source Destination Protocol Length Info 25 4.504540 2001:1b70:8288:a060::2 2001:1b70:8288:a20e::1 SCTP 118 HEARTBEAT Frame 25: 118 bytes on wire (944 bits), 118 bytes captured (944 bits) Ethernet II, Src: Cisco_37:90:00 (00:22:bd:37:90:00), Dst: Ericsson_0e:15:32 (00:80:37:0e:15:32) Internet Protocol Version 6, Src: 2001:1b70:8288:a060::2 (2001:1b70:8288:a060::2), Dst: 2001:1b70:8288:a20e::1 (2001:1b70:8288:a20e::1) Stream Control Transmission Protocol, Src Port: 29118 (29118), Dst Port: 29118 (29118) Source port: 29118 Destination port: 29118 Verification tag: 0x1e71dd46 [Assocation index: 0] Checksum: 0x4113b97c [correct CRC32C] HEARTBEAT chunk (Information: 48 bytes) Chunk type: HEARTBEAT (4) Chunk flags: 0x00 Chunk length: 52 Heartbeat info parameter (Information: 44 bytes) No. Time Source Destination Protocol Length Info 26 4.504587 2001:1b70:8288:a20e::1 2001:1b70:8288:a060::2 SCTP 118 HEARTBEAT_ACK Frame 26: 118 bytes on wire (944 bits), 118 bytes captured (944 bits) Ethernet II, Src: Ericsson_0e:15:32 (00:80:37:0e:15:32), Dst: Ericsson_0e:1b:32 (00:80:37:0e:1b:32) Internet Protocol Version 6, Src: 2001:1b70:8288:a20e::1 (2001:1b70:8288:a20e::1), Dst: 2001:1b70:8288:a060::2 (2001:1b70:8288:a060::2) Stream Control Transmission Protocol, Src Port: 29118 (29118), Dst Port: 29118 (29118) Source port: 29118 Destination port: 29118 Verification tag: 0xc30434de [Assocation index: 0] Checksum: 0xebc6981e [correct CRC32C] HEARTBEAT_ACK chunk (Information: 48 bytes) Chunk type: HEARTBEAT_ACK (5) Chunk flags: 0x00 Chunk length: 52 Heartbeat info parameter (Information: 44 bytes) No. Time Source Destination Protocol Length Info 27 4.646345 2001:1b70:8288:a20e::1 2001:1b70:8288:a060::2 SCTP 174 DATA (retransmission) Frame 27: 174 bytes on wire (1392 bits), 174 bytes captured (1392 bits) Ethernet II, Src: Ericsson_0e:15:32 (00:80:37:0e:15:32), Dst: Ericsson_0e:1b:32 (00:80:37:0e:1b:32) Internet Protocol Version 6, Src: 2001:1b70:8288:a20e::1 (2001:1b70:8288:a20e::1), Dst: 2001:1b70:8288:a060::2 (2001:1b70:8288:a060::2) Stream Control Transmission Protocol, Src Port: 29118 (29118), Dst Port: 29118 (29118) Source port: 29118 Destination port: 29118 Verification tag: 0xc30434de [Assocation index: 0] Checksum: 0x119e6a6f [correct CRC32C] DATA chunk(ordered, complete segment, TSN: 510778694, SID: 1, SSN: 0, PPID: 0, payload length: 91 bytes) Chunk type: DATA (0) Chunk flags: 0x03 Chunk length: 107 TSN: 510778694 [This TSN is a retransmission of one in frame: 23] Stream Identifier: 0x0001 Stream sequence number: 0 Payload protocol identifier: not specified (0) Chunk padding: 00 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: a060_2.pcap Type: application/octet-stream Size: 800778 bytes Desc: a060_2.pcap URL: From ingela.andin@REDACTED Mon Oct 13 11:48:43 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 13 Oct 2014 11:48:43 +0200 Subject: [erlang-questions] SSL inconsistencies in expected return values of 'ssl:connect/2' In-Reply-To: <5434FBF3.5060009@erl.io> References: <543467A3.20009@erl.io> <5434FBF3.5060009@erl.io> Message-ID: Hi! The remaining issues I think comes down to that the server in your example does not have access to all the CA-certificates so it can not build its on chain properly. CA certificates are both used to build the own chain and verify the others chain. This will mean that the server will only send its own cert to the client and not the intermediate CA. TLS specifies that only the ROOT CA may be left out of the chain. However PKIX standard does allow for the user to specify an intermediate certificate to be the trusted anchor. So in the latest erlang ssl application there is a new option partial_chain to handle this. In older version however some partial chains where "accidentally" accepted by default (if all intermediate CAs where specified in cacerts). >From the documentation: *{partial_chain, fun(Chain::[DerCert]) -> {trusted_ca, DerCert} | unknown_ca * Claim an intermediat CA in the chain as trusted. TLS will then perform the public_key:pkix_path_validation/3 with the selected CA as trusted anchor and the rest of the chain. Also your CRL-check does not really check everything specified by the RFC. For now you need to call public_key:pkix_crls_validate/3 in your verify_fun, if you want a proper check. This is a little cumbersome and we are working on creating a better integration of it in ssl. Regards Ingela Erlang/OTP team - Ericsson AB 2014-10-08 10:55 GMT+02:00 Andre Graf : > On 10/08/2014 10:47 AM, Ingela Andin wrote: > > Hi! > > 2014-10-08 0:22 GMT+02:00 Andre Graf : > >> Hi there, >> >> today I wrote a EUnit test suite that should check the SSL connection >> setup to an Erlang SSL server. Although the test cases are pretty simple >> and standard I stumbled upon various inconsistencies when testing >> against different OTP versions (R15B02, R16B03-1,OTP-17.3.1). I thought >> I share my findings. >> >> The different test cases are: >> >> 1. Connect No Client Auth (SUCCESS) >> 2. Connect No Client Auth (FAIL: wrong CA) >> 3. Connect Client Auth (SUCCESS) >> 4. Connect Client Auth (FAIL: no Client Cert provided) >> 5. Connect Client Auth (FAIL: Client Cert expired) >> 6. Connect Client Auth (FAIL: CRL check, Client Cert revoked) >> 7. Connect Client Auth (SUCCESS, CRL check) >> >> Inconsistencies in expected return of 'ssl:connect/2' in test case 2: >> - R15B02: {error,"unknown ca"}} >> - R16B03-1: {error,{tls_alert,"unknown ca"}} >> - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} >> >> > This is part of the documented potential incompatibility that we choose > to do to to improve the quality of the error messages. > > > >> Inconsistencies in expected return of 'ssl:connect/2' in test case 3: >> - R15B02: {ok, Sock} >> - R16B03-1: {ok, Sock} >> - OTP-17.3.1: {error,closed} >> >> > Will try your test case when I get time. Seems strange. > > > >> Inconsistencies in expected return of 'ssl:connect/2' in test case 4: >> - R15B02: {error,esslconnect} >> - R16B03-1: {error,{tls_alert,"handshake failure"}} >> - OTP-17.3.1: {error,{tls_alert,"handshake failure"}} >> >> > This is also part of the documented potential incompatibility that we > choose to do to to improve the quality of the error messages. > > > Inconsistencies in expected return of 'ssl:connect/2' in test case 5: >> - R15B02: {error,"certificate expired"} >> - R16B03-1: {error,{tls_alert,"certificate expired"}} >> - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} >> >> Will try your test case when I get time. Seems strange. > > > Inconsistencies in expected return of 'ssl:connect/2' in test case 6: >> - R15B02: SSL handshake process crashes >> - R16B03-1: {error,{tls_alert,"certificate revoked"}} >> - OTP-17.3.1: {error,closed} >> >> > Alas you can never depend on getting the correct error message an not > {error,closed} as > tcp does note have a delivery guarantee on application level, only on > transport level. > So ssl sends its alert and then closes the socket, and with bad timing > the application may > receive the socket close before it receives the error message data. > > Inconsistencies in expected return of 'ssl:connect/2' in test case 7: >> - R15B02: {ok, Socket} >> - R16B03-1: {ok, Socket} >> - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} >> >> > Will try your test case when I get time. Seems strange. > > > Regards Ingela Erlang/OTP team - Ericsson AB > > > No inconsistencies in test case 1. :) >> >> The code is available on https://github.com/dergraf/erlang_ssl_tester. >> >> Cheers, >> Andr? >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > Hello Ingela, > > Thanks for your reply. Please let me know if you need any help with the > test case. The tests should pass on R16B03-1, just run 'rebar eunit'. > > Cheers, > Andr? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erik.h.hoogeveen@REDACTED Mon Oct 13 12:10:41 2014 From: erik.h.hoogeveen@REDACTED (Erik Hoogeveen) Date: Mon, 13 Oct 2014 12:10:41 +0200 Subject: [erlang-questions] Mnesia clustering script Message-ID: I am trying to automate the procedure for a MongooseIM node to join another node. More precisely I?m trying to automate the procedure described here: https://github.com/esl/MongooseIM/wiki/Cluster-configuration-and-node-management#connecting-nodes I've made a small function that executes the logic to copy the tables and then stop the VM it looks like this: join_cluster_node([Node]) -> io:format("Node: ~p", [Node]), case net_adm:ping(list_to_atom(Node)) of pang -> io:format("Node: ~p is not reachable", [Node]); pong -> connect_node(list_to_atom(Node)) end, init:stop(). connect_node(OtherNode) -> mnesia:start(), {ok, [OtherNode]} = mnesia:change_config(extra_db_nodes, [OtherNode]), mnesia:change_table_copy_type(schema, node(), disc_copies), Result = [mnesia:add_table_copy(Tab, node(), ram_copies) || Tab <- [ acl, config, iq_response, local_config, node, route, s2s, session, sql_pool, component, offline_jingle, presence_subscription]], stopped = mnesia:stop(). I invoke this bit of code like this: erts-6.1/bin/erlexec -boot releases/start_clean -mode embedded -config etc/app.config -args_file etc/vm.args -noshell -run admin join_cluster_node mongooseim@REDACTED ? console_clean This is run before the node starts for the first time. When ran it works for the most part. Everything works fine except that the connecting node doesn?t write the Mnesia.mongooseim@REDACTED folder. So when the connecting node starts it still thinks it?s all alone in the universe. As shown by amnesia info: running db nodes = ['mongooseim@REDACTED'] stopped db nodes = [] The node that was being connected into did get the changes but it thinks the new node is still down: running db nodes = ['mongooseim@REDACTED'] stopped db nodes = ['mongooseim@REDACTED'] It seems to me that amnesia can?t write out it?s changes in time before the VM stops. But I?m completely at a loss as to why this happens. When I perform the whole operation manually from the shell it seems to work just fine. I?m kind of new at this does anybody have some suggestions that could be helpfull please? Thanks, Erik Hoogeveen From dmkolesnikov@REDACTED Mon Oct 13 12:52:09 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 13 Oct 2014 13:52:09 +0300 Subject: [erlang-questions] Mnesia clustering script In-Reply-To: References: Message-ID: Hello, connect_node(OtherNode) stops mnesia application at last line. Best Regards, Dmitry >-|-|-(*> > On 13 Oct 2014, at 13:10, Erik Hoogeveen wrote: > > I am trying to automate the procedure for a MongooseIM node to join another node. More precisely I?m trying to automate the procedure described here: https://github.com/esl/MongooseIM/wiki/Cluster-configuration-and-node-management#connecting-nodes > > I've made a small function that executes the logic to copy the tables and then stop the VM it looks like this: > > join_cluster_node([Node]) -> > io:format("Node: ~p", [Node]), > case net_adm:ping(list_to_atom(Node)) of > pang -> > io:format("Node: ~p is not reachable", [Node]); > pong -> > connect_node(list_to_atom(Node)) > end, > init:stop(). > > connect_node(OtherNode) -> > mnesia:start(), > {ok, [OtherNode]} = mnesia:change_config(extra_db_nodes, [OtherNode]), > mnesia:change_table_copy_type(schema, node(), disc_copies), > Result = [mnesia:add_table_copy(Tab, node(), ram_copies) || > Tab <- [ > acl, > config, > iq_response, > local_config, > node, > route, > s2s, > session, > sql_pool, > component, > offline_jingle, > presence_subscription]], > stopped = mnesia:stop(). > > > I invoke this bit of code like this: > > erts-6.1/bin/erlexec -boot releases/start_clean -mode embedded -config etc/app.config -args_file etc/vm.args -noshell -run admin join_cluster_node mongooseim@REDACTED ? console_clean > > This is run before the node starts for the first time. > > When ran it works for the most part. Everything works fine except that the connecting node doesn?t write the Mnesia.mongooseim@REDACTED folder. > > So when the connecting node starts it still thinks it?s all alone in the universe. As shown by amnesia info: > running db nodes = ['mongooseim@REDACTED'] > stopped db nodes = [] > > The node that was being connected into did get the changes but it thinks the new node is still down: > running db nodes = ['mongooseim@REDACTED'] > stopped db nodes = ['mongooseim@REDACTED'] > > It seems to me that amnesia can?t write out it?s changes in time before the VM stops. But I?m completely at a loss as to why this happens. When I perform the whole operation manually from the shell it seems to work just fine. I?m kind of new at this does anybody have some suggestions that could be helpfull please? > > Thanks, > Erik Hoogeveen > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From erik.h.hoogeveen@REDACTED Mon Oct 13 13:44:19 2014 From: erik.h.hoogeveen@REDACTED (Erik Hoogeveen) Date: Mon, 13 Oct 2014 13:44:19 +0200 Subject: [erlang-questions] Mnesia clustering script In-Reply-To: References: Message-ID: <99F76687-B8BC-4716-9522-EED5B52B198D@gmail.com> Hello Dmitry, Yes it does, I was hoping that mnesia does a sort of flush to disk on a clean shut down. It doesn?t matter much I figured, seeing that once the connect_node function returns in join_cluster_node it kills the VM which would ultimately also stop mnesia. The whole point of the script is to just do the one time setup required for mnesia nothing else. Cheers, Erik On 13 Oct 2014, at 12:52, Dmitry Kolesnikov wrote: > Hello, > > connect_node(OtherNode) stops mnesia application at last line. > > Best Regards, > Dmitry >> -|-|-(*> > >> On 13 Oct 2014, at 13:10, Erik Hoogeveen wrote: >> >> I am trying to automate the procedure for a MongooseIM node to join another node. More precisely I?m trying to automate the procedure described here: https://github.com/esl/MongooseIM/wiki/Cluster-configuration-and-node-management#connecting-nodes >> >> I've made a small function that executes the logic to copy the tables and then stop the VM it looks like this: >> >> join_cluster_node([Node]) -> >> io:format("Node: ~p", [Node]), >> case net_adm:ping(list_to_atom(Node)) of >> pang -> >> io:format("Node: ~p is not reachable", [Node]); >> pong -> >> connect_node(list_to_atom(Node)) >> end, >> init:stop(). >> >> connect_node(OtherNode) -> >> mnesia:start(), >> {ok, [OtherNode]} = mnesia:change_config(extra_db_nodes, [OtherNode]), >> mnesia:change_table_copy_type(schema, node(), disc_copies), >> Result = [mnesia:add_table_copy(Tab, node(), ram_copies) || >> Tab <- [ >> acl, >> config, >> iq_response, >> local_config, >> node, >> route, >> s2s, >> session, >> sql_pool, >> component, >> offline_jingle, >> presence_subscription]], >> stopped = mnesia:stop(). >> >> >> I invoke this bit of code like this: >> >> erts-6.1/bin/erlexec -boot releases/start_clean -mode embedded -config etc/app.config -args_file etc/vm.args -noshell -run admin join_cluster_node mongooseim@REDACTED ? console_clean >> >> This is run before the node starts for the first time. >> >> When ran it works for the most part. Everything works fine except that the connecting node doesn?t write the Mnesia.mongooseim@REDACTED folder. >> >> So when the connecting node starts it still thinks it?s all alone in the universe. As shown by amnesia info: >> running db nodes = ['mongooseim@REDACTED'] >> stopped db nodes = [] >> >> The node that was being connected into did get the changes but it thinks the new node is still down: >> running db nodes = ['mongooseim@REDACTED'] >> stopped db nodes = ['mongooseim@REDACTED'] >> >> It seems to me that amnesia can?t write out it?s changes in time before the VM stops. But I?m completely at a loss as to why this happens. When I perform the whole operation manually from the shell it seems to work just fine. I?m kind of new at this does anybody have some suggestions that could be helpfull please? >> >> Thanks, >> Erik Hoogeveen >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From richard.youngkin@REDACTED Mon Oct 13 16:08:41 2014 From: richard.youngkin@REDACTED (Youngkin, Rich) Date: Mon, 13 Oct 2014 08:08:41 -0600 Subject: [erlang-questions] Unable to create Mnesia table In-Reply-To: References: Message-ID: Thanks, everyone, for the responses. This is all helpful. Regarding what happens if I stop mnesia, create the schema, and restart mnesia - this was how I finally diagnosed what the problem was. IMO this is a hack that I will replace with one of the other techniques mentioned by others. I'm still pondering all this given that there are several nodes sharing the schema. Thanks again, Rich On Sat, Oct 11, 2014 at 1:30 AM, Dan Gudmundsson wrote: > > On Sat, Oct 11, 2014 at 2:48 AM, T Ty wrote: > >> The whole lets-create-schema-on-first-start-up-if-it-is-not-there is not >> worth the aggravation IMHO. Personally I would create the schema as a >> post-condition to installation or pre-condition to starting the >> application. >> > > That is the intention. > > Or otherwise do a test and create everything dynamically, an empty ram > schema is always created if nothing on disc is found. > > Use mnesia:change_table_copy_type(schema, node(), disc_copies). to convert > it. > > I believe (long time since I did this) you can even use > mnesia:add_table_copy(schema, OtherNode, disc_copies) for the nodes that > will start later. > > Create your tables with your distribution configuration. > > But do this only ONCE, mnesia will not accept/merge schemas > created/modifed from different nodes. > > And when starting the empty 'OtherNode ' use the extra_db_nodes config > param to initiate mnesia connection > to the 'Nodes' with a valid schema. > > > /Dan > > >> >> On Fri, Oct 10, 2014 at 8:51 PM, Youngkin, Rich < >> richard.youngkin@REDACTED> wrote: >> >>> Just in case it's helpful to anyone... I've discovered the error of my >>> ways (but I'm still looking towards a solution). This application used to >>> start Mnesia directly after creating the schema (only on the initial >>> startup of course). When creating the release I changed this by adding the >>> mnesia application to the {applications, [...]} tuple in the app.src file. >>> I did this to fix another problem caused by the Mnesia beam files not being >>> included as part of the Erlang distro created by relx. So in the release >>> version, Mnesia is up and running before the schema is created. So I end up >>> with a started Mnesia application without a schema, which of course is >>> needed to define tables. >>> >>> So now on the my next question, how can I get the schema initialized if >>> Mnesia is started prior to schema creation? Some guy who gives crappy >>> answers :) had this post in StackOverflow that gave a partial answer - >>> http://stackoverflow.com/questions/14083367/mnesia-doesnt-restart-with-supervisor. >>> Is this really the preferred way of doing this? Seems like a bit of a hack >>> to me (but I'm still a newbie, what do I know :>). >>> >>> Cheers, >>> Rich >>> >>> On Wed, Oct 8, 2014 at 8:33 AM, Youngkin, Rich < >>> richard.youngkin@REDACTED> wrote: >>> >>>> Hi all, >>>> >>>> I recently converted an existing application to a release using relx. >>>> After that the application isn't able to create any Mnesia tables. I can't >>>> reproduce the problem in the Erlang shell (except by creating the table >>>> before creating the schema). This is confusing because the app code creates >>>> the schema prior to creating the table. >>>> >>>> Here is the error: >>>> 12:20:18.929 [info] Creating a new schema from scratch... >>>> 12:20:18.929 [info] Mnesia started, creating tables... >>>> 12:20:18.929 [info] Attempting to create table with TableDef >>>> {pe_properties,{disc_copies,[{attributes,[key,value]},{record_name,pe_kvpair}]}} >>>> 12:20:18.931 [error] gen_server pe_membership terminated with reason: >>>> bad return value: >>>> {error,{unable_to_init_schema,{aborted,{bad_type,pe_properties,disc_copies,' >>>> prospero@REDACTED'}}}} >>>> >>>> >>>> Here's the associated application code: >>>> >>>> error_logger:info_msg("Creating a new schema from scratch...~n"), >>>> >>>> %% TODO: TEMP WORKAROUND TO DEBUG MNESIA SCHEMA CREATION PROBLEM >>>> >>>> application:set_env(mnesia, dir, "/var/data/prospero"), >>>> >>>> mnesia:create_schema([node()]), >>>> >>>> mnesia:start(), >>>> >>>> error_logger:info_msg("Mnesia started, creating tables...", []), >>>> >>>> case create_tables(pe_migrate:get_schema()) of >>>> >>>> >>>> The line application:set_env(...) was added in case the Mnesia >>>> directory wasn't getting created properly due to the move to a relx-built >>>> release. I had a similar entry in vm.args that I may have gotten wrong >>>> (-mnesia dir '"/var/data/prospero"'). Interestingly enough, I don't see any >>>> artifacts associated with the schema creation in the Mnesia dir (e.g., >>>> schema.DAT). I'm wondering if this is a clue as to what the cause is. >>>> >>>> pe_migrate:get_schema()) returns a list of TableDefs. create_tables >>>> iterates through that list creating the tables one at a time. The failure >>>> occurs when attempting to create the first table. >>>> >>>> Thanks, Rich >>>> >>> >>> >>> _______________________________________________ >>> 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 boikot@REDACTED Mon Oct 13 16:23:59 2014 From: boikot@REDACTED (Gonzalo Serrano) Date: Mon, 13 Oct 2014 16:23:59 +0200 Subject: [erlang-questions] How to build web chat in Erlang? In-Reply-To: <87tx39v8s7.fsf@gmx.net> References: <87k34ay63o.fsf@gmx.net> <87bnpmxzz9.fsf@gmx.net> <871tqek7eq.fsf@gmx.net> <87tx39v8s7.fsf@gmx.net> Message-ID: Hi, At SocialPoint we implemented a custom chat using Cowboy and Secure Web Sockets (wss) [1] to avoid proxy filtering from 3G/4G companies and we are quite happy about the performance/results. Cheers, Gonzalo. [1] http://ninenines.eu/docs/en/cowboy/HEAD/guide/ws_handlers/ On Sun, Oct 12, 2014 at 1:15 PM, Rainer Hansen wrote: > Maxim Sokhatsky writes: > > > It?s ok. Everything is fine. > > If you want pretty pages try synrc/skyline instead n2o_sample. > > > > -- > > Maxim Sokhatsky > Hi Maxim, > > thanks for the hint for the other demo. > > I have tested your skyline demo on my local server and on your web page: > > http://skyline.synrc.com/chat > > I get the same problems as before. If I lock the screen on my Android > mobile with Firefox browser 32.0.3 for 2 minutes and after that type > some chat message again, the message is send but the page viewed in the > mobile browser is not updated. This problem is the same as I have had > with the n2o sample page. I see it as a major problem for mobile > chatting. Do you know of any workaround? > > Rainer > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean@REDACTED Mon Oct 13 18:00:01 2014 From: sean@REDACTED (Functional Jobs) Date: Mon, 13 Oct 2014 12:00:01 -0400 Subject: [erlang-questions] New Functional Programming Job Opportunities Message-ID: <543bf7061e0c3@functionaljobs.com> Here are some functional programming job opportunities that were posted recently: Software Engineer / Developer at Clutch Analytics/ Windhaven Insurance http://functionaljobs.com/jobs/8753-software-engineer-developer-at-clutch-analytics-windhaven-insurance DevOps Engineer at Clutch Analytics/ Windhaven Insurance http://functionaljobs.com/jobs/8751-devops-engineer-at-clutch-analytics-windhaven-insurance Cheers, Sean Murphy FunctionalJobs.com From cole.fichter@REDACTED Mon Oct 13 21:04:28 2014 From: cole.fichter@REDACTED (Cole Fichter) Date: Mon, 13 Oct 2014 13:04:28 -0600 Subject: [erlang-questions] Erlang ODBC Tips In-Reply-To: References: Message-ID: Ah, thanks! I've fixed the string issue. My experience with Erlang has mostly been on Windows (as you might be able to tell from the guide). Do you know if others use ODBC on different platforms? I had kind of assumed there were better libraries to connect to, say, MySQL than ODBC. Cheers, Cole On 13 October 2014 00:26, Ola B?ckstr?m wrote: > Nice! > > > > I?d suggest you to rename ?64-Bit/32-Bit Architecture Mismatch? by adding > ?? in Windows?. > > Also there?s some typo: ?Canada? - it should be a string. > > > > /Ola > > > > *From:* erlang-questions-bounces@REDACTED [mailto: > erlang-questions-bounces@REDACTED] *On Behalf Of *Cole Fichter > *Sent:* den 11 oktober 2014 20:23 > *To:* erlang-questions@REDACTED > *Subject:* [erlang-questions] Erlang ODBC Tips > > > > Hi everyone, > > > > There isn't a lot of helpful information available about using ODBC to > connect to SQL from Erlang, so I've written a short field guide with > helpful advice and tips: > > > > http://erlang-odbc-tips.colefichter.ca/ > > > > I hope this helps others in the future, and would appreciate any feedback > you can provide. > > > > > > Cheers, > > > > Cole Fichter > -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Mon Oct 13 22:26:24 2014 From: z@REDACTED (Danil Zagoskin) Date: Tue, 14 Oct 2014 00:26:24 +0400 Subject: [erlang-questions] Supervisor child stuck in 'restarting' state In-Reply-To: References: Message-ID: Bump? Bond of supervisor+timer with rather fresh code fails to build fault-tolerant system under unclear circumstances. Was there bug in erts causing message loss or timer callback failing to be called? May user code which does not kill the timer server affect a running supervisor in this way? Which part of system should I watch more carefully to investigate a problem? On Wed, Oct 8, 2014 at 12:52 AM, Danil Zagoskin wrote: > Hello! > > We have an application (well, it's some patched old ejabberd fork) running > on OTP R16B (no digits after "B"). > > On one of our clusters sometimes appears a strange problem with supervisor > ? a child does not restart after crash (one_for_one strategy): > > Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:16:16] [async-threads:10] > [hipe] [kernel-poll:false] > (ejabberd@REDACTED)1> f(State), f(Children), State = hd([S || {data, Data} > <- lists:nth(5, element(4, sys:get_status(ejabberd_listeners))), {"State", > S} <- Data]), Children = element(4, State), lists:keyfind(5223, 3, > Children). > {child,{restarting,<0.17921.2571>}, > 5223, > {ejabberd_listener,start, > [5223,ejabberd_c2s, > [{access,c2s}, > {max_stanza_size,262144}, > {sasl_mechs,[]}, > {non_sasl_meths,[]}, > zlib,tls, ....]]}, > permanent,brutal_kill,worker, > [ejabberd_listener]} > > Inspecting supervisor code gave a way to actually restart the child ? > supervisor:try_again_restart/2 works well when called from REPL. > As supervisor:restart/2 code says, try_again_restart is scheduled > using timer:apply_after after a failed start attempt (just where > 'restarting' tag appears). So it seems like lost event in timer server. > > Git showed no changes in this part of supervisor code since R16B to > current maint branch. > There are no considerable changes in timer module either. > > Also it's quite strange to me that other clusters (with other mods loaded > but with a similar config of this supervisor) do not suffer of this problem. > > > How do I avoid such problem or how can I get more information on it? > > -- > Danil Zagoskin | z@REDACTED > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From shapovalovts@REDACTED Tue Oct 14 08:33:32 2014 From: shapovalovts@REDACTED (Shapovalov Taras) Date: Tue, 14 Oct 2014 10:33:32 +0400 Subject: [erlang-questions] How to control a table version in Mnesia? Message-ID: Hi guys, Do you know if there is a safe way to increment a table version (in Mnesia schema) with some value (>1) or just set its value into a particular version? In my case Mnesia runs only in a local mode (and will never be distributed) and as far as I understand the version is not really used in the local mode, so I would like to utilize it for my purposes. By some reason mnesia_lib:set() does not really work for me. In fact after I call that function and then request the table version, it seems it is changed, but ets:tab2list(schema) shows that it did not (and after I restart Mnesia, the requested version returns to the old value). Best regards, Taras -------------- next part -------------- An HTML attachment was scrubbed... URL: From Ola.Backstrom@REDACTED Tue Oct 14 09:00:50 2014 From: Ola.Backstrom@REDACTED (=?utf-8?B?T2xhIELDpGNrc3Ryw7Zt?=) Date: Tue, 14 Oct 2014 07:00:50 +0000 Subject: [erlang-questions] Erlang ODBC Tips In-Reply-To: References: Message-ID: The odbc module included in Erlang/OTP can be used in Linux in conjunction with the Microsoft Linux odbc driver. I know it can be used to query an MS SQL server (running under Windows). /Ola From: Cole Fichter [mailto:cole.fichter@REDACTED] Sent: den 13 oktober 2014 21:04 To: Ola B?ckstr?m Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] Erlang ODBC Tips Ah, thanks! I've fixed the string issue. My experience with Erlang has mostly been on Windows (as you might be able to tell from the guide). Do you know if others use ODBC on different platforms? I had kind of assumed there were better libraries to connect to, say, MySQL than ODBC. Cheers, Cole On 13 October 2014 00:26, Ola B?ckstr?m > wrote: Nice! I?d suggest you to rename ?64-Bit/32-Bit Architecture Mismatch? by adding ?? in Windows?. Also there?s some typo: ?Canada? - it should be a string. /Ola From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Cole Fichter Sent: den 11 oktober 2014 20:23 To: erlang-questions@REDACTED Subject: [erlang-questions] Erlang ODBC Tips Hi everyone, There isn't a lot of helpful information available about using ODBC to connect to SQL from Erlang, so I've written a short field guide with helpful advice and tips: http://erlang-odbc-tips.colefichter.ca/ I hope this helps others in the future, and would appreciate any feedback you can provide. Cheers, Cole Fichter -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Tue Oct 14 09:10:40 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Tue, 14 Oct 2014 10:10:40 +0300 Subject: [erlang-questions] How to control a table version in Mnesia? In-Reply-To: References: Message-ID: Hello, You can use user_properties features of amnesia tables if you need some version for accounting. mnesia:create_table(myt, [{user_properties, [{vsn, 1}]}]). amnesia:table_info(myt, user_properties). [{vsn,1}] - Dmitry On 14 Oct 2014, at 09:33, Shapovalov Taras wrote: > Hi guys, > > Do you know if there is a safe way to increment a table version (in Mnesia schema) with some value (>1) or just set its value into a particular version? In my case Mnesia runs only in a local mode (and will never be distributed) and as far as I understand the version is not really used in the local mode, so I would like to utilize it for my purposes. > > By some reason mnesia_lib:set() does not really work for me. In fact after I call that function and then request the table version, it seems it is changed, but ets:tab2list(schema) shows that it did not (and after I restart Mnesia, the requested version returns to the old value). > > Best regards, > > Taras > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From shapovalovts@REDACTED Tue Oct 14 10:12:33 2014 From: shapovalovts@REDACTED (Shapovalov Taras) Date: Tue, 14 Oct 2014 12:12:33 +0400 Subject: [erlang-questions] How to control a table version in Mnesia? In-Reply-To: References: Message-ID: Thank you, Dmitry, The disadvantage of user_properties in my case is it is not auto-incremented by Mnesia upon table definition change (this feature would be useful for me). Best regards, Taras On Tue, Oct 14, 2014 at 11:10 AM, Dmitry Kolesnikov wrote: > Hello, > > You can use user_properties features of amnesia tables if you need some > version for accounting. > > mnesia:create_table(myt, [{user_properties, [{vsn, 1}]}]). > amnesia:table_info(myt, user_properties). > [{vsn,1}] > > > - Dmitry > > On 14 Oct 2014, at 09:33, Shapovalov Taras wrote: > > > Hi guys, > > > > Do you know if there is a safe way to increment a table version (in > Mnesia schema) with some value (>1) or just set its value into a particular > version? In my case Mnesia runs only in a local mode (and will never be > distributed) and as far as I understand the version is not really used in > the local mode, so I would like to utilize it for my purposes. > > > > By some reason mnesia_lib:set() does not really work for me. In fact > after I call that function and then request the table version, it seems it > is changed, but ets:tab2list(schema) shows that it did not (and after I > restart Mnesia, the requested version returns to the old value). > > > > Best regards, > > > > Taras > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -- /T -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Tue Oct 14 11:48:44 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Tue, 14 Oct 2014 12:48:44 +0300 Subject: [erlang-questions] How to control a table version in Mnesia? In-Reply-To: References: Message-ID: <8B787F7B-4C30-480C-9049-6CC0A9934645@gmail.com> Hello, Indeed auto-increments is use-full. You can subscribe to schema table events: mnesia:subscribe({table, schema, detailed}). It gives you ability to trace changes and manipulate you custom version. Best Regards, Dmitry On 14 Oct 2014, at 11:12, Shapovalov Taras wrote: > Thank you, Dmitry, > > The disadvantage of user_properties in my case is it is not auto-incremented by Mnesia upon table definition change (this feature would be useful for me). > > Best regards, > > Taras > > On Tue, Oct 14, 2014 at 11:10 AM, Dmitry Kolesnikov wrote: > Hello, > > You can use user_properties features of amnesia tables if you need some version for accounting. > > mnesia:create_table(myt, [{user_properties, [{vsn, 1}]}]). > amnesia:table_info(myt, user_properties). > [{vsn,1}] > > > - Dmitry > > On 14 Oct 2014, at 09:33, Shapovalov Taras wrote: > > > Hi guys, > > > > Do you know if there is a safe way to increment a table version (in Mnesia schema) with some value (>1) or just set its value into a particular version? In my case Mnesia runs only in a local mode (and will never be distributed) and as far as I understand the version is not really used in the local mode, so I would like to utilize it for my purposes. > > > > By some reason mnesia_lib:set() does not really work for me. In fact after I call that function and then request the table version, it seems it is changed, but ets:tab2list(schema) shows that it did not (and after I restart Mnesia, the requested version returns to the old value). > > > > Best regards, > > > > Taras > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -- > /T -------------- next part -------------- An HTML attachment was scrubbed... URL: From elbrujohalcon@REDACTED Tue Oct 14 15:18:57 2014 From: elbrujohalcon@REDACTED (Brujo Benavides @ Inaka) Date: Tue, 14 Oct 2014 10:18:57 -0300 Subject: [erlang-questions] [ANN] ErlangBA Meetup #2 Message-ID: <3DEA5FC0-4C5D-4309-9D2D-3AC31FC061BD@inaka.net> All, We're doing it again!! On November 10th we'll host a new Erlang BA Meetup in Inaka's offices at Villa Crespo! This time ?lvaro Videla , a Developer Advocate for RabbitMQ/Pivotal and co-author of RabbitMQ in Action (Manning Publishing), is visiting us. He is going to speak about RabbitMQ Internal Architecture. And for those who are willing to start learning Erlang, we'll also have Brujo Benavides (Inaka's CTO) speaking about FiaR, a simple but complete introductory project to get your hands on some real Erlang code. Please come to our office in Villa Crespo on Monday, November 10th at 7 pm to hear from ?lvaro and Brujo and have some beers! We have limited space. Please register at http://bit.ly/erlangba2 . Cheers!! Fernando "Brujo" Benavides about.me/elbrujohalcon -------------- next part -------------- An HTML attachment was scrubbed... URL: From garry@REDACTED Tue Oct 14 16:22:58 2014 From: garry@REDACTED (Garry Hodgson) Date: Tue, 14 Oct 2014 10:22:58 -0400 Subject: [erlang-questions] Erlang ODBC Tips In-Reply-To: References: Message-ID: <543D31C2.80301@research.att.com> we've had to use it on linux to talk to databases on windows platforms. it wasn't fun. On 10/13/14 3:04 PM, Cole Fichter wrote: > Ah, thanks! I've fixed the string issue. > > My experience with Erlang has mostly been on Windows (as you might be > able to tell from the guide). Do you know if others use ODBC on > different platforms? I had kind of assumed there were better libraries > to connect to, say, MySQL than ODBC. > > > Cheers, > > Cole > > On 13 October 2014 00:26, Ola B?ckstr?m > wrote: > > Nice! > > I'd suggest you to rename "64-Bit/32-Bit Architecture Mismatch" by > adding "... in Windows". > > Also there's some typo: 'Canada' - it should be a string. > > /Ola > > *From:*erlang-questions-bounces@REDACTED > > [mailto:erlang-questions-bounces@REDACTED > ] *On Behalf Of *Cole > Fichter > *Sent:* den 11 oktober 2014 20:23 > *To:* erlang-questions@REDACTED > *Subject:* [erlang-questions] Erlang ODBC Tips > > Hi everyone, > > There isn't a lot of helpful information available about using > ODBC to connect to SQL from Erlang, so I've written a short field > guide with helpful advice and tips: > > http://erlang-odbc-tips.colefichter.ca/ > > I hope this helps others in the future, and would appreciate any > feedback you can provide. > > Cheers, > > Cole Fichter > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Tue Oct 14 17:24:47 2014 From: g@REDACTED (Garrett Smith) Date: Tue, 14 Oct 2014 10:24:47 -0500 Subject: [erlang-questions] Erlang ODBC Tips In-Reply-To: <543D31C2.80301@research.att.com> References: <543D31C2.80301@research.att.com> Message-ID: I saw Linux <-> Windows + SQL Server over ODBC working the other week. Like seeing a snipe! [1] [1] http://en.wikipedia.org/wiki/Snipe_hunt On Tue, Oct 14, 2014 at 9:22 AM, Garry Hodgson wrote: > we've had to use it on linux to talk to databases on windows platforms. > it wasn't fun. > > On 10/13/14 3:04 PM, Cole Fichter wrote: > > Ah, thanks! I've fixed the string issue. > > My experience with Erlang has mostly been on Windows (as you might be able > to tell from the guide). Do you know if others use ODBC on different > platforms? I had kind of assumed there were better libraries to connect to, > say, MySQL than ODBC. > > > Cheers, > > Cole > > On 13 October 2014 00:26, Ola B?ckstr?m wrote: >> >> Nice! >> >> >> >> I?d suggest you to rename ?64-Bit/32-Bit Architecture Mismatch? by adding >> ?? in Windows?. >> >> Also there?s some typo: ?Canada? - it should be a string. >> >> >> >> /Ola >> >> >> >> From: erlang-questions-bounces@REDACTED >> [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Cole Fichter >> Sent: den 11 oktober 2014 20:23 >> To: erlang-questions@REDACTED >> Subject: [erlang-questions] Erlang ODBC Tips >> >> >> >> Hi everyone, >> >> >> >> There isn't a lot of helpful information available about using ODBC to >> connect to SQL from Erlang, so I've written a short field guide with helpful >> advice and tips: >> >> >> >> http://erlang-odbc-tips.colefichter.ca/ >> >> >> >> I hope this helps others in the future, and would appreciate any feedback >> you can provide. >> >> >> >> >> >> Cheers, >> >> >> >> Cole Fichter > > > > > _______________________________________________ > 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 curtis@REDACTED Wed Oct 15 02:20:52 2014 From: curtis@REDACTED (Curtis J Schofield (ram9)) Date: Tue, 14 Oct 2014 17:20:52 -0700 Subject: [erlang-questions] OTP Worker Supervision Message-ID: Hi - I'm a beginner and am requesting feedback on some code I wrote. I haven't been able to deduce 'the otp way' to build a worker process. ( this worker generates some garbage and puts it into rabbitmq) I have been able to create a simple application with a supervisor and spawn and link a child process. I feel like I have 'hacked' it and would like to hear what the ideomatic way of this is. https://github.com/robotarmy/amqresearch/blob/master/send/src/sender_sup.erl https://github.com/robotarmy/amqresearch/blob/master/send/src/sender_worker.erl Feedback on my code would be appreciated. -- --- Modern Yoga vs Traditional Yoga http://swamij.com/traditional-yoga.htm#swamirama From vances@REDACTED Wed Oct 15 06:34:07 2014 From: vances@REDACTED (Vance Shipley) Date: Wed, 15 Oct 2014 10:04:07 +0530 Subject: [erlang-questions] OTP Worker Supervision In-Reply-To: References: Message-ID: On Wed, Oct 15, 2014 at 5:50 AM, Curtis J Schofield (ram9) wrote: > > I have been able to create a simple application with a supervisor and spawn > and link a child process. I feel like I have 'hacked' it and would > like to hear what the ideomatic way of this is. > > init([]) -> {ok, Pid} = sender_worker:boot_send(), link(Pid), Pids = [], {ok, {{one_for_one, 1, 5}, Pids}}. The supervisor behaviour encapsulates process creation and linking. All you need to do is specify the process to create in a child specification: {Id, StartFunc, Restart, Shutdown, Type, Modules} So just: init([]) -> StartMod = sender_worker, ChildSpec = {StartMod, {StartMod, boot_send, []}, temporary, 4, worker, [StartMod]}, {ok, {{one_for_one, 1, 5}, [ChildSpec]}}. -- -Vance On Wed, Oct 15, 2014 at 5:50 AM, Curtis J Schofield (ram9) wrote: > Hi - I'm a beginner and am requesting feedback on some code I wrote. > > I haven't been able to deduce 'the otp way' to build a worker process. > ( this worker generates some garbage and puts it into rabbitmq) > > I have been able to create a simple application with a supervisor and spawn > and link a child process. I feel like I have 'hacked' it and would > like to hear what the ideomatic way of this is. > > > > https://github.com/robotarmy/amqresearch/blob/master/send/src/sender_sup.erl > > > https://github.com/robotarmy/amqresearch/blob/master/send/src/sender_worker.erl > > > Feedback on my code would be appreciated. > > > -- > --- > Modern Yoga vs Traditional Yoga > http://swamij.com/traditional-yoga.htm#swamirama > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- -- -Vance -------------- next part -------------- An HTML attachment was scrubbed... URL: From shapovalovts@REDACTED Wed Oct 15 08:24:32 2014 From: shapovalovts@REDACTED (Shapovalov Taras) Date: Wed, 15 Oct 2014 10:24:32 +0400 Subject: [erlang-questions] How to control a table version in Mnesia? In-Reply-To: <8B787F7B-4C30-480C-9049-6CC0A9934645@gmail.com> References: <8B787F7B-4C30-480C-9049-6CC0A9934645@gmail.com> Message-ID: Thank you, Dmitry for the idea, this solves my problem. Best regards, Taras On Tue, Oct 14, 2014 at 1:48 PM, Dmitry Kolesnikov wrote: > Hello, > > Indeed auto-increments is use-full. > > You can subscribe to schema table events: > mnesia:subscribe({table, schema, detailed}). > > It gives you ability to trace changes and manipulate you custom version. > > Best Regards, > Dmitry > > On 14 Oct 2014, at 11:12, Shapovalov Taras wrote: > > Thank you, Dmitry, > > The disadvantage of user_properties in my case is it is not > auto-incremented by Mnesia upon table definition change (this feature would > be useful for me). > > Best regards, > > Taras > > On Tue, Oct 14, 2014 at 11:10 AM, Dmitry Kolesnikov < > dmkolesnikov@REDACTED> wrote: > >> Hello, >> >> You can use user_properties features of amnesia tables if you need some >> version for accounting. >> >> mnesia:create_table(myt, [{user_properties, [{vsn, 1}]}]). >> amnesia:table_info(myt, user_properties). >> [{vsn,1}] >> >> >> - Dmitry >> >> On 14 Oct 2014, at 09:33, Shapovalov Taras >> wrote: >> >> > Hi guys, >> > >> > Do you know if there is a safe way to increment a table version (in >> Mnesia schema) with some value (>1) or just set its value into a particular >> version? In my case Mnesia runs only in a local mode (and will never be >> distributed) and as far as I understand the version is not really used in >> the local mode, so I would like to utilize it for my purposes. >> > >> > By some reason mnesia_lib:set() does not really work for me. In fact >> after I call that function and then request the table version, it seems it >> is changed, but ets:tab2list(schema) shows that it did not (and after I >> restart Mnesia, the requested version returns to the old value). >> > >> > Best regards, >> > >> > Taras >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> >> > > > -- > /T > > > -- /T -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenji@REDACTED Wed Oct 15 11:10:30 2014 From: kenji@REDACTED (Kenji Rikitake) Date: Wed, 15 Oct 2014 18:10:30 +0900 Subject: [erlang-questions] Removing SSL v3 support from the ssl module Message-ID: <20141015091030.GA52663@k2r.org> I'd be glad if how to remove SSL v3 support from OTP ssl module is provided by the OTP Team, to prevent getting trapped into the POODLE bug. (I think it won't be that hard, regarding what I've found from the ssl module source code. The keyword atom is "sslv3".) Regards, Kenji Rikitake From essen@REDACTED Wed Oct 15 11:19:35 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Wed, 15 Oct 2014 11:19:35 +0200 Subject: [erlang-questions] Removing SSL v3 support from the ssl module In-Reply-To: <20141015091030.GA52663@k2r.org> References: <20141015091030.GA52663@k2r.org> Message-ID: <543E3C27.4060904@ninenines.eu> You can specify the protocols the connection will use when connecting/listening. I doubt an entire removal is interesting (some enterprise systems might require it yada yada), however a patch to the docs giving detailed information about it should be good. Also probably shouldn't be enabled by default anymore. On 10/15/2014 11:10 AM, Kenji Rikitake wrote: > I'd be glad if how to remove SSL v3 support from OTP ssl module is > provided by the OTP Team, to prevent getting trapped into the POODLE > bug. (I think it won't be that hard, regarding what I've found from the > ssl module source code. The keyword atom is "sslv3".) > > Regards, > Kenji Rikitake > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From aschultz@REDACTED Wed Oct 15 11:34:56 2014 From: aschultz@REDACTED (Andreas Schultz) Date: Wed, 15 Oct 2014 09:34:56 +0000 (UTC) Subject: [erlang-questions] Removing SSL v3 support from the ssl module In-Reply-To: <2082371859.74860.1413365676640.JavaMail.zimbra@tpip.net> References: <20141015091030.GA52663@k2r.org> Message-ID: <368069533.74861.1413365696097.JavaMail.zimbra@tpip.net> Hi, ----- On 15 Oct, 2014, at 11:10, Kenji Rikitake kenji@REDACTED wrote: > I'd be glad if how to remove SSL v3 support from OTP ssl module is > provided by the OTP Team, to prevent getting trapped into the POODLE > bug. (I think it won't be that hard, regarding what I've found from the > ssl module source code. The keyword atom is "sslv3".) Add {versions, ['tlsv1.2', 'tls1.1', 'tls1']} to your SSL options to restrict the version choice. Erlang R17 does im implement RFC 5746 TLS_EMPTY_RENEGOTIATION_INFO_SCSV, but the draft-ietf-tls-downgrade-scsv-00 TLS_FALLBACK_SCSV that protects from POODLE is not supported. Andreas > > Regards, > Kenji Rikitake > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- -- Dipl. Inform. Andreas Schultz email: as@REDACTED phone: +49-391-819099-224 mobil: +49-170-2226073 ------------------- enabling your networks ------------------- Travelping GmbH phone: +49-391-819099229 Roentgenstr. 13 fax: +49-391-819099299 D-39108 Magdeburg email: info@REDACTED GERMANY web: http://www.travelping.com Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 -------------------------------------------------------------- From rainer.hansen@REDACTED Wed Oct 15 12:40:46 2014 From: rainer.hansen@REDACTED (Rainer Hansen) Date: Wed, 15 Oct 2014 12:40:46 +0200 Subject: [erlang-questions] How to build web chat in Erlang? References: <87k34ay63o.fsf@gmx.net> <87bnpmxzz9.fsf@gmx.net> Message-ID: <87d29t62fl.fsf@gmx.net> Jesse Gumm writes: > Thanks for the heads up. There are some auto-reconnection > capabilities built into Nitrogen, but they are a little nasty and > undocumented and this particular page does not use them. I'm working > to improve this in the upcoming 2.3 release (Which should be ready in > the next couple of weeks). > > I'll do some playing around tonight and shoot you an email off-list > tonight or tomorrow. > > -Jesse Jesse, thanks a lot for your awesome work. After your updates everything is working fine. :-) For all interested, this is what you can do to test the updated version: 1) git clone git://github.com/choptastic/NitrogenProject.com.git --branch tests 2) cd NitrogenProject.com 3) make && make run 4) Go with your web browser to http://localhost:8000/demos/comet2 Regards, Rainer > > > > On Wed, Oct 8, 2014 at 11:55 AM, Rainer Hansen wrote: >> >> Jesse Gumm writes: >> >>> Hi Rainer, >>> >>> Nitrogen has a pretty simple chat example: >>> http://nitrogenproject.com/demos/comet2 >>> >>> (see the "View Source" link to see the code that makes that page >>> work). Changing that page to use multiple chat rooms is about 5-6 more >>> lines of code. >>> >>> Alternatively, you could look into Chicago Boss (go through the >>> tutorial, and the ways of building a chat system with it should become >>> rather clear). >>> >>> Anyway, good luck! >>> >>> -- >>> Jesse Gumm >>> Owner, Sigma Star Systems >>> 414.940.4866 || sigma-star.com || @jessegumm >> >> >> Hi Jesse, >> >> thanks for the fast answer and the link to the chat demo. It works great >> in the desktop browser (Firefox) but on my smartphone browser (also >> Firefox) I seem to get trouble with timeouts. My smartphone is not >> constantly connected to the Internet and this seems to cause some >> trouble. I can still post and others on the same page see the post but >> nothing is updated in my mobile browser window. I can also not see the >> updates of others after the connection is once interrupted. >> >> Any ideas on how to improve the Nitrogen example to handle this situation? >> >> I will also take a look at the Chicago Boss tutorial ... >> >> Rainer >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From gumm@REDACTED Wed Oct 15 13:10:34 2014 From: gumm@REDACTED (Jesse Gumm) Date: Wed, 15 Oct 2014 06:10:34 -0500 Subject: [erlang-questions] How to build web chat in Erlang? In-Reply-To: <87d29t62fl.fsf@gmx.net> References: <87k34ay63o.fsf@gmx.net> <87bnpmxzz9.fsf@gmx.net> <87d29t62fl.fsf@gmx.net> Message-ID: Glad to hear it, Rainer! These autoreconnection changes will be merged into Nitrogen master later this week. -- Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm On Oct 15, 2014 5:41 AM, "Rainer Hansen" wrote: > Jesse Gumm writes: > > > Thanks for the heads up. There are some auto-reconnection > > capabilities built into Nitrogen, but they are a little nasty and > > undocumented and this particular page does not use them. I'm working > > to improve this in the upcoming 2.3 release (Which should be ready in > > the next couple of weeks). > > > > I'll do some playing around tonight and shoot you an email off-list > > tonight or tomorrow. > > > > -Jesse > Jesse, > > thanks a lot for your awesome work. After your updates everything is > working fine. :-) > > For all interested, this is what you can do to test the updated version: > > 1) git clone git://github.com/choptastic/NitrogenProject.com.git --branch > tests > > 2) cd NitrogenProject.com > > 3) make && make run > > 4) Go with your web browser to http://localhost:8000/demos/comet2 > > Regards, > Rainer > > > > > > > > > On Wed, Oct 8, 2014 at 11:55 AM, Rainer Hansen > wrote: > >> > >> Jesse Gumm writes: > >> > >>> Hi Rainer, > >>> > >>> Nitrogen has a pretty simple chat example: > >>> http://nitrogenproject.com/demos/comet2 > >>> > >>> (see the "View Source" link to see the code that makes that page > >>> work). Changing that page to use multiple chat rooms is about 5-6 more > >>> lines of code. > >>> > >>> Alternatively, you could look into Chicago Boss (go through the > >>> tutorial, and the ways of building a chat system with it should become > >>> rather clear). > >>> > >>> Anyway, good luck! > >>> > >>> -- > >>> Jesse Gumm > >>> Owner, Sigma Star Systems > >>> 414.940.4866 || sigma-star.com || @jessegumm > >> > >> > >> Hi Jesse, > >> > >> thanks for the fast answer and the link to the chat demo. It works great > >> in the desktop browser (Firefox) but on my smartphone browser (also > >> Firefox) I seem to get trouble with timeouts. My smartphone is not > >> constantly connected to the Internet and this seems to cause some > >> trouble. I can still post and others on the same page see the post but > >> nothing is updated in my mobile browser window. I can also not see the > >> updates of others after the connection is once interrupted. > >> > >> Any ideas on how to improve the Nitrogen example to handle this > situation? > >> > >> I will also take a look at the Chicago Boss tutorial ... > >> > >> Rainer > >> > >> _______________________________________________ > >> 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 roger@REDACTED Wed Oct 15 14:09:28 2014 From: roger@REDACTED (Roger Lipscombe) Date: Wed, 15 Oct 2014 13:09:28 +0100 Subject: [erlang-questions] Removing SSL v3 support from the ssl module In-Reply-To: <368069533.74861.1413365696097.JavaMail.zimbra@tpip.net> References: <20141015091030.GA52663@k2r.org> <2082371859.74860.1413365676640.JavaMail.zimbra@tpip.net> <368069533.74861.1413365696097.JavaMail.zimbra@tpip.net> Message-ID: On 15 October 2014 10:34, Andreas Schultz wrote: > Add {versions, ['tlsv1.2', 'tls1.1', 'tls1']} to your SSL options to restrict > the version choice. I think that should be {protocol_version,['tlsv1.2','tlsv1.1',tlsv1]}. From roger@REDACTED Wed Oct 15 14:13:04 2014 From: roger@REDACTED (Roger Lipscombe) Date: Wed, 15 Oct 2014 13:13:04 +0100 Subject: [erlang-questions] Removing SSL v3 support from the ssl module In-Reply-To: References: <20141015091030.GA52663@k2r.org> <2082371859.74860.1413365676640.JavaMail.zimbra@tpip.net> <368069533.74861.1413365696097.JavaMail.zimbra@tpip.net> Message-ID: On 15 October 2014 13:09, Roger Lipscombe wrote: > On 15 October 2014 10:34, Andreas Schultz wrote: >> Add {versions, ['tlsv1.2', 'tls1.1', 'tls1']} to your SSL options to restrict >> the version choice. > > I think that should be {protocol_version,['tlsv1.2','tlsv1.1',tlsv1]}. My bad. It's 'versions' in the ssloption() type, but 'protocol_version' in application:set_env. Confusing. From davidnwelton@REDACTED Wed Oct 15 15:37:13 2014 From: davidnwelton@REDACTED (David Welton) Date: Wed, 15 Oct 2014 15:37:13 +0200 Subject: [erlang-questions] missing LD_LIBRARY_PATH Message-ID: Maybe it's the fuzzy headed feeling from a cold, but this is causing me to scratch my head: less /proc/31960/environ SHLVL=3^@LD_LIBRARY_PATH=/opt/foo_web/erts-6.2/lib:/opt/foo_web/erts-6.2/lib:^@OLDPWD=/opt/foo_web^@HOME=/home/foo^@XDG_SESSION_COOKIE=f40ea8cef2068cadd3692765531447e7-1418295886.152876-1882385673^@SSH_TTY=/dev/pts/0^@FOO_JOYSTICK_EXEC=/opt/fooo/bin/gsd-joy3d As you can see, LD_LIBRARY_PATH is present. However, when I connect to that process, and do os:getenv(), it does not show LD_LIBRARY_PATH. Likewise, os:getenv("LD_LIBRARY_PATH") returns false. Any idea what might be going on? I've been grepping around for clearenv or putenv or other things that could mess with that, but so far without success. Thank you, -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From fly@REDACTED Wed Oct 15 16:12:12 2014 From: fly@REDACTED (Fred Youhanaie) Date: Wed, 15 Oct 2014 15:12:12 +0100 Subject: [erlang-questions] missing LD_LIBRARY_PATH In-Reply-To: References: Message-ID: <543E80BC.506@anydata.co.uk> out of interest, does os:getenv() give you LD_LIBRARY_PATH in the list? and as a long shot :-() does os:getpid() give you 31960? HTH cheers Fred On 15/10/14 14:37, David Welton wrote: > Maybe it's the fuzzy headed feeling from a cold, but this is causing > me to scratch my head: > > less /proc/31960/environ > > SHLVL=3^@LD_LIBRARY_PATH=/opt/foo_web/erts-6.2/lib:/opt/foo_web/erts-6.2/lib:^@OLDPWD=/opt/foo_web^@HOME=/home/foo^@XDG_SESSION_COOKIE=f40ea8cef2068cadd3692765531447e7-1418295886.152876-1882385673^@SSH_TTY=/dev/pts/0^@FOO_JOYSTICK_EXEC=/opt/fooo/bin/gsd-joy3d > > As you can see, LD_LIBRARY_PATH is present. > > However, when I connect to that process, and do os:getenv(), it does > not show LD_LIBRARY_PATH. Likewise, os:getenv("LD_LIBRARY_PATH") > returns false. > > Any idea what might be going on? I've been grepping around for > clearenv or putenv or other things that could mess with that, but so > far without success. > > Thank you, > From davidnwelton@REDACTED Wed Oct 15 16:21:15 2014 From: davidnwelton@REDACTED (David Welton) Date: Wed, 15 Oct 2014 16:21:15 +0200 Subject: [erlang-questions] missing LD_LIBRARY_PATH In-Reply-To: <543E80BC.506@anydata.co.uk> References: <543E80BC.506@anydata.co.uk> Message-ID: Hi, > out of interest, does os:getenv() give you LD_LIBRARY_PATH in the list? No, it doesn't. > and as a long shot :-() does os:getpid() give you 31960? Yeah... -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From jon@REDACTED Wed Oct 15 16:25:28 2014 From: jon@REDACTED (Jon Schneider) Date: Wed, 15 Oct 2014 15:25:28 +0100 Subject: [erlang-questions] missing LD_LIBRARY_PATH In-Reply-To: References: <543E80BC.506@anydata.co.uk> Message-ID: <6c920615e385fe6f4b07f46f1f40ce60.squirrel@mail.jschneider.net> setuid is one way I can think of for this environment variable to be clobbered though would have thought this would be reflected in the /proc view but maybe it's done in a more hackey way. Jon > Hi, > >> out of interest, does os:getenv() give you LD_LIBRARY_PATH in the list? > > No, it doesn't. > >> and as a long shot :-() does os:getpid() give you 31960? > > Yeah... > > -- > David N. Welton > > http://www.welton.it/davidw/ > > http://www.dedasys.com/ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > From davidnwelton@REDACTED Wed Oct 15 16:43:12 2014 From: davidnwelton@REDACTED (David Welton) Date: Wed, 15 Oct 2014 16:43:12 +0200 Subject: [erlang-questions] missing LD_LIBRARY_PATH In-Reply-To: <6c920615e385fe6f4b07f46f1f40ce60.squirrel@mail.jschneider.net> References: <543E80BC.506@anydata.co.uk> <6c920615e385fe6f4b07f46f1f40ce60.squirrel@mail.jschneider.net> Message-ID: Good guess! I was just writing to say I'd figured out that it's the "setcap" we use on Linux to let Erlang listen on port 80. That was a nasty one to figure out. Now we get to decide what to do... find another way to port 80, another place for the libs, or something else. Thank you! On Wed, Oct 15, 2014 at 4:25 PM, Jon Schneider wrote: > setuid is one way I can think of for this environment variable to be > clobbered though would have thought this would be reflected in the /proc > view but maybe it's done in a more hackey way. > > Jon > >> Hi, >> >>> out of interest, does os:getenv() give you LD_LIBRARY_PATH in the list? >> >> No, it doesn't. >> >>> and as a long shot :-() does os:getpid() give you 31960? >> >> Yeah... >> >> -- >> David N. Welton >> >> http://www.welton.it/davidw/ >> >> http://www.dedasys.com/ >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From steve@REDACTED Wed Oct 15 17:06:39 2014 From: steve@REDACTED (Steve Strong) Date: Wed, 15 Oct 2014 17:06:39 +0200 Subject: [erlang-questions] missing LD_LIBRARY_PATH In-Reply-To: References: <543E80BC.506@anydata.co.uk> <6c920615e385fe6f4b07f46f1f40ce60.squirrel@mail.jschneider.net> Message-ID: <1B7E6AC4-6738-454E-A9C0-8BD0002AB6DA@srstrong.com> We tend to use iptables to get access to privileged ports; saves messing with process permissions which always causes problems like this Sent from my iPhone > On 15 Oct 2014, at 16:43, David Welton wrote: > > Good guess! I was just writing to say I'd figured out that it's the > "setcap" we use on Linux to let Erlang listen on port 80. > > That was a nasty one to figure out. > > Now we get to decide what to do... find another way to port 80, > another place for the libs, or something else. > > Thank you! > >> On Wed, Oct 15, 2014 at 4:25 PM, Jon Schneider wrote: >> setuid is one way I can think of for this environment variable to be >> clobbered though would have thought this would be reflected in the /proc >> view but maybe it's done in a more hackey way. >> >> Jon >> >>> Hi, >>> >>>> out of interest, does os:getenv() give you LD_LIBRARY_PATH in the list? >>> >>> No, it doesn't. >>> >>>> and as a long shot :-() does os:getpid() give you 31960? >>> >>> Yeah... >>> >>> -- >>> David N. Welton >>> >>> http://www.welton.it/davidw/ >>> >>> http://www.dedasys.com/ >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > David N. Welton > > http://www.welton.it/davidw/ > > http://www.dedasys.com/ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From curtis@REDACTED Wed Oct 15 17:32:16 2014 From: curtis@REDACTED (Curtis J Schofield (ram9)) Date: Wed, 15 Oct 2014 08:32:16 -0700 Subject: [erlang-questions] OTP Worker Supervision In-Reply-To: References: Message-ID: Thank you Vance. That does indeed work - I think I want 'permanent' so that the worker comes back if the application crashes - is it as simple as that? My question about ChildSpec is about 'Module' and the erlang docs. >From the erlang docs: "Modules is used by the release handler during code replacement to determine which processes are using a certain module. As a rule of thumb Modules should be a list with one element [Module], where Module is the callback module, if the child process is a supervisor, gen_server or gen_fsm." My 'sender_worker' is just a module - it is not a supervisor, gen_server or gen_fsm. Is there some specific interface that the module function 'boot_send' needs to conform to - or is returning {ok, Pid} what it needs to do? On Tue, Oct 14, 2014 at 9:34 PM, Vance Shipley wrote: > > On Wed, Oct 15, 2014 at 5:50 AM, Curtis J Schofield (ram9) > wrote: >> >> I have been able to create a simple application with a supervisor and >> spawn >> and link a child process. I feel like I have 'hacked' it and would >> like to hear what the ideomatic way of this is. >> > init([]) -> > {ok, Pid} = sender_worker:boot_send(), > link(Pid), > Pids = [], > {ok, {{one_for_one, 1, 5}, Pids}}. > > The supervisor behaviour encapsulates process creation and linking. All you > need to do is specify the process to create in a child specification: > > {Id, StartFunc, Restart, Shutdown, Type, Modules} > > So just: > > init([]) -> > StartMod = sender_worker, > ChildSpec = {StartMod, {StartMod, boot_send, []}, temporary, 4, > worker, [StartMod]}, > {ok, {{one_for_one, 1, 5}, [ChildSpec]}}. > > -- > -Vance > > On Wed, Oct 15, 2014 at 5:50 AM, Curtis J Schofield (ram9) > wrote: >> >> Hi - I'm a beginner and am requesting feedback on some code I wrote. >> >> I haven't been able to deduce 'the otp way' to build a worker process. >> ( this worker generates some garbage and puts it into rabbitmq) >> >> I have been able to create a simple application with a supervisor and >> spawn >> and link a child process. I feel like I have 'hacked' it and would >> like to hear what the ideomatic way of this is. >> >> >> >> https://github.com/robotarmy/amqresearch/blob/master/send/src/sender_sup.erl >> >> >> https://github.com/robotarmy/amqresearch/blob/master/send/src/sender_worker.erl >> >> >> Feedback on my code would be appreciated. >> >> >> -- >> --- >> Modern Yoga vs Traditional Yoga >> http://swamij.com/traditional-yoga.htm#swamirama >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > > > -- > -- > -Vance -- --- Modern Yoga vs Traditional Yoga http://swamij.com/traditional-yoga.htm#swamirama From grahamrhay@REDACTED Wed Oct 15 17:47:20 2014 From: grahamrhay@REDACTED (Graham Hay) Date: Wed, 15 Oct 2014 16:47:20 +0100 Subject: [erlang-questions] OTP Worker Supervision In-Reply-To: References: Message-ID: http://learnyousomeerlang.com/supervisors On 15 October 2014 16:32, Curtis J Schofield (ram9) wrote: > Thank you Vance. That does indeed work - I think I want 'permanent' so > that the worker comes back if the application crashes - is it as > simple as that? > > My question about ChildSpec is about 'Module' and the erlang docs. > > From the erlang docs: > "Modules is used by the release handler during code replacement to > determine which processes are using a certain module. As a rule of > thumb Modules should be a list with one element [Module], where Module > is the callback module, if the child process is a supervisor, > gen_server or gen_fsm." > > My 'sender_worker' is just a module - it is not a supervisor, > gen_server or gen_fsm. Is there some specific interface that the > module function 'boot_send' needs to conform to - or is returning {ok, > Pid} what it needs to do? > > > > On Tue, Oct 14, 2014 at 9:34 PM, Vance Shipley wrote: > > > > On Wed, Oct 15, 2014 at 5:50 AM, Curtis J Schofield (ram9) > > > wrote: > >> > >> I have been able to create a simple application with a supervisor and > >> spawn > >> and link a child process. I feel like I have 'hacked' it and would > >> like to hear what the ideomatic way of this is. > >> > > init([]) -> > > {ok, Pid} = sender_worker:boot_send(), > > link(Pid), > > Pids = [], > > {ok, {{one_for_one, 1, 5}, Pids}}. > > > > The supervisor behaviour encapsulates process creation and linking. All > you > > need to do is specify the process to create in a child specification: > > > > {Id, StartFunc, Restart, Shutdown, Type, Modules} > > > > So just: > > > > init([]) -> > > StartMod = sender_worker, > > ChildSpec = {StartMod, {StartMod, boot_send, []}, temporary, 4, > > worker, [StartMod]}, > > {ok, {{one_for_one, 1, 5}, [ChildSpec]}}. > > > > -- > > -Vance > > > > On Wed, Oct 15, 2014 at 5:50 AM, Curtis J Schofield (ram9) > > > wrote: > >> > >> Hi - I'm a beginner and am requesting feedback on some code I wrote. > >> > >> I haven't been able to deduce 'the otp way' to build a worker process. > >> ( this worker generates some garbage and puts it into rabbitmq) > >> > >> I have been able to create a simple application with a supervisor and > >> spawn > >> and link a child process. I feel like I have 'hacked' it and would > >> like to hear what the ideomatic way of this is. > >> > >> > >> > >> > https://github.com/robotarmy/amqresearch/blob/master/send/src/sender_sup.erl > >> > >> > >> > https://github.com/robotarmy/amqresearch/blob/master/send/src/sender_worker.erl > >> > >> > >> Feedback on my code would be appreciated. > >> > >> > >> -- > >> --- > >> Modern Yoga vs Traditional Yoga > >> http://swamij.com/traditional-yoga.htm#swamirama > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > -- > > -- > > -Vance > > > > -- > --- > Modern Yoga vs Traditional Yoga > http://swamij.com/traditional-yoga.htm#swamirama > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From grahamrhay@REDACTED Wed Oct 15 18:08:54 2014 From: grahamrhay@REDACTED (Graham Hay) Date: Wed, 15 Oct 2014 17:08:54 +0100 Subject: [erlang-questions] OTP Worker Supervision In-Reply-To: References: Message-ID: Sorry, that wasn't meant to be a put down. It contains the answer to your other question though (what "permanent" means). As for the second question, try it and see :) On 15 October 2014 17:04, Curtis J Schofield (ram9) wrote: > Thank you Graham. > > I have read this page - in the example it uses a 'gen_server' for the > module - which still leaves me with my above question. I'm not sure > what you are trying to communicate with this webpage. > > Learn You Some Erlang has been a helpful resource. > > For example from the page: > "StartFunc is a tuple that tells how to start the supervisor. It's the > standard {M,F,A} format we've used a few times already. Note that it > is very important that the starting function here is OTP-compliant and > links to its caller when executed (hint: use gen_*:start_link() > wrapped in your own module, all the time)." > > > for example > > https://github.com/robotarmy/amqresearch/blob/master/send/src/sender_worker.erl > > What I am trying to learn is how to make sure that my function 'F' > boot_send() is correctly compliant, or my module is correctly > compliant. > > > On Wed, Oct 15, 2014 at 8:47 AM, Graham Hay wrote: > > http://learnyousomeerlang.com/supervisors > > > > On 15 October 2014 16:32, Curtis J Schofield (ram9) > wrote: > >> > >> Thank you Vance. That does indeed work - I think I want 'permanent' so > >> that the worker comes back if the application crashes - is it as > >> simple as that? > >> > >> My question about ChildSpec is about 'Module' and the erlang docs. > >> > >> From the erlang docs: > >> "Modules is used by the release handler during code replacement to > >> determine which processes are using a certain module. As a rule of > >> thumb Modules should be a list with one element [Module], where Module > >> is the callback module, if the child process is a supervisor, > >> gen_server or gen_fsm." > >> > >> My 'sender_worker' is just a module - it is not a supervisor, > >> gen_server or gen_fsm. Is there some specific interface that the > >> module function 'boot_send' needs to conform to - or is returning {ok, > >> Pid} what it needs to do? > >> > >> > >> > >> On Tue, Oct 14, 2014 at 9:34 PM, Vance Shipley > wrote: > >> > > >> > On Wed, Oct 15, 2014 at 5:50 AM, Curtis J Schofield (ram9) > >> > > >> > wrote: > >> >> > >> >> I have been able to create a simple application with a supervisor and > >> >> spawn > >> >> and link a child process. I feel like I have 'hacked' it and would > >> >> like to hear what the ideomatic way of this is. > >> >> > >> > init([]) -> > >> > {ok, Pid} = sender_worker:boot_send(), > >> > link(Pid), > >> > Pids = [], > >> > {ok, {{one_for_one, 1, 5}, Pids}}. > >> > > >> > The supervisor behaviour encapsulates process creation and linking. > All > >> > you > >> > need to do is specify the process to create in a child specification: > >> > > >> > {Id, StartFunc, Restart, Shutdown, Type, Modules} > >> > > >> > So just: > >> > > >> > init([]) -> > >> > StartMod = sender_worker, > >> > ChildSpec = {StartMod, {StartMod, boot_send, []}, temporary, > >> > 4, > >> > worker, [StartMod]}, > >> > {ok, {{one_for_one, 1, 5}, [ChildSpec]}}. > >> > > >> > -- > >> > -Vance > >> > > >> > On Wed, Oct 15, 2014 at 5:50 AM, Curtis J Schofield (ram9) > >> > > >> > wrote: > >> >> > >> >> Hi - I'm a beginner and am requesting feedback on some code I wrote. > >> >> > >> >> I haven't been able to deduce 'the otp way' to build a worker > process. > >> >> ( this worker generates some garbage and puts it into rabbitmq) > >> >> > >> >> I have been able to create a simple application with a supervisor and > >> >> spawn > >> >> and link a child process. I feel like I have 'hacked' it and would > >> >> like to hear what the ideomatic way of this is. > >> >> > >> >> > >> >> > >> >> > >> >> > https://github.com/robotarmy/amqresearch/blob/master/send/src/sender_sup.erl > >> >> > >> >> > >> >> > >> >> > https://github.com/robotarmy/amqresearch/blob/master/send/src/sender_worker.erl > >> >> > >> >> > >> >> Feedback on my code would be appreciated. > >> >> > >> >> > >> >> -- > >> >> --- > >> >> Modern Yoga vs Traditional Yoga > >> >> http://swamij.com/traditional-yoga.htm#swamirama > >> >> _______________________________________________ > >> >> erlang-questions mailing list > >> >> erlang-questions@REDACTED > >> >> http://erlang.org/mailman/listinfo/erlang-questions > >> > > >> > > >> > > >> > > >> > -- > >> > -- > >> > -Vance > >> > >> > >> > >> -- > >> --- > >> Modern Yoga vs Traditional Yoga > >> http://swamij.com/traditional-yoga.htm#swamirama > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > -- > --- > Modern Yoga vs Traditional Yoga > http://swamij.com/traditional-yoga.htm#swamirama > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Wed Oct 15 20:04:44 2014 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Wed, 15 Oct 2014 14:04:44 -0400 Subject: [erlang-questions] Rebar: application dependencies in local file system Message-ID: <72120F0D-70F7-4016-A241-63378C3B34C7@writersglen.com> Hello, How do I specify in rebar.config that I want an application dependency located in my local file system? Thanks, LRP Sent from my iPad From a.shneyderman@REDACTED Wed Oct 15 20:31:42 2014 From: a.shneyderman@REDACTED (Alex Shneyderman) Date: Wed, 15 Oct 2014 14:31:42 -0400 Subject: [erlang-questions] Rebar: application dependencies in local file system In-Reply-To: <72120F0D-70F7-4016-A241-63378C3B34C7@writersglen.com> References: <72120F0D-70F7-4016-A241-63378C3B34C7@writersglen.com> Message-ID: use {rsync, "file:///home/alex/projects/cowboy"} is the shape of it as far as I recall On Wed, Oct 15, 2014 at 2:04 PM, Lloyd R. Prentice wrote: > Hello, > > How do I specify in rebar.config that I want an application dependency > located in my local file system? > > Thanks, > > LRP > > Sent from my iPad > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erik.sette@REDACTED Wed Oct 15 20:12:26 2014 From: erik.sette@REDACTED (Erik Sette) Date: Wed, 15 Oct 2014 14:12:26 -0400 Subject: [erlang-questions] Rebar: application dependencies in local file system In-Reply-To: <72120F0D-70F7-4016-A241-63378C3B34C7@writersglen.com> References: <72120F0D-70F7-4016-A241-63378C3B34C7@writersglen.com> Message-ID: Hello Lloyd, I use the rsync option and specify the file path. Erik On Wed, Oct 15, 2014 at 2:04 PM, Lloyd R. Prentice wrote: > Hello, > > How do I specify in rebar.config that I want an application dependency > located in my local file system? > > Thanks, > > LRP > > Sent from my iPad > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Wed Oct 15 20:55:08 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Wed, 15 Oct 2014 21:55:08 +0300 Subject: [erlang-questions] Rebar: application dependencies in local file system In-Reply-To: <72120F0D-70F7-4016-A241-63378C3B34C7@writersglen.com> References: <72120F0D-70F7-4016-A241-63378C3B34C7@writersglen.com> Message-ID: Hello, I am assuming that you are using git for your other app {myapp, ".*", {git, "~/devel/erlang/myapp", {branch, master}} } - Dmitry On 15 Oct 2014, at 21:04, Lloyd R. Prentice wrote: > Hello, > > How do I specify in rebar.config that I want an application dependency located in my local file system? > > Thanks, > > LRP > > Sent from my iPad > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From lloyd@REDACTED Wed Oct 15 21:02:59 2014 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Wed, 15 Oct 2014 15:02:59 -0400 Subject: [erlang-questions] Rebar: application dependencies in local file system In-Reply-To: References: <72120F0D-70F7-4016-A241-63378C3B34C7@writersglen.com> Message-ID: Thanks, all. Will give it a shot as soon as sit back down to my workstation. You're the greatest, LRP Sent from my iPad > On Oct 15, 2014, at 2:55 PM, Dmitry Kolesnikov wrote: > > Hello, > > I am assuming that you are using git for your other app > > {myapp, ".*", > {git, "~/devel/erlang/myapp", {branch, master}} > } > > - Dmitry > >> On 15 Oct 2014, at 21:04, Lloyd R. Prentice wrote: >> >> Hello, >> >> How do I specify in rebar.config that I want an application dependency located in my local file system? >> >> Thanks, >> >> LRP >> >> Sent from my iPad >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > From Michael.K.Schmidt@REDACTED Wed Oct 15 21:05:49 2014 From: Michael.K.Schmidt@REDACTED (Michael.K.Schmidt@REDACTED) Date: Wed, 15 Oct 2014 14:05:49 -0500 Subject: [erlang-questions] Execute in Place Message-ID: Hello, I was curious if anyone had tried running Erlang via Execute in Place (ie NOR Flash). The faq mentions running in 16MByte of RAM; Can part of this be Read Only Memory? The idea would be to store the BEAM files themselves in a way that the emulator can directory execute them (but not modify them). A related question is this: When the emulator loads a BEAM file, does it do any kind of transformation? Or is it simply copied into RAM? Any thoughts/concerns/suggestions are greatly appreciated. Thanks! Mike _____________________________________________________________________________________ Michael Schmidt | APC by Schneider Electric | End User Business Group - IT Business | United States | Firmware Engineer Phone: +636-300-2300 ext. 11480 | Fax: +636-300-2333 | Mobile: +636-744-6326 Email: michael.k.schmidt@REDACTED | Site: www.schneider-electric.com | Address: 801 Corporate Centre Drive, O'Fallon, MO 63368 *** Please consider the environment before printing this e-mail From wallentin.dahlberg@REDACTED Wed Oct 15 22:57:58 2014 From: wallentin.dahlberg@REDACTED (=?UTF-8?Q?Bj=C3=B6rn=2DEgil_Dahlberg?=) Date: Wed, 15 Oct 2014 22:57:58 +0200 Subject: [erlang-questions] Execute in Place In-Reply-To: References: Message-ID: 2014-10-15 21:05 GMT+02:00 : > > A related question is this: When the emulator loads a BEAM file, does it > do any kind of transformation? Or is it simply copied into RAM? > Yes, beam files are transformed. See, erts/emulator/beam/ops.tab for transformation rules. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Thu Oct 16 01:41:23 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Wed, 15 Oct 2014 19:41:23 -0400 Subject: [erlang-questions] Removing SSL v3 support from the ssl module In-Reply-To: <368069533.74861.1413365696097.JavaMail.zimbra@tpip.net> References: <20141015091030.GA52663@k2r.org> <2082371859.74860.1413365676640.JavaMail.zimbra@tpip.net> <368069533.74861.1413365696097.JavaMail.zimbra@tpip.net> Message-ID: On Wed, Oct 15, 2014 at 5:34 AM, Andreas Schultz wrote: > Hi, > ----- On 15 Oct, 2014, at 11:10, Kenji Rikitake kenji@REDACTED wrote: > > > I'd be glad if how to remove SSL v3 support from OTP ssl module is > > provided by the OTP Team, to prevent getting trapped into the POODLE > > bug. (I think it won't be that hard, regarding what I've found from the > > ssl module source code. The keyword atom is "sslv3".) > > Add {versions, ['tlsv1.2', 'tls1.1', 'tls1']} to your SSL options to > restrict > the version choice. Slight correction: {versions, ['tlsv1.2', 'tlsv1.1', 'tlsv1']} The 'v' characters were missing from the latter two atoms. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Thu Oct 16 13:11:24 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Thu, 16 Oct 2014 13:11:24 +0200 Subject: [erlang-questions] why the application env is only accepting atoms as Key Message-ID: When trying to upgrade an application, we noticed on a project that the application `env` settings is only accepting atoms as keys: https://github.com/erlang/otp/blob/maint/lib/sasl/src/systools_make.erl#L685-L689 and https://github.com/erlang/otp/blob/maint/lib/sasl/src/systools_make.erl#L2000-L2002 Is there any reason for that? Why not accepting any term there? - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.abrahamsson@REDACTED Thu Oct 16 13:20:08 2014 From: daniel.abrahamsson@REDACTED (Daniel Abrahamsson) Date: Thu, 16 Oct 2014 13:20:08 +0200 Subject: [erlang-questions] why the application env is only accepting atoms as Key In-Reply-To: References: Message-ID: Here is a recent discussion of the matter: http://erlang.org/pipermail/erlang-questions/2014-July/080293.html //Daniel On Thu, Oct 16, 2014 at 1:11 PM, Benoit Chesneau wrote: > When trying to upgrade an application, we noticed on a project that the > application `env` settings is only accepting atoms as keys: > > > https://github.com/erlang/otp/blob/maint/lib/sasl/src/systools_make.erl#L685-L689 > > and > > > https://github.com/erlang/otp/blob/maint/lib/sasl/src/systools_make.erl#L2000-L2002 > > > Is there any reason for that? Why not accepting any term there? > > - benoit > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andra.dinu@REDACTED Thu Oct 16 15:32:43 2014 From: andra.dinu@REDACTED (Andra Dinu) Date: Thu, 16 Oct 2014 15:32:43 +0200 (CEST) Subject: [erlang-questions] Berlin Erlang Factory Lite - 4 December Message-ID: <1040659925.126836.1413466363019.JavaMail.zimbra@erlang-solutions.com> Hi all, The Berlin Erlang Factory Lite is back on 4 December. Speakers include Robert Virding, Jos? Valim, Martin Rehfeld, Brian Troutwine and more. See all speakers here: http://www.erlang-factory.com/berlin2014#speakers Early Bird Ends on 2 November. Ticket are ?85.00+VAT Academic discount of 50% available, please email conferences@REDACTED from your university email account for details. http://www.erlang-factory.com/berlin2014 Best, Andra -- Andra Dinu Community & Social ERLANG SOLUTIONS LTD New Loom House 101 Back Church Lane London, E1 1LU United Kingdom Tel +44(0)2076550344 Mob +44(0)7983484387 www.erlang-solutions.com From garret.smith@REDACTED Fri Oct 17 03:04:44 2014 From: garret.smith@REDACTED (Garret Smith) Date: Thu, 16 Oct 2014 18:04:44 -0700 Subject: [erlang-questions] FreeBSD cpu topology detection Message-ID: CPU topology detection seems broken (at least incomplete) on FreeBSD. erlang:system_info(cpu_topology) returns 'undefined' on the few machines I have at my disposal. I'm going to take a stab at a patch, but I'd like some help from other FreeBSD users out there first. Can any FreeBSD users please send me: a) the output of 'sysctl kern.sched.topology_spec' b) a few lines from your 'dmesg' about the processor configuration like: FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 SMT threads Even if your topology is correctly determined, this info will help me ensure I don't introduce a regression. Thanks, Garret -------------- next part -------------- An HTML attachment was scrubbed... URL: From dch@REDACTED Fri Oct 17 09:53:19 2014 From: dch@REDACTED (Dave Cottlehuber) Date: Fri, 17 Oct 2014 09:53:19 +0200 Subject: [erlang-questions] FreeBSD cpu topology detection In-Reply-To: References: Message-ID: > CPU topology detection seems broken (at least incomplete) on FreeBSD. > erlang:system_info(cpu_topology) returns 'undefined' on the few machines I > have at my disposal. > > I'm going to take a stab at a patch, but I'd like some help from other > FreeBSD users out there first. > > Can any FreeBSD users please send me: > a) the output of 'sysctl kern.sched.topology_spec' > b) a few lines from your 'dmesg' about the processor configuration like: > FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs > FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 SMT threads > > Even if your topology is correctly determined, this info will help me > ensure I don't introduce a regression. > > Thanks, > Garret > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > Eugh, I get the same here. Unfortunately I?ve upgraded everything to 10.1rc2 already so can?t report older. server: https://dpaste.de/9CW9 imac: ?? A+, Dave ? sent from my Couch From raimo+erlang-questions@REDACTED Fri Oct 17 11:09:55 2014 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 17 Oct 2014 11:09:55 +0200 Subject: [erlang-questions] FreeBSD cpu topology detection In-Reply-To: References: Message-ID: <20141017090955.GA17580@erix.ericsson.se> On Thu, Oct 16, 2014 at 06:04:44PM -0700, Garret Smith wrote: > CPU topology detection seems broken (at least incomplete) on FreeBSD. > erlang:system_info(cpu_topology) returns 'undefined' on the few machines I > have at my disposal. > > I'm going to take a stab at a patch, but I'd like some help from other > FreeBSD users out there first. > > Can any FreeBSD users please send me: > a) the output of 'sysctl kern.sched.topology_spec' > b) a few lines from your 'dmesg' about the processor configuration like: > FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs > FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 SMT threads > > Even if your topology is correctly determined, this info will help me > ensure I don't introduce a regression. > > Thanks, > Garret Here are 5 machines, not much variation but anyway... kern.sched.topology_spec: 0, 1, 2, 3, 4, 5, 6, 7 0, 1, 2, 3 4, 5, 6, 7 FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs FreeBSD/SMP: 2 package(s) x 4 core(s) kern.sched.topology_spec: 0, 1, 2, 3 0, 1, 2, 3 FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) kern.sched.topology_spec: 0, 1, 2, 3 0, 1, 2, 3 FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) kern.sched.topology_spec: 0, 1, 2, 3 0, 1, 2, 3 FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) kern.sched.topology_spec: 0, 1 0, 1 FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs FreeBSD/SMP: 1 package(s) x 2 core(s) > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From garret.smith@REDACTED Fri Oct 17 18:34:55 2014 From: garret.smith@REDACTED (Garret Smith) Date: Fri, 17 Oct 2014 09:34:55 -0700 Subject: [erlang-questions] FreeBSD cpu topology detection In-Reply-To: References: Message-ID: On Thu, Oct 16, 2014 at 6:04 PM, Garret Smith wrote: > CPU topology detection seems broken (at least incomplete) on FreeBSD. > erlang:system_info(cpu_topology) returns 'undefined' on the few machines I > have at my disposal. > > I'm going to take a stab at a patch, but I'd like some help from other > FreeBSD users out there first. > > Can any FreeBSD users please send me: > a) the output of 'sysctl kern.sched.topology_spec' > b) a few lines from your 'dmesg' about the processor configuration like: > FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs > FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 SMT threads > > Even if your topology is correctly determined, this info will help me ensure > I don't introduce a regression. > > Thanks, > Garret Thank you to all who sent me information. I now have a good collection of systems with {2, 4, 8} logical processors and {2, 4} cores. Any info on machines with >8 logical processors would be appreciated. No one reported that topology detection worked. -Garret From kaiduanx@REDACTED Fri Oct 17 19:38:21 2014 From: kaiduanx@REDACTED (Kaiduan Xie) Date: Fri, 17 Oct 2014 13:38:21 -0400 Subject: [erlang-questions] Source code for Designing for Scalability with Erlang/OTP Message-ID: Hi, Where is the source code listed in the book? Thanks, /Kaiduan -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.v.romanov@REDACTED Fri Oct 17 19:58:37 2014 From: alexey.v.romanov@REDACTED (Alexey Romanov) Date: Fri, 17 Oct 2014 21:58:37 +0400 Subject: [erlang-questions] Return value of driver_async Message-ID: Documentation for driver_async says it returns a handle to the asynchronous task. However, I can't find any other mentions of these handles in erl_driver or driver_entry docs. What can/should this value be used for? Or should it be ignored? Yours, Alexey Romanov -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Fri Oct 17 20:49:11 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Fri, 17 Oct 2014 14:49:11 -0400 Subject: [erlang-questions] Return value of driver_async In-Reply-To: References: Message-ID: On Fri, Oct 17, 2014 at 1:58 PM, Alexey Romanov wrote: > Documentation for driver_async says it returns a handle to the > asynchronous task. However, I can't find any other mentions of these > handles in erl_driver or driver_entry docs. What can/should this value be > used for? Or should it be ignored? > There was an old function driver_async_cancel() for canceling async jobs that took the handle as an argument, but it was deprecated a long time ago and it's since been removed. So, you can just ignore the handle. I'll see if I can patch the docs to clarify this. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Fri Oct 17 20:52:36 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Fri, 17 Oct 2014 14:52:36 -0400 Subject: [erlang-questions] Source code for Designing for Scalability with Erlang/OTP In-Reply-To: References: Message-ID: On Fri, Oct 17, 2014 at 1:38 PM, Kaiduan Xie wrote: > Hi, > > Where is the source code listed in the book? > The book is still only in early release access and is not yet complete. When it's finally published, I believe the plan is to also make the code available via github. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Fri Oct 17 20:56:57 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Fri, 17 Oct 2014 14:56:57 -0400 Subject: [erlang-questions] Return value of driver_async In-Reply-To: References: Message-ID: On Fri, Oct 17, 2014 at 2:49 PM, Steve Vinoski wrote: > > > On Fri, Oct 17, 2014 at 1:58 PM, Alexey Romanov < > alexey.v.romanov@REDACTED> wrote: > >> Documentation for driver_async says it returns a handle to the >> asynchronous task. However, I can't find any other mentions of these >> handles in erl_driver or driver_entry docs. What can/should this value be >> used for? Or should it be ignored? >> > > There was an old function driver_async_cancel() for canceling async jobs > that took the handle as an argument, but it was deprecated a long time ago > and it's since been removed. So, you can just ignore the handle. I'll see > if I can patch the docs to clarify this. > Correction: you should check the returned handle to make sure it's not less than zero, as negative handle values indicate that an error occurred. But if it's not less than zero, then you can ignore it. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.v.romanov@REDACTED Fri Oct 17 20:57:39 2014 From: alexey.v.romanov@REDACTED (Alexey Romanov) Date: Fri, 17 Oct 2014 22:57:39 +0400 Subject: [erlang-questions] Return value of driver_async In-Reply-To: References: Message-ID: Thanks! Yours, Alexey Romanov On Fri, Oct 17, 2014 at 10:56 PM, Steve Vinoski wrote: > > > On Fri, Oct 17, 2014 at 2:49 PM, Steve Vinoski wrote: > >> >> >> On Fri, Oct 17, 2014 at 1:58 PM, Alexey Romanov < >> alexey.v.romanov@REDACTED> wrote: >> >>> Documentation for driver_async says it returns a handle to the >>> asynchronous task. However, I can't find any other mentions of these >>> handles in erl_driver or driver_entry docs. What can/should this value be >>> used for? Or should it be ignored? >>> >> >> There was an old function driver_async_cancel() for canceling async jobs >> that took the handle as an argument, but it was deprecated a long time ago >> and it's since been removed. So, you can just ignore the handle. I'll see >> if I can patch the docs to clarify this. >> > > Correction: you should check the returned handle to make sure it's not > less than zero, as negative handle values indicate that an error occurred. > But if it's not less than zero, then you can ignore it. > > --steve > -------------- next part -------------- An HTML attachment was scrubbed... URL: From garret.smith@REDACTED Sat Oct 18 05:58:07 2014 From: garret.smith@REDACTED (Garret Smith) Date: Fri, 17 Oct 2014 20:58:07 -0700 Subject: [erlang-questions] FreeBSD cpu topology detection In-Reply-To: References: Message-ID: On Fri, Oct 17, 2014 at 9:34 AM, Garret Smith wrote: > On Thu, Oct 16, 2014 at 6:04 PM, Garret Smith wrote: >> CPU topology detection seems broken (at least incomplete) on FreeBSD. >> erlang:system_info(cpu_topology) returns 'undefined' on the few machines I >> have at my disposal. >> >> I'm going to take a stab at a patch, but I'd like some help from other >> FreeBSD users out there first. >> >> Can any FreeBSD users please send me: >> a) the output of 'sysctl kern.sched.topology_spec' >> b) a few lines from your 'dmesg' about the processor configuration like: >> FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs >> FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 SMT threads >> >> Even if your topology is correctly determined, this info will help me ensure >> I don't introduce a regression. >> >> Thanks, >> Garret > > Thank you to all who sent me information. > > I now have a good collection of systems with {2, 4, 8} logical > processors and {2, 4} cores. Any info on machines with >8 logical > processors would be appreciated. > > No one reported that topology detection worked. > > -Garret First cut is up at: https://github.com/garret-smith/otp/tree/gs-freebsd-cpu-topology I get the correct topology for my machine and the XML samples I was sent. Any additional testing before I submit to the OTP team next week would be appreciated. I don't think they have a lot of boxen to really exercise this. -Garret From per@REDACTED Sat Oct 18 12:55:54 2014 From: per@REDACTED (Per Hedeland) Date: Sat, 18 Oct 2014 12:55:54 +0200 (CEST) Subject: [erlang-questions] FreeBSD cpu topology detection In-Reply-To: Message-ID: <201410181055.s9IAtsB8099440@pluto.hedeland.org> Garret Smith wrote: > >On Fri, Oct 17, 2014 at 9:34 AM, Garret Smith wrote: >> On Thu, Oct 16, 2014 at 6:04 PM, Garret Smith wrote: >>> CPU topology detection seems broken (at least incomplete) on FreeBSD. >>> erlang:system_info(cpu_topology) returns 'undefined' on the few machines I >>> have at my disposal. >>> >>> I'm going to take a stab at a patch, but I'd like some help from other >>> FreeBSD users out there first. >>> >>> Can any FreeBSD users please send me: >>> a) the output of 'sysctl kern.sched.topology_spec' >>> b) a few lines from your 'dmesg' about the processor configuration like: >>> FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs >>> FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 SMT threads >>> >>> Even if your topology is correctly determined, this info will help me ensure >>> I don't introduce a regression. >>> >>> Thanks, >>> Garret >> >> Thank you to all who sent me information. >> >> I now have a good collection of systems with {2, 4, 8} logical >> processors and {2, 4} cores. Any info on machines with >8 logical >> processors would be appreciated. >> >> No one reported that topology detection worked. Well, you didn't ask for that information.:-) Nor did you mention either the FreeBSD or the OTP version where you were seeing the problem... FWIW, it seems to work just fine for me on the 2-core/4-logical and 4-core/8-logical FreeBSD systems I use regularly, with a variety of FreeBSD and OTP versions. I'm also pretty sure Raimo would have mentioned if it was broken on any of his machines. Since another poster also saw the problem, and mentioned that he was running FreeBSD 10.something, it might be a FreeBSD-10-specific problem - personally I haven't tried Erlang/OTP on FreeBSD-10 yet. >First cut is up at: >https://github.com/garret-smith/otp/tree/gs-freebsd-cpu-topology >I get the correct topology for my machine and the XML samples I was sent. > >Any additional testing before I submit to the OTP team next week would >be appreciated. I don't think they have a lot of boxen to really >exercise this. I'll try to verify that it doesn't break what is working for me...:-) --Per Hedeland PS Also note that there is an actively maintained FreeBSD "port" for Erlang (currently at 17.3) - it seems a bit unlikely that total brokenness of the topology detection *in the version used by the port* would go unnoticed by the port maintainer. From boikot@REDACTED Sat Oct 18 11:08:56 2014 From: boikot@REDACTED (Gonzalo Serrano) Date: Sat, 18 Oct 2014 11:08:56 +0200 Subject: [erlang-questions] How to build web chat in Erlang? In-Reply-To: <87bnpg7yt9.fsf@gmx.net> References: <87k34ay63o.fsf@gmx.net> <87bnpmxzz9.fsf@gmx.net> <871tqek7eq.fsf@gmx.net> <87tx39v8s7.fsf@gmx.net> <87bnpg7yt9.fsf@gmx.net> Message-ID: Hi, and sorry for the late reply! On Mon, Oct 13, 2014 at 5:51 PM, Rainer Hansen wrote: > Hi Gonzalo, > > thanks a lot for the hint. Could you please elaborate a little bit on > this? What were the problems you have had because of the proxy filtering > and how did Cowboy help you to solve them? > We found out that some spanish mobile 3G/4G providers gave us problems with their transparent proxies and firewalls with TCP connections in ports different than the 80. That's why we chose the Websockets protocol, which handshake is done via HTTP. We still had problems with a certain 3G provider so we moved to Websockets Secure, which uses a SSL/TLS layer below the Websockets one, and voil?, problem solved. Cowboy supports WS and WSS so it made it quite straightforward to implement. > > I wonder also how do you handle the case that the mobile internet > connectivity can get sometimes suddenly offline and after a few minutes > online again because of bad coverage or the player taking a small break? > > Cowbo has a websocket handler behaviour which basically allows an erlang process to manage a websocket connection. Then we have a chat session process for each user. When a websocket connection starts it connects to it's corresponding session, which handles e.g a history of messages sent, to which chat room processes should be connected etc. When a websocket connection is dropped the handler is killed but the session is still alive, so the next time the user connects a new handler will be spawned and connected (we do that with gproc) to the session. Hope it helps! Regards, Gonzalo. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Sat Oct 18 17:46:48 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sat, 18 Oct 2014 11:46:48 -0400 (EDT) Subject: [erlang-questions] Help! Drowning in qlc documentation Message-ID: <1413647208.331211227@apps.rackspace.com> Hello, I really really want to understand qlc. But that's another story. Here's my immediate problem: I have a simple dets db that stores: -record(note, {date, subject, note}). I want to fetch all notes equal or less than a given date. Leveraging Joe Armstrong's do/1 function (Programming Erlang, 2007, p326), I wrote a query function as so: do(Q) -> F = fun() -> qlc:e(Q) end, {atomic, Val} = mnesia:transaction(F), Val. get_notes(Date) -> open_notes_db(), do(qlc:q([Record || Record <- dets:table(nit_notes), Record#note.date =< Date])), close_notes_db(). When I run get_notes/1, I get this: 36> notes_store:get_notes(Date). ** exception error: no match of right hand side value {aborted,{node_not_running,'nit_notes@REDACTED'}} in function notes_store:do/1 (/home/lloyd/nit_host/nit_notes/site/src/notes_store.erl, line 53) in call from notes_store:get_notes/1 (/home/lloyd/nit_host/nit_notes/site/src/notes_store.erl, line 59) This suggests that my dets db is not open, but I did that in get_notes/1: open_notes_db() -> File = nit_notes, {ok, nit_notes} = dets:open_file(File, [{keypos,#note.date}, {type,bag}]). Which, in the shell, returns: 29> notes_store:open_notes_db(). {ok,nit_notes} If I run: qlc:q([Record#note.note || Record <- dets:table(nit_notes), Record#note.date =< Date ]) ...in the shell, I get: {qlc_handle,{qlc_lc,#Fun, {qlc_opt,false,false,-1,any,[],any,524288,allowed}}} Yes, I know that this is a query handle. But what in world does it mean? If I plug this mess it into the shell, I get: 1> Q = qlc:q([Record#note.note || Record <- dets:table(nit_notes), Record#note.date =< Date ]). 2> qlc:eval(Q). ** exception error: bad argument in function dets:safe_fixtable/2 called as dets:safe_fixtable(nit_notes,true) in call from qlc:call/4 (qlc.erl, line 3759) in call from qlc:table_handle/3 (qlc.erl, line 2616) in call from qlc:setup_le/3 (qlc.erl, line 2381) in call from qlc:setup_quals/6 (qlc.erl, line 2480) in call from qlc:setup_quals/4 (qlc.erl, line 2438) in call from qlc:setup_le/3 (qlc.erl, line 2377) in call from qlc:eval/2 (qlc.erl, line 290) Which, again, suggests a problem with my dets table. But I don't know what. Or, is it possible that my problem is with mnesia:transactions/1 in do/1? Docs do say that qlc should work with dets, but I don't see a dets:transactions/1. How can I diagnose and fix? Many thanks, LRP ********************************************* My books: THE GOSPEL OF ASHES http://thegospelofashes.com Strength is not enough. Do they have the courage and the cunning? Can they survive long enough to save the lives of millions? FREEIN' PANCHO http://freeinpancho.com A community of misfits help a troubled boy find his way AYA TAKEO http://ayatakeo.com Star-crossed love, war and power in an alternative universe Available through Amazon or by request from your favorite bookstore ********************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf@REDACTED Sun Oct 19 09:33:54 2014 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 19 Oct 2014 09:33:54 +0200 Subject: [erlang-questions] Help! Drowning in qlc documentation In-Reply-To: <1413647208.331211227@apps.rackspace.com> References: <1413647208.331211227@apps.rackspace.com> Message-ID: <15A53E61-1A0E-41C7-9B2B-66207C3B044C@feuerlabs.com> The {aborted,{node_not_running,'nit_notes@REDACTED?}} message comes from mnesia, as you?re trying to run a mnesia transaction without actually having a mnesia database. You don?t need mnesia at all to use QLC. Just execute qlc:e(Q) directly. BR, Ulf W On 18 Oct 2014, at 17:46, lloyd@REDACTED wrote: > Hello, > > I really really want to understand qlc. But that's another story. Here's my immediate problem: > > I have a simple dets db that stores: > > -record(note, {date, subject, note}). > > I want to fetch all notes equal or less than a given date. Leveraging Joe Armstrong's do/1 function (Programming Erlang, 2007, p326), I wrote a query function as so: > > do(Q) -> > F = fun() -> qlc:e(Q) end, > {atomic, Val} = mnesia:transaction(F), > Val. > > get_notes(Date) -> > open_notes_db(), > do(qlc:q([Record || Record <- dets:table(nit_notes), Record#note.date =< Date])), > close_notes_db(). > > When I run get_notes/1, I get this: > > 36> notes_store:get_notes(Date). > ** exception error: no match of right hand side value {aborted,{node_not_running,'nit_notes@REDACTED'}} > in function notes_store:do/1 (/home/lloyd/nit_host/nit_notes/site/src/notes_store.erl, line 53) > in call from notes_store:get_notes/1 (/home/lloyd/nit_host/nit_notes/site/src/notes_store.erl, line 59) > > This suggests that my dets db is not open, but I did that in get_notes/1: > > open_notes_db() -> > File = nit_notes, > {ok, nit_notes} = dets:open_file(File, > [{keypos,#note.date}, {type,bag}]). > > > Which, in the shell, returns: > > 29> notes_store:open_notes_db(). > {ok,nit_notes} > > If I run: > > qlc:q([Record#note.note || Record <- dets:table(nit_notes), Record#note.date =< Date ]) > > ...in the shell, I get: > > {qlc_handle,{qlc_lc,#Fun, {qlc_opt,false,false,-1,any,[],any,524288,allowed}}} > > Yes, I know that this is a query handle. But what in world does it mean? If I plug this mess it into the shell, I get: > > 1> Q = qlc:q([Record#note.note || Record <- dets:table(nit_notes), Record#note.date =< Date ]). > 2> qlc:eval(Q). > ** exception error: bad argument > in function dets:safe_fixtable/2 > called as dets:safe_fixtable(nit_notes,true) > in call from qlc:call/4 (qlc.erl, line 3759) > in call from qlc:table_handle/3 (qlc.erl, line 2616) > in call from qlc:setup_le/3 (qlc.erl, line 2381) > in call from qlc:setup_quals/6 (qlc.erl, line 2480) > in call from qlc:setup_quals/4 (qlc.erl, line 2438) > in call from qlc:setup_le/3 (qlc.erl, line 2377) > in call from qlc:eval/2 (qlc.erl, line 290) > > Which, again, suggests a problem with my dets table. But I don't know what. > > Or, is it possible that my problem is with mnesia:transactions/1 in do/1? Docs do say that qlc should work with dets, but I don't see a dets:transactions/1. > > How can I diagnose and fix? > > Many thanks, > > LRP > > > > > ********************************************* > My books: > > THE GOSPEL OF ASHES > http://thegospelofashes.com > > Strength is not enough. Do they have the courage > and the cunning? Can they survive long enough to > save the lives of millions? > > FREEIN' PANCHO > http://freeinpancho.com > > A community of misfits help a troubled boy find his way > > AYA TAKEO > http://ayatakeo.com > > Star-crossed love, war and power in an alternative > universe > > Available through Amazon or by request from your > favorite bookstore > > > ********************************************** > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.v.romanov@REDACTED Sun Oct 19 15:22:12 2014 From: alexey.v.romanov@REDACTED (Alexey Romanov) Date: Sun, 19 Oct 2014 17:22:12 +0400 Subject: [erlang-questions] erlang-sqlite3 Message-ID: During the last two weeks I've finally updated erlang-sqlite3 ( https://github.com/alexeyr/erlang-sqlite3) quite a bit. The current version fixes several memory leaks, enables driver instances for different database file to use separate async pool threads, and supports all Erlang versions starting from R14B. Since there are no API changes (except for adding raw SQL constraints), everyone still using old version should probably update, and if you maintain a fork you should consider merging in the changes. Yours, Alexey Romanov -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Sun Oct 19 16:08:00 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Sun, 19 Oct 2014 18:08:00 +0400 Subject: [erlang-questions] Erlang and huge pages. Message-ID: I've launched erlang on 128 GB machine and after some googling found that such amount of memory is recommented to be organized as huge pages. But it seems that software must support them explicitly. Is it supported in Erlang? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Sun Oct 19 16:11:07 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 19 Oct 2014 16:11:07 +0200 Subject: [erlang-questions] Erlang and huge pages. In-Reply-To: References: Message-ID: Hi Max! Look up some of Rick Reeds slides from the Erlang Factory SF in 2014 and 2013 (I believe!, maybe 2012 is also in the game). Rick has a couple of tunables for the carrier allocators where he makes sure it allocates in big enough chunks for Superpages[0]. [0] Superpages =:= Hugepages. They are named a bit different in different operating systems. On Sun, Oct 19, 2014 at 4:08 PM, Max Lapshin wrote: > I've launched erlang on 128 GB machine and after some googling found that > such amount of memory is recommented to be organized as huge pages. But it > seems that software must support them explicitly. > > Is it supported in Erlang? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pguyot@REDACTED Sun Oct 19 17:37:11 2014 From: pguyot@REDACTED (Paul Guyot) Date: Sun, 19 Oct 2014 17:37:11 +0200 Subject: [erlang-questions] FreeBSD cpu topology detection In-Reply-To: References: Message-ID: <630E734F-EBD3-4EEA-9A0B-CC1DAFD4AFF3@kallisys.net> >>> No one reported that topology detection worked. > > Well, you didn't ask for that information.:-) Nor did you mention either > the FreeBSD or the OTP version where you were seeing the problem... > FWIW, it seems to work just fine for me on the 2-core/4-logical and > 4-core/8-logical FreeBSD systems I use regularly, with a variety of > FreeBSD and OTP versions. I'm also pretty sure Raimo would have > mentioned if it was broken on any of his machines. > > Since another poster also saw the problem, and mentioned that he was > running FreeBSD 10.something, it might be a FreeBSD-10-specific problem > - personally I haven't tried Erlang/OTP on FreeBSD-10 yet. I am amazed that the parser is written (which I authored) instead of being debugged? I don't mean it's exceptional code, and it actually needed more love and especially tests? The issue is not FreeBSD 10 but rather FreeBSD 10's default compiler (clang). There was a bug in this code with an undefined behavior. Older versions of gcc (which we use) behave as expected by the code, while clang and gcc devel (4.9) do not (only gcc 4.9 warns about it). I pushed a three-line fix : https://github.com/pguyot/otp/commit/c8ae3f2797d9c613e07b916683c51efea2da81aa This fix has the advantage of not introducing unwanted regression. Garret, could you please test it and determine if it works for you? I am definitely willing to debug this old code if you do provide unworking outputs of kern.sched.topology_spec. As a side note, I'm wondering why your code reads the number of cores with sysctl kern.smp.cpus. This is filled by the emulator upstream. Paul -- Semiocast http://semiocast.com/ +33.183627948 - 20 rue Lacaze, 75014 Paris From thomas.elsgaard@REDACTED Sun Oct 19 18:50:18 2014 From: thomas.elsgaard@REDACTED (Thomas Elsgaard) Date: Sun, 19 Oct 2014 14:50:18 -0200 Subject: [erlang-questions] Where did webmachines dispatch.conf go ?? Message-ID: Hi When getting webmachine from github, and creating a new : git clone git://github.com/basho/webmachine ./scripts/new_webmachine.sh test /Users/thel bar14451:webmachine thel$ ./scripts/new_webmachine.sh test /Users/thel/ ==> priv (create) Writing /Users/thel/test/README Writing /Users/thel/test/Makefile Writing /Users/thel/test/rebar.config Writing /Users/thel/test/rebar Writing /Users/thel/test/start.sh Writing /Users/thel/test/src/test.app.src Writing /Users/thel/test/src/test.erl Writing /Users/thel/test/src/test_app.erl Writing /Users/thel/test/src/test_sup.erl Writing /Users/thel/test/src/test_config.erl Writing /Users/thel/test/src/test_resource.erl There is not created any priv/dispatch.conf file ? It also seems, that adding the file manually doesn't makes webmachine dispatch to the right resource? Has anything changed ? Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean@REDACTED Sun Oct 19 18:58:48 2014 From: sean@REDACTED (Sean Cribbs) Date: Sun, 19 Oct 2014 11:58:48 -0500 Subject: [erlang-questions] Where did webmachines dispatch.conf go ?? In-Reply-To: References: Message-ID: Thomas, We recently reworked the template[1] to reflect more recent conventions in Webmachine projects. Look in test_config and test_sup for more details. [1] https://github.com/basho/webmachine/pull/208 On Sun, Oct 19, 2014 at 11:50 AM, Thomas Elsgaard wrote: > Hi > > When getting webmachine from github, and creating a new : > > git clone git://github.com/basho/webmachine > > ./scripts/new_webmachine.sh test /Users/thel > > > bar14451:webmachine thel$ ./scripts/new_webmachine.sh test /Users/thel/ > > ==> priv (create) > > Writing /Users/thel/test/README > > Writing /Users/thel/test/Makefile > > Writing /Users/thel/test/rebar.config > > Writing /Users/thel/test/rebar > > Writing /Users/thel/test/start.sh > > Writing /Users/thel/test/src/test.app.src > > Writing /Users/thel/test/src/test.erl > > Writing /Users/thel/test/src/test_app.erl > > Writing /Users/thel/test/src/test_sup.erl > > Writing /Users/thel/test/src/test_config.erl > > Writing /Users/thel/test/src/test_resource.erl > > > There is not created any priv/dispatch.conf file ? > > > It also seems, that adding the file manually doesn't makes webmachine > dispatch to the right resource? Has anything changed ? > > > Thomas > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Sean Cribbs Sr. Software Engineer Basho Technologies, Inc. http://basho.com/ From thomas.elsgaard@REDACTED Sun Oct 19 19:14:38 2014 From: thomas.elsgaard@REDACTED (Thomas Elsgaard) Date: Sun, 19 Oct 2014 15:14:38 -0200 Subject: [erlang-questions] Where did webmachines dispatch.conf go ?? In-Reply-To: References: Message-ID: Hi Sean, thanks! Got it! Btw, the "demo" folder inside the webmachine folder stil contains the "old" format with the dispatch.conf file, you might want to change it also.. ///Thomas On Sun, Oct 19, 2014 at 2:58 PM, Sean Cribbs wrote: > Thomas, > > We recently reworked the template[1] to reflect more recent > conventions in Webmachine projects. Look in test_config and test_sup > for more details. > > [1] https://github.com/basho/webmachine/pull/208 > > On Sun, Oct 19, 2014 at 11:50 AM, Thomas Elsgaard > wrote: > > Hi > > > > When getting webmachine from github, and creating a new : > > > > git clone git://github.com/basho/webmachine > > > > ./scripts/new_webmachine.sh test /Users/thel > > > > > > bar14451:webmachine thel$ ./scripts/new_webmachine.sh test /Users/thel/ > > > > ==> priv (create) > > > > Writing /Users/thel/test/README > > > > Writing /Users/thel/test/Makefile > > > > Writing /Users/thel/test/rebar.config > > > > Writing /Users/thel/test/rebar > > > > Writing /Users/thel/test/start.sh > > > > Writing /Users/thel/test/src/test.app.src > > > > Writing /Users/thel/test/src/test.erl > > > > Writing /Users/thel/test/src/test_app.erl > > > > Writing /Users/thel/test/src/test_sup.erl > > > > Writing /Users/thel/test/src/test_config.erl > > > > Writing /Users/thel/test/src/test_resource.erl > > > > > > There is not created any priv/dispatch.conf file ? > > > > > > It also seems, that adding the file manually doesn't makes webmachine > > dispatch to the right resource? Has anything changed ? > > > > > > Thomas > > > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > Sean Cribbs > Sr. Software Engineer > Basho Technologies, Inc. > http://basho.com/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Sun Oct 19 20:24:22 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sun, 19 Oct 2014 14:24:22 -0400 (EDT) Subject: [erlang-questions] Help! Drowning in qlc documentation In-Reply-To: <15A53E61-1A0E-41C7-9B2B-66207C3B044C@feuerlabs.com> References: <1413647208.331211227@apps.rackspace.com> <15A53E61-1A0E-41C7-9B2B-66207C3B044C@feuerlabs.com> Message-ID: <1413743062.30771552@apps.rackspace.com> Many thanks, Ulf, That did the trick. Best wishes, LRP -----Original Message----- From: "Ulf Wiger" Sent: Sunday, October 19, 2014 3:33am To: lloyd@REDACTED Cc: "erlang questions" Subject: Re: [erlang-questions] Help! Drowning in qlc documentation The {aborted,{node_not_running,'[ nit_notes@REDACTED ]( mailto:nit_notes@REDACTED )?}} message comes from mnesia, as you?re trying to run a mnesia transaction without actually having a mnesia database. You don?t need mnesia at all to use QLC. Just execute qlc:e(Q) directly. BR, Ulf W On 18 Oct 2014, at 17:46, [ lloyd@REDACTED ]( mailto:lloyd@REDACTED ) wrote: Hello, I really really want to understand qlc. But that's another story. Here's my immediate problem: I have a simple dets db that stores: -record(note, {date, subject, note}). I want to fetch all notes equal or less than a given date. Leveraging Joe Armstrong's do/1 function (Programming Erlang, 2007, p326), I wrote a query function as so: do(Q) -> F = fun() -> qlc:e(Q) end, {atomic, Val} = mnesia:transaction(F), Val. get_notes(Date) -> open_notes_db(), do(qlc:q([Record || Record <- dets:table(nit_notes), Record#note.date =< Date])), close_notes_db(). When I run get_notes/1, I get this: 36> notes_store:get_notes(Date). ** exception error: no match of right hand side value {aborted,{node_not_running,'[ nit_notes@REDACTED ]( mailto:nit_notes@REDACTED )'}} in function notes_store:do/1 (/home/lloyd/nit_host/nit_notes/site/src/notes_store.erl, line 53) in call from notes_store:get_notes/1 (/home/lloyd/nit_host/nit_notes/site/src/notes_store.erl, line 59) This suggests that my dets db is not open, but I did that in get_notes/1: open_notes_db() -> File = nit_notes, {ok, nit_notes} = dets:open_file(File, [{keypos,#note.date}, {type,bag}]). Which, in the shell, returns: 29> notes_store:open_notes_db(). {ok,nit_notes} If I run: qlc:q([Record#note.note || Record <- dets:table(nit_notes), Record#note.date =< Date ]) ...in the shell, I get: {qlc_handle,{qlc_lc,#Fun, {qlc_opt,false,false,-1,any,[],any,524288,allowed}}} Yes, I know that this is a query handle. But what in world does it mean? If I plug this mess it into the shell, I get: 1> Q = qlc:q([Record#note.note || Record <- dets:table(nit_notes), Record#note.date =< Date ]). 2> qlc:eval(Q). ** exception error: bad argument in function dets:safe_fixtable/2 called as dets:safe_fixtable(nit_notes,true) in call from qlc:call/4 (qlc.erl, line 3759) in call from qlc:table_handle/3 (qlc.erl, line 2616) in call from qlc:setup_le/3 (qlc.erl, line 2381) in call from qlc:setup_quals/6 (qlc.erl, line 2480) in call from qlc:setup_quals/4 (qlc.erl, line 2438) in call from qlc:setup_le/3 (qlc.erl, line 2377) in call from qlc:eval/2 (qlc.erl, line 290) Which, again, suggests a problem with my dets table. But I don't know what. Or, is it possible that my problem is with mnesia:transactions/1 in do/1? Docs do say that qlc should work with dets, but I don't see a dets:transactions/1. How can I diagnose and fix? Many thanks, LRP ********************************************* My books: THE GOSPEL OF ASHES [ http://thegospelofashes.com ]( http://thegospelofashes.com ) Strength is not enough. Do they have the courage and the cunning? Can they survive long enough to save the lives of millions? FREEIN' PANCHO http://freeinpancho.com A community of misfits help a troubled boy find his way AYA TAKEO http://ayatakeo.com Star-crossed love, war and power in an alternative universe Available through Amazon or by request from your favorite bookstore **********************************************_______________________________________________ erlang-questions mailing list [ erlang-questions@REDACTED ]( mailto:erlang-questions@REDACTED ) http://erlang.org/mailman/listinfo/erlang-questions Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. [ http://feuerlabs.com ]( http://feuerlabs.com ) -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean@REDACTED Sun Oct 19 21:56:27 2014 From: sean@REDACTED (Sean Cribbs) Date: Sun, 19 Oct 2014 14:56:27 -0500 Subject: [erlang-questions] Where did webmachines dispatch.conf go ?? In-Reply-To: References: Message-ID: Thanks, I'll look into it. On Sun, Oct 19, 2014 at 12:14 PM, Thomas Elsgaard wrote: > Hi Sean, thanks! Got it! > > Btw, the "demo" folder inside the webmachine folder stil contains the "old" > format with the dispatch.conf file, you might want to change it also.. > > ///Thomas > > > > On Sun, Oct 19, 2014 at 2:58 PM, Sean Cribbs wrote: >> >> Thomas, >> >> We recently reworked the template[1] to reflect more recent >> conventions in Webmachine projects. Look in test_config and test_sup >> for more details. >> >> [1] https://github.com/basho/webmachine/pull/208 >> >> On Sun, Oct 19, 2014 at 11:50 AM, Thomas Elsgaard >> wrote: >> > Hi >> > >> > When getting webmachine from github, and creating a new : >> > >> > git clone git://github.com/basho/webmachine >> > >> > ./scripts/new_webmachine.sh test /Users/thel >> > >> > >> > bar14451:webmachine thel$ ./scripts/new_webmachine.sh test /Users/thel/ >> > >> > ==> priv (create) >> > >> > Writing /Users/thel/test/README >> > >> > Writing /Users/thel/test/Makefile >> > >> > Writing /Users/thel/test/rebar.config >> > >> > Writing /Users/thel/test/rebar >> > >> > Writing /Users/thel/test/start.sh >> > >> > Writing /Users/thel/test/src/test.app.src >> > >> > Writing /Users/thel/test/src/test.erl >> > >> > Writing /Users/thel/test/src/test_app.erl >> > >> > Writing /Users/thel/test/src/test_sup.erl >> > >> > Writing /Users/thel/test/src/test_config.erl >> > >> > Writing /Users/thel/test/src/test_resource.erl >> > >> > >> > There is not created any priv/dispatch.conf file ? >> > >> > >> > It also seems, that adding the file manually doesn't makes webmachine >> > dispatch to the right resource? Has anything changed ? >> > >> > >> > Thomas >> > >> > >> > >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > >> >> >> >> -- >> Sean Cribbs >> Sr. Software Engineer >> Basho Technologies, Inc. >> http://basho.com/ > > -- Sean Cribbs Sr. Software Engineer Basho Technologies, Inc. http://basho.com/ From per@REDACTED Sat Oct 18 12:55:54 2014 From: per@REDACTED (Per Hedeland) Date: Sat, 18 Oct 2014 03:55:54 -0700 Subject: [erlang-questions] FreeBSD cpu topology detection In-Reply-To: Message-ID: <201410181055.s9IAtsB8099440@pluto.hedeland.org> Garret Smith wrote: > >On Fri, Oct 17, 2014 at 9:34 AM, Garret Smith wrote: >> On Thu, Oct 16, 2014 at 6:04 PM, Garret Smith wrote: >>> CPU topology detection seems broken (at least incomplete) on FreeBSD. >>> erlang:system_info(cpu_topology) returns 'undefined' on the few machines I >>> have at my disposal. >>> >>> I'm going to take a stab at a patch, but I'd like some help from other >>> FreeBSD users out there first. >>> >>> Can any FreeBSD users please send me: >>> a) the output of 'sysctl kern.sched.topology_spec' >>> b) a few lines from your 'dmesg' about the processor configuration like: >>> FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs >>> FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 SMT threads >>> >>> Even if your topology is correctly determined, this info will help me ensure >>> I don't introduce a regression. >>> >>> Thanks, >>> Garret >> >> Thank you to all who sent me information. >> >> I now have a good collection of systems with {2, 4, 8} logical >> processors and {2, 4} cores. Any info on machines with >8 logical >> processors would be appreciated. >> >> No one reported that topology detection worked. Well, you didn't ask for that information.:-) Nor did you mention either the FreeBSD or the OTP version where you were seeing the problem... FWIW, it seems to work just fine for me on the 2-core/4-logical and 4-core/8-logical FreeBSD systems I use regularly, with a variety of FreeBSD and OTP versions. I'm also pretty sure Raimo would have mentioned if it was broken on any of his machines. Since another poster also saw the problem, and mentioned that he was running FreeBSD 10.something, it might be a FreeBSD-10-specific problem - personally I haven't tried Erlang/OTP on FreeBSD-10 yet. >First cut is up at: >https://github.com/garret-smith/otp/tree/gs-freebsd-cpu-topology >I get the correct topology for my machine and the XML samples I was sent. > >Any additional testing before I submit to the OTP team next week would >be appreciated. I don't think they have a lot of boxen to really >exercise this. I'll try to verify that it doesn't break what is working for me...:-) --Per Hedeland PS Also note that there is an actively maintained FreeBSD "port" for Erlang (currently at 17.3) - it seems a bit unlikely that total brokenness of the topology detection *in the version used by the port* would go unnoticed by the port maintainer. _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED https://urldefense.proofpoint.com/v1/url?u=http://erlang.org/mailman/listinfo/erlang-questions&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=%2BeQ4KDUqB%2Ba5p47eZISTJX4bLLnoLmTlWbkSNWD9lg0%3D%0A&m=S7VxcPR0m2tbWMVoVr%2F5WVSxrZA3pVU43ir4DdF1Yes%3D%0A&s=a6d32737122514ab606373a0be697fdba3d3703d986c73f77b67b4d557e29d5c From boikot@REDACTED Sat Oct 18 11:08:56 2014 From: boikot@REDACTED (Gonzalo Serrano) Date: Sat, 18 Oct 2014 02:08:56 -0700 Subject: [erlang-questions] How to build web chat in Erlang? In-Reply-To: <87bnpg7yt9.fsf@gmx.net> References: <87k34ay63o.fsf@gmx.net> <87bnpmxzz9.fsf@gmx.net> <871tqek7eq.fsf@gmx.net> <87tx39v8s7.fsf@gmx.net> <87bnpg7yt9.fsf@gmx.net> Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From boikot@REDACTED Sat Oct 18 11:08:56 2014 From: boikot@REDACTED (Gonzalo Serrano) Date: Sat, 18 Oct 2014 02:08:56 -0700 Subject: [erlang-questions] How to build web chat in Erlang? In-Reply-To: <87bnpg7yt9.fsf@gmx.net> References: <87k34ay63o.fsf@gmx.net> <87bnpmxzz9.fsf@gmx.net> <871tqek7eq.fsf@gmx.net> <87tx39v8s7.fsf@gmx.net> <87bnpg7yt9.fsf@gmx.net> Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From lloyd@REDACTED Sat Oct 18 17:46:48 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sat, 18 Oct 2014 08:46:48 -0700 Subject: [erlang-questions] Help! Drowning in qlc documentation Message-ID: <1413647208.331211227@apps.rackspace.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From lloyd@REDACTED Sat Oct 18 17:46:48 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sat, 18 Oct 2014 08:46:48 -0700 Subject: [erlang-questions] Help! Drowning in qlc documentation Message-ID: <1413647208.331211227@apps.rackspace.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From ulf@REDACTED Sun Oct 19 09:33:54 2014 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 19 Oct 2014 00:33:54 -0700 Subject: [erlang-questions] Help! Drowning in qlc documentation In-Reply-To: <1413647208.331211227@apps.rackspace.com> References: <1413647208.331211227@apps.rackspace.com> Message-ID: <15A53E61-1A0E-41C7-9B2B-66207C3B044C@feuerlabs.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From ulf@REDACTED Sun Oct 19 09:33:54 2014 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 19 Oct 2014 00:33:54 -0700 Subject: [erlang-questions] Help! Drowning in qlc documentation In-Reply-To: <1413647208.331211227@apps.rackspace.com> References: <1413647208.331211227@apps.rackspace.com> Message-ID: <15A53E61-1A0E-41C7-9B2B-66207C3B044C@feuerlabs.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From max.lapshin@REDACTED Sun Oct 19 16:08:00 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Sun, 19 Oct 2014 07:08:00 -0700 Subject: [erlang-questions] Erlang and huge pages. Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From max.lapshin@REDACTED Sun Oct 19 16:08:00 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Sun, 19 Oct 2014 07:08:00 -0700 Subject: [erlang-questions] Erlang and huge pages. Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From alexey.v.romanov@REDACTED Sun Oct 19 15:22:12 2014 From: alexey.v.romanov@REDACTED (Alexey Romanov) Date: Sun, 19 Oct 2014 06:22:12 -0700 Subject: [erlang-questions] erlang-sqlite3 Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From alexey.v.romanov@REDACTED Sun Oct 19 15:22:12 2014 From: alexey.v.romanov@REDACTED (Alexey Romanov) Date: Sun, 19 Oct 2014 06:22:12 -0700 Subject: [erlang-questions] erlang-sqlite3 Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From pguyot@REDACTED Sun Oct 19 17:37:11 2014 From: pguyot@REDACTED (Paul Guyot) Date: Sun, 19 Oct 2014 08:37:11 -0700 Subject: [erlang-questions] FreeBSD cpu topology detection In-Reply-To: References: Message-ID: <630E734F-EBD3-4EEA-9A0B-CC1DAFD4AFF3@kallisys.net> >>> No one reported that topology detection worked. > > Well, you didn't ask for that information.:-) Nor did you mention either > the FreeBSD or the OTP version where you were seeing the problem... > FWIW, it seems to work just fine for me on the 2-core/4-logical and > 4-core/8-logical FreeBSD systems I use regularly, with a variety of > FreeBSD and OTP versions. I'm also pretty sure Raimo would have > mentioned if it was broken on any of his machines. > > Since another poster also saw the problem, and mentioned that he was > running FreeBSD 10.something, it might be a FreeBSD-10-specific problem > - personally I haven't tried Erlang/OTP on FreeBSD-10 yet. I am amazed that the parser is written (which I authored) instead of being debugged? I don't mean it's exceptional code, and it actually needed more love and especially tests? The issue is not FreeBSD 10 but rather FreeBSD 10's default compiler (clang). There was a bug in this code with an undefined behavior. Older versions of gcc (which we use) behave as expected by the code, while clang and gcc devel (4.9) do not (only gcc 4.9 warns about it). I pushed a three-line fix : https://github.com/pguyot/otp/commit/c8ae3f2797d9c613e07b916683c51efea2da81aa This fix has the advantage of not introducing unwanted regression. Garret, could you please test it and determine if it works for you? I am definitely willing to debug this old code if you do provide unworking outputs of kern.sched.topology_spec. As a side note, I'm wondering why your code reads the number of cores with sysctl kern.smp.cpus. This is filled by the emulator upstream. Paul -- Semiocast https://urldefense.proofpoint.com/v1/url?u=http://semiocast.com/&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=F3fV0VibzuPLq4QAFCq8Kw%3D%3D%0A&m=shym7ox0znLbEV%2F8gs0xsxhZ2LLnJ4PRW%2BrLkNP7BVs%3D%0A&s=51e425358a557510fdb2dabafe06260a2f2dfdf8f03cabfbffb20d0221798464 +33.183627948 - 20 rue Lacaze, 75014 Paris _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED https://urldefense.proofpoint.com/v1/url?u=http://erlang.org/mailman/listinfo/erlang-questions&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=F3fV0VibzuPLq4QAFCq8Kw%3D%3D%0A&m=shym7ox0znLbEV%2F8gs0xsxhZ2LLnJ4PRW%2BrLkNP7BVs%3D%0A&s=f44350373e181f58cc7fab4e72057d273bca3edd0170afddf8d95a5989e3bd7f From jesper.louis.andersen@REDACTED Sun Oct 19 16:11:07 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 19 Oct 2014 07:11:07 -0700 Subject: [erlang-questions] Erlang and huge pages. In-Reply-To: References: Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From pguyot@REDACTED Sun Oct 19 17:37:11 2014 From: pguyot@REDACTED (Paul Guyot) Date: Sun, 19 Oct 2014 08:37:11 -0700 Subject: [erlang-questions] FreeBSD cpu topology detection In-Reply-To: References: Message-ID: <630E734F-EBD3-4EEA-9A0B-CC1DAFD4AFF3@kallisys.net> >>> No one reported that topology detection worked. > > Well, you didn't ask for that information.:-) Nor did you mention either > the FreeBSD or the OTP version where you were seeing the problem... > FWIW, it seems to work just fine for me on the 2-core/4-logical and > 4-core/8-logical FreeBSD systems I use regularly, with a variety of > FreeBSD and OTP versions. I'm also pretty sure Raimo would have > mentioned if it was broken on any of his machines. > > Since another poster also saw the problem, and mentioned that he was > running FreeBSD 10.something, it might be a FreeBSD-10-specific problem > - personally I haven't tried Erlang/OTP on FreeBSD-10 yet. I am amazed that the parser is written (which I authored) instead of being debugged? I don't mean it's exceptional code, and it actually needed more love and especially tests? The issue is not FreeBSD 10 but rather FreeBSD 10's default compiler (clang). There was a bug in this code with an undefined behavior. Older versions of gcc (which we use) behave as expected by the code, while clang and gcc devel (4.9) do not (only gcc 4.9 warns about it). I pushed a three-line fix : https://github.com/pguyot/otp/commit/c8ae3f2797d9c613e07b916683c51efea2da81aa This fix has the advantage of not introducing unwanted regression. Garret, could you please test it and determine if it works for you? I am definitely willing to debug this old code if you do provide unworking outputs of kern.sched.topology_spec. As a side note, I'm wondering why your code reads the number of cores with sysctl kern.smp.cpus. This is filled by the emulator upstream. Paul -- Semiocast https://urldefense.proofpoint.com/v1/url?u=http://semiocast.com/&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=%2BeQ4KDUqB%2Ba5p47eZISTJX4bLLnoLmTlWbkSNWD9lg0%3D%0A&m=FRskHluaRj5g5CmdMtt2fpqEsXrw5uG3NvKr4zemG8s%3D%0A&s=3880a517df1d49a49e236d21eee7604d24d5c084ca49a6a7736a13700d489ea4 +33.183627948 - 20 rue Lacaze, 75014 Paris _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED https://urldefense.proofpoint.com/v1/url?u=http://erlang.org/mailman/listinfo/erlang-questions&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=%2BeQ4KDUqB%2Ba5p47eZISTJX4bLLnoLmTlWbkSNWD9lg0%3D%0A&m=FRskHluaRj5g5CmdMtt2fpqEsXrw5uG3NvKr4zemG8s%3D%0A&s=09705ed8a6bbfa927099cb2f5604972e6ac2e14f37a389bb32e67f90afd1b390 From jesper.louis.andersen@REDACTED Sun Oct 19 16:11:07 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 19 Oct 2014 07:11:07 -0700 Subject: [erlang-questions] Erlang and huge pages. In-Reply-To: References: Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From lloyd@REDACTED Sun Oct 19 20:24:22 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sun, 19 Oct 2014 11:24:22 -0700 Subject: [erlang-questions] Help! Drowning in qlc documentation In-Reply-To: <15A53E61-1A0E-41C7-9B2B-66207C3B044C@feuerlabs.com> References: <1413647208.331211227@apps.rackspace.com> <15A53E61-1A0E-41C7-9B2B-66207C3B044C@feuerlabs.com> Message-ID: <1413743062.30771552@apps.rackspace.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From lloyd@REDACTED Sun Oct 19 20:24:22 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sun, 19 Oct 2014 11:24:22 -0700 Subject: [erlang-questions] Help! Drowning in qlc documentation In-Reply-To: <15A53E61-1A0E-41C7-9B2B-66207C3B044C@feuerlabs.com> References: <1413647208.331211227@apps.rackspace.com> <15A53E61-1A0E-41C7-9B2B-66207C3B044C@feuerlabs.com> Message-ID: <1413743062.30771552@apps.rackspace.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From andrew.j.stone.1@REDACTED Mon Oct 20 05:49:04 2014 From: andrew.j.stone.1@REDACTED (Andrew Stone) Date: Sun, 19 Oct 2014 23:49:04 -0400 Subject: [erlang-questions] isatty/1 [erlang/otp#480] In-Reply-To: References: Message-ID: I'm very late in responding to this, as I was on vacation and then procrastinating. Tuncer, I just want to know if I'm talking to a file so I can omit writing escape codes with io:format when attempting to write a warning in red to the user. If the escape codes do get written to a file by automated tooling, the file it will have things like \e[0;31m in there, obscuring the output. It'd be better if we swapped that for an [Err] or just omitted it altogether in that case. For those playing along at home here is the summary: * I submitted a BIF os:isatty/1 that took the atoms stdin/stderr/stdout and would say if the file descriptor was a tty. * The stated purpose was to detect if the FD was NOT a tty and therefore allow a user program to make a decision about whether it wanted to write some escape code to that device * Detecting the type of device was never a goal of this PR. Checking $TERM on most *nix systems is acceptable. * It was suggested that this be moved to the I/O subsystem (io:isatty/1), to take a group_leader instead of the atoms stdin/stdout/stderr and do the check in the driver. * A second patch was written that did the above for all systems except windows, as windows does not support isatty nor ansi escape codes (_isatty/1 does exist and provides similar guarantees to isatty). * This second patch was deemed unacceptable by the OTP team since isatty would not be relevant to windows users. * OTP team declined both patches. Now, as before, we are left with a situation where *nix and Windows users cannot determine whether the output is going to a terminal. * The OTP team suggested that instead the I/O protocol be modified to handle all possible escape codes so that different backend code could be written on windows to emulate the escape codes of ANSI and other terminals. It was also suggested that an ncurses like interface may be provided * I declined to do that work, and it is up for grabs. I expect that most people on here don't use Windows for running their Erlang code and they may find the patches in the attached PR useful. Feel free to use that code in your own builds. There are also many other useful posix functions that would benefit a lot of Erlang developers, but it looks like for now that code will have to be relegated to NIFs or custom builds. Maybe one day we can have a posix module included in the erlang distribution that provides these functions. What do you all think? -Andrew On Mon, Oct 6, 2014 at 12:04 PM, Tuncer Ayaz wrote: > Hi Lukas and Andrew, > > as the original ticket[1] was closed and it was suggested to continue > the discussion on the mailing list, let's try to conclude the > discussion regarding the usefulness of isatty/1 here. > > Lukas wrote: > > The only check that I can think of that you can do with isatty is > > checking if the IODevice definitely does not support any escape > > sequences. Getting true back does (afaik) not give you any details > > about how you can communicate with it. > > From what I understood, detecting that it's not an interactive > terminal is sufficient for Andrew to decide that the output should > automatically go to a file. This appears to be reasonable and useful > regardless of escape codes. Thoughts? > > > [1] https://github.com/erlang/otp/pull/480 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Mon Oct 20 08:30:49 2014 From: ok@REDACTED (ok@REDACTED) Date: Mon, 20 Oct 2014 19:30:49 +1300 Subject: [erlang-questions] isatty/1 [erlang/otp#480] In-Reply-To: References: Message-ID: (1) Consider an alternative. Write your ANSI escape sequences always. Write a separate program that either strips them out or converts the file to HTML, so that it can be viewed in a browser with the intended colours. (2) Sometimes output is going BOTH to a file AND to a terminal, using for example tee(1) or script(1), and it is not your program that controls this. (3) Windows claims (or claimed) to have a POSIX interface. isatty(3) is a POSIX function. Therefore isatty(3) has *some* relevance. There does not appear to be any reason why a modern Windows program cannot write to a COM port. What happens when you Telnet/SSH to/from a Windows box? The rough equivalent of ioctl() in Windows seems to be DeviceIoControl http://msdn.microsoft.com/en-us/library/windows/desktop/bb968800(v=vs.85).aspx but I've never used it for anything, so don't really know. (4) OpenSolaris implemented 'isatty' by testing ioctl(f, TCGETA, &tty) >= 0. From ok@REDACTED Mon Oct 20 08:30:53 2014 From: ok@REDACTED (ok@REDACTED) Date: Mon, 20 Oct 2014 19:30:53 +1300 Subject: [erlang-questions] isatty/1 [erlang/otp#480] In-Reply-To: References: Message-ID: <6bd98f56d5a3b15a884c4e32eb3f3661.squirrel@chasm.otago.ac.nz> (1) Consider an alternative. Write your ANSI escape sequences always. Write a separate program that either strips them out or converts the file to HTML, so that it can be viewed in a browser with the intended colours. (2) Sometimes output is going BOTH to a file AND to a terminal, using for example tee(1) or script(1), and it is not your program that controls this. (3) Windows claims (or claimed) to have a POSIX interface. isatty(3) is a POSIX function. Therefore isatty(3) has *some* relevance. There does not appear to be any reason why a modern Windows program cannot write to a COM port. What happens when you Telnet/SSH to/from a Windows box? The rough equivalent of ioctl() in Windows seems to be DeviceIoControl http://msdn.microsoft.com/en-us/library/windows/desktop/bb968800(v=vs.85).aspx but I've never used it for anything, so don't really know. (4) OpenSolaris implemented 'isatty' by testing ioctl(f, TCGETA, &tty) >= 0. From per@REDACTED Mon Oct 20 09:13:00 2014 From: per@REDACTED (Per Hedeland) Date: Mon, 20 Oct 2014 09:13:00 +0200 (CEST) Subject: [erlang-questions] FreeBSD cpu topology detection In-Reply-To: <630E734F-EBD3-4EEA-9A0B-CC1DAFD4AFF3@kallisys.net> Message-ID: <201410200713.s9K7D0ba031186@pluto.hedeland.org> Paul Guyot wrote: >[I wrote:] >> >> Since another poster also saw the problem, and mentioned that he was >> running FreeBSD 10.something, it might be a FreeBSD-10-specific problem >> - personally I haven't tried Erlang/OTP on FreeBSD-10 yet. > >I am amazed that the parser is written (which I authored) instead of being debugged??? I don't mean it's exceptional code, and it actually needed more love and especially tests??? > >The issue is not FreeBSD 10 but rather FreeBSD 10's default compiler (clang). There was a bug in this code with an undefined behavior. Older versions of gcc (which we use) behave as expected by the code, while clang and gcc devel (4.9) do not (only gcc 4.9 warns about it). Ah, that explains it! I actually had 10.0 installed in a different partition on the 2-core/4-logical box (running FreeBSD 9.1) where the topology detection worked fine, and trying out 10.0 on that box with the FreeBSD Erlang package (pre-compiled, presumably by clang) I also got the 'undefined'. But kern.sched.topology_spec was identical between 9.1 and 10.0! --Per >I pushed a three-line fix : >https://github.com/pguyot/otp/commit/c8ae3f2797d9c613e07b916683c51efea2da81aa > >This fix has the advantage of not introducing unwanted regression. > >Garret, could you please test it and determine if it works for you? >I am definitely willing to debug this old code if you do provide unworking outputs of kern.sched.topology_spec. > >As a side note, I'm wondering why your code reads the number of cores with sysctl kern.smp.cpus. This is filled by the emulator upstream. > >Paul From raimo+erlang-questions@REDACTED Mon Oct 20 09:17:59 2014 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Mon, 20 Oct 2014 09:17:59 +0200 Subject: [erlang-questions] FreeBSD cpu topology detection In-Reply-To: <201410181055.s9IAtsB8099440@pluto.hedeland.org> References: <201410181055.s9IAtsB8099440@pluto.hedeland.org> Message-ID: <20141020071759.GA594@erix.ericsson.se> On Sat, Oct 18, 2014 at 12:55:54PM +0200, Per Hedeland wrote: > Garret Smith wrote: > > > >On Fri, Oct 17, 2014 at 9:34 AM, Garret Smith wrote: > >> On Thu, Oct 16, 2014 at 6:04 PM, Garret Smith wrote: > >>> CPU topology detection seems broken (at least incomplete) on FreeBSD. > >>> erlang:system_info(cpu_topology) returns 'undefined' on the few machines I > >>> have at my disposal. > >>> > >>> I'm going to take a stab at a patch, but I'd like some help from other > >>> FreeBSD users out there first. > >>> > >>> Can any FreeBSD users please send me: > >>> a) the output of 'sysctl kern.sched.topology_spec' > >>> b) a few lines from your 'dmesg' about the processor configuration like: > >>> FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs > >>> FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 SMT threads > >>> > >>> Even if your topology is correctly determined, this info will help me ensure > >>> I don't introduce a regression. > >>> > >>> Thanks, > >>> Garret > >> > >> Thank you to all who sent me information. > >> > >> I now have a good collection of systems with {2, 4, 8} logical > >> processors and {2, 4} cores. Any info on machines with >8 logical > >> processors would be appreciated. > >> > >> No one reported that topology detection worked. > > Well, you didn't ask for that information.:-) Nor did you mention either > the FreeBSD or the OTP version where you were seeing the problem... > FWIW, it seems to work just fine for me on the 2-core/4-logical and > 4-core/8-logical FreeBSD systems I use regularly, with a variety of > FreeBSD and OTP versions. I'm also pretty sure Raimo would have > mentioned if it was broken on any of his machines. Well, as you said, the information was not asked for... erlang:system_info(cpu_topology) -> undefined on all the machines i reported for. And that with a mixture of erlang installed from FreeBSD ports and built from source (I have not tried all cominations). But all machines report the correct number of cores in the SMP prompt and starts the correct number of schedulers, so missing cpu topology is not something that affects our daily tests therefore has not been prioritized, hardly even noticed. / Raimo Niskanen > > Since another poster also saw the problem, and mentioned that he was > running FreeBSD 10.something, it might be a FreeBSD-10-specific problem > - personally I haven't tried Erlang/OTP on FreeBSD-10 yet. > > >First cut is up at: > >https://github.com/garret-smith/otp/tree/gs-freebsd-cpu-topology > >I get the correct topology for my machine and the XML samples I was sent. > > > >Any additional testing before I submit to the OTP team next week would > >be appreciated. I don't think they have a lot of boxen to really > >exercise this. > > I'll try to verify that it doesn't break what is working for me...:-) > > --Per Hedeland > > PS Also note that there is an actively maintained FreeBSD "port" for > Erlang (currently at 17.3) - it seems a bit unlikely that total > brokenness of the topology detection *in the version used by the port* > would go unnoticed by the port maintainer. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From bog495@REDACTED Mon Oct 20 10:26:47 2014 From: bog495@REDACTED (Bogdan Andu) Date: Mon, 20 Oct 2014 11:26:47 +0300 Subject: [erlang-questions] [POODLE] SSLv3 dezactivation in Erlang VM Message-ID: Hello, I am trying to dezactivate SSLv3 protocol and keep active only TLSv1 protocol for an Erlang virtual machine using: 1) command line switch: erl ... -ssl protocol_version '[tlsv1]' 2) pass to the ssl:listen/2 function the option: {versions, [tlsv1]} Neither of the above has effect. When starting the vm I see this: (test@REDACTED)2> ssl:versions(). [{ssl_app,"4.1.6"}, {supported,[tlsv1]}, {available,[tlsv1,sslv3]}] (test@REDACTED)3> however, when I execute the command: $ openssl s_client -connect 10.10.11.66:5151 -ssl3 I see that the handshake is successful: .................. SSL handshake has read 2944 bytes and written 338 bytes --- New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE SSL-Session: Protocol : SSLv3 Cipher : DHE-RSA-AES256-SHA Session-ID: A4B1A5AA7DE23C5691C8C982E5EC18F577561508F951778B7B5E19E468A91749 Session-ID-ctx: Master-Key: 4B04633A344F789EDB0B330BB2454EB7E19BF298461A440A04F1C6CE4F0772C02587B23127B966E84CF2571939AA4F3A Key-Arg : None Krb5 Principal: None PSK identity: None PSK identity hint: None Start Time: 1413793000 Timeout : 7200 (sec) Verify return code: 0 (ok) The handshake shouldn't be successful. But when I execute the command: $ openssl s_client -connect 10.10.11.66:5151 -ssl2 No client certificate CA names sent --- SSL handshake has read 7 bytes and written 48 bytes --- New, (NONE), Cipher is (NONE) Secure Renegotiation IS NOT supported Compression: NONE Expansion: NONE SSL-Session: Protocol : SSLv2 Cipher : 0000 Session-ID: Session-ID-ctx: Master-Key: Key-Arg : None Krb5 Principal: None PSK identity: None PSK identity hint: None Start Time: 1413793132 Timeout : 300 (sec) Verify return code: 0 (ok) --- The protocol is refused because is disabled by default. The same thing I want to happen with SSLv3 protocol. I don't know what I am missing. What should I do to instruct the Erlang vm to accept ssl connections using only TLSv1 protocol? the version of vm is: Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:8:8] [rq:8] [async-threads:0] [kernel-poll:false] Thank you , Bogdan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Mon Oct 20 11:20:36 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 20 Oct 2014 11:20:36 +0200 Subject: [erlang-questions] Removing SSL v3 support from the ssl module In-Reply-To: References: <20141015091030.GA52663@k2r.org> <2082371859.74860.1413365676640.JavaMail.zimbra@tpip.net> <368069533.74861.1413365696097.JavaMail.zimbra@tpip.net> Message-ID: Hi! >From ssl man page: [...] protocol() = sslv3 | tlsv1 | 'tlsv1.1' | 'tlsv1.2' [...] *{versions, [protocol()]}*TLS protocol versions that will be supported by started clients and servers. This option overrides the application environment option protocol_version. If the environment option is not set it defaults to all versions supported by the SSL application. See also ssl(6) from ssl(6) man page: erl ... -ssl protocol_version '[sslv3, tlsv1]' .... *protocol_version = [sslv3|tlsv1] . %% I see we need to update the documentation here to include *'tlsv1.1' | 'tlsv1.2' Protocol that will be supported by started clients and servers. If this option is not set it will default to all protocols currently supported by the erlang ssl application. Note that this option may be overridden by the version option to ssl:connect/[2,3] and ssl:listen/2. ssl:versions(). [{ssl_app,"5.3.6"}, {supported,['tlsv1.2','tlsv1.1',tlsv1,sslv3]}, {available,['tlsv1.2','tlsv1.1',tlsv1,sslv3]}] If you change the environment variable supported and available will differ. And even if all versions are available it can always be overridden by the versions option. Name choices are backwards compatible, like it or not. I do not see a reason to remove the possibility to run sslv3 altogether even though from a security perspective I would no configure my server to run it. Regards Ingela Erlang/OTP team - Ericsson AB 2014-10-16 1:41 GMT+02:00 Steve Vinoski : > > > On Wed, Oct 15, 2014 at 5:34 AM, Andreas Schultz > wrote: > >> Hi, >> ----- On 15 Oct, 2014, at 11:10, Kenji Rikitake kenji@REDACTED wrote: >> >> > I'd be glad if how to remove SSL v3 support from OTP ssl module is >> > provided by the OTP Team, to prevent getting trapped into the POODLE >> > bug. (I think it won't be that hard, regarding what I've found from the >> > ssl module source code. The keyword atom is "sslv3".) >> >> Add {versions, ['tlsv1.2', 'tls1.1', 'tls1']} to your SSL options to >> restrict >> the version choice. > > > Slight correction: {versions, ['tlsv1.2', 'tlsv1.1', 'tlsv1']} > > The 'v' characters were missing from the latter two atoms. > > --steve > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Mon Oct 20 12:28:08 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 20 Oct 2014 12:28:08 +0200 Subject: [erlang-questions] [POODLE] SSLv3 dezactivation in Erlang VM In-Reply-To: References: Message-ID: Hi! R14B04 is a really old release, time to upgrade I would say, featuring ssl-4.X.Y, I think you are seeing a bug fixed in ssl-5.3 Fixed Bugs and Malfunctions - Honor the versions option to ssl:connect and ssl:listen. Own Id: OTP-10905 Regards Ingela Erlang/OTP team - Ericsson AB 2014-10-20 10:26 GMT+02:00 Bogdan Andu : > Hello, > > I am trying to dezactivate SSLv3 protocol and keep active only TLSv1 > protocol for an Erlang virtual machine using: > 1) command line switch: > erl ... -ssl protocol_version '[tlsv1]' > 2) pass to the ssl:listen/2 function the option: {versions, [tlsv1]} > > Neither of the above has effect. > > When starting the vm I see this: > (test@REDACTED)2> ssl:versions(). > [{ssl_app,"4.1.6"}, > {supported,[tlsv1]}, > {available,[tlsv1,sslv3]}] > (test@REDACTED)3> > > > however, when I execute the command: > $ openssl s_client -connect 10.10.11.66:5151 -ssl3 > I see that the handshake is successful: > .................. > > SSL handshake has read 2944 bytes and written 338 bytes > --- > New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA > Server public key is 2048 bit > Secure Renegotiation IS supported > Compression: NONE > Expansion: NONE > SSL-Session: > Protocol : SSLv3 > Cipher : DHE-RSA-AES256-SHA > Session-ID: > A4B1A5AA7DE23C5691C8C982E5EC18F577561508F951778B7B5E19E468A91749 > Session-ID-ctx: > Master-Key: > 4B04633A344F789EDB0B330BB2454EB7E19BF298461A440A04F1C6CE4F0772C02587B23127B966E84CF2571939AA4F3A > Key-Arg : None > Krb5 Principal: None > PSK identity: None > PSK identity hint: None > Start Time: 1413793000 > Timeout : 7200 (sec) > Verify return code: 0 (ok) > > > The handshake shouldn't be successful. > > But when I execute the command: > $ openssl s_client -connect 10.10.11.66:5151 -ssl2 > > No client certificate CA names sent > --- > SSL handshake has read 7 bytes and written 48 bytes > --- > New, (NONE), Cipher is (NONE) > Secure Renegotiation IS NOT supported > Compression: NONE > Expansion: NONE > SSL-Session: > Protocol : SSLv2 > Cipher : 0000 > Session-ID: > Session-ID-ctx: > Master-Key: > Key-Arg : None > Krb5 Principal: None > PSK identity: None > PSK identity hint: None > Start Time: 1413793132 > Timeout : 300 (sec) > Verify return code: 0 (ok) > --- > > The protocol is refused because is disabled by default. > > The same thing I want to happen with SSLv3 protocol. > > I don't know what I am missing. > > What should I do to instruct the Erlang vm to accept ssl connections using > only TLSv1 protocol? > > the version of vm is: > > Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:8:8] [rq:8] > [async-threads:0] [kernel-poll:false] > > Thank you , > > Bogdan > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ceo@REDACTED Mon Oct 20 11:45:55 2014 From: ceo@REDACTED (Rohan Sarker) Date: Mon, 20 Oct 2014 05:45:55 -0400 (EDT) Subject: [erlang-questions] Query on Chatting Backend Monitoring Message-ID: <1684353785.8838.1413798355995.JavaMail.vpopmail@webmail3.networksolutionsemail.com> Dear Manager / Reviewer, I am having a website at www.rohansarker.com . I want to know if there is any Erlang code by which I can monitor Facebook Backend chatting records of chatting done by me in Facebook. I am providing the example code: File messenger.erl in link: http://www.erlang.org/doc/getting_started/conc_prog.html Also can it be done for recording chatting records for Twitter & LinkedIn? My next query is: From an Internet Search I found that there is no way to create a Windows Installer (.EXE) in Windows from Erlang Source Code for a customized application (Say an Switch Erlang Load Calculator). Is it correct? My Machine is Dell Vostro with Intel Processor (32 Bit OS) with Windows 7. Please let me know the answers. Thank you. Regards Rohan Sarker CEO & Founder SwitchGate CrystalShift www.rohansarker.com http://about.me/rohansarker https://www.facebook.com/rohan.sarker.5 https://www.facebook.com/switchgatecrystalshift +913324288069 +917278539338 +919674221741 Skype: arati_genius -------------- next part -------------- An HTML attachment was scrubbed... URL: From mabrek@REDACTED Mon Oct 20 13:19:30 2014 From: mabrek@REDACTED (Anton Lebedevich) Date: Mon, 20 Oct 2014 15:19:30 +0400 Subject: [erlang-questions] centos 6.5 OOM kills heart process making restart impossible Message-ID: <5444EFC2.3020400@gmail.com> Hello. When erlang process (erlang-17.3-2.el6 from Erlang Solutions packages) eats too much memory under CentOS 6.5 it is killed by OOM killer which is expected. But when I run it with -heart the heartbeat process gets killed first because it's a child of beam.smp which has the largest OOM score. It makes erlang application stop forever because both beam.smp and heart are dead. I don't remember similar problems under R14-16 and Debian. Is there any way to make sure that beam.smp is killed first to allow heat process to restart it? Regards, Anton Lebedevich. From bog495@REDACTED Mon Oct 20 13:42:03 2014 From: bog495@REDACTED (Bogdan Andu) Date: Mon, 20 Oct 2014 14:42:03 +0300 Subject: [erlang-questions] [POODLE] SSLv3 dezactivation in Erlang VM In-Reply-To: References: Message-ID: Hi Ingela, Thank you for reply so quickly. You are right, R14 is rather old, but in the near future this is my only option to run my production application server that servers ssl connections as this is a per policy decision and the pressure upon me is high to disable SSLv3 support from the management. Is there a workaround to enable this functionality on R14, or is there a patch that could be cleanly applied on a R14B04 otp release? Best Regards, Bogdan On Mon, Oct 20, 2014 at 1:28 PM, Ingela Andin wrote: > Hi! > > R14B04 is a really old release, time to upgrade I would say, featuring > ssl-4.X.Y, I think you are seeing a bug fixed in ssl-5.3 > Fixed Bugs and Malfunctions > > - > > Honor the versions option to ssl:connect and ssl:listen. > > Own Id: OTP-10905 > > > Regards Ingela Erlang/OTP team - Ericsson AB > > 2014-10-20 10:26 GMT+02:00 Bogdan Andu : > >> Hello, >> >> I am trying to dezactivate SSLv3 protocol and keep active only TLSv1 >> protocol for an Erlang virtual machine using: >> 1) command line switch: >> erl ... -ssl protocol_version '[tlsv1]' >> 2) pass to the ssl:listen/2 function the option: {versions, [tlsv1]} >> >> Neither of the above has effect. >> >> When starting the vm I see this: >> (test@REDACTED)2> ssl:versions(). >> [{ssl_app,"4.1.6"}, >> {supported,[tlsv1]}, >> {available,[tlsv1,sslv3]}] >> (test@REDACTED)3> >> >> >> however, when I execute the command: >> $ openssl s_client -connect 10.10.11.66:5151 -ssl3 >> I see that the handshake is successful: >> .................. >> >> SSL handshake has read 2944 bytes and written 338 bytes >> --- >> New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA >> Server public key is 2048 bit >> Secure Renegotiation IS supported >> Compression: NONE >> Expansion: NONE >> SSL-Session: >> Protocol : SSLv3 >> Cipher : DHE-RSA-AES256-SHA >> Session-ID: >> A4B1A5AA7DE23C5691C8C982E5EC18F577561508F951778B7B5E19E468A91749 >> Session-ID-ctx: >> Master-Key: >> 4B04633A344F789EDB0B330BB2454EB7E19BF298461A440A04F1C6CE4F0772C02587B23127B966E84CF2571939AA4F3A >> Key-Arg : None >> Krb5 Principal: None >> PSK identity: None >> PSK identity hint: None >> Start Time: 1413793000 >> Timeout : 7200 (sec) >> Verify return code: 0 (ok) >> >> >> The handshake shouldn't be successful. >> >> But when I execute the command: >> $ openssl s_client -connect 10.10.11.66:5151 -ssl2 >> >> No client certificate CA names sent >> --- >> SSL handshake has read 7 bytes and written 48 bytes >> --- >> New, (NONE), Cipher is (NONE) >> Secure Renegotiation IS NOT supported >> Compression: NONE >> Expansion: NONE >> SSL-Session: >> Protocol : SSLv2 >> Cipher : 0000 >> Session-ID: >> Session-ID-ctx: >> Master-Key: >> Key-Arg : None >> Krb5 Principal: None >> PSK identity: None >> PSK identity hint: None >> Start Time: 1413793132 >> Timeout : 300 (sec) >> Verify return code: 0 (ok) >> --- >> >> The protocol is refused because is disabled by default. >> >> The same thing I want to happen with SSLv3 protocol. >> >> I don't know what I am missing. >> >> What should I do to instruct the Erlang vm to accept ssl connections >> using only TLSv1 protocol? >> >> the version of vm is: >> >> Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:8:8] [rq:8] >> [async-threads:0] [kernel-poll:false] >> >> Thank you , >> >> Bogdan >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.santos@REDACTED Mon Oct 20 13:52:33 2014 From: michael.santos@REDACTED (Michael Santos) Date: Mon, 20 Oct 2014 07:52:33 -0400 Subject: [erlang-questions] centos 6.5 OOM kills heart process making restart impossible In-Reply-To: <5444EFC2.3020400@gmail.com> References: <5444EFC2.3020400@gmail.com> Message-ID: <20141020115233.GA1791@brk> On Mon, Oct 20, 2014 at 03:19:30PM +0400, Anton Lebedevich wrote: > Hello. > > When erlang process (erlang-17.3-2.el6 from Erlang Solutions packages) > eats too much memory under CentOS 6.5 it is killed by OOM killer which > is expected. > But when I run it with -heart the heartbeat process gets killed first > because it's a child of beam.smp which has the largest OOM score. It > makes erlang application stop forever because both beam.smp and heart > are dead. > I don't remember similar problems under R14-16 and Debian. > > Is there any way to make sure that beam.smp is killed first to allow > heat process to restart it? Disable the OOM killer. Add to /etc/sysctl.conf: vm.overcommit_memory=2 vm.overcommit_ratio=90 The OOM killer can also be disabled per process. For example, if the PID of heart is 12345: sudo echo -1000 > /proc/12345/oom_adj_score cat /proc/12345/oom_adj_score -1000 See proc(5) for details. From ingela.andin@REDACTED Mon Oct 20 15:17:39 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 20 Oct 2014 15:17:39 +0200 Subject: [erlang-questions] [POODLE] SSLv3 dezactivation in Erlang VM In-Reply-To: References: Message-ID: The commit that solves the problem is: bfb408ae3d424bf8f510806434eb14a730adc4fb How easy it is to port it to R14 I do not know, but I think doing so is proably your best option if you can not upgrade. Regards Ingela Erlang/OTP Team - Ericsson AB 2014-10-20 13:42 GMT+02:00 Bogdan Andu : > Hi Ingela, > > Thank you for reply so quickly. > > You are right, R14 is rather old, but in the near future this is my only > option to run my > production application server that servers ssl connections as this is a > per policy decision > and the pressure upon me is high to disable SSLv3 support from the > management. > > Is there a workaround to enable this functionality on R14, or is there a > patch that > could be cleanly applied on a R14B04 otp release? > > Best Regards, > > Bogdan > > > On Mon, Oct 20, 2014 at 1:28 PM, Ingela Andin > wrote: > >> Hi! >> >> R14B04 is a really old release, time to upgrade I would say, featuring >> ssl-4.X.Y, I think you are seeing a bug fixed in ssl-5.3 >> Fixed Bugs and Malfunctions >> >> - >> >> Honor the versions option to ssl:connect and ssl:listen. >> >> Own Id: OTP-10905 >> >> >> Regards Ingela Erlang/OTP team - Ericsson AB >> >> 2014-10-20 10:26 GMT+02:00 Bogdan Andu : >> >>> Hello, >>> >>> I am trying to dezactivate SSLv3 protocol and keep active only TLSv1 >>> protocol for an Erlang virtual machine using: >>> 1) command line switch: >>> erl ... -ssl protocol_version '[tlsv1]' >>> 2) pass to the ssl:listen/2 function the option: {versions, [tlsv1]} >>> >>> Neither of the above has effect. >>> >>> When starting the vm I see this: >>> (test@REDACTED)2> ssl:versions(). >>> [{ssl_app,"4.1.6"}, >>> {supported,[tlsv1]}, >>> {available,[tlsv1,sslv3]}] >>> (test@REDACTED)3> >>> >>> >>> however, when I execute the command: >>> $ openssl s_client -connect 10.10.11.66:5151 -ssl3 >>> I see that the handshake is successful: >>> .................. >>> >>> SSL handshake has read 2944 bytes and written 338 bytes >>> --- >>> New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA >>> Server public key is 2048 bit >>> Secure Renegotiation IS supported >>> Compression: NONE >>> Expansion: NONE >>> SSL-Session: >>> Protocol : SSLv3 >>> Cipher : DHE-RSA-AES256-SHA >>> Session-ID: >>> A4B1A5AA7DE23C5691C8C982E5EC18F577561508F951778B7B5E19E468A91749 >>> Session-ID-ctx: >>> Master-Key: >>> 4B04633A344F789EDB0B330BB2454EB7E19BF298461A440A04F1C6CE4F0772C02587B23127B966E84CF2571939AA4F3A >>> Key-Arg : None >>> Krb5 Principal: None >>> PSK identity: None >>> PSK identity hint: None >>> Start Time: 1413793000 >>> Timeout : 7200 (sec) >>> Verify return code: 0 (ok) >>> >>> >>> The handshake shouldn't be successful. >>> >>> But when I execute the command: >>> $ openssl s_client -connect 10.10.11.66:5151 -ssl2 >>> >>> No client certificate CA names sent >>> --- >>> SSL handshake has read 7 bytes and written 48 bytes >>> --- >>> New, (NONE), Cipher is (NONE) >>> Secure Renegotiation IS NOT supported >>> Compression: NONE >>> Expansion: NONE >>> SSL-Session: >>> Protocol : SSLv2 >>> Cipher : 0000 >>> Session-ID: >>> Session-ID-ctx: >>> Master-Key: >>> Key-Arg : None >>> Krb5 Principal: None >>> PSK identity: None >>> PSK identity hint: None >>> Start Time: 1413793132 >>> Timeout : 300 (sec) >>> Verify return code: 0 (ok) >>> --- >>> >>> The protocol is refused because is disabled by default. >>> >>> The same thing I want to happen with SSLv3 protocol. >>> >>> I don't know what I am missing. >>> >>> What should I do to instruct the Erlang vm to accept ssl connections >>> using only TLSv1 protocol? >>> >>> the version of vm is: >>> >>> Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:8:8] [rq:8] >>> [async-threads:0] [kernel-poll:false] >>> >>> Thank you , >>> >>> Bogdan >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz@REDACTED Mon Oct 20 16:02:40 2014 From: aschultz@REDACTED (Andreas Schultz) Date: Mon, 20 Oct 2014 14:02:40 +0000 (UTC) Subject: [erlang-questions] [POODLE] SSLv3 dezactivation in Erlang VM In-Reply-To: <2053076454.17524.1413813723933.JavaMail.zimbra@tpip.net> References: Message-ID: <1074918737.17525.1413813760288.JavaMail.zimbra@tpip.net> Hi, ----- On 20 Oct, 2014, at 15:17, Ingela Andin ingela.andin@REDACTED wrote: > The commit that solves the problem is: > > bfb408ae3d424bf8f510806434eb14a730adc4fb > > How easy it is to port it to R14 I do not know, but I think doing so is proably > your best option if you can not > upgrade. Instead of back-porting, you could always adjust this define in ssl_internal.hrl: -define(DEFAULT_SUPPORTED_VERSIONS, [tlsv1, sslv3]). Andreas > > Regards Ingela Erlang/OTP Team - Ericsson AB > > 2014-10-20 13:42 GMT+02:00 Bogdan Andu < bog495@REDACTED > : > > > > Hi Ingela, > > Thank you for reply so quickly. > > You are right, R14 is rather old, but in the near future this is my only option > to run my > production application server that servers ssl connections as this is a per > policy decision > and the pressure upon me is high to disable SSLv3 support from the management. > > Is there a workaround to enable this functionality on R14, or is there a patch > that > could be cleanly applied on a R14B04 otp release? > > Best Regards, > > Bogdan > > > On Mon, Oct 20, 2014 at 1:28 PM, Ingela Andin < ingela.andin@REDACTED > wrote: > > > > Hi! > > > R14B04 is a really old release, time to upgrade I would say, featuring > ssl-4.X.Y, I think you are seeing a bug fixed in ssl- 5.3 Fixed Bugs and > Malfunctions > > > * > > Honor the versions option to ssl:connect and ssl:listen. > > Own Id: OTP-10905 > > Regards Ingela Erlang/OTP team - Ericsson AB > > 2014-10-20 10:26 GMT+02:00 Bogdan Andu < bog495@REDACTED > : > > > > Hello, > > I am trying to dezactivate SSLv3 protocol and keep active only TLSv1 protocol > for an Erlang virtual machine using: > 1) command line switch: > erl ... -ssl protocol_version '[tlsv1]' > 2) pass to the ssl:listen/2 function the option: {versions, [tlsv1]} > > Neither of the above has effect. > > When starting the vm I see this: > (test@REDACTED)2> ssl:versions(). > [{ssl_app,"4.1.6"}, > {supported,[tlsv1]}, > {available,[tlsv1,sslv3]}] > ( test@REDACTED) 3> > > > however, when I execute the command: > $ openssl s_client -connect 10.10.11.66:5151 -ssl3 > I see that the handshake is successful : > .................. > > SSL handshake has read 2944 bytes and written 338 bytes > --- > New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA > Server public key is 2048 bit > Secure Renegotiation IS supported > Compression: NONE > Expansion: NONE > SSL-Session: > Protocol : SSLv3 > Cipher : DHE-RSA-AES256-SHA > Session-ID: A4B1A5AA7DE23C5691C8C982E5EC18F577561508F951778B7B5E19E468A91749 > Session-ID-ctx: > Master-Key: > 4B04633A344F789EDB0B330BB2454EB7E19BF298461A440A04F1C6CE4F0772C02587B23127B966E84CF2571939AA4F3A > Key-Arg : None > Krb5 Principal: None > PSK identity: None > PSK identity hint: None > Start Time: 1413793000 > Timeout : 7200 (sec) > Verify return code: 0 (ok) > > > The handshake shouldn't be successful. > > But when I execute the command: > $ openssl s_client -connect 10.10.11.66:5151 -ssl2 > > No client certificate CA names sent > --- > SSL handshake has read 7 bytes and written 48 bytes > --- > New, (NONE), Cipher is (NONE) > Secure Renegotiation IS NOT supported > Compression: NONE > Expansion: NONE > SSL-Session: > Protocol : SSLv2 > Cipher : 0000 > Session-ID: > Session-ID-ctx: > Master-Key: > Key-Arg : None > Krb5 Principal: None > PSK identity: None > PSK identity hint: None > Start Time: 1413793132 > Timeout : 300 (sec) > Verify return code: 0 (ok) > --- > > The protocol is refused because is disabled by default. > > The same thing I want to happen with SSLv3 protocol. > > I don't know what I am missing. > > What should I do to instruct the Erlang vm to accept ssl connections using only > TLSv1 protocol? > > the version of vm is: > > Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:8:8] [rq:8] [async-threads:0] > [kernel-poll:false] > > Thank you , > > Bogdan > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- -- Dipl. Inform. Andreas Schultz email: as@REDACTED phone: +49-391-819099-224 mobil: +49-170-2226073 ------------------- enabling your networks ------------------- Travelping GmbH phone: +49-391-819099229 Roentgenstr. 13 fax: +49-391-819099299 D-39108 Magdeburg email: info@REDACTED GERMANY web: http://www.travelping.com Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 -------------------------------------------------------------- From bog495@REDACTED Mon Oct 20 16:44:53 2014 From: bog495@REDACTED (Bogdan Andu) Date: Mon, 20 Oct 2014 17:44:53 +0300 Subject: [erlang-questions] [POODLE] SSLv3 dezactivation in Erlang VM In-Reply-To: <1074918737.17525.1413813760288.JavaMail.zimbra@tpip.net> References: <2053076454.17524.1413813723933.JavaMail.zimbra@tpip.net> <1074918737.17525.1413813760288.JavaMail.zimbra@tpip.net> Message-ID: Thank you both for help, I definitely look into both solutions, the -define one looking the easiest. So, if I define de following as: -define(DEFAULT_SUPPORTED_VERSIONS, [tlsv1]). and recompile otp R14 there should be available only tlsv1 I presume. Thank you very much, Bogdan On Mon, Oct 20, 2014 at 5:02 PM, Andreas Schultz wrote: > Hi, > > ----- On 20 Oct, 2014, at 15:17, Ingela Andin ingela.andin@REDACTED > wrote: > > > The commit that solves the problem is: > > > > bfb408ae3d424bf8f510806434eb14a730adc4fb > > > > How easy it is to port it to R14 I do not know, but I think doing so is > proably > > your best option if you can not > > upgrade. > > Instead of back-porting, you could always adjust this define in > ssl_internal.hrl: > > -define(DEFAULT_SUPPORTED_VERSIONS, [tlsv1, sslv3]). > > Andreas > > > > > Regards Ingela Erlang/OTP Team - Ericsson AB > > > > 2014-10-20 13:42 GMT+02:00 Bogdan Andu < bog495@REDACTED > : > > > > > > > > Hi Ingela, > > > > Thank you for reply so quickly. > > > > You are right, R14 is rather old, but in the near future this is my only > option > > to run my > > production application server that servers ssl connections as this is a > per > > policy decision > > and the pressure upon me is high to disable SSLv3 support from the > management. > > > > Is there a workaround to enable this functionality on R14, or is there a > patch > > that > > could be cleanly applied on a R14B04 otp release? > > > > Best Regards, > > > > Bogdan > > > > > > On Mon, Oct 20, 2014 at 1:28 PM, Ingela Andin < ingela.andin@REDACTED > > wrote: > > > > > > > > Hi! > > > > > > R14B04 is a really old release, time to upgrade I would say, featuring > > ssl-4.X.Y, I think you are seeing a bug fixed in ssl- 5.3 Fixed Bugs and > > Malfunctions > > > > > > * > > > > Honor the versions option to ssl:connect and ssl:listen. > > > > Own Id: OTP-10905 > > > > Regards Ingela Erlang/OTP team - Ericsson AB > > > > 2014-10-20 10:26 GMT+02:00 Bogdan Andu < bog495@REDACTED > : > > > > > > > > Hello, > > > > I am trying to dezactivate SSLv3 protocol and keep active only TLSv1 > protocol > > for an Erlang virtual machine using: > > 1) command line switch: > > erl ... -ssl protocol_version '[tlsv1]' > > 2) pass to the ssl:listen/2 function the option: {versions, [tlsv1]} > > > > Neither of the above has effect. > > > > When starting the vm I see this: > > (test@REDACTED)2> ssl:versions(). > > [{ssl_app,"4.1.6"}, > > {supported,[tlsv1]}, > > {available,[tlsv1,sslv3]}] > > ( test@REDACTED) 3> > > > > > > however, when I execute the command: > > $ openssl s_client -connect 10.10.11.66:5151 -ssl3 > > I see that the handshake is successful : > > .................. > > > > SSL handshake has read 2944 bytes and written 338 bytes > > --- > > New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA > > Server public key is 2048 bit > > Secure Renegotiation IS supported > > Compression: NONE > > Expansion: NONE > > SSL-Session: > > Protocol : SSLv3 > > Cipher : DHE-RSA-AES256-SHA > > Session-ID: > A4B1A5AA7DE23C5691C8C982E5EC18F577561508F951778B7B5E19E468A91749 > > Session-ID-ctx: > > Master-Key: > > > 4B04633A344F789EDB0B330BB2454EB7E19BF298461A440A04F1C6CE4F0772C02587B23127B966E84CF2571939AA4F3A > > Key-Arg : None > > Krb5 Principal: None > > PSK identity: None > > PSK identity hint: None > > Start Time: 1413793000 > > Timeout : 7200 (sec) > > Verify return code: 0 (ok) > > > > > > The handshake shouldn't be successful. > > > > But when I execute the command: > > $ openssl s_client -connect 10.10.11.66:5151 -ssl2 > > > > No client certificate CA names sent > > --- > > SSL handshake has read 7 bytes and written 48 bytes > > --- > > New, (NONE), Cipher is (NONE) > > Secure Renegotiation IS NOT supported > > Compression: NONE > > Expansion: NONE > > SSL-Session: > > Protocol : SSLv2 > > Cipher : 0000 > > Session-ID: > > Session-ID-ctx: > > Master-Key: > > Key-Arg : None > > Krb5 Principal: None > > PSK identity: None > > PSK identity hint: None > > Start Time: 1413793132 > > Timeout : 300 (sec) > > Verify return code: 0 (ok) > > --- > > > > The protocol is refused because is disabled by default. > > > > The same thing I want to happen with SSLv3 protocol. > > > > I don't know what I am missing. > > > > What should I do to instruct the Erlang vm to accept ssl connections > using only > > TLSv1 protocol? > > > > the version of vm is: > > > > Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:8:8] [rq:8] > [async-threads:0] > > [kernel-poll:false] > > > > Thank you , > > > > Bogdan > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -- > -- > Dipl. Inform. > Andreas Schultz > > email: as@REDACTED > phone: +49-391-819099-224 > mobil: +49-170-2226073 > > ------------------- enabling your networks ------------------- > > Travelping GmbH phone: +49-391-819099229 > Roentgenstr. 13 fax: +49-391-819099299 > D-39108 Magdeburg email: info@REDACTED > GERMANY web: http://www.travelping.com > > Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 > Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 > -------------------------------------------------------------- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Mon Oct 20 18:56:27 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 20 Oct 2014 18:56:27 +0200 Subject: [erlang-questions] [POODLE] SSLv3 dezactivation in Erlang VM In-Reply-To: References: <2053076454.17524.1413813723933.JavaMail.zimbra@tpip.net> <1074918737.17525.1413813760288.JavaMail.zimbra@tpip.net> Message-ID: Hi! 2014-10-20 16:44 GMT+02:00 Bogdan Andu : > Thank you both for help, > > I definitely look into both solutions, the -define one looking the easiest. > > So, if I define de following as: > > -define(DEFAULT_SUPPORTED_VERSIONS, [tlsv1]). > > and recompile otp R14 > there should be available only tlsv1 I presume. > > Thank you very much, > > Well yes Andreas has a point that this would have the desired affect. It does not fix the bug, but as in your case of R14, disabling sslv3 would leave one version of the protocol, so I guess that would be acceptable. Regards Ingela Erlang/OTP team - Ericsson AB > Bogdan > > > > On Mon, Oct 20, 2014 at 5:02 PM, Andreas Schultz > wrote: > >> Hi, >> >> ----- On 20 Oct, 2014, at 15:17, Ingela Andin ingela.andin@REDACTED >> wrote: >> >> > The commit that solves the problem is: >> > >> > bfb408ae3d424bf8f510806434eb14a730adc4fb >> > >> > How easy it is to port it to R14 I do not know, but I think doing so is >> proably >> > your best option if you can not >> > upgrade. >> >> Instead of back-porting, you could always adjust this define in >> ssl_internal.hrl: >> >> -define(DEFAULT_SUPPORTED_VERSIONS, [tlsv1, sslv3]). >> >> Andreas >> >> > >> > Regards Ingela Erlang/OTP Team - Ericsson AB >> > >> > 2014-10-20 13:42 GMT+02:00 Bogdan Andu < bog495@REDACTED > : >> > >> > >> > >> > Hi Ingela, >> > >> > Thank you for reply so quickly. >> > >> > You are right, R14 is rather old, but in the near future this is my >> only option >> > to run my >> > production application server that servers ssl connections as this is a >> per >> > policy decision >> > and the pressure upon me is high to disable SSLv3 support from the >> management. >> > >> > Is there a workaround to enable this functionality on R14, or is there >> a patch >> > that >> > could be cleanly applied on a R14B04 otp release? >> > >> > Best Regards, >> > >> > Bogdan >> > >> > >> > On Mon, Oct 20, 2014 at 1:28 PM, Ingela Andin < ingela.andin@REDACTED >> > wrote: >> > >> > >> > >> > Hi! >> > >> > >> > R14B04 is a really old release, time to upgrade I would say, featuring >> > ssl-4.X.Y, I think you are seeing a bug fixed in ssl- 5.3 Fixed Bugs and >> > Malfunctions >> > >> > >> > * >> > >> > Honor the versions option to ssl:connect and ssl:listen. >> > >> > Own Id: OTP-10905 >> > >> > Regards Ingela Erlang/OTP team - Ericsson AB >> > >> > 2014-10-20 10:26 GMT+02:00 Bogdan Andu < bog495@REDACTED > : >> > >> > >> > >> > Hello, >> > >> > I am trying to dezactivate SSLv3 protocol and keep active only TLSv1 >> protocol >> > for an Erlang virtual machine using: >> > 1) command line switch: >> > erl ... -ssl protocol_version '[tlsv1]' >> > 2) pass to the ssl:listen/2 function the option: {versions, [tlsv1]} >> > >> > Neither of the above has effect. >> > >> > When starting the vm I see this: >> > (test@REDACTED)2> ssl:versions(). >> > [{ssl_app,"4.1.6"}, >> > {supported,[tlsv1]}, >> > {available,[tlsv1,sslv3]}] >> > ( test@REDACTED) 3> >> > >> > >> > however, when I execute the command: >> > $ openssl s_client -connect 10.10.11.66:5151 -ssl3 >> > I see that the handshake is successful : >> > .................. >> > >> > SSL handshake has read 2944 bytes and written 338 bytes >> > --- >> > New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA >> > Server public key is 2048 bit >> > Secure Renegotiation IS supported >> > Compression: NONE >> > Expansion: NONE >> > SSL-Session: >> > Protocol : SSLv3 >> > Cipher : DHE-RSA-AES256-SHA >> > Session-ID: >> A4B1A5AA7DE23C5691C8C982E5EC18F577561508F951778B7B5E19E468A91749 >> > Session-ID-ctx: >> > Master-Key: >> > >> 4B04633A344F789EDB0B330BB2454EB7E19BF298461A440A04F1C6CE4F0772C02587B23127B966E84CF2571939AA4F3A >> > Key-Arg : None >> > Krb5 Principal: None >> > PSK identity: None >> > PSK identity hint: None >> > Start Time: 1413793000 >> > Timeout : 7200 (sec) >> > Verify return code: 0 (ok) >> > >> > >> > The handshake shouldn't be successful. >> > >> > But when I execute the command: >> > $ openssl s_client -connect 10.10.11.66:5151 -ssl2 >> > >> > No client certificate CA names sent >> > --- >> > SSL handshake has read 7 bytes and written 48 bytes >> > --- >> > New, (NONE), Cipher is (NONE) >> > Secure Renegotiation IS NOT supported >> > Compression: NONE >> > Expansion: NONE >> > SSL-Session: >> > Protocol : SSLv2 >> > Cipher : 0000 >> > Session-ID: >> > Session-ID-ctx: >> > Master-Key: >> > Key-Arg : None >> > Krb5 Principal: None >> > PSK identity: None >> > PSK identity hint: None >> > Start Time: 1413793132 >> > Timeout : 300 (sec) >> > Verify return code: 0 (ok) >> > --- >> > >> > The protocol is refused because is disabled by default. >> > >> > The same thing I want to happen with SSLv3 protocol. >> > >> > I don't know what I am missing. >> > >> > What should I do to instruct the Erlang vm to accept ssl connections >> using only >> > TLSv1 protocol? >> > >> > the version of vm is: >> > >> > Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:8:8] [rq:8] >> [async-threads:0] >> > [kernel-poll:false] >> > >> > Thank you , >> > >> > Bogdan >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > >> > >> > >> > >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> >> -- >> -- >> Dipl. Inform. >> Andreas Schultz >> >> email: as@REDACTED >> phone: +49-391-819099-224 >> mobil: +49-170-2226073 >> >> ------------------- enabling your networks ------------------- >> >> Travelping GmbH phone: +49-391-819099229 >> Roentgenstr. 13 fax: +49-391-819099299 >> D-39108 Magdeburg email: info@REDACTED >> GERMANY web: http://www.travelping.com >> >> Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 >> Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 >> -------------------------------------------------------------- >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bog495@REDACTED Mon Oct 20 19:25:18 2014 From: bog495@REDACTED (Bogdan Andu) Date: Mon, 20 Oct 2014 20:25:18 +0300 Subject: [erlang-questions] [POODLE] SSLv3 dezactivation in Erlang VM In-Reply-To: References: <2053076454.17524.1413813723933.JavaMail.zimbra@tpip.net> <1074918737.17525.1413813760288.JavaMail.zimbra@tpip.net> Message-ID: Much obliged, Bogdan On Mon, Oct 20, 2014 at 7:56 PM, Ingela Andin wrote: > Hi! > > 2014-10-20 16:44 GMT+02:00 Bogdan Andu : > >> Thank you both for help, >> >> I definitely look into both solutions, the -define one looking the >> easiest. >> >> So, if I define de following as: >> >> -define(DEFAULT_SUPPORTED_VERSIONS, [tlsv1]). >> >> and recompile otp R14 >> there should be available only tlsv1 I presume. >> >> Thank you very much, >> >> > > Well yes Andreas has a point that this would have the desired affect. It > does not fix the bug, but as in your case of R14, disabling sslv3 would > leave one version of the protocol, > so I guess that would be acceptable. > > > Regards Ingela Erlang/OTP team - Ericsson AB > > > > >> Bogdan >> >> >> >> On Mon, Oct 20, 2014 at 5:02 PM, Andreas Schultz >> wrote: >> >>> Hi, >>> >>> ----- On 20 Oct, 2014, at 15:17, Ingela Andin ingela.andin@REDACTED >>> wrote: >>> >>> > The commit that solves the problem is: >>> > >>> > bfb408ae3d424bf8f510806434eb14a730adc4fb >>> > >>> > How easy it is to port it to R14 I do not know, but I think doing so >>> is proably >>> > your best option if you can not >>> > upgrade. >>> >>> Instead of back-porting, you could always adjust this define in >>> ssl_internal.hrl: >>> >>> -define(DEFAULT_SUPPORTED_VERSIONS, [tlsv1, sslv3]). >>> >>> Andreas >>> >>> > >>> > Regards Ingela Erlang/OTP Team - Ericsson AB >>> > >>> > 2014-10-20 13:42 GMT+02:00 Bogdan Andu < bog495@REDACTED > : >>> > >>> > >>> > >>> > Hi Ingela, >>> > >>> > Thank you for reply so quickly. >>> > >>> > You are right, R14 is rather old, but in the near future this is my >>> only option >>> > to run my >>> > production application server that servers ssl connections as this is >>> a per >>> > policy decision >>> > and the pressure upon me is high to disable SSLv3 support from the >>> management. >>> > >>> > Is there a workaround to enable this functionality on R14, or is there >>> a patch >>> > that >>> > could be cleanly applied on a R14B04 otp release? >>> > >>> > Best Regards, >>> > >>> > Bogdan >>> > >>> > >>> > On Mon, Oct 20, 2014 at 1:28 PM, Ingela Andin < ingela.andin@REDACTED >>> > wrote: >>> > >>> > >>> > >>> > Hi! >>> > >>> > >>> > R14B04 is a really old release, time to upgrade I would say, featuring >>> > ssl-4.X.Y, I think you are seeing a bug fixed in ssl- 5.3 Fixed Bugs >>> and >>> > Malfunctions >>> > >>> > >>> > * >>> > >>> > Honor the versions option to ssl:connect and ssl:listen. >>> > >>> > Own Id: OTP-10905 >>> > >>> > Regards Ingela Erlang/OTP team - Ericsson AB >>> > >>> > 2014-10-20 10:26 GMT+02:00 Bogdan Andu < bog495@REDACTED > : >>> > >>> > >>> > >>> > Hello, >>> > >>> > I am trying to dezactivate SSLv3 protocol and keep active only TLSv1 >>> protocol >>> > for an Erlang virtual machine using: >>> > 1) command line switch: >>> > erl ... -ssl protocol_version '[tlsv1]' >>> > 2) pass to the ssl:listen/2 function the option: {versions, [tlsv1]} >>> > >>> > Neither of the above has effect. >>> > >>> > When starting the vm I see this: >>> > (test@REDACTED)2> ssl:versions(). >>> > [{ssl_app,"4.1.6"}, >>> > {supported,[tlsv1]}, >>> > {available,[tlsv1,sslv3]}] >>> > ( test@REDACTED) 3> >>> > >>> > >>> > however, when I execute the command: >>> > $ openssl s_client -connect 10.10.11.66:5151 -ssl3 >>> > I see that the handshake is successful : >>> > .................. >>> > >>> > SSL handshake has read 2944 bytes and written 338 bytes >>> > --- >>> > New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA >>> > Server public key is 2048 bit >>> > Secure Renegotiation IS supported >>> > Compression: NONE >>> > Expansion: NONE >>> > SSL-Session: >>> > Protocol : SSLv3 >>> > Cipher : DHE-RSA-AES256-SHA >>> > Session-ID: >>> A4B1A5AA7DE23C5691C8C982E5EC18F577561508F951778B7B5E19E468A91749 >>> > Session-ID-ctx: >>> > Master-Key: >>> > >>> 4B04633A344F789EDB0B330BB2454EB7E19BF298461A440A04F1C6CE4F0772C02587B23127B966E84CF2571939AA4F3A >>> > Key-Arg : None >>> > Krb5 Principal: None >>> > PSK identity: None >>> > PSK identity hint: None >>> > Start Time: 1413793000 >>> > Timeout : 7200 (sec) >>> > Verify return code: 0 (ok) >>> > >>> > >>> > The handshake shouldn't be successful. >>> > >>> > But when I execute the command: >>> > $ openssl s_client -connect 10.10.11.66:5151 -ssl2 >>> > >>> > No client certificate CA names sent >>> > --- >>> > SSL handshake has read 7 bytes and written 48 bytes >>> > --- >>> > New, (NONE), Cipher is (NONE) >>> > Secure Renegotiation IS NOT supported >>> > Compression: NONE >>> > Expansion: NONE >>> > SSL-Session: >>> > Protocol : SSLv2 >>> > Cipher : 0000 >>> > Session-ID: >>> > Session-ID-ctx: >>> > Master-Key: >>> > Key-Arg : None >>> > Krb5 Principal: None >>> > PSK identity: None >>> > PSK identity hint: None >>> > Start Time: 1413793132 >>> > Timeout : 300 (sec) >>> > Verify return code: 0 (ok) >>> > --- >>> > >>> > The protocol is refused because is disabled by default. >>> > >>> > The same thing I want to happen with SSLv3 protocol. >>> > >>> > I don't know what I am missing. >>> > >>> > What should I do to instruct the Erlang vm to accept ssl connections >>> using only >>> > TLSv1 protocol? >>> > >>> > the version of vm is: >>> > >>> > Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:8:8] [rq:8] >>> [async-threads:0] >>> > [kernel-poll:false] >>> > >>> > Thank you , >>> > >>> > Bogdan >>> > >>> > _______________________________________________ >>> > erlang-questions mailing list >>> > erlang-questions@REDACTED >>> > http://erlang.org/mailman/listinfo/erlang-questions >>> > >>> > >>> > >>> > >>> > >>> > _______________________________________________ >>> > erlang-questions mailing list >>> > erlang-questions@REDACTED >>> > http://erlang.org/mailman/listinfo/erlang-questions >>> >>> -- >>> -- >>> Dipl. Inform. >>> Andreas Schultz >>> >>> email: as@REDACTED >>> phone: +49-391-819099-224 >>> mobil: +49-170-2226073 >>> >>> ------------------- enabling your networks ------------------- >>> >>> Travelping GmbH phone: +49-391-819099229 >>> Roentgenstr. 13 fax: +49-391-819099299 >>> D-39108 Magdeburg email: info@REDACTED >>> GERMANY web: http://www.travelping.com >>> >>> Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 >>> Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 >>> -------------------------------------------------------------- >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From garret.smith@REDACTED Mon Oct 20 22:27:58 2014 From: garret.smith@REDACTED (Garret Smith) Date: Mon, 20 Oct 2014 13:27:58 -0700 Subject: [erlang-questions] FreeBSD cpu topology detection In-Reply-To: <630E734F-EBD3-4EEA-9A0B-CC1DAFD4AFF3@kallisys.net> References: <630E734F-EBD3-4EEA-9A0B-CC1DAFD4AFF3@kallisys.net> Message-ID: On Sun, Oct 19, 2014 at 8:37 AM, Paul Guyot wrote: > >>>> No one reported that topology detection worked. >> >> Well, you didn't ask for that information.:-) Nor did you mention either >> the FreeBSD or the OTP version where you were seeing the problem... >> FWIW, it seems to work just fine for me on the 2-core/4-logical and >> 4-core/8-logical FreeBSD systems I use regularly, with a variety of >> FreeBSD and OTP versions. I'm also pretty sure Raimo would have >> mentioned if it was broken on any of his machines. >> >> Since another poster also saw the problem, and mentioned that he was >> running FreeBSD 10.something, it might be a FreeBSD-10-specific problem >> - personally I haven't tried Erlang/OTP on FreeBSD-10 yet. > > I am amazed that the parser is written (which I authored) instead of being debugged? I don't mean it's exceptional code, and it actually needed more love and especially tests? > > The issue is not FreeBSD 10 but rather FreeBSD 10's default compiler (clang). There was a bug in this code with an undefined behavior. Older versions of gcc (which we use) behave as expected by the code, while clang and gcc devel (4.9) do not (only gcc 4.9 warns about it). > > I pushed a three-line fix : > https://github.com/pguyot/otp/commit/c8ae3f2797d9c613e07b916683c51efea2da81aa > > This fix has the advantage of not introducing unwanted regression. > > Garret, could you please test it and determine if it works for you? > I am definitely willing to debug this old code if you do provide unworking outputs of kern.sched.topology_spec. > > As a side note, I'm wondering why your code reads the number of cores with sysctl kern.smp.cpus. This is filled by the emulator upstream. > > Paul > -- > Semiocast http://semiocast.com/ > +33.183627948 - 20 rue Lacaze, 75014 Paris > I had tried quite a few things with the existing code before giving up, including the FreeBSD port, manual compile with clang 3.4.1 and gcc 4.8.3. Apparently gcc 4.8.3 isn't old enough to have the proper undefined behavior. I was expecting some change in the XML on FreeBSD 10.1. I used kern.smp.cpus sysctl to pre-allocate all erts_cpu_topology_t and avoid the realloc as you have on lines 1500 and 1627. Not sure why this might be necessary since a difference in the number of (logical) CPUs read from the topology and sysctl should be an error. The patch you provided fixes CPU topology detection on my machine with both clang 3.4.1 and gcc 4.8.3. -Garret From andre.graf@REDACTED Tue Oct 21 10:10:46 2014 From: andre.graf@REDACTED (Andre Graf) Date: Tue, 21 Oct 2014 10:10:46 +0200 Subject: [erlang-questions] SSL inconsistencies in expected return values of 'ssl:connect/2' In-Reply-To: References: <543467A3.20009@erl.io> <5434FBF3.5060009@erl.io> Message-ID: <54461506.1080905@erl.io> Hello Ingela, Thanks for your response! Indeed, adding the partial_chain (just a very dump one, always returning {trusted_ca, DerCert}) option as advised solves most of the mentioned problems. However, one new inconsistency appeared as well as one question regarding CRLs remain. The test checking SSL client auth with an expired certificate fails, it happily accepts a connection {ok, Socket} with the expired certificate on 17, whereas R16B03 returns {error, {tls_alert, "certificate expired"}}. Is it possible to use public_key:pkix_crls_validate with CRLs not using the Distribution Point extension? All the best, Andr? On 10/13/2014 11:48 AM, Ingela Andin wrote: > Hi! > > The remaining issues I think comes down to that the server in your > example does not have access to all the CA-certificates so it can not > build its on chain > properly. CA certificates are both used to build the own chain and > verify the others chain. This will mean that the server will only send > its own cert to the client and not > the intermediate CA. TLS specifies that only the ROOT CA may be left > out of the chain. However PKIX standard does allow for the user to > specify an intermediate certificate to be the trusted anchor. So in > the latest erlang ssl application there is a new option partial_chain > to handle this. In older version however some partial chains where > "accidentally" accepted by default (if all intermediate CAs where > specified in cacerts). > > From the documentation: > > *{partial_chain, fun(Chain::[DerCert]) -> {trusted_ca, DerCert} | > unknown_ca * > Claim an intermediat CA in the chain as trusted. TLS will then > perform the public_key:pkix_path_validation/3 with the selected CA > as trusted anchor and the rest of the chain. > > Also your CRL-check does not really check everything specified by the > RFC. For now you need to call public_key:pkix_crls_validate/3 in your > verify_fun, if you want a proper check. This is a little cumbersome > and we are working on creating a better integration of it in ssl. > > Regards Ingela Erlang/OTP team - Ericsson AB > > > 2014-10-08 10:55 GMT+02:00 Andre Graf >: > > On 10/08/2014 10:47 AM, Ingela Andin wrote: >> Hi! >> >> 2014-10-08 0:22 GMT+02:00 Andre Graf > >: >> >> Hi there, >> >> today I wrote a EUnit test suite that should check the SSL >> connection >> setup to an Erlang SSL server. Although the test cases are >> pretty simple >> and standard I stumbled upon various inconsistencies when testing >> against different OTP versions (R15B02, R16B03-1,OTP-17.3.1). >> I thought >> I share my findings. >> >> The different test cases are: >> >> 1. Connect No Client Auth (SUCCESS) >> 2. Connect No Client Auth (FAIL: wrong CA) >> 3. Connect Client Auth (SUCCESS) >> 4. Connect Client Auth (FAIL: no Client Cert provided) >> 5. Connect Client Auth (FAIL: Client Cert expired) >> 6. Connect Client Auth (FAIL: CRL check, Client Cert revoked) >> 7. Connect Client Auth (SUCCESS, CRL check) >> >> Inconsistencies in expected return of 'ssl:connect/2' in test >> case 2: >> - R15B02: {error,"unknown ca"}} >> - R16B03-1: {error,{tls_alert,"unknown ca"}} >> - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} >> >> >> This is part of the documented potential incompatibility that we >> choose to do to to improve the quality of the error messages. >> >> >> >> Inconsistencies in expected return of 'ssl:connect/2' in test >> case 3: >> - R15B02: {ok, Sock} >> - R16B03-1: {ok, Sock} >> - OTP-17.3.1: {error,closed} >> >> >> Will try your test case when I get time. Seems strange. >> >> >> >> Inconsistencies in expected return of 'ssl:connect/2' in test >> case 4: >> - R15B02: {error,esslconnect} >> - R16B03-1: {error,{tls_alert,"handshake failure"}} >> - OTP-17.3.1: {error,{tls_alert,"handshake failure"}} >> >> >> This is also part of the documented potential incompatibility >> that we choose to do to to improve the quality of the error messages. >> >> >> Inconsistencies in expected return of 'ssl:connect/2' in test >> case 5: >> - R15B02: {error,"certificate expired"} >> - R16B03-1: {error,{tls_alert,"certificate expired"}} >> - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} >> >> Will try your test case when I get time. Seems strange. >> >> >> Inconsistencies in expected return of 'ssl:connect/2' in test >> case 6: >> - R15B02: SSL handshake process crashes >> - R16B03-1: {error,{tls_alert,"certificate revoked"}} >> - OTP-17.3.1: {error,closed} >> >> >> Alas you can never depend on getting the correct error message an >> not {error,closed} as >> tcp does note have a delivery guarantee on application level, >> only on transport level. >> So ssl sends its alert and then closes the socket, and with bad >> timing the application may >> receive the socket close before it receives the error message data. >> >> Inconsistencies in expected return of 'ssl:connect/2' in test >> case 7: >> - R15B02: {ok, Socket} >> - R16B03-1: {ok, Socket} >> - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} >> >> >> Will try your test case when I get time. Seems strange. >> >> >> Regards Ingela Erlang/OTP team - Ericsson AB >> >> >> No inconsistencies in test case 1. :) >> >> The code is available on >> https://github.com/dergraf/erlang_ssl_tester. >> >> Cheers, >> Andr? >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > Hello Ingela, > > Thanks for your reply. Please let me know if you need any help > with the test case. The tests should pass on R16B03-1, just run > 'rebar eunit'. > > Cheers, > Andr? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andre@REDACTED Tue Oct 21 10:30:35 2014 From: andre@REDACTED (Andre Graf) Date: Tue, 21 Oct 2014 10:30:35 +0200 Subject: [erlang-questions] SSL inconsistencies in expected return values of 'ssl:connect/2' In-Reply-To: <54461506.1080905@erl.io> References: <543467A3.20009@erl.io> <5434FBF3.5060009@erl.io> <54461506.1080905@erl.io> Message-ID: <544619AB.7080606@dergraf.org> Sorry, my bad. The reported inconsistency with the expired certificate is gone. This was an error in the test suite. On 10/21/2014 10:10 AM, Andre Graf wrote: > Hello Ingela, > > Thanks for your response! Indeed, adding the partial_chain (just a > very dump one, always returning {trusted_ca, DerCert}) option as > advised solves most of the mentioned problems. However, one new > inconsistency appeared as well as one question regarding CRLs remain. > > The test checking SSL client auth with an expired certificate fails, > it happily accepts a connection {ok, Socket} with the expired > certificate on 17, whereas R16B03 returns {error, {tls_alert, > "certificate expired"}}. > > Is it possible to use public_key:pkix_crls_validate with CRLs not > using the Distribution Point extension? > > All the best, > Andr? > > On 10/13/2014 11:48 AM, Ingela Andin wrote: >> Hi! >> >> The remaining issues I think comes down to that the server in your >> example does not have access to all the CA-certificates so it can not >> build its on chain >> properly. CA certificates are both used to build the own chain and >> verify the others chain. This will mean that the server will only >> send its own cert to the client and not >> the intermediate CA. TLS specifies that only the ROOT CA may be left >> out of the chain. However PKIX standard does allow for the user to >> specify an intermediate certificate to be the trusted anchor. So in >> the latest erlang ssl application there is a new option partial_chain >> to handle this. In older version however some partial chains where >> "accidentally" accepted by default (if all intermediate CAs where >> specified in cacerts). >> >> From the documentation: >> >> *{partial_chain, fun(Chain::[DerCert]) -> {trusted_ca, DerCert} | >> unknown_ca * >> Claim an intermediat CA in the chain as trusted. TLS will then >> perform the public_key:pkix_path_validation/3 with the selected >> CA as trusted anchor and the rest of the chain. >> >> Also your CRL-check does not really check everything specified by the >> RFC. For now you need to call public_key:pkix_crls_validate/3 in >> your verify_fun, if you want a proper check. This is a little >> cumbersome and we are working on creating a better integration of it >> in ssl. >> >> Regards Ingela Erlang/OTP team - Ericsson AB >> >> >> 2014-10-08 10:55 GMT+02:00 Andre Graf > >: >> >> On 10/08/2014 10:47 AM, Ingela Andin wrote: >>> Hi! >>> >>> 2014-10-08 0:22 GMT+02:00 Andre Graf >> >: >>> >>> Hi there, >>> >>> today I wrote a EUnit test suite that should check the SSL >>> connection >>> setup to an Erlang SSL server. Although the test cases are >>> pretty simple >>> and standard I stumbled upon various inconsistencies when >>> testing >>> against different OTP versions (R15B02, >>> R16B03-1,OTP-17.3.1). I thought >>> I share my findings. >>> >>> The different test cases are: >>> >>> 1. Connect No Client Auth (SUCCESS) >>> 2. Connect No Client Auth (FAIL: wrong CA) >>> 3. Connect Client Auth (SUCCESS) >>> 4. Connect Client Auth (FAIL: no Client Cert provided) >>> 5. Connect Client Auth (FAIL: Client Cert expired) >>> 6. Connect Client Auth (FAIL: CRL check, Client Cert revoked) >>> 7. Connect Client Auth (SUCCESS, CRL check) >>> >>> Inconsistencies in expected return of 'ssl:connect/2' in >>> test case 2: >>> - R15B02: {error,"unknown ca"}} >>> - R16B03-1: {error,{tls_alert,"unknown ca"}} >>> - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} >>> >>> >>> This is part of the documented potential incompatibility that we >>> choose to do to to improve the quality of the error messages. >>> >>> >>> >>> Inconsistencies in expected return of 'ssl:connect/2' in >>> test case 3: >>> - R15B02: {ok, Sock} >>> - R16B03-1: {ok, Sock} >>> - OTP-17.3.1: {error,closed} >>> >>> >>> Will try your test case when I get time. Seems strange. >>> >>> >>> >>> Inconsistencies in expected return of 'ssl:connect/2' in >>> test case 4: >>> - R15B02: {error,esslconnect} >>> - R16B03-1: {error,{tls_alert,"handshake failure"}} >>> - OTP-17.3.1: {error,{tls_alert,"handshake failure"}} >>> >>> >>> This is also part of the documented potential incompatibility >>> that we choose to do to to improve the quality of the error >>> messages. >>> >>> >>> Inconsistencies in expected return of 'ssl:connect/2' in >>> test case 5: >>> - R15B02: {error,"certificate expired"} >>> - R16B03-1: {error,{tls_alert,"certificate expired"}} >>> - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} >>> >>> Will try your test case when I get time. Seems strange. >>> >>> >>> Inconsistencies in expected return of 'ssl:connect/2' in >>> test case 6: >>> - R15B02: SSL handshake process crashes >>> - R16B03-1: {error,{tls_alert,"certificate revoked"}} >>> - OTP-17.3.1: {error,closed} >>> >>> >>> Alas you can never depend on getting the correct error message >>> an not {error,closed} as >>> tcp does note have a delivery guarantee on application level, >>> only on transport level. >>> So ssl sends its alert and then closes the socket, and with bad >>> timing the application may >>> receive the socket close before it receives the error message data. >>> >>> Inconsistencies in expected return of 'ssl:connect/2' in >>> test case 7: >>> - R15B02: {ok, Socket} >>> - R16B03-1: {ok, Socket} >>> - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} >>> >>> >>> Will try your test case when I get time. Seems strange. >>> >>> >>> Regards Ingela Erlang/OTP team - Ericsson AB >>> >>> >>> No inconsistencies in test case 1. :) >>> >>> The code is available on >>> https://github.com/dergraf/erlang_ssl_tester. >>> >>> Cheers, >>> Andr? >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> Hello Ingela, >> >> Thanks for your reply. Please let me know if you need any help >> with the test case. The tests should pass on R16B03-1, just run >> 'rebar eunit'. >> >> Cheers, >> Andr? >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenji@REDACTED Tue Oct 21 11:25:10 2014 From: kenji@REDACTED (Kenji Rikitake) Date: Tue, 21 Oct 2014 18:25:10 +0900 Subject: [erlang-questions] A poll on Erlang and the open-source software movement Message-ID: <20141021092510.GA39341@k2r.org> I am going to give a presentation on Saturday November 8, 2014, at Kansai Open Forum 2014, a regional open-source software annual event since 2002 at Osaka in Japan, on Erlang/OTP and how the open-source software movement contributes the change and progress, as a Japan UNIX Society session. The session details in Japanese are at: https://k-of.jp/2014/session/558 I'd appreciate if you take a look and give your opinions at the following poll on Google Form (in English) on how open-source movement affects/changes Erlang/OTP and other language systems in the ecosystem: http://goo.gl/forms/Th5ogpM4B7 Regards, Kenji Rikitake From ingela.andin@REDACTED Tue Oct 21 11:58:56 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 21 Oct 2014 11:58:56 +0200 Subject: [erlang-questions] SSL inconsistencies in expected return values of 'ssl:connect/2' In-Reply-To: <54461506.1080905@erl.io> References: <543467A3.20009@erl.io> <5434FBF3.5060009@erl.io> <54461506.1080905@erl.io> Message-ID: Hi! Is it possible to use public_key:pkix_crls_validate with CRLs not using the > Distribution Point extension? > > You can create a DP for the input. Outlned from the RFC: The CRLs that should be considerd in CRL processing are: "For each distribution point (DP) in the certificate's CRL distribution points extension, for each corresponding CRL in the local CRL cache" run algorithm in public_key and "if the revocation status has not been determined, repeat the process above with any available CRLs not specified in a distribution point but issued by the certificate issuer. For the processing of such a CRL, assume a DP with both the reasons and the cRLIssuer fields omitted and a distribution point name of the certificate issuer. That is, the sequence of names in fullName is generated from the certificate issuer field as well as the certificate issuerAltName extension." Regards Ingela Erlang/OTP team - Ericsson AB All the best, > Andr? > > > On 10/13/2014 11:48 AM, Ingela Andin wrote: > > Hi! > > The remaining issues I think comes down to that the server in your example > does not have access to all the CA-certificates so it can not build its on > chain > properly. CA certificates are both used to build the own chain and > verify the others chain. This will mean that the server will only send its > own cert to the client and not > the intermediate CA. TLS specifies that only the ROOT CA may be left out > of the chain. However PKIX standard does allow for the user to specify an > intermediate certificate to be the trusted anchor. So in the latest erlang > ssl application there is a new option partial_chain to handle this. In > older version however some partial chains where "accidentally" accepted by > default (if all intermediate CAs where specified in cacerts). > > From the documentation: > *{partial_chain, fun(Chain::[DerCert]) -> {trusted_ca, DerCert} | > unknown_ca * Claim an intermediat CA in the chain as trusted. TLS will > then perform the public_key:pkix_path_validation/3 with the selected CA as > trusted anchor and the rest of the chain. > > Also your CRL-check does not really check everything specified by the RFC. > For now you need to call public_key:pkix_crls_validate/3 in your > verify_fun, if you want a proper check. This is a little cumbersome and we > are working on creating a better integration of it in ssl. > Regards Ingela Erlang/OTP team - Ericsson AB > > > 2014-10-08 10:55 GMT+02:00 Andre Graf : > >> On 10/08/2014 10:47 AM, Ingela Andin wrote: >> >> Hi! >> >> 2014-10-08 0:22 GMT+02:00 Andre Graf : >> >>> Hi there, >>> >>> today I wrote a EUnit test suite that should check the SSL connection >>> setup to an Erlang SSL server. Although the test cases are pretty simple >>> and standard I stumbled upon various inconsistencies when testing >>> against different OTP versions (R15B02, R16B03-1,OTP-17.3.1). I thought >>> I share my findings. >>> >>> The different test cases are: >>> >>> 1. Connect No Client Auth (SUCCESS) >>> 2. Connect No Client Auth (FAIL: wrong CA) >>> 3. Connect Client Auth (SUCCESS) >>> 4. Connect Client Auth (FAIL: no Client Cert provided) >>> 5. Connect Client Auth (FAIL: Client Cert expired) >>> 6. Connect Client Auth (FAIL: CRL check, Client Cert revoked) >>> 7. Connect Client Auth (SUCCESS, CRL check) >>> >>> Inconsistencies in expected return of 'ssl:connect/2' in test case 2: >>> - R15B02: {error,"unknown ca"}} >>> - R16B03-1: {error,{tls_alert,"unknown ca"}} >>> - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} >>> >>> >> This is part of the documented potential incompatibility that we choose >> to do to to improve the quality of the error messages. >> >> >> >>> Inconsistencies in expected return of 'ssl:connect/2' in test case 3: >>> - R15B02: {ok, Sock} >>> - R16B03-1: {ok, Sock} >>> - OTP-17.3.1: {error,closed} >>> >>> >> Will try your test case when I get time. Seems strange. >> >> >> >>> Inconsistencies in expected return of 'ssl:connect/2' in test case 4: >>> - R15B02: {error,esslconnect} >>> - R16B03-1: {error,{tls_alert,"handshake failure"}} >>> - OTP-17.3.1: {error,{tls_alert,"handshake failure"}} >>> >>> >> This is also part of the documented potential incompatibility that we >> choose to do to to improve the quality of the error messages. >> >> >> Inconsistencies in expected return of 'ssl:connect/2' in test case 5: >>> - R15B02: {error,"certificate expired"} >>> - R16B03-1: {error,{tls_alert,"certificate expired"}} >>> - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} >>> >>> Will try your test case when I get time. Seems strange. >> >> >> Inconsistencies in expected return of 'ssl:connect/2' in test case 6: >>> - R15B02: SSL handshake process crashes >>> - R16B03-1: {error,{tls_alert,"certificate revoked"}} >>> - OTP-17.3.1: {error,closed} >>> >>> >> Alas you can never depend on getting the correct error message an not >> {error,closed} as >> tcp does note have a delivery guarantee on application level, only on >> transport level. >> So ssl sends its alert and then closes the socket, and with bad timing >> the application may >> receive the socket close before it receives the error message data. >> >> Inconsistencies in expected return of 'ssl:connect/2' in test case 7: >>> - R15B02: {ok, Socket} >>> - R16B03-1: {ok, Socket} >>> - OTP-17.3.1: {error,{tls_alert,"unknown ca"}} >>> >>> >> Will try your test case when I get time. Seems strange. >> >> >> Regards Ingela Erlang/OTP team - Ericsson AB >> >> >> No inconsistencies in test case 1. :) >>> >>> The code is available on https://github.com/dergraf/erlang_ssl_tester. >>> >>> Cheers, >>> Andr? >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> >> Hello Ingela, >> >> Thanks for your reply. Please let me know if you need any help with the >> test case. The tests should pass on R16B03-1, just run 'rebar eunit'. >> >> Cheers, >> Andr? >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From semmitmondo@REDACTED Tue Oct 21 17:00:19 2014 From: semmitmondo@REDACTED (semmit mondo) Date: Tue, 21 Oct 2014 17:00:19 +0200 (CEST) Subject: [erlang-questions] crypto ECDSA private key -> public Message-ID: Hi, How can I generate an ECDSA public key from the private one using crypto?All I can do with it is to generate a public and private key pair at once: {Pub, Priv} = crypto:generate_key(ecdh, prime239v3). but can't calculate the public key if the private key was known beforehand. (prime239v3 isn't important, it could be any EC curve...) -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Tue Oct 21 18:39:01 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Tue, 21 Oct 2014 18:39:01 +0200 Subject: [erlang-questions] isatty/1 [erlang/otp#480] In-Reply-To: References: Message-ID: On Mon, Oct 20, 2014 at 5:49 AM, Andrew Stone wrote: > I'm very late in responding to this, as I was on vacation and then > procrastinating. > > Tuncer, I just want to know if I'm talking to a file so I can omit > writing escape codes with io:format when attempting to write a > warning in red to the user. If the escape codes do get written to a > file by automated tooling, the file it will have things like > \e[0;31m in there, obscuring the output. It'd be better if we > swapped that for an [Err] or just omitted it altogether in that > case. I'm repeating myself, but to be totally clear I'll respond anyway :). Even though it's not as precise+reliable of a terminal capability indicator, isatty/1 can be used for your problem, and it has other uses as well, so I think it makes sense to include in otp.git. Also, escripts cannot portably rely on non-otp.git native code. From cleancode@REDACTED Tue Oct 21 22:33:28 2014 From: cleancode@REDACTED (=?GBK?B?1cW5+ri7?=) Date: Wed, 22 Oct 2014 04:33:28 +0800 (CST) Subject: [erlang-questions] Application can not be started Message-ID: <14014383.f525.149346a1646.Coremail.cleancode@163.com> Hello all, I'm now following a Erlang rebar tutorial at http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades, the test application can be started inside the erlang shell, like $ erl -pa apps/ebin/ -boot start_sasl 1> application:start(dummy_proj). =PROGRESS REPORT==== 21-Oct-2014::21:16:13 === application: dummy_proj started_at: nonode@REDACTED ok 2> dummy_proj_server:poke(). {ok,1} but it can not be started this way $ erl -pa apps/ebin/ -boot start_sasl -s dummy_proj Erlang R16B03 (erts-5.10.4) [source] [smp:4:4] [async-threads:10] [kernel-poll:false] .... ..... =PROGRESS REPORT==== 21-Oct-2014::21:17:23 === application: sasl started_at: nonode@REDACTED {"init terminating in do_boot",{undef,[{dummy_proj,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} Crash dump was written to: erl_crash.dump init terminating in do_boot () It seems Erlang is trying to call dummy_proj:start(), but I can not understand why. Anybody who ever encountered the same problem here? How can I make it work? Thanks. Best wishes zhangguofu(Gary) -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dummy_proj.zip Type: application/x-zip-compressed Size: 72575 bytes Desc: not available URL: From jay@REDACTED Wed Oct 22 00:48:14 2014 From: jay@REDACTED (Jay Doane) Date: Tue, 21 Oct 2014 15:48:14 -0700 Subject: [erlang-questions] Application can not be started In-Reply-To: <14014383.f525.149346a1646.Coremail.cleancode@163.com> References: <14014383.f525.149346a1646.Coremail.cleancode@163.com> Message-ID: I believe this line {"init terminating in do_boot",{undef,[{dummy_proj, start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} indicates that the function start/0 is not defined in module dummy_proj, so if you want to start it like that on the command line, you could try adding something like the following to dummy_proj.erl: -export([start/1]). start() -> application:ensure_all_started(dummy_proj). On Tue, Oct 21, 2014 at 1:33 PM, ??? wrote: > Hello all, > I'm now following a Erlang rebar tutorial at > http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades, > the test application can be started inside the erlang shell, like > $ erl -pa apps/ebin/ -boot start_sasl > 1> application:start(dummy_proj). > =PROGRESS REPORT==== 21-Oct-2014::21:16:13 === > application: dummy_proj > started_at: nonode@REDACTED > ok > 2> dummy_proj_server:poke(). > {ok,1} > but it can not be started this way > $ erl -pa apps/ebin/ -boot start_sasl -s dummy_proj > Erlang R16B03 (erts-5.10.4) [source] [smp:4:4] [async-threads:10] > [kernel-poll:false] > .... ..... > =PROGRESS REPORT==== 21-Oct-2014::21:17:23 === > application: sasl > started_at: nonode@REDACTED > {"init terminating in > do_boot",{undef,[{dummy_proj,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} > Crash dump was written to: erl_crash.dump > init terminating in do_boot () > > It seems Erlang is trying to call dummy_proj:start(), but I can not > understand why. > Anybody who ever encountered the same problem here? How can I make it work? > > Thanks. > > Best wishes > > zhangguofu(Gary) > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From felixgallo@REDACTED Wed Oct 22 01:28:05 2014 From: felixgallo@REDACTED (Felix Gallo) Date: Tue, 21 Oct 2014 16:28:05 -0700 Subject: [erlang-questions] erlang vs. ibm power8 in the cloud: super-high single-system parallelism Message-ID: 'runabove.com' (said to be a subsidiary of OVH?) recently announced an IBM Power8 cloud server offering in which you can spend about $1 an hour to get 176 threads on and 48G. Signing up for that lab thing appears to give you about a day's worth of runtime credit at that rate. So in the interests of erlang-questions-list citizen journalism, I signed up for the test. Each individual thread is a little less speedy than those of us in the x86 world may be used to, but after horsing around with installing tar (!?), ncurses, and a development environment for a bit, and then installing a recent erlang via kerl, these servers are gigantic, fast, and... [root@REDACTED admin]# erl Erlang/OTP 17 [erts-6.1] [source] [64-bit] [smp:176:176] [async-threads:10] [kernel-poll:false] Eshell V6.1 (abort with ^G) 1> erlang recognizes all 176 threads. Nice! sysbench for this box: [root@REDACTED admin]# sysbench --test=cpu --cpu-max-prime=100000 run --num-threads=176 sysbench 0.4.12: multi-threaded system evaluation benchmark [...] Test execution summary: total time: 2.8208s total number of events: 10000 total time taken by event execution: 443.7155 per-request statistics: min: 7.52ms avg: 44.37ms max: 118.15ms approx. 95 percentile: 48.13ms For comparison, a generic cloud x86 8-core box: root@REDACTED:~# sysbench --test=cpu --cpu-max-prime=100000 run --num-threads=8 sysbench 0.4.12: multi-threaded system evaluation benchmark [...] Test execution summary: total time: 38.7198s total number of events: 10000 total time taken by event execution: 309.5309 per-request statistics: min: 29.89ms avg: 30.95ms max: 79.24ms approx. 95 percentile: 34.12ms No idea how production-ready these boxes are, and don't have a single-system highly parallel erlang throughput benchmark handy to drop in there to see how they do, but if you want a glimpse of the multicore future, these could be pretty fun to play around with. One could imagine video streams and databases being pretty insane. F. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tty.erlang@REDACTED Wed Oct 22 09:13:24 2014 From: tty.erlang@REDACTED (T Ty) Date: Wed, 22 Oct 2014 08:13:24 +0100 Subject: [erlang-questions] Application can not be started In-Reply-To: References: <14014383.f525.149346a1646.Coremail.cleancode@163.com> Message-ID: According to the Erlang documentation http://erlang.org/doc/man/erl.html when you call erl -s module And no other arguments provided it defaults to Func "start" and if no arguments are provided, the function is assumed to be of arity 0. On Tue, Oct 21, 2014 at 11:48 PM, Jay Doane wrote: > I believe this line > > {"init terminating in do_boot",{undef,[{dummy_proj, > start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} > > indicates that the function start/0 is not defined in module dummy_proj, > so if you want to start it like that on the command line, you could try > adding something like the following to dummy_proj.erl: > -export([start/1]). > start() -> > application:ensure_all_started(dummy_proj). > > > On Tue, Oct 21, 2014 at 1:33 PM, ??? wrote: > >> Hello all, >> I'm now following a Erlang rebar tutorial at >> http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades, >> the test application can be started inside the erlang shell, like >> $ erl -pa apps/ebin/ -boot start_sasl >> 1> application:start(dummy_proj). >> =PROGRESS REPORT==== 21-Oct-2014::21:16:13 === >> application: dummy_proj >> started_at: nonode@REDACTED >> ok >> 2> dummy_proj_server:poke(). >> {ok,1} >> but it can not be started this way >> $ erl -pa apps/ebin/ -boot start_sasl -s dummy_proj >> Erlang R16B03 (erts-5.10.4) [source] [smp:4:4] [async-threads:10] >> [kernel-poll:false] >> .... ..... >> =PROGRESS REPORT==== 21-Oct-2014::21:17:23 === >> application: sasl >> started_at: nonode@REDACTED >> {"init terminating in >> do_boot",{undef,[{dummy_proj,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} >> Crash dump was written to: erl_crash.dump >> init terminating in do_boot () >> >> It seems Erlang is trying to call dummy_proj:start(), but I can not >> understand why. >> Anybody who ever encountered the same problem here? How can I make it >> work? >> >> Thanks. >> >> Best wishes >> >> zhangguofu(Gary) >> >> >> >> >> >> _______________________________________________ >> 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 cbenac@REDACTED Wed Oct 22 10:04:55 2014 From: cbenac@REDACTED (Clara Benac Earle) Date: Wed, 22 Oct 2014 10:04:55 +0200 Subject: [erlang-questions] Madrid Erlounge Message-ID: <54476527.1080703@fi.upm.es> Dear all, It is with great pleasure that we announce the next Madrid Erlounge, a good chance to meet erlangers in Madrid and to practice Spanish. Details follow in Spanish :-) See you there! Clara ------------------------------- *Cu?ndo: *Mi?rcoles 29 de octubre 2014 19:00 (la charla empieza a las 19:30) *D?nde: *Sala de Grados (1? planta Facultad de Inform?tica, Universidad Complutense de Madrid) (http://gpd.sip.ucm.es/fraguas/wflp06/campus_ucm.jpg) *Qui?n:* Jos? Luis es responsable del desarrollo, dise?o y mantenimento de un sistema distribuido de tiempo real para gesti?n de ?rdenes y precios de sistemas financieros electr?nicos, labor que ha desempe?ado durante m?s de 10 a?os. Entre otras, las tecnolog?as utilizadas han sido C++, Tibco/rendezvous, AMQP/Qpid, Python, DSLs externos. Desarrollo de librer?a en C++ reactiva, enfocada en tiempo real, multiplataforma, la seguridad y pocas dependencias. Puntuaci?n C++ IKM (93/100). Adem?s Jos? Luis est? apasionado por aprender, ciclismo, ciencia y tecnolog?as. *Qu?: * Elixir es un nuevo lenguaje de programaci?n basado en la m?quina virtual de Erlang que ha llegado con fuerza y buenas cr?ticas. Discutiremos sobre * Un r?pido repaso de los lenguajes de programaci?n * La relaci?n de Elixir con Erlang y su m?quina virtual * Lo que puede aportar Elixir al ecosistema Erlang Veremos unos ejemplos de c?digo sencillo de Elixir y una breve introducci?n a sus macros higi?nicas. El alcance es muy amplio y nos centraremos m?s en conocer las caracter?sticas que en defender sus bondadades de forma abstracta (tema apasiontante que puede ser tratado con unas cervezas y ampliado en otra ocasi?n). ?Os esperamos! Clara -------------- next part -------------- An HTML attachment was scrubbed... URL: From askjuise@REDACTED Wed Oct 22 11:59:13 2014 From: askjuise@REDACTED (Alexander Petrovsky) Date: Wed, 22 Oct 2014 13:59:13 +0400 Subject: [erlang-questions] Erlang and slow dns resolver Message-ID: Hi! tl;dr?! In a couple days ago I'm stumble upon bad performance erlang dns resolver subsystem. I noticed that erlang resolver not so fast. By example: 1. via native method, via inet_gethost: (dns_test@REDACTED)1> inet:get_rc(). [{domain,"local"}, {nameservers,{8,8,8,8}}, {nameservers,{8,8,4,4}}, {search,["local"]}, {resolv_conf,"/etc/resolv.conf"}, {hosts_file,"/etc/hosts"}, {lookup,[native]}] (dns_test@REDACTED)2> timer:tc(fun() -> inet:gethostbyname("yahoo.com") end). {78302, *<--- request to inet_gethost via port* {ok,{hostent,"yahoo.com",[],inet,4, [{206,190,36,45},{98,139,183,24},{98,138,253,109}]}}} (dns_test@REDACTED)3> timer:tc(fun() -> inet:gethostbyname("yahoo.com") end). {74727, *<--- request to inet_gethost via port* {ok,{hostent,"yahoo.com",[],inet,4, [{206,190,36,45},{98,139,183,24},{98,138,253,109}]}}} 2. via dns method: (dns_test@REDACTED)1> inet:get_rc(). [{domain,"local"}, {nameservers,{8,8,8,8}}, {nameservers,{8,8,4,4}}, {search,["local"]}, {resolv_conf,"/etc/resolv.conf"}, {hosts_file,"/etc/hosts"}, {cache_size,1000}, {lookup,[file,dns]}] (dns_test@REDACTED)2> timer:tc(fun() -> inet:gethostbyname("yahoo.com") end). {79489, *<--- request to remote DNS server* {ok,{hostent,"yahoo.com",[],inet,4, [{98,139,183,24},{98,138,253,109},{206,190,36,45}]}}} (dns_test@REDACTED)3> timer:tc(fun() -> inet:gethostbyname("yahoo.com") end). {143, *<--- request local cache* {ok,{hostent,"yahoo.com",[],inet,4, [{98,139,183,24},{98,138,253,109},{206,190,36,45}]}}} (dns_test@REDACTED)4> timer:tc(fun() -> inet:gethostbyname("yahoo.com") end). {143, *<--- request local cache* {ok,{hostent,"yahoo.com",[],inet,4, [{98,139,183,24},{98,138,253,109},{206,190,36,45}]}}} But, when I make stress test like spawn 1000 procs that make 1000 simultaneous calls inet:gethostbyname/1, I get a performance degradation: S = self(). R = fun(Y, Acc) -> receive {time, X} -> Y(Y, [X | Acc]) after 5000 -> Acc end end. W = fun(X) -> Itr = lists:seq(1, X), [spawn(fun() -> {T, _} = timer:tc(fun() -> inet:gethostbyname("yahoo.com") end), S ! {time, T} end) || _ <- Itr] end. inet:gethostbyname("yahoo.com"). 1. via native method, via inet_gethost: (dns_test@REDACTED)3> rp(begin spawn(fun() -> W(1000) end), bear:get_statistics(R(R, [])) end). [{min,478}, {max,79351}, {arithmetic_mean,45360.174}, {geometric_mean,36733.733209560276}, {harmonic_mean,19980.545407674203}, {median,50804}, {variance,470036105.12885255}, {standard_deviation,21680.31607539089}, {skewness,-0.4003204928175034}, {kurtosis,-1.0786416653034996}, {percentile,[{50,50804}, {75,62816}, {90,71738}, {95,74148}, {99,77927}, {999,79285}]}, {histogram,[{8478,56}, {16478,78}, {23478,83}, {31478,96}, {40478,73}, {50478,108}, {60478,198}, {70478,187}, {80478,121}, {90478,0}]}, {n,1000}] ok 2. via dns method: (dns_test@REDACTED)3> rp(begin spawn(fun() -> W(1000) end), bear:get_statistics(R(R, [])) end). [{min,35}, {max,22254}, {arithmetic_mean,2481.493}, {geometric_mean,578.8992039619226}, {harmonic_mean,175.0856422999963}, {median,396}, *<--- not so fast, why? resource contention?* {variance,13536424.050001001}, {standard_deviation,3679.187960678416}, {skewness,1.6528371477689106}, {kurtosis,2.036594779004444}, {percentile,[{50,396}, {75,3827}, *<--- request from local cache, or cache invalidation? why so slow?* {90,8586}, *<--- request from local cache, or cache invalidation? why so slow?* {95,10793}, *<--- request from local cache, or cache invalidation? why so slow?* {99,13498}, *<--- request from local cache, or cache invalidation? why so slow?* {999,17155}]}, *<--- request from local cache, or cache invalidation? why so slow?* {histogram,[{1335,645}, {2635,57}, {4035,57}, {6035,63}, {7035,35}, {8035,25}, {10035,52}, {11035,19}, {12035,17}, {13035,15}, {15035,12}, {16035,0}, {17035,0}, {19035,2}, {20035,0}, {21035,0}, {22035,0}, {24035,1}]}, {n,1000}] ok -- ?????????? ????????? / Alexander Petrovsky, Skype: askjuise Phone: +7 914 8 820 815 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kunthar@REDACTED Wed Oct 22 17:06:41 2014 From: kunthar@REDACTED (Gokhan Boranalp) Date: Wed, 22 Oct 2014 18:06:41 +0300 Subject: [erlang-questions] Erlang and slow dns resolver In-Reply-To: References: Message-ID: Hi Alexander, I am sharing my results. https://gist.github.com/kunthar/cede1ccb72dcfe694f71 I think this is related to your machine's dns settings. - Did you try to change dns servers and run tests again? - Did you check resolv.conf and hosts files for syntax etc. Here is my dns settings for reference: ? kunthar : cat /etc/resolv.conf # # Mac OS X Notice # # This file is not used by the host name and address resolution # or the DNS query routing mechanisms used by most processes on # this Mac OS X system. # # This file is automatically generated. # nameserver 156.154.70.1 nameserver 156.154.71.1 nameserver 8.8.4.4 On Wed, Oct 22, 2014 at 12:59 PM, Alexander Petrovsky wrote: > Hi! > > tl;dr?! > > In a couple days ago I'm stumble upon bad performance erlang dns resolver > subsystem. I noticed that erlang resolver not so fast. > > By example: > > 1. via native method, via inet_gethost: > > (dns_test@REDACTED)1> inet:get_rc(). > [{domain,"local"}, > {nameservers,{8,8,8,8}}, > {nameservers,{8,8,4,4}}, > {search,["local"]}, > {resolv_conf,"/etc/resolv.conf"}, > {hosts_file,"/etc/hosts"}, > {lookup,[native]}] > > (dns_test@REDACTED)2> timer:tc(fun() -> inet:gethostbyname("yahoo.com") > end). > {78302, *<--- request to inet_gethost via port* > {ok,{hostent,"yahoo.com",[],inet,4, > [{206,190,36,45},{98,139,183,24},{98,138,253,109}]}}} > > (dns_test@REDACTED)3> timer:tc(fun() -> inet:gethostbyname("yahoo.com") > end). > {74727, *<--- request to inet_gethost via port* > {ok,{hostent,"yahoo.com",[],inet,4, > [{206,190,36,45},{98,139,183,24},{98,138,253,109}]}}} > > 2. via dns method: > > (dns_test@REDACTED)1> inet:get_rc(). > [{domain,"local"}, > {nameservers,{8,8,8,8}}, > {nameservers,{8,8,4,4}}, > {search,["local"]}, > {resolv_conf,"/etc/resolv.conf"}, > {hosts_file,"/etc/hosts"}, > {cache_size,1000}, > {lookup,[file,dns]}] > > (dns_test@REDACTED)2> timer:tc(fun() -> inet:gethostbyname("yahoo.com") > end). > {79489, *<--- request to remote DNS server* > {ok,{hostent,"yahoo.com",[],inet,4, > [{98,139,183,24},{98,138,253,109},{206,190,36,45}]}}} > > (dns_test@REDACTED)3> timer:tc(fun() -> inet:gethostbyname("yahoo.com") > end). > {143, *<--- request local cache* > {ok,{hostent,"yahoo.com",[],inet,4, > [{98,139,183,24},{98,138,253,109},{206,190,36,45}]}}} > > (dns_test@REDACTED)4> timer:tc(fun() -> inet:gethostbyname("yahoo.com") > end). > {143, *<--- request local cache* > {ok,{hostent,"yahoo.com",[],inet,4, > [{98,139,183,24},{98,138,253,109},{206,190,36,45}]}}} > > > But, when I make stress test like spawn 1000 procs that make 1000 > simultaneous calls inet:gethostbyname/1, I get a performance degradation: > > S = self(). > R = fun(Y, Acc) -> receive {time, X} -> Y(Y, [X | Acc]) after 5000 -> Acc > end end. > W = fun(X) -> Itr = lists:seq(1, X), [spawn(fun() -> {T, _} = > timer:tc(fun() -> inet:gethostbyname("yahoo.com") end), S ! {time, T} > end) || _ <- Itr] end. > inet:gethostbyname("yahoo.com"). > > 1. via native method, via inet_gethost: > > (dns_test@REDACTED)3> rp(begin spawn(fun() -> W(1000) end), > bear:get_statistics(R(R, [])) end). > [{min,478}, > {max,79351}, > {arithmetic_mean,45360.174}, > {geometric_mean,36733.733209560276}, > {harmonic_mean,19980.545407674203}, > {median,50804}, > {variance,470036105.12885255}, > {standard_deviation,21680.31607539089}, > {skewness,-0.4003204928175034}, > {kurtosis,-1.0786416653034996}, > {percentile,[{50,50804}, > {75,62816}, > {90,71738}, > {95,74148}, > {99,77927}, > {999,79285}]}, > {histogram,[{8478,56}, > {16478,78}, > {23478,83}, > {31478,96}, > {40478,73}, > {50478,108}, > {60478,198}, > {70478,187}, > {80478,121}, > {90478,0}]}, > {n,1000}] > ok > > 2. via dns method: > > (dns_test@REDACTED)3> rp(begin spawn(fun() -> W(1000) end), > bear:get_statistics(R(R, [])) end). > [{min,35}, > {max,22254}, > {arithmetic_mean,2481.493}, > {geometric_mean,578.8992039619226}, > {harmonic_mean,175.0856422999963}, > {median,396}, *<--- not so fast, why? resource contention?* > {variance,13536424.050001001}, > {standard_deviation,3679.187960678416}, > {skewness,1.6528371477689106}, > {kurtosis,2.036594779004444}, > {percentile,[{50,396}, > {75,3827}, *<--- request from local cache, or cache > invalidation? why so slow?* > {90,8586}, *<--- request from local cache, or cache > invalidation? why so slow?* > {95,10793}, *<--- request from local cache, or cache > invalidation? why so slow?* > {99,13498}, *<--- request from local cache, or cache > invalidation? why so slow?* > {999,17155}]}, *<--- request from local cache, or cache > invalidation? why so slow?* > {histogram,[{1335,645}, > {2635,57}, > {4035,57}, > {6035,63}, > {7035,35}, > {8035,25}, > {10035,52}, > {11035,19}, > {12035,17}, > {13035,15}, > {15035,12}, > {16035,0}, > {17035,0}, > {19035,2}, > {20035,0}, > {21035,0}, > {22035,0}, > {24035,1}]}, > {n,1000}] > ok > > -- > ?????????? ????????? / Alexander Petrovsky, > > Skype: askjuise > Phone: +7 914 8 820 815 > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- BR, \|/ Kunthar -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincent.dephily@REDACTED Wed Oct 22 17:29:10 2014 From: vincent.dephily@REDACTED (Vincent de Phily) Date: Wed, 22 Oct 2014 17:29:10 +0200 Subject: [erlang-questions] Removing SSL v3 support from the ssl module In-Reply-To: References: <20141015091030.GA52663@k2r.org> <368069533.74861.1413365696097.JavaMail.zimbra@tpip.net> Message-ID: <16095605.Z2g7XaJzps@moltowork> On Wednesday 15 October 2014 19:41:23 Steve Vinoski wrote: > On Wed, Oct 15, 2014 at 5:34 AM, Andreas Schultz wrote: > > Hi, > > > > ----- On 15 Oct, 2014, at 11:10, Kenji Rikitake kenji@REDACTED wrote: > > > I'd be glad if how to remove SSL v3 support from OTP ssl module is > > > provided by the OTP Team, to prevent getting trapped into the POODLE > > > bug. (I think it won't be that hard, regarding what I've found from the > > > ssl module source code. The keyword atom is "sslv3".) > > > > Add {versions, ['tlsv1.2', 'tls1.1', 'tls1']} to your SSL options to > > restrict > > the version choice. > > Slight correction: {versions, ['tlsv1.2', 'tlsv1.1', 'tlsv1']} I suggest going with proplists:get_value(available,ssl:versions()) -- [sslv3] to future-proof your code a bit. I'm not sure what the difference between 'supported' and 'available' is (a clarification in the docs would be nice), neither of them seem to be affected by the command-line argument to restrict versions. -- Vincent de Phily From cleancode@REDACTED Wed Oct 22 19:32:45 2014 From: cleancode@REDACTED (=?GBK?B?1cW5+ri7?=) Date: Thu, 23 Oct 2014 01:32:45 +0800 (CST) Subject: [erlang-questions] Application can not be started In-Reply-To: References: <14014383.f525.149346a1646.Coremail.cleancode@163.com> Message-ID: <55410541.d6.14938eafea2.Coremail.cleancode@163.com> Thanks, it is very helpful. Now I added a module dummy_proj and the start function is implemented, finally it's working by $ erl -pa apps/ebin/ -boot start_sasl -s dummy_proj But personally I do not want to add a entire new module just for this purpose, So I tried something else. However, another problem shows up, that when I start erl shell by $ erl -pa apps/ebin/ -boot start_sasl -s application start dummy_proj or $ erl -pa apps/ebin/ -boot start_sasl -s application ensure_all_started dummy_proj Nothing will go wrong but application dummy_proj will not be started at the same time. On the other hand, if I try $ erl -pa apps/ebin/ -boot start_sasl -s appmon start the AppMon tool will be started as expected. That's to say the application:start(dummy_proj) was called, but nothing happened. It's weird. Best wishes. zhangguofu (Gary) ? 2014-10-22 15:13:24?"T Ty" ??? According to the Erlang documentation http://erlang.org/doc/man/erl.html when you call erl -s module And no other arguments provided it defaults to Func "start" and if no arguments are provided, the function is assumed to be of arity 0. On Tue, Oct 21, 2014 at 11:48 PM, Jay Doane wrote: I believe this line {"init terminating in do_boot",{undef,[{dummy_proj,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} indicates that the function start/0 is not defined in module dummy_proj, so if you want to start it like that on the command line, you could try adding something like the following to dummy_proj.erl: -export([start/1]). start() -> application:ensure_all_started(dummy_proj). On Tue, Oct 21, 2014 at 1:33 PM, ??? wrote: Hello all, I'm now following a Erlang rebar tutorial at http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades, the test application can be started inside the erlang shell, like $ erl -pa apps/ebin/ -boot start_sasl 1> application:start(dummy_proj). =PROGRESS REPORT==== 21-Oct-2014::21:16:13 === application: dummy_proj started_at: nonode@REDACTED ok 2> dummy_proj_server:poke(). {ok,1} but it can not be started this way $ erl -pa apps/ebin/ -boot start_sasl -s dummy_proj Erlang R16B03 (erts-5.10.4) [source] [smp:4:4] [async-threads:10] [kernel-poll:false] .... ..... =PROGRESS REPORT==== 21-Oct-2014::21:17:23 === application: sasl started_at: nonode@REDACTED {"init terminating in do_boot",{undef,[{dummy_proj,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} Crash dump was written to: erl_crash.dump init terminating in do_boot () It seems Erlang is trying to call dummy_proj:start(), but I can not understand why. Anybody who ever encountered the same problem here? How can I make it work? Thanks. Best wishes zhangguofu(Gary) _______________________________________________ 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 jay@REDACTED Wed Oct 22 23:51:17 2014 From: jay@REDACTED (Jay Doane) Date: Wed, 22 Oct 2014 14:51:17 -0700 Subject: [erlang-questions] Application can not be started In-Reply-To: <55410541.d6.14938eafea2.Coremail.cleancode@163.com> References: <14014383.f525.149346a1646.Coremail.cleancode@163.com> <55410541.d6.14938eafea2.Coremail.cleancode@163.com> Message-ID: Here's a quote from the docs that T Ty mentioned: *-s Mod [Func [Arg1, Arg2, ...]](init flag)* Makes init call the specified function. Func defaults to start. If no arguments are provided, the function is assumed to be of arity 0. Otherwise it is assumed to be of arity 1, taking the list [Arg1,Arg2,...] as argument. All arguments are passed as atoms. See init(3) . So when you pass -s application ensure_all_started dummy_proj to erl, it's going to call application:ensure_all_started([dummy_proj]) (note that the argument is a single element list), which is not what you want. I struggled with the best way to deal with this for a while, and eventually created a little helper module that looks like this: -module(app). %% @doc Allow applications to be started from command line: -s app start application-name -export([start/1]). start([App]) -> application:start(App). and seems to work well enough for my purposes. You will want to either change the last line to application:ensure_all_started(App), or create a separate function that calls ensure_all_started. YMMV. On Wed, Oct 22, 2014 at 10:32 AM, ??? wrote: > Thanks, it is very helpful. > Now I added a module dummy_proj and the start function is implemented, > finally it's working by > $ erl -pa apps/ebin/ -boot start_sasl -s dummy_proj > > But personally I do not want to add a entire new module just for this > purpose, So I tried something else. > However, another problem shows up, that when I start erl shell by > $ erl -pa apps/ebin/ -boot start_sasl -s application start dummy_proj > or > $ erl -pa apps/ebin/ -boot start_sasl -s application ensure_all_started > dummy_proj > Nothing will go wrong but application dummy_proj will not be started at > the same time. > On the other hand, if I try > $ erl -pa apps/ebin/ -boot start_sasl -s appmon start > the AppMon tool will be started as expected. > > That's to say the application:start(dummy_proj) was called, but nothing > happened. > It's weird. > > Best wishes. > zhangguofu (Gary) > > ? 2014-10-22 15:13:24?"T Ty" ??? > > According to the Erlang documentation > > http://erlang.org/doc/man/erl.html when you call > > erl -s module > > And no other arguments provided it defaults to Func "start" and if no > arguments are provided, the function is assumed to be of arity 0. > > On Tue, Oct 21, 2014 at 11:48 PM, Jay Doane wrote: > >> I believe this line >> >> {"init terminating in do_boot",{undef,[{dummy_proj, >> start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} >> >> indicates that the function start/0 is not defined in module dummy_proj, >> so if you want to start it like that on the command line, you could try >> adding something like the following to dummy_proj.erl: >> -export([start/1]). >> start() -> >> application:ensure_all_started(dummy_proj). >> >> >> On Tue, Oct 21, 2014 at 1:33 PM, ??? wrote: >> >>> Hello all, >>> I'm now following a Erlang rebar tutorial at >>> http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades, >>> the test application can be started inside the erlang shell, like >>> $ erl -pa apps/ebin/ -boot start_sasl >>> 1> application:start(dummy_proj). >>> =PROGRESS REPORT==== 21-Oct-2014::21:16:13 === >>> application: dummy_proj >>> started_at: nonode@REDACTED >>> ok >>> 2> dummy_proj_server:poke(). >>> {ok,1} >>> but it can not be started this way >>> $ erl -pa apps/ebin/ -boot start_sasl -s dummy_proj >>> Erlang R16B03 (erts-5.10.4) [source] [smp:4:4] [async-threads:10] >>> [kernel-poll:false] >>> .... ..... >>> =PROGRESS REPORT==== 21-Oct-2014::21:17:23 === >>> application: sasl >>> started_at: nonode@REDACTED >>> {"init terminating in >>> do_boot",{undef,[{dummy_proj,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} >>> Crash dump was written to: erl_crash.dump >>> init terminating in do_boot () >>> >>> It seems Erlang is trying to call dummy_proj:start(), but I can not >>> understand why. >>> Anybody who ever encountered the same problem here? How can I make it >>> work? >>> >>> Thanks. >>> >>> Best wishes >>> >>> zhangguofu(Gary) >>> >>> >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tty.erlang@REDACTED Thu Oct 23 02:20:59 2014 From: tty.erlang@REDACTED (T Ty) Date: Thu, 23 Oct 2014 01:20:59 +0100 Subject: [erlang-questions] Application can not be started In-Reply-To: References: <14014383.f525.149346a1646.Coremail.cleancode@163.com> <55410541.d6.14938eafea2.Coremail.cleancode@163.com> Message-ID: To add to what Jay wrote: it is common to have a dummy_proj.erl implement the Application behaviour and have a start/0 function just for starting it from the Unix/Windows command line. When using rebar it creates dummy_proj_app.erl and you have 2 choices: 1. put a start/0 in dummpy_proj_app which means you can now do erl -pa apps/ebin/ -boot start_sasl -s dummy_proj_app or 2. rename dummy_proj_app.erl to dummy_proj.erl, put a start/0 in it and change the dummy_proj.app.src file to match. Either way your start/0 function must exist somewhere. On Wed, Oct 22, 2014 at 10:51 PM, Jay Doane wrote: > Here's a quote from the docs that T Ty mentioned: > > *-s Mod [Func [Arg1, Arg2, ...]](init flag)* > > Makes init call the specified function. Func defaults to start. If no > arguments are provided, the function is assumed to be of arity 0. Otherwise > it is assumed to be of arity 1, taking the list [Arg1,Arg2,...] as > argument. All arguments are passed as atoms. See init(3) > . > So when you pass -s application ensure_all_started dummy_proj > to erl, it's going to call application:ensure_all_started([dummy_proj]) > (note that the argument is a single element list), which is not what you > want. > > I struggled with the best way to deal with this for a while, and > eventually created a little helper module that looks like this: > > -module(app). > > %% @doc Allow applications to be started from command line: -s app start > application-name > > -export([start/1]). > > start([App]) -> > application:start(App). > > and seems to work well enough for my purposes. You will want to either > change the last line to application:ensure_all_started(App), or create a > separate function that calls ensure_all_started. YMMV. > > > > On Wed, Oct 22, 2014 at 10:32 AM, ??? wrote: > >> Thanks, it is very helpful. >> Now I added a module dummy_proj and the start function is implemented, >> finally it's working by >> $ erl -pa apps/ebin/ -boot start_sasl -s dummy_proj >> >> But personally I do not want to add a entire new module just for this >> purpose, So I tried something else. >> However, another problem shows up, that when I start erl shell by >> $ erl -pa apps/ebin/ -boot start_sasl -s application start dummy_proj >> or >> $ erl -pa apps/ebin/ -boot start_sasl -s application ensure_all_started >> dummy_proj >> Nothing will go wrong but application dummy_proj will not be started at >> the same time. >> On the other hand, if I try >> $ erl -pa apps/ebin/ -boot start_sasl -s appmon start >> the AppMon tool will be started as expected. >> >> That's to say the application:start(dummy_proj) was called, but nothing >> happened. >> It's weird. >> >> Best wishes. >> zhangguofu (Gary) >> >> ? 2014-10-22 15:13:24?"T Ty" ??? >> >> According to the Erlang documentation >> >> http://erlang.org/doc/man/erl.html when you call >> >> erl -s module >> >> And no other arguments provided it defaults to Func "start" and if no >> arguments are provided, the function is assumed to be of arity 0. >> >> On Tue, Oct 21, 2014 at 11:48 PM, Jay Doane wrote: >> >>> I believe this line >>> >>> {"init terminating in do_boot",{undef,[{dummy_proj, >>> start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} >>> >>> indicates that the function start/0 is not defined in module dummy_proj, >>> so if you want to start it like that on the command line, you could try >>> adding something like the following to dummy_proj.erl: >>> -export([start/1]). >>> start() -> >>> application:ensure_all_started(dummy_proj). >>> >>> >>> On Tue, Oct 21, 2014 at 1:33 PM, ??? wrote: >>> >>>> Hello all, >>>> I'm now following a Erlang rebar tutorial at >>>> http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades, >>>> the test application can be started inside the erlang shell, like >>>> $ erl -pa apps/ebin/ -boot start_sasl >>>> 1> application:start(dummy_proj). >>>> =PROGRESS REPORT==== 21-Oct-2014::21:16:13 === >>>> application: dummy_proj >>>> started_at: nonode@REDACTED >>>> ok >>>> 2> dummy_proj_server:poke(). >>>> {ok,1} >>>> but it can not be started this way >>>> $ erl -pa apps/ebin/ -boot start_sasl -s dummy_proj >>>> Erlang R16B03 (erts-5.10.4) [source] [smp:4:4] [async-threads:10] >>>> [kernel-poll:false] >>>> .... ..... >>>> =PROGRESS REPORT==== 21-Oct-2014::21:17:23 === >>>> application: sasl >>>> started_at: nonode@REDACTED >>>> {"init terminating in >>>> do_boot",{undef,[{dummy_proj,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} >>>> Crash dump was written to: erl_crash.dump >>>> init terminating in do_boot () >>>> >>>> It seems Erlang is trying to call dummy_proj:start(), but I can not >>>> understand why. >>>> Anybody who ever encountered the same problem here? How can I make it >>>> work? >>>> >>>> Thanks. >>>> >>>> Best wishes >>>> >>>> zhangguofu(Gary) >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ceo@REDACTED Thu Oct 23 06:55:25 2014 From: ceo@REDACTED (Rohan Sarker) Date: Thu, 23 Oct 2014 00:55:25 -0400 (EDT) Subject: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 Message-ID: <1720035394.46871.1414040125597.JavaMail.vpopmail@webmail3.networksolutionsemail.com> Dear list members. Can anyone help me with my questions? Apologies for any misunderstandings since English is not my native language. I know that within OTP there is no tool to make an .EXE from an Erlang Application. I want to know if there is any open source projects that can do this. Thank you. Regards Rohan Sarker CEO & Founder SwitchGate CrystalShift www.rohansarker.com http://about.me/rohansarker https://www.facebook.com/rohan.sarker.5 https://www.facebook.com/switchgatecrystalshift +913324288069 +917278539338 +919674221741 Skype: arati_genius -------------- next part -------------- An HTML attachment was scrubbed... URL: From cleancode@REDACTED Thu Oct 23 08:22:34 2014 From: cleancode@REDACTED (cleancode) Date: Thu, 23 Oct 2014 07:22:34 +0100 Subject: [erlang-questions] Application can not be started In-Reply-To: References: <14014383.f525.149346a1646.Coremail.cleancode@163.com> <55410541.d6.14938eafea2.Coremail.cleancode@163.com> Message-ID: <6FF82C18-2FD6-4FB4-80CF-F36609F18AD0@163.com> Yes, now I see that when I pass erl -s Module Func Arg1 Arg2, Module:Func([Arg1, Arg2]) will be called, not Module:Func(Arg1, Arg2) As I expected. Anyway, this does not annoy me any more. Why I struggled so much at the first place is that I want the application to be started when the release node, which I am going to create, is started. And after step forward I realize that rebar uses other way to achieve this feature, not the way by giving some starting codes like erl -s somewhere, as I thought at the beginning. Thanks for taking time for this and your kind response. Best wishes! Zhangguofu (Gary) > On Oct 23, 2014, at 01:20, T Ty wrote: > > To add to what Jay wrote: it is common to have a dummy_proj.erl implement the Application behaviour and have a start/0 function just for starting it from the Unix/Windows command line. > > When using rebar it creates dummy_proj_app.erl and you have 2 choices: > > 1. put a start/0 in dummpy_proj_app which means you can now do > > erl -pa apps/ebin/ -boot start_sasl -s dummy_proj_app > > or > > 2. rename dummy_proj_app.erl to dummy_proj.erl, put a start/0 in it and change the dummy_proj.app.src file to match. > > Either way your start/0 function must exist somewhere. > > > > >> On Wed, Oct 22, 2014 at 10:51 PM, Jay Doane wrote: >> Here's a quote from the docs that T Ty mentioned: >> >> -s Mod [Func [Arg1, Arg2, ...]](init flag) >> Makes init call the specified function. Func defaults to start. If no arguments are provided, the function is assumed to be of arity 0. Otherwise it is assumed to be of arity 1, taking the list [Arg1,Arg2,...] as argument. All arguments are passed as atoms. See init(3). >> >> So when you pass -s application ensure_all_started dummy_proj >> to erl, it's going to call application:ensure_all_started([dummy_proj]) (note that the argument is a single element list), which is not what you want. >> >> I struggled with the best way to deal with this for a while, and eventually created a little helper module that looks like this: >> >> -module(app). >> >> %% @doc Allow applications to be started from command line: -s app start application-name >> >> -export([start/1]). >> >> start([App]) -> >> application:start(App). >> >> and seems to work well enough for my purposes. You will want to either change the last line to application:ensure_all_started(App), or create a separate function that calls ensure_all_started. YMMV. >> >> >> >>> On Wed, Oct 22, 2014 at 10:32 AM, ??? wrote: >>> Thanks, it is very helpful. >>> Now I added a module dummy_proj and the start function is implemented, finally it's working by >>> $ erl -pa apps/ebin/ -boot start_sasl -s dummy_proj >>> >>> But personally I do not want to add a entire new module just for this purpose, So I tried something else. >>> However, another problem shows up, that when I start erl shell by >>> $ erl -pa apps/ebin/ -boot start_sasl -s application start dummy_proj >>> or >>> $ erl -pa apps/ebin/ -boot start_sasl -s application ensure_all_started dummy_proj >>> Nothing will go wrong but application dummy_proj will not be started at the same time. >>> On the other hand, if I try >>> $ erl -pa apps/ebin/ -boot start_sasl -s appmon start >>> the AppMon tool will be started as expected. >>> >>> That's to say the application:start(dummy_proj) was called, but nothing happened. >>> It's weird. >>> >>> Best wishes. >>> zhangguofu (Gary) >>> >>> ? 2014-10-22 15:13:24?"T Ty" ??? >>> >>> According to the Erlang documentation >>> >>> http://erlang.org/doc/man/erl.html when you call >>> >>> erl -s module >>> >>> And no other arguments provided it defaults to Func "start" and if no arguments are provided, the function is assumed to be of arity 0. >>> >>>> On Tue, Oct 21, 2014 at 11:48 PM, Jay Doane wrote: >>>> I believe this line >>>> >>>> {"init terminating in do_boot",{undef,[{dummy_proj,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} >>>> >>>> indicates that the function start/0 is not defined in module dummy_proj, so if you want to start it like that on the command line, you could try adding something like the following to dummy_proj.erl: >>>> -export([start/1]). >>>> start() -> >>>> application:ensure_all_started(dummy_proj). >>>> >>>> >>>>> On Tue, Oct 21, 2014 at 1:33 PM, ??? wrote: >>>>> Hello all, >>>>> I'm now following a Erlang rebar tutorial at http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades, the test application can be started inside the erlang shell, like >>>>> $ erl -pa apps/ebin/ -boot start_sasl >>>>> 1> application:start(dummy_proj). >>>>> =PROGRESS REPORT==== 21-Oct-2014::21:16:13 === >>>>> application: dummy_proj >>>>> started_at: nonode@REDACTED >>>>> ok >>>>> 2> dummy_proj_server:poke(). >>>>> {ok,1} >>>>> but it can not be started this way >>>>> $ erl -pa apps/ebin/ -boot start_sasl -s dummy_proj >>>>> Erlang R16B03 (erts-5.10.4) [source] [smp:4:4] [async-threads:10] [kernel-poll:false] >>>>> .... ..... >>>>> =PROGRESS REPORT==== 21-Oct-2014::21:17:23 === >>>>> application: sasl >>>>> started_at: nonode@REDACTED >>>>> {"init terminating in do_boot",{undef,[{dummy_proj,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} >>>>> Crash dump was written to: erl_crash.dump >>>>> init terminating in do_boot () >>>>> >>>>> It seems Erlang is trying to call dummy_proj:start(), but I can not understand why. >>>>> Anybody who ever encountered the same problem here? How can I make it work? >>>>> >>>>> Thanks. >>>>> >>>>> Best wishes >>>>> >>>>> zhangguofu(Gary) >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From askjuise@REDACTED Thu Oct 23 09:02:30 2014 From: askjuise@REDACTED (Alexander Petrovsky) Date: Thu, 23 Oct 2014 11:02:30 +0400 Subject: [erlang-questions] Erlang and slow dns resolver In-Reply-To: References: Message-ID: Hi Gokhan. I've see you test results. The first test result make sense (populate resolver cache): 3> timer:tc(fun() -> inet:gethostbyname("yahoo.com") end). > {143889, > {ok,{hostent,"yahoo.com",[],inet,4, > [{98,138,253,109},{206,190,36,45},{98,139,183,24}]}}} but the second, third, etc... I can explant to my self why you get a good (us) results and I'm get bad (ms) results? BTW the last two tests is wrong. You got in all values (min, max,median, etc) zeros. Looks like something goes wrong. Could you please recheck and try again? 2014-10-22 19:06 GMT+04:00 Gokhan Boranalp : > Hi Alexander, > > I am sharing my results. > > https://gist.github.com/kunthar/cede1ccb72dcfe694f71 > > I think this is related to your machine's dns settings. > - Did you try to change dns servers and run tests again? > - Did you check resolv.conf and hosts files for syntax etc. > > Here is my dns settings for reference: > > ? kunthar : cat /etc/resolv.conf > # > # Mac OS X Notice > # > # This file is not used by the host name and address resolution > # or the DNS query routing mechanisms used by most processes on > # this Mac OS X system. > # > # This file is automatically generated. > # > nameserver 156.154.70.1 > nameserver 156.154.71.1 > nameserver 8.8.4.4 > > > > > > > > On Wed, Oct 22, 2014 at 12:59 PM, Alexander Petrovsky > wrote: > >> Hi! >> >> tl;dr?! >> >> In a couple days ago I'm stumble upon bad performance erlang dns resolver >> subsystem. I noticed that erlang resolver not so fast. >> >> By example: >> >> 1. via native method, via inet_gethost: >> >> (dns_test@REDACTED)1> inet:get_rc(). >> [{domain,"local"}, >> {nameservers,{8,8,8,8}}, >> {nameservers,{8,8,4,4}}, >> {search,["local"]}, >> {resolv_conf,"/etc/resolv.conf"}, >> {hosts_file,"/etc/hosts"}, >> {lookup,[native]}] >> >> (dns_test@REDACTED)2> timer:tc(fun() -> inet:gethostbyname("yahoo.com") >> end). >> {78302, *<--- request to inet_gethost via port* >> {ok,{hostent,"yahoo.com",[],inet,4, >> [{206,190,36,45},{98,139,183,24},{98,138,253,109}]}}} >> >> (dns_test@REDACTED)3> timer:tc(fun() -> inet:gethostbyname("yahoo.com") >> end). >> {74727, *<--- request to inet_gethost via port* >> {ok,{hostent,"yahoo.com",[],inet,4, >> [{206,190,36,45},{98,139,183,24},{98,138,253,109}]}}} >> >> 2. via dns method: >> >> (dns_test@REDACTED)1> inet:get_rc(). >> [{domain,"local"}, >> {nameservers,{8,8,8,8}}, >> {nameservers,{8,8,4,4}}, >> {search,["local"]}, >> {resolv_conf,"/etc/resolv.conf"}, >> {hosts_file,"/etc/hosts"}, >> {cache_size,1000}, >> {lookup,[file,dns]}] >> >> (dns_test@REDACTED)2> timer:tc(fun() -> inet:gethostbyname("yahoo.com") >> end). >> {79489, *<--- request to remote DNS server* >> {ok,{hostent,"yahoo.com",[],inet,4, >> [{98,139,183,24},{98,138,253,109},{206,190,36,45}]}}} >> >> (dns_test@REDACTED)3> timer:tc(fun() -> inet:gethostbyname("yahoo.com") >> end). >> {143, *<--- request local cache* >> {ok,{hostent,"yahoo.com",[],inet,4, >> [{98,139,183,24},{98,138,253,109},{206,190,36,45}]}}} >> >> (dns_test@REDACTED)4> timer:tc(fun() -> inet:gethostbyname("yahoo.com") >> end). >> {143, *<--- request local cache* >> {ok,{hostent,"yahoo.com",[],inet,4, >> [{98,139,183,24},{98,138,253,109},{206,190,36,45}]}}} >> >> >> But, when I make stress test like spawn 1000 procs that make 1000 >> simultaneous calls inet:gethostbyname/1, I get a performance degradation: >> >> S = self(). >> R = fun(Y, Acc) -> receive {time, X} -> Y(Y, [X | Acc]) after 5000 -> >> Acc end end. >> W = fun(X) -> Itr = lists:seq(1, X), [spawn(fun() -> {T, _} = >> timer:tc(fun() -> inet:gethostbyname("yahoo.com") end), S ! {time, T} >> end) || _ <- Itr] end. >> inet:gethostbyname("yahoo.com"). >> >> 1. via native method, via inet_gethost: >> >> (dns_test@REDACTED)3> rp(begin spawn(fun() -> W(1000) end), >> bear:get_statistics(R(R, [])) end). >> [{min,478}, >> {max,79351}, >> {arithmetic_mean,45360.174}, >> {geometric_mean,36733.733209560276}, >> {harmonic_mean,19980.545407674203}, >> {median,50804}, >> {variance,470036105.12885255}, >> {standard_deviation,21680.31607539089}, >> {skewness,-0.4003204928175034}, >> {kurtosis,-1.0786416653034996}, >> {percentile,[{50,50804}, >> {75,62816}, >> {90,71738}, >> {95,74148}, >> {99,77927}, >> {999,79285}]}, >> {histogram,[{8478,56}, >> {16478,78}, >> {23478,83}, >> {31478,96}, >> {40478,73}, >> {50478,108}, >> {60478,198}, >> {70478,187}, >> {80478,121}, >> {90478,0}]}, >> {n,1000}] >> ok >> >> 2. via dns method: >> >> (dns_test@REDACTED)3> rp(begin spawn(fun() -> W(1000) end), >> bear:get_statistics(R(R, [])) end). >> [{min,35}, >> {max,22254}, >> {arithmetic_mean,2481.493}, >> {geometric_mean,578.8992039619226}, >> {harmonic_mean,175.0856422999963}, >> {median,396}, *<--- not so fast, why? resource contention?* >> {variance,13536424.050001001}, >> {standard_deviation,3679.187960678416}, >> {skewness,1.6528371477689106}, >> {kurtosis,2.036594779004444}, >> {percentile,[{50,396}, >> {75,3827}, *<--- request from local cache, or cache >> invalidation? why so slow?* >> {90,8586}, *<--- request from local cache, or cache >> invalidation? why so slow?* >> {95,10793}, *<--- request from local cache, or cache >> invalidation? why so slow?* >> {99,13498}, *<--- request from local cache, or cache >> invalidation? why so slow?* >> {999,17155}]}, *<--- request from local cache, or cache >> invalidation? why so slow?* >> {histogram,[{1335,645}, >> {2635,57}, >> {4035,57}, >> {6035,63}, >> {7035,35}, >> {8035,25}, >> {10035,52}, >> {11035,19}, >> {12035,17}, >> {13035,15}, >> {15035,12}, >> {16035,0}, >> {17035,0}, >> {19035,2}, >> {20035,0}, >> {21035,0}, >> {22035,0}, >> {24035,1}]}, >> {n,1000}] >> ok >> >> -- >> ?????????? ????????? / Alexander Petrovsky, >> >> Skype: askjuise >> Phone: +7 914 8 820 815 >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > > -- > BR, > \|/ Kunthar > -- ?????????? ????????? / Alexander Petrovsky, Skype: askjuise Phone: +7 914 8 820 815 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jean.parpaillon@REDACTED Thu Oct 23 09:24:28 2014 From: jean.parpaillon@REDACTED (Jean Parpaillon) Date: Thu, 23 Oct 2014 09:24:28 +0200 Subject: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 In-Reply-To: <1720035394.46871.1414040125597.JavaMail.vpopmail@webmail3.networksolutionsemail.com> References: <1720035394.46871.1414040125597.JavaMail.vpopmail@webmail3.networksolutionsemail.com> Message-ID: <1414049068.18861.14.camel@free.fr> Hi, There are basically 2 kinds of erlang applications: - the "pure erlang" way is to create a release including the runtime, OTP and your application(s). Then a simple .bat script can launch the runtime with the right options. reltool or systools are made for creating these releases: http://learnyousomeerlang.com/release-is-the-word http://www.erlang.org/documentation/doc-1/apps/reltool/index.html rebar can help you using these tools. - for a single executable, not distributed, with a single app, you can create an 'escript' from your code which will be launched as an executable. rebar includes the escriptize command to achieve this. As an example, you can look at the 'averell' web server which is built that way: https://github.com/jeanparpaillon/averell Cheers Jean Le jeudi 23 octobre 2014 ? 00:55 -0400, Rohan Sarker a ?crit : > Dear list members. > > > > > > Can anyone help me with my questions? > > > > Apologies for any misunderstandings since English is not my native > language. > > > > I know that within OTP there is no tool to make an .EXE from an Erlang > Application. > > > > I want to know if there is any open source projects that can do this. > > > > Thank you. > > > > > > > > Regards > > Rohan Sarker > > CEO & Founder > > SwitchGate CrystalShift > > www.rohansarker.com > > http://about.me/rohansarker > > https://www.facebook.com/rohan.sarker.5 > > https://www.facebook.com/switchgatecrystalshift > > +913324288069 > > +917278539338 > > +919674221741 > > Skype: arati_genius > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Jean Parpaillon Open Source Consultant Phone: +33 6 30 10 92 86 im: jean.parpaillon@REDACTED skype: jean.parpaillon linkedin: http://www.linkedin.com/in/jeanparpaillon/en From maxim@REDACTED Thu Oct 23 09:47:32 2014 From: maxim@REDACTED (Maxim Sokhatsky) Date: Thu, 23 Oct 2014 10:47:32 +0300 Subject: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 In-Reply-To: <1720035394.46871.1414040125597.JavaMail.vpopmail@webmail3.networksolutionsemail.com> References: <1720035394.46871.1414040125597.JavaMail.vpopmail@webmail3.networksolutionsemail.com> Message-ID: Hello. You can create escript bundles with MAD. ? ? ? ? https://synrc.com/apps/mad The name of the binary should be the same as as the module which has main/1 function. MAD know how yo ordering apps. Binaries made with mad are able to be run under Windows, Linux and Mac. We created ETS filesystem wich unzip all priv dirs of all apps to the memory from the bundle?s static.gz. So you even be able to run N2O sites as the bundles. To create simple N2O site with MAD and bundle it you should do: ? ? $ mad app sample ? ? $ cd sample ? ? $ mad deps compile plan bundle web_app ./web_app packed Site could be run on any machine with Erlang installed in any folder. -- 5HT From Tobias.Schlager@REDACTED Thu Oct 23 10:39:25 2014 From: Tobias.Schlager@REDACTED (Tobias Schlager) Date: Thu, 23 Oct 2014 08:39:25 +0000 Subject: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 In-Reply-To: References: <1720035394.46871.1414040125597.JavaMail.vpopmail@webmail3.networksolutionsemail.com>, Message-ID: <12F2115FD1CCEE4294943B2608A18FA301223AD93D@MAIL01.win.lbaum.eu> 'mad bundle' sounds interesting, especially the idea of having an ETS based filesystem. Does this work together with the standard OTP API (code:priv_dir/1 and file module) or do you have to adapt the bundled apps to a custom API? When writing the https://github.com/schlagert/rebar_escript_plugin I also ran into the issue of not available 'priv' content. My highest directive was not to force apps to use another API than the standard OTP one. In the end, I couldn't figure out a better solution than to unpack everything to the local filesystem on escript startup.... or write a custom (prim_)loader. @Jean: I did pretty much the same project as a showcase for the rebar_escripit_plugin, see https://github.com/schlagert/serve_it :) Regards Tobias ________________________________________ Von: erlang-questions-bounces@REDACTED [erlang-questions-bounces@REDACTED]" im Auftrag von "Maxim Sokhatsky [maxim@REDACTED] Gesendet: Donnerstag, 23. Oktober 2014 09:47 An: Rohan Sarker; erlang-questions@REDACTED Betreff: Re: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 Hello. You can create escript bundles with MAD. https://synrc.com/apps/mad The name of the binary should be the same as as the module which has main/1 function. MAD know how yo ordering apps. Binaries made with mad are able to be run under Windows, Linux and Mac. We created ETS filesystem wich unzip all priv dirs of all apps to the memory from the bundle?s static.gz. So you even be able to run N2O sites as the bundles. To create simple N2O site with MAD and bundle it you should do: $ mad app sample $ cd sample $ mad deps compile plan bundle web_app ./web_app packed Site could be run on any machine with Erlang installed in any folder. -- 5HT _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions From maxim@REDACTED Thu Oct 23 10:51:29 2014 From: maxim@REDACTED (Maxim Sokhatsky) Date: Thu, 23 Oct 2014 11:51:29 +0300 Subject: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 In-Reply-To: <12F2115FD1CCEE4294943B2608A18FA301223AD93D@MAIL01.win.lbaum.eu> References: <1720035394.46871.1414040125597.JavaMail.vpopmail@webmail3.networksolutionsemail.com> <12F2115FD1CCEE4294943B2608A18FA301223AD93D@MAIL01.win.lbaum.eu> Message-ID: Naturally you can't redefine code:priv_dir that is why we created custom Cowboy static handler (ETS FS aware) and are using own own MAD API for that purposes. -- Maxim From Tobias.Schlager@REDACTED Thu Oct 23 11:15:24 2014 From: Tobias.Schlager@REDACTED (Tobias Schlager) Date: Thu, 23 Oct 2014 09:15:24 +0000 Subject: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 In-Reply-To: References: <1720035394.46871.1414040125597.JavaMail.vpopmail@webmail3.networksolutionsemail.com> <12F2115FD1CCEE4294943B2608A18FA301223AD93D@MAIL01.win.lbaum.eu>, Message-ID: <12F2115FD1CCEE4294943B2608A18FA301223AD956@MAIL01.win.lbaum.eu> Obviously not, I just thought that the solution does some magic with the code path and uses some (undocumented) hooks to engange in the file loading/lookup process. Nevertheless, having an ETS based filesystem for this purpose is a cool idea and could be a good extension for the erl_prim_loader. Regards Tobias ________________________________________ Von: Maxim Sokhatsky [maxim@REDACTED] Gesendet: Donnerstag, 23. Oktober 2014 10:51 An: erlang-questions@REDACTED; Tobias Schlager Betreff: Re: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 Naturally you can't redefine code:priv_dir that is why we created custom Cowboy static handler (ETS FS aware) and are using own own MAD API for that purposes. -- Maxim From jean.parpaillon@REDACTED Thu Oct 23 11:28:31 2014 From: jean.parpaillon@REDACTED (Jean Parpaillon) Date: Thu, 23 Oct 2014 11:28:31 +0200 Subject: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 In-Reply-To: <12F2115FD1CCEE4294943B2608A18FA301223AD93D@MAIL01.win.lbaum.eu> References: <1720035394.46871.1414040125597.JavaMail.vpopmail@webmail3.networksolutionsemail.com> , <12F2115FD1CCEE4294943B2608A18FA301223AD93D@MAIL01.win.lbaum.eu> Message-ID: <1414056511.29793.8.camel@free.fr> Hi, Le jeudi 23 octobre 2014 ? 08:39 +0000, Tobias Schlager a ?crit : > 'mad bundle' sounds interesting, especially the idea of having an ETS based filesystem. Does this work together with the standard OTP API (code:priv_dir/1 and file module) or do you have to adapt the bundled apps to a custom API? > > When writing the https://github.com/schlagert/rebar_escript_plugin I also ran into the issue of not available 'priv' content. My highest directive was not to force apps to use another API than the standard OTP one. In the end, I couldn't figure out a better solution than to unpack everything to the local filesystem on escript startup.... or write a custom (prim_)loader. > > @Jean: I did pretty much the same project as a showcase for the rebar_escripit_plugin, see https://github.com/schlagert/serve_it :) Great :) Jean > > Regards > Tobias > > ________________________________________ > Von: erlang-questions-bounces@REDACTED [erlang-questions-bounces@REDACTED]" im Auftrag von "Maxim Sokhatsky [maxim@REDACTED] > Gesendet: Donnerstag, 23. Oktober 2014 09:47 > An: Rohan Sarker; erlang-questions@REDACTED > Betreff: Re: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 > > Hello. You can create escript bundles with MAD. > > https://synrc.com/apps/mad > > The name of the binary should be the same as as the module which has main/1 function. MAD know how yo ordering apps. Binaries made with mad are able to be run under Windows, Linux and Mac. We created ETS filesystem wich unzip all priv dirs of all apps to the memory from the bundle?s static.gz. So you even be able to run N2O sites as the bundles. To create simple N2O site with MAD and bundle it you should do: > > $ mad app sample > $ cd sample > $ mad deps compile plan bundle web_app > > ./web_app packed Site could be run on any machine with Erlang installed in any folder. > > -- > 5HT > > > _______________________________________________ > 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 -- Jean Parpaillon Open Source Consultant Phone: +33 6 30 10 92 86 im: jean.parpaillon@REDACTED skype: jean.parpaillon linkedin: http://www.linkedin.com/in/jeanparpaillon/en From maxim@REDACTED Thu Oct 23 11:28:37 2014 From: maxim@REDACTED (Maxim Sokhatsky) Date: Thu, 23 Oct 2014 12:28:37 +0300 Subject: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 In-Reply-To: <12F2115FD1CCEE4294943B2608A18FA301223AD956@MAIL01.win.lbaum.eu> References: <1720035394.46871.1414040125597.JavaMail.vpopmail@webmail3.networksolutionsemail.com> <12F2115FD1CCEE4294943B2608A18FA301223AD93D@MAIL01.win.lbaum.eu> <12F2115FD1CCEE4294943B2608A18FA301223AD956@MAIL01.win.lbaum.eu> Message-ID: Yeah, the?erl_prim_loader is broken by design. That is why we don?t have many bundlers in Erlang. -- Maxim From edgurgel@REDACTED Thu Oct 23 11:35:19 2014 From: edgurgel@REDACTED (Eduardo Gurgel) Date: Thu, 23 Oct 2014 22:35:19 +1300 Subject: [erlang-questions] Binary pattern matching on ETS Message-ID: Is it possible to match the prefix of a binary using ETS match spec? And if it's not, is it a limitation or just a missing implementation? Thanks in advance, -- Eduardo http://gurgel.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From ceo@REDACTED Thu Oct 23 14:23:29 2014 From: ceo@REDACTED (Rohan Sarker) Date: Thu, 23 Oct 2014 08:23:29 -0400 (EDT) Subject: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 In-Reply-To: References: <1720035394.46871.1414040125597.JavaMail.vpopmail@webmail3.networksolutionsemail.com> <12F2115FD1CCEE4294943B2608A18FA301223AD93D@MAIL01.win.lbaum.eu> <12F2115FD1CCEE4294943B2608A18FA301223AD956@MAIL01.win.lbaum.eu> Message-ID: <1863817310.9407.1414067009092.JavaMail.vpopmail@webmail3.networksolutionsemail.com> Dear list members. Thank you for all your kind replies. I want to tell you that I am a beginner in Erlang and I am very weak in interpreting English as English is not my native language. I just started this month a few days back and that I worked in Ericsson AXE10 / AXE810 in beginner stages in 2005-2005 as Switch Analyst earlier. My requirement is that I had an Erlang Source File named as helloworld.erl whch I can compile in werl application as: c(helloworld). {ok,helloworld} This generates helloworld.beam as Erlang Beam Code. Now to create an application as .EXE file in Windows 7 what I need to do practically like: Step 1: Do this Step 2: Do that Step 3: Do this Step 4: Copy this . .. ... Step N: helloworld.exe file is generated which on double click does the functionality as mentioned in the Erlang Code. This .exe file can be distributed without Erlang Installation preferably. I read all the posts and since I am not very strong in English, I had difficulty in interpreting the same. Please excuse me for the same. Thank you. Regards Rohan Sarker CEO & Founder SwitchGate CrystalShift http://www.rohansarker.com/home.html http://about.me/rohansarker https://www.facebook.com/rohan.sarker.5 https://www.facebook.com/switchgatecrystalshift +913324288069 +917278539338 +919674221741 Skype: arati_genius On October 23, 2014 at 5:28 AM Maxim Sokhatsky wrote: > Yeah, the erl_prim_loader is broken by design. > That is why we don?t have many bundlers in Erlang. > > -- > Maxim > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tobias.Schlager@REDACTED Thu Oct 23 16:36:45 2014 From: Tobias.Schlager@REDACTED (Tobias Schlager) Date: Thu, 23 Oct 2014 14:36:45 +0000 Subject: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 In-Reply-To: <1863817310.9407.1414067009092.JavaMail.vpopmail@webmail3.networksolutionsemail.com> References: <1720035394.46871.1414040125597.JavaMail.vpopmail@webmail3.networksolutionsemail.com> <12F2115FD1CCEE4294943B2608A18FA301223AD93D@MAIL01.win.lbaum.eu> <12F2115FD1CCEE4294943B2608A18FA301223AD956@MAIL01.win.lbaum.eu> , <1863817310.9407.1414067009092.JavaMail.vpopmail@webmail3.networksolutionsemail.com> Message-ID: <12F2115FD1CCEE4294943B2608A18FA301223AE9C4@MAIL01.win.lbaum.eu> Sorry for the confusing OT discussion. Unfortunately, what you want, is AFAIK not possible. There are a number of previous discussions on the list regarding this topic if you search the archives. Good luck Tobias ________________________________ Von: Rohan Sarker [ceo@REDACTED] Gesendet: Donnerstag, 23. Oktober 2014 14:23 An: Tobias Schlager; Maxim Sokhatsky; erlang-questions@REDACTED Betreff: Re: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 Dear list members. Thank you for all your kind replies. I want to tell you that I am a beginner in Erlang and I am very weak in interpreting English as English is not my native language. I just started this month a few days back and that I worked in Ericsson AXE10 / AXE810 in beginner stages in 2005-2005 as Switch Analyst earlier. My requirement is that I had an Erlang Source File named as helloworld.erl whch I can compile in werl application as: c(helloworld). {ok,helloworld} This generates helloworld.beam as Erlang Beam Code. Now to create an application as .EXE file in Windows 7 what I need to do practically like: Step 1: Do this Step 2: Do that Step 3: Do this Step 4: Copy this . .. ... Step N: helloworld.exe file is generated which on double click does the functionality as mentioned in the Erlang Code. This .exe file can be distributed without Erlang Installation preferably. I read all the posts and since I am not very strong in English, I had difficulty in interpreting the same. Please excuse me for the same. Thank you. Regards Rohan Sarker CEO & Founder SwitchGate CrystalShift http://www.rohansarker.com/home.html http://about.me/rohansarker https://www.facebook.com/rohan.sarker.5 https://www.facebook.com/switchgatecrystalshift +913324288069 +917278539338 +919674221741 Skype: arati_genius On October 23, 2014 at 5:28 AM Maxim Sokhatsky wrote: > Yeah, the erl_prim_loader is broken by design. > That is why we don?t have many bundlers in Erlang. > > -- > Maxim > > > _______________________________________________ > 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 Thu Oct 23 17:22:27 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 23 Oct 2014 11:22:27 -0400 Subject: [erlang-questions] Creating .EXE from Erlang Application in Windows 7 In-Reply-To: <1863817310.9407.1414067009092.JavaMail.vpopmail@webmail3.networksolutionsemail.com> References: <1720035394.46871.1414040125597.JavaMail.vpopmail@webmail3.networksolutionsemail.com> <12F2115FD1CCEE4294943B2608A18FA301223AD93D@MAIL01.win.lbaum.eu> <12F2115FD1CCEE4294943B2608A18FA301223AD956@MAIL01.win.lbaum.eu> <1863817310.9407.1414067009092.JavaMail.vpopmail@webmail3.networksolutionsemail.com> Message-ID: <20141023152226.GA2531@ferdair.local> On 10/23, Rohan Sarker wrote: > Dear list members. > > My requirement is that I had an Erlang Source File named as helloworld.erl whch > I can compile in werl application as: > > c(helloworld). > > [...] > > Step N: helloworld.exe file is generated which on double click does the > functionality as mentioned in the Erlang Code. This .exe file can be distributed > without Erlang Installation preferably. > Hi, a single executable .exe is not directly possible this easily with Erlang. What you can have however, is one redistributable release that will be self-contained. There are many ways to do it. I've tried documenting some in http://learnyousomeerlang.com/release-is-the-word (which I believe should be platform-agnostic for the most part), but it tends to depend on prior knowledge of other bits of the Erlang ecosystem. I've made a quick overview of it in http://howistart.org/posts/erlang/1 -- although this bit uses Relx, a different build tool altogether. Other options exist, but would require an Erlang install to be present already. Regards, Fred. From tty.erlang@REDACTED Thu Oct 23 17:34:29 2014 From: tty.erlang@REDACTED (T Ty) Date: Thu, 23 Oct 2014 16:34:29 +0100 Subject: [erlang-questions] Erlang and Oracle Message-ID: Hello, Has anyone worked with connecting Erlang to Oracle 12 ? I tried unixODBC on RH 5 and get a memory allocation exception, {port_exit,memory_allocation_failed}, when doing a "select * from employee" as per http://www.erlang.org/documentation/doc-1/apps/odbc/getting_started.html#id59381 odbc:param_query isn't supported and odbc:insert does not cleanly update the table if following the example. However if I create the table in sqlplus followed by an insert from Erlang odbc it works. The select still doesn't. Given that isql and sqlplus works just fine this leads me to believe the issue is with the Erlang ODBC port driver. I am open to using Erlang/OCI if folks have better experience with it. Thanks, /t -------------- next part -------------- An HTML attachment was scrubbed... URL: From andre.graf@REDACTED Thu Oct 23 18:18:34 2014 From: andre.graf@REDACTED (Andre Graf) Date: Thu, 23 Oct 2014 18:18:34 +0200 Subject: [erlang-questions] Erlang and Oracle In-Reply-To: References: Message-ID: <54492A5A.50808@erl.io> Hi there, I know the guys at K2Informatics use the https://github.com/k2informatics/erloci project heavily in production. Cheers Andre On 10/23/2014 05:34 PM, T Ty wrote: > Hello, > > Has anyone worked with connecting Erlang to Oracle 12 ? > > I tried unixODBC on RH 5 and get a memory allocation exception, > {port_exit,memory_allocation_failed}, when doing a "select * from > employee" as per > > http://www.erlang.org/documentation/doc-1/apps/odbc/getting_started.html#id59381 > > odbc:param_query isn't supported and odbc:insert does not cleanly update > the table if following the example. > > However if I create the table in sqlplus followed by an insert from > Erlang odbc it works. The select still doesn't. > > Given that isql and sqlplus works just fine this leads me to believe the > issue is with the Erlang ODBC port driver. > > > I am open to using Erlang/OCI if folks have better experience with it. > > Thanks, /t > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From bduggan@REDACTED Fri Oct 24 06:08:14 2014 From: bduggan@REDACTED (Bernard Duggan) Date: Fri, 24 Oct 2014 15:08:14 +1100 Subject: [erlang-questions] Mnesia transaction restarts Message-ID: <5449D0AE.5010507@shoretel.com> Hi List, Can anyone shed some light for me on the exact circumstances under which mnesia transactions will restart? I ask because on our system (which I'd describe as "moderately loaded", on the order of maybe a few million transactions a day) we had a couple of cases recently where a relatively simple read-then-write transaction hit 60 retries and 82 seconds. This is a single-node system using a disc_copies table with a couple of extra indices set on it, but nothing else very special. Of course, mnesia did no less than what the manual promised: the transaction eventually completed. However I'd like to understand better what might lead to so many retries (and, as a result of the increasing retry backoff, the very long delay). I've read every bit of "mneisa internals" documentation I can get my hands on, but I'm still a bit hazy. If I read that stuff correctly, it seems that unless there's a lot of transactions that started *before* the one in question, and ran for a very long time themselves, it should actually have been queued up to run next rather than retrying. It seems very likely that there are other cases that will cause a retry regardless of how "old" the transaction is with respect to any it might conflict with (the manual casually mentions that it may be restarted "thousands" of times), but it's those cases that I'm not clear on. Cheers, Bernard ________________________________ This e-mail and any attachments are confidential. If it is not intended for you, please notify the sender, and please erase and ignore the contents. From dangud@REDACTED Fri Oct 24 08:16:46 2014 From: dangud@REDACTED (Dan Gudmundsson) Date: Fri, 24 Oct 2014 08:16:46 +0200 Subject: [erlang-questions] Mnesia transaction restarts In-Reply-To: <5449D0AE.5010507@shoretel.com> References: <5449D0AE.5010507@shoretel.com> Message-ID: Mnesia transactions are restarted when something hinders the completion of the transaction. Basically locks that are occupied or that another involved mnesia-node goes down during the transaction. So in your single node case it it caused by locks conflicts. To avoid deadlock and starvation mnesia locks are restarted if the transaction id is newer than the transaction holding the lock. Otherwise the transaction will be queued until that lock is released. /Dan On Fri, Oct 24, 2014 at 6:08 AM, Bernard Duggan wrote: > Hi List, > Can anyone shed some light for me on the exact circumstances under which > mnesia transactions will restart? I ask because on our system (which I'd > describe as "moderately loaded", on the order of maybe a few million > transactions a day) we had a couple of cases recently where a relatively > simple read-then-write transaction hit 60 retries and 82 seconds. This > is a single-node system using a disc_copies table with a couple of extra > indices set on it, but nothing else very special. > > Of course, mnesia did no less than what the manual promised: the > transaction eventually completed. However I'd like to understand better > what might lead to so many retries (and, as a result of the increasing > retry backoff, the very long delay). I've read every bit of "mneisa > internals" documentation I can get my hands on, but I'm still a bit > hazy. If I read that stuff correctly, it seems that unless there's a lot > of transactions that started *before* the one in question, and ran for a > very long time themselves, it should actually have been queued up to run > next rather than retrying. It seems very likely that there are other > cases that will cause a retry regardless of how "old" the transaction is > with respect to any it might conflict with (the manual casually mentions > that it may be restarted "thousands" of times), but it's those cases > that I'm not clear on. > > Cheers, > > Bernard > > ________________________________ > > This e-mail and any attachments are confidential. If it is not intended > for you, please notify the sender, and please erase and ignore the contents. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ewoznicka@REDACTED Fri Oct 24 11:09:02 2014 From: ewoznicka@REDACTED (=?UTF-8?B?RXdhIFdvxbpuaWNrYQ==?=) Date: Fri, 24 Oct 2014 11:09:02 +0200 Subject: [erlang-questions] team of Erlang developers for hire Message-ID: <544A172E.9050307@silversoft.pl> Hello, I'd like to let you know that our team has now some free man-power. If you have projects that need expert Erlang developers and/or for more information about us, please contact me. Sincerly yours, Ewa Woznicka Executive Assistant SilverSoft Sp. z o.o., Warsaw From rainer.hansen@REDACTED Fri Oct 24 19:28:04 2014 From: rainer.hansen@REDACTED (Rainer Hansen) Date: Fri, 24 Oct 2014 19:28:04 +0200 Subject: [erlang-questions] Erlang web servers and DDoS? Message-ID: <87tx2tv0m3.fsf@gmx.net> Hi, I wonder which Erlang web server is best fitted to handle DDoS attacks and what is the reason for that? The web server should be used for dynamic web pages. It will need to read some data from a data storage on another server. I wonder especially about the difference of Yaws and Cowboy regarding this topic. Thanks for your help! Rainer From rainer.hansen@REDACTED Fri Oct 24 19:36:36 2014 From: rainer.hansen@REDACTED (Rainer Hansen) Date: Fri, 24 Oct 2014 19:36:36 +0200 Subject: [erlang-questions] Erlang/OTP based systems and DDoS Message-ID: <87ppdhv07v.fsf@gmx.net> Hi, I wonder what are the strengths and weaknesses of Erlang/OTP based system in genearl regarding DDoS? It seems that the fine grained processes help Erlang/OTP systems to handle attack situations better because they can handle more load. I guess that might not be the only reason. The concept of process supervision should make Erlang/OTP also better to handle such attacks. Are there some mechanisms or principles that make Erlang/OTP superior to systems build in Node.js, PHP or Java? What are the weak points? Are there best practices to handle them? Thanks for your help. Rainer From lloyd@REDACTED Fri Oct 24 21:41:24 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Fri, 24 Oct 2014 15:41:24 -0400 (EDT) Subject: [erlang-questions] Mnesia and supervision Message-ID: <1414179684.403616975@apps.rackspace.com> Hello, In a web application, what is the best way to supervise mnesia when more than one user has access to the mnesia tables? E.g., say I have the following modules: my_data_sup.erl -- supervisor my_insert_info.erl -- insertion form my_get_info.erl -- retrieve form my_data_store.erl -- mnesia query functions I don't understand how to restart mnesia if it should abort for any reason. Many thanks, LRP -------------- next part -------------- An HTML attachment was scrubbed... URL: From kunthar@REDACTED Sat Oct 25 00:26:06 2014 From: kunthar@REDACTED (Gokhan Boranalp) Date: Sat, 25 Oct 2014 01:26:06 +0300 Subject: [erlang-questions] Erlang/OTP based systems and DDoS In-Reply-To: <87ppdhv07v.fsf@gmx.net> References: <87ppdhv07v.fsf@gmx.net> Message-ID: Hi, You have no choice for this kind of attack [1]. Even Erlang can not help for this magnitude. Please consider solving DDOS separately by using different techniques. i think nor Erlang neither any other languages has nothing to do with it directly. [1] http://blog.cloudflare.com/technical-details-behind-a-400gbps-ntp-amplification-ddos-attack/ [2] https://www.cloudflare.com/ http://www.cisco.com/c/en/us/products/collateral/security/traffic-anomaly-detector-xt-5600a/prod_white_paper0900aecd8011e927.html On Fri, Oct 24, 2014 at 8:36 PM, Rainer Hansen wrote: > Hi, > > I wonder what are the strengths and weaknesses of Erlang/OTP based > system in genearl regarding DDoS? > > It seems that the fine grained processes help Erlang/OTP systems to > handle attack situations better because they can handle more load. I > guess that might not be the only reason. The concept of process > supervision should make Erlang/OTP also better to handle such attacks. > > Are there some mechanisms or principles that make Erlang/OTP superior to > systems build in Node.js, PHP or Java? > > What are the weak points? Are there best practices to handle them? > > Thanks for your help. > > Rainer > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- BR, \|/ Kunthar From ransomr@REDACTED Sat Oct 25 00:41:36 2014 From: ransomr@REDACTED (Ransom Richardson) Date: Fri, 24 Oct 2014 22:41:36 +0000 Subject: [erlang-questions] Truncated error reports Message-ID: <1414190496878.65031@talko.com> I've been trying to get useful information (the full stack) from Cowboy error reports. But all of our reports are truncated. I found this http://stackoverflow.com/questions/17596686/truncated-error-report-in-erlang?, but the solution didn't work for me. I looked at the emulator source code and found the undocumented +# switch which controls precision. Using this switch, I verified that the errors are being truncated by the emulator itself (see below). Is this truncation intentional or a bug? Is there a better way around it than the +# switch? At a higher level, is there a better way to get error/crash information from a process than going through error_logger? We're using lager and erlbrake and both add error_logger handlers that parse the text error reports. I would much rather deal with the reason term directly. Is there a way to be notified of process termination other than error_logger? ? talko@REDACTED:~/talko_service/erl/session$ erl Erlang/OTP 17 [erts-6.1.2] [source] [64-bit] [smp:6:6] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.1.2 (abort with ^G) 1> spawn(fun() -> erlang:error([$x || _ <- lists:seq(0,5000)]) end). <0.35.0> =ERROR REPORT==== 24-Oct-2014::22:23:21 === Error in process <0.35.0> with exit value: {"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... talko@REDACTED:~/talko_service/erl/session$ erl +#10 Erlang/OTP 17 [erts-6.1.2] [source] [64-bit] [smp:6:6] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.1.2 (abort with ^G) 1> spawn(fun() -> erlang:error([$x || _ <- lists:seq(0,5000)]) end). <0.35.0> 2> =ERROR REPORT==== 24-Oct-2014::22:23:34 === Error in process <0.35.0> with exit value: {"xxxxxxxx... talko@REDACTED:~/talko_service/erl/session$ erl +#400 Erlang/OTP 17 [erts-6.1.2] [source] [64-bit] [smp:6:6] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.1.2 (abort with ^G) 1> spawn(fun() -> erlang:error([$x || _ <- lists:seq(0,5000)]) end). <0.35.0> 2> =ERROR REPORT==== 24-Oct-2014::22:23:49 === Error in process <0.35.0> with exit value: {"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmytro.lytovchenko@REDACTED Sat Oct 25 07:49:38 2014 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Sat, 25 Oct 2014 07:49:38 +0200 Subject: [erlang-questions] Erlang/OTP based systems and DDoS In-Reply-To: <87ppdhv07v.fsf@gmx.net> References: <87ppdhv07v.fsf@gmx.net> Message-ID: One way to handle a DDOS is to soak it with far superior infrastrusture, in simple words -- throw money at it and scale until DDOS becomes a regular load which is possible to handle.Erlang can scale your (well designed) app on as many servers as DDOS requires until you run out of money paying for AWS or other cloud hosting, or until DDOS is absorbed fully. On Fri, Oct 24, 2014 at 7:36 PM, Rainer Hansen wrote: > Hi, > > I wonder what are the strengths and weaknesses of Erlang/OTP based > system in genearl regarding DDoS? > > It seems that the fine grained processes help Erlang/OTP systems to > handle attack situations better because they can handle more load. I > guess that might not be the only reason. The concept of process > supervision should make Erlang/OTP also better to handle such attacks. > > Are there some mechanisms or principles that make Erlang/OTP superior to > systems build in Node.js, PHP or Java? > > What are the weak points? Are there best practices to handle them? > > Thanks for your help. > > Rainer > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Sat Oct 25 08:40:08 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Sat, 25 Oct 2014 10:40:08 +0400 Subject: [erlang-questions] Erlang/OTP based systems and DDoS In-Reply-To: References: <87ppdhv07v.fsf@gmx.net> Message-ID: Rainer, there is no simple thing like "DDoS" protection. You need to plan what ddos are you going to handle, because if you get 5 gbit/s of SYN flood, it doesn't matter what language for your website do you choose, it matter what ddos protection service do you choose. For example, if you are under serious ddos attack, you have only one choice: go to company that have control over it's AS connectivity and at least 100-200 gbit/s of connectivity and ask them for a protection. They will give you new IP address of a proxy. This proxy will filter about 99,99% of traffic and leave only valuable requests. So again: it doesn't matter what language do you choose. But of course there are serious design ideas that make erlang much superior comparing to node.js or even Java. It is process+messaging model. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wallentin.dahlberg@REDACTED Sat Oct 25 17:16:25 2014 From: wallentin.dahlberg@REDACTED (=?UTF-8?Q?Bj=C3=B6rn=2DEgil_Dahlberg?=) Date: Sat, 25 Oct 2014 17:16:25 +0200 Subject: [erlang-questions] Truncated error reports In-Reply-To: <1414190496878.65031@talko.com> References: <1414190496878.65031@talko.com> Message-ID: There is a currently a Pull Request that deals with this: https://github.com/erlang/otp/pull/359 I believe that PR will make into master in one form or another. Why is the error truncated in the first place? If I had to guess, and sadly I have to, I think it has to do with memory and copying. When a process terminates with an error, it could potentially have a very large message (state and stacktrace) which is then sent to the error logger. Currently, before the error message is sent by the dying process it will truncate the message to 200 (default) characters. This means we have less to copy and we are less likely to kill the system, i.e. we have more control. So, if not truncated it could in the worst case kill the system. See my last entry in the PR for an example. I think the heart of the matter is that we have less control when a process dies and thus have no control over what the error message is or more importantly how large it is. So we truncate it to have some control. The problem is compounded by the lack of sharing of terms. Aside: In this particular case of error message propagation it should be possible to just give the heap of the dying process as a heap fragment to the receiving process. The dying process should't need it anyway. No copy should be needed. // Bj?rn-Egil 2014-10-25 0:41 GMT+02:00 Ransom Richardson : > I've been trying to get useful information (the full stack) from Cowboy > error reports. But all of our reports are truncated. I found this > http://stackoverflow.com/questions/17596686/truncated-error-report-in-erlang?, > but the solution didn't work for me. > > > I looked at the emulator source code and found the undocumented +# > switch which controls precision. Using this switch, I verified that the > errors are being truncated by the emulator itself (see below). > > > Is this truncation intentional or a bug? Is there a better way around it > than the +# switch? > > > At a higher level, is there a better way to get error/crash information > from a process than going through error_logger? We're using lager and > erlbrake and both add error_logger handlers that parse the text error > reports. I would much rather deal with the reason term directly. Is there a > way to be notified of process termination other than error_logger? > > ? > > > > talko@REDACTED:~/talko_service/erl/session$ erl > Erlang/OTP 17 [erts-6.1.2] [source] [64-bit] [smp:6:6] [async-threads:10] > [hipe] [kernel-poll:false] > > Eshell V6.1.2 (abort with ^G) > 1> spawn(fun() -> erlang:error([$x || _ <- lists:seq(0,5000)]) end). > <0.35.0> > > =ERROR REPORT==== 24-Oct-2014::22:23:21 === > Error in process <0.35.0> with exit value: > {"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... > > > talko@REDACTED:~/talko_service/erl/session$ erl +#10 > Erlang/OTP 17 [erts-6.1.2] [source] [64-bit] [smp:6:6] [async-threads:10] > [hipe] [kernel-poll:false] > > Eshell V6.1.2 (abort with ^G) > 1> spawn(fun() -> erlang:error([$x || _ <- lists:seq(0,5000)]) end). > <0.35.0> > 2> > =ERROR REPORT==== 24-Oct-2014::22:23:34 === > Error in process <0.35.0> with exit value: {"xxxxxxxx... > > > talko@REDACTED:~/talko_service/erl/session$ erl +#400 > Erlang/OTP 17 [erts-6.1.2] [source] [64-bit] [smp:6:6] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.1.2 (abort with ^G) > 1> spawn(fun() -> erlang:error([$x || _ <- lists:seq(0,5000)]) end). > <0.35.0> > 2> > =ERROR REPORT==== 24-Oct-2014::22:23:49 === > Error in process <0.35.0> with exit value: > {"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From peerst@REDACTED Sat Oct 25 17:18:20 2014 From: peerst@REDACTED (Peer Stritzinger) Date: Sat, 25 Oct 2014 17:18:20 +0200 Subject: [erlang-questions] Distributed Application where its only running if all required Nodes are present Message-ID: Hi, I want to run a application on several nodes at the same time. However it only should run on any node if all nodes are present and can communicate. If the node set is not complete, the application should be stopped. If the node set afterwards is complete again it should be restarted. Is a behaviour like this doable with OTPs build in distributed applications? E.g. would something along these lines do what I'm intending? On node 1: [{kernel, [{distributed, [{myapp, 5000, [node1]}]}, {sync_nodes_mandatory, [node2, node3]}, {sync_nodes_timeout, 30000} ]}] On node 2: [{kernel, [{distributed, [{myapp, 5000, [node2]}]}, {sync_nodes_mandatory, [node1, node3]}, {sync_nodes_timeout, 30000} ]}] On node 3: [{kernel, [{distributed, [{myapp, 5000, [node3]}]}, {sync_nodes_mandatory, [node1, node2]}, {sync_nodes_timeout, 30000} ]}] Cheers, -- Peer From peerst@REDACTED Sat Oct 25 17:48:56 2014 From: peerst@REDACTED (Peer Stritzinger) Date: Sat, 25 Oct 2014 17:48:56 +0200 Subject: [erlang-questions] FreeBSD cpu topology detection References: <630E734F-EBD3-4EEA-9A0B-CC1DAFD4AFF3@kallisys.net> Message-ID: On 2014-10-19 15:37:11 +0000, Paul Guyot said: > > I am amazed that the parser is written (which I authored) instead of > being debugged??? I don't mean it's exceptional code, and it actually > needed more love and especially tests??? > > The issue is not FreeBSD 10 but rather FreeBSD 10's default compiler > (clang). There was a bug in this code with an undefined behavior. Older > versions of gcc (which we use) behave as expected by the code, while > clang and gcc devel (4.9) do not (only gcc 4.9 warns about it). I can confirm that erlang:system_info(cpu_topology) works as advertized on FreeBSD 8.0 and 8.2 (any Erlang version I have installed) Cheers -- Peer From brendan@REDACTED Sat Oct 25 17:57:28 2014 From: brendan@REDACTED (Brendan McKenna) Date: Sat, 25 Oct 2014 16:57:28 +0100 Subject: [erlang-questions] Erlang/OTP based systems and DDoS In-Reply-To: References: <87ppdhv07v.fsf@gmx.net> Message-ID: <544BC868.8030601@hallwaysdc.com> Hi, On 25/10/14 06:49, Dmytro Lytovchenko wrote: > One way to handle a DDOS is to soak it with far superior infrastrusture, in > simple words -- throw money at it and scale until DDOS becomes a regular > load which is possible to handle.Erlang can scale your (well designed) app > on as many servers as DDOS requires until you run out of money paying for > AWS or other cloud hosting, or until DDOS is absorbed fully. > An alternative to that would be to use a distributed caching service like CloudFlare, who handle DDOS attacks as part of their normal business and let them worry about it. At large scales, it's probably cheaper than trying to scale out your infrastructure on your own. Brendan From drc@REDACTED Sat Oct 25 20:21:30 2014 From: drc@REDACTED (David Conrad) Date: Sat, 25 Oct 2014 11:21:30 -0700 Subject: [erlang-questions] Erlang/OTP based systems and DDoS In-Reply-To: <544BC868.8030601@hallwaysdc.com> References: <87ppdhv07v.fsf@gmx.net> <544BC868.8030601@hallwaysdc.com> Message-ID: On Oct 25, 2014, at 8:57 AM, Brendan McKenna wrote: >> Erlang can scale your (well designed) app >> on as many servers as DDOS requires until you run out of money paying for >> AWS or other cloud hosting, or until DDOS is absorbed fully. > > An alternative to that would be to use a distributed caching service like CloudFlare, who handle DDOS attacks as part of their normal business and let them worry about it. At large scales, it's probably cheaper than trying to scale out your infrastructure on your own. While true[*], CloudFlare only works for HTTP/HTTPS. Regards, -drc [*]: Full disclosure: I used to work for them and still do occasional consulting for them. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: Message signed with OpenPGP using GPGMail URL: From kovyl2404@REDACTED Sat Oct 25 20:37:03 2014 From: kovyl2404@REDACTED (Viacheslav V. Kovalev) Date: Sat, 25 Oct 2014 22:37:03 +0400 Subject: [erlang-questions] Erlang garbage collection Message-ID: <544BEDCF.8050409@gmail.com> Hi all! I need your help in investigation of issue with erlang memory consumption. How typical, isn't it? We have two different deployment schemes. * In first scheme we running many identical nodes on small virtual machines (in Amazon AWS), one node per machine. Each machine has 4Gb of RAM. * In another deployment scheme we running this nodes on big baremetal machines (with 64 Gb of ram), with many nodes per machine. In this deployment nodes are isolated in docker containers (with memory limit set to 4 Gb). I've noticed, that heap of processes in dockerized nodes are hogging up to 3 times much more RAM, than heaps in non-dockerized nodes with identical load. I suspect that garbage collection in non-dockerized nodes is more aggressive. Unfortunately, I don't have any garbage collection statistics, but I wanna obtain it ASAP. To give more information, I should say that we are using HiPE R17.1 on ubuntu 14.04 with stock kernel. In both schemes we are running 8 schedulers per node, and using default `fullsweep_after` flag. My blind suggestion is that erlang default garbage collection relies (somehow) on /proc/meminfo (which is not actual in dockerized environment). I am not C-guy and not familar with emulator internals, so could someone point me to places in erlang sources that are responsible for garbage collection and some emulator options which I can use to tweak this behavior? Viacheslav V. Kovalev Software engineer, Tradingview. From zd2559@REDACTED Sun Oct 26 08:24:52 2014 From: zd2559@REDACTED (=?GBK?B?1cW2sA==?=) Date: Sun, 26 Oct 2014 15:24:52 +0800 (CST) Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? Message-ID: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> Hello the maillist member: I am new in Erlang,Please Help me. When I try some multiplication, I got the some unexpected answer about the following expression. Please help! List: 23> [1.1*1.1,1.1*1.2,1.1*1.3,1.1*1.4,1.1*1.5]. [1.2100000000000002,1.32,1.4300000000000002,1.54, 1.6500000000000001] 24> [1.2*1.2,1.2*1.3,1.2*1.4,1.2*1.5,1.2*1.6]. [1.44,1.56,1.68,1.7999999999999998,1.92] Thank you for your time. Eric D. Zhang In China. -------------- next part -------------- An HTML attachment was scrubbed... URL: From peerst@REDACTED Sun Oct 26 09:44:39 2014 From: peerst@REDACTED (Peer Stritzinger) Date: Sun, 26 Oct 2014 09:44:39 +0100 Subject: [erlang-questions] Distributed Application where its only running if all required Nodes are present References: Message-ID: FYI: Currently I went away from this distributed application setup. What I'm doing now is starting the application on each node and handling the whole distribution aspect myself. Main reason was that I also need to wait until a certain set of keys are registered in global before I start the application parts on the respective machines. I do this with a monitor process which is started at the end of a all_for_one supervisor which waits until all global required keys are present, then monitors the remote processes and sends a 'start' message to its siblings. If any of the remote peers disappears it just crashes and takes down all siblings with it. When comming up again it waits again until all required global keys are present. With this setup I can easily also have a local fallback application that takes over when the network is not complete. This can be done by a protocol between the respective monitors. BTW this is used for my IEC61499 distributed PLC runtime for context see my talk http://www.erlang-factory.com/euc2014/peer-stritzinger Comments wellcome. Cheers, -- Peer On 2014-10-25 15:18:20 +0000, Peer Stritzinger said: > Hi, > > I want to run a application on several nodes at the same time. However > it only should run on any node if all nodes are present and can > communicate. > > If the node set is not complete, the application should be stopped. > > If the node set afterwards is complete again it should be restarted. > > Is a behaviour like this doable with OTPs build in distributed applications? > > E.g. would something along these lines do what I'm intending? > > On node 1: > > [{kernel, > [{distributed, [{myapp, 5000, [node1]}]}, > {sync_nodes_mandatory, [node2, node3]}, > {sync_nodes_timeout, 30000} > ]}] > > On node 2: > > [{kernel, > [{distributed, [{myapp, 5000, [node2]}]}, > {sync_nodes_mandatory, [node1, node3]}, > {sync_nodes_timeout, 30000} > ]}] > > On node 3: > > [{kernel, > [{distributed, [{myapp, 5000, [node3]}]}, > {sync_nodes_mandatory, [node1, node2]}, > {sync_nodes_timeout, 30000} > ]}] > > Cheers, > -- Peer From dmytro.lytovchenko@REDACTED Sun Oct 26 10:00:40 2014 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Sun, 26 Oct 2014 10:00:40 +0100 Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? In-Reply-To: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> References: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> Message-ID: Because of the principle how floating point numbers work. Encoded number is approximate, so that 0.0000000002 is just closest representation in binary that would encode your given fraction (1.21), and it is below the precision which is guaranteed for this size of floating point value. This question been discussed million times for every programming language. http://en.wikipedia.org/wiki/IEEE_floating_point (there is chinese variant of this article, hope its detailed enough). On Sun, Oct 26, 2014 at 8:24 AM, ?? wrote: > Hello the maillist member: > I am new in Erlang,Please Help me. > > When I try some multiplication, I got the some unexpected answer about > the following expression. > > Please help! > > List: > > 23> [1.1*1.1,1.1*1.2,1.1*1.3,1.1*1.4,1.1*1.5]. > [1.2100000000000002,1.32,1.4300000000000002,1.54, > 1.6500000000000001] > > 24> [1.2*1.2,1.2*1.3,1.2*1.4,1.2*1.5,1.2*1.6]. > [1.44,1.56,1.68,1.7999999999999998,1.92] > > Thank you for your time. > > Eric D. Zhang In China. > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Sun Oct 26 10:02:39 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Sun, 26 Oct 2014 10:02:39 +0100 Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? In-Reply-To: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> References: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> Message-ID: <544CB8AF.1050405@ninenines.eu> Floats are an inaccurate number format. See http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems Decimal32/decimal64 are the accurate equivalent, though quite new and as of now rarely found natively in programming languages. On 10/26/2014 08:24 AM, ?? wrote: > Hello the maillist member: > I am new in Erlang,Please Help me. > > When I try some multiplication, I got the someunexpectedanswerabout the > following expression. > > Please help! > > List: > > 23> [1.1*1.1,1.1*1.2,1.1*1.3,1.1*1.4,1.1*1.5]. > [1.2100000000000002,1.32,1.4300000000000002,1.54, > 1.6500000000000001] > > 24> [1.2*1.2,1.2*1.3,1.2*1.4,1.2*1.5,1.2*1.6]. > [1.44,1.56,1.68,1.7999999999999998,1.92] > > Thank you for your time. > > Eric D. Zhang In China. > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From ivan@REDACTED Sun Oct 26 10:03:48 2014 From: ivan@REDACTED (Ivan Uemlianin) Date: Sun, 26 Oct 2014 09:03:48 +0000 Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? In-Reply-To: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> References: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> Message-ID: ??? Which part of the answer was unexpected? This: > 1.1*1.1. 1.2100000000000002 is normal for floating point arithmetic. Ivan -- festina lente > On 26 Oct 2014, at 07:24, ?? wrote: > > Hello the maillist member: > I am new in Erlang,Please Help me. > > When I try some multiplication, I got the some unexpected answer about the following expression. > > Please help! > > List: > > 23> [1.1*1.1,1.1*1.2,1.1*1.3,1.1*1.4,1.1*1.5]. > [1.2100000000000002,1.32,1.4300000000000002,1.54, > 1.6500000000000001] > > 24> [1.2*1.2,1.2*1.3,1.2*1.4,1.2*1.5,1.2*1.6]. > [1.44,1.56,1.68,1.7999999999999998,1.92] > > Thank you for your time. > > Eric D. Zhang In China. > > > > _______________________________________________ > 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 Oct 26 10:04:13 2014 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Sun, 26 Oct 2014 10:04:13 +0100 Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? Message-ID: <48yllbfhilw46gppqxuaks8n.1414314253695@email.android.com> Hi, you will have this problem with any programming language, it is due to float representation in computers. the lonely way is to work with integers and divide by power of 10. 11*11/100 . ? Envoy? depuis mon mobile ? Eric ?? a ?crit?: >Hello the maillist member: >I am new in Erlang,Please Help me. > >When I try some multiplication, I got the some unexpected answer about the following expression. > >Please help! > >List: > >23> [1.1*1.1,1.1*1.2,1.1*1.3,1.1*1.4,1.1*1.5]. >[1.2100000000000002,1.32,1.4300000000000002,1.54, > 1.6500000000000001] > >24> [1.2*1.2,1.2*1.3,1.2*1.4,1.2*1.5,1.2*1.6]. >[1.44,1.56,1.68,1.7999999999999998,1.92] > >Thank you for your time. > >Eric D. Zhang In China. > > >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomasl_erlang@REDACTED Sun Oct 26 11:35:36 2014 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Sun, 26 Oct 2014 10:35:36 +0000 (UTC) Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? In-Reply-To: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> References: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> Message-ID: <1435866397.313266.1414319736121.JavaMail.yahoo@jws10785.mail.gq1.yahoo.com> Eric, it might be useful to read this:? CiteSeerX ? What Every Computer Scientist Should Know About Floating Point Arithmetic I know I liked it. Best,Thomas On Sunday, October 26, 2014 9:35 AM, ?? wrote: Hello the maillist member: I am? new in Erlang,Please Help me. When I try some multiplication, I got the some unexpected answer about the following expression. Please help! List: 23> [1.1*1.1,1.1*1.2,1.1*1.3,1.1*1.4,1.1*1.5]. [1.2100000000000002,1.32,1.4300000000000002,1.54, ?1.6500000000000001] 24> [1.2*1.2,1.2*1.3,1.2*1.4,1.2*1.5,1.2*1.6]. [1.44,1.56,1.68,1.7999999999999998,1.92] Thank you for your time. Eric D. Zhang In China. _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Sun Oct 26 13:33:54 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 26 Oct 2014 13:33:54 +0100 Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? In-Reply-To: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> References: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> Message-ID: On Sun, Oct 26, 2014 at 8:24 AM, ?? wrote: > When I try some multiplication, I got the some unexpected answer about > the following expression. > Hi! In addition to what everyone else has said, you may want to search the archives. There is a couple of posts by Richard O. Keefe which explains this in great detail. If my memory serves, he actually ends up arguing that every language which does not write 1.2100000000000002 is lying to you. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From valentin@REDACTED Sun Oct 26 13:50:40 2014 From: valentin@REDACTED (Valentin Micic) Date: Sun, 26 Oct 2014 14:50:40 +0200 Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? In-Reply-To: References: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> Message-ID: <26772502-851C-4D6E-92A4-2693721D1CBB@pixie.co.za> How did we manage to survive as spices for this long? V/ On 26 Oct 2014, at 2:33 PM, Jesper Louis Andersen wrote: > > On Sun, Oct 26, 2014 at 8:24 AM, ?? wrote: > When I try some multiplication, I got the some unexpected answer about the following expression. > > Hi! > > In addition to what everyone else has said, you may want to search the archives. There is a couple of posts by Richard O. Keefe which explains this in great detail. If my memory serves, he actually ends up arguing that every language which does not write 1.2100000000000002 is lying to you. > > > -- > J. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Sun Oct 26 13:53:01 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 26 Oct 2014 13:53:01 +0100 Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? In-Reply-To: <26772502-851C-4D6E-92A4-2693721D1CBB@pixie.co.za> References: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> <26772502-851C-4D6E-92A4-2693721D1CBB@pixie.co.za> Message-ID: On Sun, Oct 26, 2014 at 1:50 PM, Valentin Micic wrote: > How did we manage to survive as spices for this long? By evolution and the fact that the human body is one big distributed system with fault tolerance. Next question! -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anders.nygren@REDACTED Sun Oct 26 18:35:12 2014 From: anders.nygren@REDACTED (Anders Nygren) Date: Sun, 26 Oct 2014 11:35:12 -0600 Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? In-Reply-To: <26772502-851C-4D6E-92A4-2693721D1CBB@pixie.co.za> References: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> <26772502-851C-4D6E-92A4-2693721D1CBB@pixie.co.za> Message-ID: Because for most of history it has been enough to count one, two, many. On Sun, Oct 26, 2014 at 6:50 AM, Valentin Micic wrote: > How did we manage to survive as spices for this long? > > V/ > > On 26 Oct 2014, at 2:33 PM, Jesper Louis Andersen wrote: > > > On Sun, Oct 26, 2014 at 8:24 AM, ?? wrote: > >> When I try some multiplication, I got the some unexpected answer about >> the following expression. >> > > Hi! > > In addition to what everyone else has said, you may want to search the > archives. There is a couple of posts by Richard O. Keefe which explains > this in great detail. If my memory serves, he actually ends up arguing that > every language which does not write 1.2100000000000002 is lying to you. > > > -- > J. > _______________________________________________ > 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 bduggan@REDACTED Mon Oct 27 01:17:08 2014 From: bduggan@REDACTED (Bernard Duggan) Date: Mon, 27 Oct 2014 11:17:08 +1100 Subject: [erlang-questions] Mnesia transaction restarts In-Reply-To: References: <5449D0AE.5010507@shoretel.com> Message-ID: <544D8F04.6030703@shoretel.com> Thanks very much Dan. That was pretty much exactly my understanding, but it's very helpful have it confirmed. It really seems, in our case, like the starvation-avoidance system should have precluded such a high number of retries as we're seeing, particularly when the write is only on a single record. But since it *is* happening there must be some property of our system that I don't fully understand. Time to go digging again :) Cheers, Bernard On 24/10/14 17:16, Dan Gudmundsson wrote: Mnesia transactions are restarted when something hinders the completion of the transaction. Basically locks that are occupied or that another involved mnesia-node goes down during the transaction. So in your single node case it it caused by locks conflicts. To avoid deadlock and starvation mnesia locks are restarted if the transaction id is newer than the transaction holding the lock. Otherwise the transaction will be queued until that lock is released. /Dan On Fri, Oct 24, 2014 at 6:08 AM, Bernard Duggan > wrote: Hi List, Can anyone shed some light for me on the exact circumstances under which mnesia transactions will restart? I ask because on our system (which I'd describe as "moderately loaded", on the order of maybe a few million transactions a day) we had a couple of cases recently where a relatively simple read-then-write transaction hit 60 retries and 82 seconds. This is a single-node system using a disc_copies table with a couple of extra indices set on it, but nothing else very special. Of course, mnesia did no less than what the manual promised: the transaction eventually completed. However I'd like to understand better what might lead to so many retries (and, as a result of the increasing retry backoff, the very long delay). I've read every bit of "mneisa internals" documentation I can get my hands on, but I'm still a bit hazy. If I read that stuff correctly, it seems that unless there's a lot of transactions that started *before* the one in question, and ran for a very long time themselves, it should actually have been queued up to run next rather than retrying. It seems very likely that there are other cases that will cause a retry regardless of how "old" the transaction is with respect to any it might conflict with (the manual casually mentions that it may be restarted "thousands" of times), but it's those cases that I'm not clear on. Cheers, Bernard ________________________________ This e-mail and any attachments are confidential. If it is not intended for you, please notify the sender, and please erase and ignore the contents. _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions ________________________________ This e-mail and any attachments are confidential. If it is not intended for you, please notify the sender, and please erase and ignore the contents. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stuart.coyle@REDACTED Mon Oct 27 01:17:58 2014 From: stuart.coyle@REDACTED (Stuart Coyle) Date: Mon, 27 Oct 2014 11:17:58 +1100 Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? In-Reply-To: References: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> <26772502-851C-4D6E-92A4-2693721D1CBB@pixie.co.za> Message-ID: I would direct you to Knuth, "The Art of Computer Programming", Volume II. Floating point is harder to do in computers than you would intuitively expect it to be. There are a bunch of strange edge cases, even when you are not running on a Pentium . -------------- next part -------------- An HTML attachment was scrubbed... URL: From yueyoum@REDACTED Mon Oct 27 04:33:16 2014 From: yueyoum@REDACTED (=?UTF-8?B?5pyI5b+n6IyX?=) Date: Mon, 27 Oct 2014 11:33:16 +0800 Subject: [erlang-questions] Erlang, observer , processes view, How to hide system processes Message-ID: As the mail title, The pman can hide system processes but observer I can't how to do this -- My GitHub https://github.com/yueyoum -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Mon Oct 27 09:29:17 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 27 Oct 2014 10:29:17 +0200 Subject: [erlang-questions] Erlang garbage collection In-Reply-To: <544BEDCF.8050409@gmail.com> References: <544BEDCF.8050409@gmail.com> Message-ID: <0801CC76-53DA-49FC-B27E-386669AF44AB@gmail.com> Hello, One of the docker problem is that resources are constrained via cgroups. The ordinary system calls and utilities reports host memory. Thus, your dockerized Erlang nodes assumes 64Gb RAM availability and they will adjust gc accordingly. I do not see any better solution then set hard memory limit either to docker container or Erlang node. Unfortunately, none of these options are available for you. I am afraid that you need to tune Erlang memory allocators to achieve desired effect. Here is some references: https://erlangcentral.org/euc-2014-lukas-larsson-memory-allocators-in-the-vm-memory-management-battle-stories/#.VE39WYc3bQc http://erlang.org/doc/man/erts_alloc.html BTW, I am going to hit same issue during next week(s) due to my Erlang to Docker roll-out project. I?d be glad to collaborate on it to find best solution. Best Regards, Dmitry > On 25 Oct 2014, at 21:37, Viacheslav V. Kovalev wrote: > > Hi all! > I need your help in investigation of issue with erlang memory consumption. How typical, isn't it? > > We have two different deployment schemes. > * In first scheme we running many identical nodes on small virtual machines (in Amazon AWS), > one node per machine. Each machine has 4Gb of RAM. > * In another deployment scheme we running this nodes on big baremetal machines (with 64 Gb of ram), > with many nodes per machine. In this deployment nodes are isolated in docker containers > (with memory limit set to 4 Gb). > > I've noticed, that heap of processes in dockerized nodes are hogging up to 3 times much more RAM, than > heaps in non-dockerized nodes with identical load. I suspect that garbage collection in non-dockerized nodes is more aggressive. > Unfortunately, I don't have any garbage collection statistics, but I wanna obtain it ASAP. > > To give more information, I should say that we are using HiPE R17.1 on ubuntu 14.04 with stock kernel. In both schemes we are > running 8 schedulers per node, and using default `fullsweep_after` flag. > > My blind suggestion is that erlang default garbage collection relies (somehow) on /proc/meminfo (which is not actual in dockerized environment). > I am not C-guy and not familar with emulator internals, so could someone point me to places in erlang sources that are responsible for garbage collection > and some emulator options which I can use to tweak this behavior? > > Viacheslav V. Kovalev > Software engineer, Tradingview. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From lukas@REDACTED Mon Oct 27 09:46:45 2014 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 27 Oct 2014 09:46:45 +0100 Subject: [erlang-questions] Erlang garbage collection In-Reply-To: <544BEDCF.8050409@gmail.com> References: <544BEDCF.8050409@gmail.com> Message-ID: Hello, On Sat, Oct 25, 2014 at 8:37 PM, Viacheslav V. Kovalev wrote: > I've noticed, that heap of processes in dockerized nodes are hogging up to > 3 times much more RAM, than > heaps in non-dockerized nodes with identical load. I suspect that garbage > collection in non-dockerized nodes is more aggressive. > How did you measure that the heap of the processes was three times larger? erlang:memory(processes)? > Unfortunately, I don't have any garbage collection statistics, but I wanna > obtain it ASAP. > > To give more information, I should say that we are using HiPE R17.1 on > ubuntu 14.04 with stock kernel. In both schemes we are > running 8 schedulers per node, and using default `fullsweep_after` flag. > > My blind suggestion is that erlang default garbage collection relies > (somehow) on /proc/meminfo (which is not actual in dockerized environment). The garbage collector does very little to react to the environment it is in, so this setting should not influence how it works. > I am not C-guy and not familar with emulator internals, so could someone > point me to places in erlang sources that are responsible for garbage > collection > and some emulator options which I can use to tweak this behavior? The garbage collector is not very tweakable at all in Erlang. The only settings you can play with is min_heap_size and fullsweep_after. However, as Dmitry mentions, the erlang memory allocators do have a load of options that can be tweaked, and depending on what the root cause of the memory issue is, changing them could be effective. For more info about how the memory allocators work and what you can do to change their setting see the links Dmitry posted, and also I would recommend reading what Fred Hebert has written about them here https://blog.heroku.com/archives/2013/11/7/logplex-down-the-rabbit-hole and here http://ferd.github.io/recon/. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Mon Oct 27 10:02:11 2014 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 27 Oct 2014 10:02:11 +0100 Subject: [erlang-questions] Binary pattern matching on ETS In-Reply-To: References: Message-ID: Hello, On Thu, Oct 23, 2014 at 11:35 AM, Eduardo Gurgel wrote: > Is it possible to match the prefix of a binary using ETS match spec? > It is not possible. > And if it's not, is it a limitation or just a missing implementation? > At the moment it is both :) I've never tried to do something like that, but I would guess you work around this limitation by extracting what you have to match from the binary into a surrounding tuple before doing the insert. Right now there is afaik no plan to add the possibility to do this. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf@REDACTED Mon Oct 27 10:43:08 2014 From: ulf@REDACTED (Ulf Wiger) Date: Mon, 27 Oct 2014 10:43:08 +0100 Subject: [erlang-questions] Mnesia transaction restarts In-Reply-To: <544D8F04.6030703@shoretel.com> References: <5449D0AE.5010507@shoretel.com> <544D8F04.6030703@shoretel.com> Message-ID: On 27 Oct 2014, at 01:17, Bernard Duggan wrote: > But since it *is* happening there must be some property of our system that I don't fully understand. Time to go digging again :) If the writes are replicated, you might want to look for overload conditions on remote mnesia_tm processes (e.g. due to mnesia_overload (message_queue_len)). Dan will have to correct me if I?m wrong here... If a younger (WaitForTid < OurTid) transaction gets held up on commit, older transactions can get stuck in a restart condition. Since the mnesia_tm process relies on (unoptimizable) selective receive, it?s vulnerable to long message queues (which can happen especially if you have lots of replicated dirty writes). Note that when comparing tids from different nodes, the words ?younger? and ?older' doen?t necessarily correspond to a true global ordering. The comparison is essentially {Counter, Pid}, and the Counter is node-local, incremented for each transaction start/restart. The important thing for the deadlock prevention is that the comparison rules are globally consistent (that is, produce the same result regardless of *where* the comparison takes place). The mnesia_locker process has no blocking conditions that I know of. A lock request for a replicated read or write will loop through the ?where_to_read?/?where_to_write? list and ask each locker in turn. The list is sorted, but the local node (if present) is always first. Locks are released when instructed by the mnesia_tm process (on commit/abort). If you have side-effects inside transactions (message send/receive), basically all bets are off, and really weird things can happen, not least transaction processes waiting endlessly for messages that were already sent+received, but then discarded due to transaction restart. BR, Ulf W Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf@REDACTED Mon Oct 27 11:06:42 2014 From: ulf@REDACTED (Ulf Wiger) Date: Mon, 27 Oct 2014 11:06:42 +0100 Subject: [erlang-questions] Binary pattern matching on ETS In-Reply-To: References: Message-ID: FWIW, the kvdb database [1] allows for select operations on e.g. ets-based tables, including prefix match on binary keys. It does this through a little trickery. Since the match syntax doesn?t support prefix notation for binaries, and kvdb keys are always some form of binary encoding, specifying a list prefix, e.g. ?aa? ++ ?_? in the head pattern will indicate to kvdb that you want to match on prefix, and the match spec will be modified. More specifically, kvdb will derive a proper prefix and do a prefix_match using ?next? iteration, and then matching the objects using ets:match_spec_run/2. Example: Eshell V5.10.3 (abort with ^G) 1> kvdb:start(). starting kvdb KVDB Dbs = [] ok 2> kvdb:open(db,[{backend,ets}]). File = "db.db" {ok,<0.53.0>} 3> kvdb:add_table(db,t,[]). ok 4> kvdb:put(db,t,{<<"aaaaa">>,1}). ok 5> kvdb:put(db,t,{<<"aabbb">>,2}). ok 6> kvdb:put(db,t,{<<"aabcc">>,3}). ok 7> kvdb:select(db,t,[{{<<"aa">>,'_'},[],['$_']}]). {[],#Fun} 8> kvdb:select(db,t,[{{"aa" ++ '_','_'},[],['$_']}]). {[{<<"aaaaa">>,1},{<<"aabbb">>,2},{<<"aabcc">>,3}], #Fun} 9> kvdb:select(db,t,[{{"aab" ++ '_','_'},[],['$_']}]). {[{<<"aabbb">>,2},{<<"aabcc">>,3}], #Fun} This is obviously (significantly) slower than doing a normal ets:select() or mnesia:[dirty_]select(), but it?s mainly a question of constant-factor overheads. Kvdb clearly puts semantics before performance. ;-) BR, Ulf W [1] https://github.com/Feuerlabs/kvdb On 27 Oct 2014, at 10:02, Lukas Larsson wrote: > Hello, > > On Thu, Oct 23, 2014 at 11:35 AM, Eduardo Gurgel wrote: > Is it possible to match the prefix of a binary using ETS match spec? > > It is not possible. > > And if it's not, is it a limitation or just a missing implementation? > > At the moment it is both :) > > I've never tried to do something like that, but I would guess you work around this limitation by extracting what you have to match from the binary into a surrounding tuple before doing the insert. Right now there is afaik no plan to add the possibility to do this. > > Lukas > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Ola.Backstrom@REDACTED Mon Oct 27 12:45:25 2014 From: Ola.Backstrom@REDACTED (=?utf-8?B?T2xhIELDpGNrc3Ryw7Zt?=) Date: Mon, 27 Oct 2014 11:45:25 +0000 Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? In-Reply-To: References: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> Message-ID: <13ca19963da8451ea108512923c710cf@exsrvfe.ls.local> The argument ?arguing that every language which does not write 1.2100000000000002 is lying to you.? is only valid if you encode floating point numbers in binary. The rather cool 4-bit wide (!) microprocessor used in early HP calculators encoded both the mantissa and the exponent in 4-bit bcd. Thus it could exactly encode both 1.1 and 1.21, since it actually made the floating point calculations in decimal. No fancy algorithm for making the numbers ?look nice? was needed. My trusty old HP48 was both programmable and doing decimal as a human... so it didn?t have to lie. (of course this does not mean that bcd gives higher precision in general. In fact it the opposite). /Ola From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Jesper Louis Andersen Sent: den 26 oktober 2014 13:34 To: ?? Cc: Erlang (E-mail) Subject: Re: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? On Sun, Oct 26, 2014 at 8:24 AM, ?? > wrote: When I try some multiplication, I got the some unexpected answer about the following expression. Hi! In addition to what everyone else has said, you may want to search the archives. There is a couple of posts by Richard O. Keefe which explains this in great detail. If my memory serves, he actually ends up arguing that every language which does not write 1.2100000000000002 is lying to you. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rainer.hansen@REDACTED Mon Oct 27 13:04:30 2014 From: rainer.hansen@REDACTED (Rainer Hansen) Date: Mon, 27 Oct 2014 13:04:30 +0100 Subject: [erlang-questions] Erlang/OTP based systems and DDoS References: <87ppdhv07v.fsf@gmx.net> Message-ID: <87egtt7m7l.fsf@gmx.net> Max Lapshin writes: > Rainer, there is no simple thing like "DDoS" protection. > > You need to plan what ddos are you going to handle, because if you get > 5 gbit/s of SYN flood, it doesn't matter what language for your > website do you choose, it matter what ddos protection service do you > choose. > > For example, if you are under serious ddos attack, you have only one > choice: go to company that have control over it's AS connectivity and > at least 100-200 gbit/s of connectivity and ask them for a protection. > They will give you new IP address of a proxy. This proxy will filter > about 99,99% of traffic and leave only valuable requests. So again: it > doesn't matter what language do you choose. > > But of course there are serious design ideas that make erlang much > superior comparing to node.js or even Java. It is process+messaging > model. Max and the others thanks for your replis. As I have understood from the comments there are various levels of attacks. An attack flooding the network have to be handled different than the attack against a certain service. Do I understand right that it takes even with "external help" time to handle a DDoS attack. The attackers might try various methods and you have defend against them. To get the defense in place and to work properly takes time and as more scalable your infrastructure is as quicker you can get to normal service quality. Erlang systems can be designed to be quite scalable at a reasonable cost which should make it possible to go back to normal service quality faster than less scalable systems. I wonder if the process supervision might help to handle certain attacks better than systems build in JEE or node.js? Processes showing strange behaviour could be killed fast and hence less load should be on such systems. Erlang/OTP systems can be quite flexible changed during runtime. Isn't that another important point under such attacks when the traffic level is not completely flooding the node? Rainer From jesper.louis.andersen@REDACTED Mon Oct 27 13:27:59 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 27 Oct 2014 13:27:59 +0100 Subject: [erlang-questions] Erlang/OTP based systems and DDoS In-Reply-To: <87egtt7m7l.fsf@gmx.net> References: <87ppdhv07v.fsf@gmx.net> <87egtt7m7l.fsf@gmx.net> Message-ID: On Mon, Oct 27, 2014 at 1:04 PM, Rainer Hansen wrote: > Do I understand right that it takes even with "external help" time to > handle a DDoS attack. The attackers might try various methods and you > have defend against them. To get the defense in place and to work > properly takes time and as more scalable your infrastructure is as > quicker you can get to normal service quality. Erlang systems can be > designed to be quite scalable at a reasonable cost which should make it > possible to go back to normal service quality faster than less scalable > systems. > DDiS us bit a orecusion tool. The purpose of such an attack is to overwhelm the system such that the weakest link of the system breaks. Depending on setup, that weakest link will be different. It works by forcing systems to misallocate resources. Typical resources are bandwidth, number of socket connections, memory, disk and CPU time. The way you handle a DDoS attack is to thwart an attackers ability to control the resources of your system. You succeed in the defense when your system survives the attack and recovers gracefully after the attack. It is essentially guerilla warfare, where the economic cost of the attacker is much lower than the economic cost of the defender. The problem with sweeping generalizations are that an attacker will just shift their focus to another part of the system. That is, the attacker will detect that a pattern which crashes processes does not tie up resources, and then proceed to make an attack which does. Systems have an operating capacity and an engineering capacity. That is, a number of simultaneous work it can do when it is operating nominally, and a number of simultaneous work it can do at its peak stress. The key is to reject work when you hit the engineering peak of the system. This in turn, will protect yourself against the situation where an enemy seek to bind certain kind of resources: CPU, Memory and sockets. But it will not protect you against the situation where the attack goes for the bandwidth resource. hence, if you guard the system against this, then an attacker will overwhelm your bandwidth. This can be solved by talking to your ISP and have them filter out connections from the Attacker. To summarize: it has to be a joint effort on all of the system. Otherwise, the weakest link will break. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jon@REDACTED Mon Oct 27 13:58:26 2014 From: jon@REDACTED (Jon Schneider) Date: Mon, 27 Oct 2014 12:58:26 -0000 Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? In-Reply-To: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> References: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> Message-ID: <8d46c62c0f6f902e7b92146035cb776c.squirrel@mail.jschneider.net> Just to be clear. This is about floating point rounding and display. I can do the same with Python . Python 2.7.3 (default, Feb 27 2014, 19:58:35) >>> [1.1*1.1,1.1*1.2,1.1*1.3,1.1*1.4,1.1*1.5] [1.2100000000000002, 1.32, 1.4300000000000002, 1.54, 1.6500000000000001] >>> [1.2*1.2,1.2*1.3,1.2*1.4,1.2*1.5,1.2*1.6] [1.44, 1.56, 1.68, 1.7999999999999998, 1.92] Jon > Hello the maillist member: > I am new in Erlang,Please Help me. > > When I try some multiplication, I got the some unexpected answer about the > following expression. > > Please help! > > List: > > 23> [1.1*1.1,1.1*1.2,1.1*1.3,1.1*1.4,1.1*1.5]. > [1.2100000000000002,1.32,1.4300000000000002,1.54, > 1.6500000000000001] > > 24> [1.2*1.2,1.2*1.3,1.2*1.4,1.2*1.5,1.2*1.6]. > [1.44,1.56,1.68,1.7999999999999998,1.92] > > Thank you for your time. > > Eric D. Zhang In China. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From vasco@REDACTED Mon Oct 27 18:01:14 2014 From: vasco@REDACTED (Vassil Kolarov) Date: Mon, 27 Oct 2014 17:01:14 +0000 Subject: [erlang-questions] [ANN] Rivus CEP update Message-ID: Hi all, Here is an update to the Rivus CEP project I announced months ago: https://github.com/vascokk/rivus_cep Summary of the changes: - support for batch windows (in addition to the sliding windows) - fast aggregations for join-less, batch window queries - filters (similar to Esper ones) - DSL extended to support run-time event definition - ability to receive events via TCP stream - using event aliases is not mandatory anymore - added Basho Bench driver and config file for load-testing - Pattern-matching queries re-implemented using digraph based FSM In the roadmap: - named windows - events serialization/deserialization for use with other languages This is really just a toy-project at the moment and I am more focused on adding functionality, rather than performance optimisations. Anyway, someone could find it useful. Best regards, Vasco -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Mon Oct 27 22:34:27 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 27 Oct 2014 22:34:27 +0100 Subject: [erlang-questions] crypto ECDSA private key -> public In-Reply-To: References: Message-ID: Hi! There is also a function crypto:generate_key/3 that takes a private key as third argument, maybe that is what you want? Regards Ingela Erlang/OTP team - Ericsson AB 2014-10-21 17:00 GMT+02:00 semmit mondo : > Hi, > > How can I generate an ECDSA public key from the private one using crypto? > All I can do with it is to generate a public and private key pair at once: > > {Pub, Priv} = crypto:generate_key(ecdh, prime239v3). > > but can't calculate the public key if the private key was known beforehand. > > (prime239v3 isn't important, it could be any EC curve...) > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanfiedler@REDACTED Mon Oct 27 18:45:10 2014 From: nathanfiedler@REDACTED (Nathan Fiedler) Date: Mon, 27 Oct 2014 10:45:10 -0700 Subject: [erlang-questions] Examples of Common Test in apps built with rebar/relx? Message-ID: I'm a beginner, so bear in mind I may be doing all of this incorrectly. I started with Fred Hebert's How I Start tutorial [1] and went from there. I have a very simple application that is built and assembled using a combination of rebar and relx; that much works. I have a single eunit test that exercises the one operation I have implemented to date. So far, so good. I would like to instead use Common Test, but I've run into a problem: noproc error. Apparently something is not getting started when I run ct but is fine with eunit and when I run the application manually. Looking around for examples, I found ejabberd, but I'm not certain I understand how it's wired together, much less tested. My question to the group is, do you have any favorite (open source) examples of applications that use Common Test and are assembled with rebar and relx? I am being specific because it seems to me that the tools have a big impact on how the code is setup and started. Thanks n [1] http://howistart.org/posts/erlang/1 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Mon Oct 27 23:03:44 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 28 Oct 2014 11:03:44 +1300 Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? In-Reply-To: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> References: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> Message-ID: On 26/10/2014, at 8:24 PM, ?? wrote: > When I try some multiplication, I got the some unexpected answer about the following expression. But WHY did you not expect what you got? If you do not understand floating point arithmetic, what is your excuse for using it? > 23> [1.1*1.1,1.1*1.2,1.1*1.3,1.1*1.4,1.1*1.5]. > [1.2100000000000002,1.32,1.4300000000000002,1.54, > 1.6500000000000001] Using Gambit Scheme: > (list (* 1.1 1.1) (* 1.1 1.2) (* 1.1 1.3) (* 1.1 1.4) (* 1.1 1.5)) (1.2100000000000002 1.32 1.4300000000000002 1.54 1.6500000000000001) We see that Erlang is giving *EXACTLY* the answers that it ought to. > 24> [1.2*1.2,1.2*1.3,1.2*1.4,1.2*1.5,1.2*1.6]. > [1.44,1.56,1.68,1.7999999999999998,1.92] > (list (* 1.2 1.2) (* 1.2 1.3) (* 1.2 1.4) (* 1.2 1.5) (* 1.2 1.6)) (1.44 1.56 1.68 1.7999999999999998 1.92) Again, Erlang is giving EXACTLY the BEST POSSIBLE ANSWERS. Read "What every Computer Scientist should know about Floating-Point arithmetic". Here's a link to a copy: https://www.stat.auckland.ac.nz/~stat782/downloads/floating-point-arithmetic.pdf To cut a long story short, computers use BINARY (base 2) floating point arithmetic, which means that numbers like 1.1 CANNOT be represented exactly. When you compute "1.1*1.1" you are *REALLY* computing round(round(1.1) * round(1.1)). To make the story somewhat longer, there _have_ been computers with decimal floating point arithmetic, there is a recent standard for decimal floating point arithmetic complete with a C interface to it, and IBM make machines that support it -- in addition to IEEE binary arithmetic. This will completely solve your problem with 1.1 and 1.2, but it will leave people confused about 1.0/3.0. From a.shneyderman@REDACTED Mon Oct 27 23:10:23 2014 From: a.shneyderman@REDACTED (Alex Shneyderman) Date: Mon, 27 Oct 2014 18:10:23 -0400 Subject: [erlang-questions] Examples of Common Test in apps built with rebar/relx? In-Reply-To: References: Message-ID: https://github.com/ninenines/cowboy/blob/master/test/http_SUITE.erl On Mon, Oct 27, 2014 at 1:45 PM, Nathan Fiedler wrote: > I'm a beginner, so bear in mind I may be doing all of this incorrectly. I > started with Fred Hebert's How I Start tutorial [1] and went from there. I > have a very simple application that is built and assembled using a > combination of rebar and relx; that much works. I have a single eunit test > that exercises the one operation I have implemented to date. So far, so > good. I would like to instead use Common Test, but I've run into a problem: > noproc error. Apparently something is not getting started when I run ct but > is fine with eunit and when I run the application manually. > > Looking around for examples, I found ejabberd, but I'm not certain I > understand how it's wired together, much less tested. > > My question to the group is, do you have any favorite (open source) > examples of applications that use Common Test and are assembled with rebar > and relx? I am being specific because it seems to me that the tools have a > big impact on how the code is setup and started. > > Thanks > > n > > [1] http://howistart.org/posts/erlang/1 > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Mon Oct 27 23:23:44 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 28 Oct 2014 11:23:44 +1300 Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? In-Reply-To: <544CB8AF.1050405@ninenines.eu> References: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> <544CB8AF.1050405@ninenines.eu> Message-ID: On 26/10/2014, at 10:02 PM, Lo?c Hoguin wrote: > Floats are an inaccurate number format. That is a very confusing way to put it. Floating point NUMBERS are exact. Floating point OPERATIONS round. This includes the operation "convert from decimal to binary". > See http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems A number is *precise* if it is given to many digits. A number is *accurate* if it is correct to many of those digits. 3.151592653589 is a precise but inaccurate approximation to pi. 3.14 is an imprecise but more accurate one. IEEE floating point arithmetic is, if used with care, more accurate than we can physically measure for most problems. > Decimal32/decimal64 are the accurate equivalent, though quite new and as of now rarely found natively in programming languages. Decimal floating point arithmetic is no more accurate than binary floating point arithmetic. Decimal floating point arithmetic can accurately represent a wider range of numbers stated in decimal, but it is still incapable of representing 1/n where n is not a factor of a power of 10. Furthermore, if you take X = 1.0, Y = X + 1.0e-15, Z = Y*Y then even in decimal64 arithmetic, Z will only approximate the mathematically exact answer. Decimal floats were available early. The IBM 650 had decimal floats with 8 digits of significand and 2 digits of exponent. The Burroughs Medium Systems machines had decimal floats with up to 99 digits of significand. Decimal floats were not abandoned simply for speed; they had some numerical problems binary floats are free of. The new standard partly mitigates those, but only partly. There is a standard way to access decimal floating point arithmetic in C. I have no experience with it, because gcc doesn't support it unless you have hardware for it. From semmitmondo@REDACTED Mon Oct 27 23:24:00 2014 From: semmitmondo@REDACTED (semmit mondo) Date: Mon, 27 Oct 2014 23:24:00 +0100 (CET) Subject: [erlang-questions] crypto ECDSA private key -> public In-Reply-To: Message-ID: Yes and no. According to the source of the crypto module generate_key/3does accept a private key only for a few encryption method types.This is the only function head that matches ecdh: generate_key(ecdh, Curve, undefined) -> ... There's no definition for ecdh with a 3rd param that is notundefined. ...and generate_key/2 calls the above one: generate_key(Type, Params) -> generate_key(Type, Params, undefined). It would be the function I'm after... Ingela Andin ?rta: >Hi! There is also a function crypto:generate_key/3 that takes a private key as third argument, maybe that is what you want? Regards Ingela Erlang/OTP team - Ericsson AB 2014-10-21 17:00 GMT+02:00 semmit mondo : >>Hi, How can I generate an ECDSA public key from the private one using crypto?All I can do with it is to generate a public and private key pair at once: {Pub, Priv} = crypto:generate_key(ecdh, prime239v3). but can't calculate the public key if the private key was known beforehand. (prime239v3 isn't important, it could be any EC curve...) >>_______________________________________________ >>erlang-questions mailing list >>erlang-questions@REDACTED >>http://erlang.org/mailman/listinfo/erlang-questions >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Mon Oct 27 23:37:04 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 27 Oct 2014 23:37:04 +0100 Subject: [erlang-questions] Examples of Common Test in apps built with rebar/relx? In-Reply-To: References: Message-ID: <544EC910.7010909@ninenines.eu> I wouldn't show Cowboy's test suites to a beginner. There's a lot of things that are unusual there from the cowboy_test module to a ct hook and error_logger handler. It also does not use rebar, but erlang.mk instead. Rebar making common_test runs very slow was the very first thing that made me move toward using Make and ultimately writing erlang.mk. It also does not use relx, although that's a smaller concern because Cowboy is just an Erlang application and not a whole system. I am not aware of people who run relx releases from inside common_test, although that's something I wish I could do sometimes. On 10/27/2014 11:10 PM, Alex Shneyderman wrote: > https://github.com/ninenines/cowboy/blob/master/test/http_SUITE.erl > > On Mon, Oct 27, 2014 at 1:45 PM, Nathan Fiedler > wrote: > > I'm a beginner, so bear in mind I may be doing all of this > incorrectly. I started with Fred Hebert's How I Start tutorial [1] > and went from there. I have a very simple application that is built > and assembled using a combination of rebar and relx; that much > works. I have a single eunit test that exercises the one operation I > have implemented to date. So far, so good. I would like to instead > use Common Test, but I've run into a problem: noproc error. > Apparently something is not getting started when I run ct but is > fine with eunit and when I run the application manually. > > Looking around for examples, I found ejabberd, but I'm not certain I > understand how it's wired together, much less tested. > > My question to the group is, do you have any favorite (open source) > examples of applications that use Common Test and are assembled with > rebar and relx? I am being specific because it seems to me that the > tools have a big impact on how the code is setup and started. > > Thanks > > n > > [1] http://howistart.org/posts/erlang/1 > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From demeshchuk@REDACTED Mon Oct 27 23:41:57 2014 From: demeshchuk@REDACTED (Dmitry Demeshchuk) Date: Mon, 27 Oct 2014 15:41:57 -0700 Subject: [erlang-questions] Examples of Common Test in apps built with rebar/relx? In-Reply-To: References: Message-ID: Don't use ejabberd as an example, it's way too weird and full of legacy decisions. As for common_test examples, OTP has some, for example: https://github.com/erlang/otp/blob/maint/lib/stdlib/test/gen_server_SUITE.erl They are usually pretty straightforward. On Mon, Oct 27, 2014 at 10:45 AM, Nathan Fiedler wrote: > I'm a beginner, so bear in mind I may be doing all of this incorrectly. I > started with Fred Hebert's How I Start tutorial [1] and went from there. I > have a very simple application that is built and assembled using a > combination of rebar and relx; that much works. I have a single eunit test > that exercises the one operation I have implemented to date. So far, so > good. I would like to instead use Common Test, but I've run into a problem: > noproc error. Apparently something is not getting started when I run ct but > is fine with eunit and when I run the application manually. > > Looking around for examples, I found ejabberd, but I'm not certain I > understand how it's wired together, much less tested. > > My question to the group is, do you have any favorite (open source) > examples of applications that use Common Test and are assembled with rebar > and relx? I am being specific because it seems to me that the tools have a > big impact on how the code is setup and started. > > Thanks > > n > > [1] http://howistart.org/posts/erlang/1 > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Best regards, Dmitry Demeshchuk -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Tue Oct 28 00:29:37 2014 From: mjtruog@REDACTED (Michael Truog) Date: Mon, 27 Oct 2014 16:29:37 -0700 Subject: [erlang-questions] Examples of Common Test in apps built with rebar/relx? In-Reply-To: <544EC910.7010909@ninenines.eu> References: <544EC910.7010909@ninenines.eu> Message-ID: <544ED561.4070307@gmail.com> I like using reltool_util (https://github.com/okeuday/reltool_util/) to start applications within CT tests, since it can handle many edge-cases. If you wanted to start a release inside a CT test you could do it with reltool_util:boot_start/1 or reltool_util:script_start/1. Normally, I use reltool_util:application_start/3 for CT test suites which has the added benefit of accepting application env settings for separate test cases. A minimal example is here https://github.com/CloudI/cloudi_service_queue/blob/master/test/cloudi_write_ahead_logging_SUITE.erl . On 10/27/2014 03:37 PM, Lo?c Hoguin wrote: > I wouldn't show Cowboy's test suites to a beginner. There's a lot of things that are unusual there from the cowboy_test module to a ct hook and error_logger handler. > > It also does not use rebar, but erlang.mk instead. Rebar making common_test runs very slow was the very first thing that made me move toward using Make and ultimately writing erlang.mk. > > It also does not use relx, although that's a smaller concern because Cowboy is just an Erlang application and not a whole system. I am not aware of people who run relx releases from inside common_test, although that's something I wish I could do sometimes. > > On 10/27/2014 11:10 PM, Alex Shneyderman wrote: >> https://github.com/ninenines/cowboy/blob/master/test/http_SUITE.erl >> >> On Mon, Oct 27, 2014 at 1:45 PM, Nathan Fiedler > > wrote: >> >> I'm a beginner, so bear in mind I may be doing all of this >> incorrectly. I started with Fred Hebert's How I Start tutorial [1] >> and went from there. I have a very simple application that is built >> and assembled using a combination of rebar and relx; that much >> works. I have a single eunit test that exercises the one operation I >> have implemented to date. So far, so good. I would like to instead >> use Common Test, but I've run into a problem: noproc error. >> Apparently something is not getting started when I run ct but is >> fine with eunit and when I run the application manually. >> >> Looking around for examples, I found ejabberd, but I'm not certain I >> understand how it's wired together, much less tested. >> >> My question to the group is, do you have any favorite (open source) >> examples of applications that use Common Test and are assembled with >> rebar and relx? I am being specific because it seems to me that the >> tools have a big impact on how the code is setup and started. >> >> Thanks >> >> n >> >> [1] http://howistart.org/posts/erlang/1 >> >> >> _______________________________________________ >> 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 demeshchuk@REDACTED Tue Oct 28 00:44:08 2014 From: demeshchuk@REDACTED (Dmitry Demeshchuk) Date: Mon, 27 Oct 2014 16:44:08 -0700 Subject: [erlang-questions] Examples of Common Test in apps built with rebar/relx? In-Reply-To: References: Message-ID: Oh, sorry, you were talking about using rebar and relx in particular. Sorry, nevermind my comment, I'm dumb. OTP obviously doesn't use any of those. On Mon, Oct 27, 2014 at 3:41 PM, Dmitry Demeshchuk wrote: > Don't use ejabberd as an example, it's way too weird and full of legacy > decisions. > > As for common_test examples, OTP has some, for example: > https://github.com/erlang/otp/blob/maint/lib/stdlib/test/gen_server_SUITE.erl > > They are usually pretty straightforward. > > On Mon, Oct 27, 2014 at 10:45 AM, Nathan Fiedler > wrote: > >> I'm a beginner, so bear in mind I may be doing all of this incorrectly. I >> started with Fred Hebert's How I Start tutorial [1] and went from there. I >> have a very simple application that is built and assembled using a >> combination of rebar and relx; that much works. I have a single eunit test >> that exercises the one operation I have implemented to date. So far, so >> good. I would like to instead use Common Test, but I've run into a problem: >> noproc error. Apparently something is not getting started when I run ct but >> is fine with eunit and when I run the application manually. >> >> Looking around for examples, I found ejabberd, but I'm not certain I >> understand how it's wired together, much less tested. >> >> My question to the group is, do you have any favorite (open source) >> examples of applications that use Common Test and are assembled with rebar >> and relx? I am being specific because it seems to me that the tools have a >> big impact on how the code is setup and started. >> >> Thanks >> >> n >> >> [1] http://howistart.org/posts/erlang/1 >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > > -- > Best regards, > Dmitry Demeshchuk > -- Best regards, Dmitry Demeshchuk -------------- next part -------------- An HTML attachment was scrubbed... URL: From edgurgel@REDACTED Tue Oct 28 02:20:08 2014 From: edgurgel@REDACTED (Eduardo Gurgel) Date: Tue, 28 Oct 2014 14:20:08 +1300 Subject: [erlang-questions] Binary pattern matching on ETS In-Reply-To: References: Message-ID: Thank you, Lukas and Ulf. I'll check out both proposed solutions. I needed this prefix matching on gproc, so I don't think kvdb will be a possible solution for me in this case .I will probably need to see if I can use a simple string instead of a binary to tag my processes. Regards, -- Eduardo On 27 October 2014 23:06, Ulf Wiger wrote: > > FWIW, the kvdb database [1] allows for select operations on e.g. ets-based > tables, including prefix match on binary keys. > > It does this through a little trickery. Since the match syntax doesn?t > support prefix notation for binaries, and kvdb keys are always some form of > binary encoding, specifying a list prefix, e.g. ?aa? ++ ?_? in the head > pattern will indicate to kvdb that you want to match on prefix, and the > match spec will be modified. More specifically, kvdb will derive a proper > prefix and do a prefix_match using ?next? iteration, and then matching the > objects using ets:match_spec_run/2. > > Example: > > Eshell V5.10.3 (abort with ^G) > 1> kvdb:start(). > starting kvdb > KVDB Dbs = [] > ok > 2> kvdb:open(db,[{backend,ets}]). > File = "db.db" > {ok,<0.53.0>} > 3> kvdb:add_table(db,t,[]). > ok > 4> kvdb:put(db,t,{<<"aaaaa">>,1}). > ok > 5> kvdb:put(db,t,{<<"aabbb">>,2}). > ok > 6> kvdb:put(db,t,{<<"aabcc">>,3}). > ok > 7> kvdb:select(db,t,[{{<<"aa">>,'_'},[],['$_']}]). > {[],#Fun} > 8> kvdb:select(db,t,[{{"aa" ++ '_','_'},[],['$_']}]). > {[{<<"aaaaa">>,1},{<<"aabbb">>,2},{<<"aabcc">>,3}], > #Fun} > 9> kvdb:select(db,t,[{{"aab" ++ '_','_'},[],['$_']}]). > {[{<<"aabbb">>,2},{<<"aabcc">>,3}], > #Fun} > > This is obviously (significantly) slower than doing a normal ets:select() > or mnesia:[dirty_]select(), but it?s mainly a question of constant-factor > overheads. Kvdb clearly puts semantics before performance. ;-) > > BR, > Ulf W > > [1] https://github.com/Feuerlabs/kvdb > > On 27 Oct 2014, at 10:02, Lukas Larsson wrote: > > Hello, > > On Thu, Oct 23, 2014 at 11:35 AM, Eduardo Gurgel > wrote: > >> Is it possible to match the prefix of a binary using ETS match spec? >> > > It is not possible. > > >> And if it's not, is it a limitation or just a missing implementation? >> > > At the moment it is both :) > > I've never tried to do something like that, but I would guess you work > around this limitation by extracting what you have to match from the binary > into a surrounding tuple before doing the insert. Right now there is afaik > no plan to add the possibility to do this. > > Lukas > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. > http://feuerlabs.com > > > > -- Eduardo -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Tue Oct 28 05:18:01 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 28 Oct 2014 05:18:01 +0100 Subject: [erlang-questions] Examples of Common Test in apps built with rebar/relx? In-Reply-To: <544EC910.7010909@ninenines.eu> References: <544EC910.7010909@ninenines.eu> Message-ID: <544F18F9.7030300@ninenines.eu> On 10/27/2014 11:37 PM, Lo?c Hoguin wrote: > It also does not use relx, although that's a smaller concern because > Cowboy is just an Erlang application and not a whole system. I am not > aware of people who run relx releases from inside common_test, although > that's something I wish I could do sometimes. To clarify on this I mean building relx releases dynamically and then managing them, not just release handling. -- Lo?c Hoguin http://ninenines.eu From bduggan@REDACTED Tue Oct 28 05:57:53 2014 From: bduggan@REDACTED (Bernard Duggan) Date: Tue, 28 Oct 2014 15:57:53 +1100 Subject: [erlang-questions] Mnesia transaction restarts In-Reply-To: References: <5449D0AE.5010507@shoretel.com> <544D8F04.6030703@shoretel.com> Message-ID: <544F2251.2030205@shoretel.com> On 27/10/14 20:43, Ulf Wiger wrote: On 27 Oct 2014, at 01:17, Bernard Duggan > wrote: But since it *is* happening there must be some property of our system that I don't fully understand. Time to go digging again :) If the writes are replicated, you might want to look for overload conditions on remote mnesia_tm processes (e.g. due to mnesia_overload (message_queue_len)). Thanks Ulf. Inconveniently, this is only a single-node system, so there's no opportunity for distribution systems to get in the way :) Dan will have to correct me if I?m wrong here... If a younger (WaitForTid < OurTid) transaction gets held up on commit, older transactions can get stuck in a restart condition. Since the mnesia_tm process relies on (unoptimizable) selective receive, it?s vulnerable to long message queues (which can happen especially if you have lots of replicated dirty writes). I have noticed (and been tripped up by) that selective receive in the past. I even took a look at one stage at whether it could be new-reference optimised, but quickly gave up. In at least one sense I'm glad to hear you say that it is, in fact, unoptimisable because it means I was right to not spend too much time on it :) [snip] If you have side-effects inside transactions (message send/receive), basically all bets are off, and really weird things can happen, not least transaction processes waiting endlessly for messages that were already sent+received, but then discarded due to transaction restart. Thanks - it's something we've definitely tried to keep in mind, making sure we avoid debug logging etc inside the transactions. I will, however, go back and re-check a few critical places to make sure we're not doing something silly. Cheers, Bernard ________________________________ This e-mail and any attachments are confidential. If it is not intended for you, please notify the sender, and please erase and ignore the contents. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Tue Oct 28 07:37:46 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Tue, 28 Oct 2014 08:37:46 +0200 Subject: [erlang-questions] Binary pattern matching on ETS In-Reply-To: References: Message-ID: Hello, > I needed this prefix matching on gproc You should mentioned that earlier. Use tuples as keys as Lukas said. - Dmitry > On 28 Oct 2014, at 03:20, Eduardo Gurgel wrote: > > Thank you, Lukas and Ulf. I'll check out both proposed solutions. > > I needed this prefix matching on gproc, so I don't think kvdb will be a possible solution for me in this case .I will probably need to see if I can use a simple string instead of a binary to tag my processes. > > Regards, > > -- > > Eduardo > > On 27 October 2014 23:06, Ulf Wiger > wrote: > > FWIW, the kvdb database [1] allows for select operations on e.g. ets-based tables, including prefix match on binary keys. > > It does this through a little trickery. Since the match syntax doesn?t support prefix notation for binaries, and kvdb keys are always some form of binary encoding, specifying a list prefix, e.g. ?aa? ++ ?_? in the head pattern will indicate to kvdb that you want to match on prefix, and the match spec will be modified. More specifically, kvdb will derive a proper prefix and do a prefix_match using ?next? iteration, and then matching the objects using ets:match_spec_run/2. > > Example: > > Eshell V5.10.3 (abort with ^G) > 1> kvdb:start(). > starting kvdb > KVDB Dbs = [] > ok > 2> kvdb:open(db,[{backend,ets}]). > File = "db.db" > {ok,<0.53.0>} > 3> kvdb:add_table(db,t,[]). > ok > 4> kvdb:put(db,t,{<<"aaaaa">>,1}). > ok > 5> kvdb:put(db,t,{<<"aabbb">>,2}). > ok > 6> kvdb:put(db,t,{<<"aabcc">>,3}). > ok > 7> kvdb:select(db,t,[{{<<"aa">>,'_'},[],['$_']}]). > {[],#Fun} > 8> kvdb:select(db,t,[{{"aa" ++ '_','_'},[],['$_']}]). > {[{<<"aaaaa">>,1},{<<"aabbb">>,2},{<<"aabcc">>,3}], > #Fun} > 9> kvdb:select(db,t,[{{"aab" ++ '_','_'},[],['$_']}]). > {[{<<"aabbb">>,2},{<<"aabcc">>,3}], > #Fun} > > This is obviously (significantly) slower than doing a normal ets:select() or mnesia:[dirty_]select(), but it?s mainly a question of constant-factor overheads. Kvdb clearly puts semantics before performance. ;-) > > BR, > Ulf W > > [1] https://github.com/Feuerlabs/kvdb > On 27 Oct 2014, at 10:02, Lukas Larsson > wrote: > >> Hello, >> >> On Thu, Oct 23, 2014 at 11:35 AM, Eduardo Gurgel >wrote: >> Is it possible to match the prefix of a binary using ETS match spec? >> >> It is not possible. >> >> And if it's not, is it a limitation or just a missing implementation? >> >> At the moment it is both :) >> >> I've never tried to do something like that, but I would guess you work around this limitation by extracting what you have to match from the binary into a surrounding tuple before doing the insert. Right now there is afaik no plan to add the possibility to do this. >> >> Lukas >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. > http://feuerlabs.com > > > > > > > -- > Eduardo > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From caisonglu@REDACTED Tue Oct 28 08:13:57 2014 From: caisonglu@REDACTED (songlu cai) Date: Tue, 28 Oct 2014 15:13:57 +0800 Subject: [erlang-questions] Unbalanced Scheduler Problem caused by Using out of date active_no_runq Message-ID: Hi, We find an Erlang unbalanced scheduler problem on our proxy servers(for processing and forwarding requests from clients). *Env:* Erlang Version: R16B03/SMP 24 schedulers online/-swt low Mem: 64G, 1.6G occupied by beam.smp CPU: 24 Xeon cores *Issue Description:* On clients, we establish some tcp keep-alive connections to proxy servers; time to time, we make some tcp short (non keep-alive) connections to proxy servers. Then clients send requests to proxy servers, proxy processes & forwards requests to backend servers. During the test, we find 11 schedulers? usage is 100% while other 13 schedulers? usage is 0(idle), and busy ones are with long runq (rq->len around 100). Sometimes maybe 21 busy, 3 idle. Such state lasts for from 30 minutes to 6 hours in an uncertain way. Sometimes it disappears, after an hour or a day, occasionly, it comes back again. *Debug:* So I write a gdb script to catch the runq flags and other struct members, I want to know what happens when the problem comes up. Collect.sh is used to catch the runq state every 2 seconds, wakeix.sh is used to catch which runq(ix) is waked up when schedulers in the unbalanced state. //////////////////////////////////////////This is a separator///////////////////////////////////////// #cat collect.sh #!/bin/sh while [ 1 ]; do date #cat wakeix.sh #!/bin/sh //////////////////////////////////////////This is a separator///////////////////////////////////////// gdb -p 9075 <ix; int stop_ix = ix; int active_ix, balance_ix; get_no_runqs(&active_ix, &balance_ix); if (active_ix > balance_ix) active_ix = balance_ix; if (ix >= active_ix) stop_ix = ix = active_ix; /* Try to wake a scheduler on an active run queue */ while (1) { A:ix--; if (ix < 0) { if (active_ix == stop_ix) B: break; C: ix = active_ix - 1; } if (ix == stop_ix) D: break; E: if (chk_wake_sched(crq, ix, 0)) F: return; } if (active_ix < balance_ix) { /* Try to activate a new run queue and wake its scheduler */ G: (void) chk_wake_sched(crq, active_ix, 1); } } static ERTS_INLINE int chk_wake_sched(ErtsRunQueue *crq, int ix, int activate) { Uint32 flags; ErtsRunQueue *wrq; if (crq->ix == ix) return 0; wrq = ERTS_RUNQ_IX(ix); flags = ERTS_RUNQ_FLGS_GET(wrq); H: if (!(flags & (ERTS_RUNQ_FLG_SUSPENDED|ERTS_RUNQ_FLG_NONEMPTY))) { if (activate) { if (try_inc_no_active_runqs(ix+1)) (void) ERTS_RUNQ_FLGS_UNSET(wrq, ERTS_RUNQ_FLG_INACTIVE); } I: wake_scheduler(wrq, 0); return 1; } J: return 0; } //////////////////////////////////////////This is a separator///////////////////////////////////////// *Root cause:* A possible execution path: Step 1,scheduler with runq ix=10 calls wakeup_other_check, then fall through to wake_scheduler_on_empty_runq, active_ix=21 stop_ix=10 Step 2,A->E->H->J loops 10 times Step 3,A(ix=-1)->C(ix=20)->E->H->J Step 4,A->E->H->J loops 9 times Step 5,A(ix=10)->D->G(active_ix=21)->H(ix=21)->J The problem happens in step 5 H->J, the runq ix=21 (22th) is with flag NONEMPTY|INACTIVE, so it skips ?H:if (!(flags & (ERTS_RUNQ_FLG_SUSPENDED|ERTS_RUNQ_FLG_NONEMPTY)))?, and jumps to ?J: return 0;?. As a result, the 22th(ix=21) runq will never be waked up, unless, another check_balance is called and clear the NONEMPTY flag. But not every check_balance call wants to clear the NONEMPTY flag, it depends on the history & current workset , in a word, it is hard to know when we can get rid of such unbalanced state. In out stress test, the unbalanced state lasts from 30 minutes to several hours, it is relative with the test case. The NONEMPTY|INACTIVE combination is also dangerous, during test it happened runq(ix=10, 11th) with such flag, only 11/24 of CPU can be used, others were idle, the clients were jammed with long latency. *Where does NONEMPTY|INACTIVE flag come from?* Two functions are involved: static ERTS_INLINE void get_no_runqs(int *active, int *used) static ERTS_INLINE void set_no_active_runqs(int active) A possible path: Time T1: Thread A does wakeup_check, then call get_no_runqs, gets active_ix=24 (24 runqs are all active), and decides to wake up runq ix=20 (21th, named as Thread W) Time T2: Thread B does schedule, then call check_balance, set active runq no to 21, set_no_active_runqs(21) the runq ix=21 (22th) is with flag INACTIVE Time T3: Thread A does wake_scheduler, Thread W is waked up from kernel futex-wait (scheduler_wait), then Thread W call non_empty_runq(runq ix=21), flag is set to INACTIVE|NONEMPTY Time T4: Thread W cant steal process from another runq due to INACTIVE flag, so it sleeps on futex again, with flag = INACTIVE|NONEMPTY At last, the runq ix=21 is with flag INACTIVE|NONEMPTY and never be waked up until another lucky check_balance call to help it get rid of such situation. The essence of the problem is we are using a value(active_ix) that out of date(updated by others). *How to fix:* 1, Using mutex when involved with balance_info.no_runqs, but the critical region will be very long, and there are too many codes to be modified, and may degrade the performance. 2, Judge the INACTIVE|NONEMPTY flag in function chk_wake_sched, it means that sometimes we are waking up(activating) a NONEMPTY runq. 3, Or Another Way? Best Regards, Zijia -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz@REDACTED Tue Oct 28 10:48:53 2014 From: aschultz@REDACTED (Andreas Schultz) Date: Tue, 28 Oct 2014 09:48:53 +0000 (UTC) Subject: [erlang-questions] crypto ECDSA private key -> public In-Reply-To: <931249906.241396.1414489713360.JavaMail.zimbra@tpip.net> References: Message-ID: <1922578025.241397.1414489733134.JavaMail.zimbra@tpip.net> Hi, ----- On 27 Oct, 2014, at 23:24, semmit mondo semmitmondo@REDACTED wrote: > Yes and no. > According to the source of the crypto module generate_key/3 > does accept a private key only for a few encryption method types. > This is the only function head that matches ecdh: > generate_key(ecdh, Curve, undefined) -> ... > There's no definition for ecdh with a 3rd param that is not > undefined. ...and generate_key/2 calls the above one: > generate_key(Type, Params) -> > generate_key(Type, Params, undefined). > It would be the function I'm after... The function you are looking for is ec_key_new in lib/crypto/c_src/crypto.c. That function is not exported to the Erlang world (originally it was in some faschion, but the crypto API restructuring un-exported it). Andreas > > Ingela Andin ?rta: > > > Hi! > There is also a function crypto:generate_key/3 that takes a private key as third > argument, maybe that is what you want? > Regards Ingela Erlang/OTP team - Ericsson AB > 2014-10-21 17:00 GMT+02:00 semmit mondo < semmitmondo@REDACTED > : > > > Hi, > How can I generate an ECDSA public key from the private one using crypto? > All I can do with it is to generate a public and private key pair at once: > {Pub, Priv} = crypto:generate_key(ecdh, prime239v3). > but can't calculate the public key if the private key was known beforehand. > (prime239v3 isn't important, it could be any EC curve...) > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- -- Dipl. Inform. Andreas Schultz email: as@REDACTED phone: +49-391-819099-224 mobil: +49-170-2226073 ------------------- enabling your networks ------------------- Travelping GmbH phone: +49-391-819099229 Roentgenstr. 13 fax: +49-391-819099299 D-39108 Magdeburg email: info@REDACTED GERMANY web: http://www.travelping.com Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 -------------------------------------------------------------- From bog495@REDACTED Tue Oct 28 10:50:31 2014 From: bog495@REDACTED (Bogdan Andu) Date: Tue, 28 Oct 2014 11:50:31 +0200 Subject: [erlang-questions] ssl impas Message-ID: Hi folks, sorry for my problem but I am stuck after turning it on every facet. I have an application server that processes xml structures with the following listen parameters: {ok, ListenSock} = ssl:listen(Port, [binary, {packet, 0}, % app specific packaging {active, false}, {ip, IPv4}, {mode, binary}, {certfile, Certfile}, {cacertfile, CACertfile}, {keyfile, Keyfile}, {verify, verify_none}, {fail_if_no_peer_cert, false}, {ssl_imp, new} ]), I have the following piece of code: %% receiving part: recv_frame_ssl(S, N, SslRecvTimeout) -> {ok, Header} = ssl:recv(S, 4, SslRecvTimeout), <> = Header, {ok, Data} = ssl:recv(S, Length - 4, SslRecvTimeout), <> = Data, {ok, binary_to_list(Data1)}. %%and sending part - the problematic piece of code: send_frame_ssl(Sock, Data) -> DataBin = unicode:characters_to_binary(Data), HeaderLen = erlang:size(DataBin) + 4, ssl:send(Sock, <>), ssl:send(Sock, <>). In R14B04 variable HeaderLen is encoded in network byte order correctly and the client is able to extract the header and to read the rest of packet which has (HeaderLen - 4) length in bytes. In R15, R16 and R17 variable HeaderLen is no more encoded correctlty, apparently, as the client receives a large value and is unable to extract the correct length of the packet and hence, is not able to read the rest of the packet which is xml payload. For example, instead of receiving a HeaderLen with value 390 the client receives a HeaderLen with value 189756. I really don't know how to approach this problem and I am sure I miss something obvious. I tried different combination of HeaderLen encoding with no success whatsoever. Please shed some light on this as I am puzzled and I do not know what to do. Thank you, Bogdan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Tue Oct 28 11:25:02 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 28 Oct 2014 11:25:02 +0100 Subject: [erlang-questions] crypto ECDSA private key -> public In-Reply-To: <1922578025.241397.1414489733134.JavaMail.zimbra@tpip.net> References: <931249906.241396.1414489713360.JavaMail.zimbra@tpip.net> <1922578025.241397.1414489733134.JavaMail.zimbra@tpip.net> Message-ID: Hi! 2014-10-28 10:48 GMT+01:00 Andreas Schultz : > Hi, > > ----- On 27 Oct, 2014, at 23:24, semmit mondo semmitmondo@REDACTED > wrote: > > > Yes and no. > > According to the source of the crypto module generate_key/3 > > does accept a private key only for a few encryption method types. > > This is the only function head that matches ecdh: > > generate_key(ecdh, Curve, undefined) -> ... > > There's no definition for ecdh with a 3rd param that is not > > undefined. ...and generate_key/2 calls the above one: > > generate_key(Type, Params) -> > > generate_key(Type, Params, undefined). > > It would be the function I'm after... > > The function you are looking for is ec_key_new in > lib/crypto/c_src/crypto.c. That > function is not exported to the Erlang world (originally it was in some > faschion, > but the crypto API restructuring un-exported it). > > Humm that was a very big refactor and it sounds like we might have missed an aspect. The function should probably be made available through generate_key/3. Regards Ingela Erlang/OTP Team - Ericsson AB > Andreas > > > > > Ingela Andin ?rta: > > > > > > Hi! > > There is also a function crypto:generate_key/3 that takes a private key > as third > > argument, maybe that is what you want? > > Regards Ingela Erlang/OTP team - Ericsson AB > > 2014-10-21 17:00 GMT+02:00 semmit mondo < semmitmondo@REDACTED > : > > > > > > Hi, > > How can I generate an ECDSA public key from the private one using crypto? > > All I can do with it is to generate a public and private key pair at > once: > > {Pub, Priv} = crypto:generate_key(ecdh, prime239v3). > > but can't calculate the public key if the private key was known > beforehand. > > (prime239v3 isn't important, it could be any EC curve...) > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -- > -- > Dipl. Inform. > Andreas Schultz > > email: as@REDACTED > phone: +49-391-819099-224 > mobil: +49-170-2226073 > > ------------------- enabling your networks ------------------- > > Travelping GmbH phone: +49-391-819099229 > Roentgenstr. 13 fax: +49-391-819099299 > D-39108 Magdeburg email: info@REDACTED > GERMANY web: http://www.travelping.com > > Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 > Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 > -------------------------------------------------------------- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lcastro@REDACTED Tue Oct 28 12:15:55 2014 From: lcastro@REDACTED (Laura M. Castro) Date: Tue, 28 Oct 2014 12:15:55 +0100 Subject: [erlang-questions] DBus: erlang native implementations Message-ID: Hello, I have a personal project for with I would like to communicate with FreeDesktop applications from Erlang via DBus. I could use a port, but I have also found three native implementations: https://code.google.com/p/erlang-dbus/ https://github.com/zem/erlang-dbus https://github.com/tonyrog/dbus Anyone has experience with (any of) them? Given all three repos have not seen any activity in a while, your insights would be very valuable. Thanks! -- Laura M. Castro From ingela.andin@REDACTED Tue Oct 28 12:18:54 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 28 Oct 2014 12:18:54 +0100 Subject: [erlang-questions] ssl impas In-Reply-To: References: Message-ID: Hi! It could have to do with that with the fact that the length argument is only relevant for raw sockets, and that in R15 we implemented 1/n-1 splitting countermeasure to the Rizzo Duong BEAST attack, which will split all packets to the into the first byte and the following bytes. Regards Ingela Erlang/OTP team - Ericsson AB 2014-10-28 10:50 GMT+01:00 Bogdan Andu : > Hi folks, > > sorry for my problem but I am stuck after > turning it on every facet. > > I have an application server that processes xml structures > with the following listen parameters: > > {ok, ListenSock} = ssl:listen(Port, [binary, > {packet, 0}, % app > specific packaging > {active, false}, > {ip, IPv4}, > {mode, binary}, > {certfile, > Certfile}, > {cacertfile, > CACertfile}, > {keyfile, Keyfile}, > {verify, > verify_none}, > > {fail_if_no_peer_cert, false}, > {ssl_imp, new} > ]), > > I have the following piece of code: > > %% receiving part: > recv_frame_ssl(S, N, SslRecvTimeout) -> > {ok, Header} = ssl:recv(S, 4, SslRecvTimeout), > <> = Header, > > {ok, Data} = ssl:recv(S, Length - 4, SslRecvTimeout), > <> = Data, > > {ok, binary_to_list(Data1)}. > > %%and sending part - the problematic piece of code: > send_frame_ssl(Sock, Data) -> > DataBin = unicode:characters_to_binary(Data), > HeaderLen = erlang:size(DataBin) + 4, > > ssl:send(Sock, <>), > ssl:send(Sock, <>). > > In R14B04 variable HeaderLen is encoded in network byte order correctly > and the client is able to extract the header and to read the rest of packet > which has (HeaderLen - 4) length in bytes. > > In R15, R16 and R17 variable HeaderLen is no more encoded correctlty, > apparently, as the client receives a large value and is unable to extract > the correct length of the packet and hence, is not able to read the rest of > the packet which is xml payload. > For example, instead of receiving a HeaderLen with value 390 the client > receives a HeaderLen with value 189756. > > I really don't know how to approach this problem and I am sure I miss > something obvious. > > I tried different combination of HeaderLen encoding with no success > whatsoever. > > Please shed some light on this as I am puzzled and I do not know what to > do. > > Thank you, > > Bogdan > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Tue Oct 28 12:21:20 2014 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Tue, 28 Oct 2014 12:21:20 +0100 Subject: [erlang-questions] In Erlang , {1.1*1.1.} show me the answer is 1.2100000000000002, why? In-Reply-To: References: <1d2235b4.633b.1494b57e78d.Coremail.zd2559@126.com> <544CB8AF.1050405@ninenines.eu> Message-ID: <20141028112120.GA6980@erix.ericsson.se> On Tue, Oct 28, 2014 at 11:23:44AM +1300, Richard A. O'Keefe wrote: : > > Decimal floats were not abandoned simply for speed; they had > some numerical problems binary floats are free of. The new > standard partly mitigates those, but only partly. That's interesting. If you want to elaborate I would very much like to know... -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From bog495@REDACTED Tue Oct 28 14:53:47 2014 From: bog495@REDACTED (Bogdan Andu) Date: Tue, 28 Oct 2014 15:53:47 +0200 Subject: [erlang-questions] ssl impas In-Reply-To: References: Message-ID: Hi Ingela, Thank you for reply, The packet was in raw format - the socket option: {packet , 0} - and I tried to send the packet formatted as: ssl:send(Sock, <<0:8/unit:1, HeaderLen:32/big, DataBin/binary>>) in order to let the Erlang tcp stack to strip the first byte. That was better, in the sense that the length of the packet was what the client expected but only for the first packet sent to it from server. For subsequent packets the decoding problem persisted. However, I updated that client to the latest version, and it is working with R14 and R17 without adding first byte. In other words, the code: ssl:send(Sock, <>) works the same with both R14 and R17 with new client. That's because the new client has put the fread(socket, length) in a 'while(!feof(socket))' construct allowing it to read the 1st byte and then the other 3 bytes, constructing thus the 'header' of the packet correctly accumulating all 4 bytes. So, after all was a client problem, and their update fixed by accident my problem also. I was stubborn to make Erlang speak with a bad client (which is already distributed to our end clients), altough I knew the fact that the client is badly written. The info you gave me was like a revelation and helped me to understand what really is going on. Thank you so much, Bogdan On Tue, Oct 28, 2014 at 1:18 PM, Ingela Andin wrote: > Hi! > > It could have to do with that with the fact that the length argument is > only relevant for raw sockets, > and that in R15 we implemented 1/n-1 splitting countermeasure to the Rizzo > Duong BEAST attack, which > will split all packets to the into the first byte and the following bytes. > > Regards Ingela Erlang/OTP team - Ericsson AB > > > 2014-10-28 10:50 GMT+01:00 Bogdan Andu : > >> Hi folks, >> >> sorry for my problem but I am stuck after >> turning it on every facet. >> >> I have an application server that processes xml structures >> with the following listen parameters: >> >> {ok, ListenSock} = ssl:listen(Port, [binary, >> {packet, 0}, % app >> specific packaging >> {active, false}, >> {ip, IPv4}, >> {mode, binary}, >> {certfile, >> Certfile}, >> {cacertfile, >> CACertfile}, >> {keyfile, >> Keyfile}, >> {verify, >> verify_none}, >> >> {fail_if_no_peer_cert, false}, >> {ssl_imp, new} >> ]), >> >> I have the following piece of code: >> >> %% receiving part: >> recv_frame_ssl(S, N, SslRecvTimeout) -> >> {ok, Header} = ssl:recv(S, 4, SslRecvTimeout), >> <> = Header, >> >> {ok, Data} = ssl:recv(S, Length - 4, SslRecvTimeout), >> <> = Data, >> >> {ok, binary_to_list(Data1)}. >> >> %%and sending part - the problematic piece of code: >> send_frame_ssl(Sock, Data) -> >> DataBin = unicode:characters_to_binary(Data), >> HeaderLen = erlang:size(DataBin) + 4, >> >> ssl:send(Sock, <>), >> ssl:send(Sock, <>). >> >> In R14B04 variable HeaderLen is encoded in network byte order correctly >> and the client is able to extract the header and to read the rest of packet >> which has (HeaderLen - 4) length in bytes. >> >> In R15, R16 and R17 variable HeaderLen is no more encoded correctlty, >> apparently, as the client receives a large value and is unable to extract >> the correct length of the packet and hence, is not able to read the rest of >> the packet which is xml payload. >> For example, instead of receiving a HeaderLen with value 390 the client >> receives a HeaderLen with value 189756. >> >> I really don't know how to approach this problem and I am sure I miss >> something obvious. >> >> I tried different combination of HeaderLen encoding with no success >> whatsoever. >> >> Please shed some light on this as I am puzzled and I do not know what to >> do. >> >> Thank you, >> >> Bogdan >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From community-manager@REDACTED Tue Oct 28 15:15:11 2014 From: community-manager@REDACTED (Bruce Yinhe) Date: Tue, 28 Oct 2014 15:15:11 +0100 Subject: [erlang-questions] Erlang Central tutorial section Message-ID: To all Erlangers, At Erlang Central we are committed to provide useful resources for developers to improve their Erlang programming skills. The tutorial section was launched particularly for this purpose. We are always working to improve the quality of the tutorial section and increase the variety of learning materials. As time progressed, we have already around 150 wiki entries and more than 50 tutorials. Many of them were migrated from trapexit and cleaned up, with more and more coming in every month. The more our users contribute to the Erlang Central the better it will get and we greatly appreciate all the contribution and feedback we have received from you. The tutorial section is a wiki, everyone is welcome to update, improve and help maintain existing tutorials. It is a great place to move your blog posts so that they become easy to find. Visit the Erlang Central tutorial section here: bit.ly/1wDsQoD We are looking for Erlang tutorials and examples of both beginner level and intermediate level, particularly any blog posts, any topics on helpful advice and tips, examples of how to build applications, alternative approaches, interfacing Erlang, comparison of Erlang and other languages. Best wishes, Bruce Yinhe erlangcentral.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanfiedler@REDACTED Tue Oct 28 14:29:15 2014 From: nathanfiedler@REDACTED (Nathan Fiedler) Date: Tue, 28 Oct 2014 06:29:15 -0700 Subject: [erlang-questions] Examples of Common Test in apps built with rebar/relx? In-Reply-To: <544F18F9.7030300@ninenines.eu> References: <544EC910.7010909@ninenines.eu> <544F18F9.7030300@ninenines.eu> Message-ID: Thanks for all of the responses everyone, it has been helpful to know what others are using. I have something that kinda works, I just can't test it the way I want, so I'll keep plugging away at that. Should help me to better understand how it all works. n -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidnwelton@REDACTED Tue Oct 28 16:53:27 2014 From: davidnwelton@REDACTED (David Welton) Date: Tue, 28 Oct 2014 16:53:27 +0100 Subject: [erlang-questions] DBus: erlang native implementations In-Reply-To: References: Message-ID: Hi, This one is actively developed: https://github.com/lizenn/erlang-dbus It probably needs more work, but at least the developer is available and willing to collaborate. On Tue, Oct 28, 2014 at 12:15 PM, Laura M. Castro wrote: > Hello, > > I have a personal project for with I would like to communicate with > FreeDesktop applications from Erlang via DBus. I could use a port, but > I have also found three native implementations: > > https://code.google.com/p/erlang-dbus/ > https://github.com/zem/erlang-dbus > https://github.com/tonyrog/dbus > > Anyone has experience with (any of) them? Given all three repos have > not seen any activity in a while, your insights would be very > valuable. > > Thanks! > > -- > Laura M. Castro > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From pguyot@REDACTED Tue Oct 28 18:07:06 2014 From: pguyot@REDACTED (Paul Guyot) Date: Tue, 28 Oct 2014 18:07:06 +0100 Subject: [erlang-questions] [ANN] BBEdit Erlang Language Module v1.3 Message-ID: <39441651-BDE8-4340-A887-1B1128E0DA92@kallisys.net> Hello, I'm pleased to announce v1.3 update of the Erlang language module for BBEdit, an award-winning MacOS X text editor. It features syntax coloring and code completion (including all Erlang/OTP documented API). You can download it here: https://github.com/pguyot/erlang-bblm/releases/tag/v1.3 Source code is available as well. Please use v1.2 with BBEdit 9 and 10 or TextWrangler (which wasn't updated yet to use new language module API AFAIK). Changes: ? [ENH] Upgraded for BBEdit 11. ? [ENH] Updated completion lists for Erlang 17 ? [FEA] Comments can now be spell-checked (BBEdit 11 addition). ? [FEA] include and include_lib files can be opened from the popup (BBEdit 11 addition). ? [FIX] Fixed algorithmic bugs revelead by Clang analyzer. Regards, Paul -- Semiocast http://semiocast.com/ +33.183627948 - 20 rue Lacaze, 75014 Paris From xuxb1979@REDACTED Wed Oct 29 06:05:47 2014 From: xuxb1979@REDACTED (Xiaobin Xu) Date: Wed, 29 Oct 2014 13:05:47 +0800 Subject: [erlang-questions] verify google play signature in erlang Message-ID: hi, I tried to implement google play store signature verification in erlang this morning, I think i can use public_key:verify(Msg, DigestType, Signature, Key) -> boolean() to do my job, but I don't know how to generate a public key from encoded public key provided by play store. In case of java, we can do this: byte[] decodedKey = Base64.decode(encodedPublicKey, Base64. DEFAULT); KeyFactory keyFactory = KeyFactory.getInstance( KEY_FACTORY_ALGORITHM); return keyFactory.generatePublic(new X509EncodedKeySpec( decodedKey)); Thanks, Xiaobin, Xu -------------- next part -------------- An HTML attachment was scrubbed... URL: From semmitmondo@REDACTED Wed Oct 29 13:02:07 2014 From: semmitmondo@REDACTED (semmit mondo) Date: Wed, 29 Oct 2014 13:02:07 +0100 (CET) Subject: [erlang-questions] crypto ECDSA private key -> public In-Reply-To: Message-ID: >Humm that was a very big refactor and it sounds like we might have missed an aspect. >The function should probably be made available through generate_key/3. Does this mean that I can hope generate_key/3 will do the job soon,perhaps in the next release? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Wed Oct 29 14:13:45 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Wed, 29 Oct 2014 14:13:45 +0100 Subject: [erlang-questions] crypto ECDSA private key -> public In-Reply-To: References: Message-ID: Hi! I think that generate:key/3 should do the job, but the only way to guarantee that it will do it soon is if someone contributes the code. Probably not a very big job but probably not on top of Ericsson's priority list either so I can not promise anything regarding when we have time to do it. Regards Ingela Erlang/OTP Team - Ericsson AB 2014-10-29 13:02 GMT+01:00 semmit mondo : > > *Humm that was a very big refactor and it sounds like we might have missed > an aspect. The function should probably be made available through > generate_key/3. * > > Does this mean that I can hope generate_key/3 will do the job soon, > perhaps in the next release? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Wed Oct 29 14:20:17 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Wed, 29 Oct 2014 14:20:17 +0100 Subject: [erlang-questions] verify google play signature in erlang In-Reply-To: References: Message-ID: Hi! 2014-10-29 6:05 GMT+01:00 Xiaobin Xu : > hi, > > I tried to implement google play store signature verification in > erlang this morning, I think i can use public_key:verify(Msg, DigestType, > Signature, Key) -> boolean() to do my job, but I don't know how to generate > a public key from encoded public key provided by play store. > > It depends on what encoding you have? There is public_key:pem_decode that handles PEM-encoding. (Basically Base64 encoded ASN-1 DER blobs rapped in some header/footer lines) When you have a ASN-1 DER blob you can use public_key:der_decode(ASN1-type, DER) to get the erlang record for that ASN-1 type. Regards Ingela Erlang/OTP team - Ericsson AB In case of java, we can do this: > > byte[] decodedKey = Base64.decode(encodedPublicKey, Base64. > DEFAULT); > > KeyFactory keyFactory = KeyFactory.getInstance( > KEY_FACTORY_ALGORITHM); > > return keyFactory.generatePublic(new X509EncodedKeySpec( > decodedKey)); > > > > Thanks, > > Xiaobin, Xu > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lcastro@REDACTED Wed Oct 29 15:52:11 2014 From: lcastro@REDACTED (Laura M. Castro) Date: Wed, 29 Oct 2014 15:52:11 +0100 Subject: [erlang-questions] DBus: erlang native implementations In-Reply-To: References: Message-ID: > This one is actively developed: https://github.com/lizenn/erlang-dbus > > It probably needs more work, but at least the developer is available > and willing to collaborate. That one hadn't showed up on the searches I made, thanks! -- Laura M. Castro From aschultz@REDACTED Wed Oct 29 16:43:47 2014 From: aschultz@REDACTED (Andreas Schultz) Date: Wed, 29 Oct 2014 15:43:47 +0000 (UTC) Subject: [erlang-questions] crypto ECDSA private key -> public In-Reply-To: <703478170.344403.1414597395287.JavaMail.zimbra@tpip.net> References: Message-ID: <1517323709.344408.1414597427708.JavaMail.zimbra@tpip.net> Hi Semmit, The attached patch adds crypto:generate_key/3 with private key for ecdh. Sample: Erlang/OTP 18 [DEVELOPMENT] [erts-7.0] [source-937f447] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Eshell V7.0 (abort with ^G) 1> {Pub, Priv} = crypto:generate_key(ecdh, secp112r1). {<<4,40,132,38,255,209,253,37,204,31,26,207,136,215,167, 143,157,58,176,10,191,31,177,127,84,17,123,89,...>>, <<52,78,247,5,151,208,119,88,134,92,144,155,48,10>>} 2> {Pub, Priv} = crypto:generate_key(ecdh, secp112r1, Priv). {<<4,40,132,38,255,209,253,37,204,31,26,207,136,215,167, 143,157,58,176,10,191,31,177,127,84,17,123,89,...>>, <<52,78,247,5,151,208,119,88,134,92,144,155,48,10>>} The only test I have done is the shell snippet above. I don't have the time (or motivation) to update the documentation and write the unit tests for this. So, if you really want this in R18, you'll have to prepare the pull request yourself (add documentation and tests). Andreas ----- On 29 Oct, 2014, at 14:13, Ingela Andin ingela.andin@REDACTED wrote: > Hi! > > I think that generate:key/3 should do the job, but the only way to guarantee > that it will do it soon is if someone > contributes the code. Probably not a very big job but probably not on top of > Ericsson's priority list either so I can not > promise anything regarding when we have time to do it. > > Regards Ingela Erlang/OTP Team - Ericsson AB > > > 2014-10-29 13:02 GMT+01:00 semmit mondo < semmitmondo@REDACTED > : > > > > > > > Humm that was a very big refactor and it sounds like we might have missed an > aspect. > The function should probably be made available through generate_key/3. > Does this mean that I can hope generate_key/3 will do the job soon, > perhaps in the next release? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- -- Dipl. Inform. Andreas Schultz -------------- next part -------------- A non-text attachment was scrubbed... Name: generate_key_ecdh_private.patch Type: text/x-patch Size: 3109 bytes Desc: not available URL: From schuster@REDACTED Wed Oct 29 18:36:03 2014 From: schuster@REDACTED (Jonathan Schuster) Date: Wed, 29 Oct 2014 13:36:03 -0400 Subject: [erlang-questions] Looking for tricky protocol examples for verification research Message-ID: This morning I happened to find the "Erlang and Akka" thread from a couple of months ago, and it caught my eye because several people discussed exactly the sort of thing I'm researching right now: verifying that actor-based programs conform to some given protocol. In particular, I'm trying to figure out how we can do better for real-world programs instead of the simple examples used in things like session types. I'm currently in the process of collecting more examples of this sort of problem, so I'd love to know what examples members of this list might have (particularly examples with publicly accessible code). I'm interested in any examples of a protocol that can be tricky to implement, and communication bugs that could have been caught earlier if only there were some type system/analysis/tool to detect them. I'm using "protocol" here in a loose sense - it doesn't have to be a standard, like an RFC. I'm referring more generally to an expectation of the kinds of messages a process should send or receive - much like the sort of thing UBF checks for. -------------- next part -------------- An HTML attachment was scrubbed... URL: From xuxb1979@REDACTED Thu Oct 30 04:32:28 2014 From: xuxb1979@REDACTED (Xiaobin Xu) Date: Thu, 30 Oct 2014 11:32:28 +0800 Subject: [erlang-questions] verify google play signature in erlang In-Reply-To: References: Message-ID: Hi, Ingela, According to google, the key is "Base64-encoded RSA public key?. After add header/footer, I?m able to generate public key record now. Thank you for your kindly help. Best regards, Xiaobin Xu 2014-10-29 21:20 GMT+08:00 Ingela Andin : > Hi! > > 2014-10-29 6:05 GMT+01:00 Xiaobin Xu : > >> hi, >> >> I tried to implement google play store signature verification in >> erlang this morning, I think i can use public_key:verify(Msg, DigestType, >> Signature, Key) -> boolean() to do my job, but I don't know how to generate >> a public key from encoded public key provided by play store. >> >> > It depends on what encoding you have? There is public_key:pem_decode that > handles PEM-encoding. (Basically Base64 encoded ASN-1 DER blobs rapped in > some > header/footer lines) > > When you have a ASN-1 DER blob you can use > public_key:der_decode(ASN1-type, DER) to get the erlang record for that > ASN-1 type. > > > Regards Ingela Erlang/OTP team - Ericsson AB > > > In case of java, we can do this: >> >> byte[] decodedKey = Base64.decode(encodedPublicKey, Base64. >> DEFAULT); >> >> KeyFactory keyFactory = KeyFactory.getInstance( >> KEY_FACTORY_ALGORITHM); >> >> return keyFactory.generatePublic(new X509EncodedKeySpec( >> decodedKey)); >> >> >> >> Thanks, >> >> Xiaobin, Xu >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fritchie@REDACTED Thu Oct 30 08:53:22 2014 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Thu, 30 Oct 2014 02:53:22 -0500 Subject: [erlang-questions] Unbalanced Scheduler Problem caused by Using out of date active_no_runq In-Reply-To: Message of "Tue, 28 Oct 2014 15:13:57 +0800." Message-ID: <28140.1414655602@snookles.snookles.com> songlu cai wrote: slc> How to fix: slc> [...] slc> 3, Or Another Way? Wow, that's quite a diagnosis. I'm not a good judge of the race condition that you've found or your fix. I can provide some context, however, in case that you weren't aware of it. It might help to create a Real, Final, 100% Correct Fix ... something which does not exist right now. The best workaround is to use "+scl false" and "+sfwi" with a value of 500 or a bit smaller. See the discussion last month about it, http://erlang.org/pipermail/erlang-questions/2014-September/081017.html My colleague Joe Blomstedt wrote a demo program that can cause scheduler collapse to happen pretty quickly. It might be useful for judging how well any fix works ... at Basho we had a terrible time trying to reproduce this bug before Joe found a semi-reliable trigger. https://github.com/basho/nifwait It is discussed in this email thread (which is broken across two URLs, sorry). http://erlang.org/pipermail/erlang-questions/2012-October/069503.html (first message only, I don't know why) http://erlang.org/pipermail/erlang-questions/2012-October/069585.html (the rest of the thread) If your analysis is correct ... then hopefully this can lead quickly to a Real, Final, 100% Correct Fix. I'm tired of diagnosing systems that suffer scheduler collapse and then discover that the customer forgot to add the magic +sfwi and +scl flags in their runtime configuration to work around that !@#$! bug. -Scott From fritchie@REDACTED Thu Oct 30 09:07:41 2014 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Thu, 30 Oct 2014 03:07:41 -0500 Subject: [erlang-questions] Looking for tricky protocol examples for verification research In-Reply-To: Message of "Wed, 29 Oct 2014 13:36:03 EDT." Message-ID: <30091.1414656461@snookles.snookles.com> Hrm, well, there is the Multi-Paxos framework that's the foundation for riak_ensemble. https://github.com/basho/riak_ensemble There are four different Raft protocol implementations mentioned at: http://raftconsensus.github.io/ Is this the sort of thing you're looking for? Elsewhere, verifying the good/bad health of the gen_leader protocol. Its implementations have splintered, so I'm not quite sure which one is the highest quality today, perhaps this one? Ulf Wiger and/or Andrew Thompson might also have some opinions ... I haven't seen any postings to this list by Augusto Becciu. https://github.com/abecciu/gen_leader_revival -Scott From ulf@REDACTED Thu Oct 30 10:51:21 2014 From: ulf@REDACTED (Ulf Wiger) Date: Thu, 30 Oct 2014 10:51:21 +0100 Subject: [erlang-questions] Looking for tricky protocol examples for verification research In-Reply-To: <30091.1414656461@snookles.snookles.com> References: <30091.1414656461@snookles.snookles.com> Message-ID: On 30 Oct 2014, at 09:07, Scott Lystig Fritchie wrote: > Elsewhere, verifying the good/bad health of the gen_leader protocol. > Its implementations have splintered, so I'm not quite sure which one is > the highest quality today, perhaps this one? Ulf Wiger and/or Andrew > Thompson might also have some opinions ? I do. It?s probably not the majority opinion, but I?m leaning towards ?locks_leader? [1] as the best leader-election approach, with the huge proviso that it hasn?t seen much - if any - real action*, as far as I know. ;-) > I haven't seen any postings to this list by Augusto Becciu. I remember him posting back in 2010 [2]. BR, Ulf W [1] https://github.com/uwiger/locks/blob/master/doc/locks_leader.md [2] http://erlang.org/pipermail/erlang-questions/2010-October/054088.html * If anyone has some feedback about ?locks? in the field, please let me know. You can email me in confidence if you want. Personally, I?ve used locks in the kvdb database, and successfully negotiated both the kvdb test suite and the Exosense server test suite (which also does things like passing transaction contexts between processes). The ?uw-locks-integration? branch of kvdb has not yet been merged into master, though, and while the idea is to eventually use locks_leader in kvdb (or a Raft version), I?ve not yet gone there. Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com From ulf@REDACTED Thu Oct 30 11:52:01 2014 From: ulf@REDACTED (Ulf Wiger) Date: Thu, 30 Oct 2014 11:52:01 +0100 Subject: [erlang-questions] Looking for tricky protocol examples for verification research In-Reply-To: References: Message-ID: <40F2C184-7261-4E52-9BDA-F6B1A3EC2629@feuerlabs.com> On 29 Oct 2014, at 18:36, Jonathan Schuster wrote: > This morning I happened to find the "Erlang and Akka" thread from a couple of months ago, and it caught my eye because several people discussed exactly the sort of thing I'm researching right now: verifying that actor-based programs conform to some given protocol. In particular, I'm trying to figure out how we can do better for real-world programs instead of the simple examples used in things like session types. I have used UBF, and like the idea of having a state- and type-based protocol checking. I thought a problem with UBF was that it really only dealt with synchronous protocols. I know Joe had some excellent ideas on how to move further, but I?m not sure they were ever implemented. While type errors are certainly important, I believe unexpected message ordering is more so. I talked about that in my ?Death by Accidental Complexity? [1] and got permission to publish the code used in the presentation [2]. Of course, any verification here would have to take into account that Erlang can implicitly ignore (buffer) messages in states where the focus is on only a few specific messages. Keeping track of message types, one could perhaps note if patterns are too general, so as to accept messages that are not expected to (or even must not) be handled in the current state. The POTS code mentioned above actually contains examples of that, where valid messages are discarded in states that do not recognize them, yet still consume them. This is in a way worse than crashing on a bad message, since this at least gives a fairly clear indication of what has gone wrong; instead the code ends up waiting indefinitely for a message that has already been received and discarded. BR, Ulf W [1] http://www.infoq.com/presentations/Death-by-Accidental-Complexity [2] https://github.com/uwiger/pots Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tobias.lindahl@REDACTED Thu Oct 30 11:56:15 2014 From: tobias.lindahl@REDACTED (Tobias Lindahl) Date: Thu, 30 Oct 2014 11:56:15 +0100 Subject: [erlang-questions] Mnesia transaction restarts In-Reply-To: <544F2251.2030205@shoretel.com> References: <5449D0AE.5010507@shoretel.com> <544D8F04.6030703@shoretel.com> <544F2251.2030205@shoretel.com> Message-ID: In my experience you make these things happen yourself on the application level. Although the transaction you are describing is only accessing one record, there might be another process that takes a whole table lock and keeps running for some time. This is usually some reporting process or some maintenance process, where you didn't realize that you were taking a whole table lock. Such locks are implicitly taken by qlc:s, matches and selects when you do them in a transaction. If you don't have such processes, I would look for careless try/catch patterns that execute in a transaction. Since the restarts in mnesia transactions are signaled with exceptions you need to be very careful with what you are catching in the code inside a transaction. This could make another transaction that should have been restarted ending up catching the restart signal and keep the lock. Just my 2c 2014-10-28 5:57 GMT+01:00 Bernard Duggan : > > On 27/10/14 20:43, Ulf Wiger wrote: > > > On 27 Oct 2014, at 01:17, Bernard Duggan wrote: > > But since it *is* happening there must be some property of our system that > I don't fully understand. Time to go digging again :) > > > If the writes are replicated, you might want to look for overload > conditions on remote mnesia_tm processes (e.g. due to mnesia_overload > (message_queue_len)). > > Thanks Ulf. Inconveniently, this is only a single-node system, so there's > no opportunity for distribution systems to get in the way :) > > Dan will have to correct me if I?m wrong here... > > If a younger (WaitForTid < OurTid) transaction gets held up on commit, > older transactions can get stuck in a restart condition. Since the > mnesia_tm process relies on (unoptimizable) selective receive, it?s > vulnerable to long message queues (which can happen especially if you have > lots of replicated dirty writes). > > I have noticed (and been tripped up by) that selective receive in the > past. I even took a look at one stage at whether it could be new-reference > optimised, but quickly gave up. In at least one sense I'm glad to hear you > say that it is, in fact, unoptimisable because it means I was right to not > spend too much time on it :) > > [snip] > > If you have side-effects inside transactions (message send/receive), > basically all bets are off, and really weird things can happen, not least > transaction processes waiting endlessly for messages that were already > sent+received, but then discarded due to transaction restart. > > Thanks - it's something we've definitely tried to keep in mind, making > sure we avoid debug logging etc inside the transactions. I will, however, > go back and re-check a few critical places to make sure we're not doing > something silly. > > Cheers, > > Bernard > > > ------------------------------ > > This e-mail and any attachments are confidential. If it is not intended > for you, please notify the sender, and please erase and ignore the contents. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Thu Oct 30 12:49:17 2014 From: z@REDACTED (Danil Zagoskin) Date: Thu, 30 Oct 2014 15:49:17 +0400 Subject: [erlang-questions] Supervisor child stuck in 'restarting' state In-Reply-To: References: Message-ID: Upgraded to OTP 17.3, still having the same issue: 12> lists:keyfind(5223, 3, element(4, sys:get_state(ejabberd_listeners))). #child{pid = {restarting,<0.2096.2241>}, name = 5223, mfargs = {ejabberd_listener,start, [5223,ejabberd_c2s, [...]]}, restart_type = permanent,shutdown = brutal_kill, child_type = worker, modules = [ejabberd_listener]} 13> supervisor:try_again_restart(ejabberd_listeners, 5223). ok 14> lists:keyfind(5223, 3, element(4, sys:get_state(ejabberd_listeners))). #child{pid = <0.17553.2059>,name = 5223, mfargs = {ejabberd_listener,start, [5223,ejabberd_c2s, [...]]}, restart_type = permanent,shutdown = brutal_kill, child_type = worker, modules = [ejabberd_listener]} Any ideas on what to do when supervisor does not supervise? On Tue, Oct 14, 2014 at 12:26 AM, Danil Zagoskin wrote: > Bump? > > Bond of supervisor+timer with rather fresh code fails to build > fault-tolerant system under unclear circumstances. > > Was there bug in erts causing message loss or timer callback failing to be > called? > May user code which does not kill the timer server affect a running > supervisor in this way? > Which part of system should I watch more carefully to investigate a > problem? > > > On Wed, Oct 8, 2014 at 12:52 AM, Danil Zagoskin wrote: > >> Hello! >> >> We have an application (well, it's some patched old ejabberd fork) >> running on OTP R16B (no digits after "B"). >> >> On one of our clusters sometimes appears a strange problem with >> supervisor ? a child does not restart after crash (one_for_one strategy): >> >> Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:16:16] >> [async-threads:10] [hipe] [kernel-poll:false] >> (ejabberd@REDACTED)1> f(State), f(Children), State = hd([S || {data, Data} >> <- lists:nth(5, element(4, sys:get_status(ejabberd_listeners))), {"State", >> S} <- Data]), Children = element(4, State), lists:keyfind(5223, 3, >> Children). >> {child,{restarting,<0.17921.2571>}, >> 5223, >> {ejabberd_listener,start, >> [5223,ejabberd_c2s, >> [{access,c2s}, >> {max_stanza_size,262144}, >> {sasl_mechs,[]}, >> {non_sasl_meths,[]}, >> zlib,tls, ....]]}, >> permanent,brutal_kill,worker, >> [ejabberd_listener]} >> >> Inspecting supervisor code gave a way to actually restart the child ? >> supervisor:try_again_restart/2 works well when called from REPL. >> As supervisor:restart/2 code says, try_again_restart is scheduled >> using timer:apply_after after a failed start attempt (just where >> 'restarting' tag appears). So it seems like lost event in timer server. >> >> Git showed no changes in this part of supervisor code since R16B to >> current maint branch. >> There are no considerable changes in timer module either. >> >> Also it's quite strange to me that other clusters (with other mods loaded >> but with a similar config of this supervisor) do not suffer of this problem. >> >> >> How do I avoid such problem or how can I get more information on it? >> >> -- >> Danil Zagoskin | z@REDACTED >> > > > > -- > Danil Zagoskin | z@REDACTED > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.platt@REDACTED Thu Oct 30 22:33:45 2014 From: pablo.platt@REDACTED (pablo platt) Date: Thu, 30 Oct 2014 23:33:45 +0200 Subject: [erlang-questions] DTLS/SRTP for WebRTC Message-ID: Hi, What is the state of DTLS in OTP? I'm interested in using DTLS/SRTP in Erlang for WebRTC. I've found two implementations: Clean code but I couldn't make it work because it's missing SRTP support. https://github.com/RoadRunnr/otp/tree/new_crypto_dtls This works quite well. I'm able to connect clients to the server: https://groups.google.com/d/msg/discuss-webrtc/MP-1sCrOljA/qAs4VK-18y4J The problem is that some clients can't connect and I'm getting HANDSHAKE packets while in the CIPHER state in the following order: HANDSHAKE, SERVER_HELLO HANDSHAKE, CERTIFICATE HANDSHAKE, SERVER_KEY_EXCHANGE HANDSHAKE, CERTIFICATE_REQUEST HANDSHAKE, SERVER_HELLO_DONE I'm assuming that is related to wrong state change or retransmission. The code only implement retransmission for two packet types and have the following comment: %% problem remainning: different strategy should be adopted while state==hello or cipher. Does anyone use DTLS/SRTP in Erlang and help solve this issue or recommend another solution? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From schuster@REDACTED Thu Oct 30 22:43:51 2014 From: schuster@REDACTED (Jonathan Schuster) Date: Thu, 30 Oct 2014 17:43:51 -0400 Subject: [erlang-questions] Looking for tricky protocol examples for verification research In-Reply-To: <30091.1414656461@snookles.snookles.com> References: <30091.1414656461@snookles.snookles.com> Message-ID: On Thu, Oct 30, 2014 at 4:07 AM, Scott Lystig Fritchie < fritchie@REDACTED> wrote: > Hrm, well, there is the Multi-Paxos framework that's the foundation for > riak_ensemble. > > https://github.com/basho/riak_ensemble > > There are four different Raft protocol implementations mentioned at: > > http://raftconsensus.github.io/ > > Is this the sort of thing you're looking for? > > Elsewhere, verifying the good/bad health of the gen_leader protocol. > Its implementations have splintered, so I'm not quite sure which one is > the highest quality today, perhaps this one? Ulf Wiger and/or Andrew > Thompson might also have some opinions ... I haven't seen any postings > to this list by Augusto Becciu. > > https://github.com/abecciu/gen_leader_revival > > I've only had a chance to glance at these so far, but both these and the POTS example Ulf mentioned look possibly relevant. More generally, I'm looking for the kinds of scenarios that one might use contracts to specify in a non-concurrent world: instances in which you expect some component you're interacting with to have a certain behavior, so you specify that behavior in some way that the computer understands. My hunch is that something similar could be useful for communication-focused programs, but it's unclear what. It would be especially useful if anyone points out in these examples "at line X of file Y, I want to state invariant Z but have no way of doing so". >From what I've seen, session types come closest to solving this problem, but they tend to be overly restrictive, and it's not obvious how to apply session types to actor-based programs, because session types assume that channels are created separately from the processes that receive messages on them. I'm especially interested in examples that expect a particular behavior from PIDs sent as messages, since this adds an extra layer of complexity not normally addressed in the classic communicating finite state machine literature. Session types deal with this with what they call "carried types", and I'm curious what other mechanisms I might be able to devise for those situations. -------------- next part -------------- An HTML attachment was scrubbed... URL: From caisonglu@REDACTED Fri Oct 31 03:55:48 2014 From: caisonglu@REDACTED (songlu cai) Date: Fri, 31 Oct 2014 10:55:48 +0800 Subject: [erlang-questions] Unbalanced Scheduler Problem caused by Using out of date active_no_runq In-Reply-To: <28140.1414655602@snookles.snookles.com> References: <28140.1414655602@snookles.snookles.com> Message-ID: Hi Scott, Thanks for your attention & quick reply. It seems that quite a few people suffer from this problem. Scott>The best workaround is to use "+scl false" and "+sfwi" with a value of 500 or a bit smaller 1, we set +sfwi 500 2,at first, we set +scl false, but it causes unbalanced runq length among all runqs on R16B03, then we set +scl true (by default), so +scl false is not a safe choice on R16B03 Our test cmdline: /home/Xxx/erts-5.10.4/bin/beam.smp -zdbbl 8192 -sbt db -sbwt very_short -swt low -sfwi 500 -MBmmsbc 100 -MHmmsbc 100 -MBmmmbc 100 -MHmmmbc 100 -MMscs 20480 -MBsmbcs 10240 -MHsbct 2048 -W w -e 50000 -Q 1000000 -hmbs 46422 -hms 2586 -P 1000000 -A 16 -K true -d -Bi -sct L23T0C0P0N0:L22T1C1P0N0:L21T2C2P0N0:L20T3C3P0N0:L19T4C4P0N0:L18T5C5P0N0:L17T6C0P1N1:L16T7C1P1N1:L15T8C2P1N1:L14T9C3P1N1:L13T10C4P1N1:L12T11C5P1N1:L11T12C0P0N0:L10T13C1P0N0:L9T14C2P0N0:L8T15C3P0N0:L7T16C4P0N0:L6T17C5P0N0:L5T18C0P1N1:L4T19C1P1N1:L3T20C2P1N1:L2T21C3P1N1:L1T22C4P1N1:L0T23C5P1N1 -swct medium -- -root /home/Xxx/dir -progname Xxx -- -home /root -- -boot /home/Xxx/dir -mode interactive -config /home/Xxx/sys.config -shutdown_time 30000 -heart -setcookie Xxx -name proxy@REDACTED ? console And , apart from everything else, INACTIVE|NONEMPTY is not a normal state of runq flag. Next few days, I will fix the not-yet-be-sure bug in my way based on R16B03 and run the test cases again. Best Regards, Songlu Cai 2014-10-30 15:53 GMT+08:00 Scott Lystig Fritchie : > songlu cai wrote: > > slc> How to fix: > > slc> [...] > > slc> 3, Or Another Way? > > Wow, that's quite a diagnosis. I'm not a good judge of the race > condition that you've found or your fix. I can provide some context, > however, in case that you weren't aware of it. It might help to create > a Real, Final, 100% Correct Fix ... something which does not exist right > now. > > The best workaround is to use "+scl false" and "+sfwi" with a value of > 500 or a bit smaller. See the discussion last month about it, > > > http://erlang.org/pipermail/erlang-questions/2014-September/081017.html > > My colleague Joe Blomstedt wrote a demo program that can cause scheduler > collapse to happen pretty quickly. It might be useful for judging how > well any fix works ... at Basho we had a terrible time trying to > reproduce this bug before Joe found a semi-reliable trigger. > > https://github.com/basho/nifwait > > It is discussed in this email thread (which is broken across two URLs, > sorry). > > http://erlang.org/pipermail/erlang-questions/2012-October/069503.html > (first message only, I don't know why) > http://erlang.org/pipermail/erlang-questions/2012-October/069585.html > (the rest of the thread) > > If your analysis is correct ... then hopefully this can lead quickly to > a Real, Final, 100% Correct Fix. I'm tired of diagnosing systems that > suffer scheduler collapse and then discover that the customer forgot to > add the magic +sfwi and +scl flags in their runtime configuration to > work around that !@#$! bug. > > -Scott > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Fri Oct 31 05:47:31 2014 From: zxq9@REDACTED (zxq9) Date: Fri, 31 Oct 2014 13:47:31 +0900 Subject: [erlang-questions] Looking for tricky protocol examples for verification research In-Reply-To: References: <30091.1414656461@snookles.snookles.com> Message-ID: <9261345.Oa5XLBjXf2@burrito> In other words, you want to define a contractual way that different processes can verify the external behavior of one another, instead of doing the actor version of duck typing that we tend to use all the time? If this is a runtime thing (and it would have to be in the case of empty processes which get assigned their behavior at runtime), then there would have to be a way to interrogate a process and ask it what messages it listens for and what the return type (if any) or side effects (if any) of receipt of those would be. Actually, it wouldn't be hard to write a framework or behavior that did exactly that. You would, as always, be depending on the programmer to not forget things and for processes to always tell the truth (consider the games we play with Dialyzer). Is this sort of what you are getting at? -Craig On Thursday 30 October 2014 17:43:51 Jonathan Schuster wrote: > More generally, I'm looking for the kinds of scenarios that one might use > contracts to specify in a non-concurrent world: instances in which you > expect some component you're interacting with to have a certain behavior, > so you specify that behavior in some way that the computer understands. My > hunch is that something similar could be useful for communication-focused > programs, but it's unclear what. It would be especially useful if anyone > points out in these examples "at line X of file Y, I want to state > invariant Z but have no way of doing so". > > From what I've seen, session types come closest to solving this problem, > but they tend to be overly restrictive, and it's not obvious how to apply > session types to actor-based programs, because session types assume that > channels are created separately from the processes that receive messages on > them. > > I'm especially interested in examples that expect a particular behavior > from PIDs sent as messages, since this adds an extra layer of complexity > not normally addressed in the classic communicating finite state machine > literature. Session types deal with this with what they call "carried > types", and I'm curious what other mechanisms I might be able to devise for > those situations. From chandrashekhar.mullaparthi@REDACTED Fri Oct 31 10:20:21 2014 From: chandrashekhar.mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Fri, 31 Oct 2014 09:20:21 -0000 Subject: [erlang-questions] Garbage collection Message-ID: <067901cff4eb$e68f5a00$b3ae0e00$@gmail.com> Hi all, I have a question about beam's GC implementation. When an erlang process is being GCed, is the processing required to do the GC taken out of the process's 2000 reduction quota, or is it done after a process has been scheduled out? regards, Chandru -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Fri Oct 31 10:37:29 2014 From: lukas@REDACTED (Lukas Larsson) Date: Fri, 31 Oct 2014 10:37:29 +0100 Subject: [erlang-questions] Garbage collection In-Reply-To: <067901cff4eb$e68f5a00$b3ae0e00$@gmail.com> References: <067901cff4eb$e68f5a00$b3ae0e00$@gmail.com> Message-ID: Hello, On Fri, Oct 31, 2014 at 10:20 AM, Chandrashekhar Mullaparthi < chandrashekhar.mullaparthi@REDACTED> wrote: > > > I have a question about beam?s GC implementation. When an erlang process > is being GCed, is the processing required to do the GC taken out of the > process?s 2000 reduction quota, or is it done after a process has been > scheduled out? > > > The GC work is taken out of the process' reductions. The GC is never triggered when it is scheduled out, but it can be triggered before being scheduled in, in which case the newly allotted reductions will be reduced by the GC work. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandrashekhar.mullaparthi@REDACTED Fri Oct 31 10:51:29 2014 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Fri, 31 Oct 2014 09:51:29 +0000 Subject: [erlang-questions] Garbage collection In-Reply-To: References: <067901cff4eb$e68f5a00$b3ae0e00$@gmail.com> Message-ID: Thank you Lukas. On 31 October 2014 09:37, Lukas Larsson wrote: > Hello, > > On Fri, Oct 31, 2014 at 10:20 AM, Chandrashekhar Mullaparthi < > chandrashekhar.mullaparthi@REDACTED> wrote: > >> >> >> I have a question about beam?s GC implementation. When an erlang process >> is being GCed, is the processing required to do the GC taken out of the >> process?s 2000 reduction quota, or is it done after a process has been >> scheduled out? >> >> >> > > The GC work is taken out of the process' reductions. The GC is never > triggered when it is scheduled out, but it can be triggered before being > scheduled in, in which case the newly allotted reductions will be reduced > by the GC work. > So what happens if the process has a large heap? Can the GC end up taking more time than to execute 2000 reductions? Or is it somehow time bounded? If it is not time bounded, it explains a lot of the problems I'm seeing on a system. regards, Chandru -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Fri Oct 31 11:01:54 2014 From: lukas@REDACTED (Lukas Larsson) Date: Fri, 31 Oct 2014 11:01:54 +0100 Subject: [erlang-questions] Garbage collection In-Reply-To: References: <067901cff4eb$e68f5a00$b3ae0e00$@gmail.com> Message-ID: On Fri, Oct 31, 2014 at 10:51 AM, Chandru < chandrashekhar.mullaparthi@REDACTED> wrote: > Thank you Lukas. > > On 31 October 2014 09:37, Lukas Larsson wrote: > >> Hello, >> >> On Fri, Oct 31, 2014 at 10:20 AM, Chandrashekhar Mullaparthi < >> chandrashekhar.mullaparthi@REDACTED> wrote: >> >>> >>> >>> I have a question about beam?s GC implementation. When an erlang process >>> is being GCed, is the processing required to do the GC taken out of the >>> process?s 2000 reduction quota, or is it done after a process has been >>> scheduled out? >>> >>> >>> >> >> The GC work is taken out of the process' reductions. The GC is never >> triggered when it is scheduled out, but it can be triggered before being >> scheduled in, in which case the newly allotted reductions will be reduced >> by the GC work. >> > > So what happens if the process has a large heap? Can the GC end up taking > more time than to execute 2000 reductions? Or is it somehow time bounded? > If it is not time bounded, it explains a lot of the problems I'm seeing on > a system. > The current GC is not incremental, so once it has started doing work it cannot be interrupted. This means that if a process has a large heap it will block all other execution on that scheduler for the GC duration. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandrashekhar.mullaparthi@REDACTED Fri Oct 31 11:06:16 2014 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Fri, 31 Oct 2014 10:06:16 +0000 Subject: [erlang-questions] Garbage collection In-Reply-To: References: <067901cff4eb$e68f5a00$b3ae0e00$@gmail.com> Message-ID: On 31 October 2014 10:01, Lukas Larsson wrote: > On Fri, Oct 31, 2014 at 10:51 AM, Chandru < > chandrashekhar.mullaparthi@REDACTED> wrote: > >> Thank you Lukas. >> >> On 31 October 2014 09:37, Lukas Larsson wrote: >> >>> Hello, >>> >>> On Fri, Oct 31, 2014 at 10:20 AM, Chandrashekhar Mullaparthi < >>> chandrashekhar.mullaparthi@REDACTED> wrote: >>> >>>> >>>> >>>> I have a question about beam?s GC implementation. When an erlang >>>> process is being GCed, is the processing required to do the GC taken out of >>>> the process?s 2000 reduction quota, or is it done after a process has been >>>> scheduled out? >>>> >>>> >>>> >>> >>> The GC work is taken out of the process' reductions. The GC is never >>> triggered when it is scheduled out, but it can be triggered before being >>> scheduled in, in which case the newly allotted reductions will be reduced >>> by the GC work. >>> >> >> So what happens if the process has a large heap? Can the GC end up taking >> more time than to execute 2000 reductions? Or is it somehow time bounded? >> If it is not time bounded, it explains a lot of the problems I'm seeing on >> a system. >> > > The current GC is not incremental, so once it has started doing work it > cannot be interrupted. This means that if a process has a large heap it > will block all other execution on that scheduler for the GC duration. > Can it also block other schedulers by any chance? Robert Virding's presentation [1] says that every 20-40k reductions, a new master scheduler is chosen. I'm wondering if this transition of master scheduler has to happen while one of the scheduler's is stuck in a long GC, will it potentially block other schedulers? regards, Chandru [1] http://www.erlang-factory.com/upload/presentations/708/HitchhikersTouroftheBEAM.pdf -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Fri Oct 31 11:49:13 2014 From: lukas@REDACTED (Lukas Larsson) Date: Fri, 31 Oct 2014 11:49:13 +0100 Subject: [erlang-questions] Garbage collection In-Reply-To: References: <067901cff4eb$e68f5a00$b3ae0e00$@gmail.com> Message-ID: On Fri, Oct 31, 2014 at 11:06 AM, Chandru < chandrashekhar.mullaparthi@REDACTED> wrote: > > On 31 October 2014 10:01, Lukas Larsson wrote: > >> On Fri, Oct 31, 2014 at 10:51 AM, Chandru < >> chandrashekhar.mullaparthi@REDACTED> wrote: >> >>> Thank you Lukas. >>> >>> On 31 October 2014 09:37, Lukas Larsson wrote: >>> >>>> Hello, >>>> >>>> On Fri, Oct 31, 2014 at 10:20 AM, Chandrashekhar Mullaparthi < >>>> chandrashekhar.mullaparthi@REDACTED> wrote: >>>> >>>>> >>>>> >>>>> I have a question about beam?s GC implementation. When an erlang >>>>> process is being GCed, is the processing required to do the GC taken out of >>>>> the process?s 2000 reduction quota, or is it done after a process has been >>>>> scheduled out? >>>>> >>>>> >>>>> >>>> >>>> The GC work is taken out of the process' reductions. The GC is never >>>> triggered when it is scheduled out, but it can be triggered before being >>>> scheduled in, in which case the newly allotted reductions will be reduced >>>> by the GC work. >>>> >>> >>> So what happens if the process has a large heap? Can the GC end up >>> taking more time than to execute 2000 reductions? Or is it somehow time >>> bounded? If it is not time bounded, it explains a lot of the problems I'm >>> seeing on a system. >>> >> >> The current GC is not incremental, so once it has started doing work it >> cannot be interrupted. This means that if a process has a large heap it >> will block all other execution on that scheduler for the GC duration. >> > > Can it also block other schedulers by any chance? Robert Virding's > presentation [1] says that every 20-40k reductions, a new master scheduler > is chosen. I'm wondering if this transition of master scheduler has to > happen while one of the scheduler's is stuck in a long GC, will it > potentially block other schedulers? > > It can result in schedulers not waking up properly, for the same reasons as long running nifs/bifs causes this. So if this is you problem I would have a look at which processes are using a lot of heap space and try to reduce it, or make sure that they do not GC :) Scott has collected a bunch of his observations on the long running nifs/bifs issue here: https://github.com/slfritchie/nifwait/blob/md5/README.md. Sometime in the not too distant future I hope to have the time to write an incremental GC for large Erlang heaps, but in the meantime I believe Scott recommends using something like "+sfwi 500 +scl false" in order to avoid this problem. Try them out and see if the options work for you. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandrashekhar.mullaparthi@REDACTED Fri Oct 31 11:54:47 2014 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Fri, 31 Oct 2014 10:54:47 +0000 Subject: [erlang-questions] Garbage collection In-Reply-To: References: <067901cff4eb$e68f5a00$b3ae0e00$@gmail.com> Message-ID: On 31 October 2014 10:49, Lukas Larsson wrote: > On Fri, Oct 31, 2014 at 11:06 AM, Chandru < > chandrashekhar.mullaparthi@REDACTED> wrote: > >> >> On 31 October 2014 10:01, Lukas Larsson wrote: >> >>> On Fri, Oct 31, 2014 at 10:51 AM, Chandru < >>> chandrashekhar.mullaparthi@REDACTED> wrote: >>> >>>> Thank you Lukas. >>>> >>>> On 31 October 2014 09:37, Lukas Larsson wrote: >>>> >>>>> Hello, >>>>> >>>>> On Fri, Oct 31, 2014 at 10:20 AM, Chandrashekhar Mullaparthi < >>>>> chandrashekhar.mullaparthi@REDACTED> wrote: >>>>> >>>>>> >>>>>> >>>>>> I have a question about beam?s GC implementation. When an erlang >>>>>> process is being GCed, is the processing required to do the GC taken out of >>>>>> the process?s 2000 reduction quota, or is it done after a process has been >>>>>> scheduled out? >>>>>> >>>>>> >>>>>> >>>>> >>>>> The GC work is taken out of the process' reductions. The GC is never >>>>> triggered when it is scheduled out, but it can be triggered before being >>>>> scheduled in, in which case the newly allotted reductions will be reduced >>>>> by the GC work. >>>>> >>>> >>>> So what happens if the process has a large heap? Can the GC end up >>>> taking more time than to execute 2000 reductions? Or is it somehow time >>>> bounded? If it is not time bounded, it explains a lot of the problems I'm >>>> seeing on a system. >>>> >>> >>> The current GC is not incremental, so once it has started doing work it >>> cannot be interrupted. This means that if a process has a large heap it >>> will block all other execution on that scheduler for the GC duration. >>> >> >> Can it also block other schedulers by any chance? Robert Virding's >> presentation [1] says that every 20-40k reductions, a new master scheduler >> is chosen. I'm wondering if this transition of master scheduler has to >> happen while one of the scheduler's is stuck in a long GC, will it >> potentially block other schedulers? >> >> > It can result in schedulers not waking up properly, for the same reasons > as long running nifs/bifs causes this. So if this is you problem I would > have a look at which processes are using a lot of heap space and try to > reduce it, or make sure that they do not GC :) > Thanks for the confirmation, and yes of course. I'm trying to convince someone that it isn't GC which is the problem, but its the system design ;-) Knowing exactly how it works helps in the argument. > > Scott has collected a bunch of his observations on the long running > nifs/bifs issue here: > https://github.com/slfritchie/nifwait/blob/md5/README.md. Sometime in the > not too distant future I hope to have the time to write an incremental GC > for large Erlang heaps, but in the meantime I believe Scott recommends > using something like "+sfwi 500 +scl false" in order to avoid this problem. > Try them out and see if the options work for you. > Thanks, I'll give them a try. cheers Chandru -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Fri Oct 31 13:25:07 2014 From: henrik@REDACTED (Henrik Nord) Date: Fri, 31 Oct 2014 13:25:07 +0100 Subject: [erlang-questions] New Script for Github pulls! Message-ID: <54537FA3.1000606@erlang.org> Hello! Finally the new version of the OTP-Maintainer is live. This might add some spam initially, but this is just the first sweep of all the current (open) pull requests. After this initial run, we should only see one post per SHA value. If there is no update to your branch there should not be any new posts from the bot. There will hopefully be some clarification as to in what stage the patch failed the building process, if that is the case. -- /Henrik Nord Erlang/OTP From schuster@REDACTED Fri Oct 31 16:14:15 2014 From: schuster@REDACTED (Jonathan Schuster) Date: Fri, 31 Oct 2014 11:14:15 -0400 Subject: [erlang-questions] Looking for tricky protocol examples for verification research In-Reply-To: <9261345.Oa5XLBjXf2@burrito> References: <30091.1414656461@snookles.snookles.com> <9261345.Oa5XLBjXf2@burrito> Message-ID: On Fri, Oct 31, 2014 at 12:47 AM, zxq9 wrote: > In other words, you want to define a contractual way that different > processes > can verify the external behavior of one another, instead of doing the actor > version of duck typing that we tend to use all the time? > It wouldn't be so much the processes verifying each other, but some overarching part of the runtime, or perhaps an analysis tool that verifies the "contract" for each process. Think of a type system: the type checker verifies that every function has the right type, and then a programmer who uses the function can be confident that the result of the function will be what they expect. I'm not saying I want to invent a type system, but I want to enable a similar style of reasoning for concurrent programs, where a programmer can just assume that another process acts in a certain way because that behavior is checked by another mechanism. Contracts in Racket ( http://docs.racket-lang.org/guide/contracts.html) also enable this kind of reasoning, although with enforcement happening at run-time. I'm not sure what you mean by the "actor version" of duck typing, though. Could you expand on that, or point me towards an example? > If this is a runtime thing (and it would have to be in the case of empty > processes which get assigned their behavior at runtime), then there would > have > to be a way to interrogate a process and ask it what messages it listens > for > and what the return type (if any) or side effects (if any) of receipt of > those > would be. Actually, it wouldn't be hard to write a framework or behavior > that > did exactly that. You would, as always, be depending on the programmer to > not > forget things and for processes to always tell the truth (consider the > games > we play with Dialyzer). > Again, I'm thinking of something closer to types or contracts where we don't assume the programmer always specifies the right behavior: any "wrong" behavior by the program would (ideally) be detected and reported. Really, though, I'm not sure exactly what kind of solution I'm targeting yet. I've observed that it's generally difficult to do the kind of reasoning I'd like to do in languages like Erlang, and I'm currently looking for concrete examples of this kind of problem. Then the plan is to study those examples, try to find a common pattern, and figure out what a useful solution would be. Without concrete examples, it's difficult to know if I'm solving the right problem. Regarding Dialyzer, I haven't actually used it myself, although I've read about it. Can you tell me more about what kinds of games you have to play with it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Fri Oct 31 17:20:04 2014 From: zxq9@REDACTED (zxq9) Date: Sat, 01 Nov 2014 01:20:04 +0900 Subject: [erlang-questions] Looking for tricky protocol examples for verification research In-Reply-To: References: <9261345.Oa5XLBjXf2@burrito> Message-ID: <8536865.C0t6tqKRTt@changa> On 2014?10?31? ??? 11:14:15 you wrote: > On Fri, Oct 31, 2014 at 12:47 AM, zxq9 wrote: > > In other words, you want to define a contractual way that different > > processes > > can verify the external behavior of one another, instead of doing the > > actor > > version of duck typing that we tend to use all the time? > > It wouldn't be so much the processes verifying each other, but some > overarching part of the runtime, or perhaps an analysis tool that verifies > the "contract" for each process. Think of a type system: the type checker > verifies that every function has the right type, and then a programmer who > uses the function can be confident that the result of the function will be > what they expect. I'm not saying I want to invent a type system, but I want > to enable a similar style of reasoning for concurrent programs, where a > programmer can just assume that another process acts in a certain way > because that behavior is checked by another mechanism. Contracts in Racket ( > http://docs.racket-lang.org/guide/contracts.html) also enable this kind of > reasoning, although with enforcement happening at run-time. > > I'm not sure what you mean by the "actor version" of duck typing, though. > Could you expand on that, or point me towards an example? In a duck typed language like Python we can treat anything as some type if it implements the basic methods expected of that type. An outside process doesn't need to care (sure we could introspect, but needing to is usually regarded as a sign of using the wrong tool). Erlang processes can be thought of the same way if we accept that in Erlang "process" means something much closer to what languages like Python mean by "object" than is commonly imagined. If I have a game character process it might have an AI controller, or it might have a player controller. The character process doesn't need to know or care, and we could actively swap out AI for player control on the fly and the character process wouldn't care, so long as all controllers, regardless of subtype (if we decide to use this term "type"), adhere to the "controller" protocol. Erlang lacks inheritance, so this talk of types is often limited to mean "a particular sort of Erlang term()", but in some sense protocol definitions are interface definitions that parallel duck typing very closely. This is true of any network API as well, actually, hence the loose coupling enjoyed by network components that communicate via bland protocols (as opposed to overly rich ones nobody bothers to implement). I think the main issue here is that most protocols internal to Erlang programs are informally specified, if at all. The closest thing I see to a contract system governing message protocols is Erlang behavior definitions. Come to think of it, Erlang behavior definitions might be a good place look for inspiration with regard to a message protocol contract system. They mandate callback function definitions, but those callback functions are required to adhere to certain protocol expectations which are handled directly (received/emitted) by functions defined in the governing module of the behavior. These modules could be seen as describing (but not defining on their own) a message protocol that could be enforced by contract. Properly -spec'd functions would contain the information needed in most cases, but there are probably some weird edges there. The only ones necessary to evaluate would be the ones mandated by the behavior module (in practice that is mostly true, but this is not explicit -- it is not necessary that everything demanded by a behavior be ultimately message related). Blah. I wrote this thinking through it as I typed, so there's almost certainly something ridiculous up there. But basically it should be possible to extend behaviors or add something very similar to them that would do what you want. The problem is that the compiler will care but not the runtime, and this is a very different problem. -Craig From daniel.goertzen@REDACTED Fri Oct 31 21:33:33 2014 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Fri, 31 Oct 2014 15:33:33 -0500 Subject: [erlang-questions] dirty scheduler segfault Message-ID: I am seeing a segfault that seems to be related to dirty schedulers. I've reduced the fault to the erlang and C nif module below which executes the same nif with either the io dirty scheduler, the cpu dirty scheduler, or the normal erlang scheduler. When I start the emulator and run either dirty nif, I get a segfault. ( see https://gist.github.com/goertzenator/6237e0200a5f7bf22976) The non-dirty nif works properly, and If I run the non-dirty nif first then subsequent calls to the dirty nifs work fine. Also, if I reduce the nif list length from 11 to 10, the dirty nifs work on the first go. Is there a bug here or am I doing something dumb? Thanks, Dan. -module(dlibusb). -author("goertzen"). -on_load(init/0). -include_lib("eunit/include/eunit.hrl"). -export([mytest_io/0, mytest_cpu/0, mytest_none/0]). mytest_io() -> erlang:nif_error(nif_library_not_loaded). mytest_cpu() -> erlang:nif_error(nif_library_not_loaded). mytest_none() -> erlang:nif_error(nif_library_not_loaded). init() -> PrivDir = code:priv_dir(dlibusb), Lib = filename:join([PrivDir, "dlibusb"]), ok = erlang:load_nif(Lib, 0). #include int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info) { return 0; } void unload(ErlNifEnv* env, void* priv_data) { } ERL_NIF_TERM mytest(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) { const int cnt=11; // doesn't segfault if cnt=10 ERL_NIF_TERM arr[cnt]; ERL_NIF_TERM atom_ok; atom_ok = enif_make_atom(env, "ok"); for(int i=0; i From vinoski@REDACTED Fri Oct 31 22:05:16 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Fri, 31 Oct 2014 17:05:16 -0400 Subject: [erlang-questions] dirty scheduler segfault In-Reply-To: References: Message-ID: On Fri, Oct 31, 2014 at 4:33 PM, Daniel Goertzen wrote: > I am seeing a segfault that seems to be related to dirty schedulers. I've > reduced the fault to the erlang and C nif module below which executes the > same nif with either the io dirty scheduler, the cpu dirty scheduler, or > the normal erlang scheduler. > > > When I start the emulator and run either dirty nif, I get a segfault. ( > see https://gist.github.com/goertzenator/6237e0200a5f7bf22976) > I found it hard to make sense of what's in that gist due to the formatting, so I took your code and built it myself. When I ran it, it failed in your NIF load function, but it failed in a way that didn't make sense because all your function does is return 0. Then I realized none of your C functions were declared static, which means they are global, and I suspected your load() function was clashing with some other function of the same name. I made all your C functions static, rebuilt, and then ran everything and it seems like it worked: > c(dlibusb). Reading symbols for shared libraries . done {ok,dlibusb} 2> dlibusb:mytest_cpu(). [ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok] 3> dlibusb:mytest_io(). [ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok] 4> dlibusb:mytest_none(). [ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok] --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From flexchap@REDACTED Fri Oct 31 23:14:36 2014 From: flexchap@REDACTED (Peter Johansson) Date: Fri, 31 Oct 2014 23:14:36 +0100 Subject: [erlang-questions] Fwd: Erlang "memory economics" & pointers pointing to other pointers In-Reply-To: References: Message-ID: Hi there fellow Erlang-developers/users ! I have been using Erlang in a project of mine for a couple of months (4 - 5) now ( coming from a 10 years Java & Python developer-background ) .....after having evaluating/investigating the language and its runtime-system first during some 1 - 2 months before the decision was taken that it address/suits my set of concluded needs very well indeed ( thumbs up for that :-) ). I'm directing these following few issues/questions towards, firstly/primarily, persons on the list which are members of or closely involved/related with the teams behind erlang.org and/or Erlang/OTP at Ericsson. The Erlang VM/architecture, as understood by me, aims/strives for keeping the amounts/occurrences of memory-copy operations to as low as possible. Natural exceptions to that being message-passing between processes .....and I/O - receive/write operations. My first and primary wondering ( or search for clarification on assumptions ....if you like ) is: ..... do this principle yields from the very first point of local existence ( loaded modules, function-declarations ) ?? If I have say .... a list and a IOlist with elements of deterministic data: List = "blablabla". IOList = [<<"bla">>, <<"bla">>, <<"bla">>]. Will List and IOlist be setup, within the heap-stack of an individual process, as pointers to the original memory-spaces of the lists from the module-load ?? .....If these lists are used as included parts in later constructs .......will there then be new pointers setup in the process's heap-stack pointing to the previous ones ?? Does this mechanism ( if it exist as of above ) re-emerge down/up through all the functional/operational levels of the process ( with socket-IO as the entry/exit-point ) ?? Does this mechanism ( if it exist as of above ) yields for all Erlang's data/term-types .....or is any of those excluded from it ?? If the mechanism exists as assumed so far ....the " in-mutative data-carrier " - property of Erlang becomes obvious/logical understandable for both performance & data-consistency reasons as I perceive the situation in a wider/extended context. An implication become that all concurrent processes within the node shares all originally deterministic data written to memory during module loads !? As an example ....everything assumed/concluded from this point on would essentially form the whole underlying foundation/reason for why the third-part library / module collection "ErlyDTL" is considered an attractive & high-performing tool for Output/Web- templating. It compiles templates to Erlang modules which then render their outputs from, as I have understood it, special IOlist-constructs holding alternating patterns/sequences of binaries ( fixed text part of original template ) & Funs ( injection/condition/iterator - statements of original template ). Only the outputs from these Funs then needs to be allocated/written into the heap-stack of the present process. Any further/later inclusive use of the result from the render-operation will, once again, cause new pointers - to - pointers to be setup in the process heap-stack. Under the condition that I have assumed/interpreted/understand this situation correctly ....I think ...indeed ...it should be formalized into a descriptive/introductory piece of information and put in a "front-line" / "early chapter" place/position within the official Erlang/OTP documentation .... as it truly illustrates something that makes Erlang stand out extensively in relation to most other high-level languages. My practical impressions & experience of this language so far have been exclusively rewarding, encouraging & idea-producing for all the "next to come" motivations/objectives in my present time project. Sending my best regards for now / Peter flexchap at gmail dot com -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.polvorin@REDACTED Fri Oct 31 23:45:31 2014 From: pablo.polvorin@REDACTED (Pablo Polvorin) Date: Fri, 31 Oct 2014 19:45:31 -0300 Subject: [erlang-questions] Fwd: Erlang "memory economics" & pointers pointing to other pointers In-Reply-To: References: Message-ID: You might want to read http://www.erlang.org/doc/efficiency_guide/processes.html#8.2.1 , the section on "constant pool" On 31 October 2014 19:14, Peter Johansson wrote: > > Hi there fellow Erlang-developers/users ! > > I have been using Erlang in a project of mine for a couple of months (4 - 5) > now ( coming from a 10 years Java & Python developer-background ) .....after > having evaluating/investigating the language and its runtime-system first > during some 1 - 2 months before the decision was taken that it address/suits > my set of concluded needs very well indeed ( thumbs up for that :-) ). > > I'm directing these following few issues/questions towards, > firstly/primarily, persons on the list which are members of or closely > involved/related with the teams behind erlang.org and/or Erlang/OTP at > Ericsson. > > > The Erlang VM/architecture, as understood by me, aims/strives for keeping > the amounts/occurrences of memory-copy operations to as low as possible. > Natural exceptions to that being message-passing between processes .....and > I/O - receive/write operations. > > My first and primary wondering ( or search for clarification on assumptions > ....if you like ) is: ..... do this principle yields from the very first > point of local existence ( loaded modules, function-declarations ) ?? > > If I have say .... a list and a IOlist with elements of deterministic data: > > List = "blablabla". > IOList = [<<"bla">>, <<"bla">>, <<"bla">>]. > > Will List and IOlist be setup, within the heap-stack of an individual > process, as pointers to the original memory-spaces of the lists from the > module-load ?? > > .....If these lists are used as included parts in later constructs > .......will there then be new pointers setup in the process's heap-stack > pointing to the previous ones ?? > > Does this mechanism ( if it exist as of above ) re-emerge down/up through > all the functional/operational levels of the process ( with socket-IO as the > entry/exit-point ) ?? > > Does this mechanism ( if it exist as of above ) yields for all Erlang's > data/term-types .....or is any of those excluded from it ?? > > > If the mechanism exists as assumed so far ....the " in-mutative data-carrier > " - property of Erlang becomes obvious/logical understandable for both > performance & data-consistency reasons as I perceive the situation in a > wider/extended context. An implication become that all concurrent processes > within the node shares all originally deterministic data written to memory > during module loads !? > > As an example ....everything assumed/concluded from this point on would > essentially form the whole underlying foundation/reason for why the > third-part library / module collection "ErlyDTL" is considered an attractive > & high-performing tool for Output/Web- templating. It compiles templates to > Erlang modules which then render their outputs from, as I have understood > it, special IOlist-constructs holding alternating patterns/sequences of > binaries ( fixed text part of original template ) & Funs ( > injection/condition/iterator - statements of original template ). Only the > outputs from these Funs then needs to be allocated/written into the > heap-stack of the present process. Any further/later inclusive use of the > result from the render-operation will, once again, cause new pointers - to - > pointers to be setup in the process heap-stack. > > > Under the condition that I have assumed/interpreted/understand this > situation correctly ....I think ...indeed ...it should be formalized into a > descriptive/introductory piece of information and put in a "front-line" / > "early chapter" place/position within the official Erlang/OTP documentation > .... as it truly illustrates something that makes Erlang stand out > extensively in relation to most other high-level languages. > > My practical impressions & experience of this language so far have been > exclusively rewarding, encouraging & idea-producing for all the "next to > come" motivations/objectives in my present time project. > > Sending my best regards for now / Peter flexchap at gmail dot com > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Pablo Polvorin ProcessOne